[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Check function definitions for the same variable name

2017-12-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398678 )

Change subject: Check function definitions for the same variable name
..

Check function definitions for the same variable name

Bug: T164653
Change-Id: I554eb87c68ce51f1665d094d2df5e9eab085cc27
---
M MediaWiki/ruleset.xml
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/MediaWiki/ruleset.xml b/MediaWiki/ruleset.xml
index bdabe2e..c97adf5 100644
--- a/MediaWiki/ruleset.xml
+++ b/MediaWiki/ruleset.xml
@@ -89,6 +89,7 @@



+   




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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I554eb87c68ce51f1665d094d2df5e9eab085cc27
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
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...codesniffer[master]: Require that an explicit visiblity is set on methods and pro...

2017-12-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398679 )

Change subject: Require that an explicit visiblity is set on methods and 
properties
..

Require that an explicit visiblity is set on methods and properties

Bug: T164653
Change-Id: Iaf101675447b2ecd9dd2b5a4eac8a2d28886b1a4
---
M MediaWiki/Tests/files/Usage/dir_usage.php
M MediaWiki/Tests/files/Usage/dir_usage.php.fixed
M MediaWiki/ruleset.xml
3 files changed, 10 insertions(+), 8 deletions(-)


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

diff --git a/MediaWiki/Tests/files/Usage/dir_usage.php 
b/MediaWiki/Tests/files/Usage/dir_usage.php
index bdca741..55d9040 100644
--- a/MediaWiki/Tests/files/Usage/dir_usage.php
+++ b/MediaWiki/Tests/files/Usage/dir_usage.php
@@ -5,14 +5,14 @@
/**
 * @return void
 */
-   function __construct() {
+   public function __construct() {
}
 
/**
 * @param int $a Just for test.
 * @return string
 */
-   function dirname( $a ) {
+   public function dirname( $a ) {
return BAR::dirname( __FILE__ );
}
 
@@ -20,7 +20,7 @@
 * @param int $a Just for test.
 * @return string
 */
-   function foo( $a ) {
+   public function foo( $a ) {
return BAR::foo( __FILE__ );
}
 
@@ -28,7 +28,7 @@
 * @param int $a Just for test.
 * @return string
 */
-   function bar( $a ) {
+   public function bar( $a ) {
return BAR::bar( 0 );
}
 }
diff --git a/MediaWiki/Tests/files/Usage/dir_usage.php.fixed 
b/MediaWiki/Tests/files/Usage/dir_usage.php.fixed
index 9d48480..c5d356d 100644
--- a/MediaWiki/Tests/files/Usage/dir_usage.php.fixed
+++ b/MediaWiki/Tests/files/Usage/dir_usage.php.fixed
@@ -5,14 +5,14 @@
/**
 * @return void
 */
-   function __construct() {
+   public function __construct() {
}
 
/**
 * @param int $a Just for test.
 * @return string
 */
-   function dirname( $a ) {
+   public function dirname( $a ) {
return BAR::dirname( __FILE__ );
}
 
@@ -20,7 +20,7 @@
 * @param int $a Just for test.
 * @return string
 */
-   function foo( $a ) {
+   public function foo( $a ) {
return BAR::foo( __FILE__ );
}
 
@@ -28,7 +28,7 @@
 * @param int $a Just for test.
 * @return string
 */
-   function bar( $a ) {
+   public function bar( $a ) {
return BAR::bar( 0 );
}
 }
diff --git a/MediaWiki/ruleset.xml b/MediaWiki/ruleset.xml
index c97adf5..4d957e7 100644
--- a/MediaWiki/ruleset.xml
+++ b/MediaWiki/ruleset.xml
@@ -92,6 +92,8 @@



+   
+   




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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf101675447b2ecd9dd2b5a4eac8a2d28886b1a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
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...codesniffer[master]: Add sniff for using is_int over is_integer

2017-12-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398677 )

Change subject: Add sniff for using is_int over is_integer
..

Add sniff for using is_int over is_integer

For consistency with our use of "int" everywhere instead of "integer".

Bug: T173175
Change-Id: Ifbdb8267b5500a5ae77a6ea4d3000625ad81fbc4
---
A MediaWiki/Sniffs/Usage/ShortIsIntUsageSniff.php
A MediaWiki/Tests/files/Usage/short_is_int_usage.php
A MediaWiki/Tests/files/Usage/short_is_int_usage.php.expect
A MediaWiki/Tests/files/Usage/short_is_int_usage.php.fixed
4 files changed, 96 insertions(+), 0 deletions(-)


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

diff --git a/MediaWiki/Sniffs/Usage/ShortIsIntUsageSniff.php 
b/MediaWiki/Sniffs/Usage/ShortIsIntUsageSniff.php
new file mode 100644
index 000..ee3a174
--- /dev/null
+++ b/MediaWiki/Sniffs/Usage/ShortIsIntUsageSniff.php
@@ -0,0 +1,81 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+namespace MediaWiki\Sniffs\Usage;
+
+use PHP_CodeSniffer\Files\File;
+use PHP_CodeSniffer\Sniffs\Sniff;
+
+class ShortIsIntUsageSniff implements Sniff {
+
+   /**
+* Function => Replacement
+*
+* @var string[]
+*/
+   private $functions = [
+   'is_integer' => 'is_int',
+   ];
+
+   /**
+* @return array
+*/
+   public function register() {
+   return [ T_STRING ];
+   }
+
+   /**
+* @param File $phpcsFile File object.
+* @param int $stackPtr The current token index.
+* @return void
+*/
+   public function process( File $phpcsFile, $stackPtr ) {
+   $tokens = $phpcsFile->getTokens();
+
+   // Check if the function is one of the bad ones
+   $funcName = $tokens[$stackPtr]['content'];
+   if ( !isset( $this->functions[$funcName] ) ) {
+   return;
+   }
+
+   $ignore = [
+   T_DOUBLE_COLON => true,
+   T_OBJECT_OPERATOR => true,
+   T_FUNCTION => true,
+   T_CONST => true,
+   ];
+
+   // Check to make sure it's a PHP function (not $this->, etc.)
+   $prevToken = $phpcsFile->findPrevious( T_WHITESPACE, ( 
$stackPtr - 1 ), null, true );
+   if ( isset( $ignore[$tokens[$prevToken]['code']] ) ) {
+   return;
+   }
+
+   $replacement = $this->functions[$funcName];
+   $fix = $phpcsFile->addFixableWarning(
+   "Use $replacement() instead of $funcName",
+   $stackPtr,
+   $funcName
+   );
+   if ( $fix ) {
+   $phpcsFile->fixer->replaceToken( $stackPtr, 
$replacement );
+   }
+   }
+}
diff --git a/MediaWiki/Tests/files/Usage/short_is_int_usage.php 
b/MediaWiki/Tests/files/Usage/short_is_int_usage.php
new file mode 100644
index 000..329ef36
--- /dev/null
+++ b/MediaWiki/Tests/files/Usage/short_is_int_usage.php
@@ -0,0 +1,6 @@
+is_integer( 14 );
diff --git a/MediaWiki/Tests/files/Usage/short_is_int_usage.php.expect 
b/MediaWiki/Tests/files/Usage/short_is_int_usage.php.expect
new file mode 100644
index 000..7e21cf2
--- /dev/null
+++ b/MediaWiki/Tests/files/Usage/short_is_int_usage.php.expect
@@ -0,0 +1,3 @@
+ 4 | WARNING | [x] Use is_int() instead of is_integer
+   | | (MediaWiki.Usage.ShortIsIntUsage.is_integer)
+PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
diff --git a/MediaWiki/Tests/files/Usage/short_is_int_usage.php.fixed 
b/MediaWiki/Tests/files/Usage/short_is_int_usage.php.fixed
new file mode 100644
index 000..232ea33
--- /dev/null
+++ b/MediaWiki/Tests/files/Usage/short_is_int_usage.php.fixed
@@ -0,0 +1,6 @@
+is_integer( 14 );

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

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

[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: WIP: Linter: Properly attribute lint issues in cite extension

2017-12-16 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398676 )

Change subject: WIP: Linter: Properly attribute lint issues in cite extension
..

WIP: Linter: Properly attribute lint issues in cite extension

* ref content ends up in references section and when references
  is templated, this throws off the linter attribution code.

* mocha tests added.

Change-Id: Ic84f6fa26e1c4b63f744587ff13c44e5e61bdd3c
---
M lib/wt2html/pp/processors/linter.js
M tests/mocha/linter.js
2 files changed, 67 insertions(+), 17 deletions(-)


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

diff --git a/lib/wt2html/pp/processors/linter.js 
b/lib/wt2html/pp/processors/linter.js
index 47bb13c..71b73bf 100644
--- a/lib/wt2html/pp/processors/linter.js
+++ b/lib/wt2html/pp/processors/linter.js
@@ -957,7 +957,7 @@
}
 }
 
-function findLints(root, env, tplInfo) {
+function findLints(root, env, tplInfoStack) {
var node = root.firstChild;
while (node !== null) {
if (!DU.isElt(node)) {
@@ -965,37 +965,52 @@
continue;
}
 
-   // Identify the first template/extension node.
-   // You'd think the !tplInfo check isn't necessary since
-   // we don't have nested transclusions, however, you can
-   // get extensions in transclusions.
-   if (!tplInfo && DU.isFirstEncapsulationWrapperNode(node)) {
+   // Maintain a stack of templated info because extensions
+   // can templated and those extensions can, in turn, use 
templates.
+   //
+   //foo {{1x|x}}
+   //{{1x|  }}
+   //
+   var currTplInfo = JSUtils.lastItem(tplInfoStack);
+   if (DU.isFirstEncapsulationWrapperNode(node)) {
var about = node.getAttribute("about");
-   tplInfo = {
+   currTplInfo = {
first: node,
last: 
JSUtils.lastItem(DU.getAboutSiblings(node, about)),
dsr: DU.getDataParsoid(node).dsr,
clear: false,
+   typeof: node.getAttribute('typeof'),
};
+   tplInfoStack.push(currTplInfo);
+   }
+
+   // FIXME: Special hack for Cite extension
+   if (currTplInfo && 
/\bmw:Extension\/references\b/.test(currTplInfo.typeof)) {
+   var dp = DU.getDataParsoid(node);
+   // FIXME: fiwiki: Aspartaami crashes here because 
currTplInfo.dsr is null!
+   if (dp.dsr && dp.dsr[1] <= currTplInfo.dsr[0]) {
+   currTplInfo = null;
+   }
}
 
// Lint this node
-   var nextNode = logWikitextFixups(node, env, tplInfo);
-   if (tplInfo && tplInfo.clear) {
-   tplInfo = null;
+   var nextNode = logWikitextFixups(node, env, currTplInfo);
+   if (currTplInfo && currTplInfo.clear) {
+   tplInfoStack.pop();
}
 
// Lint subtree
-   if (!nextNode) {
-   findLints(node, env, tplInfo);
-   nextNode = node.nextSibling;
+   // FIXME: Special optimization for Cite extension
+   // (Skip  linkbacks since they are Parsoid-generated)
+   if (!nextNode && (!currTplInfo || 
!/\bmw:Extension\/ref\b/.test(currTplInfo.typeof))) {
+   findLints(node, env, tplInfoStack);
}
 
-   if (tplInfo && tplInfo.last === node) {
-   tplInfo = null;
+   if (currTplInfo && currTplInfo.last === node) {
+   tplInfoStack.pop();
}
 
-   node = nextNode;
+   node = nextNode || node.nextSibling;
}
 }
 
@@ -1006,7 +1021,7 @@
return;
}
 
-   findLints(body, env);
+   findLints(body, env, []);
postProcessLints(env.lintLogger.buffer);
 }
 
diff --git a/tests/mocha/linter.js b/tests/mocha/linter.js
index 55e1019..8f2eb81 100644
--- a/tests/mocha/linter.js
+++ b/tests/mocha/linter.js
@@ -937,4 +937,39 @@
return expectEmptyResults("a 
\nb\n ");
});
});
+   describe('LINT ISSUES IN  TAGS', function() {
+   it('should attribute linter issues to the ref tag', function() {
+   return parseWT('a x 
').then(function(result) {
+   result.should.have.length(1);
+   result[0].should.have.a.property("type", 

[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Move linting pass to the very end

2017-12-16 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398674 )

Change subject: Move linting pass to the very end
..

Move linting pass to the very end

* This requires marker meta stripping to be moved to the end as well.

Change-Id: I74e8351065203ebc76aae505da91f6da3bc63816
---
M lib/wt2html/DOMPostProcessor.js
1 file changed, 21 insertions(+), 21 deletions(-)


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

diff --git a/lib/wt2html/DOMPostProcessor.js b/lib/wt2html/DOMPostProcessor.js
index 113073f..e0df1b6 100644
--- a/lib/wt2html/DOMPostProcessor.js
+++ b/lib/wt2html/DOMPostProcessor.js
@@ -177,31 +177,27 @@
domVisitor.addHandler(null, CleanUp.handleEmptyElements);
addPP('handleEmptyElts', domVisitor.traverse.bind(domVisitor));
 
+   domVisitor = new DOMTraverser(env);
+   var tableFixer = new TableFixups(env);
+   // 1. Deal with -hack and move trailing categories in s out of 
the list
+   domVisitor.addHandler('li', liFixups.handleLIHack);
+   domVisitor.addHandler('li', liFixups.migrateTrailingCategories);
+   // 2. Fix up issues from templated table cells and table cell attributes
+   domVisitor.addHandler('td', tableFixer.stripDoubleTDs.bind(tableFixer));
+   domVisitor.addHandler('td', 
tableFixer.handleTableCellTemplates.bind(tableFixer));
+   domVisitor.addHandler('th', 
tableFixer.handleTableCellTemplates.bind(tableFixer));
+   // 3. Add heading anchors
+   domVisitor.addHandler(null, headings.genAnchors);
+   addPP('(li+table)Fixups+headings', 
domVisitor.traverse.bind(domVisitor));
+
+   // Add  wrappers around sections
+   addPP('wrapSections', wrapSections);
+
if (env.conf.parsoid.linting) {
domVisitor = new DOMTraverser(env);
domVisitor.addHandler(null, linter.logWikitextFixups);
addPP('linter', domVisitor.traverse.bind(domVisitor));
}
-
-   domVisitor = new DOMTraverser(env);
-   var tableFixer = new TableFixups(env);
-   // 1. Strip marker metas -- removes left over marker metas (ex: metas
-   //nested in expanded tpl/extension output).
-   domVisitor.addHandler('meta',
-   CleanUp.stripMarkerMetas.bind(null, 
env.conf.parsoid.rtTestMode));
-   // 2. Deal with -hack and move trailing categories in s out of 
the list
-   domVisitor.addHandler('li', liFixups.handleLIHack);
-   domVisitor.addHandler('li', liFixups.migrateTrailingCategories);
-   // 3. Fix up issues from templated table cells and table cell attributes
-   domVisitor.addHandler('td', tableFixer.stripDoubleTDs.bind(tableFixer));
-   domVisitor.addHandler('td', 
tableFixer.handleTableCellTemplates.bind(tableFixer));
-   domVisitor.addHandler('th', 
tableFixer.handleTableCellTemplates.bind(tableFixer));
-   // 4. Add heading anchors
-   domVisitor.addHandler(null, headings.genAnchors);
-   addPP('stripMarkers+(li+table)Fixups+headings', 
domVisitor.traverse.bind(domVisitor));
-
-   // Add  wrappers around sections
-   addPP('wrapSections', wrapSections);
 
// Make heading IDs unique
domVisitor = new DOMTraverser(env);
@@ -240,7 +236,11 @@
}
return true;
});
-   addPP('heading id uniqueness', domVisitor.traverse.bind(domVisitor));
+   // Strip marker metas -- removes left over marker metas (ex: metas
+   // nested in expanded tpl/extension output).
+   domVisitor.addHandler('meta',
+   CleanUp.stripMarkerMetas.bind(null, 
env.conf.parsoid.rtTestMode));
+   addPP('heading id uniqueness + stripMarkerMetas', 
domVisitor.traverse.bind(domVisitor));
 
// Save data.parsoid into data-parsoid html attribute.
// Make this its own thing so that any changes to the DOM

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74e8351065203ebc76aae505da91f6da3bc63816
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...parsoid[master]: Make linter its own self-contained DOM pass

2017-12-16 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398675 )

Change subject: Make linter its own self-contained DOM pass
..

Make linter its own self-contained DOM pass

* This gives it more control over how to process the DOM and
  also how to handle template / extension information.

* A followup patch will leverage this to process references content
  differently for improved lint information for ref tags. Currently,
  when the references tag comes from a template, all lint errors in
  ref tags on the page are attributed to the template that generate
  the references tag which mightily confusing and useless.

Change-Id: I48f8e19e61752a0b37a801d3ce4cddfed6e802c4
---
M lib/wt2html/DOMPostProcessor.js
R lib/wt2html/pp/processors/linter.js
2 files changed, 60 insertions(+), 23 deletions(-)


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

diff --git a/lib/wt2html/DOMPostProcessor.js b/lib/wt2html/DOMPostProcessor.js
index e0df1b6..47e5df3 100644
--- a/lib/wt2html/DOMPostProcessor.js
+++ b/lib/wt2html/DOMPostProcessor.js
@@ -1,4 +1,4 @@
-/* Perform post-processing steps on an already-built HTML DOM. */
+/;* Perform post-processing steps on an already-built HTML DOM. */
 
 'use strict';
 
@@ -18,6 +18,7 @@
 };
 var markFosteredContent = requireProcessor('markFosteredContent');
 var handleUnbalancedTables = requireProcessor('handleUnbalancedTables');
+var linter = requireProcessor('linter');
 var markTreeBuilderFixups = requireProcessor('markTreeBuilderFixups');
 var normalize = requireProcessor('normalize');
 var cleanupFormattingTagFixup = requireProcessor('cleanupFormattingTagFixup');
@@ -33,7 +34,6 @@
return require('./pp/handlers/' + file + '.js');
 };
 
-var linter = requireHandlers('linter');
 var CleanUp = requireHandlers('cleanup');
 var headings = requireHandlers('headings');
 var unpackDOMFragments = 
requireHandlers('unpackDOMFragments').unpackDOMFragments;
@@ -194,9 +194,7 @@
addPP('wrapSections', wrapSections);
 
if (env.conf.parsoid.linting) {
-   domVisitor = new DOMTraverser(env);
-   domVisitor.addHandler(null, linter.logWikitextFixups);
-   addPP('linter', domVisitor.traverse.bind(domVisitor));
+   addPP('linter', linter);
}
 
// Make heading IDs unique
@@ -535,9 +533,6 @@
}
if (psd.dumpFlags && psd.dumpFlags.has('wt2html:limits')) {
env.printParserResourceUsage({ 'HTML Size': 
document.outerHTML.length });
-   }
-   if (env.conf.parsoid.linting) {
-   linter.postProcessLints(env.lintLogger.buffer);
}
}
 
diff --git a/lib/wt2html/pp/handlers/linter.js 
b/lib/wt2html/pp/processors/linter.js
similarity index 95%
rename from lib/wt2html/pp/handlers/linter.js
rename to lib/wt2html/pp/processors/linter.js
index c414d87..47bb13c 100644
--- a/lib/wt2html/pp/handlers/linter.js
+++ b/lib/wt2html/pp/processors/linter.js
@@ -15,6 +15,7 @@
 
 var DU = require('../../../utils/DOMUtils.js').DOMUtils;
 var Util = require('../../../utils/Util.js').Util;
+var JSUtils = require('../../../utils/jsutils.js').JSUtils;
 var Consts = require('../../../config/WikitextConstants.js').WikitextConstants;
 
 /* 
--
@@ -915,18 +916,7 @@
env.log('lint/multiline-html-table-in-list', lintObj);
 }
 
-function logWikitextFixups(node, env, atTopLevel, tplInfo) {
-   // For now, don't run linter in subpipelines.
-   // Only on the final DOM for the top-level page.
-   if (!atTopLevel || !DU.isElt(node)) {
-   return true;
-   }
-
-   // Skip linting if we cannot lint it
-   if (!env.page.hasLintableContentModel()) {
-   return true;
-   }
-
+function logWikitextFixups(node, env, tplInfo) {
var dp = DU.getDataParsoid(node);
 
/*
@@ -963,11 +953,63 @@
if (dp.fostered && !DU.emitsSolTransparentSingleLineWT(env, node, 
true)) {
return logFosteredContent(env, node, dp, tplInfo);
} else {
-   return true;
+   return null;
}
 }
 
+function findLints(root, env, tplInfo) {
+   var node = root.firstChild;
+   while (node !== null) {
+   if (!DU.isElt(node)) {
+   node = node.nextSibling;
+   continue;
+   }
+
+   // Identify the first template/extension node.
+   // You'd think the !tplInfo check isn't necessary since
+   // we don't have nested transclusions, however, you can
+   // get extensions in transclusions.
+   if (!tplInfo && DU.isFirstEncapsulationWrapperNode(node)) {
+   var about = 

[MediaWiki-commits] [Gerrit] mediawiki...SocialProfile[master]: UserProfilePage: Avoid &$this in hooks

2017-12-16 Thread Rafidaslam (Code Review)
Rafidaslam has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398673 )

Change subject: UserProfilePage: Avoid &$this in hooks
..

UserProfilePage: Avoid &$this in hooks

&$this triggers warnings in PHP 7.1. Simply renaming the variable before
passing it by reference avoids the warning, without breaking backwards
compatibility.

Bug: T153505
Change-Id: Ibb7308623437666f8b3afd2f8e8610f786883b20
---
M UserProfile/UserProfilePage.php
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SocialProfile 
refs/changes/73/398673/1

diff --git a/UserProfile/UserProfilePage.php b/UserProfile/UserProfilePage.php
index 61e40fa..3e7fdcb 100644
--- a/UserProfile/UserProfilePage.php
+++ b/UserProfile/UserProfilePage.php
@@ -108,7 +108,10 @@
// Left side
$wgOut->addHTML( '' );
 
-   if ( !Hooks::run( 'UserProfileBeginLeft', array( &$this ) ) ) {
+   // Avoid PHP 7.1 warning of passing $this by reference
+   $userProfilePage = $this;
+
+   if ( !Hooks::run( 'UserProfileBeginLeft', array( 
&$userProfilePage ) ) ) {
wfDebug( __METHOD__ . ": UserProfileBeginLeft messed up 
profile!\n" );
}
 
@@ -121,7 +124,7 @@
$wgOut->addHTML( $this->getFanBoxes( $this->user_name ) );
$wgOut->addHTML( $this->getUserStats( $this->user_id, 
$this->user_name ) );
 
-   if ( !Hooks::run( 'UserProfileEndLeft', array( &$this ) ) ) {
+   if ( !Hooks::run( 'UserProfileEndLeft', array( 
&$userProfilePage ) ) ) {
wfDebug( __METHOD__ . ": UserProfileEndLeft messed up 
profile!\n" );
}
 
@@ -132,7 +135,7 @@
// Right side
$wgOut->addHTML( '' 
);
 
-   if ( !Hooks::run( 'UserProfileBeginRight', array( &$this ) ) ) {
+   if ( !Hooks::run( 'UserProfileBeginRight', array( 
&$userProfilePage ) ) ) {
wfDebug( __METHOD__ . ": UserProfileBeginRight messed 
up profile!\n" );
}
 
@@ -145,7 +148,7 @@
$wgOut->addHTML( $this->getCasualGames( $this->user_id, 
$this->user_name ) );
$wgOut->addHTML( $this->getUserBoard( $this->user_id, 
$this->user_name ) );
 
-   if ( !Hooks::run( 'UserProfileEndRight', array( &$this ) ) ) {
+   if ( !Hooks::run( 'UserProfileEndRight', array( 
&$userProfilePage ) ) ) {
wfDebug( __METHOD__ . ": UserProfileEndRight messed up 
profile!\n" );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb7308623437666f8b3afd2f8e8610f786883b20
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SocialProfile
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam 

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


[MediaWiki-commits] [Gerrit] mediawiki...GlobalContribs[master]: SpecialGlobalContributions: Avoid &$this in hooks

2017-12-16 Thread Rafidaslam (Code Review)
Rafidaslam has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398672 )

Change subject: SpecialGlobalContributions: Avoid &$this in hooks
..

SpecialGlobalContributions: Avoid &$this in hooks

&$this triggers warnings in PHP 7.1. Simply renaming the variable before
passing it by reference avoids the warning, without breaking backwards
compatibility.

Bug: T153505
Change-Id: I11b8f07a90e0ccb7fabe1f99f3bba7c7d83c1437
---
M SpecialGlobalContributions.php
1 file changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/SpecialGlobalContributions.php b/SpecialGlobalContributions.php
index 58139b3..ad0c759 100644
--- a/SpecialGlobalContributions.php
+++ b/SpecialGlobalContributions.php
@@ -369,7 +369,9 @@
$this->tagFilter
);
 
-   Hooks::run( 'ContribsPager::getQueryInfo', array( &$this, 
&$queryInfo ) );
+   // Avoid PHP 7.1 warning of passing $this by reference
+   $globalContribsPager = $this;
+   Hooks::run( 'ContribsPager::getQueryInfo', array( 
&$globalContribsPager, &$queryInfo ) );
 
return $queryInfo;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11b8f07a90e0ccb7fabe1f99f3bba7c7d83c1437
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalContribs
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam 

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Use upstream Generic.PHP.DiscourageGoto

2017-12-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398671 )

Change subject: Use upstream Generic.PHP.DiscourageGoto
..

Use upstream Generic.PHP.DiscourageGoto

Instead of our own.

Change-Id: I36afb56346595846e9ea163e8d924655c9c459bc
---
D MediaWiki/Sniffs/Usage/GotoUsageSniff.php
D MediaWiki/Tests/files/Usage/goto_usage.php
D MediaWiki/Tests/files/Usage/goto_usage.php.expect
M MediaWiki/ruleset.xml
4 files changed, 1 insertion(+), 62 deletions(-)


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

diff --git a/MediaWiki/Sniffs/Usage/GotoUsageSniff.php 
b/MediaWiki/Sniffs/Usage/GotoUsageSniff.php
deleted file mode 100644
index c8a7cd4..000
--- a/MediaWiki/Sniffs/Usage/GotoUsageSniff.php
+++ /dev/null
@@ -1,32 +0,0 @@
-https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#Other
-   return [
-   T_GOTO
-   ];
-   }
-
-   /**
-* @param File $phpcsFile File object.
-* @param int $stackPtr The current token index.
-* @return void
-*/
-   public function process( File $phpcsFile, $stackPtr ) {
-   $error = 'Control statement "goto" must not be used.';
-   $phpcsFile->addError( $error, $stackPtr, 'GotoUsage' );
-   }
-}
diff --git a/MediaWiki/Tests/files/Usage/goto_usage.php 
b/MediaWiki/Tests/files/Usage/goto_usage.php
deleted file mode 100644
index 0ddf5c6..000
--- a/MediaWiki/Tests/files/Usage/goto_usage.php
+++ /dev/null
@@ -1,28 +0,0 @@
-


+   




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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I36afb56346595846e9ea163e8d924655c9c459bc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/codesniffer
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] pywikibot/core[master]: imagecopy.py: Add 'https' in the link of 'View in browser' f...

2017-12-16 Thread Eflyjason (Code Review)
Eflyjason has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398670 )

Change subject: imagecopy.py: Add 'https' in the link of 'View in browser' 
function
..

imagecopy.py: Add 'https' in the link of 'View in browser' function

Bug: T182854
Change-Id: I490c35b62f41b662ddb03150e74ea3850b497c79
---
M scripts/imagecopy.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/70/398670/1

diff --git a/scripts/imagecopy.py b/scripts/imagecopy.py
index 656525e..4a8b149 100644
--- a/scripts/imagecopy.py
+++ b/scripts/imagecopy.py
@@ -448,7 +448,7 @@
 
 def open_in_browser(self):
 """The user pressed the View in browser button."""
-webbrowser.open(self.url)
+webbrowser.open('https:' + self.url)
 
 def add2_auto_skip(self):
 """The user pressed the Add to AutoSkip button."""

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

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

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: pywikibot.userinterfaces.gui is broken in Python 3.6

2017-12-16 Thread Eflyjason (Code Review)
Eflyjason has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398669 )

Change subject: pywikibot.userinterfaces.gui is broken in Python 3.6
..

pywikibot.userinterfaces.gui is broken in Python 3.6

Bug: T164164
Change-Id: Idc1a1d990e9646862dd831607bba88743f91f6d2
---
M pywikibot/userinterfaces/gui.py
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/69/398669/1

diff --git a/pywikibot/userinterfaces/gui.py b/pywikibot/userinterfaces/gui.py
index 21f866b..4c8c5f6 100644
--- a/pywikibot/userinterfaces/gui.py
+++ b/pywikibot/userinterfaces/gui.py
@@ -29,9 +29,15 @@
 
 from ScrolledText import ScrolledText
 
-from idlelib import SearchDialog, ReplaceDialog, configDialog
-from idlelib.configHandler import idleConf
-from idlelib.MultiCall import MultiCallCreator
+# T164163
+if sys.version_info > (3, 5):
+   from idlelib import search as SearchDialog, replace as ReplaceDialog, 
configdialog as configDialog
+   from idlelib.config import idleConf
+   from idlelib.multicall import MultiCallCreator
+else:
+   from idlelib import SearchDialog, ReplaceDialog, configDialog
+   from idlelib.configHandler import idleConf
+   from idlelib.MultiCall import MultiCallCreator
 
 import pywikibot
 

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

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

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


[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: WDCM EngineGeo 17 Dec 2017

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

Change subject: WDCM EngineGeo 17 Dec 2017
..


WDCM EngineGeo 17 Dec 2017

Change-Id: I6b2239853ea574493b2900729d10eabac5bb08cd
---
M WDCM_EngineGeo_goransm.R
1 file changed, 74 insertions(+), 7 deletions(-)

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



diff --git a/WDCM_EngineGeo_goransm.R b/WDCM_EngineGeo_goransm.R
index 9d9c8df..635606b 100644
--- a/WDCM_EngineGeo_goransm.R
+++ b/WDCM_EngineGeo_goransm.R
@@ -154,7 +154,10 @@
 rm(item); rm(coordinate); rm(label); rm(rc); gc()
 # - keep unique result set:
 w <- which(duplicated(items$item))
-items <- items[-w, ]
+if (length(w) > 0) {items <- items[-w, ]}
+# - clear possible NAs from coordinates
+w <- which(is.na(items$coordinate) | (items$coordinate == ""))
+if (length(w) > 0) {items <- items[-w, ]}
 # - fix items
 items$item <- gsub("http://www.wikidata.org/entity/;, "", items$item, 
fixed = T)
 # - fix coordinates (lon, lat)
@@ -283,7 +286,64 @@
 }
 
 ### --- join coordinates, items, labels, and usage
+setwd(dataDir)
 
+# - list .tsv files
+lF <- list.files()
+w <- which(grepl("^wdcm_geoitem", lF))
+lF <- lF[w]
+w <- which(grepl(".tsv", lF, fixed = T))
+lF <- lF[w]
+
+# - remove old .csv files:
+rmF <- list.files()
+w <- which(grepl("^wdcm_geoitem", rmF))
+rmF <- rmF[w]
+w <- which(grepl(".csv", rmF, fixed = T))
+rmF <- rmF[w]
+file.remove(rmF)
+
+for (i in 1:length(lF)) {
+  
+  # - to runtime Log:
+  print(paste("Joining dataset: ", lF[i], sep = ""))
+  
+  # - usage data
+  usage <- readLines(lF[i])
+  usage <- usage[-which(grepl("null", usage, fixed = T))]
+  usage <- usage[-which(usage == "")]
+  usageList <- lapply(usage, function(x) {
+udata <- strsplit(x, split = "\t", fixed = T)[[1]]
+udata <- data.frame(item = udata[1], 
+usage = udata[2],
+stringsAsFactors = F)
+  })
+  usage <- rbindlist(usageList)
+  rm(usageList)
+  # - coordinates data and labels
+  setwd(itemsDir)
+  rF <- list.files()
+  # - find coordinates data and labels file
+  catUsage <- strsplit(
+strsplit(lF[i], split = ".", fixed = T)[[1]][1],
+split = "_",
+fixed = T)[[1]][3]
+  rFcheck <- sapply(rF, function(x) {
+gsub(" ", "", strsplit(x, split = "_", fixed = T)[[1]][1], fixed = T)
+  })
+  w <- sapply(rFcheck, function(x) {grepl(catUsage, x)})
+  geo <- read.csv(rF[w], 
+  header = T,
+  check.names = F,
+  stringsAsFactors = F)
+  # - join
+  usage <- left_join(usage, geo, by = 'item')
+  rm(geo)
+  # - write: back to dataDir
+  setwd(dataDir)
+  file.remove(lF[i])
+  write.csv(usage, file = gsub(".tsv", ".csv", lF[i], fixed = T))
+}
 
 ### --- log ETL step:
 # - to runtime Log:
@@ -314,13 +374,20 @@
 ### --- Step 3: toLabsGeoReport
 ### ---
 
+### --- toLabsGeoReport
+toLabsGeoReport <- data.frame(timeStamp = as.character(Sys.time()),
+  statbox = "stat1005",
+  sqoopbox = "stat1004",
+  stringsAsFactors = F)
+write.csv(toLabsGeoReport, "toLabsGeoReport.csv")
 
+# - to runtime Log:
+print(paste("--- UPDATE RUN COMPLETED ON:", Sys.time(), sep = " "))
 
+### --- copy reports to /srv/published-datasets/wdcm:
 
-
-
-
-
-
-
+# - WDCM_MainReport
+system(command = 'cp 
/home/goransm/RScripts/WDCM_R/WDCM_Logs/WDCM_GeoReport.csv 
/srv/published-datasets/wdcm/', wait = T)
+# - toLabsReport
+system(command = 'cp 
/home/goransm/RScripts/WDCM_R/WDCM_Logs/toLabsGeoReport.csv 
/srv/published-datasets/wdcm/', wait = T)
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6b2239853ea574493b2900729d10eabac5bb08cd
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/WDCM
Gerrit-Branch: master
Gerrit-Owner: GoranSMilovanovic 
Gerrit-Reviewer: GoranSMilovanovic 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: WDCM EngineGeo 17 Dec 2017

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398668 )

Change subject: WDCM EngineGeo 17 Dec 2017
..

WDCM EngineGeo 17 Dec 2017

Change-Id: I6b2239853ea574493b2900729d10eabac5bb08cd
---
M WDCM_EngineGeo_goransm.R
1 file changed, 74 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/WDCM 
refs/changes/68/398668/1

diff --git a/WDCM_EngineGeo_goransm.R b/WDCM_EngineGeo_goransm.R
index 9d9c8df..635606b 100644
--- a/WDCM_EngineGeo_goransm.R
+++ b/WDCM_EngineGeo_goransm.R
@@ -154,7 +154,10 @@
 rm(item); rm(coordinate); rm(label); rm(rc); gc()
 # - keep unique result set:
 w <- which(duplicated(items$item))
-items <- items[-w, ]
+if (length(w) > 0) {items <- items[-w, ]}
+# - clear possible NAs from coordinates
+w <- which(is.na(items$coordinate) | (items$coordinate == ""))
+if (length(w) > 0) {items <- items[-w, ]}
 # - fix items
 items$item <- gsub("http://www.wikidata.org/entity/;, "", items$item, 
fixed = T)
 # - fix coordinates (lon, lat)
@@ -283,7 +286,64 @@
 }
 
 ### --- join coordinates, items, labels, and usage
+setwd(dataDir)
 
+# - list .tsv files
+lF <- list.files()
+w <- which(grepl("^wdcm_geoitem", lF))
+lF <- lF[w]
+w <- which(grepl(".tsv", lF, fixed = T))
+lF <- lF[w]
+
+# - remove old .csv files:
+rmF <- list.files()
+w <- which(grepl("^wdcm_geoitem", rmF))
+rmF <- rmF[w]
+w <- which(grepl(".csv", rmF, fixed = T))
+rmF <- rmF[w]
+file.remove(rmF)
+
+for (i in 1:length(lF)) {
+  
+  # - to runtime Log:
+  print(paste("Joining dataset: ", lF[i], sep = ""))
+  
+  # - usage data
+  usage <- readLines(lF[i])
+  usage <- usage[-which(grepl("null", usage, fixed = T))]
+  usage <- usage[-which(usage == "")]
+  usageList <- lapply(usage, function(x) {
+udata <- strsplit(x, split = "\t", fixed = T)[[1]]
+udata <- data.frame(item = udata[1], 
+usage = udata[2],
+stringsAsFactors = F)
+  })
+  usage <- rbindlist(usageList)
+  rm(usageList)
+  # - coordinates data and labels
+  setwd(itemsDir)
+  rF <- list.files()
+  # - find coordinates data and labels file
+  catUsage <- strsplit(
+strsplit(lF[i], split = ".", fixed = T)[[1]][1],
+split = "_",
+fixed = T)[[1]][3]
+  rFcheck <- sapply(rF, function(x) {
+gsub(" ", "", strsplit(x, split = "_", fixed = T)[[1]][1], fixed = T)
+  })
+  w <- sapply(rFcheck, function(x) {grepl(catUsage, x)})
+  geo <- read.csv(rF[w], 
+  header = T,
+  check.names = F,
+  stringsAsFactors = F)
+  # - join
+  usage <- left_join(usage, geo, by = 'item')
+  rm(geo)
+  # - write: back to dataDir
+  setwd(dataDir)
+  file.remove(lF[i])
+  write.csv(usage, file = gsub(".tsv", ".csv", lF[i], fixed = T))
+}
 
 ### --- log ETL step:
 # - to runtime Log:
@@ -314,13 +374,20 @@
 ### --- Step 3: toLabsGeoReport
 ### ---
 
+### --- toLabsGeoReport
+toLabsGeoReport <- data.frame(timeStamp = as.character(Sys.time()),
+  statbox = "stat1005",
+  sqoopbox = "stat1004",
+  stringsAsFactors = F)
+write.csv(toLabsGeoReport, "toLabsGeoReport.csv")
 
+# - to runtime Log:
+print(paste("--- UPDATE RUN COMPLETED ON:", Sys.time(), sep = " "))
 
+### --- copy reports to /srv/published-datasets/wdcm:
 
-
-
-
-
-
-
+# - WDCM_MainReport
+system(command = 'cp 
/home/goransm/RScripts/WDCM_R/WDCM_Logs/WDCM_GeoReport.csv 
/srv/published-datasets/wdcm/', wait = T)
+# - toLabsReport
+system(command = 'cp 
/home/goransm/RScripts/WDCM_R/WDCM_Logs/toLabsGeoReport.csv 
/srv/published-datasets/wdcm/', wait = T)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b2239853ea574493b2900729d10eabac5bb08cd
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/WDCM
Gerrit-Branch: master
Gerrit-Owner: GoranSMilovanovic 

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


[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: EngineGeo 16 Dec 2017 ed2

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398667 )

Change subject: EngineGeo 16 Dec 2017 ed2
..


EngineGeo 16 Dec 2017 ed2

Change-Id: I0f16705bf73bd0e66a19636321fd438b386f6139
---
M WDCM_EngineGeo_goransm.R
M WDCM_Engine_goransm.R
2 files changed, 122 insertions(+), 14 deletions(-)

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



diff --git a/WDCM_EngineGeo_goransm.R b/WDCM_EngineGeo_goransm.R
index 25e8a40..9d9c8df 100644
--- a/WDCM_EngineGeo_goransm.R
+++ b/WDCM_EngineGeo_goransm.R
@@ -54,6 +54,7 @@
 library(httr)
 library(XML)
 # - wrangling:
+library(dplyr)
 library(stringr)
 library(readr)
 library(data.table)
@@ -62,11 +63,11 @@
 
 ### --- Directories
 # - fPath: where the scripts is run from?
-fPath <- 
'/home/goransm/Work/___DataKolektiv/Projects/WikimediaDEU/_WMDE_Projects/WDCM_Dev/WDCM/'
+fPath <- '/home/goransm/RScripts/WDCM_R'
 # - form paths:
-ontologyDir <- paste(fPath, 'WDCM_Ontology', sep = "")
-logDir <- paste(fPath, 'WDCM_Logs', sep = "")
-itemsDir <- paste(fPath, 'WDCM_CollectedGeoItems', sep = "")
+ontologyDir <- paste(fPath, '/WDCM_Ontology', sep = "")
+logDir <- paste(fPath, '/WDCM_Logs', sep = "")
+itemsDir <- paste(fPath, '/WDCM_CollectedGeoItems', sep = "")
 # - stat1005 published-datasets, maps onto 
 # - https://analytics.wikimedia.org/datasets/wdcm/
 dataDir <- '/srv/published-datasets/wdcm'
@@ -75,9 +76,9 @@
 print(paste("--- UPDATE RUN STARTED ON:", Sys.time(), sep = " "))
 
 ### --- Set proxy
-# Sys.setenv(
-#   http_proxy = "http://webproxy.eqiad.wmnet:8080;,
-#   https_proxy = "http://webproxy.eqiad.wmnet:8080;)
+Sys.setenv(
+  http_proxy = "http://webproxy.eqiad.wmnet:8080;,
+  https_proxy = "http://webproxy.eqiad.wmnet:8080;)
 
 ### --- Read WDCM_GeoItems
 # - to runtime Log:
@@ -114,8 +115,6 @@
   strsplit(wdcmGeoItems$item[i],
split = ",", fixed = T)[[1]],
   "both")
-  
-  itemsOut <- list()
   
   # - Construct Query:
   query <- paste0(
@@ -190,8 +189,8 @@
 write.csv(qErrors, "WDCM_Collect_GeoItems_SPARQL_Errors.csv")
 # - write to WDCM main reporting file:
 lF <- list.files()
-if ('WDCM_MainReport.csv' %in% lF) {
-  mainReport <- read.csv('WDCM_MainReport.csv',
+if ('WDCM_GeoReport.csv' %in% lF) {
+  mainReport <- read.csv('WDCM_GeoReport.csv',
  header = T,
  row.names = 1,
  check.names = F,
@@ -200,18 +199,128 @@
   Time = as.character(Sys.time()),
   stringsAsFactors = F)
   mainReport <- rbind(mainReport, newReport)
-  write.csv(mainReport, 'WDCM_MainReport.csv')
+  write.csv(mainReport, 'WDCM_GeoReport.csv')
 } else {
   newReport <- data.frame(Step = 'CollectItems',
   Time = as.character(Sys.time()),
   stringsAsFactors = F)
-  write.csv(newReport, 'WDCM_MainReport.csv')
+  write.csv(newReport, 'WDCM_GeoReport.csv')
 }
 
 ### ---
 ### --- Step 2: ETL: Wikidata usage statistics from WDCM Maintable
 ### ---
 
+# - to runtime Log:
+print("--- ETL: Wikidata usage statistics from wdcm_maintable")
+
+### --- read item categories:
+setwd(itemsDir)
+
+idFiles <- list.files()
+idFiles <- idFiles[grepl(".csv$", idFiles)]
+categories <- unname(sapply(idFiles, function(x) {
+  strsplit(x, split = "_")[[1]][1]
+}))
+
+for (i in 1:length(categories)) {
+  
+  # - filename
+  filename <- paste("wdcm_geoitem_",
+gsub(" ", "", categories[i], fixed = T), ".tsv",
+sep = "")
+  
+  # - geoitems
+  geoitems <- read.csv(idFiles[i],
+   header = T,
+   check.names = F,
+   stringsAsFactors = F)
+  searchitems <- geoitems$item
+  
+  # - to runtime Log:
+  print(paste("--- processing: ", i, ": ", filename, sep = ""))
+  
+  # - to runtime Log:
+  print("--- RUNNING HiveQL Query to search for geoitems.")
+  hiveQLQuery_1 <- "USE goransm; SET hive.mapred.mode=unstrict;"
+  hiveQLQuery_2 <- paste("SELECT eu_entity_id, SUM(eu_count) AS usage FROM 
wdcm_maintable WHERE eu_entity_id IN (",
+ paste("\"", searchitems, "\"", collapse = ", ", sep = 
""),
+ ") GROUP BY eu_entity_id ORDER BY usage DESC LIMIT 
1000;",
+ sep = "")
+  hiveQLQuery <- paste(hiveQLQuery_1, hiveQLQuery_2, sep = " ")
+  
+  # - write hiveQLQuery locally:
+  setwd(fPath)
+  write(hiveQLQuery, "hiveQL_geoQuery.hql")
+  
+  # - execute HiveQLQuery:
+  hiveQLQueryCommand <- paste("/usr/local/bin/beeline --silent -f ", 
+  getwd(), "/hiveQL_geoQuery.hql", 
+  " > ", dataDir, "/", filename, 
+  sep = "")
+  

[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: EngineGeo 16 Dec 2017 ed2

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398667 )

Change subject: EngineGeo 16 Dec 2017 ed2
..

EngineGeo 16 Dec 2017 ed2

Change-Id: I0f16705bf73bd0e66a19636321fd438b386f6139
---
M WDCM_EngineGeo_goransm.R
M WDCM_Engine_goransm.R
2 files changed, 122 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/WDCM 
refs/changes/67/398667/1

diff --git a/WDCM_EngineGeo_goransm.R b/WDCM_EngineGeo_goransm.R
index 25e8a40..9d9c8df 100644
--- a/WDCM_EngineGeo_goransm.R
+++ b/WDCM_EngineGeo_goransm.R
@@ -54,6 +54,7 @@
 library(httr)
 library(XML)
 # - wrangling:
+library(dplyr)
 library(stringr)
 library(readr)
 library(data.table)
@@ -62,11 +63,11 @@
 
 ### --- Directories
 # - fPath: where the scripts is run from?
-fPath <- 
'/home/goransm/Work/___DataKolektiv/Projects/WikimediaDEU/_WMDE_Projects/WDCM_Dev/WDCM/'
+fPath <- '/home/goransm/RScripts/WDCM_R'
 # - form paths:
-ontologyDir <- paste(fPath, 'WDCM_Ontology', sep = "")
-logDir <- paste(fPath, 'WDCM_Logs', sep = "")
-itemsDir <- paste(fPath, 'WDCM_CollectedGeoItems', sep = "")
+ontologyDir <- paste(fPath, '/WDCM_Ontology', sep = "")
+logDir <- paste(fPath, '/WDCM_Logs', sep = "")
+itemsDir <- paste(fPath, '/WDCM_CollectedGeoItems', sep = "")
 # - stat1005 published-datasets, maps onto 
 # - https://analytics.wikimedia.org/datasets/wdcm/
 dataDir <- '/srv/published-datasets/wdcm'
@@ -75,9 +76,9 @@
 print(paste("--- UPDATE RUN STARTED ON:", Sys.time(), sep = " "))
 
 ### --- Set proxy
-# Sys.setenv(
-#   http_proxy = "http://webproxy.eqiad.wmnet:8080;,
-#   https_proxy = "http://webproxy.eqiad.wmnet:8080;)
+Sys.setenv(
+  http_proxy = "http://webproxy.eqiad.wmnet:8080;,
+  https_proxy = "http://webproxy.eqiad.wmnet:8080;)
 
 ### --- Read WDCM_GeoItems
 # - to runtime Log:
@@ -114,8 +115,6 @@
   strsplit(wdcmGeoItems$item[i],
split = ",", fixed = T)[[1]],
   "both")
-  
-  itemsOut <- list()
   
   # - Construct Query:
   query <- paste0(
@@ -190,8 +189,8 @@
 write.csv(qErrors, "WDCM_Collect_GeoItems_SPARQL_Errors.csv")
 # - write to WDCM main reporting file:
 lF <- list.files()
-if ('WDCM_MainReport.csv' %in% lF) {
-  mainReport <- read.csv('WDCM_MainReport.csv',
+if ('WDCM_GeoReport.csv' %in% lF) {
+  mainReport <- read.csv('WDCM_GeoReport.csv',
  header = T,
  row.names = 1,
  check.names = F,
@@ -200,18 +199,128 @@
   Time = as.character(Sys.time()),
   stringsAsFactors = F)
   mainReport <- rbind(mainReport, newReport)
-  write.csv(mainReport, 'WDCM_MainReport.csv')
+  write.csv(mainReport, 'WDCM_GeoReport.csv')
 } else {
   newReport <- data.frame(Step = 'CollectItems',
   Time = as.character(Sys.time()),
   stringsAsFactors = F)
-  write.csv(newReport, 'WDCM_MainReport.csv')
+  write.csv(newReport, 'WDCM_GeoReport.csv')
 }
 
 ### ---
 ### --- Step 2: ETL: Wikidata usage statistics from WDCM Maintable
 ### ---
 
+# - to runtime Log:
+print("--- ETL: Wikidata usage statistics from wdcm_maintable")
+
+### --- read item categories:
+setwd(itemsDir)
+
+idFiles <- list.files()
+idFiles <- idFiles[grepl(".csv$", idFiles)]
+categories <- unname(sapply(idFiles, function(x) {
+  strsplit(x, split = "_")[[1]][1]
+}))
+
+for (i in 1:length(categories)) {
+  
+  # - filename
+  filename <- paste("wdcm_geoitem_",
+gsub(" ", "", categories[i], fixed = T), ".tsv",
+sep = "")
+  
+  # - geoitems
+  geoitems <- read.csv(idFiles[i],
+   header = T,
+   check.names = F,
+   stringsAsFactors = F)
+  searchitems <- geoitems$item
+  
+  # - to runtime Log:
+  print(paste("--- processing: ", i, ": ", filename, sep = ""))
+  
+  # - to runtime Log:
+  print("--- RUNNING HiveQL Query to search for geoitems.")
+  hiveQLQuery_1 <- "USE goransm; SET hive.mapred.mode=unstrict;"
+  hiveQLQuery_2 <- paste("SELECT eu_entity_id, SUM(eu_count) AS usage FROM 
wdcm_maintable WHERE eu_entity_id IN (",
+ paste("\"", searchitems, "\"", collapse = ", ", sep = 
""),
+ ") GROUP BY eu_entity_id ORDER BY usage DESC LIMIT 
1000;",
+ sep = "")
+  hiveQLQuery <- paste(hiveQLQuery_1, hiveQLQuery_2, sep = " ")
+  
+  # - write hiveQLQuery locally:
+  setwd(fPath)
+  write(hiveQLQuery, "hiveQL_geoQuery.hql")
+  
+  # - execute HiveQLQuery:
+  hiveQLQueryCommand <- paste("/usr/local/bin/beeline --silent -f ", 
+  getwd(), "/hiveQL_geoQuery.hql", 
+  " > ", dataDir, "/", filename, 
+  

[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: EngineGeo 16 Dec 2017

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398666 )

Change subject: EngineGeo 16 Dec 2017
..


EngineGeo 16 Dec 2017

Change-Id: I4750665c1789c201d579c425b9231a1f848be3a0
---
M WDCM_EngineGeo_goransm.R
1 file changed, 1 insertion(+), 900 deletions(-)

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



diff --git a/WDCM_EngineGeo_goransm.R b/WDCM_EngineGeo_goransm.R
index 7013c3a..25e8a40 100644
--- a/WDCM_EngineGeo_goransm.R
+++ b/WDCM_EngineGeo_goransm.R
@@ -209,908 +209,9 @@
 }
 
 ### ---
-### --- Script 2: WDCM_Search_Clients.R, WDCM Search Module
+### --- Step 2: ETL: Wikidata usage statistics from WDCM Maintable
 ### ---
 
-### ---
-### --- WDCM Search Module, v. Beta 0.1
-### --- Script: WDCM_Search_Clients.R, v. Beta 0.1
-### --- Author: Goran S. Milovanovic, Data Analyst, WMDE
-### --- Developed under the contract between Goran Milovanovic PR Data Kolektiv
-### --- and WMDE.
-### --- Contact: goran.milovanovic_...@wikimedia.de
-### ---
-### --- DESCRIPTION:
-### --- WDCM_Search_Clients.R takes a list of
-### --- item IDs from Wikidata (the list is delivered by
-### --- the WDCM_Collect_Items.R script) and searches for their
-### --- usage across the Wikimedia projects in Hadoop:
-### --- database: goransm
-### --- directory: wdcmsqoop
-### --- table: wdcm_clients_wb_entity_usage
-### --- from production (currently: stat1005.eqiad.wmnet).
-### --- NOTE: wdcm_clients_wb_entity_usage is produced by
-### --- WDCM_Sqoop_Clients.R (currently run from: stat1004.eqiad.wmnet)
-### ---
-### --- INPUT:
-### --- the WDCM_Search_Clients_HiveQL.R reads the list of item IDs
-### --- to search for from /WDCM_CollectedItems
-### --- This folder contains the .csv files that specify the item IDs
-### --- to search for; the files are produced by Scrpt 1: WDCM_Collect_Items.R
-### ---
-### --- OUTPUT:
-### --- wdcm_maintable Hive table on hdfs, database: goransm
-### ---
-
-### --- read item categories:
-setwd(itemsDir)
-idFiles <- list.files()
-idFiles <- idFiles[grepl(".csv$", idFiles)]
-idFilesSize <- file.size(idFiles)/1024^2
-
-### --- Track all categories under processing:
-# - check for the existence of the wdcmSearchReport file
-# - and delete the old file if it's found:
-setwd(logDir)
-lF <- list.files()
-w <- which(grepl("^wdcmSearchReport", lF))
-if (length(w) == 1) {
-  file.remove(lF[w])
-}
-### --- generate wdcmSearchReport data.frame
-wdcmSearchReport <- data.frame(category = idFiles,
-   fileSize = idFilesSize,
-   startTime = character(length(idFiles)),
-   endTime = character(length(idFiles)),
-   stringsAsFactors = F
-)
-wdcmSearchReport <- wdcmSearchReport[order(-wdcmSearchReport$fileSize), ]
-
-### --- PREPARATION: delete goransm.wdcm_maintable if exists,
-### --- delete all from EXTERNAL Hive table from /user/goransm/wdcmtables 
(hdfs path)
-### --- make directory for EXTERNAL Hive table /user/goransm/wdcmtables (hdfs 
path)
-
-### --- check if goransm.wdcm_maintable exists in Hadoop; if yes, drop it:
-# - NOTE: drop wdcm_maintable == erase metastore data:
-# - [query01Err]
-
-# - to runtime Log:
-print("Running query [query01Err].")
-
-query01Err <- system(command = '/usr/local/bin/beeline --silent -e "USE 
goransm; DROP TABLE IF EXISTS wdcm_maintable;"', wait = T)
-if (query01Err != 0) {
-  # - to runtime Log:
-  print("--- (!!!) query01Err failed: waiting for 1h before next attempt...")
-  # - sleep for one hour
-  Sys.sleep(time = 60*60)
-  # - re-run query
-  query01Err <- system(command = '/usr/local/bin/beeline --silent -e "USE 
goransm; DROP TABLE IF EXISTS wdcm_maintable;"', wait = T)
-  # - check errors:
-  if (query01Err != 0) {
-# - to runtime Log:
-print("--- (!!!) query01Err failed AGAIN: quiting.")
-quit()
-  }
-}
-
-### --- delete files for EXTERNAL Hive table from /user/goransm/wdcmtables 
(hdfs path)
-# - [query02Err]
-# - to runtime Log:
-print("--- Running query [query02Err].")
-query02Err <- system(command = 'hdfs dfs -rm -r /user/goransm/wdcmtables', 
wait = T)
-if (query02Err != 0) {
-  # - to runtime Log:
-  print("--- (!!!) query02Err failed: waiting for 1h before next attempt...")
-  # - sleep for one hour
-  Sys.sleep(time = 60*60)
-  # - re-run query
-  query02Err <- system(command = 'hdfs dfs -rm 

[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: EngineGeo 16 Dec 2017

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398666 )

Change subject: EngineGeo 16 Dec 2017
..

EngineGeo 16 Dec 2017

Change-Id: I4750665c1789c201d579c425b9231a1f848be3a0
---
M WDCM_EngineGeo_goransm.R
1 file changed, 1 insertion(+), 900 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/WDCM 
refs/changes/66/398666/1

diff --git a/WDCM_EngineGeo_goransm.R b/WDCM_EngineGeo_goransm.R
index 7013c3a..25e8a40 100644
--- a/WDCM_EngineGeo_goransm.R
+++ b/WDCM_EngineGeo_goransm.R
@@ -209,908 +209,9 @@
 }
 
 ### ---
-### --- Script 2: WDCM_Search_Clients.R, WDCM Search Module
+### --- Step 2: ETL: Wikidata usage statistics from WDCM Maintable
 ### ---
 
-### ---
-### --- WDCM Search Module, v. Beta 0.1
-### --- Script: WDCM_Search_Clients.R, v. Beta 0.1
-### --- Author: Goran S. Milovanovic, Data Analyst, WMDE
-### --- Developed under the contract between Goran Milovanovic PR Data Kolektiv
-### --- and WMDE.
-### --- Contact: goran.milovanovic_...@wikimedia.de
-### ---
-### --- DESCRIPTION:
-### --- WDCM_Search_Clients.R takes a list of
-### --- item IDs from Wikidata (the list is delivered by
-### --- the WDCM_Collect_Items.R script) and searches for their
-### --- usage across the Wikimedia projects in Hadoop:
-### --- database: goransm
-### --- directory: wdcmsqoop
-### --- table: wdcm_clients_wb_entity_usage
-### --- from production (currently: stat1005.eqiad.wmnet).
-### --- NOTE: wdcm_clients_wb_entity_usage is produced by
-### --- WDCM_Sqoop_Clients.R (currently run from: stat1004.eqiad.wmnet)
-### ---
-### --- INPUT:
-### --- the WDCM_Search_Clients_HiveQL.R reads the list of item IDs
-### --- to search for from /WDCM_CollectedItems
-### --- This folder contains the .csv files that specify the item IDs
-### --- to search for; the files are produced by Scrpt 1: WDCM_Collect_Items.R
-### ---
-### --- OUTPUT:
-### --- wdcm_maintable Hive table on hdfs, database: goransm
-### ---
-
-### --- read item categories:
-setwd(itemsDir)
-idFiles <- list.files()
-idFiles <- idFiles[grepl(".csv$", idFiles)]
-idFilesSize <- file.size(idFiles)/1024^2
-
-### --- Track all categories under processing:
-# - check for the existence of the wdcmSearchReport file
-# - and delete the old file if it's found:
-setwd(logDir)
-lF <- list.files()
-w <- which(grepl("^wdcmSearchReport", lF))
-if (length(w) == 1) {
-  file.remove(lF[w])
-}
-### --- generate wdcmSearchReport data.frame
-wdcmSearchReport <- data.frame(category = idFiles,
-   fileSize = idFilesSize,
-   startTime = character(length(idFiles)),
-   endTime = character(length(idFiles)),
-   stringsAsFactors = F
-)
-wdcmSearchReport <- wdcmSearchReport[order(-wdcmSearchReport$fileSize), ]
-
-### --- PREPARATION: delete goransm.wdcm_maintable if exists,
-### --- delete all from EXTERNAL Hive table from /user/goransm/wdcmtables 
(hdfs path)
-### --- make directory for EXTERNAL Hive table /user/goransm/wdcmtables (hdfs 
path)
-
-### --- check if goransm.wdcm_maintable exists in Hadoop; if yes, drop it:
-# - NOTE: drop wdcm_maintable == erase metastore data:
-# - [query01Err]
-
-# - to runtime Log:
-print("Running query [query01Err].")
-
-query01Err <- system(command = '/usr/local/bin/beeline --silent -e "USE 
goransm; DROP TABLE IF EXISTS wdcm_maintable;"', wait = T)
-if (query01Err != 0) {
-  # - to runtime Log:
-  print("--- (!!!) query01Err failed: waiting for 1h before next attempt...")
-  # - sleep for one hour
-  Sys.sleep(time = 60*60)
-  # - re-run query
-  query01Err <- system(command = '/usr/local/bin/beeline --silent -e "USE 
goransm; DROP TABLE IF EXISTS wdcm_maintable;"', wait = T)
-  # - check errors:
-  if (query01Err != 0) {
-# - to runtime Log:
-print("--- (!!!) query01Err failed AGAIN: quiting.")
-quit()
-  }
-}
-
-### --- delete files for EXTERNAL Hive table from /user/goransm/wdcmtables 
(hdfs path)
-# - [query02Err]
-# - to runtime Log:
-print("--- Running query [query02Err].")
-query02Err <- system(command = 'hdfs dfs -rm -r /user/goransm/wdcmtables', 
wait = T)
-if (query02Err != 0) {
-  # - to runtime Log:
-  print("--- (!!!) query02Err failed: waiting for 1h before next attempt...")
-  # - sleep for one hour
-  Sys.sleep(time = 60*60)
-  # - re-run query
-  query02Err <- system(command = 'hdfs dfs -rm -r 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: logstash: Fix puppet 4 support

2017-12-16 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398665 )

Change subject: logstash: Fix puppet 4 support
..

logstash: Fix puppet 4 support

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/65/398665/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c422396ebb55b87e085ce27ac454bd04785
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Add return value to hook handler

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

Change subject: Add return value to hook handler
..


Add return value to hook handler

Change-Id: I594f80f133e98124fa021e024063d0a0e3c4b28f
---
M src/Hook/LinkEnd/AddDataUserName.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/src/Hook/LinkEnd/AddDataUserName.php 
b/src/Hook/LinkEnd/AddDataUserName.php
index f8a0546..92ee3e8 100644
--- a/src/Hook/LinkEnd/AddDataUserName.php
+++ b/src/Hook/LinkEnd/AddDataUserName.php
@@ -22,5 +22,6 @@
}
 
$this->attribs['data-bs-username'] = $user->getName();
+   return true;
}
 }
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I594f80f133e98124fa021e024063d0a0e3c4b28f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel 
Gerrit-Reviewer: Ljonka 
Gerrit-Reviewer: Mglaser 
Gerrit-Reviewer: Pwirth 
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...BlueSpiceFoundation[master]: Add return value to hook handler

2017-12-16 Thread Robert Vogel (Code Review)
Robert Vogel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398664 )

Change subject: Add return value to hook handler
..

Add return value to hook handler

Change-Id: I594f80f133e98124fa021e024063d0a0e3c4b28f
---
M src/Hook/LinkEnd/AddDataUserName.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/src/Hook/LinkEnd/AddDataUserName.php 
b/src/Hook/LinkEnd/AddDataUserName.php
index f8a0546..92ee3e8 100644
--- a/src/Hook/LinkEnd/AddDataUserName.php
+++ b/src/Hook/LinkEnd/AddDataUserName.php
@@ -22,5 +22,6 @@
}
 
$this->attribs['data-bs-username'] = $user->getName();
+   return true;
}
 }
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I594f80f133e98124fa021e024063d0a0e3c4b28f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Robert Vogel 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAvatars[master]: Use of DFD module and some new features

2017-12-16 Thread Robert Vogel (Code Review)
Robert Vogel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398663 )

Change subject: Use of DFD module and some new features
..

Use of DFD module and some new features

* Now usind DFD module
* Added new tag  that allows to have user images in wikitext
* Added user option (with preview) for profile image (formerly in BSF)
* Added profile image to every user-page link (this is probably a bad idea;
maybe just add it to history view, using a different hook)
* Removed obsolete setting "DefaultSize"

TODO:
* Use a mustache template for the image
* Handle width/height properly
* Add config var for LinkEnd feature

Change-Id: I39523a2dceaeb17a5e26aa705bc579665e264528
---
M extension.json
M i18n/en.json
M i18n/qqq.json
A src/Config.php
D src/ConfigDefinition/AvatarsDefaultSize.php
A src/DynamicFileDispatcher/Image.php
A src/DynamicFileDispatcher/ImageExternal.php
A src/DynamicFileDispatcher/UserProfileImage.php
M src/Generator.php
D src/Hook/BSCoreGetUserMiniProfileBeforeInit/SetAvatar.php
A src/Hook/GetPreferences/AddProfileImage.php
A src/Hook/LinkEnd/AddUserImage.php
A src/Hook/ParserFirstCallInit/AddUserImageTag.php
A src/Html/FormField/UserImage.php
A src/Html/ProfileImage.php
A src/Tag/UserImage.php
16 files changed, 426 insertions(+), 67 deletions(-)


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

diff --git a/extension.json b/extension.json
index 1136107..9de7bdd 100644
--- a/extension.json
+++ b/extension.json
@@ -16,10 +16,12 @@
"className": "Avatars",
"extPath": "/BlueSpiceAvatars",
"configDefinitions": {
-   "AvatarsDefaultSize": 
"\\BlueSpice\\Avatars\\ConfigDefinition\\AvatarsDefaultSize::getInstance",
"AvatarsGenerator": 
"\\BlueSpice\\Avatars\\ConfigDefinition\\AvatarsGenerator::getInstance"
}
}
+   },
+   "DynamicFileRegistry": {
+   "userprofileimage": 
"\\BlueSpice\\Avatars\\DynamicFileDispatcher\\UserProfileImage"
}
}
},
@@ -66,17 +68,19 @@
},
"config_prefix": "bsg",
"config": {
-   "AvatarsDefaultSize": {
-   "value": 40
-   },
"AvatarsGenerator": {
"value": "InstantAvatar"
}
},
+   "DefaultUserOptions": {
+   "bs-avatars-profileimage": ""
+   },
"Hooks": {
"BeforePageDisplay": 
"\\BlueSpice\\Avatars\\Hook\\BeforePageDisplay\\AddModules::callback",
-   "UnitTestsList": "Avatars::onUnitTestsList",
-   "BSCoreGetUserMiniProfileBeforeInit": 
"\\BlueSpice\\Avatars\\Hook\\BSCoreGetUserMiniProfileBeforeInit\\SetAvatar::callback"
+   "GetPreferences": 
"\\BlueSpice\\Avatars\\Hook\\GetPreferences\\AddProfileImage::callback",
+   "ParserFirstCallInit": 
"\\BlueSpice\\Avatars\\Hook\\ParserFirstCallInit\\AddUserImageTag::callback",
+   "LinkEnd": 
"\\BlueSpice\\Avatars\\Hook\\LinkEnd\\AddUserImage::callback",
+   "UnitTestsList": "Avatars::onUnitTestsList"
},
"load_composer_autoloader": true,
"manifest_version": 2
diff --git a/i18n/en.json b/i18n/en.json
index 88f1ac2..f0e16a1 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -9,6 +9,8 @@
"bs-avatars-desc": "Provides generic and individual user pictures",
"bs-avatars-pref-generator": "Generator:",
"bs-avatars-pref-defaultsize": "Default size in pixel:",
+   "bs-avatars-pref-userimage": "User image:",
+   "bs-avatars-pref-userimage-img-alt": "Your current user image",
"bs-avatars-upload-complete": "The picture was uploaded.",
"bs-avatars-generate-complete": "A new avatar was generated.",
"bs-avatars-upload-title": "Change profile picture",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 556ca64..b2aa81a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -9,6 +9,8 @@
"bs-avatars-desc": "Used in 
[{{canonicalurl:Special:WikiAdmin|mode=ExtensionInfo}} 
Special:WikiAdmin?mode=ExtensionInfo], description of avatars extension",
"bs-avatars-pref-generator": "Option in 
[{{canonicalurl:Special:WikiAdmin|mode=Preferences}} 
Special:WikiAdmin?mode=Preferences], label for avatar 
generator:\n{{Identical|Generator}}",
"bs-avatars-pref-defaultsize": "Option in 
[{{canonicalurl:Special:WikiAdmin|mode=Preferences}} 
Special:WikiAdmin?mode=Preferences], label for default size of avatar in 
pixel:",
+   "bs-avatars-pref-userimage": "Option in 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Update elasticsearch-template.json to match production

2017-12-16 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398662 )

Change subject: Update elasticsearch-template.json to match production
..

Update elasticsearch-template.json to match production

Change-Id: Ief29981b9fefe04bc73ce1a5da1926fecfee244a
(cherry picked from commit c3e5d0f1053b238d94e0da359434d7d7c2c266b5)
---
M puppet/modules/logstash/files/elasticsearch-template.json
1 file changed, 48 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/62/398662/1

diff --git a/puppet/modules/logstash/files/elasticsearch-template.json 
b/puppet/modules/logstash/files/elasticsearch-template.json
index 7b5dfc0..9716aef 100644
--- a/puppet/modules/logstash/files/elasticsearch-template.json
+++ b/puppet/modules/logstash/files/elasticsearch-template.json
@@ -24,13 +24,16 @@
   "dynamic_templates" : [
 {
   "string_fields" : {
+"match" : "*",
 "match_mapping_type" : "string",
 "mapping" : {
   "type" : "text",
+  "index" : true,
   "omit_norms" : true,
   "fields" : {
 "raw" : {
   "type" : "keyword",
+  "index" : true,
   "doc_values": true
 }
   }
@@ -41,11 +44,13 @@
   "boolean_to_string" : {
 "match_mapping_type" : "boolean",
 "mapping" : {
-  "type" : "keyword",
-  "omit_norms" : true,
-  "fields" : {
-"raw" : {
-  "type" : "keyword",
+  "type" : "text",
+  "index" : true,
+  "omit_norms": true,
+  "fields": {
+"raw": {
+  "index": true,
+  "type": "keyword",
   "doc_values": true
 }
   }
@@ -56,11 +61,13 @@
   "double_to_string" : {
 "match_mapping_type" : "double",
 "mapping" : {
-  "type" : "keyword",
-  "omit_norms" : true,
-  "fields" : {
-"raw" : {
-  "type" : "keyword",
+  "type" : "text",
+  "index" : true,
+  "omit_norms": true,
+  "fields": {
+"raw": {
+  "index": true,
+  "type": "keyword",
   "doc_values": true
 }
   }
@@ -71,11 +78,13 @@
   "long_to_string" : {
 "match_mapping_type" : "long",
 "mapping" : {
-  "type" : "keyword",
-  "omit_norms" : true,
-  "fields" : {
-"raw" : {
-  "type" : "keyword",
+  "type" : "text",
+  "index" : true,
+  "omit_norms": true,
+  "fields": {
+"raw": {
+  "index": true,
+  "type": "keyword",
   "doc_values": true
 }
   }
@@ -86,10 +95,12 @@
   "properties" : {
 "@timestamp" : {
   "type" : "date",
+  "index" : true,
   "doc_values": true
 },
 "@version" : {
   "type" : "keyword",
+  "index" : true,
   "doc_values": true
 },
 "geoip"  : {
@@ -104,26 +115,28 @@
 },
 "host" : {
   "type" : "keyword",
+  "index" : true,
   "doc_values": true
 },
 "level" : {
   "type" : "keyword",
+  "index" : true,
   "doc_values": true
 },
 "message" : {
   "type" : "text",
+  "index" : true,
   "omit_norms" : true
 },
 "normalized_message" : {
   "type": "text",
+  "index" : true,
+  "omit_norms" : true,
   "fields": {
 "raw": {
   "type": "keyword",
+  "index": true,
   "doc_values": true
-},
-"normalized_message": {
-  "type" : "text",
-  "omit_norms" : true
 }
   }
 },
@@ -133,17 +146,32 @@
 },
 "tags" : {
   "type" : "keyword",
+  "index" : true,
   "doc_values": true
 },
 "type" : {
   "type" : "keyword",
+  "index" : true,
   "doc_values": true
 },
 "udp_sender" : {
   "type" : "keyword",
+  "index" : true,
+  "doc_values": true
+},
+"request_time" : {
+  "type" : "float",
+  "doc_values": true
+},
+"upstream_time" : {
+  "type" : "float",
+  "doc_values": true
+},
+"response_size" : {
+  "type" : "long",
   "doc_values": true
 }
   

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Fix accessing kibana from webui

2017-12-16 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398661 )

Change subject: Fix accessing kibana from webui
..

Fix accessing kibana from webui

/srv/kibana/ no longer exists.

config.js was removed.

Change-Id: Ia05b827617e6942d56cef084c129c8db9b7c2701
(cherry picked from commit 1ac20a6c1bceb759c5f563947ef61d9c364a6211)
---
M puppet/hieradata/common.yaml
M puppet/modules/role/templates/elk/apache.conf.erb
2 files changed, 12 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/61/398661/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 3eb1b97..476bbea 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -154,7 +154,7 @@
 hhvm::logroot: /vagrant/logs
 hhvm::admin_site_name: "hhvm-admin%{hiera('mwv::tld')}"
 
-kibana::deploy_dir: "%{hiera('mwv::vendor_dir')}/kibana"
+kibana::deploy_dir: /usr/share/kibana
 kibana::default_route: /dashboard/elasticsearch/default
 
 logstash::heap_memory_mb: 192
diff --git a/puppet/modules/role/templates/elk/apache.conf.erb 
b/puppet/modules/role/templates/elk/apache.conf.erb
index f437372..86943ac 100644
--- a/puppet/modules/role/templates/elk/apache.conf.erb
+++ b/puppet/modules/role/templates/elk/apache.conf.erb
@@ -16,33 +16,21 @@
   Require all granted
 
 
-alias /config.js /etc/kibana/config.js
+
+  ProxyPass "http://localhost:5601/;
+
 
 ProxyRequests Off
-http://127.0.0.1:9200>
+
+http://localhost:5601>
   ProxySet connectiontimeout=5 timeout=90 retry=0
 
 
 Header set Cache-Control "public, must-revalidate, max-age=3600"
 
-# Elasticsearch searches
-
-  ProxyPassMatch http://127.0.0.1:9200/$1
-  ProxyPassReverse http://127.0.0.1:9200/$1
-  Header set Cache-Control "private, must-revalidate, max-age=0"
-  Header set Expires "Thu, 01 Jan 1970 00:00:00 GMT"
-
-
-# Elasticsearch meta-data requests
-
-  ProxyPassMatch http://127.0.0.1:9200/$1
-  ProxyPassReverse http://127.0.0.1:9200/$1
-  Header set Cache-Control "public, must-revalidate, max-age=900"
-
-
-# Storage/retrieval of saved dashboards via elasticsearch
-
-  ProxyPassMatch http://127.0.0.1:9200/$1$2
-  ProxyPassReverse http://127.0.0.1:9200/$1$2
-  Header set Cache-Control "public, must-revalidate, max-age=900"
-
+# Expose the status api without authenticating
+# Due to varnish frontend, all requests are seen by Apache as being internal
+# so using IP ranges is not any more restrictive than "all"
+
+  Require all granted
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia05b827617e6942d56cef084c129c8db9b7c2701
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: Paladox 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Add log4j to logstash plugin

2017-12-16 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398660 )

Change subject: Add log4j to logstash plugin
..

Add log4j to logstash plugin

Change-Id: Ic891f936cfc60c1710a6a65f9f6272e4005bb500
---
A puppet/modules/logstash/manifests/input/log4j.pp
A puppet/modules/logstash/templates/input/log4j.erb
M puppet/modules/role/manifests/elk.pp
3 files changed, 42 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/60/398660/1

diff --git a/puppet/modules/logstash/manifests/input/log4j.pp 
b/puppet/modules/logstash/manifests/input/log4j.pp
new file mode 100644
index 000..dc06b12
--- /dev/null
+++ b/puppet/modules/logstash/manifests/input/log4j.pp
@@ -0,0 +1,31 @@
+# vim:sw=4 ts=4 sts=4 et:
+
+# = Define: logstash::input::log4j
+#
+# Configure logstash to collect input as a log4j listener
+#
+# == Parameters:
+# - $ensure: Whether the config should exist. Default present.
+# - $port: port to listen for json input on. Default 12202.
+# - $priority: Configuration loading priority. Default undef.
+#
+# == Sample usage:
+#
+#   logstash::input::log4j {
+#   port => 4560,
+#   }
+#
+define logstash::input::log4j(
+$ensure   = present,
+$port = 4560,
+$priority = 10,
+$mode = 'server',
+$host = '0.0.0.0',
+) {
+logstash::conf { "input_log4j_${title}":
+ensure   => $ensure,
+content  => template('logstash/input/log4j.erb'),
+priority => $priority,
+}
+}
+
diff --git a/puppet/modules/logstash/templates/input/log4j.erb 
b/puppet/modules/logstash/templates/input/log4j.erb
new file mode 100644
index 000..65e8470
--- /dev/null
+++ b/puppet/modules/logstash/templates/input/log4j.erb
@@ -0,0 +1,9 @@
+input {
+  # Log4j socket-based logger
+  log4j {
+type => "log4j"
+port => "<%= @port %>"
+mode => "<%= @mode %>"
+host => "<%= @host %>"
+  }
+}
\ No newline at end of file
diff --git a/puppet/modules/role/manifests/elk.pp 
b/puppet/modules/role/manifests/elk.pp
index 48825b3..7e7a7d4 100644
--- a/puppet/modules/role/manifests/elk.pp
+++ b/puppet/modules/role/manifests/elk.pp
@@ -34,6 +34,8 @@
 port => 12202,
 }
 
+logstash::input::log4j { 'log4j': }
+
 logstash::conf { 'filter_strip_ansi_color':
 source   => 'puppet:///modules/role/elk/filter-strip-ansi-color.conf',
 priority => 40,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic891f936cfc60c1710a6a65f9f6272e4005bb500
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: Paladox 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceSmartlist[master]: BlueSpiceSmartList

2017-12-16 Thread Mglaser (Code Review)
Mglaser has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394979 )

Change subject: BlueSpiceSmartList
..


BlueSpiceSmartList

Added config-data in extension.json.

Removed BsConfig::registerVar-methods in main-class.

Removed BsConfig::get-methods on main-class.

Added $config->get-methods on main-class.

Added config-classes.

Corrected config->get-methods on main-class.

Corrected hook-paths.

Removed default-param on config-class AddComments

Removed ConfigDefinition

Removed related messages in i18n-files.

Corrected option-name on config-class.

Removed unused config definitions.

Corrected config-name.

Corrected default value of config registrations.

Corrected type error.

Change-Id: Ib44ad521d00a021075debca9d2ba108b2c39551f
---
M SmartList.class.php
M extension.json
M i18n/en.json
M i18n/qqq.json
A src/Hook/GetPreferences/AddComments.php
A src/Hook/GetPreferences/AddCount.php
6 files changed, 52 insertions(+), 45 deletions(-)

Approvals:
  Pwirth: Looks good to me, but someone else must approve
  Mglaser: Verified; Looks good to me, approved
  Raimond Spekking: Looks good to me, but someone else must approve



diff --git a/SmartList.class.php b/SmartList.class.php
index 81c1836..76869db 100644
--- a/SmartList.class.php
+++ b/SmartList.class.php
@@ -52,22 +52,6 @@
$this->setHook( 'BSDashboardsUserDashboardPortalPortlets' );
$this->setHook( 'BSUsageTrackerRegisterCollectors' );
 
-   BsConfig::registerVar( 'MW::SmartList::Count', 5, 
BsConfig::LEVEL_USER | BsConfig::TYPE_INT, 'bs-smartlist-pref-count', 'int');
-   BsConfig::registerVar( 'MW::SmartList::Namespaces', array(), 
BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_ARRAY_STRING | 
BsConfig::USE_PLUGIN_FOR_PREFS, 'bs-smartlist-pref-namespaces', 
'multiselectex');
-   BsConfig::registerVar( 'MW::SmartList::Categories', array(), 
BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_ARRAY_STRING, 
'bs-smartlist-pref-categories', 'multiselectplusadd');
-   // possible values: -, day, week, month
-   BsConfig::registerVar( 'MW::SmartList::Period', '-', 
BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_STRING | 
BsConfig::USE_PLUGIN_FOR_PREFS, 'bs-smartlist-pref-period', 'select');
-   BsConfig::registerVar( 'MW::SmartList::ShowMinorChanges', true, 
BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_BOOL, 
'bs-smartlist-pref-showminorchanges', 'toggle');
-   BsConfig::registerVar( 'MW::SmartList::ShowOnlyNewArticles', 
false, BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_BOOL, 
'bs-smartlist-pref-showonlynewarticles', 'toggle');
-   BsConfig::registerVar( 'MW::SmartList::Trim', 20, 
BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_INT, 'bs-smartlist-pref-trim', 'int');
-   BsConfig::registerVar( 'MW::SmartList::ShowText', false, 
BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_BOOL, 'bs-smartlist-pref-showtext', 
'toggle');
-   BsConfig::registerVar( 'MW::SmartList::TrimText', 50, 
BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_INT, 'bs-smartlist-pref-trimtext', 
'int');
-   // possible values: title, time
-   BsConfig::registerVar( 'MW::SmartList::Order', 'DESC', 
BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_STRING | 
BsConfig::USE_PLUGIN_FOR_PREFS, 'bs-smartlist-pref-order', 'select'); 
//title|time
-   BsConfig::registerVar( 'MW::SmartList::Sort', 'time', 
BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_STRING | 
BsConfig::USE_PLUGIN_FOR_PREFS, 'bs-smartlist-pref-sort', 'select');
-   BsConfig::registerVar( 'MW::SmartList::ShowNamespace', true, 
BsConfig::LEVEL_PUBLIC | BsConfig::TYPE_BOOL, 
'bs-smartlist-pref-shownamespace', 'toggle');
-   BsConfig::registerVar( 'MW::SmartList::Comments', false, 
BsConfig::LEVEL_USER | BsConfig::TYPE_BOOL | BsConfig::USE_PLUGIN_FOR_PREFS, 
'bs-smartlist-pref-comments', 'check');
-
wfProfileOut('BS::' . __METHOD__);
}
 
@@ -573,6 +557,7 @@
 */
$aObjectList = array();
$aNamespaceIds = array();
+   $config = 
\MediaWiki\MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 
'bsg' );
 
$oErrorListView = new ViewTagErrorList( $this );
$oValidationResult = BsValidator::isValid( 'ArgCount', 
$aArgs['count'], array( 'fullResponse' => true ) );
@@ -735,7 +720,7 @@
if ( isset( $aArgs['meta'] ) && $aArgs['meta'] == true 
) {
$aFields[] = 'MAX(rc_timestamp) as time, 
rc_user_text as username';
}
-   if ( BsConfig::get( 'MW::SmartList::Comments' ) ) {
+   if ( $config->get( 'bs-smartlist-pref-comments' ) ) {
$aFields[] = 'MAX(rc_comment) as comment';
}
$res = $dbr->select(
@@ 

[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Refactored UserMiniProfile and UserProfileImage DFD-Module

2017-12-16 Thread Robert Vogel (Code Review)
Robert Vogel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398659 )

Change subject: Refactored UserMiniProfile and UserProfileImage DFD-Module
..

Refactored UserMiniProfile and UserProfileImage DFD-Module

* Moved user setting to Extension:BlueSpiceAvatars
* Therefore BSF only handles "anon" and "default"

Change-Id: I4958c75cc66b5c9c863e0471ca3c5fe511dad0b1
---
M includes/outputhandler/views/view.UserMiniProfile.php
M src/DynamicFileDispatcher/UserProfileImage.php
A src/DynamicFileDispatcher/UserProfileImage/AnonImage.php
A src/DynamicFileDispatcher/UserProfileImage/DefaultImage.php
D src/DynamicFileDispatcher/UserProfileImage/Image.php
D src/DynamicFileDispatcher/UserProfileImage/ImageExternal.php
6 files changed, 72 insertions(+), 209 deletions(-)


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

diff --git a/includes/outputhandler/views/view.UserMiniProfile.php 
b/includes/outputhandler/views/view.UserMiniProfile.php
index 5bc65b1..5c67d6b 100644
--- a/includes/outputhandler/views/view.UserMiniProfile.php
+++ b/includes/outputhandler/views/view.UserMiniProfile.php
@@ -1,7 +1,8 @@
 aDefaultClasses;
 
$params = array_merge( $this->mOptions, [
-   Params::MODULE => 'userprofileimage',
-   'username' => $this->mOptions['user']->getName(),
+   Params::MODULE => UserProfileImage::MODULE_NAME,
+   UserProfileImage::USERNAME => 
$this->mOptions['user']->getName(),
+   UserProfileImage::WIDTH => 
(int)$this->mOptions['width'],
+   UserProfileImage::HEIGHT => 
(int)$this->mOptions['height']
]);
-   $dfdUrlBuilder = MediaWikiServices::getInstance()->getService(
-   'BSDynamicFileDispatcherUrlBuilder'
-   );
-   $url = $dfdUrlBuilder->build(
-   new Params( $params )
-   );
+
+   $dfdUrlBuilder = 
Services::getInstance()->getBSDynamicFileDispatcherUrlBuilder();
+   $url = $dfdUrlBuilder->build( new Params( $params ) );
 
$aOut = array();
$aOut[] = '';
@@ -101,69 +101,6 @@
);
}
 
-   if( empty( $this->mOptions['userimagesrc'] ) ) {
-   $this->mOptions['userimagesrc'] = 
$GLOBALS['wgScriptPath']
-   
."/extensions/BlueSpiceFoundation/resources/bluespice/images/bs-user-default-image.png";
-   }
-
-   if ( $oUser->isAnon() ) {
-   $this->mOptions['userimagesrc'] = 
$GLOBALS['wgScriptPath']
-   
."/extensions/BlueSpiceFoundation/resources/bluespice/images/bs-user-anon-image.png";
-   $this->mOptions['linktargethref'] = '';
-   } else {
-   $sUserImageName = BsConfig::getVarForUser( 
'MW::UserImage', $oUser );
-   if ( !empty( $sUserImageName ) ) { //Image given as a 
url
-
-   if ( $sUserImageName{0} == '/' ) {
-   //relative url from own system given
-   $this->mOptions['userimagesrc'] = 
$sUserImageName;
-   } elseif ( $this->isExternalUrl( 
$sUserImageName ) ) {
-   $aParsedUrl = wfParseUrl( 
$sUserImageName );
-   //external url
-   //TODO: Fix, when system is call via 
https:// and the given
-   //url is http:// the browser will block 
the image
-   $bAllowedProtocoll = in_array(
-   
$aParsedUrl['scheme'].$aParsedUrl['delimiter'],
-   $wgUrlProtocols
-   );
-   if( $bAllowedProtocoll ) {
-   $sQuery = isset( 
$aParsedUrl['query'] ) ?
-   
"?{$aParsedUrl['query']}"
-   : ''
-   ;
-   $this->mOptions['userimagesrc'] 
=
-   $aParsedUrl['scheme']
-   
.$aParsedUrl['delimiter']
-   .$aParsedUrl['host']
-   .$aParsedUrl['path']
-   .$sQuery
- 

[MediaWiki-commits] [Gerrit] mediawiki...GraphViz[master]: Removed passed sniffs from .phpcs.xml

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

Change subject: Removed passed sniffs from .phpcs.xml
..


Removed passed sniffs from .phpcs.xml

Follow-Up: I8c8a47b13ca79be5789f796fe77e2b4fff28cb03
Change-Id: Ifbeb40ace9e6b52984b11133d22bcbb5f560640d
---
M .phpcs.xml
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/.phpcs.xml b/.phpcs.xml
index 1e67803..e284282 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -8,8 +8,6 @@



-   
-   

.


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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifbeb40ace9e6b52984b11133d22bcbb5f560640d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GraphViz
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Fix "Cannot alias File[/vagrant/settings.d/wikis/]"

2017-12-16 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398658 )

Change subject: Fix "Cannot alias File[/vagrant/settings.d/wikis/]"
..

Fix "Cannot alias File[/vagrant/settings.d/wikis/]"

Error: Cannot alias File[/vagrant/settings.d/wikis/] to 
["/vagrant/settings.d/wikis"]
at /vagrant/puppet/modules/mediawiki/manifests/wiki.pp:188;
resource ["File", "/vagrant/settings.d/wikis"] already declared
at /vagrant/puppet/modules/mediawiki/manifests/multiwiki.pp:76

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/58/398658/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id40344e4cb9489e1fb2201faa75a667b0e71e191
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: Paladox 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Change BlueSpice\Services to be decorator

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

Change subject: Change BlueSpice\Services to be decorator
..


Change BlueSpice\Services to be decorator

... of MediaWikiServices

Change-Id: I1d4b1eb462e9942a2f63b53087c38ba188e93ee1
---
M src/Services.php
A src/ServicesDecorator.php
2 files changed, 406 insertions(+), 9 deletions(-)

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



diff --git a/src/Services.php b/src/Services.php
index 5f8f51d..5ce168e 100644
--- a/src/Services.php
+++ b/src/Services.php
@@ -4,14 +4,14 @@
 
 use MediaWiki\MediaWikiServices;
 
-class Services extends MediaWikiServices {
+class Services extends ServicesDecorator {
 
/**
 *
 * @return ExtensionRegistry
 */
public function getBSExtensionRegistry() {
-   return $this->getService( 'BSExtensionRegistry' );
+   return $this->decoratedServices->getService( 
'BSExtensionRegistry' );
}
 
/**
@@ -19,7 +19,7 @@
 * @return ExtensionFactory
 */
public function getBSExtensionFactory() {
-   return $this->getService( 'BSExtensionFactory' );
+   return $this->decoratedServices->getService( 
'BSExtensionFactory' );
}
 
/**
@@ -27,7 +27,7 @@
 * @return ConfigDefinitionFactory
 */
public function getBSConfigDefinitionFactory() {
-   return $this->getService( 'BSConfigDefinitionFactory' );
+   return $this->decoratedServices->getService( 
'BSConfigDefinitionFactory' );
}
 
/**
@@ -35,7 +35,7 @@
 * @return DynamicFileDispatcher\Factory
 */
public function getBSDynamicFileDispatcherFactory() {
-   return $this->getService( 'BSDynamicFileDispatcherFactory' );
+   return $this->decoratedServices->getService( 
'BSDynamicFileDispatcherFactory' );
}
 
/**
@@ -43,7 +43,7 @@
 * @return DynamicFileDispatcher\UrlBuilder
 */
public function getBSDynamicFileDispatcherUrlBuilder() {
-   return $this->getService( 'BSDynamicFileDispatcherUrlBuilder' );
+   return $this->decoratedServices->getService( 
'BSDynamicFileDispatcherUrlBuilder' );
}
 
/**
@@ -51,7 +51,7 @@
 * @return EntityRegistry
 */
public function getBSEntityRegistry() {
-   return $this->getService( 'BSEntityRegistry' );
+   return $this->decoratedServices->getService( 'BSEntityRegistry' 
);
}
 
/**
@@ -59,7 +59,7 @@
 * @return EntityConfigFactory
 */
public function getBSEntityConfigFactory() {
-   return $this->getService( 'BSEntityConfigFactory' );
+   return $this->decoratedServices->getService( 
'BSEntityConfigFactory' );
}
 
/**
@@ -67,6 +67,6 @@
 * @return EntityFactory
 */
public function getBSEntityFactory() {
-   return $this->getService( 'BSEntityFactory' );
+   return $this->decoratedServices->getService( 'BSEntityFactory' 
);
}
 }
\ No newline at end of file
diff --git a/src/ServicesDecorator.php b/src/ServicesDecorator.php
new file mode 100644
index 000..07a4008
--- /dev/null
+++ b/src/ServicesDecorator.php
@@ -0,0 +1,397 @@
+decoratedServices = $services;
+   }
+
+   /**
+* @params MediaWikiServices
+* @return Services
+* @throws MWException
+* @throws \FatalError
+*/
+   private static function newInstance( $services ) {
+   $instance = new static( $services );
+
+   \Hooks::run( 'BlueSpiceServices', [ $instance ] );
+
+   return $instance;
+   }
+
+   /**
+* Returns a service object of the kind associated with $name.
+* Services instances are instantiated lazily, on demand.
+* This method may or may not return the same service instance
+* when called multiple times with the same $name.
+*
+* @note Rather than calling this method directly, it is recommended to 
provide
+* getters with more meaningful names and more specific return types, 
using
+* a subclass or wrapper.
+*
+* @see redefineService().
+*
+* @param string $name The service name
+*
+* @throws NoSuchServiceException if $name is not a known service.
+* @throws ContainerDisabledException if this container has already 
been destroyed.
+* @throws ServiceDisabledException if the requested service has been 
disabled.
+*
+* @return object The service instance
+*/
+   public function getService( $name ) {
+   return $this->decoratedServices->getService( $name );
+   }
+
+   /**
+* 

[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: README.md change

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398657 )

Change subject: README.md change
..


README.md change

Change-Id: I3d136e860ed7a74db7650b84bef4ab53861ae11f
---
M README.md
1 file changed, 10 insertions(+), 3 deletions(-)

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



diff --git a/README.md b/README.md
index 42231e7..0114fd7 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,17 @@
 # WDCM
 Wikidata Concept Monitor
 
-Wikidata Concept Monitor (WDCM) is a set of analytical dashboards that track 
the usage of Wikidata across the Wikimedia projects.
-WDCM is currently under development. All R scrips should be considered as test 
versions only.
-Thorough documentation will be provided soon. Stay tuned.
+The Wikidata Concepts Monitor (WDCM) (aka: Q42376073) is an analytical tool 
that enables you to browse and build an understanding of the way Wikidata is 
used across the Wikimedia projects.
 
+While Wikidata itself is a semantic ontology with pre-defined and evolving 
normative rules of description and inference, Wikidata usage is essentialy a 
social, behavioral phenomenon, suitable for study by means of machine learning 
in the field of distributional semantics: the analysis and modeling of 
statistical patterns of occurrence and co-occurence of Wikidata item and 
property usage across the client projects (e.g. enwiki, frwiki, ruwiki, etc). 
+
+WDCM thus employs various statistical methodologies in an attempt to describe 
and provide insights from the observable Wikidata usage statistics (e.g. topic 
modeling, clustering, dimensionality reduction, all beyond providing elementary 
descriptive statistics of Wikidata usage, of course.).
+
+The WDCM is designed to become a path towards discovery: following the 
examples listed here not only that you can learn to work with a system that 
might improve your understanding of Wikidata, but you could also find yourself 
involved in adventurous attempts to learn and discover more of it.
+
+WDCM Wiki project page: 
https://www.wikidata.org/wiki/Wikidata:Wikidata_Concepts_Monitor
+WDCM Wikitech page: 
https://wikitech.wikimedia.org/wiki/Wikidata_Concepts_Monitor
+WDCM User Feedback page: 
https://www.wikidata.org/wiki/Wikidata:Wikidata_Concepts_Monitor/UserFeedback
 ---
 
 WDCM is developed by Goran S. Milovanovic, Data Analyst, WMDE, under the 
contract between Goran Milovanovic PR Data Kolektiv and WMDE.
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3d136e860ed7a74db7650b84bef4ab53861ae11f
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/WDCM
Gerrit-Branch: master
Gerrit-Owner: GoranSMilovanovic 
Gerrit-Reviewer: GoranSMilovanovic 

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


[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: README.md change

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398657 )

Change subject: README.md change
..

README.md change

Change-Id: I3d136e860ed7a74db7650b84bef4ab53861ae11f
---
M README.md
1 file changed, 10 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/WDCM 
refs/changes/57/398657/1

diff --git a/README.md b/README.md
index 42231e7..0114fd7 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,17 @@
 # WDCM
 Wikidata Concept Monitor
 
-Wikidata Concept Monitor (WDCM) is a set of analytical dashboards that track 
the usage of Wikidata across the Wikimedia projects.
-WDCM is currently under development. All R scrips should be considered as test 
versions only.
-Thorough documentation will be provided soon. Stay tuned.
+The Wikidata Concepts Monitor (WDCM) (aka: Q42376073) is an analytical tool 
that enables you to browse and build an understanding of the way Wikidata is 
used across the Wikimedia projects.
 
+While Wikidata itself is a semantic ontology with pre-defined and evolving 
normative rules of description and inference, Wikidata usage is essentialy a 
social, behavioral phenomenon, suitable for study by means of machine learning 
in the field of distributional semantics: the analysis and modeling of 
statistical patterns of occurrence and co-occurence of Wikidata item and 
property usage across the client projects (e.g. enwiki, frwiki, ruwiki, etc). 
+
+WDCM thus employs various statistical methodologies in an attempt to describe 
and provide insights from the observable Wikidata usage statistics (e.g. topic 
modeling, clustering, dimensionality reduction, all beyond providing elementary 
descriptive statistics of Wikidata usage, of course.).
+
+The WDCM is designed to become a path towards discovery: following the 
examples listed here not only that you can learn to work with a system that 
might improve your understanding of Wikidata, but you could also find yourself 
involved in adventurous attempts to learn and discover more of it.
+
+WDCM Wiki project page: 
https://www.wikidata.org/wiki/Wikidata:Wikidata_Concepts_Monitor
+WDCM Wikitech page: 
https://wikitech.wikimedia.org/wiki/Wikidata_Concepts_Monitor
+WDCM User Feedback page: 
https://www.wikidata.org/wiki/Wikidata:Wikidata_Concepts_Monitor/UserFeedback
 ---
 
 WDCM is developed by Goran S. Milovanovic, Data Analyst, WMDE, under the 
contract between Goran Milovanovic PR Data Kolektiv and WMDE.
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d136e860ed7a74db7650b84bef4ab53861ae11f
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/WDCM
Gerrit-Branch: master
Gerrit-Owner: GoranSMilovanovic 

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


[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: .csv deletions 16 Dec 2017

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398656 )

Change subject: .csv deletions 16 Dec 2017
..


.csv deletions 16 Dec 2017

Change-Id: Ib6689cfad6a7480053aacc8ed5430845c4ebcb76
---
D WDCM_CollectedGeoItems/archive_ItemIDs.csv
D WDCM_CollectedGeoItems/art gallery_ItemIDs.csv
D WDCM_CollectedGeoItems/botanical garden_ItemIDs.csv
D WDCM_CollectedGeoItems/city_ItemIDs.csv
D WDCM_CollectedGeoItems/country_ItemIDs.csv
D WDCM_CollectedGeoItems/library_ItemIDs.csv
D WDCM_CollectedGeoItems/museum_ItemIDs.csv
D WDCM_CollectedGeoItems/university_ItemIDs.csv
D WDCM_CollectedGeoItems/zoological garden_ItemIDs.csv
D WDCM_CollectedItems/Human_ItemIDs.csv
D WDCM_CollectedItems/Wikimedia_Internal_ItemIDs.csv
11 files changed, 0 insertions(+), 68,016 deletions(-)

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6689cfad6a7480053aacc8ed5430845c4ebcb76
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/WDCM
Gerrit-Branch: master
Gerrit-Owner: GoranSMilovanovic 
Gerrit-Reviewer: GoranSMilovanovic 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: .csv deletions 16 Dec 2017

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398656 )

Change subject: .csv deletions 16 Dec 2017
..

.csv deletions 16 Dec 2017

Change-Id: Ib6689cfad6a7480053aacc8ed5430845c4ebcb76
---
D WDCM_CollectedGeoItems/archive_ItemIDs.csv
D WDCM_CollectedGeoItems/art gallery_ItemIDs.csv
D WDCM_CollectedGeoItems/botanical garden_ItemIDs.csv
D WDCM_CollectedGeoItems/city_ItemIDs.csv
D WDCM_CollectedGeoItems/country_ItemIDs.csv
D WDCM_CollectedGeoItems/library_ItemIDs.csv
D WDCM_CollectedGeoItems/museum_ItemIDs.csv
D WDCM_CollectedGeoItems/university_ItemIDs.csv
D WDCM_CollectedGeoItems/zoological garden_ItemIDs.csv
D WDCM_CollectedItems/Human_ItemIDs.csv
D WDCM_CollectedItems/Wikimedia_Internal_ItemIDs.csv
11 files changed, 0 insertions(+), 68,016 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/WDCM 
refs/changes/56/398656/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6689cfad6a7480053aacc8ed5430845c4ebcb76
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/WDCM
Gerrit-Branch: master
Gerrit-Owner: GoranSMilovanovic 

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


[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: Production v2 16 Dec 2017

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398655 )

Change subject: Production v2 16 Dec 2017
..


Production v2 16 Dec 2017

Change-Id: Icb4fa9f89460e8a6290a34e6305370a756d4a706
---
D WDCM_Collect_Items.R
A WDCM_CollectedGeoItems/.directory
A WDCM_CollectedGeoItems/archive_ItemIDs.csv
A WDCM_CollectedGeoItems/art gallery_ItemIDs.csv
A WDCM_CollectedGeoItems/botanical garden_ItemIDs.csv
A WDCM_CollectedGeoItems/city_ItemIDs.csv
A WDCM_CollectedGeoItems/country_ItemIDs.csv
A WDCM_CollectedGeoItems/library_ItemIDs.csv
A WDCM_CollectedGeoItems/museum_ItemIDs.csv
A WDCM_CollectedGeoItems/university_ItemIDs.csv
A WDCM_CollectedGeoItems/zoological garden_ItemIDs.csv
A WDCM_CollectedItems/.directory
A WDCM_CollectedItems/Human_ItemIDs.csv
A WDCM_CollectedItems/Wikimedia_Internal_ItemIDs.csv
M WDCM_Engine_goransm.R
A WDCM_Ontology/WDCM_GeoItems_Belgrade_12152017.csv
A WDCM_Ontology/WDCM_Ontology_Berlin_05032017.csv
D WDCM_Pre-Process.R
D WDCM_Process.R
D WDCM_Search_Clients.R
D WDCM_Search_Clients_MariaDB.R
M WDCM_Sqoop_Clients.R
M _installProduction_analytics-wmde.R
23 files changed, 68,601 insertions(+), 1,920 deletions(-)

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icb4fa9f89460e8a6290a34e6305370a756d4a706
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/WDCM
Gerrit-Branch: master
Gerrit-Owner: GoranSMilovanovic 
Gerrit-Reviewer: GoranSMilovanovic 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: Production v2 16 Dec 2017

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398655 )

Change subject: Production v2 16 Dec 2017
..

Production v2 16 Dec 2017

Change-Id: Icb4fa9f89460e8a6290a34e6305370a756d4a706
---
D WDCM_Collect_Items.R
A WDCM_CollectedGeoItems/.directory
A WDCM_CollectedGeoItems/archive_ItemIDs.csv
A WDCM_CollectedGeoItems/art gallery_ItemIDs.csv
A WDCM_CollectedGeoItems/botanical garden_ItemIDs.csv
A WDCM_CollectedGeoItems/city_ItemIDs.csv
A WDCM_CollectedGeoItems/country_ItemIDs.csv
A WDCM_CollectedGeoItems/library_ItemIDs.csv
A WDCM_CollectedGeoItems/museum_ItemIDs.csv
A WDCM_CollectedGeoItems/university_ItemIDs.csv
A WDCM_CollectedGeoItems/zoological garden_ItemIDs.csv
A WDCM_CollectedItems/.directory
A WDCM_CollectedItems/Human_ItemIDs.csv
A WDCM_CollectedItems/Wikimedia_Internal_ItemIDs.csv
M WDCM_Engine_goransm.R
A WDCM_Ontology/WDCM_GeoItems_Belgrade_12152017.csv
A WDCM_Ontology/WDCM_Ontology_Berlin_05032017.csv
D WDCM_Pre-Process.R
D WDCM_Process.R
D WDCM_Search_Clients.R
D WDCM_Search_Clients_MariaDB.R
M WDCM_Sqoop_Clients.R
M _installProduction_analytics-wmde.R
23 files changed, 68,601 insertions(+), 1,920 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/WDCM 
refs/changes/55/398655/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb4fa9f89460e8a6290a34e6305370a756d4a706
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wmde/WDCM
Gerrit-Branch: master
Gerrit-Owner: GoranSMilovanovic 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Change BlueSpice\Services to be decorator

2017-12-16 Thread Robert Vogel (Code Review)
Robert Vogel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398654 )

Change subject: Change BlueSpice\Services to be decorator
..

Change BlueSpice\Services to be decorator

... of MediaWikiServices

Change-Id: I1d4b1eb462e9942a2f63b53087c38ba188e93ee1
---
M src/Services.php
A src/ServicesDecorator.php
2 files changed, 388 insertions(+), 9 deletions(-)


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

diff --git a/src/Services.php b/src/Services.php
index 5f8f51d..5ce168e 100644
--- a/src/Services.php
+++ b/src/Services.php
@@ -4,14 +4,14 @@
 
 use MediaWiki\MediaWikiServices;
 
-class Services extends MediaWikiServices {
+class Services extends ServicesDecorator {
 
/**
 *
 * @return ExtensionRegistry
 */
public function getBSExtensionRegistry() {
-   return $this->getService( 'BSExtensionRegistry' );
+   return $this->decoratedServices->getService( 
'BSExtensionRegistry' );
}
 
/**
@@ -19,7 +19,7 @@
 * @return ExtensionFactory
 */
public function getBSExtensionFactory() {
-   return $this->getService( 'BSExtensionFactory' );
+   return $this->decoratedServices->getService( 
'BSExtensionFactory' );
}
 
/**
@@ -27,7 +27,7 @@
 * @return ConfigDefinitionFactory
 */
public function getBSConfigDefinitionFactory() {
-   return $this->getService( 'BSConfigDefinitionFactory' );
+   return $this->decoratedServices->getService( 
'BSConfigDefinitionFactory' );
}
 
/**
@@ -35,7 +35,7 @@
 * @return DynamicFileDispatcher\Factory
 */
public function getBSDynamicFileDispatcherFactory() {
-   return $this->getService( 'BSDynamicFileDispatcherFactory' );
+   return $this->decoratedServices->getService( 
'BSDynamicFileDispatcherFactory' );
}
 
/**
@@ -43,7 +43,7 @@
 * @return DynamicFileDispatcher\UrlBuilder
 */
public function getBSDynamicFileDispatcherUrlBuilder() {
-   return $this->getService( 'BSDynamicFileDispatcherUrlBuilder' );
+   return $this->decoratedServices->getService( 
'BSDynamicFileDispatcherUrlBuilder' );
}
 
/**
@@ -51,7 +51,7 @@
 * @return EntityRegistry
 */
public function getBSEntityRegistry() {
-   return $this->getService( 'BSEntityRegistry' );
+   return $this->decoratedServices->getService( 'BSEntityRegistry' 
);
}
 
/**
@@ -59,7 +59,7 @@
 * @return EntityConfigFactory
 */
public function getBSEntityConfigFactory() {
-   return $this->getService( 'BSEntityConfigFactory' );
+   return $this->decoratedServices->getService( 
'BSEntityConfigFactory' );
}
 
/**
@@ -67,6 +67,6 @@
 * @return EntityFactory
 */
public function getBSEntityFactory() {
-   return $this->getService( 'BSEntityFactory' );
+   return $this->decoratedServices->getService( 'BSEntityFactory' 
);
}
 }
\ No newline at end of file
diff --git a/src/ServicesDecorator.php b/src/ServicesDecorator.php
new file mode 100644
index 000..83c0cdf
--- /dev/null
+++ b/src/ServicesDecorator.php
@@ -0,0 +1,379 @@
+decoratedServices = $services;
+   }
+
+   /**
+* @params MediaWikiServices
+* @return Services
+* @throws MWException
+* @throws \FatalError
+*/
+   private static function newInstance( $services ) {
+   $instance = new static( $services );
+
+   \Hooks::run( 'BlueSpiceServices', [ $instance ] );
+
+   return $instance;
+   }
+
+   /*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+* Returns the Config object containing the bootstrap configuration.
+* Bootstrap configuration would typically include database credentials
+* and other information that may be needed before the ConfigFactory
+* service can be instantiated.
+*
+* @note This should only be used during bootstrapping, in particular
+* when creating the MainConfig service. Application logic should
+* use getMainConfig() to get a Config instances.
+*
+* @since 1.27
+* @return Config
+*/
+   public function getBootstrapConfig() {
+   return $this->decoratedServices->getService( 'BootstrapConfig' 
);
+   }
+
+   /**
+* @since 1.27
+* @return ConfigFactory
+*/
+   public function getConfigFactory() {
+   return 

[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: EngineGeo Dec 16 2017

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398652 )

Change subject: EngineGeo Dec 16 2017
..


EngineGeo Dec 16 2017

Change-Id: I3c5c2bdcd1503c99d5a8e22a2ee849edccae25ed
---
A WDCM_EngineGeo_goransm.R
1 file changed, 1,116 insertions(+), 0 deletions(-)

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



diff --git a/WDCM_EngineGeo_goransm.R b/WDCM_EngineGeo_goransm.R
new file mode 100644
index 000..7013c3a
--- /dev/null
+++ b/WDCM_EngineGeo_goransm.R
@@ -0,0 +1,1116 @@
+#!/usr/bin/env Rscript
+
+### ---
+### --- WDCM EngineGeo, v. Beta 0.1
+### --- Script: WDCM_EngineGeo.R, v. Beta 0.1
+### --- Author: Goran S. Milovanovic, Data Analyst, WMDE
+### --- Developed under the contract between Goran Milovanovic PR Data Kolektiv
+### --- and WMDE.
+### --- Contact: goran.milovanovic_...@wikimedia.de
+### ---
+### --- DESCRIPTION:
+### --- WDCM_Engine_Geo contacts the WDQS SPARQL end-point
+### --- and fetches the item IDs for several Wikidata concepts
+### --- that have geographical co-ordinates. 
+### --- WDCM_Pre-Process.R
+### --- The remainder of the script searches the Hive goransm.wdcm_maintable
+### --- for usage data and prepares the export .tsv files
+### --- that migrate to Labs (wikidataconcepts, currently) where they are
+### --- additionaly processed and stored to MariaDB to support
+### --- the WDCM Geo Dashboard.
+### --- NOTE: the execution of this WDCM script is always dependent upon the
+### --- previous WDCM_Sqoop_Clients.R run from stat1004 (currently).
+### ---
+### --- RUN FROM: /home/goransm/RScripts/WDCM_R
+### --- nohup Rscript WDCM_EngineGeo_goransm.R &
+### ---
+
+### ---
+### --- LICENSE:
+### ---
+### --- GPL v2
+### --- This file is part of Wikidata Concepts Monitor (WDCM)
+### ---
+### --- WDCM is free software: you can redistribute it and/or modify
+### --- it under the terms of the GNU General Public License as published by
+### --- the Free Software Foundation, either version 2 of the License, or
+### --- (at your option) any later version.
+### ---
+### --- WDCM is distributed in the hope that it will be useful,
+### --- but WITHOUT ANY WARRANTY; without even the implied warranty of
+### --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+### --- GNU General Public License for more details.
+### ---
+### --- You should have received a copy of the GNU General Public License
+### --- along with WDCM. If not, see .
+### ---
+
+### ---
+### --- Step 1: Collect from WQDS
+### ---
+
+### --- Setup
+# - contact:
+library(httr)
+library(XML)
+# - wrangling:
+library(stringr)
+library(readr)
+library(data.table)
+library(tidyr)
+library(jsonlite)
+
+### --- Directories
+# - fPath: where the scripts is run from?
+fPath <- 
'/home/goransm/Work/___DataKolektiv/Projects/WikimediaDEU/_WMDE_Projects/WDCM_Dev/WDCM/'
+# - form paths:
+ontologyDir <- paste(fPath, 'WDCM_Ontology', sep = "")
+logDir <- paste(fPath, 'WDCM_Logs', sep = "")
+itemsDir <- paste(fPath, 'WDCM_CollectedGeoItems', sep = "")
+# - stat1005 published-datasets, maps onto 
+# - https://analytics.wikimedia.org/datasets/wdcm/
+dataDir <- '/srv/published-datasets/wdcm'
+
+# - to runtime Log:
+print(paste("--- UPDATE RUN STARTED ON:", Sys.time(), sep = " "))
+
+### --- Set proxy
+# Sys.setenv(
+#   http_proxy = "http://webproxy.eqiad.wmnet:8080;,
+#   https_proxy = "http://webproxy.eqiad.wmnet:8080;)
+
+### --- Read WDCM_GeoItems
+# - to runtime Log:
+print("--- Reading Ontology.")
+setwd(ontologyDir)
+wdcmGeoItems <- read.csv("WDCM_GeoItems_Belgrade_12152017.csv",
+ header = T,
+ check.names = F,
+ stringsAsFactors = F)
+
+### --- Select all instances accross all sub-classes of searchItems:
+# - endPoint:
+endPointURL <- 
"https://query.wikidata.org/bigdata/namespace/wdq/sparql?format=json=;
+
+# - set itemsDir:
+setwd(itemsDir)
+
+# - clear output dir:
+lF <- list.files()
+rmF <- file.remove(lF)
+
+# - track uncompleted queries:
+qErrors <- character()
+
+# - startTime (WDCM Main Report)
+startTime <- as.character(Sys.time())
+
+for (i in 1:length(wdcmGeoItems$item)) {
+
+  # - to runtime Log:
+  print(paste("--- SPARQL category:", 

[MediaWiki-commits] [Gerrit] analytics...WDCM[master]: EngineGeo Dec 16 2017

2017-12-16 Thread GoranSMilovanovic (Code Review)
GoranSMilovanovic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398652 )

Change subject: EngineGeo Dec 16 2017
..

EngineGeo Dec 16 2017

Change-Id: I3c5c2bdcd1503c99d5a8e22a2ee849edccae25ed
---
A WDCM_EngineGeo_goransm.R
1 file changed, 1,116 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wmde/WDCM 
refs/changes/52/398652/1

diff --git a/WDCM_EngineGeo_goransm.R b/WDCM_EngineGeo_goransm.R
new file mode 100644
index 000..7013c3a
--- /dev/null
+++ b/WDCM_EngineGeo_goransm.R
@@ -0,0 +1,1116 @@
+#!/usr/bin/env Rscript
+
+### ---
+### --- WDCM EngineGeo, v. Beta 0.1
+### --- Script: WDCM_EngineGeo.R, v. Beta 0.1
+### --- Author: Goran S. Milovanovic, Data Analyst, WMDE
+### --- Developed under the contract between Goran Milovanovic PR Data Kolektiv
+### --- and WMDE.
+### --- Contact: goran.milovanovic_...@wikimedia.de
+### ---
+### --- DESCRIPTION:
+### --- WDCM_Engine_Geo contacts the WDQS SPARQL end-point
+### --- and fetches the item IDs for several Wikidata concepts
+### --- that have geographical co-ordinates. 
+### --- WDCM_Pre-Process.R
+### --- The remainder of the script searches the Hive goransm.wdcm_maintable
+### --- for usage data and prepares the export .tsv files
+### --- that migrate to Labs (wikidataconcepts, currently) where they are
+### --- additionaly processed and stored to MariaDB to support
+### --- the WDCM Geo Dashboard.
+### --- NOTE: the execution of this WDCM script is always dependent upon the
+### --- previous WDCM_Sqoop_Clients.R run from stat1004 (currently).
+### ---
+### --- RUN FROM: /home/goransm/RScripts/WDCM_R
+### --- nohup Rscript WDCM_EngineGeo_goransm.R &
+### ---
+
+### ---
+### --- LICENSE:
+### ---
+### --- GPL v2
+### --- This file is part of Wikidata Concepts Monitor (WDCM)
+### ---
+### --- WDCM is free software: you can redistribute it and/or modify
+### --- it under the terms of the GNU General Public License as published by
+### --- the Free Software Foundation, either version 2 of the License, or
+### --- (at your option) any later version.
+### ---
+### --- WDCM is distributed in the hope that it will be useful,
+### --- but WITHOUT ANY WARRANTY; without even the implied warranty of
+### --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+### --- GNU General Public License for more details.
+### ---
+### --- You should have received a copy of the GNU General Public License
+### --- along with WDCM. If not, see .
+### ---
+
+### ---
+### --- Step 1: Collect from WQDS
+### ---
+
+### --- Setup
+# - contact:
+library(httr)
+library(XML)
+# - wrangling:
+library(stringr)
+library(readr)
+library(data.table)
+library(tidyr)
+library(jsonlite)
+
+### --- Directories
+# - fPath: where the scripts is run from?
+fPath <- 
'/home/goransm/Work/___DataKolektiv/Projects/WikimediaDEU/_WMDE_Projects/WDCM_Dev/WDCM/'
+# - form paths:
+ontologyDir <- paste(fPath, 'WDCM_Ontology', sep = "")
+logDir <- paste(fPath, 'WDCM_Logs', sep = "")
+itemsDir <- paste(fPath, 'WDCM_CollectedGeoItems', sep = "")
+# - stat1005 published-datasets, maps onto 
+# - https://analytics.wikimedia.org/datasets/wdcm/
+dataDir <- '/srv/published-datasets/wdcm'
+
+# - to runtime Log:
+print(paste("--- UPDATE RUN STARTED ON:", Sys.time(), sep = " "))
+
+### --- Set proxy
+# Sys.setenv(
+#   http_proxy = "http://webproxy.eqiad.wmnet:8080;,
+#   https_proxy = "http://webproxy.eqiad.wmnet:8080;)
+
+### --- Read WDCM_GeoItems
+# - to runtime Log:
+print("--- Reading Ontology.")
+setwd(ontologyDir)
+wdcmGeoItems <- read.csv("WDCM_GeoItems_Belgrade_12152017.csv",
+ header = T,
+ check.names = F,
+ stringsAsFactors = F)
+
+### --- Select all instances accross all sub-classes of searchItems:
+# - endPoint:
+endPointURL <- 
"https://query.wikidata.org/bigdata/namespace/wdq/sparql?format=json=;
+
+# - set itemsDir:
+setwd(itemsDir)
+
+# - clear output dir:
+lF <- list.files()
+rmF <- file.remove(lF)
+
+# - track uncompleted queries:
+qErrors <- character()
+
+# - startTime (WDCM Main Report)
+startTime <- as.character(Sys.time())
+
+for (i in 1:length(wdcmGeoItems$item)) {
+
+  # - to runtime Log:
+  print(paste("--- SPARQL 

[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Introduce ScoreStorage and its Sql implementetion

2017-12-16 Thread Ladsgroup (Code Review)
Ladsgroup has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398651 )

Change subject: Introduce ScoreStorage and its Sql implementetion
..

Introduce ScoreStorage and its Sql implementetion

It will take over some works of the Cache.php

Bug: T181334
Change-Id: I94025f3ee38ee723a4f9e8c08d353be27b3d7558
---
M includes/ServiceWiring.php
A includes/Storage/ScoreStorage.php
A includes/Storage/SqlScoreStorage.php
A tests/phpunit/includes/Storage/SqlScoreStorageTest.php
4 files changed, 303 insertions(+), 1 deletion(-)


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

diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php
index 458c902..0d114ad 100644
--- a/includes/ServiceWiring.php
+++ b/includes/ServiceWiring.php
@@ -19,6 +19,7 @@
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
 use ORES\Storage\SqlModelLookup;
+use ORES\Storage\SqlScoreStorage;
 
 return [
'ORESModelLookup' => function ( MediaWikiServices $services ) {
@@ -31,6 +32,13 @@
$services->getMainWANObjectCache(),
LoggerFactory::getInstance( 'ORES' )
);
-   }
+   },
+
+   'ORESScoreStorage' => function ( MediaWikiServices $services ) {
+   return new SqlScoreStorage(
+   $services->getDBLoadBalancer(),
+   $services->getService( 'ORESModelLookup' )
+   );
+   },
 
 ];
diff --git a/includes/Storage/ScoreStorage.php 
b/includes/Storage/ScoreStorage.php
new file mode 100644
index 000..ce9325e
--- /dev/null
+++ b/includes/Storage/ScoreStorage.php
@@ -0,0 +1,34 @@
+http://www.gnu.org/licenses/>.
+ */
+
+namespace ORES\Storage;
+
+/**
+ * Service interface to store score data in storage.
+ *
+ * @license GPL-2.0+
+ */
+interface ScoreStorage {
+
+   /**
+* Save scores to the database
+*
+* @param array[] $scores in the same structure as is returned by ORES.
+* @param callable $errorCallback The callback when parsing a revision 
fails
+*/
+   public function storeScores( $scores, callable $errorCallback = null );
+
+}
diff --git a/includes/Storage/SqlScoreStorage.php 
b/includes/Storage/SqlScoreStorage.php
new file mode 100644
index 000..274273c
--- /dev/null
+++ b/includes/Storage/SqlScoreStorage.php
@@ -0,0 +1,77 @@
+http://www.gnu.org/licenses/>.
+ */
+
+namespace ORES\Storage;
+
+use InvalidArgumentException;
+use ORES\Parser\ScoreParser;
+use RuntimeException;
+use Wikimedia\Rdbms\LoadBalancer;
+
+class SqlScoreStorage implements ScoreStorage {
+
+   private $loadBalancer;
+
+   private $modelLookup;
+
+   public function __construct(
+   LoadBalancer $loadBalancer,
+   ModelLookup $modelLookup
+   ) {
+   $this->loadBalancer = $loadBalancer;
+   $this->modelLookup = $modelLookup;
+   }
+
+   /**
+* @see ModelLookup::getModelId()
+*
+* @param array[] $scores
+* @param callable $errorCallback
+* @return int
+*/
+   public function storeScores( $scores, callable $errorCallback = null ) {
+   // TODO: Make it an arguement and deprecate the whole config 
variable
+   global $wgOresModelClasses;
+
+   if ( $errorCallback === null ) {
+   $errorCallback = function ( $mssg, $revision ) {
+   throw new RuntimeException( "Model contains an 
error for $revision: $mssg" );
+   };
+   }
+
+   $dbData = [];
+
+   $scoreParser = new ScoreParser( $this->modelLookup, 
$wgOresModelClasses );
+   foreach ( $scores as $revision => $revisionData ) {
+   try {
+   $dbDataPerRevision = 
$scoreParser->processRevision( $revision, $revisionData );
+   } catch ( InvalidArgumentException $exception ) {
+   call_user_func( $errorCallback, 
$exception->getMessage(), $revision );
+   continue;
+   }
+
+   $dbData = array_merge( $dbData, $dbDataPerRevision );
+   }
+
+   $this->loadBalancer->getConnection( DB_MASTER )->insert(
+   'ores_classification',
+   $dbData,
+   __METHOD__,
+   [ 'IGNORE' ]
+   );
+   }
+
+}
diff --git a/tests/phpunit/includes/Storage/SqlScoreStorageTest.php 
b/tests/phpunit/includes/Storage/SqlScoreStorageTest.php
new file mode 100644
index 000..b004c04
--- /dev/null
+++ b/tests/phpunit/includes/Storage/SqlScoreStorageTest.php
@@ -0,0 +1,183 @@
+tablesUsed[] = 'ores_classification';
+   $modelData = [
+

[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Linter: Reorganize some mocha tests

2017-12-16 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398650 )

Change subject: Linter: Reorganize some mocha tests
..

Linter: Reorganize some mocha tests

Change-Id: Ib4920d58a03697d7dbcfadbdf49bb19870f8
---
M tests/mocha/linter.js
1 file changed, 58 insertions(+), 60 deletions(-)


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

diff --git a/tests/mocha/linter.js b/tests/mocha/linter.js
index a4f914f..55e1019 100644
--- a/tests/mocha/linter.js
+++ b/tests/mocha/linter.js
@@ -869,74 +869,72 @@
noLintsOfThisType('foo\nfoo 
x bar', "multiple-unclosed-formatting-tags");
});
});
-   describe('MISC TIDY REPLACEMENT ISSUES', function() {
-   describe('Unclosed wikitext i/b in headings', function() {
-   it('should detect unclosed wikitext i tags in 
headings', function() {
-   return 
parseWT("==foo''a==\nx").then(function(result) {
-   result.should.have.length(1);
-   
result[0].should.have.a.property("type", "unclosed-quotes-in-heading");
-   
result[0].params.should.have.a.property("name", "i");
-   
result[0].params.should.have.a.property("ancestorName", "h2");
-   });
-   });
-   it('should detect unclosed wikitext b tags in 
headings', function() {
-   return 
parseWT("==foo'''a==\nx").then(function(result) {
-   result.should.have.length(1);
-   
result[0].should.have.a.property("type", "unclosed-quotes-in-heading");
-   
result[0].params.should.have.a.property("name", "b");
-   
result[0].params.should.have.a.property("ancestorName", "h2");
-   });
-   });
-   it('should not detect unclosed HTML i/b tags in 
headings', function() {
-   return 
parseWT("==fooa==\nx\n==fooa==\ny").then(function(result)
 {
-   result.should.have.length(2);
-   
result[0].should.have.a.property("type", "missing-end-tag");
-   
result[1].should.have.a.property("type", "missing-end-tag");
-   });
+   describe('UNCLOSED WIKITEXT I/B tags in headings', function() {
+   it('should detect unclosed wikitext i tags in headings', 
function() {
+   return 
parseWT("==foo''a==\nx").then(function(result) {
+   result.should.have.length(1);
+   result[0].should.have.a.property("type", 
"unclosed-quotes-in-heading");
+   result[0].params.should.have.a.property("name", 
"i");
+   
result[0].params.should.have.a.property("ancestorName", "h2");
});
});
-   describe('Multiline HTML tables in lists', function() {
-   it('should detect multiline HTML tables in lists (1)', 
function() {
-   return parseWT("* 
x\n").then(function(result) {
-   result.should.have.length(1);
-   
result[0].should.have.a.property("type", "multiline-html-table-in-list");
-   
result[0].params.should.have.a.property("name", "table");
-   
result[0].params.should.have.a.property("ancestorName", "li");
-   });
+   it('should detect unclosed wikitext b tags in headings', 
function() {
+   return 
parseWT("==foo'''a==\nx").then(function(result) {
+   result.should.have.length(1);
+   result[0].should.have.a.property("type", 
"unclosed-quotes-in-heading");
+   result[0].params.should.have.a.property("name", 
"b");
+   
result[0].params.should.have.a.property("ancestorName", "h2");
});
-   it('should detect multiline HTML tables in lists (2)', 
function() {
-   return parseWT("* 
x\n").then(function(result) {
-   result.should.have.length(1);
-   
result[0].should.have.a.property("type", "multiline-html-table-in-list");
-   
result[0].params.should.have.a.property("name", 

[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Linter: Additional updates to multiline-html-table-in-list

2017-12-16 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398649 )

Change subject: Linter: Additional updates to multiline-html-table-in-list
..

Linter: Additional updates to multiline-html-table-in-list

* Handle HTML lists -- don't trigger linter issue there
* Handle dl/dt lists -- trigger linter issue there
* Added new tests

Change-Id: I33206f29cf9a9e6b991824eff2302d45bd32
---
M lib/wt2html/pp/handlers/linter.js
M tests/mocha/linter.js
2 files changed, 32 insertions(+), 5 deletions(-)


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

diff --git a/lib/wt2html/pp/handlers/linter.js 
b/lib/wt2html/pp/handlers/linter.js
index caa1891..c414d87 100644
--- a/lib/wt2html/pp/handlers/linter.js
+++ b/lib/wt2html/pp/handlers/linter.js
@@ -874,19 +874,27 @@
detectMultipleUnclosedFormattingTags(lints);
 }
 
-function hasListAncestor(node) {
-   while (node && node.nodeName !== 'LI') {
+function getWikitextListItemAncestor(node) {
+   while (node && !DU.isListItem(node)) {
node = node.parentNode;
}
 
+   // If the list item is a HTML list item, ignore it
// If the list item comes from references content, ignore it
-   return node && 
!(/mw:Extension\/references/.test(node.parentNode.getAttribute('typeof')));
+   if (node && !DU.isLiteralHTMLNode(node) &&
+   
!(/mw:Extension\/references/.test(node.parentNode.getAttribute('typeof')))
+   )  {
+   return node;
+   } else {
+   return null;
+   }
 }
 
 function logPHPParserBug(env, node, dp, tplInfo) {
+   var li;
if (!DU.isLiteralHTMLNode(node) ||
node.nodeName !== 'TABLE' ||
-   !hasListAncestor(node) ||
+   !(li = getWikitextListItemAncestor(node)) ||
!/\n/.test(node.outerHTML)
) {
return;
@@ -901,7 +909,7 @@
templateInfo: templateInfo,
params: {
name: 'table',
-   ancestorName: 'li',
+   ancestorName: li.nodeName.toLowerCase(),
}
};
env.log('lint/multiline-html-table-in-list', lintObj);
diff --git a/tests/mocha/linter.js b/tests/mocha/linter.js
index f1679db..a4f914f 100644
--- a/tests/mocha/linter.js
+++ b/tests/mocha/linter.js
@@ -912,6 +912,25 @@

result[0].params.should.have.a.property("ancestorName", "li");
});
});
+   it('should detect multiline HTML tables in lists (3)', 
function() {
+   return parseWT("; 
x\n").then(function(result) {
+   result.should.have.length(1);
+   
result[0].should.have.a.property("type", "multiline-html-table-in-list");
+   
result[0].params.should.have.a.property("name", "table");
+   
result[0].params.should.have.a.property("ancestorName", "dt");
+   });
+   });
+   it('should detect multiline HTML tables in lists (4)', 
function() {
+   return parseWT(": 
x\n").then(function(result) {
+   result.should.have.length(1);
+   
result[0].should.have.a.property("type", "multiline-html-table-in-list");
+   
result[0].params.should.have.a.property("name", "table");
+   
result[0].params.should.have.a.property("ancestorName", "dd");
+   });
+   });
+   it('should not detect multiline HTML tables in HTML 
lists', function() {
+   return 
expectEmptyResults("\nx\n\n");
+   });
it('should not detect single-line HTML tables in 
lists', function() {
return expectEmptyResults("* 
x");
});

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33206f29cf9a9e6b991824eff2302d45bd32
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/vagrant[stretch-migration]: Migrate mysql to mariadb

2017-12-16 Thread Paladox (Code Review)
Paladox has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398648 )

Change subject: Migrate mysql to mariadb
..

Migrate mysql to mariadb

Mysql does not exist in debian stretch anymore.

Was replaced with mariadb.

Also rename module mysql to mariadb

Bug: T51652
Change-Id: Ib28ec9aa3e486f39afac65bdd1e052b6483ab045
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/48/398648/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib28ec9aa3e486f39afac65bdd1e052b6483ab045
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Avoid using EntityDiffChangedAspectsFactory like a static co...

2017-12-16 Thread Ladsgroup (Code Review)
Ladsgroup has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394044 )

Change subject: Avoid using EntityDiffChangedAspectsFactory like a static 
constructor
..


Avoid using EntityDiffChangedAspectsFactory like a static constructor

Let's please be honest and use an actual static constructor method when
code really is called like a static constructor method.

I understand that ( new ClassName() )->methodName() is not meant to stay
like this. Which is why I'm changing it right now, before it becomes
technical debt we need to track and come back to.

We can change it back to use the factory (when it starts behaving like
an actual factory) any time. The fact that I'm introducing two static
constructor methods does not block us from doing so in the future.

Bug: T113468
Change-Id: Id17259c2c62f60a73a01d2243e72d0d6203dff6e
---
M client/includes/Changes/AffectedPagesFinder.php
M client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
M lib/includes/Changes/DiffChange.php
M lib/includes/Changes/EntityChange.php
M lib/includes/Changes/EntityChangeFactory.php
M lib/includes/Changes/EntityDiffChangedAspects.php
M lib/includes/Changes/EntityDiffChangedAspectsFactory.php
M lib/tests/phpunit/Changes/EntityDiffChangedAspectsFactoryTest.php
M lib/tests/phpunit/Changes/ItemChangeTest.php
9 files changed, 26 insertions(+), 25 deletions(-)

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



diff --git a/client/includes/Changes/AffectedPagesFinder.php 
b/client/includes/Changes/AffectedPagesFinder.php
index 134661c..8c2d502 100644
--- a/client/includes/Changes/AffectedPagesFinder.php
+++ b/client/includes/Changes/AffectedPagesFinder.php
@@ -119,7 +119,6 @@
 */
public function getChangedAspects( EntityChange $change ) {
$aspects = [];
-
$diffAspects = $change->getCompactDiff();
 
if ( $diffAspects->getSiteLinkChanges() !== [] ) {
diff --git a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php 
b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
index 8081361..d8773cf 100644
--- a/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
+++ b/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
@@ -10,7 +10,7 @@
 use Wikibase\DataModel\SiteLink;
 use Wikibase\EntityChange;
 use Wikibase\ItemChange;
-use Wikibase\Lib\Changes\EntityDiffChangedAspectsFactory;
+use Wikibase\Lib\Changes\EntityDiffChangedAspects;
 use Wikibase\Lib\Store\EntityRevisionLookup;
 use Wikibase\Lib\Tests\MockRepository;
 use Wikibase\Lib\Tests\Changes\TestChanges;
@@ -132,7 +132,7 @@
}
$change->setEntityId( new ItemId( $values['object_id'] ) );
 
-   $diffAspects = ( new EntityDiffChangedAspectsFactory() 
)->newFromEntityDiff( $diff );
+   $diffAspects = EntityDiffChangedAspects::newFromEntityDiff( 
$diff );
$change->setCompactDiff( $diffAspects );
 
return $change;
diff --git a/lib/includes/Changes/DiffChange.php 
b/lib/includes/Changes/DiffChange.php
index 281c93d..8bab9a0 100644
--- a/lib/includes/Changes/DiffChange.php
+++ b/lib/includes/Changes/DiffChange.php
@@ -2,9 +2,7 @@
 
 namespace Wikibase;
 
-use Diff\DiffOp\Diff\Diff;
 use Wikibase\Lib\Changes\EntityDiffChangedAspects;
-use Wikibase\Lib\Changes\EntityDiffChangedAspectsFactory;
 
 /**
  * Class for changes that can be represented as a Diff.
@@ -25,7 +23,7 @@
// This shouldn't happen, but we should be robust 
against corrupt, incomplete
// obsolete instances in the database, etc.
wfLogWarning( 'Cannot get the diff when it has not been 
set yet.' );
-   return ( new EntityDiffChangedAspectsFactory() 
)->newFromEntityDiff( new Diff() );
+   return EntityDiffChangedAspects::newEmpty();
} else {
return $info['compactDiff'];
}
diff --git a/lib/includes/Changes/EntityChange.php 
b/lib/includes/Changes/EntityChange.php
index d8f398d..c696d7a 100644
--- a/lib/includes/Changes/EntityChange.php
+++ b/lib/includes/Changes/EntityChange.php
@@ -2,7 +2,6 @@
 
 namespace Wikibase;
 
-use Diff\DiffOp\Diff\Diff;
 use MWException;
 use RecentChange;
 use Revision;
@@ -10,7 +9,6 @@
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\BasicEntityIdParser;
 use Wikibase\Lib\Changes\EntityDiffChangedAspects;
-use Wikibase\Lib\Changes\EntityDiffChangedAspectsFactory;
 
 /**
  * Represents a change for an entity; to be extended by various change subtypes
@@ -308,12 +306,8 @@
 
$info = parent::unserializeInfo( $serialization );
 
-   if ( isset( $info['compactDiff'] ) && is_string( 
$info['compactDiff'] ) &&
-   $info['compactDiff']
-   ) {
-

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Revert "Add tab and shift+tab to blocked triggers list"

2017-12-16 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398647 )

Change subject: Revert "Add tab and shift+tab to blocked triggers list"
..

Revert "Add tab and shift+tab to blocked triggers list"

It seems that blocking tab and shift+tab does makes it hard to post
comments /create posts using StructuredDiscussions when the user does
that in "visual editing" mode[1].

As there doesn't seem to be much value in blocking 'Tab' don't block it.
In case the user accidentally hit 'Tab' he could always get back using
a 'Shift+Tab'.

This reverts commit b89ea541f9579d30210a478231d8449812a6eb2c.

[1]: cf. https://www.mediawiki.org/wiki/Topic:Tzmpo1gjj2gv2ugy

Change-Id: I12ea52c6c3116c678293cc19b838681e4cc6d665
---
M src/ce/ve.ce.Surface.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/47/398647/1

diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index ae35351..9b281a0 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -1221,8 +1221,8 @@
 ve.ce.Surface.prototype.isBlockedTrigger = function ( trigger ) {
var platformKey = ve.getSystemPlatform() === 'mac' ? 'mac' : 'pc',
blocked = {
-   mac: [ 'meta+b', 'meta+i', 'meta+u', 'meta+z', 
'meta+y', 'meta+shift+z', 'tab', 'shift+tab', 'meta+[', 'meta+]' ],
-   pc: [ 'ctrl+b', 'ctrl+i', 'ctrl+u', 'ctrl+z', 'ctrl+y', 
'ctrl+shift+z', 'tab', 'shift+tab' ]
+   mac: [ 'meta+b', 'meta+i', 'meta+u', 'meta+z', 
'meta+y', 'meta+shift+z', 'meta+[', 'meta+]'],
+   pc: [ 'ctrl+b', 'ctrl+i', 'ctrl+u', 'ctrl+z', 'ctrl+y', 
'ctrl+shift+z' ]
};
 
return blocked[ platformKey ].indexOf( trigger.toString() ) !== -1;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I12ea52c6c3116c678293cc19b838681e4cc6d665
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Clean up all backward compatibilities for EntityCompactDiff

2017-12-16 Thread Ladsgroup (Code Review)
Ladsgroup has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/397798 )

Change subject: Clean up all backward compatibilities for EntityCompactDiff
..


Clean up all backward compatibilities for EntityCompactDiff

Bug: T182137
Change-Id: Ieee787509a33e75e2ced2d161dd750fc0bb9be57
---
M client/includes/Changes/AffectedPagesFinder.php
M client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
M client/tests/phpunit/includes/Changes/InjectRCRecordsJobTest.php
M client/tests/phpunit/includes/RecentChanges/RecentChangeFactoryTest.php
M lib/includes/Changes/DiffChange.php
M lib/includes/Changes/EntityChange.php
M lib/includes/Changes/ItemChange.php
M lib/tests/phpunit/Changes/EntityChangeTest.php
M lib/tests/phpunit/Changes/ItemChangeTest.php
M repo/tests/phpunit/includes/Store/Sql/SqlChangeStoreTest.php
10 files changed, 43 insertions(+), 265 deletions(-)

Approvals:
  Ladsgroup: Verified
  Thiemo Kreuz (WMDE): Looks good to me, approved



diff --git a/client/includes/Changes/AffectedPagesFinder.php 
b/client/includes/Changes/AffectedPagesFinder.php
index a5450e2..134661c 100644
--- a/client/includes/Changes/AffectedPagesFinder.php
+++ b/client/includes/Changes/AffectedPagesFinder.php
@@ -16,7 +16,6 @@
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\EntityChange;
 use Wikibase\ItemChange;
-use Wikibase\Lib\Changes\EntityDiffChangedAspectsFactory;
 use Wikibase\Lib\Store\StorageException;
 
 /**
@@ -121,15 +120,7 @@
public function getChangedAspects( EntityChange $change ) {
$aspects = [];
 
-   $info = $change->getInfo();
-   // We might unserialize old EntityChange which doesn't have 
getCompactDiff method
-   if ( array_key_exists( 'compactDiff', $info ) ) {
-   $diffAspects = $info['compactDiff'];
-   } else {
-   $diffAspects = ( new EntityDiffChangedAspectsFactory() 
)->newFromEntityDiff(
-   $change->getDiff()
-   );
-   }
+   $diffAspects = $change->getCompactDiff();
 
if ( $diffAspects->getSiteLinkChanges() !== [] ) {
$sitelinkChanges = $diffAspects->getSiteLinkChanges();
@@ -239,15 +230,7 @@
$usages = $this->transformAllPageEntityUsages( $usages, 
$entityId, $changedAspects );
 
if ( $change instanceof ItemChange && in_array( 
EntityUsage::TITLE_USAGE, $changedAspects ) ) {
-   $info = $change->getInfo();
-   // We might unserialize old EntityChange which doesn't 
have getCompactDiff method
-   if ( array_key_exists( 'compactDiff', $info ) ) {
-   $diffChangedAspects = $info['compactDiff'];
-   } else {
-   $diffChangedAspects = ( new 
EntityDiffChangedAspectsFactory() )->newFromEntityDiff(
-   $change->getDiff()
-   );
-   }
+   $diffChangedAspects = $change->getCompactDiff();
$namesFromDiff = $this->getPagesReferencedInDiff(
$diffChangedAspects->getSiteLinkChanges()
);
diff --git a/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php 
b/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
index 5ce984d..4106fc6 100644
--- a/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
+++ b/client/tests/phpunit/includes/Changes/AffectedPagesFinderTest.php
@@ -18,7 +18,6 @@
 use Wikibase\DataModel\Entity\PropertyId;
 use Wikibase\DataModel\Snak\PropertyValueSnak;
 use Wikibase\EntityChange;
-use Wikibase\Lib\Changes\EntityDiffChangedAspectsFactory;
 use Wikibase\Lib\Store\SiteLinkLookup;
 use Wikibase\Lib\Store\StorageException;
 use Wikibase\Lib\Tests\Changes\TestChanges;
@@ -218,32 +217,6 @@
 
$actual = $referencedPagesFinder->getChangedAspects( $change );
 
-   sort( $expected );
-   sort( $actual );
-   $this->assertEquals( $expected, $actual );
-   }
-
-   /**
-* @dataProvider getChangedAspectsProvider
-*/
-   public function testGetChangedAspectsUsingEntityChangeAspects(
-   array $expected,
-   EntityChange $change,
-   $trackUsagesInAllLanguages = false
-   ) {
-   $referencedPagesFinder = $this->getAffectedPagesFinder( [], [], 
$trackUsagesInAllLanguages );
-   $info = $change->getInfo();
-   if ( !array_key_exists( 'compactDiff', $info ) ) {
-   $aspects = ( new EntityDiffChangedAspectsFactory() 
)->newFromEntityDiff(
-   $change->getDiff()
-   );
-

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Fix stale comment

2017-12-16 Thread Kaartic (Code Review)
Kaartic has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398646 )

Change subject: Fix stale comment
..

Fix stale comment

Change-Id: Ie506f7199ccc603548cac6490e6097c9e2ca
---
M src/ce/keydownhandlers/ve.ce.LinearTabKeyDownHandler.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/46/398646/1

diff --git a/src/ce/keydownhandlers/ve.ce.LinearTabKeyDownHandler.js 
b/src/ce/keydownhandlers/ve.ce.LinearTabKeyDownHandler.js
index a60cbf8..510dcbe 100644
--- a/src/ce/keydownhandlers/ve.ce.LinearTabKeyDownHandler.js
+++ b/src/ce/keydownhandlers/ve.ce.LinearTabKeyDownHandler.js
@@ -34,7 +34,7 @@
 /**
  * @inheritdoc
  *
- * Handle escape key down events with a linear selection while table editing.
+ * Handle Tab key down events with a linear selection while table editing.
  */
 ve.ce.LinearTabKeyDownHandler.static.execute = function ( surface, e ) {
var activeTableNode = surface.getActiveNode() && 
surface.getActiveNode().findParent( ve.ce.TableNode );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie506f7199ccc603548cac6490e6097c9e2ca
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Kaartic 

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


[MediaWiki-commits] [Gerrit] mediawiki...CategoryTree[master]: Split CategoryPageSubclass.php into two files

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

Change subject: Split CategoryPageSubclass.php into two files
..


Split CategoryPageSubclass.php into two files

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass


Change-Id: Ic4d064272a5297e33b1edc090b807937cfb06545
---
M .phpcs.xml
A CategoryTreeCategoryPage.php
R CategoryTreeCategoryViewer.php
M extension.json
4 files changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/.phpcs.xml b/.phpcs.xml
index d473d2b..3f9d0cb 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -3,7 +3,6 @@



-   



diff --git a/CategoryTreeCategoryPage.php b/CategoryTreeCategoryPage.php
new file mode 100644
index 000..ebec49f
--- /dev/null
+++ b/CategoryTreeCategoryPage.php
@@ -0,0 +1,5 @@
+https://gerrit.wikimedia.org/r/398633
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic4d064272a5297e33b1edc090b807937cfb06545
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CategoryTree
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Fomafix 
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]: Fix tooltip accessibility for screen readers

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

Change subject: Fix tooltip accessibility for screen readers
..


Fix tooltip accessibility for screen readers

By adding an additional aria-label attribute to the tooltip,
we can ensure that every tooltip will be accessible
for accessibility tools like screen readers.

Works with Echo extension, but I am not sure if there
are extensions who are using the original-title attribute.

Tested with ChromeVox on Chrome 62.0.3202.94.

Bug: T54711
Change-Id: I19500c4e8ccbdcb8288b9c2299a29b3f8a31639d
---
M includes/htmlform/fields/HTMLCheckMatrix.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/includes/htmlform/fields/HTMLCheckMatrix.php 
b/includes/htmlform/fields/HTMLCheckMatrix.php
index dd4e707..df44626 100644
--- a/includes/htmlform/fields/HTMLCheckMatrix.php
+++ b/includes/htmlform/fields/HTMLCheckMatrix.php
@@ -106,6 +106,7 @@
$tooltipAttribs = [
'class' => "mw-htmlform-tooltip 
$tooltipClass",
'title' => 
$this->mParams['tooltips'][$rowLabel],
+   'aria-label' => 
$this->mParams['tooltips'][$rowLabel]
];
$rowLabel .= ' ' . Html::element( 'span', 
$tooltipAttribs, '' );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I19500c4e8ccbdcb8288b9c2299a29b3f8a31639d
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Divadsn 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Prtksxna 
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]: mariadb: Depool db1100, broken

2017-12-16 Thread Jcrespo (Code Review)
Jcrespo has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398645 )

Change subject: mariadb: Depool db1100, broken
..


mariadb: Depool db1100, broken

Change-Id: I342b04ecc58cdf9aaa83ed423232e54fc7decd58
---
M wmf-config/db-eqiad.php
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Giuseppe Lavagetto: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Jcrespo: Looks good to me, approved



diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index db509f9..cf67da4 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -145,10 +145,10 @@
's5' => [
'db1070' => 0,   # D1 2.8TB 160GB, master
'db1051' => 0,   # B3 2.8TB  96GB, vslow, dump in s5
-   'db1082' => 300, # A2 3.6TB 512GB, api # db1095 master
+   'db1082' => 50, # A2 3.6TB 512GB, api # db1095 master
'db1096:3315' => 1,   # A6 3.6TB 512GB, # rc, log: s5 and s6
'db1097:3315' => 1,   # D1 3.6TB 512GB, # rc, log: s4 and s5
-   'db1100' => 50,  # C2 3.6TB 512GB, old master #api
+   # 'db1100' => 50,  # C2 3.6TB 512GB, old master #api, depool, 
broken
'db1106' => 500, # D3 3.6TB 512GB
'db1110' => 500, # C3 3.6TB 512GB
],
@@ -401,7 +401,7 @@
],
'api' => [
'db1082' => 1,
-   'db1100' => 3,
+   # 'db1100' => 3,
],
'watchlist' => [
'db1096:3315' => 1,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I342b04ecc58cdf9aaa83ed423232e54fc7decd58
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Jcrespo 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: mariadb: Depool db1100, broken

2017-12-16 Thread Jcrespo (Code Review)
Jcrespo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398645 )

Change subject: mariadb: Depool db1100, broken
..

mariadb: Depool db1100, broken

Change-Id: I342b04ecc58cdf9aaa83ed423232e54fc7decd58
---
M wmf-config/db-eqiad.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index db509f9..cf67da4 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -145,10 +145,10 @@
's5' => [
'db1070' => 0,   # D1 2.8TB 160GB, master
'db1051' => 0,   # B3 2.8TB  96GB, vslow, dump in s5
-   'db1082' => 300, # A2 3.6TB 512GB, api # db1095 master
+   'db1082' => 50, # A2 3.6TB 512GB, api # db1095 master
'db1096:3315' => 1,   # A6 3.6TB 512GB, # rc, log: s5 and s6
'db1097:3315' => 1,   # D1 3.6TB 512GB, # rc, log: s4 and s5
-   'db1100' => 50,  # C2 3.6TB 512GB, old master #api
+   # 'db1100' => 50,  # C2 3.6TB 512GB, old master #api, depool, 
broken
'db1106' => 500, # D3 3.6TB 512GB
'db1110' => 500, # C3 3.6TB 512GB
],
@@ -401,7 +401,7 @@
],
'api' => [
'db1082' => 1,
-   'db1100' => 3,
+   # 'db1100' => 3,
],
'watchlist' => [
'db1096:3315' => 1,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Move classes to own files

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398644 )

Change subject: Move classes to own files
..

Move classes to own files

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: Iad77a451551effaa4f6ef7810a7267dc4ac4
---
M .phpcs.xml
M extension.json
A pages/LqtDiscussionPager.php
A pages/LqtNewMessagesPager.php
M pages/NewUserMessagesView.php
A pages/TalkpageHistoryPager.php
M pages/TalkpageHistoryView.php
M pages/TalkpageView.php
8 files changed, 339 insertions(+), 338 deletions(-)


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

diff --git a/.phpcs.xml b/.phpcs.xml
index 861e352..b7164b8 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -5,8 +5,6 @@



-   
-   



diff --git a/extension.json b/extension.json
index 367814d..9f7b2a6 100644
--- a/extension.json
+++ b/extension.json
@@ -122,9 +122,9 @@
"ThreadHistoricalRevisionView": 
"pages/ThreadHistoricalRevisionView.php",
"SummaryPageView": "pages/SummaryPageView.php",
"NewUserMessagesView": "pages/NewUserMessagesView.php",
-   "LqtDiscussionPager": "pages/TalkpageView.php",
-   "LqtNewMessagesPager": "pages/NewUserMessagesView.php",
-   "TalkpageHistoryPager": "pages/TalkpageHistoryView.php",
+   "LqtDiscussionPager": "pages/LqtDiscussionPager.php",
+   "LqtNewMessagesPager": "pages/LqtNewMessagesPager.php",
+   "TalkpageHistoryPager": "pages/TalkpageHistoryPager.php",
"ThreadActionPage": "pages/ThreadActionPage.php",
"SpecialMoveThread": "pages/SpecialMoveThread.php",
"SpecialNewMessages": "pages/SpecialNewMessages.php",
diff --git a/pages/LqtDiscussionPager.php b/pages/LqtDiscussionPager.php
new file mode 100644
index 000..aa0778c
--- /dev/null
+++ b/pages/LqtDiscussionPager.php
@@ -0,0 +1,167 @@
+article = $article;
+   $this->orderType = $orderType;
+
+   parent::__construct();
+
+   $this->setLimit( min( 50, $this->getPageLimit() ) );
+   }
+
+   function getPageLimit() {
+   $article = $this->article;
+
+   global $wgRequest;
+   $requestedLimit = $wgRequest->getInt( 'limit', null );
+   if ( $requestedLimit ) {
+   return $requestedLimit;
+   }
+
+   if ( $article->exists() ) {
+   $pout = $article->getParserOutput();
+   $setLimit = $pout->getProperty( 'lqt-page-limit' );
+   if ( $setLimit ) {
+   return $setLimit;
+   }
+   }
+
+   global $wgLiquidThreadsDefaultPageLimit;
+   return $wgLiquidThreadsDefaultPageLimit;
+   }
+
+   function getQueryInfo() {
+   $queryInfo = [
+   'tables' => [ 'thread' ],
+   'fields' => '*',
+   'conds' => [
+   Threads::articleClause( $this->article ),
+   Threads::topLevelClause(),
+   'thread_type != ' . $this->mDb->addQuotes( 
Threads::TYPE_DELETED ),
+   ],
+   ];
+
+   return $queryInfo;
+   }
+
+   // Adapted from getBody().
+   function getRows() {
+   if ( !$this->mQueryDone ) {
+   $this->doQuery();
+   }
+
+   # Don't use any extra rows returned by the query
+   $numRows = min( $this->mResult->numRows(), $this->mLimit );
+
+   $rows = [];
+
+   if ( $numRows ) {
+   if ( $this->mIsBackwards ) {
+   for ( $i = $numRows - 1; $i >= 0; $i-- ) {
+   $this->mResult->seek( $i );
+   $row = $this->mResult->fetchObject();
+   $rows[] = $row;
+   }
+   } else {
+   $this->mResult->seek( 0 );
+   for ( $i = 0; $i < $numRows; $i++ ) {
+   $row = $this->mResult->fetchObject();
+   $rows[] = $row;
+   }
+   }
+   }
+
+   return $rows;
+   }
+
+   function formatRow( $row ) {
+   // No-op, we get the list of rows from getRows()
+   }
+
+   function getIndexField() {
+   switch ( $this->orderType ) {
+   case 

[MediaWiki-commits] [Gerrit] mediawiki...Interwiki[master]: Move InterwikiLogFormatter to own file

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398643 )

Change subject: Move InterwikiLogFormatter to own file
..

Move InterwikiLogFormatter to own file

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I463de4435b1f1ef82b9e87b35ebc3ad16e181898
---
M .phpcs.xml
A InterwikiLogFormatter.php
M Interwiki_body.php
M extension.json
4 files changed, 18 insertions(+), 18 deletions(-)


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

diff --git a/.phpcs.xml b/.phpcs.xml
index 3cb24ee..e2ae5f1 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -2,7 +2,6 @@
 


-   



diff --git a/InterwikiLogFormatter.php b/InterwikiLogFormatter.php
new file mode 100644
index 000..ecdce1a
--- /dev/null
+++ b/InterwikiLogFormatter.php
@@ -0,0 +1,17 @@
+https://gerrit.wikimedia.org/r/398643
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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


[MediaWiki-commits] [Gerrit] mediawiki...GraphViz[master]: Removed passed sniffs from .phpcs.xml

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398642 )

Change subject: Removed passed sniffs from .phpcs.xml
..

Removed passed sniffs from .phpcs.xml

Follow-Up: I8c8a47b13ca79be5789f796fe77e2b4fff28cb03
Change-Id: Ifbeb40ace9e6b52984b11133d22bcbb5f560640d
---
M .phpcs.xml
1 file changed, 0 insertions(+), 2 deletions(-)


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

diff --git a/.phpcs.xml b/.phpcs.xml
index 1e67803..e284282 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -8,8 +8,6 @@



-   
-   

.


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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...GlobalBlocking[master]: Move GlobalBlockListPager to own file

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398641 )

Change subject: Move GlobalBlockListPager to own file
..

Move GlobalBlockListPager to own file

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I802c0fe46765613519ee172b6c5ebc0ed7c0a63b
---
M .phpcs.xml
M extension.json
A includes/specials/GlobalBlockListPager.php
M includes/specials/SpecialGlobalBlockList.php
4 files changed, 112 insertions(+), 110 deletions(-)


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

diff --git a/.phpcs.xml b/.phpcs.xml
index 57b3f85..8a4cc26 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -3,12 +3,13 @@



-   
-   




+   
+   */maintenance/*
+   

GlobalBlocking\.alias\.php

diff --git a/extension.json b/extension.json
index d5b16fd..fcf19a0 100644
--- a/extension.json
+++ b/extension.json
@@ -86,7 +86,7 @@
"AutoloadClasses": {
"SpecialGlobalBlock": 
"includes/specials/SpecialGlobalBlock.php",
"SpecialGlobalBlockList": 
"includes/specials/SpecialGlobalBlockList.php",
-   "GlobalBlockListPager": 
"includes/specials/SpecialGlobalBlockList.php",
+   "GlobalBlockListPager": 
"includes/specials/GlobalBlockListPager.php",
"SpecialGlobalBlockStatus": 
"includes/specials/SpecialGlobalBlockStatus.php",
"SpecialRemoveGlobalBlock": 
"includes/specials/SpecialRemoveGlobalBlock.php",
"ApiQueryGlobalBlocks": "includes/api/ApiQueryGlobalBlocks.php",
diff --git a/includes/specials/GlobalBlockListPager.php 
b/includes/specials/GlobalBlockListPager.php
new file mode 100644
index 000..dacb30c
--- /dev/null
+++ b/includes/specials/GlobalBlockListPager.php
@@ -0,0 +1,108 @@
+queryConds = $conds;
+   $this->mDb = GlobalBlocking::getGlobalBlockingDatabase( 
DB_REPLICA );
+   }
+
+   public function formatRow( $row ) {
+   global $wgApplyGlobalBlocks;
+
+   $lang = $this->getLanguage();
+   $options = [];
+
+   $expiry = $lang->formatExpiry( $row->gb_expiry, TS_MW );
+   if ( $expiry == 'infinity' ) {
+   $options[] = $this->msg( 'infiniteblock' )->parse();
+   } else {
+   $options[] = $this->msg(
+   'expiringblock',
+   $lang->date( $expiry ),
+   $lang->time( $expiry )
+   )->parse();
+   }
+
+   // Check for whitelisting.
+   $wlinfo = GlobalBlocking::getWhitelistInfo( $row->gb_id );
+   if ( $wlinfo ) {
+   $options[] = $this->msg(
+   'globalblocking-list-whitelisted',
+   User::whois( $wlinfo['user'] ), 
$wlinfo['reason']
+   )->text();
+   }
+
+   if ( $row->gb_anon_only ) {
+   $options[] = $this->msg( 'globalblocking-list-anononly' 
)->text();
+   }
+
+   // Do afterthoughts (comment, links for admins)
+   $info = [];
+   $user = $this->getUser();
+   $canBlock = $user->isAllowed( 'globalblock' );
+   if ( $canBlock ) {
+   $info[] = Linker::linkKnown(
+   SpecialPage::getTitleFor( 'RemoveGlobalBlock' ),
+   $this->msg( 'globalblocking-list-unblock' 
)->parse(),
+   [],
+   [ 'address' => $row->gb_address ]
+   );
+   }
+
+   if ( $wgApplyGlobalBlocks && $user->isAllowed( 
'globalblock-whitelist' ) ) {
+   $info[] = Linker::link(
+   SpecialPage::getTitleFor( 'GlobalBlockStatus' ),
+   $this->msg( 'globalblocking-list-whitelist' 
)->parse(),
+   [],
+   [ 'address' => $row->gb_address ]
+   );
+   }
+
+   if ( $canBlock ) {
+   $info[] = Linker::linkKnown(
+   SpecialPage::getTitleFor( 'GlobalBlock' ),
+   $this->msg( 'globalblocking-list-modify' 
)->parse(),
+   [],
+   [ 'wpAddress' => $row->gb_address ]
+   );
+   }
+
+   $timestamp = $row->gb_timestamp;
+   $timestamp = $lang->timeanddate( wfTimestamp( TS_MW, $timestamp 
), true );
+   

[MediaWiki-commits] [Gerrit] mediawiki...Quiz[master]: [WIP] Switch from jshint to eslint

2017-12-16 Thread Fomafix (Code Review)
Fomafix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398640 )

Change subject: [WIP] Switch from jshint to eslint
..

[WIP] Switch from jshint to eslint

Change-Id: I35e94cdfbc7ecc222703c88fc8f5b3ffb7958dff
---
M Gruntfile.js
M modules/ext.quiz.js
M package.json
3 files changed, 9 insertions(+), 8 deletions(-)


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

diff --git a/Gruntfile.js b/Gruntfile.js
index 77b8308..198520d 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,7 +1,7 @@
-/*jshint node:true */
+/* eslint-env node */
 module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
-   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
 
@@ -9,13 +9,13 @@
banana: {
all: 'i18n/'
},
-   jshint: {
+   eslint: {
all: [
'**/*.js',
'!node_modules/**',
'!vendor/**'
]
-   },
+   }
jsonlint: {
all: [
'**/*.json',
@@ -32,6 +32,6 @@
}
} );
 
-   grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana', 
'stylelint' ] );
+   grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 
'stylelint' ] );
grunt.registerTask( 'default', 'test' );
 };
diff --git a/modules/ext.quiz.js b/modules/ext.quiz.js
index bb98f78..168716e 100644
--- a/modules/ext.quiz.js
+++ b/modules/ext.quiz.js
@@ -33,7 +33,7 @@
  * @author Louis-Rémi Babe 
  */
 
-(function () {
+( function ( mw, $ ) {
'use strict';
 
/**
@@ -139,4 +139,4 @@
}
 
mw.hook( 'wikipage.content' ).add( prepareQuiz );
-})();
+}( mediaWiki, jQuery ) );
diff --git a/package.json b/package.json
index 4e9e099..a5b5bc4 100644
--- a/package.json
+++ b/package.json
@@ -4,9 +4,10 @@
 "test": "grunt test"
   },
   "devDependencies": {
+"eslint-config-wikimedia": "0.5.0",
 "grunt": "1.0.1",
 "grunt-banana-checker": "0.5.0",
-"grunt-contrib-jshint": "1.1.0",
+"grunt-eslint": "20.1.0",
 "grunt-jsonlint": "1.1.0",
 "grunt-stylelint": "0.6.0",
 "stylelint": "7.8.0",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35e94cdfbc7ecc222703c88fc8f5b3ffb7958dff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Quiz
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...FeaturedFeeds[master]: Move classes to own files

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398639 )

Change subject: Move classes to own files
..

Move classes to own files

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: Ife9bb4f2f18082ad95af9ea937110b525e56fdfd
---
M .phpcs.xml
A FeaturedFeedChannel.php
A FeaturedFeedItem.php
M FeaturedFeeds.body.php
M extension.json
5 files changed, 230 insertions(+), 229 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/FeaturedFeeds 
refs/changes/39/398639/1

diff --git a/.phpcs.xml b/.phpcs.xml
index b08ffe3..d81f486 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -3,7 +3,6 @@



-   



diff --git a/FeaturedFeedChannel.php b/FeaturedFeedChannel.php
new file mode 100644
index 000..68289f5
--- /dev/null
+++ b/FeaturedFeedChannel.php
@@ -0,0 +1,205 @@
+name = $name;
+   $this->options = $options;
+   if ( $options['inUserLanguage'] ) {
+   $this->languageCode = $lang->getCode();
+   } else {
+   $this->languageCode = $wgContLang->getCode();
+   }
+   }
+
+   private static function staticInit() {
+   if ( !self::$parserOptions ) {
+   self::$parserOptions = new ParserOptions();
+   if ( !defined( 
'ParserOutput::SUPPORTS_STATELESS_TRANSFORMS' ) ) {
+   self::$parserOptions->setEditSection( false );
+   }
+   self::$parser = new Parser();
+   }
+   }
+
+   public function __wakeup() {
+   self::staticInit();
+   }
+
+   /**
+* @param string $key
+* @return Message
+*/
+   private function msg( $key ) {
+   return wfMessage( $key )->inLanguage( $this->languageCode );
+   }
+
+   /**
+* @return bool
+*/
+   public function isOK() {
+   $this->init();
+   return $this->page !== false;
+   }
+
+   /**
+* Returns language used by the feed
+* @return Language
+*/
+   public function getLanguage() {
+   // factory() is cached
+   return Language::factory( $this->languageCode );
+   }
+
+   public function init() {
+   global $wgLanguageCode;
+   if ( $this->title !== false ) {
+   return;
+   }
+   $this->title = $this->msg( $this->options['title'] )->text();
+   $this->shortTitle = $this->msg( $this->options['short-title'] 
)->text();
+   $this->description = $this->msg( $this->options['description'] 
)->text();
+   $pageMsg = $this->msg( $this->options['page'] )->params( 
$this->languageCode );
+   if ( $pageMsg->isDisabled() ) {
+   // fall back manually, messages can be existent but 
empty
+   if ( $this->languageCode != $wgLanguageCode ) {
+   $pageMsg = wfMessage( $this->options['page'] )
+   ->params( $this->languageCode )
+   ->inContentLanguage();
+   }
+   }
+   if ( $pageMsg->isDisabled() ) {
+   return;
+   }
+   $this->page = $pageMsg->plain();
+   $this->page = str_replace( '$LANGUAGE', $this->languageCode, 
$this->page );
+   $this->entryName = $this->msg( $this->options['entryName'] 
)->plain();
+   }
+
+   /**
+* @return array
+*/
+   public function getFeedItems() {
+   $this->init();
+   if ( $this->items === false ) {
+   $this->items = [];
+   switch ( $this->options['frequency'] ) {
+   case 'daily':
+   $ratio = 1;
+   $baseTime = 
FeaturedFeeds::todaysStart();
+   break;
+   case 'weekly':
+   $ratio = 7;
+   $baseTime = 
FeaturedFeeds::startOfThisWeek();
+   break;
+   default:
+   throw new Exception( 
"'{$this->options['frequency']}' is not a valid frequency" );
+   }
+   for ( $i = 1 - $this->options['limit']; $i <= 0; $i++ ) 
{
+   $timestamp = $baseTime + $i * $ratio * 24 * 
3600;
+   $item = $this->getFeedItem( $timestamp );
+   if ( 

[MediaWiki-commits] [Gerrit] mediawiki...ConfirmEdit[master]: Move classes to own files

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398638 )

Change subject: Move classes to own files
..

Move classes to own files

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I88b5112d84d8983e67be1bca9f4039486bcefc6f
---
M .phpcs.xml
M extension.json
D includes/CaptchaStore.php
A includes/store/CaptchaCacheStore.php
A includes/store/CaptchaHashStore.php
A includes/store/CaptchaSessionStore.php
A includes/store/CaptchaStore.php
7 files changed, 154 insertions(+), 152 deletions(-)


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

diff --git a/.phpcs.xml b/.phpcs.xml
index a60b550..7e6cd14 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -5,7 +5,6 @@



-   



diff --git a/extension.json b/extension.json
index ce6ef61..2247452 100644
--- a/extension.json
+++ b/extension.json
@@ -52,10 +52,10 @@
"AutoloadClasses": {
"ConfirmEditHooks": "includes/ConfirmEditHooks.php",
"SimpleCaptcha": "SimpleCaptcha/Captcha.php",
-   "CaptchaStore": "includes/CaptchaStore.php",
-   "CaptchaSessionStore": "includes/CaptchaStore.php",
-   "CaptchaCacheStore": "includes/CaptchaStore.php",
-   "CaptchaHashStore": "includes/CaptchaStore.php",
+   "CaptchaStore": "includes/store/CaptchaStore.php",
+   "CaptchaSessionStore": "includes/store/CaptchaSessionStore.php",
+   "CaptchaCacheStore": "includes/store/CaptchaCacheStore.php",
+   "CaptchaHashStore": "includes/store/CaptchaHashStore.php",
"CaptchaTriggers": "includes/CaptchaTriggers.php",
"CaptchaSpecialPage": "includes/specials/SpecialCaptcha.php",
"CaptchaPreAuthenticationProvider": 
"includes/auth/CaptchaPreAuthenticationProvider.php",
diff --git a/includes/CaptchaStore.php b/includes/CaptchaStore.php
deleted file mode 100644
index 9eb5200..000
--- a/includes/CaptchaStore.php
+++ /dev/null
@@ -1,147 +0,0 @@
-persist();
-   }
-
-   function store( $index, $info ) {
-   SessionManager::getGlobalSession()->set( 'captcha' . $index, 
$info );
-   }
-
-   function retrieve( $index ) {
-   return SessionManager::getGlobalSession()->get( 'captcha' . 
$index, false );
-   }
-
-   function clear( $index ) {
-   SessionManager::getGlobalSession()->remove( 'captcha' . $index 
);
-   }
-
-   function cookiesNeeded() {
-   return true;
-   }
-}
-
-class CaptchaCacheStore extends CaptchaStore {
-   function store( $index, $info ) {
-   global $wgCaptchaSessionExpiration;
-
-   ObjectCache::getMainStashInstance()->set(
-   wfMemcKey( 'captcha', $index ),
-   $info,
-   $wgCaptchaSessionExpiration
-   );
-   }
-
-   function retrieve( $index ) {
-   $info = ObjectCache::getMainStashInstance()->get( wfMemcKey( 
'captcha', $index ) );
-   if ( $info ) {
-   return $info;
-   } else {
-   return false;
-   }
-   }
-
-   function clear( $index ) {
-   ObjectCache::getMainStashInstance()->delete( wfMemcKey( 
'captcha', $index ) );
-   }
-
-   function cookiesNeeded() {
-   return false;
-   }
-}
-
-class CaptchaHashStore extends CaptchaStore {
-   protected $data = [];
-
-   public function store( $index, $info ) {
-   $this->data[$index] = $info;
-   }
-
-   public function retrieve( $index ) {
-   if ( array_key_exists( $index, $this->data ) ) {
-   return $this->data[$index];
-   }
-   return false;
-   }
-
-   public function clear( $index ) {
-   unset( $this->data[$index] );
-   }
-
-   public function cookiesNeeded() {
-   return false;
-   }
-
-   public function clearAll() {
-   $this->data = [];
-   }
-}
diff --git a/includes/store/CaptchaCacheStore.php 
b/includes/store/CaptchaCacheStore.php
new file mode 100644
index 000..d6661b3
--- /dev/null
+++ b/includes/store/CaptchaCacheStore.php
@@ -0,0 +1,30 @@
+set(
+   wfMemcKey( 'captcha', $index ),
+   $info,
+   $wgCaptchaSessionExpiration
+   );
+   }
+
+   function retrieve( $index ) {
+   $info = ObjectCache::getMainStashInstance()->get( wfMemcKey( 
'captcha', $index ) );
+   if ( $info ) {
+   return $info;
+   } else {
+   return false;
+   }

[MediaWiki-commits] [Gerrit] operations/dumps[master]: Revert "use cat to recombine gzipped files together"

2017-12-16 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398637 )

Change subject: Revert "use cat to recombine gzipped files together"
..


Revert "use cat to recombine gzipped files together"

This reverts commit faf7de86d3dd98b4e5bd59809c5938050fbec42d.

A nice idea but we would wind up with multiple site headers in the concatenated 
file, changing the contents.

Change-Id: I7da9a95c0c817b529f40ce024235c1afbe85600f
---
M xmldumps-backup/dumps/recombinejobs.py
1 file changed, 9 insertions(+), 9 deletions(-)

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



diff --git a/xmldumps-backup/dumps/recombinejobs.py 
b/xmldumps-backup/dumps/recombinejobs.py
index ce5e580..12c49e5 100644
--- a/xmldumps-backup/dumps/recombinejobs.py
+++ b/xmldumps-backup/dumps/recombinejobs.py
@@ -129,11 +129,11 @@
 if not len(input_dfnames):
 self.set_status("failed")
 raise BackupError("No input files for %s found" % self.name())
-if not exists(runner.wiki.config.cat):
-raise BackupError("cat command %s not found" % 
runner.wiki.config.cat)
-compression_command = runner.wiki.config.cat
-compression_command = "%s > " % runner.wiki.config.cat
-uncompression_command = ["%s" % runner.wiki.config.cat]
+if not exists(runner.wiki.config.gzip):
+raise BackupError("gzip command %s not found" % 
runner.wiki.config.gzip)
+compression_command = runner.wiki.config.gzip
+compression_command = "%s > " % runner.wiki.config.gzip
+uncompression_command = ["%s" % runner.wiki.config.gzip, "-dc"]
 recombine_command_string = self.build_recombine_command_string(
 runner, input_dfnames, output_dfname, compression_command, 
uncompression_command)
 recombine_command = [recombine_command_string]
@@ -301,10 +301,10 @@
 if not len(input_dfnames):
 self.set_status("failed")
 raise BackupError("No input files for %s found" % self.name())
-if not exists(runner.wiki.config.cat):
-raise BackupError("cat command %s not found" % 
runner.wiki.config.cat)
-compression_command = "%s > " % runner.wiki.config.cat
-uncompression_command = ["%s" % runner.wiki.config.cat]
+if not exists(runner.wiki.config.gzip):
+raise BackupError("gzip command %s not found" % 
runner.wiki.config.gzip)
+compression_command = "%s > " % runner.wiki.config.gzip
+uncompression_command = ["%s" % runner.wiki.config.gzip, "-dc"]
 recombine_command_string = self.build_recombine_command_string(
 runner, input_dfnames, output_dfname, compression_command,
 uncompression_command, "")

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7da9a95c0c817b529f40ce024235c1afbe85600f
Gerrit-PatchSet: 2
Gerrit-Project: operations/dumps
Gerrit-Branch: master
Gerrit-Owner: ArielGlenn 
Gerrit-Reviewer: ArielGlenn 
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/dumps[master]: Revert "use cat to recombine gzipped files together"

2017-12-16 Thread ArielGlenn (Code Review)
Hello jenkins-bot,

I'd like you to do a code review.  Please visit

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

to review the following change.


Change subject: Revert "use cat to recombine gzipped files together"
..

Revert "use cat to recombine gzipped files together"

This reverts commit faf7de86d3dd98b4e5bd59809c5938050fbec42d.

A nice idea but we woudl wind up with multiple site headers in the concatenated 
file, changing the contents.

Change-Id: I7da9a95c0c817b529f40ce024235c1afbe85600f
---
M xmldumps-backup/dumps/recombinejobs.py
1 file changed, 9 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps 
refs/changes/37/398637/1

diff --git a/xmldumps-backup/dumps/recombinejobs.py 
b/xmldumps-backup/dumps/recombinejobs.py
index ce5e580..12c49e5 100644
--- a/xmldumps-backup/dumps/recombinejobs.py
+++ b/xmldumps-backup/dumps/recombinejobs.py
@@ -129,11 +129,11 @@
 if not len(input_dfnames):
 self.set_status("failed")
 raise BackupError("No input files for %s found" % self.name())
-if not exists(runner.wiki.config.cat):
-raise BackupError("cat command %s not found" % 
runner.wiki.config.cat)
-compression_command = runner.wiki.config.cat
-compression_command = "%s > " % runner.wiki.config.cat
-uncompression_command = ["%s" % runner.wiki.config.cat]
+if not exists(runner.wiki.config.gzip):
+raise BackupError("gzip command %s not found" % 
runner.wiki.config.gzip)
+compression_command = runner.wiki.config.gzip
+compression_command = "%s > " % runner.wiki.config.gzip
+uncompression_command = ["%s" % runner.wiki.config.gzip, "-dc"]
 recombine_command_string = self.build_recombine_command_string(
 runner, input_dfnames, output_dfname, compression_command, 
uncompression_command)
 recombine_command = [recombine_command_string]
@@ -301,10 +301,10 @@
 if not len(input_dfnames):
 self.set_status("failed")
 raise BackupError("No input files for %s found" % self.name())
-if not exists(runner.wiki.config.cat):
-raise BackupError("cat command %s not found" % 
runner.wiki.config.cat)
-compression_command = "%s > " % runner.wiki.config.cat
-uncompression_command = ["%s" % runner.wiki.config.cat]
+if not exists(runner.wiki.config.gzip):
+raise BackupError("gzip command %s not found" % 
runner.wiki.config.gzip)
+compression_command = "%s > " % runner.wiki.config.gzip
+uncompression_command = ["%s" % runner.wiki.config.gzip, "-dc"]
 recombine_command_string = self.build_recombine_command_string(
 runner, input_dfnames, output_dfname, compression_command,
 uncompression_command, "")

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7da9a95c0c817b529f40ce024235c1afbe85600f
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: master
Gerrit-Owner: ArielGlenn 
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...ConfirmAccount[master]: Move ConfirmAccountsPager to own file

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398636 )

Change subject: Move ConfirmAccountsPager to own file
..

Move ConfirmAccountsPager to own file

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I8a787d8b92603f10c457826ae5e6e3a165269d48
---
M .phpcs.xml
M ConfirmAccount.setup.php
M frontend/specialpages/actions/ConfirmAccount_body.php
A frontend/specialpages/actions/ConfirmAccountsPager.php
4 files changed, 107 insertions(+), 108 deletions(-)


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

diff --git a/.phpcs.xml b/.phpcs.xml
index 91b9934..0583c3a 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -8,11 +8,9 @@



-   


.

-   
-   vendor
+   
 
diff --git a/ConfirmAccount.setup.php b/ConfirmAccount.setup.php
index ce65332..31497e0 100644
--- a/ConfirmAccount.setup.php
+++ b/ConfirmAccount.setup.php
@@ -39,7 +39,7 @@
$messagesDirs['RequestAccountPage'] = __DIR__ . 
'/i18n/requestaccount';
# UI to confirm accounts
$classes['ConfirmAccountsPage'] = 
"$spActionDir/ConfirmAccount_body.php";
-   $classes['ConfirmAccountsPager'] = 
"$spActionDir/ConfirmAccount_body.php";
+   $classes['ConfirmAccountsPager'] = 
"$spActionDir/ConfirmAccountsPager.php";
$messagesDirs['ConfirmAccountPage'] = __DIR__ . 
'/i18n/confirmaccount';
# UI to see account credentials
$classes['UserCredentialsPage'] = 
"$spActionDir/UserCredentials_body.php";
diff --git a/frontend/specialpages/actions/ConfirmAccount_body.php 
b/frontend/specialpages/actions/ConfirmAccount_body.php
index 31ffec3..f8ecd0c 100644
--- a/frontend/specialpages/actions/ConfirmAccount_body.php
+++ b/frontend/specialpages/actions/ConfirmAccount_body.php
@@ -827,107 +827,3 @@
return 'users';
}
 }
-
-/**
- * Query to list out pending accounts
- */
-class ConfirmAccountsPager extends ReverseChronologicalPager {
-   public $mForm, $mConds;
-
-   function __construct(
-   $form, $conds, $type, $rejects = false, $showHeld = false, 
$showStale = false
-   ) {
-   $this->mForm = $form;
-   $this->mConds = $conds;
-
-   $this->mConds['acr_type'] = $type;
-
-   $this->rejects = $rejects;
-   $this->stale = $showStale;
-   if ( $rejects || $showStale ) {
-   $this->mConds['acr_deleted'] = 1;
-   } else {
-   $this->mConds['acr_deleted'] = 0;
-   if ( $showHeld ) {
-   $this->mConds[] = 'acr_held IS NOT NULL';
-   } else {
-   $this->mConds[] = 'acr_held IS NULL';
-   }
-
-   }
-   parent::__construct();
-   # Treat 20 as the default limit, since each entry takes up 5 
rows.
-   $urlLimit = $this->mRequest->getInt( 'limit' );
-   $this->mLimit = $urlLimit ? $urlLimit : 20;
-   }
-
-   /**
-* @return Title
-*/
-   function getTitle() {
-   return $this->mForm->getFullTitle();
-   }
-
-   /**
-* @param $row
-* @return string
-*/
-   function formatRow( $row ) {
-   return $this->mForm->formatRow( $row );
-   }
-
-   /**
-* @return string
-*/
-   function getStartBody() {
-   if ( $this->getNumRows() ) {
-   return '';
-   } else {
-   return '';
-   }
-   }
-
-   /**
-* @return string
-*/
-   function getEndBody() {
-   if ( $this->getNumRows() ) {
-   return '';
-   } else {
-   return '';
-   }
-   }
-
-   /**
-* @return array
-*/
-   function getQueryInfo() {
-   $conds = $this->mConds;
-   $tables = [ 'account_requests' ];
-   $fields = [ 'acr_id', 'acr_name', 'acr_real_name', 
'acr_registration', 'acr_held',
-   'acr_user', 'acr_email', 'acr_email_authenticated', 
'acr_bio', 'acr_notes',
-   'acr_urls', 'acr_filename', 'acr_type', 'acr_rejected' 
];
-   # Stale requests have a user ID of zero
-   if ( $this->stale ) {
-   $conds[] = 'acr_user = 0';
-   } elseif ( $this->rejects ) {
-   $conds[] = 'acr_user != 0';
-   $tables[] = 'user';
-   $conds[] = 'acr_user = user_id';
-   $fields[] = 

[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: Move classes to own files

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398635 )

Change subject: Move classes to own files
..

Move classes to own files

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I358bc50deee92964cdc25d1912708cfa2f5cc081
---
M .phpcs.xml
M Collection.php
R CollectionProposals.php
A CollectionSuggest.php
A rendering/CollectionAPIResult.php
R rendering/CollectionRenderingAPI.php
A rendering/MWServeRenderingAPI.php
7 files changed, 336 insertions(+), 316 deletions(-)


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

diff --git a/.phpcs.xml b/.phpcs.xml
index 10a4c41..1d566f2 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -6,7 +6,6 @@



-   



diff --git a/Collection.php b/Collection.php
index 2f6f21a..3e60c5e 100644
--- a/Collection.php
+++ b/Collection.php
@@ -180,8 +180,8 @@
 $wgAutoloadClasses['SpecialCollection'] = __DIR__ . '/Collection.body.php';
 $wgAutoloadClasses['CollectionSession'] = __DIR__ . '/Collection.session.php';
 $wgAutoloadClasses['CollectionHooks'] = __DIR__ . '/Collection.hooks.php';
-$wgAutoloadClasses['CollectionSuggest'] = __DIR__ . '/Collection.suggest.php';
-$wgAutoloadClasses['CollectionProposals'] = __DIR__ . 
'/Collection.suggest.php';
+$wgAutoloadClasses['CollectionSuggest'] = __DIR__ . '/CollectionSuggest.php';
+$wgAutoloadClasses['CollectionProposals'] = __DIR__ . 
'/CollectionProposals.php';
 
 $wgAutoloadClasses['SpecialRenderBook'] = __DIR__ . '/SpecialRenderBook.php';
 $wgAutoloadClasses[\MediaWiki\Extensions\Collection\DataProvider::class]
@@ -214,9 +214,9 @@
 $wgAutoloadClasses['CollectionSuggestTemplate'] =
__DIR__ . '/templates/CollectionSuggestTemplate.php';
 
-$wgAutoloadClasses['CollectionRenderingAPI'] = __DIR__ . '/RenderingAPI.php';
-$wgAutoloadClasses['MWServeRenderingAPI'] = __DIR__ . '/RenderingAPI.php';
-$wgAutoloadClasses['CollectionAPIResult'] = __DIR__ . '/RenderingAPI.php';
+$wgAutoloadClasses['CollectionRenderingAPI'] = __DIR__ . 
'/rendering/CollectionRenderingAPI.php';
+$wgAutoloadClasses['MWServeRenderingAPI'] = __DIR__ . 
'/rendering/MWServeRenderingAPI.php';
+$wgAutoloadClasses['CollectionAPIResult'] = __DIR__ . 
'/rendering/CollectionAPIResult.php';
 
 $wgMessagesDirs['Collection'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['CollectionAlias'] = __DIR__ . 
'/Collection.alias.php';
diff --git a/Collection.suggest.php b/CollectionProposals.php
similarity index 62%
rename from Collection.suggest.php
rename to CollectionProposals.php
index 7d1e142..42d7d77 100644
--- a/Collection.suggest.php
+++ b/CollectionProposals.php
@@ -21,208 +21,6 @@
  */
 
 /**
- * Class: CollectionSuggest
- *
- * This class contains only static methods, so theres no need for a 
constructer.
- * When the page Special:Book/suggest/ is loaded the method run() is called.
- * Ajax calles refresh().
- * When clearing a book the method clear() should be called.
- */
-class CollectionSuggest {
-   /**
-* 
===
-* public methods
-* 
===
-*/
-
-   /**
-* Main entrypoint
-*
-* @param string $mode
-*'add' => add one title to the book.
-*'addAll' => Add a list of titles to the book.
-*'ban' => Ban a title from the proposals.
-*'unban' => Undo a ban.
-*'remove' => Remove a title from the book, and ban it.
-*'removeOnly' => Remove a title without banning it.
-* @param string|string[] $param Name of the article to be added, banned
-*or removed, or a list of article names to be added.
-*/
-   public static function run( $mode = '', $param = '' ) {
-   global $wgOut;
-
-   if ( !CollectionSession::hasSession() ) {
-   CollectionSession::startSession();
-   }
-
-   $template = self::getCollectionSuggestTemplate( $mode, $param );
-   $wgOut->setPageTitle( wfMessage( 'coll-suggest_title' ) );
-   $wgOut->addModules( 'ext.collection.suggest' );
-   $wgOut->addTemplate( $template );
-   }
-
-   /**
-* Entrypoint for Ajax
-*
-* @param string $mode
-*'add' => add one title to the book.
-*'addAll' => Add a list of titles to the book.
-*'ban' => Ban a title from the proposals.
-*'unban' => Undo a ban.
-*'remove' => Remove a title from the book, and ban it.
-*'removeOnly' => Remove a title without banning it.
-* @param string|string[] 

[MediaWiki-commits] [Gerrit] operations/dumps[master]: use cat to recombine gzipped files together

2017-12-16 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398634 )

Change subject: use cat to recombine gzipped files together
..


use cat to recombine gzipped files together

Most if not all tools should already support uncompressing such files.

Bug: T182572
Change-Id: I650ceb1caf5963a1b5eb6a955fcf19a14096e1c6
---
M xmldumps-backup/dumps/recombinejobs.py
1 file changed, 9 insertions(+), 9 deletions(-)

Approvals:
  ArielGlenn: Looks good to me, approved



diff --git a/xmldumps-backup/dumps/recombinejobs.py 
b/xmldumps-backup/dumps/recombinejobs.py
index 12c49e5..ce5e580 100644
--- a/xmldumps-backup/dumps/recombinejobs.py
+++ b/xmldumps-backup/dumps/recombinejobs.py
@@ -129,11 +129,11 @@
 if not len(input_dfnames):
 self.set_status("failed")
 raise BackupError("No input files for %s found" % self.name())
-if not exists(runner.wiki.config.gzip):
-raise BackupError("gzip command %s not found" % 
runner.wiki.config.gzip)
-compression_command = runner.wiki.config.gzip
-compression_command = "%s > " % runner.wiki.config.gzip
-uncompression_command = ["%s" % runner.wiki.config.gzip, "-dc"]
+if not exists(runner.wiki.config.cat):
+raise BackupError("cat command %s not found" % 
runner.wiki.config.cat)
+compression_command = runner.wiki.config.cat
+compression_command = "%s > " % runner.wiki.config.cat
+uncompression_command = ["%s" % runner.wiki.config.cat]
 recombine_command_string = self.build_recombine_command_string(
 runner, input_dfnames, output_dfname, compression_command, 
uncompression_command)
 recombine_command = [recombine_command_string]
@@ -301,10 +301,10 @@
 if not len(input_dfnames):
 self.set_status("failed")
 raise BackupError("No input files for %s found" % self.name())
-if not exists(runner.wiki.config.gzip):
-raise BackupError("gzip command %s not found" % 
runner.wiki.config.gzip)
-compression_command = "%s > " % runner.wiki.config.gzip
-uncompression_command = ["%s" % runner.wiki.config.gzip, "-dc"]
+if not exists(runner.wiki.config.cat):
+raise BackupError("cat command %s not found" % 
runner.wiki.config.cat)
+compression_command = "%s > " % runner.wiki.config.cat
+uncompression_command = ["%s" % runner.wiki.config.cat]
 recombine_command_string = self.build_recombine_command_string(
 runner, input_dfnames, output_dfname, compression_command,
 uncompression_command, "")

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I650ceb1caf5963a1b5eb6a955fcf19a14096e1c6
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: master
Gerrit-Owner: ArielGlenn 
Gerrit-Reviewer: ArielGlenn 
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/dumps[master]: use cat to recombine gzipped files together

2017-12-16 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398634 )

Change subject: use cat to recombine gzipped files together
..

use cat to recombine gzipped files together

Most if not all tools should already support uncompressing such files.

Bug: T182572
Change-Id: I650ceb1caf5963a1b5eb6a955fcf19a14096e1c6
---
M xmldumps-backup/dumps/recombinejobs.py
1 file changed, 9 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps 
refs/changes/34/398634/1

diff --git a/xmldumps-backup/dumps/recombinejobs.py 
b/xmldumps-backup/dumps/recombinejobs.py
index 12c49e5..ce5e580 100644
--- a/xmldumps-backup/dumps/recombinejobs.py
+++ b/xmldumps-backup/dumps/recombinejobs.py
@@ -129,11 +129,11 @@
 if not len(input_dfnames):
 self.set_status("failed")
 raise BackupError("No input files for %s found" % self.name())
-if not exists(runner.wiki.config.gzip):
-raise BackupError("gzip command %s not found" % 
runner.wiki.config.gzip)
-compression_command = runner.wiki.config.gzip
-compression_command = "%s > " % runner.wiki.config.gzip
-uncompression_command = ["%s" % runner.wiki.config.gzip, "-dc"]
+if not exists(runner.wiki.config.cat):
+raise BackupError("cat command %s not found" % 
runner.wiki.config.cat)
+compression_command = runner.wiki.config.cat
+compression_command = "%s > " % runner.wiki.config.cat
+uncompression_command = ["%s" % runner.wiki.config.cat]
 recombine_command_string = self.build_recombine_command_string(
 runner, input_dfnames, output_dfname, compression_command, 
uncompression_command)
 recombine_command = [recombine_command_string]
@@ -301,10 +301,10 @@
 if not len(input_dfnames):
 self.set_status("failed")
 raise BackupError("No input files for %s found" % self.name())
-if not exists(runner.wiki.config.gzip):
-raise BackupError("gzip command %s not found" % 
runner.wiki.config.gzip)
-compression_command = "%s > " % runner.wiki.config.gzip
-uncompression_command = ["%s" % runner.wiki.config.gzip, "-dc"]
+if not exists(runner.wiki.config.cat):
+raise BackupError("cat command %s not found" % 
runner.wiki.config.cat)
+compression_command = "%s > " % runner.wiki.config.cat
+uncompression_command = ["%s" % runner.wiki.config.cat]
 recombine_command_string = self.build_recombine_command_string(
 runner, input_dfnames, output_dfname, compression_command,
 uncompression_command, "")

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I650ceb1caf5963a1b5eb6a955fcf19a14096e1c6
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps
Gerrit-Branch: master
Gerrit-Owner: ArielGlenn 

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


[MediaWiki-commits] [Gerrit] mediawiki...CategoryTree[master]: Split CategoryPageSubclass.php into two files

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398633 )

Change subject: Split CategoryPageSubclass.php into two files
..

Split CategoryPageSubclass.php into two files

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass


Change-Id: Ic4d064272a5297e33b1edc090b807937cfb06545
---
M .phpcs.xml
A CategoryTreeCategoryPage.php
R CategoryTreeCategoryViewer.php
M extension.json
4 files changed, 7 insertions(+), 7 deletions(-)


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

diff --git a/.phpcs.xml b/.phpcs.xml
index d473d2b..3f9d0cb 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -3,7 +3,6 @@



-   



diff --git a/CategoryTreeCategoryPage.php b/CategoryTreeCategoryPage.php
new file mode 100644
index 000..ebec49f
--- /dev/null
+++ b/CategoryTreeCategoryPage.php
@@ -0,0 +1,5 @@
+https://gerrit.wikimedia.org/r/398633
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ArticleRatings[master]: Split RatingDataClass.php into two files

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398632 )

Change subject: Split RatingDataClass.php into two files
..

Split RatingDataClass.php into two files

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I55d41d0d354a9bbd7757a326588bc4ac6bb364fc
---
M .phpcs.xml
R Rating.php
A RatingData.php
M extension.json
4 files changed, 31 insertions(+), 31 deletions(-)


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

diff --git a/.phpcs.xml b/.phpcs.xml
index 6e97740..66496e3 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -2,7 +2,6 @@
 


-   



diff --git a/RatingDataClass.php b/Rating.php
similarity index 72%
rename from RatingDataClass.php
rename to Rating.php
index e056b4e..1341195 100644
--- a/RatingDataClass.php
+++ b/Rating.php
@@ -1,33 +1,5 @@
 plain();
-   if ( empty( $json ) ) {
-   trigger_error( 'ARE Error: empty JSON' );
-   }
-   return json_decode( $json, true );
-   }
-
-   public static function getAllRatings() {
-   $JSON = self::getJSON();
-
-   $returners = [];
-
-   foreach ( $JSON as $data ) {
-   $returners[] = new Rating( $data['codename'] );
-   }
-
-   return $returners;
-   }
-
-   public static function getDefaultRating() {
-   $JSON = self::getJSON();
-
-   return new Rating( $JSON[0]['codename'] );
-   }
-}
-
 class Rating {
protected $codename;
protected $data = [];
diff --git a/RatingData.php b/RatingData.php
new file mode 100644
index 000..00c4eb7
--- /dev/null
+++ b/RatingData.php
@@ -0,0 +1,29 @@
+plain();
+   if ( empty( $json ) ) {
+   trigger_error( 'ARE Error: empty JSON' );
+   }
+   return json_decode( $json, true );
+   }
+
+   public static function getAllRatings() {
+   $JSON = self::getJSON();
+
+   $returners = [];
+
+   foreach ( $JSON as $data ) {
+   $returners[] = new Rating( $data['codename'] );
+   }
+
+   return $returners;
+   }
+
+   public static function getDefaultRating() {
+   $JSON = self::getJSON();
+
+   return new Rating( $JSON[0]['codename'] );
+   }
+}
diff --git a/extension.json b/extension.json
index 85c663c..6612316 100644
--- a/extension.json
+++ b/extension.json
@@ -33,8 +33,8 @@
"ArticleRatingsAlias": "ArticleRatings.alias.php"
},
"AutoloadClasses": {
-   "RatingData": "RatingDataClass.php",
-   "Rating": "RatingDataClass.php",
+   "RatingData": "RatingData.php",
+   "Rating": "Rating.php",
"AreHooks": "ArticleRatingsHooks.php",
"SpecialChangeRating": "SpecialChangeRating.php",
"SpecialMassRatings": "SpecialMassRatings.php"

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...BetaFeatures[master]: Move BetaFeaturesMissingFieldException to own file

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398631 )

Change subject: Move BetaFeaturesMissingFieldException to own file
..

Move BetaFeaturesMissingFieldException to own file

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I3442bb7e5bca3e494d533dc71288c04646efbde6
---
M .phpcs.xml
M BetaFeaturesHooks.php
M extension.json
A includes/BetaFeaturesMissingFieldException.php
4 files changed, 26 insertions(+), 5 deletions(-)


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

diff --git a/.phpcs.xml b/.phpcs.xml
index f0ce77f..6683cf1 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -4,7 +4,6 @@



-   



diff --git a/BetaFeaturesHooks.php b/BetaFeaturesHooks.php
index c3a1ab2..d0454ae 100644
--- a/BetaFeaturesHooks.php
+++ b/BetaFeaturesHooks.php
@@ -23,9 +23,6 @@
  * @license GNU General Public License version 2 or later
  */
 
-class BetaFeaturesMissingFieldException extends Exception {
-}
-
 class BetaFeaturesHooks {
 
/**
diff --git a/extension.json b/extension.json
index 6e3516f..dc15655 100644
--- a/extension.json
+++ b/extension.json
@@ -82,7 +82,7 @@
},
"AutoloadClasses": {
"BetaFeaturesHooks": "BetaFeaturesHooks.php",
-   "BetaFeaturesMissingFieldException": "BetaFeaturesHooks.php",
+   "BetaFeaturesMissingFieldException": 
"includes/BetaFeaturesMissingFieldException.php",
"NewHTMLCheckField": "includes/NewHTMLCheckField.php",
"HTMLFeatureField": "includes/HTMLFeatureField.php",
"HTMLTextBlockField": "includes/HTMLTextBlockField.php",
diff --git a/includes/BetaFeaturesMissingFieldException.php 
b/includes/BetaFeaturesMissingFieldException.php
new file mode 100644
index 000..68f29de
--- /dev/null
+++ b/includes/BetaFeaturesMissingFieldException.php
@@ -0,0 +1,25 @@
+http://www.gnu.org/licenses/>.
+ *
+ * @file
+ * @ingroup Extensions
+ * @copyright 2013 Mark Holmquist and others; see AUTHORS
+ * @license GNU General Public License version 2 or later
+ */
+
+class BetaFeaturesMissingFieldException extends Exception {
+}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ApiFeatureUsage[master]: Move ApiFeatureUsageQueryEngineElasticaConnection to own file

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398630 )

Change subject: Move ApiFeatureUsageQueryEngineElasticaConnection to own file
..

Move ApiFeatureUsageQueryEngineElasticaConnection to own file

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass

Change-Id: I587ef41434d9bbca1de5869c9b9cd2f8083e7227
---
M .phpcs.xml
M ApiFeatureUsageQueryEngineElastica.php
A ApiFeatureUsageQueryEngineElasticaConnection.php
M extension.json
4 files changed, 30 insertions(+), 32 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApiFeatureUsage 
refs/changes/30/398630/1

diff --git a/.phpcs.xml b/.phpcs.xml
index 2005fa3..d87bc24 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -6,10 +6,8 @@



-   

.


-   vendor
 
diff --git a/ApiFeatureUsageQueryEngineElastica.php 
b/ApiFeatureUsageQueryEngineElastica.php
index 2102dfe..fdc22c5 100644
--- a/ApiFeatureUsageQueryEngineElastica.php
+++ b/ApiFeatureUsageQueryEngineElastica.php
@@ -167,32 +167,3 @@
}
}
 }
-
-/**
- * Class to create the connection
- */
-class ApiFeatureUsageQueryEngineElasticaConnection extends ElasticaConnection {
-   private $options = [];
-
-   public function __construct( $options = null ) {
-   if ( !is_array( $options ) ) {
-   $options = [];
-   }
-
-   if ( empty( $options['serverList'] ) || !is_array( 
$options['serverList'] ) ) {
-   throw new MWException( __METHOD__ . ': serverList is 
not set or is not valid.' );
-   }
-
-   $this->options = $options + [
-   'maxConnectionAttempts' => 1,
-   ];
-   }
-
-   public function getServerList() {
-   return $this->options['serverList'];
-   }
-
-   public function getMaxConnectionAttempts() {
-   return $this->options['maxConnectionAttempts'];
-   }
-}
diff --git a/ApiFeatureUsageQueryEngineElasticaConnection.php 
b/ApiFeatureUsageQueryEngineElasticaConnection.php
new file mode 100644
index 000..81e7a6e
--- /dev/null
+++ b/ApiFeatureUsageQueryEngineElasticaConnection.php
@@ -0,0 +1,29 @@
+options = $options + [
+   'maxConnectionAttempts' => 1,
+   ];
+   }
+
+   public function getServerList() {
+   return $this->options['serverList'];
+   }
+
+   public function getMaxConnectionAttempts() {
+   return $this->options['maxConnectionAttempts'];
+   }
+}
diff --git a/extension.json b/extension.json
index 8ffef14..7ae1b91 100644
--- a/extension.json
+++ b/extension.json
@@ -34,7 +34,7 @@
"ApiQueryFeatureUsage": "ApiQueryFeatureUsage.php",
"ApiFeatureUsageQueryEngine": "ApiFeatureUsageQueryEngine.php",
"ApiFeatureUsageQueryEngineElastica": 
"ApiFeatureUsageQueryEngineElastica.php",
-   "ApiFeatureUsageQueryEngineElasticaConnection": 
"ApiFeatureUsageQueryEngineElastica.php",
+   "ApiFeatureUsageQueryEngineElasticaConnection": 
"ApiFeatureUsageQueryEngineElasticaConnection.php",
"ApiFeatureUsageHooks": "ApiFeatureUsage.hooks.php"
},
"ResourceModules": {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Metrolook[master]: Rename class MetrolookHooks to match file

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

Change subject: Rename class MetrolookHooks to match file
..


Rename class MetrolookHooks to match file

Change-Id: I80d76dfdf0465cb31e15ea58282472c4b7a0d451
---
M .phpcs.xml
M SkinMetrolookHooks.php
M skin.json
3 files changed, 6 insertions(+), 7 deletions(-)

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



diff --git a/.phpcs.xml b/.phpcs.xml
index a143456..d57c719 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -4,7 +4,6 @@



-   

.

diff --git a/SkinMetrolookHooks.php b/SkinMetrolookHooks.php
index dc12137..2eae141 100644
--- a/SkinMetrolookHooks.php
+++ b/SkinMetrolookHooks.php
@@ -7,7 +7,7 @@
  * @ingroup Skins
  */
 
-class MetrolookHooks {
+class SkinMetrolookHooks {
 
/* Protected Static Members */
 
diff --git a/skin.json b/skin.json
index fa6dd52..125157d 100644
--- a/skin.json
+++ b/skin.json
@@ -28,20 +28,20 @@
},
"Hooks": {
"BeforePageDisplay": [
-   "MetrolookHooks::beforePageDisplay"
+   "SkinMetrolookHooks::beforePageDisplay"
],
"GetPreferences": [
-   "MetrolookHooks::getPreferences"
+   "SkinMetrolookHooks::getPreferences"
],
"ResourceLoaderGetConfigVars": [
-   "MetrolookHooks::resourceLoaderGetConfigVars"
+   "SkinMetrolookHooks::resourceLoaderGetConfigVars"
],
"MakeGlobalVariablesScript": [
-   "MetrolookHooks::makeGlobalVariablesScript"
+   "SkinMetrolookHooks::makeGlobalVariablesScript"
]
},
"AutoloadClasses": {
-   "MetrolookHooks": "SkinMetrolookHooks.php",
+   "SkinMetrolookHooks": "SkinMetrolookHooks.php",
"SkinMetrolook": "SkinMetrolook.php",
"MetrolookTemplate": "MetrolookTemplate.php",
"Metrolook\\ResourceLoaderLessModule": 
"ResourceLoaderLessModule.php"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I80d76dfdf0465cb31e15ea58282472c4b7a0d451
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/skins/Metrolook
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Umherirrender 
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...ActiveAbstract[master]: Move classes to own files

2017-12-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398629 )

Change subject: Move classes to own files
..

Move classes to own files

Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass
Rename a file to match class
Make use of autoloader to remove require_once

Change-Id: I118b92dd16fff40b253c2c1009827086ef847dc2
---
M .phpcs.xml
M AbstractFilter.php
M GoogleCoopFilter.php
A NoredirectFilter.php
M extension.json
M tests/phpunit/AbstractFilterTest.php
R tests/phpunit/BackupDumperAbstractsTest.php
A tests/phpunit/DroppingReturnValueMap.php
8 files changed, 110 insertions(+), 105 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ActiveAbstract 
refs/changes/29/398629/1

diff --git a/.phpcs.xml b/.phpcs.xml
index 32990b8..fba8ef0 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -2,8 +2,6 @@
 


-   
-   


.
diff --git a/AbstractFilter.php b/AbstractFilter.php
index 6fb55cf..548b540 100644
--- a/AbstractFilter.php
+++ b/AbstractFilter.php
@@ -297,13 +297,3 @@
$this->revision = $rev;
}
 }
-
-class NoredirectFilter extends DumpFilter {
-   /**
-* @param stdClass $page
-* @return bool
-*/
-   function pass( $page ) {
-   return !$page->page_is_redirect;
-   }
-}
diff --git a/GoogleCoopFilter.php b/GoogleCoopFilter.php
index 9fa2ea0..a455789 100644
--- a/GoogleCoopFilter.php
+++ b/GoogleCoopFilter.php
@@ -1,5 +1,4 @@
 page_is_redirect;
+   }
+}
diff --git a/extension.json b/extension.json
index 95861eb..657d882 100644
--- a/extension.json
+++ b/extension.json
@@ -15,5 +15,10 @@
"i18n"
]
},
+   "AutoloadClasses": {
+   "AbstractFilter": "AbstractFilter.php",
+   "NoredirectFilter": "NoredirectFilter.php",
+   "GoogleCoopFilter": "GoogleCoopFilter.php"
+   },
"manifest_version": 1
 }
diff --git a/tests/phpunit/AbstractFilterTest.php 
b/tests/phpunit/AbstractFilterTest.php
index 3698016..d9b3f59 100644
--- a/tests/phpunit/AbstractFilterTest.php
+++ b/tests/phpunit/AbstractFilterTest.php
@@ -1,95 +1,4 @@
 expects( $this->once() )
- *   ->method( 'methodName' )
- *   ->parameters( $this->equalTo( param1 ), $this->equalTo( param2 ) )
- *   ->will( $this->returnValue( ret12 ) );
- *   mock->expects( $this->once() )
- *   ->method( 'methodName' )
- *   ->parameters( $this->equalTo( param3 ), $this->equalTo( param4 ) )
- *   ->will( $this->returnValue( ret34 ) );
- *
- * (the above code ignore the first of the two statements) to do what it is
- * supposed to do (i.e.: asserting that methodName is called exactly two times.
- * Once with parameters param1, param2 returning ret12, and once with
- * parameters param3, param4 returning ret34 (which of the two happens first
- * does not matter), you can use the following code:
- *
- *   $map = array(
- * array( param1, param2, ret12),
- * array( param3, param4, ret34)
- *   );
- *   mock->expects( $this->exactly( count( $map ) ) )
- *   ->method( 'methodName' )
- *   ->will( new DroppingReturnValueMap( $map ) );
- *
- * This code asserts that each parameter given in $map is used exactly once,
- * while each call returns the given return value.
- *
- *
- * The implementation of DroppingReturnValueMap is based off of
- * PHPUnit_Framework_MockObject_Stub_ReturnValueMap from PHPUnit_MockObject by
- * Sebastian Bergmann (under the 3-clause-BSD licence).
- */
-class DroppingReturnValueMap implements PHPUnit_Framework_MockObject_Stub {
-   protected $valueMap;
-
-   public function __construct( array $valueMap ) {
-   $this->valueMap = $valueMap;
-   }
-
-   public function invoke( PHPUnit_Framework_MockObject_Invocation 
$invocation ) {
-   $parameterCount = count( $invocation->parameters );
-
-   foreach ( $this->valueMap as $key => $map ) {
-   if ( !is_array( $map ) || $parameterCount != count( 
$map ) - 1 ) {
-   continue;
-   }
-
-   $return = array_pop( $map );
-   if ( $invocation->parameters === $map ) {
-   unset( $this->valueMap[$key] );
-
-   return $return;
-   }
-   }
-
-   // Could not find the actual parameters in valueMap. We signal 
failure, after
-   // formatting the actual parameters in $actual, to have a nice 
error message
-   $actual = "(";
-   $connective = "";
-   foreach ( $invocation->parameters as $parameter ) {
-   $actual .= $connective . " ";
-   try {
-   

[MediaWiki-commits] [Gerrit] mediawiki...Metrolook[master]: Add minus-x to "composer test"

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

Change subject: Add minus-x to "composer test"
..


Add minus-x to "composer test"

Add minus-x to "composer test" and "composer fix"

Bug: T175794
Change-Id: I7ca1b7636e5ed274592398af75e335b7aaf3da0b
---
M composer.json
1 file changed, 8 insertions(+), 3 deletions(-)

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



diff --git a/composer.json b/composer.json
index 094279b..c9fa448 100644
--- a/composer.json
+++ b/composer.json
@@ -35,13 +35,18 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"mediawiki/mediawiki-codesniffer": "14.1.0",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
-   "fix": "phpcbf",
+   "fix": [
+   "phpcbf",
+   "minus-x fix ."
+   ],
"test": [
"parallel-lint . --exclude node_modules --exclude 
vendor",
-   "phpcs -p -s"
+   "phpcs -p -s",
+   "minus-x check ."
]
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7ca1b7636e5ed274592398af75e335b7aaf3da0b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Metrolook
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Umherirrender 
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...MinervaNeue[master]: Add minus-x to "composer test"

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

Change subject: Add minus-x to "composer test"
..


Add minus-x to "composer test"

Add minus-x to "composer test" and "composer fix"

Bug: T175794
Change-Id: I54088f3895ca931006c6a004a48c87f9445abf8c
---
M composer.json
1 file changed, 6 insertions(+), 3 deletions(-)

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



diff --git a/composer.json b/composer.json
index 8976ec9..0d46d2f 100644
--- a/composer.json
+++ b/composer.json
@@ -2,15 +2,18 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"mediawiki/mediawiki-codesniffer": "14.1.0",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
"test": [
"parallel-lint . --exclude vendor --exclude 
node_modules",
-   "phpcs -p -s"
+   "phpcs -p -s",
+   "minus-x check ."
],
"fix": [
-   "phpcbf"
+   "phpcbf",
+   "minus-x fix ."
]
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I54088f3895ca931006c6a004a48c87f9445abf8c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/MinervaNeue
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam 
Gerrit-Reviewer: Pmiazga 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Fix case of file ApiQueryConfiguredPages.php

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

Change subject: Fix case of file ApiQueryConfiguredPages.php
..


Fix case of file ApiQueryConfiguredPages.php

Makes MediaWiki.Files.ClassMatchesFilename.WrongCase pass

Change-Id: I7e9c8d58c1fb3f0605f8dd8d0d90d9b1f5b6463d
---
M .phpcs.xml
M FlaggedRevs.php
R api/reports/ApiQueryConfiguredpages.php
3 files changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/.phpcs.xml b/.phpcs.xml
index beff47f..1e755d5 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -5,7 +5,6 @@



-   



@@ -14,6 +13,9 @@



+   
+   */maintenance/*
+   

frontend/language/

diff --git a/FlaggedRevs.php b/FlaggedRevs.php
index bcd048d..e22582d 100644
--- a/FlaggedRevs.php
+++ b/FlaggedRevs.php
@@ -337,7 +337,7 @@
 # ReviewedPages for API
 $wgAutoloadClasses['ApiQueryReviewedpages'] = 
"$apiReportDir/ApiQueryReviewedpages.php";
 # ConfiguredPages for API
-$wgAutoloadClasses['ApiQueryConfiguredpages'] = 
"$apiReportDir/ApiQueryConfiguredPages.php";
+$wgAutoloadClasses['ApiQueryConfiguredpages'] = 
"$apiReportDir/ApiQueryConfiguredpages.php";
 # Flag metadata for pages for API
 $wgAutoloadClasses['ApiQueryFlagged'] = "$apiReportDir/ApiQueryFlagged.php";
 # Site flag config for API
diff --git a/api/reports/ApiQueryConfiguredPages.php 
b/api/reports/ApiQueryConfiguredpages.php
similarity index 100%
rename from api/reports/ApiQueryConfiguredPages.php
rename to api/reports/ApiQueryConfiguredpages.php

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e9c8d58c1fb3f0605f8dd8d0d90d9b1f5b6463d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Fomafix 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [Bugfix] Touch the page, not the item in newitem.py

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

Change subject: [Bugfix] Touch the page, not the item in newitem.py
..


[Bugfix] Touch the page, not the item in newitem.py

Bug: T179924
Change-Id: Id0f7dccfcf25c9278957ba27fcd3fd1cf4c381b5
---
M scripts/newitem.py
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/scripts/newitem.py b/scripts/newitem.py
index 3ebb54d..50a06f1 100755
--- a/scripts/newitem.py
+++ b/scripts/newitem.py
@@ -116,7 +116,8 @@
 "Haven't implemented that yet so skipping.")
 return
 
-self.create_item_for_page(page, callback=self._callback)
+self.create_item_for_page(
+page, callback=lambda _, exc: self._callback(page, exc))
 
 
 def main(*args):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id0f7dccfcf25c9278957ba27fcd3fd1cf4c381b5
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek 
Gerrit-Reviewer: Dalba 
Gerrit-Reviewer: Framawiki 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Magul 
Gerrit-Reviewer: Matěj Suchánek 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: Zoranzoki21 
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...MinervaNeue[master]: Add minus-x to "composer test"

2017-12-16 Thread Rafidaslam (Code Review)
Rafidaslam has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398628 )

Change subject: Add minus-x to "composer test"
..

Add minus-x to "composer test"

Add minus-x to "composer test" and "composer fix"

Bug: T175794
Change-Id: I54088f3895ca931006c6a004a48c87f9445abf8c
---
M composer.json
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/28/398628/1

diff --git a/composer.json b/composer.json
index 8976ec9..0d46d2f 100644
--- a/composer.json
+++ b/composer.json
@@ -2,15 +2,18 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"mediawiki/mediawiki-codesniffer": "14.1.0",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
"test": [
"parallel-lint . --exclude vendor --exclude 
node_modules",
-   "phpcs -p -s"
+   "phpcs -p -s",
+   "minus-x check ."
],
"fix": [
-   "phpcbf"
+   "phpcbf",
+   "minus-x fix ."
]
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I54088f3895ca931006c6a004a48c87f9445abf8c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/MinervaNeue
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam 

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


[MediaWiki-commits] [Gerrit] mediawiki...Metrolook[master]: Add minus-x to "composer test"

2017-12-16 Thread Rafidaslam (Code Review)
Rafidaslam has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398627 )

Change subject: Add minus-x to "composer test"
..

Add minus-x to "composer test"

Add minus-x to "composer test" and "composer fix"

Bug: T175794
Change-Id: I7ca1b7636e5ed274592398af75e335b7aaf3da0b
---
M composer.json
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Metrolook 
refs/changes/27/398627/1

diff --git a/composer.json b/composer.json
index 094279b..c9fa448 100644
--- a/composer.json
+++ b/composer.json
@@ -35,13 +35,18 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"mediawiki/mediawiki-codesniffer": "14.1.0",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
-   "fix": "phpcbf",
+   "fix": [
+   "phpcbf",
+   "minus-x fix ."
+   ],
"test": [
"parallel-lint . --exclude node_modules --exclude 
vendor",
-   "phpcs -p -s"
+   "phpcs -p -s",
+   "minus-x check ."
]
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ca1b7636e5ed274592398af75e335b7aaf3da0b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Metrolook
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Update doc for readinglists role

2017-12-16 Thread Code Review
Gergő Tisza has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398626 )

Change subject: Update doc for readinglists role
..

Update doc for readinglists role

Wiki documentation was expanded + readinglistorder endpoint was removed.

Change-Id: I8a251178a5ede2027ce940f5e58e2633865cdf0d
---
M puppet/modules/role/manifests/readinglists.pp
M puppet/modules/role/templates/readinglists/VagrantRoleReadingLists.wiki.erb
2 files changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/26/398626/1

diff --git a/puppet/modules/role/manifests/readinglists.pp 
b/puppet/modules/role/manifests/readinglists.pp
index a9faad2..c9fd873 100644
--- a/puppet/modules/role/manifests/readinglists.pp
+++ b/puppet/modules/role/manifests/readinglists.pp
@@ -1,8 +1,9 @@
 # == Class: role::readinglists
-# Installs the Reading Lists[1] extension which provides
-# an API to manage private lists of pages.
+# Installs the Reading Lists extension[1] and service[2]
+# which provides an API to manage private lists of pages.
 #
 # [1] https://www.mediawiki.org/wiki/Extension:ReadingLists
+# [2] https://www.mediawiki.org/wiki/Reading/Reading_List_Service
 #
 class role::readinglists {
 include ::role::restbase
diff --git 
a/puppet/modules/role/templates/readinglists/VagrantRoleReadingLists.wiki.erb 
b/puppet/modules/role/templates/readinglists/VagrantRoleReadingLists.wiki.erb
index 8497ae3..e350167 100644
--- 
a/puppet/modules/role/templates/readinglists/VagrantRoleReadingLists.wiki.erb
+++ 
b/puppet/modules/role/templates/readinglists/VagrantRoleReadingLists.wiki.erb
@@ -1,3 +1,3 @@
-* Documentation: [[mw:Extension:ReadingLists|]]
-* API help: [[Special:ApiHelp/readinglists|readinglists]], 
[[Special:ApiHelp/query+readinglists|query+readinglists]], 
[[Special:ApiHelp/query+readinglistentries|query+readinglistentries]], 
[[Special:ApiHelp/query+readinglistorder|query+readinglistorder]], [<%= 
@restbase_url %>#/Reading_lists RESTBase]
+* Documentation: [[mw:Extension:ReadingLists]], 
[[mw:Reading/Reading_List_Service]], [[wikitech:Reading List Service]]
+* API help: [[Special:ApiHelp/readinglists|readinglists]], 
[[Special:ApiHelp/query+readinglists|query+readinglists]], 
[[Special:ApiHelp/query+readinglistentries|query+readinglistentries]], [<%= 
@restbase_url %>#/Reading_lists RESTBase]
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a251178a5ede2027ce940f5e58e2633865cdf0d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
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...Material[master]: Add minus-x to "composer test"

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

Change subject: Add minus-x to "composer test"
..


Add minus-x to "composer test"

Add minus-x to "composer test" and "composer fix"

Bug: T175794
Change-Id: I41efa26aa67e7ebc861ac835df4f2a996a95582a
---
M composer.json
1 file changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/composer.json b/composer.json
index 040f075..1fb656e 100644
--- a/composer.json
+++ b/composer.json
@@ -50,11 +50,16 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
+   "fix": [
+   "minus-x fix ."
+   ],
"test": [
-   "parallel-lint . --exclude vendor --exclude 
node_modules"
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
+   "minus-x check ."
]
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I41efa26aa67e7ebc861ac835df4f2a996a95582a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Material
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Example[master]: Add minus-x to "composer test"

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

Change subject: Add minus-x to "composer test"
..


Add minus-x to "composer test"

Add minus-x to "composer test" and "composer fix"

Bug: T175794
Change-Id: Id7eee8a5b29fd0c7c312a6545e049e822dc7e228
---
M composer.json
1 file changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/composer.json b/composer.json
index aebd773..dfca38b 100644
--- a/composer.json
+++ b/composer.json
@@ -1,11 +1,16 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
+   "fix": [
+   "minus-x fix ."
+   ],
"test": [
-   "parallel-lint . --exclude vendor --exclude 
node_modules"
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
+   "minus-x check ."
]
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id7eee8a5b29fd0c7c312a6545e049e822dc7e228
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Example
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Be aware of extension MediaWiki compatibility

2017-12-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398625 )

Change subject: Be aware of extension MediaWiki compatibility
..

Be aware of extension MediaWiki compatibility

We can use the MediaWiki requirement specified in extension.json to
customize MediaWiki sniffs for higher accuracy. As a proof of concept, I
adapted the deprecated constant sniff to use it. In the future, we could
have the sniffs that check for PHP 7 syntax run for extensions that are
marked as supporting pre-1.31 versions. This will also be useful for the
DeprecatedGlobal sniff too.

We use composer/semver for the actual parsing of versions to match the
extension.json implementation, with a loose version constraint to not
interfere with MediaWiki core's own dependency (and surely the "semver"
package will actually follow semver ;)).

All of the expensive computations (version parsing) are instance cached
to avoid a major performance impact.

Because the ExtensionInfo class is not a sniff, we can't depend upon
PHPCS's autoloader and need to setup the composer one instead.

Bug: T175465
Change-Id: I726cacda3e92a07483362806f795a25902773496
---
M MediaWiki/Sniffs/Usage/DeprecatedConstantUsageSniff.php
A MediaWiki/Utils/ExtensionInfo.php
M composer.json
3 files changed, 143 insertions(+), 6 deletions(-)


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

diff --git a/MediaWiki/Sniffs/Usage/DeprecatedConstantUsageSniff.php 
b/MediaWiki/Sniffs/Usage/DeprecatedConstantUsageSniff.php
index 350f699..cc55b3d 100644
--- a/MediaWiki/Sniffs/Usage/DeprecatedConstantUsageSniff.php
+++ b/MediaWiki/Sniffs/Usage/DeprecatedConstantUsageSniff.php
@@ -20,20 +20,31 @@
 
 namespace MediaWiki\Sniffs\Usage;
 
+use MediaWiki\Utils\ExtensionInfo;
 use PHP_CodeSniffer\Files\File;
 use PHP_CodeSniffer\Sniffs\Sniff;
 
 class DeprecatedConstantUsageSniff implements Sniff {
 
/**
-* Deprecated constant => Replacement
+* Deprecated constant => Replacement, and last
+* MW version that old constant should still be used
 *
 * @var array
 */
private $deprecated = [
-   'DB_SLAVE' => 'DB_REPLICA',
-   'NS_IMAGE' => 'NS_FILE',
-   'NS_IMAGE_TALK' => 'NS_FILE_TALK',
+   'DB_SLAVE' => [
+   'replace' => 'DB_REPLICA',
+   'version' => '1.27',
+   ],
+   'NS_IMAGE' => [
+   'replace' => 'NS_FILE',
+   'version' => '1.13',
+   ],
+   'NS_IMAGE_TALK' => [
+   'replace' => 'NS_FILE_TALK',
+   'version' => '1.13',
+   ],
];
 
/**
@@ -57,15 +68,18 @@
$token = $phpcsFile->getTokens()[$stackPtr];
$current = $token['content'];
if ( isset( $this->deprecated[$current] ) ) {
+   $extensionInfo = ExtensionInfo::newFromFile( $phpcsFile 
);
+   if ( $extensionInfo->supportsMediaWiki( 
$this->deprecated[$current]['version'] ) ) {
+   return;
+   }
$fix = $phpcsFile->addFixableWarning(
"Deprecated constant $current used",
$stackPtr,
$current
);
if ( $fix ) {
-   $phpcsFile->fixer->replaceToken( $stackPtr, 
$this->deprecated[$current] );
+   $phpcsFile->fixer->replaceToken( $stackPtr, 
$this->deprecated[$current]['replace'] );
}
}
}
-
 }
diff --git a/MediaWiki/Utils/ExtensionInfo.php 
b/MediaWiki/Utils/ExtensionInfo.php
new file mode 100644
index 000..81f37b9
--- /dev/null
+++ b/MediaWiki/Utils/ExtensionInfo.php
@@ -0,0 +1,117 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+namespace MediaWiki\Utils;
+
+use Composer\Semver\Constraint\Constraint;
+use Composer\Semver\VersionParser;
+use PHP_CodeSniffer\Files\File;
+
+class ExtensionInfo {
+
+   /**
+   

[MediaWiki-commits] [Gerrit] mediawiki...Example[master]: Add minus-x to "composer test"

2017-12-16 Thread Rafidaslam (Code Review)
Rafidaslam has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398624 )

Change subject: Add minus-x to "composer test"
..

Add minus-x to "composer test"

Add minus-x to "composer test" and "composer fix"

Bug: T175794
Change-Id: Id7eee8a5b29fd0c7c312a6545e049e822dc7e228
---
M composer.json
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Example 
refs/changes/24/398624/1

diff --git a/composer.json b/composer.json
index aebd773..dfca38b 100644
--- a/composer.json
+++ b/composer.json
@@ -1,11 +1,16 @@
 {
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
+   "fix": [
+   "minus-x fix ."
+   ],
"test": [
-   "parallel-lint . --exclude vendor --exclude 
node_modules"
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
+   "minus-x check ."
]
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7eee8a5b29fd0c7c312a6545e049e822dc7e228
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Example
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam 

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: diff_checker.py: Fix the logic of calculating error state

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

Change subject: diff_checker.py: Fix the logic of calculating error state
..


diff_checker.py: Fix the logic of calculating error state

Also fix an encoding issue in Python 3 where `universal_newlines` parameter
in `subprocess.check_output` forces the result to be in text mode, but it also
needs to know the `encoding` of the result to correctly decode utf-8 diffs,
but `check_output` in Python 2 does not have the `encoding` parameter.
Therefore we have to decode the file and normalize newlines ourselves in both
Python 2 and 3.

Change-Id: I7ab6d63c1d213087e23481679c7ef2a8665835d9
---
M scripts/maintenance/diff_checker.py
1 file changed, 4 insertions(+), 5 deletions(-)

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



diff --git a/scripts/maintenance/diff_checker.py 
b/scripts/maintenance/diff_checker.py
index 957c247..734befd 100644
--- a/scripts/maintenance/diff_checker.py
+++ b/scripts/maintenance/diff_checker.py
@@ -51,10 +51,9 @@
 """Return the PatchSet for the latest commit."""
 # regex from https://github.com/PyCQA/pylint/blob/master/pylintrc
 output = check_output(
-['git', 'diff', '-U0', '@~..@'], universal_newlines=True)
-if version_info.major == 2:
-return PatchSet.from_string(output, encoding='utf-8')
-return PatchSet.from_string(output)
+['git', 'diff', '-U0', '@~..@'])
+return PatchSet.from_string(
+output.replace(b'\r\n', b'\n'), encoding='utf-8')
 
 
 def print_error(path, line_no, col_no, error):
@@ -119,7 +118,7 @@
 )
 error = True
 if added_lines:
-error = check_tokens(path, added_lines) and error
+error = not check_tokens(path, added_lines) or error
 return not error
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7ab6d63c1d213087e23481679c7ef2a8665835d9
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: Zoranzoki21 
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...Material[master]: Add minus-x to "composer test"

2017-12-16 Thread Rafidaslam (Code Review)
Rafidaslam has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398623 )

Change subject: Add minus-x to "composer test"
..

Add minus-x to "composer test"

Add minus-x to "composer test" and "composer fix"

Bug: T175794
Change-Id: I41efa26aa67e7ebc861ac835df4f2a996a95582a
---
M composer.json
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Material 
refs/changes/23/398623/1

diff --git a/composer.json b/composer.json
index 040f075..1fb656e 100644
--- a/composer.json
+++ b/composer.json
@@ -50,11 +50,16 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "jakub-onderka/php-console-highlighter": "0.3.2"
+   "jakub-onderka/php-console-highlighter": "0.3.2",
+   "mediawiki/minus-x": "0.2.1"
},
"scripts": {
+   "fix": [
+   "minus-x fix ."
+   ],
"test": [
-   "parallel-lint . --exclude vendor --exclude 
node_modules"
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
+   "minus-x check ."
]
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41efa26aa67e7ebc861ac835df4f2a996a95582a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Material
Gerrit-Branch: master
Gerrit-Owner: Rafidaslam 

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


[MediaWiki-commits] [Gerrit] mediawiki...Genealogy[master]: Move graph-creating and checking to the Tree class

2017-12-16 Thread Samwilson (Code Review)
Samwilson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398622 )

Change subject: Move graph-creating and checking to the Tree class
..

Move graph-creating and checking to the Tree class

Also give a better error when GraphViz isn't installed.

Change-Id: I8289afe5d73a77e2ec92ff64ec8d5b1604b1861e
---
M i18n/en.json
M i18n/qqq.json
M src/Hooks.php
M src/Tree.php
4 files changed, 46 insertions(+), 14 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index d1a9141..9e9e3d1 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -18,5 +18,6 @@
"genealogy-parser-function-not-found": "Genealogy parser function type 
not recognised: $1",
"genealogy-existing-partners": "This person already has the following 
{{PLURAL:$1|partner|partners}}: ",
"genealogy-invalid-parent-title": "Error: invalid parent page title: 
'$1'",
-   "genealogy-invalid-partner-title": "Error: invalid partner page title: 
'$1'"
+   "genealogy-invalid-partner-title": "Error: invalid partner page title: 
'$1'",
+   "genealogy-no-graphviz": "Graphic tree generation requires the GraphViz 
extension to be installed"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a8783e8..9ae4f09 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -20,5 +20,6 @@
"genealogy-parser-function-not-found": "The error message shown when 
the parser function is passed something it doesn't recognise.",
"genealogy-existing-partners": "The message that is shown above the 
page-editing form, alerting the user to the fact that the person they're 
editing has already got a defined partner from another page.",
"genealogy-invalid-parent-title": "The error message that is shown when 
a user-supplied parent name is not a valid page title.",
-   "genealogy-invalid-partner-title": "The error message that is shown 
when a user-supplied partner name is not a valid page title."
+   "genealogy-invalid-partner-title": "The error message that is shown 
when a user-supplied partner name is not a valid page title.",
+   "genealogy-no-graphviz": "An error message displayed when the GraphViz 
extension isn't installed."
 }
diff --git a/src/Hooks.php b/src/Hooks.php
index 1e2c3f3..83e8d68 100644
--- a/src/Hooks.php
+++ b/src/Hooks.php
@@ -131,11 +131,7 @@
if ( isset( $params['descendant depth'] ) ) {
$tree->setDescendantDepth( 
$params['descendant depth'] );
}
-   if ( $tree->hasAncestorsOrDescendants() ) {
-   $graphviz = $tree->getGraphviz();
-   $out .= $parser->recursiveTagParse( 
"\n$graphviz\n" );
-   // $out .= $parser->recursiveTagParse( 
"$graphviz" );
-   }
+   $out = $tree->getWikitext( $parser );
break;
default:
$msg = wfMessage( 
'genealogy-parser-function-not-found', [ $type ] );
diff --git a/src/Tree.php b/src/Tree.php
index e8316f4..0a0cc73 100644
--- a/src/Tree.php
+++ b/src/Tree.php
@@ -2,6 +2,8 @@
 
 namespace MediaWiki\Extensions\Genealogy;
 
+use Html;
+use Parser;
 use Title;
 
 class Tree {
@@ -77,15 +79,41 @@
}
 
/**
+* Get the wikitext for the tree, containing the  element and 
dot-formatted contents.
+* @param Parser $parser The parser.
+* @return string Unsafe half-parsed HTML, as returned by 
Parser::recursiveTagParse().
+*/
+   public function getWikitext( Parser $parser ) {
+   // If there's nothing to render, give up.
+   if ( !$this->hasAncestorsOrDescendants() ) {
+   return '';
+   }
+
+   // See if GraphViz is installed.
+   if ( !class_exists( '\MediaWiki\Extension\GraphViz\GraphViz' ) 
) {
+   $err = wfMessage( 'genealogy-no-graphviz' );
+   return Html::element( 'p', [ 'class' => 'error' ], $err 
);
+   }
+
+   // Make sure the current user (even anonymous IP users) can 
upload the image file.
+   // @todo Move to GraphViz
+   // $parser->getUser()->mRights[] = 'upload';
+
+   // Get the GraphViz source and run it through the GraphViz 
extension.
+   $graphSource = $this->getGraphvizSource();
+   $out = $parser->recursiveTagParse( 
"\n$graphSource\n" );
+
+   // Debugging.
+   // $out .= $parser->recursiveTagParse( 
"$graphSource" );
+
+   return $out;
+   }
+
+   /**
 * Get the Dot source code for the graph of 

[MediaWiki-commits] [Gerrit] mediawiki...ReadingLists[master]: Use PSR-4 autoloader

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

Change subject: Use PSR-4 autoloader
..


Use PSR-4 autoloader

Change-Id: I6d42c60dc29f40bbf927c122f1f681d62d0c5e53
---
M extension.json
1 file changed, 2 insertions(+), 19 deletions(-)

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



diff --git a/extension.json b/extension.json
index 84ceb09..fb89956 100644
--- a/extension.json
+++ b/extension.json
@@ -8,25 +8,8 @@
"descriptionmsg": "readinglists-desc",
"license-name": "GPL-2.0+",
"type": "other",
-   "AutoloadClasses": {
-   "MediaWiki\\Extensions\\ReadingLists\\HookHandler": 
"src/HookHandler.php",
-   "MediaWiki\\Extensions\\ReadingLists\\Utils": "src/Utils.php",
-   "MediaWiki\\Extensions\\ReadingLists\\ReadingListRepository": 
"src/ReadingListRepository.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\ReadingListRepositoryException": 
"src/ReadingListRepositoryException.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\ReverseInterwikiLookupInterface": 
"src/ReverseInterwikiLookupInterface.php",
-   "MediaWiki\\Extensions\\ReadingLists\\ReverseInterwikiLookup": 
"src/ReverseInterwikiLookup.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\Api\\ApiQueryReadingListEntries": 
"src/Api/ApiQueryReadingListEntries.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\Api\\ApiQueryReadingLists": 
"src/Api/ApiQueryReadingLists.php",
-   "MediaWiki\\Extensions\\ReadingLists\\Api\\ApiQueryTrait": 
"src/Api/ApiQueryTrait.php",
-   "MediaWiki\\Extensions\\ReadingLists\\Api\\ApiReadingLists": 
"src/Api/ApiReadingLists.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\Api\\ApiReadingListsCreateEntry": 
"src/Api/ApiReadingListsCreateEntry.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\Api\\ApiReadingListsCreate": 
"src/Api/ApiReadingListsCreate.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\Api\\ApiReadingListsDeleteEntry": 
"src/Api/ApiReadingListsDeleteEntry.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\Api\\ApiReadingListsDelete": 
"src/Api/ApiReadingListsDelete.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\Api\\ApiReadingListsSetup": 
"src/Api/ApiReadingListsSetup.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\Api\\ApiReadingListsTeardown": 
"src/Api/ApiReadingListsTeardown.php",
-   
"MediaWiki\\Extensions\\ReadingLists\\Api\\ApiReadingListsUpdate": 
"src/Api/ApiReadingListsUpdate.php",
-   "MediaWiki\\Extensions\\ReadingLists\\Api\\ApiTrait": 
"src/Api/ApiTrait.php"
+   "AutoloadNamespaces": {
+   "MediaWiki\\Extensions\\ReadingLists\\": "src/"
},
"APIModules": {
"readinglists": 
"MediaWiki\\Extensions\\ReadingLists\\Api\\ApiReadingLists"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6d42c60dc29f40bbf927c122f1f681d62d0c5e53
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ReadingLists
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Mholloway 
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...codesniffer[master]: Ignore maintenance scripts in ClassMatchesFilenameSniff

2017-12-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398621 )

Change subject: Ignore maintenance scripts in ClassMatchesFilenameSniff
..

Ignore maintenance scripts in ClassMatchesFilenameSniff

Change-Id: I78f03a028539e0313f96534490bf4fcda19160a8
---
M MediaWiki/Sniffs/Files/ClassMatchesFilenameSniff.php
1 file changed, 29 insertions(+), 0 deletions(-)


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

diff --git a/MediaWiki/Sniffs/Files/ClassMatchesFilenameSniff.php 
b/MediaWiki/Sniffs/Files/ClassMatchesFilenameSniff.php
index dea4edf..5b71417 100644
--- a/MediaWiki/Sniffs/Files/ClassMatchesFilenameSniff.php
+++ b/MediaWiki/Sniffs/Files/ClassMatchesFilenameSniff.php
@@ -50,6 +50,16 @@
$name = $phpcsFile->getDeclarationName( $stackPtr );
if ( $base !== "$name.php" ) {
$wrongCase = strtolower( $base ) === strtolower( 
"$name.php" );
+   if ( $wrongCase && $this->isMaintenanceScript( 
$phpcsFile ) ) {
+   // Maintenance scripts follow the class name, 
but the first
+   // letter is lowercase.
+   $expected = $name;
+   $expected[0] = strtolower( $expected[0] );
+   if ( $base === "$expected.php" ) {
+   // OK!
+   return;
+   }
+   }
$phpcsFile->addError(
"Class name '$name' does not match filename 
'$base'",
$stackPtr,
@@ -58,4 +68,23 @@
}
}
 
+   /**
+* Figure out whether the file is a MediaWiki maintenance script
+*
+* @param File $phpcsFile File being checked
+*
+* @return bool
+*/
+   private function isMaintenanceScript( File $phpcsFile ) {
+   foreach ( $phpcsFile->getTokens() as $token ) {
+   if ( $token['code'] === T_STRING
+   && $token['content'] === 
'RUN_MAINTENANCE_IF_MAIN'
+   ) {
+   return true;
+   }
+   }
+
+   return false;
+   }
+
 }

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

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

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