[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Replace MimeMagic::singleton() calls

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

Change subject: Replace MimeMagic::singleton() calls
..


Replace MimeMagic::singleton() calls

Change-Id: Ieed41b5d6b0f568fe2872e7754f2feae7868fe7a
---
M includes/Feed.php
M includes/StreamFile.php
M includes/api/ApiFormatBase.php
M includes/filebackend/FileBackendGroup.php
M includes/filerepo/FileRepo.php
M includes/filerepo/RepoGroup.php
M includes/filerepo/file/File.php
M includes/filerepo/file/ForeignAPIFile.php
M includes/filerepo/file/LocalFile.php
M includes/filerepo/file/UnregisteredLocalFile.php
M includes/media/DjVu.php
M includes/media/MediaHandler.php
M includes/specials/SpecialMediaStatistics.php
M includes/upload/UploadBase.php
M includes/upload/UploadStash.php
M includes/utils/MWFileProps.php
M maintenance/importImages.php
M tests/phpunit/includes/media/MediaWikiMediaTestCase.php
M tests/phpunit/includes/media/WebPTest.php
19 files changed, 30 insertions(+), 27 deletions(-)

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



diff --git a/includes/Feed.php b/includes/Feed.php
index fd223e6..35f2ce9 100644
--- a/includes/Feed.php
+++ b/includes/Feed.php
@@ -232,7 +232,8 @@
header( "Content-type: $mimetype; charset=UTF-8" );
 
// Set a sane filename
-   $exts = MimeMagic::singleton()->getExtensionsForType( $mimetype 
);
+   $exts = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()
+   ->getExtensionsForType( $mimetype );
$ext = $exts ? strtok( $exts, ' ' ) : 'xml';
header( "Content-Disposition: inline; filename=\"feed.{$ext}\"" 
);
 
diff --git a/includes/StreamFile.php b/includes/StreamFile.php
index 71113a8..2ad42e5 100644
--- a/includes/StreamFile.php
+++ b/includes/StreamFile.php
@@ -113,7 +113,7 @@
return 'unknown/unknown';
}
 
-   $magic = MimeMagic::singleton();
+   $magic = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
// Use the extension only, rather than magic numbers, to avoid 
opening
// up vulnerabilities due to uploads of files with allowed 
extensions
// but disallowed types.
diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php
index c5f2fcf..4348fc8 100644
--- a/includes/api/ApiFormatBase.php
+++ b/includes/api/ApiFormatBase.php
@@ -78,7 +78,8 @@
} elseif ( $this->getIsHtml() ) {
return 'api-result.html';
} else {
-   $exts = MimeMagic::singleton()->getExtensionsForType( 
$this->getMimeType() );
+   $exts = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()
+   ->getExtensionsForType( $this->getMimeType() );
$ext = $exts ? strtok( $exts, ' ' ) : strtolower( 
$this->mFormat );
return "api-result.$ext";
}
diff --git a/includes/filebackend/FileBackendGroup.php 
b/includes/filebackend/FileBackendGroup.php
index 5d0da6d..0b61979 100644
--- a/includes/filebackend/FileBackendGroup.php
+++ b/includes/filebackend/FileBackendGroup.php
@@ -229,7 +229,7 @@
 * @since 1.27
 */
public function guessMimeInternal( $storagePath, $content, $fsPath ) {
-   $magic = MimeMagic::singleton();
+   $magic = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
// Trust the extension of the storage path (caller must 
validate)
$ext = FileBackend::extensionFromPath( $storagePath );
$type = $magic->guessTypesForExtension( $ext );
diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php
index 5005280..5d22b8d 100644
--- a/includes/filerepo/FileRepo.php
+++ b/includes/filerepo/FileRepo.php
@@ -1543,7 +1543,7 @@
 */
public function getFileProps( $virtualUrl ) {
$fsFile = $this->getLocalReference( $virtualUrl );
-   $mwProps = new MWFileProps( MimeMagic::singleton() );
+   $mwProps = new MWFileProps( 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer() );
if ( $fsFile ) {
$props = $mwProps->getPropsFromPath( 
$fsFile->getPath(), true );
} else {
diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php
index 2edd6d0..5e37d67 100644
--- a/includes/filerepo/RepoGroup.php
+++ b/includes/filerepo/RepoGroup.php
@@ -452,7 +452,7 @@
 
return $repo->getFileProps( $fileName );
} else {
-   $mwProps = new MWFileProps( MimeMagic::singleton() );
+   $mwProps = new MWFileProps( 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad.php: Increase weight for db1097:3314

2017-11-26 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393543 )

Change subject: db-eqiad.php: Increase weight for db1097:3314
..

db-eqiad.php: Increase weight for db1097:3314

Give it some more weight

Change-Id: I803911f5efdbc9547dc982434a96df500e072f8c
---
M wmf-config/db-eqiad.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 05337cf..e703629 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -364,7 +364,7 @@
],
'contributions' => [
'db1056' => 1,
-   # 'db1097:3314' => 1,
+   'db1097:3314' => 1,
'db1103:3314' => 1,
],
'logpager' => [

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Add support for parser tag hooks

2017-11-26 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393541 )

Change subject: Add support for parser tag hooks
..


Add support for parser tag hooks

Change-Id: Ie979f53ea92d2c17a40cc348e28faa97e6b7f20e
---
M .phpcs.xml
M src/MWPreVisitor.php
M src/MWVisitor.php
M src/MediaWikiSecurityCheckPlugin.php
M src/TaintednessVisitor.php
M tests/integration/stripitem/Parser.php
A tests/integration/taghook/Parser.php
A tests/integration/taghook/expectedResults.txt
A tests/integration/taghook/test.php
9 files changed, 215 insertions(+), 11 deletions(-)



diff --git a/.phpcs.xml b/.phpcs.xml
index 8b2fe7e..45549de 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -5,6 +5,7 @@



+   

.

diff --git a/src/MWPreVisitor.php b/src/MWPreVisitor.php
index ebe5042..68625be 100644
--- a/src/MWPreVisitor.php
+++ b/src/MWPreVisitor.php
@@ -13,13 +13,12 @@
  */
 class MWPreVisitor extends TaintednessBaseVisitor {
 
-
/**
 * Ensure type of plugin is instance of MediaWikiSecurityCheckPlugin
 *
 * @param CodeBase $code_base
 * @param Context $context
-* @param MediaWikiSecurityCheckPlugin
+* @param MediaWikiSecurityCheckPlugin $plugin
 */
public function __construct(
CodeBase $code_base,
@@ -68,6 +67,37 @@
case '!ParserFunctionHook':
$this->setFuncHookParamTaint( $params, $method );
break;
+   case '!ParserHook':
+   $this->setTagHookParamTaint( $params, $method );
+   break;
+   }
+   }
+
+   /**
+* Set taint for a tag hook.
+*
+* The parameters are:
+*  string contents (Tainted from wikitext)
+*  array attribs (Tainted from wikitext)
+*  Parser object
+*  PPFrame object
+*
+* @param array $params formal parameters of tag hook
+* @param FunctionInterface $method
+*/
+   private function setTagHookParamTaint( array $params, FunctionInterface 
$method ) {
+   // Only care about first 2 parameters.
+   for ( $i = 0; $i < 2 && $i < count( $params ); $i++ ) {
+   $param = $params[$i];
+   $scope = $this->context->getScope();
+   if ( !$scope->hasVariableWithName( 
$param->children['name'] ) ) {
+   // Well uh-oh.
+   $this->debug( __METHOD__, "Missing variable for 
param \$" . $param->children['name'] );
+   continue;
+   }
+   $varObj = $scope->getVariableByName( 
$param->children['name'] );
+   $this->setTaintedness( $varObj, 
SecurityCheckPlugin::YES_TAINT );
+   // $this->debug( __METHOD__, "In $method setting param 
$varObj as tainted" );
}
}
 
@@ -82,7 +112,6 @@
 * @param FunctionInterface $method
 */
private function setFuncHookParamTaint( array $params, 
FunctionInterface $method ) {
-   $this->debug( __METHOD__, "Setting taint for hook $method" );
$funcTaint = $this->getTaintOfFunction( $method );
$varObjs = [];
foreach ( $params as $i => $param ) {
diff --git a/src/MWVisitor.php b/src/MWVisitor.php
index 76a9909..27bf1aa 100644
--- a/src/MWVisitor.php
+++ b/src/MWVisitor.php
@@ -49,9 +49,15 @@
false /* not a static call */
);
// Should this be getDefiningFQSEN() instead?
-   switch ( (string)$method->getFQSEN() ) {
+   $methodName = (string)$method->getFQSEN();
+   // $this->debug( __METHOD__, "Checking to see if we 
should register $methodName" );
+   switch ( $methodName ) {
case '\Parser::setFunctionHook':
-   $this->handleFuncRegistration( $node );
+   case '\Parser::setHook':
+   case '\Parser::setTransparentTagHook':
+   $type = 
$this->getHookTypeForRegistrationMethod( $methodName );
+   // $this->debug( __METHOD__, 
"registering $methodName as $type" );
+   $this->handleHookRegistration( $node, 
$type );
break;
}
} catch ( Exception $e ) {
@@ -60,19 +66,36 @@
}
 
/**
+* @param string $method The method name of the registration function
+* @return string The name of 

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Keep track of hook registrations

2017-11-26 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393542 )

Change subject: Keep track of hook registrations
..


Keep track of hook registrations

As of yet, it doesn't do anything with the information.

Also, so far only Hooks::register is implemented. $wgHooks and
extension.json is not yet implemented.

Change-Id: I1bc7c7996dbe5684d6aeefbd7c4ee6abb0f3e992
---
M src/MWVisitor.php
A tests/integration/registerhook/Hooks.php
A tests/integration/registerhook/expectedResults.txt
A tests/integration/registerhook/test.php
4 files changed, 240 insertions(+), 30 deletions(-)



diff --git a/src/MWVisitor.php b/src/MWVisitor.php
index 27bf1aa..833dd98 100644
--- a/src/MWVisitor.php
+++ b/src/MWVisitor.php
@@ -3,7 +3,9 @@
 use Phan\Language\Context;
 use Phan\Language\FQSEN\FullyQualifiedMethodName;
 use Phan\Language\FQSEN\FullyQualifiedFunctionName;
+use Phan\Language\FQSEN\FullyQualifiedFunctionLikeName;
 use Phan\Language\FQSEN;
+use Phan\Language\Type\CallableType;
 use Phan\Plugin;
 use Phan\CodeBase;
 use ast\Node;
@@ -37,7 +39,19 @@
}
 
/**
-* Try and recognize
+* Check static calls for hook registration
+*
+* Forwards to method call handler.
+* @param Node $node
+*/
+   public function visitStaticCall( Node $node ) {
+   $this->visitMethodCall( $node );
+   }
+
+   /**
+* Try and recognize hook registration
+*
+* Also handles static calls
 * @param Node $node
 */
public function visitMethodCall( Node $node ) {
@@ -46,7 +60,7 @@
$methodName = $node->children['method'];
$method = $ctx->getMethod(
$methodName,
-   false /* not a static call */
+   $node->kind === \ast\AST_STATIC_CALL
);
// Should this be getDefiningFQSEN() instead?
$methodName = (string)$method->getFQSEN();
@@ -57,7 +71,10 @@
case '\Parser::setTransparentTagHook':
$type = 
$this->getHookTypeForRegistrationMethod( $methodName );
// $this->debug( __METHOD__, 
"registering $methodName as $type" );
-   $this->handleHookRegistration( $node, 
$type );
+   $this->handleParserHookRegistration( 
$node, $type );
+   break;
+   case '\Hooks::register':
+   $this->handleNormalHookRegistration( 
$node );
break;
}
} catch ( Exception $e ) {
@@ -82,44 +99,75 @@
}
 
/**
-* When someone calls $parser->setFunctionHook()
+* Handle registering a normal hook from Hooks::register (Not from 
$wgHooks)
+*
+* @param Node $node The node representing the AST_STATIC_CALL
+*/
+   private function handleNormalHookRegistration( Node $node ) {
+   assert( $node->kind === \ast\AST_STATIC_CALL );
+   $params = $node->children['args']->children;
+   if ( count( $params ) < 2 ) {
+   $this->debug( __METHOD__, "Could not understand 
Hooks::register" );
+   return;
+   }
+   $hookName = $params[0];
+   if ( !is_string( $params[0] ) ) {
+   $this->debug( __METHOD__, "Could not register hook. 
Name is complex" );
+   return;
+   }
+   $cb = $this->getCallableFromHookRegistration( $params[1], 
$hookName );
+   if ( $cb ) {
+   $this->debug( __METHOD__, "registering $cb as handling 
$hookName" );
+   $this->registerHook( $hookName, $cb );
+   } else {
+   $this->debug( __METHOD__, "Could not register $hookName 
hook due to complex callback" );
+   }
+   }
+
+   /**
+* When someone calls $parser->setFunctionHook() or setTagHook()
 *
 * @note Causes phan to error out if given non-existent class
-* @param Node $node
+* @param Node $node The AST_METHOD_CALL node
 * @param string $hookType The name of the hook
 */
-   private function handleHookRegistration( Node $node, string $hookType ) 
{
+   private function handleParserHookRegistration( Node $node, string 
$hookType ) {
$args = $node->children['args']->children;
if ( count( $args ) < 2 ) {
return;
}
$callback = $this->getFQSENFromCallable( $args[1] 

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Support ParserFunctions, and start of work for hooks in general

2017-11-26 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393540 )

Change subject: Support ParserFunctions, and start of work for hooks in general
..


Support ParserFunctions, and start of work for hooks in general

Also fix bug sometimes function taint would get lost if
setting a different taint for another parameter

Add -v option to the test runner
Change-Id: Idcd74eee6ad5fb38d7c8b81f4cf1058dc26f080b
---
M .phpcs.xml
A src/MWPreVisitor.php
A src/MWVisitor.php
M src/MediaWikiSecurityCheckPlugin.php
M src/TaintednessBaseVisitor.php
M src/TaintednessVisitor.php
A tests/integration/callbackhook/Parser.php
A tests/integration/callbackhook/db.php
A tests/integration/callbackhook/expectedResults.txt
A tests/integration/callbackhook/func.php
A tests/integration/callbackhook/test.php
A tests/integration/stripitem/Parser.php
A tests/integration/stripitem/expectedResults.txt
A tests/integration/stripitem/test.php
M tests/runtests.sh
15 files changed, 833 insertions(+), 17 deletions(-)



diff --git a/.phpcs.xml b/.phpcs.xml
index 60518ae..8b2fe7e 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -4,6 +4,7 @@



+   

.

@@ -23,6 +24,12 @@

./tests

+   
+   ./tests
+   
+   
+   ./tests
+   

./tests

diff --git a/src/MWPreVisitor.php b/src/MWPreVisitor.php
new file mode 100644
index 000..ebe5042
--- /dev/null
+++ b/src/MWPreVisitor.php
@@ -0,0 +1,119 @@
+plugin = $plugin;
+   }
+
+   /**
+* Handle any node not otherwise handled.
+*
+* Currently a no-op.
+*
+* @param Node $node
+*/
+   public function visit( Node $node ) {
+   }
+
+   /**
+* @see visitMethod
+* @param Decl $node
+* @return void Just has a return statement in case visitMethod changes
+*/
+   public function visitFuncDecl( Decl $node ) {
+   return $this->visitMethod( $node );
+   }
+
+   /**
+* Set taint for certain hook types.
+*
+* Also handles FuncDecl
+* @param Decl $node
+*/
+   public function visitMethod( Decl $node ) {
+   $method = $this->context->getFunctionLikeInScope( 
$this->code_base );
+   $hookType = $this->plugin->isSpecialHookSubscriber( 
$method->getFQSEN() );
+   if ( !$hookType ) {
+   return;
+   }
+   $params = $node->children['params']->children;
+
+   switch ( $hookType ) {
+   case '!ParserFunctionHook':
+   $this->setFuncHookParamTaint( $params, $method );
+   break;
+   }
+   }
+
+   /**
+* Set the appropriate taint for a parser function hook
+*
+* Basically all but the first arg comes from wikitext
+* and is tainted.
+*
+* @todo This is handling SFH_OBJECT type func hooks incorrectly.
+* @param Node[] $params Children of the AST_PARAM_LIST
+* @param FunctionInterface $method
+*/
+   private function setFuncHookParamTaint( array $params, 
FunctionInterface $method ) {
+   $this->debug( __METHOD__, "Setting taint for hook $method" );
+   $funcTaint = $this->getTaintOfFunction( $method );
+   $varObjs = [];
+   foreach ( $params as $i => $param ) {
+   if ( $i === 0 ) {
+   continue;
+   }
+   $scope = $this->context->getScope();
+   if ( !$scope->hasVariableWithName( 
$param->children['name'] ) ) {
+   // Well uh-oh.
+   $this->debug( __METHOD__, "Missing variable for 
param \$" . $param->children['name'] );
+   continue;
+   }
+   $varObj = $scope->getVariableByName( 
$param->children['name'] );
+   $this->setTaintedness( $varObj, 
SecurityCheckPlugin::YES_TAINT );
+   /*** Is this needed ? Disabling for now.
+   if ( isset( $funcTaint[$i] ) ) {
+   if ( !$this->isSafeAssignment(
+   $funcTaint[$i],
+   SecurityCheckPlugin::YES_TAINT
+   ) ) {
+   $funcName = $method->getFQSEN();
+   $this->plugin->emitIssue(
+   $this->code_base,
+   $this->context,
+   

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Fix remaining tests (mostly phpcs)

2017-11-26 Thread Brian Wolff (Code Review)
Brian Wolff has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393537 )

Change subject: Fix remaining tests (mostly phpcs)
..

Fix remaining tests (mostly phpcs)

Change-Id: Ic802e332ab0fbabc3434b308a41353eaafbab69b
---
M .phpcs.xml
M src/GenericSecurityCheckPlugin.php
M src/MediaWikiSecurityCheckPlugin.php
M src/PreTaintednessVisitor.php
M src/SecurityCheckPlugin.php
M src/TaintednessBaseVisitor.php
M src/TaintednessVisitor.php
7 files changed, 536 insertions(+), 89 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/tools/phan/SecurityCheckPlugin 
refs/changes/37/393537/1

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



+   

.

diff --git a/src/GenericSecurityCheckPlugin.php 
b/src/GenericSecurityCheckPlugin.php
index 51f9684..0d21534 100644
--- a/src/GenericSecurityCheckPlugin.php
+++ b/src/GenericSecurityCheckPlugin.php
@@ -15,6 +15,9 @@
  */
 class GenericSecurityCheckPlugin extends SecurityCheckPlugin {
 
+   /**
+* @inheritDoc
+*/
protected function getCustomFuncTaints() : array {
return [];
}
diff --git a/src/MediaWikiSecurityCheckPlugin.php 
b/src/MediaWikiSecurityCheckPlugin.php
index bc6c4a4..75d5166 100644
--- a/src/MediaWikiSecurityCheckPlugin.php
+++ b/src/MediaWikiSecurityCheckPlugin.php
@@ -6,6 +6,9 @@
 
 class MediaWikiSecurityCheckPlugin extends SecurityCheckPlugin {
 
+   /**
+* @inheritDoc
+*/
protected function getCustomFuncTaints() : array {
return [
// '\Message::__construct' => 
SecurityCheckPlugin::YES_TAINT,
diff --git a/src/PreTaintednessVisitor.php b/src/PreTaintednessVisitor.php
index 70c0172..46f0f83 100644
--- a/src/PreTaintednessVisitor.php
+++ b/src/PreTaintednessVisitor.php
@@ -5,12 +5,35 @@
 use ast\Node\Decl;
 use Phan\Debug;
 
+/**
+ * Class for visiting any nodes we want to handle in pre-order.
+ *
+ * Unlike TaintednessVisitor, this is solely used to set taint
+ * on variable objects, and not to determine the taint of the
+ * current node, so this class does not return anything.
+ */
 class PreTaintednessVisitor extends TaintednessBaseVisitor {
 
+   /**
+* Handle any node not otherwise handled.
+*
+* Currently a no-op.
+*
+* @param Node $node
+*/
public function visit( Node $node ) {
-   // no-op
}
 
+   /**
+* Visit a foreach loop
+*
+* This is done in pre-order so that we can handle
+* the loop condition prior to determine the taint
+* of the loop variable, prior to evaluating the
+* loop body.
+*
+* @param Node $node
+*/
public function visitForeach( Node $node ) {
// TODO: Could we do something better here detecting the array
// type
@@ -44,17 +67,29 @@
// getVariable can throw an IssueException if var 
doesn't exist.
$this->debug( __METHOD__, "Exception " . get_class( $e 
) . $e->getMessage() . "" );
}
-
-   // The foreach as a block cannot be tainted.
-   return SecurityCheckPlugin::NO_TAINT;
}
 
+   /**
+* @see visitMethod
+* @param Decl $node
+* @return void Just has a return statement in case visitMethod changes
+*/
public function visitFuncDecl( Decl $node ) {
return $this->visitMethod( $node );
}
 
/**
+* Set the taintedness of parameters to method/function.
+*
+* Parameters that are ints (etc) are clearly safe so
+* this marks them as such. For other parameters, it
+* creates a map between the function object and the
+* parameter object so if anyone later calls the method
+* with a dangerous argument we can determine if we need
+* to output a warning.
+*
 * Also handles FuncDecl
+* @param Decl $node
 */
public function visitMethod( Decl $node ) {
// var_dump( __METHOD__ ); Debug::printNode( $node );
diff --git a/src/SecurityCheckPlugin.php b/src/SecurityCheckPlugin.php
index 0eb4490..94d6b5b 100644
--- a/src/SecurityCheckPlugin.php
+++ b/src/SecurityCheckPlugin.php
@@ -44,20 +44,12 @@
const YES_EXEC_TAINT = 2040;
 
/**
-* @param CodeBase $code_base
-* The code base in which the node exists
+* Called on every node in the AST in post-order
 *
-* @param Context $context
-* The context in which the node exits. This is
-* the context inside the given node rather than
-* the context outside of the given node
- 

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Mention phan version requirements

2017-11-26 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393538 )

Change subject: Mention phan version requirements
..


Mention phan version requirements

Change-Id: Id582792be158cc04112b03939019462413c250fd
---
M README
1 file changed, 2 insertions(+), 0 deletions(-)



diff --git a/README b/README
index 7ba4cd2..42bf034 100644
--- a/README
+++ b/README
@@ -7,3 +7,5 @@
 or MediaWikiSecurityCheckPlugin.php to the plugins list in
 your phan config, depending on if you are checking a non-mediawiki
 project or a MediaWiki/MediaWiki extension respectively.
+
+This is only tested with Phan 0.8.0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id582792be158cc04112b03939019462413c250fd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/phan/SecurityCheckPlugin
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff 
Gerrit-Reviewer: Brian Wolff 

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


[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Add taint for db related function. Fix handling of subclasses

2017-11-26 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393539 )

Change subject: Add taint for db related function. Fix handling of subclasses
..


Add taint for db related function. Fix handling of subclasses

Change-Id: I8b8c6a4350ebb605216411124631984c8bdaf54c
---
M .phpcs.xml
M src/MediaWikiSecurityCheckPlugin.php
M src/SecurityCheckPlugin.php
M src/TaintednessBaseVisitor.php
A tests/integration/subclasses/db.php
A tests/integration/subclasses/expectedResults.txt
A tests/integration/subclasses/test.php
M tests/runtests.sh
8 files changed, 149 insertions(+), 2 deletions(-)



diff --git a/.phpcs.xml b/.phpcs.xml
index d5331bd..60518ae 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -26,4 +26,7 @@

./tests

+   
+   ./tests
+   

diff --git a/src/MediaWikiSecurityCheckPlugin.php 
b/src/MediaWikiSecurityCheckPlugin.php
index 75d5166..232ecfe 100644
--- a/src/MediaWikiSecurityCheckPlugin.php
+++ b/src/MediaWikiSecurityCheckPlugin.php
@@ -11,6 +11,51 @@
 */
protected function getCustomFuncTaints() : array {
return [
+   // Note, at the moment, this checks where the function
+   // is implemented, so you can't use IDatabase.
+   '\Wikimedia\Rdbms\Database::query' => [
+   self::SQL_EXEC_TAINT,
+   // What should DB results be considered?
+   'overall' => self::YES_TAINT
+   ],
+   '\Wikimedia\Rdbms\IDatabase::query' => [
+   self::SQL_EXEC_TAINT,
+   // What should DB results be considered?
+   'overall' => self::YES_TAINT
+   ],
+   '\Wikimedia\Rdbms\DBConnRef::query' => [
+   self::SQL_EXEC_TAINT,
+   // What should DB results be considered?
+   'overall' => self::YES_TAINT
+   ],
+   '\Wikimedia\Rdbms\Database::addQuotes' => [
+   self::YES_TAINT & ~self::SQL_TAINT,
+   'overall' => self::NO_TAINT,
+   ],
+   '\Wikimedia\Rdbms\DBConnRef::addQuotes' => [
+   self::YES_TAINT & ~self::SQL_TAINT,
+   'overall' => self::NO_TAINT,
+   ],
+   '\Wikimedia\Rdbms\DatabaseMysqlBase::addQuotes' => [
+   self::YES_TAINT & ~self::SQL_TAINT,
+   'overall' => self::NO_TAINT,
+   ],
+   '\Wikimedia\Rdbms\DatabaseMssql::addQuotes' => [
+   self::YES_TAINT & ~self::SQL_TAINT,
+   'overall' => self::NO_TAINT,
+   ],
+   '\Wikimedia\Rdbms\IDatabase::addQuotes' => [
+   self::YES_TAINT & ~self::SQL_TAINT,
+   'overall' => self::NO_TAINT,
+   ],
+   '\Wikimedia\Rdbms\DatabasePostgres::addQuotes' => [
+   self::YES_TAINT & ~self::SQL_TAINT,
+   'overall' => self::NO_TAINT,
+   ],
+   '\Wikimedia\Rdbms\DatabaseSqlite::addQuotes' => [
+   self::YES_TAINT & ~self::SQL_TAINT,
+   'overall' => self::NO_TAINT,
+   ],
// '\Message::__construct' => 
SecurityCheckPlugin::YES_TAINT,
// '\wfMessage' => SecurityCheckPlugin::YES_TAINT,
'\Message::plain' => [ 'overall' => 
SecurityCheckPlugin::YES_TAINT, ],
diff --git a/src/SecurityCheckPlugin.php b/src/SecurityCheckPlugin.php
index 94d6b5b..e566975 100644
--- a/src/SecurityCheckPlugin.php
+++ b/src/SecurityCheckPlugin.php
@@ -152,6 +152,46 @@
self::SERIALIZE_EXEC_TAINT,
'overall' => self::NO_TAINT,
],
+   '\mysql_query' => [
+   self::SQL_EXEC_TAINT,
+   'overall' => self::UNKNOWN_TAINT
+   ],
+   '\mysqli_query' => [
+   self::NO_TAINT,
+   self::SQL_EXEC_TAINT,
+   'overall' => self::UNKNOWN_TAINT
+   ],
+   '\mysqli::query' => [
+   self::SQL_EXEC_TAINT,
+   'overall' => 

[MediaWiki-commits] [Gerrit] mediawiki...SecurityCheckPlugin[master]: Fix remaining tests (mostly phpcs)

2017-11-26 Thread Brian Wolff (Code Review)
Brian Wolff has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393537 )

Change subject: Fix remaining tests (mostly phpcs)
..


Fix remaining tests (mostly phpcs)

Change-Id: Ic802e332ab0fbabc3434b308a41353eaafbab69b
---
M .phpcs.xml
M src/GenericSecurityCheckPlugin.php
M src/MediaWikiSecurityCheckPlugin.php
M src/PreTaintednessVisitor.php
M src/SecurityCheckPlugin.php
M src/TaintednessBaseVisitor.php
M src/TaintednessVisitor.php
7 files changed, 536 insertions(+), 89 deletions(-)



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



+   

.

diff --git a/src/GenericSecurityCheckPlugin.php 
b/src/GenericSecurityCheckPlugin.php
index 51f9684..0d21534 100644
--- a/src/GenericSecurityCheckPlugin.php
+++ b/src/GenericSecurityCheckPlugin.php
@@ -15,6 +15,9 @@
  */
 class GenericSecurityCheckPlugin extends SecurityCheckPlugin {
 
+   /**
+* @inheritDoc
+*/
protected function getCustomFuncTaints() : array {
return [];
}
diff --git a/src/MediaWikiSecurityCheckPlugin.php 
b/src/MediaWikiSecurityCheckPlugin.php
index bc6c4a4..75d5166 100644
--- a/src/MediaWikiSecurityCheckPlugin.php
+++ b/src/MediaWikiSecurityCheckPlugin.php
@@ -6,6 +6,9 @@
 
 class MediaWikiSecurityCheckPlugin extends SecurityCheckPlugin {
 
+   /**
+* @inheritDoc
+*/
protected function getCustomFuncTaints() : array {
return [
// '\Message::__construct' => 
SecurityCheckPlugin::YES_TAINT,
diff --git a/src/PreTaintednessVisitor.php b/src/PreTaintednessVisitor.php
index 70c0172..46f0f83 100644
--- a/src/PreTaintednessVisitor.php
+++ b/src/PreTaintednessVisitor.php
@@ -5,12 +5,35 @@
 use ast\Node\Decl;
 use Phan\Debug;
 
+/**
+ * Class for visiting any nodes we want to handle in pre-order.
+ *
+ * Unlike TaintednessVisitor, this is solely used to set taint
+ * on variable objects, and not to determine the taint of the
+ * current node, so this class does not return anything.
+ */
 class PreTaintednessVisitor extends TaintednessBaseVisitor {
 
+   /**
+* Handle any node not otherwise handled.
+*
+* Currently a no-op.
+*
+* @param Node $node
+*/
public function visit( Node $node ) {
-   // no-op
}
 
+   /**
+* Visit a foreach loop
+*
+* This is done in pre-order so that we can handle
+* the loop condition prior to determine the taint
+* of the loop variable, prior to evaluating the
+* loop body.
+*
+* @param Node $node
+*/
public function visitForeach( Node $node ) {
// TODO: Could we do something better here detecting the array
// type
@@ -44,17 +67,29 @@
// getVariable can throw an IssueException if var 
doesn't exist.
$this->debug( __METHOD__, "Exception " . get_class( $e 
) . $e->getMessage() . "" );
}
-
-   // The foreach as a block cannot be tainted.
-   return SecurityCheckPlugin::NO_TAINT;
}
 
+   /**
+* @see visitMethod
+* @param Decl $node
+* @return void Just has a return statement in case visitMethod changes
+*/
public function visitFuncDecl( Decl $node ) {
return $this->visitMethod( $node );
}
 
/**
+* Set the taintedness of parameters to method/function.
+*
+* Parameters that are ints (etc) are clearly safe so
+* this marks them as such. For other parameters, it
+* creates a map between the function object and the
+* parameter object so if anyone later calls the method
+* with a dangerous argument we can determine if we need
+* to output a warning.
+*
 * Also handles FuncDecl
+* @param Decl $node
 */
public function visitMethod( Decl $node ) {
// var_dump( __METHOD__ ); Debug::printNode( $node );
diff --git a/src/SecurityCheckPlugin.php b/src/SecurityCheckPlugin.php
index 0eb4490..94d6b5b 100644
--- a/src/SecurityCheckPlugin.php
+++ b/src/SecurityCheckPlugin.php
@@ -44,20 +44,12 @@
const YES_EXEC_TAINT = 2040;
 
/**
-* @param CodeBase $code_base
-* The code base in which the node exists
+* Called on every node in the AST in post-order
 *
-* @param Context $context
-* The context in which the node exits. This is
-* the context inside the given node rather than
-* the context outside of the given node
-*
-* @param Node $node
-* The php-ast Node being analyzed.
-*
-* 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Include geoip in kafkatee::webrequest::ops

2017-11-26 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393536 )

Change subject: Include geoip in kafkatee::webrequest::ops
..

Include geoip in kafkatee::webrequest::ops

Make the GeoIP databases available on oxygen, as they're useful for
occasional analysis on the 1:1000 logs.

Change-Id: I88a1ada75ccf8d37bc62b89f3e0f4a9d058b9c8f
---
M modules/role/manifests/logging/kafkatee/webrequest/ops.pp
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/36/393536/1

diff --git a/modules/role/manifests/logging/kafkatee/webrequest/ops.pp 
b/modules/role/manifests/logging/kafkatee/webrequest/ops.pp
index 3698ee0..ccda6f6 100644
--- a/modules/role/manifests/logging/kafkatee/webrequest/ops.pp
+++ b/modules/role/manifests/logging/kafkatee/webrequest/ops.pp
@@ -5,6 +5,7 @@
 require_package('socat')
 
 include role::logging::kafkatee::webrequest::base
+include ::geoip
 
 $webrequest_log_directory = 
$::role::logging::kafkatee::webrequest::base::webrequest_log_directory
 $logstash_host = 
hiera('role::logging::kafkatee::webrequest::ops::logstash_host')

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88a1ada75ccf8d37bc62b89f3e0f4a9d058b9c8f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad.php: Increase weight for db1097:3314

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

Change subject: db-eqiad.php: Increase weight for db1097:3314
..


db-eqiad.php: Increase weight for db1097:3314

Give it some more weight

Bug: T178359
Change-Id: Ia77155a3f25fadb7fb3f1bd1a2cc254421cb1514
---
M wmf-config/db-eqiad.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index cf5662b..05337cf 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -354,12 +354,12 @@
],
'recentchanges' => [
'db1056' => 1,
-   # 'db1097:3314' => 1,
+   'db1097:3314' => 1,
'db1103:3314' => 1,
],
'recentchangeslinked' => [
'db1056' => 1,
-   # 'db1097:3314' => 1,
+   'db1097:3314' => 1,
'db1103:3314' => 1,
],
'contributions' => [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia77155a3f25fadb7fb3f1bd1a2cc254421cb1514
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
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]: db-eqiad.php: Increase weight for db1097:3314

2017-11-26 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393533 )

Change subject: db-eqiad.php: Increase weight for db1097:3314
..

db-eqiad.php: Increase weight for db1097:3314

Give it some more weight

Bug: T178359
Change-Id: Ia77155a3f25fadb7fb3f1bd1a2cc254421cb1514
---
M wmf-config/db-eqiad.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index cf5662b..05337cf 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -354,12 +354,12 @@
],
'recentchanges' => [
'db1056' => 1,
-   # 'db1097:3314' => 1,
+   'db1097:3314' => 1,
'db1103:3314' => 1,
],
'recentchangeslinked' => [
'db1056' => 1,
-   # 'db1097:3314' => 1,
+   'db1097:3314' => 1,
'db1103:3314' => 1,
],
'contributions' => [

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

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

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


[MediaWiki-commits] [Gerrit] operations/software[master]: s2.hosts: Remove db1021

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

Change subject: s2.hosts: Remove db1021
..


s2.hosts: Remove db1021

Will be decommissioned

Bug: T181378
Change-Id: I26db2dc808b83cbbb13fc2bc03a78900281337d7
---
M dbtools/s2.hosts
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/dbtools/s2.hosts b/dbtools/s2.hosts
index 7c778d9..a7ab372 100644
--- a/dbtools/s2.hosts
+++ b/dbtools/s2.hosts
@@ -17,7 +17,6 @@
 labsdb1003.eqiad.wmnet 3306
 dbstore1002.eqiad.wmnet3306
 dbstore1001.eqiad.wmnet3306
-db1021.eqiad.wmnet 3306
 db1053.eqiad.wmnet 3306
 db1060.eqiad.wmnet 3306
 db1074.eqiad.wmnet 3306

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I26db2dc808b83cbbb13fc2bc03a78900281337d7
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: Volans 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/software[master]: s2.hosts: Remove db1021

2017-11-26 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393528 )

Change subject: s2.hosts: Remove db1021
..

s2.hosts: Remove db1021

Will be decommissioned

Bug: T181378
Change-Id: I26db2dc808b83cbbb13fc2bc03a78900281337d7
---
M dbtools/s2.hosts
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software 
refs/changes/28/393528/1

diff --git a/dbtools/s2.hosts b/dbtools/s2.hosts
index 7c778d9..a7ab372 100644
--- a/dbtools/s2.hosts
+++ b/dbtools/s2.hosts
@@ -17,7 +17,6 @@
 labsdb1003.eqiad.wmnet 3306
 dbstore1002.eqiad.wmnet3306
 dbstore1001.eqiad.wmnet3306
-db1021.eqiad.wmnet 3306
 db1053.eqiad.wmnet 3306
 db1060.eqiad.wmnet 3306
 db1074.eqiad.wmnet 3306

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26db2dc808b83cbbb13fc2bc03a78900281337d7
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: Marostegui 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: mariadb: Prepare to decommission db1021

2017-11-26 Thread Marostegui (Code Review)
Marostegui has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393525 )

Change subject: mariadb: Prepare to decommission db1021
..


mariadb: Prepare to decommission db1021

db1021's data was copied over db1053 so it is ready to be
decommissioned.
Set it to spare and removed from everywhere else

Bug: T181378
Change-Id: Ia5963b13294d7e9b10953433fb039ad21f538e93
---
D hieradata/hosts/db1021.yaml
M manifests/site.pp
M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
M modules/role/files/prometheus/mysql-core_eqiad.yaml
4 files changed, 6 insertions(+), 9 deletions(-)

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



diff --git a/hieradata/hosts/db1021.yaml b/hieradata/hosts/db1021.yaml
deleted file mode 100644
index 9b907d8..000
--- a/hieradata/hosts/db1021.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-mariadb::shard: 's2'
-mariadb::socket: '/tmp/mysql.sock'
diff --git a/manifests/site.pp b/manifests/site.pp
index 39081b8..41234a9 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -338,10 +338,15 @@
 }
 
 # eqiad replicas
-node /^db1(021|053|060|074|076|090)\.eqiad\.wmnet/ {
+node /^db1(053|060|074|076|090)\.eqiad\.wmnet/ {
 role(mariadb::core)
 }
 
+node 'db1021.eqiad.wmnet' {
+role(spare::system)
+}
+
+
 # s2 (large wikis) core production dbs on codfw
 # codfw master
 node 'db2017.codfw.wmnet' {
diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 
b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
index c9289a0..bbdf0e6 100644
--- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
+++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
@@ -921,11 +921,6 @@
 filename "trusty-installer/ubuntu-installer/amd64/pxelinux.0";
 }
 
-host db1021 {
-hardware ethernet 78:2b:cb:03:ca:38;
-fixed-address db1021.eqiad.wmnet;
-}
-
 host db1029 {
 hardware ethernet 78:2b:cb:03:dd:32;
 fixed-address db1029.eqiad.wmnet;
diff --git a/modules/role/files/prometheus/mysql-core_eqiad.yaml 
b/modules/role/files/prometheus/mysql-core_eqiad.yaml
index 01e8d9c..5794333 100644
--- a/modules/role/files/prometheus/mysql-core_eqiad.yaml
+++ b/modules/role/files/prometheus/mysql-core_eqiad.yaml
@@ -20,7 +20,6 @@
 shard: s2
 role: slave
   targets:
-  - db1021:9104
   - db1060:9104
   - db1053:9104
   - db1067:9104

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia5963b13294d7e9b10953433fb039ad21f538e93
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: mariadb: Prepare to decommission db1021

2017-11-26 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393525 )

Change subject: mariadb: Prepare to decommission db1021
..

mariadb: Prepare to decommission db1021

db1021's data was copied over db1053 so it is ready to be
decommissioned.
Set it to spare and removed from everywhere else

Bug: T181378
Change-Id: Ia5963b13294d7e9b10953433fb039ad21f538e93
---
M manifests/site.pp
M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
M modules/role/files/prometheus/mysql-core_eqiad.yaml
3 files changed, 6 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/25/393525/1

diff --git a/manifests/site.pp b/manifests/site.pp
index 39081b8..41234a9 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -338,10 +338,15 @@
 }
 
 # eqiad replicas
-node /^db1(021|053|060|074|076|090)\.eqiad\.wmnet/ {
+node /^db1(053|060|074|076|090)\.eqiad\.wmnet/ {
 role(mariadb::core)
 }
 
+node 'db1021.eqiad.wmnet' {
+role(spare::system)
+}
+
+
 # s2 (large wikis) core production dbs on codfw
 # codfw master
 node 'db2017.codfw.wmnet' {
diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 
b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
index c9289a0..bbdf0e6 100644
--- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
+++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
@@ -921,11 +921,6 @@
 filename "trusty-installer/ubuntu-installer/amd64/pxelinux.0";
 }
 
-host db1021 {
-hardware ethernet 78:2b:cb:03:ca:38;
-fixed-address db1021.eqiad.wmnet;
-}
-
 host db1029 {
 hardware ethernet 78:2b:cb:03:dd:32;
 fixed-address db1029.eqiad.wmnet;
diff --git a/modules/role/files/prometheus/mysql-core_eqiad.yaml 
b/modules/role/files/prometheus/mysql-core_eqiad.yaml
index 01e8d9c..5794333 100644
--- a/modules/role/files/prometheus/mysql-core_eqiad.yaml
+++ b/modules/role/files/prometheus/mysql-core_eqiad.yaml
@@ -20,7 +20,6 @@
 shard: s2
 role: slave
   targets:
-  - db1021:9104
   - db1060:9104
   - db1053:9104
   - db1067:9104

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad, db-codfw.php: Remove db1021

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

Change subject: db-eqiad,db-codfw.php: Remove db1021
..


db-eqiad,db-codfw.php: Remove db1021

db1021's data was copied over db1053 and db1053 has been working fine
for a few days, so let's get rid of db1021

Bug: T181378
Change-Id: I1e86430ea1ba82fcbea672a149ee2b41c63ed410
---
M wmf-config/db-codfw.php
M wmf-config/db-eqiad.php
2 files changed, 0 insertions(+), 3 deletions(-)

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



diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php
index e6ba10b..395fcf2 100644
--- a/wmf-config/db-codfw.php
+++ b/wmf-config/db-codfw.php
@@ -577,7 +577,6 @@
'db1009' => '10.64.0.13', # do not remove or comment out
'db1011' => '10.64.0.15', # do not remove or comment out
'db1020' => '10.64.16.9', # do not remove or comment out
-   'db1021' => '10.64.16.10', # do not remove or comment out
'db1030' => '10.64.16.19', # do not remove or comment out
'db1034' => '10.64.16.23', # do not remove or comment out
'db1039' => '10.64.16.28', # do not remove or comment out
diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index f58c4d7..cf5662b 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -114,7 +114,6 @@
],
's2' => [
'db1054' => 0,   # A3 2.8TB  96GB, master
-   # 'db1021' => 0,   # B1 1.4TB  64GB, vslow, dump #to be 
decommissioned
'db1053' => 0,   # A2 2.8TB  96GB, vslow, dump
'db1060' => 1,   # C2 2.8TB  96GB, api #master for sanitarium 
#T153743
'db1074' => 300, # A2 3.6TB 512GB, api
@@ -490,7 +489,6 @@
'db1009' => '10.64.0.13', # do not remove or comment out
'db1011' => '10.64.0.15', # do not remove or comment out
'db1020' => '10.64.16.9', # do not remove or comment out
-   'db1021' => '10.64.16.10', # do not remove or comment out
'db1030' => '10.64.16.19', # do not remove or comment out
'db1034' => '10.64.16.23', # do not remove or comment out
'db1039' => '10.64.16.28', # do not remove or comment out

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1e86430ea1ba82fcbea672a149ee2b41c63ed410
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: Urbanecm 
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...BlueSpiceExtendedSearch[master]: Replace MimeMagic::singleton() call

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

Change subject: Replace MimeMagic::singleton() call
..


Replace MimeMagic::singleton() call

Change-Id: Iea5155d3e2ef050ce51bfeb922ccc0185964fe7a
---
M src/Source/DocumentProvider/File.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/src/Source/DocumentProvider/File.php 
b/src/Source/DocumentProvider/File.php
index 75964ee..f2dd19d 100644
--- a/src/Source/DocumentProvider/File.php
+++ b/src/Source/DocumentProvider/File.php
@@ -12,10 +12,11 @@
 */
public function getDataConfig( $sUri, $oFile ) {
$aDC = $this->oDecoratedDP->getDataConfig( $sUri, $oFile );
+   $magic = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$aDC += [
'basename' => $oFile->getBasename(),
'extension' => $oFile->getExtension(),
-   'mime_type' => \MimeMagic::singleton()->guessMimeType( 
$oFile->getPathname() ),
+   'mime_type' => $magic->guessMimeType( 
$oFile->getPathname() ),
'mtime' => $oFile->getMTime(),
'ctime' => $oFile->getCTime(),
'size' => $oFile->getSize(),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iea5155d3e2ef050ce51bfeb922ccc0185964fe7a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtendedSearch
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Ljonka 
Gerrit-Reviewer: Mglaser 
Gerrit-Reviewer: Pwirth 
Gerrit-Reviewer: Robert Vogel 
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]: db-eqiad, db-codfw.php: Remove db1021

2017-11-26 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393524 )

Change subject: db-eqiad,db-codfw.php: Remove db1021
..

db-eqiad,db-codfw.php: Remove db1021

db1021's data was copied over db1053 and db1053 has been working fine
for a few days, so let's get rid of db1021

Bug: T181378
Change-Id: I1e86430ea1ba82fcbea672a149ee2b41c63ed410
---
M wmf-config/db-codfw.php
M wmf-config/db-eqiad.php
2 files changed, 0 insertions(+), 3 deletions(-)


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

diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php
index e6ba10b..395fcf2 100644
--- a/wmf-config/db-codfw.php
+++ b/wmf-config/db-codfw.php
@@ -577,7 +577,6 @@
'db1009' => '10.64.0.13', # do not remove or comment out
'db1011' => '10.64.0.15', # do not remove or comment out
'db1020' => '10.64.16.9', # do not remove or comment out
-   'db1021' => '10.64.16.10', # do not remove or comment out
'db1030' => '10.64.16.19', # do not remove or comment out
'db1034' => '10.64.16.23', # do not remove or comment out
'db1039' => '10.64.16.28', # do not remove or comment out
diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index f58c4d7..cf5662b 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -114,7 +114,6 @@
],
's2' => [
'db1054' => 0,   # A3 2.8TB  96GB, master
-   # 'db1021' => 0,   # B1 1.4TB  64GB, vslow, dump #to be 
decommissioned
'db1053' => 0,   # A2 2.8TB  96GB, vslow, dump
'db1060' => 1,   # C2 2.8TB  96GB, api #master for sanitarium 
#T153743
'db1074' => 300, # A2 3.6TB 512GB, api
@@ -490,7 +489,6 @@
'db1009' => '10.64.0.13', # do not remove or comment out
'db1011' => '10.64.0.15', # do not remove or comment out
'db1020' => '10.64.16.9', # do not remove or comment out
-   'db1021' => '10.64.16.10', # do not remove or comment out
'db1030' => '10.64.16.19', # do not remove or comment out
'db1034' => '10.64.16.23', # do not remove or comment out
'db1039' => '10.64.16.28', # do not remove or comment out

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Replace MimeMagic::singleton() call

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

Change subject: Replace MimeMagic::singleton() call
..


Replace MimeMagic::singleton() call

Change-Id: Id944953ce139a15b080280353369ebc5eff09024
---
M Flexiskin/includes/FlexiskinFormatter.class.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/Flexiskin/includes/FlexiskinFormatter.class.php 
b/Flexiskin/includes/FlexiskinFormatter.class.php
index 1c8bebe..94bda41 100644
--- a/Flexiskin/includes/FlexiskinFormatter.class.php
+++ b/Flexiskin/includes/FlexiskinFormatter.class.php
@@ -14,7 +14,7 @@
$oStatus = BsFileSystemHelper::getFileContent( 
$aConfig->backgroundImage, 'flexiskin' . DS . $sNewId . DS . 'images' );
if( $oStatus->isGood() ){
$oFileInfo = new SplFileInfo( 
$aConfig->backgroundImage );
-   $sMime = 
MimeMagic::singleton()->guessTypesForExtension( $oFileInfo->getExtension() );
+   $sMime = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()->guessTypesForExtension(
 $oFileInfo->getExtension() );
$aReturn[] = 
"body.mediawiki{background-image:url('data:$sMime;base64," . base64_encode( 
$oStatus->getValue() ) . "') !important;}";
}
else{
@@ -78,7 +78,7 @@
$oStatus = BsFileSystemHelper::getFileContent( $sFileName, 
'flexiskin' . DS . $sNewId . DS . 'images' );
if( $oStatus->isGood() ){
$oFileInfo = new SplFileInfo( $sFileName );
-   $sMime = 
MimeMagic::singleton()->guessTypesForExtension( $oFileInfo->getExtension() );
+   $sMime 
=\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()->guessTypesForExtension(
 $oFileInfo->getExtension() );
return "#bs-logo > 
a{background-image:url('data:$sMime;base64," . base64_encode( 
$oStatus->getValue() ) . "') !important;}";
}
return '';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id944953ce139a15b080280353369ebc5eff09024
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Ljonka 
Gerrit-Reviewer: Mglaser 
Gerrit-Reviewer: Pwirth 
Gerrit-Reviewer: Robert Vogel 
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...cxserver[master]: test: Add test for Matxin MT

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

Change subject: test: Add test for Matxin MT
..


test: Add test for Matxin MT

Change-Id: I87cb79e3889d8c6ec0220aa18b9e0bc1e9c63040
---
M lib/mt/Matxin.js
A test/mt/Matxin.test.js
2 files changed, 24 insertions(+), 1 deletion(-)

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



diff --git a/lib/mt/Matxin.js b/lib/mt/Matxin.js
index c39e7dd..e8ade33 100644
--- a/lib/mt/Matxin.js
+++ b/lib/mt/Matxin.js
@@ -30,7 +30,8 @@
} ).then( ( response ) => response.body.translation.replace( 
/\. ॥ ॥\. /g, '.॥॥.' ) )
.catch( ( response ) => {
throw new Error( 'Translation with Matxin 
failed. Error: ' +
-   this.getErrorName( response.status ) + 
' ' + sourceLang + '-' + targetLang );
+   this.getErrorName( response.status ) +
+   ` for ${sourceLang} + > + 
${targetLang}` );
} );
}
 
diff --git a/test/mt/Matxin.test.js b/test/mt/Matxin.test.js
new file mode 100644
index 000..1c039b9
--- /dev/null
+++ b/test/mt/Matxin.test.js
@@ -0,0 +1,22 @@
+'use strict';
+
+const assert = require( '../utils/assert.js' );
+const server = require( '../utils/server.js' );
+const Matxin = require( '../../lib/mt' ).Matxin;
+
+describe( 'Matxin machine translation', function () {
+   it( 'Should fail because of wrong key ', () => {
+   const cxConfig = server.config.service;
+   cxConfig.conf.mt.Matxin.key = 'wrongkey';
+   const matxin = new Matxin( cxConfig );
+   const testSourceContent = 'Esta es una prueba';
+   assert.fails(
+   matxin.translate( 'es', 'eu', testSourceContent ),
+   function ( err ) {
+   if ( ( err instanceof Error ) && /value/.test( 
err ) ) {
+   return true;
+   }
+   }
+   );
+   } );
+} );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I87cb79e3889d8c6ec0220aa18b9e0bc1e9c63040
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: KartikMistry 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Santhosh 
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...Linter[master]: Add link to Special:ExpandTemplates if lint error is from a ...

2017-11-26 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393523 )

Change subject: Add link to Special:ExpandTemplates if lint error is from a 
template
..

Add link to Special:ExpandTemplates if lint error is from a template

If the lint error comes from a template, include a link to
Special:ExpandTemplates for the specific wikitext that caused the error.
This is a little hacky since we don't want to be looking up page text
during the Special:LintErrors query. Instead, generate a link to
Special:LintErrorRedirect//. That special page will
handle looking up content, and then redirecting the user to
Special:ExpandTemplates with the context title and wikitext all filled
out.

Bug: T163149
Change-Id: Ia50148610da196f4d981ef5f161191c68c0ee276
---
M Linter.alias.php
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/LintErrorsPager.php
A includes/SpecialLintErrorRedirect.php
6 files changed, 147 insertions(+), 4 deletions(-)


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

diff --git a/Linter.alias.php b/Linter.alias.php
index d20f437..53cb778 100644
--- a/Linter.alias.php
+++ b/Linter.alias.php
@@ -23,6 +23,7 @@
 /** English (English) */
 $specialPageAliases['en'] = [
'LintErrors' => [ 'LintErrors' ],
+   'LintErrorRedirect' => [ 'LintErrorRedirect' ],
 ];
 
 /** Español (Spanish) */
diff --git a/extension.json b/extension.json
index 566ef08..46f7fac 100644
--- a/extension.json
+++ b/extension.json
@@ -19,6 +19,7 @@
"MediaWiki\\Linter\\ApiQueryLinterStats": 
"includes/ApiQueryLinterStats.php",
"MediaWiki\\Linter\\RecordLintJob": 
"includes/RecordLintJob.php",
"MediaWiki\\Linter\\SpecialLintErrors": 
"includes/SpecialLintErrors.php",
+   "MediaWiki\\Linter\\SpecialLintErrorRedirect": 
"includes/SpecialLintErrorRedirect.php",
"MediaWiki\\Linter\\LintErrorsPager": 
"includes/LintErrorsPager.php",
"MediaWiki\\Linter\\TotalsLookup": "includes/TotalsLookup.php"
},
@@ -45,7 +46,8 @@
"linterstats": "MediaWiki\\Linter\\ApiQueryLinterStats"
},
"SpecialPages": {
-   "LintErrors": "MediaWiki\\Linter\\SpecialLintErrors"
+   "LintErrors": "MediaWiki\\Linter\\SpecialLintErrors",
+   "LintErrorRedirect": 
"MediaWiki\\Linter\\SpecialLintErrorRedirect"
},
"JobClasses": {
"RecordLintJob": "MediaWiki\\Linter\\RecordLintJob"
diff --git a/i18n/en.json b/i18n/en.json
index 4927537..0b35e21 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -52,9 +52,12 @@
"linker-page-title-edit": "$1 ($2)",
"linker-page-edit": "edit",
"linker-page-history": "history",
+   "linker-page-expandtemplates": "expand templates",
"linter-heading-high-priority": "High priority",
"linter-heading-medium-priority": "Medium priority",
"linter-heading-low-priority": "Low priority",
+   "linter-redirect-invalid": "Error",
+   "linter-redirect-invalid-id": "The IDs provided to this page were 
invalid.",
"multi-part-template-block": "Output not from a single template",
"pageinfo-linter": "Lint errors",
"apihelp-query+linterrors-description": "Get a list of lint errors",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 9162c24..bc6cba0 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -56,9 +56,12 @@
"linker-page-title-edit": "Used in a table cell. $1 is a link to the 
page, $2 is pipe separated links to the edit and history pages, the link text 
is {{msg-mw|linker-page-edit}} and {{msg-mw|linker-page-history}}",
"linker-page-edit": "Link text for edit link in 
{{msg-mw|linker-page-title-edit}}\n{{Identical|Edit}}",
"linker-page-history": "Link text for history link in 
{{msg-mw|linker-page-title-edit}}\n{{Identical|History}}",
+   "linker-page-expandtemplates": "Link text for Special:ExpandTemplates 
link in {{msg-mw|linker-page-title-edit}}",
"linter-heading-high-priority": "Heading on [[Special:LintErrors]]",
"linter-heading-medium-priority": "Heading on [[Special:LintErrors]]",
"linter-heading-low-priority": "Heading on [[Special:LintErrors]]",
+   "linter-redirect-invalid": "Error page title",
+   "linter-redirect-invalid-id": "Error message if the IDs provided were 
invalid.",
"multi-part-template-block": "Table cell on [[Special:LintErrors]] 
indicating that content block is not produced by a single template",
"pageinfo-linter": "Heading on ?action=info for a page if it has lint 
errors",
"apihelp-query+linterrors-description": 
"{{doc-apihelp-description|query+linterrors}}",
diff --git a/includes/LintErrorsPager.php b/includes/LintErrorsPager.php
index 661e6e1..344da14 100644
--- a/includes/LintErrorsPager.php
+++ 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-eqiad.php: Pool db1097 in s4

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

Change subject: db-eqiad.php: Pool db1097 in s4
..


db-eqiad.php: Pool db1097 in s4

db1097 is a multi-instance slave that servers also in s4.
Start giving it some weight

Bug: T178359
Change-Id: I6d1570eb8ff8847591bc0a0f5ea7b88a4d4d2a5e
---
M wmf-config/db-eqiad.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index f6045bd..f58c4d7 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -137,7 +137,7 @@
'db1081' => 100, # A2 3.6TB 512GB, api #lower weight T178359
'db1084' => 300, # B1 3.6TB 512GB, api #T178359
'db1091' => 500, # D2 3.6TB 512GB
-   # 'db1097:3314' => 1,   # D1 3.6TB 512GB, # rc, log: s4 and s5 
# do not pool being built
+   'db1097:3314' => 1,   # D1 3.6TB 512GB, # rc, log: s4 and s5
'db1103:3314' => 1,  # A3 3.6TB 512GB # rc, log: s2 and s4
],
's5' => [
@@ -350,7 +350,7 @@
],
'watchlist' => [
'db1056' => 1,
-   # 'db1097:3314' => 1,
+   'db1097:3314' => 1,
'db1103:3314' => 1,
],
'recentchanges' => [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6d1570eb8ff8847591bc0a0f5ea7b88a4d4d2a5e
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: Urbanecm 
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] operations/mediawiki-config[master]: db-eqiad.php: Pool db1097 in s4

2017-11-26 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393522 )

Change subject: db-eqiad.php: Pool db1097 in s4
..

db-eqiad.php: Pool db1097 in s4

db1097 is a multi-instance slave that servers also in s4.
Start giving it some weight

Bug: T178359
Change-Id: I6d1570eb8ff8847591bc0a0f5ea7b88a4d4d2a5e
---
M wmf-config/db-eqiad.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index f6045bd..f58c4d7 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -137,7 +137,7 @@
'db1081' => 100, # A2 3.6TB 512GB, api #lower weight T178359
'db1084' => 300, # B1 3.6TB 512GB, api #T178359
'db1091' => 500, # D2 3.6TB 512GB
-   # 'db1097:3314' => 1,   # D1 3.6TB 512GB, # rc, log: s4 and s5 
# do not pool being built
+   'db1097:3314' => 1,   # D1 3.6TB 512GB, # rc, log: s4 and s5
'db1103:3314' => 1,  # A3 3.6TB 512GB # rc, log: s2 and s4
],
's5' => [
@@ -350,7 +350,7 @@
],
'watchlist' => [
'db1056' => 1,
-   # 'db1097:3314' => 1,
+   'db1097:3314' => 1,
'db1103:3314' => 1,
],
'recentchanges' => [

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

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

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


[MediaWiki-commits] [Gerrit] wikidata...gui-deploy[production]: Merging from 0a3b9ba3bd186ead1e0f1cf2b87641a9511a268b:

2017-11-26 Thread Smalyshev (Code Review)
Smalyshev has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393521 )

Change subject: Merging from 0a3b9ba3bd186ead1e0f1cf2b87641a9511a268b:
..


Merging from 0a3b9ba3bd186ead1e0f1cf2b87641a9511a268b:

Add Pywikibot to CodeSamples.js

Bug: T181286
Change-Id: I1e0e794ce02b65ad5c1fb09c1a3f89459c78fbfb
---
R css/embed.style.min.4a02de1ddf96597820e6.css
R css/style.min.8edfba43f146d31f5f78.css
M embed.html
A examples/code/Python (Pywikibot).txt
M i18n/diq.json
M i18n/sl.json
M index.html
A js/embed.vendor.min.2d1a710314ca68627eb2.js
D js/embed.vendor.min.ff5a48b35cb60bfe12e8.js
A js/embed.wdqs.min.11d528d00010355f4014.js
D js/embed.wdqs.min.689c71c6adeae2164dc4.js
A js/vendor.min.1771a14efcf984fa475e.js
D js/vendor.min.8ae8a3459f4ec9a2231d.js
A js/wdqs.min.7db8b26731f46380ec51.js
D js/wdqs.min.e90ac2a045501f627bdd.js
15 files changed, 24 insertions(+), 23 deletions(-)

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1e0e794ce02b65ad5c1fb09c1a3f89459c78fbfb
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui-deploy
Gerrit-Branch: production
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: Smalyshev 

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


[MediaWiki-commits] [Gerrit] wikidata...gui-deploy[production]: Merging from 0a3b9ba3bd186ead1e0f1cf2b87641a9511a268b:

2017-11-26 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393521 )

Change subject: Merging from 0a3b9ba3bd186ead1e0f1cf2b87641a9511a268b:
..

Merging from 0a3b9ba3bd186ead1e0f1cf2b87641a9511a268b:

Add Pywikibot to CodeSamples.js

Bug: T181286
Change-Id: I1e0e794ce02b65ad5c1fb09c1a3f89459c78fbfb
---
R css/embed.style.min.4a02de1ddf96597820e6.css
R css/style.min.8edfba43f146d31f5f78.css
M embed.html
A examples/code/Python (Pywikibot).txt
M i18n/diq.json
M i18n/sl.json
M index.html
A js/embed.vendor.min.2d1a710314ca68627eb2.js
D js/embed.vendor.min.ff5a48b35cb60bfe12e8.js
A js/embed.wdqs.min.11d528d00010355f4014.js
D js/embed.wdqs.min.689c71c6adeae2164dc4.js
A js/vendor.min.1771a14efcf984fa475e.js
D js/vendor.min.8ae8a3459f4ec9a2231d.js
A js/wdqs.min.7db8b26731f46380ec51.js
D js/wdqs.min.e90ac2a045501f627bdd.js
15 files changed, 24 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui-deploy 
refs/changes/21/393521/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e0e794ce02b65ad5c1fb09c1a3f89459c78fbfb
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui-deploy
Gerrit-Branch: production
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Add Pywikibot to CodeSamples.js

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

Change subject: Add Pywikibot to CodeSamples.js
..


Add Pywikibot to CodeSamples.js

Bug: T181286
Change-Id: I5052a436d8aadcdf82ff952c2950f71afab629c2
---
A examples/code/Python (Pywikibot).txt
M wikibase/queryService/api/CodeSamples.js
A wikibase/tests/queryService/api/code-examples/empty/Python (Pywikibot).txt
A wikibase/tests/queryService/api/code-examples/simple/Python (Pywikibot).txt
4 files changed, 44 insertions(+), 0 deletions(-)

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



diff --git "a/examples/code/Python \050Pywikibot\051.txt" 
"b/examples/code/Python \050Pywikibot\051.txt"
new file mode 100644
index 000..7a31d91
--- /dev/null
+++ "b/examples/code/Python \050Pywikibot\051.txt"
@@ -0,0 +1,11 @@
+# https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Pywikibot
+import pywikibot
+from pywikibot import pagegenerators
+
+site = pywikibot.Site()
+repo = site.data_repository()
+query = {SPARQL_QUERY}
+generator = pagegenerators.WikidataSPARQLPageGenerator(query, site=repo)
+
+for item in generator:
+print(item)
diff --git a/wikibase/queryService/api/CodeSamples.js 
b/wikibase/queryService/api/CodeSamples.js
index b15679f..c4dbce2 100644
--- a/wikibase/queryService/api/CodeSamples.js
+++ b/wikibase/queryService/api/CodeSamples.js
@@ -16,6 +16,7 @@
 * @constructor
 */
function SELF( endpoint, root, index ) {
+   var self = this;
if ( endpoint.startsWith( '/' ) ) {
var origin;
if ( window.location.origin ) {
@@ -128,6 +129,11 @@
return '"""' + escapedQuery + '"""';
}
},
+   'Python (Pywikibot)': {
+   escape: function( query ) {
+   return self._languages.Python.escape( 
query );
+   }
+   },
Ruby: {
escape: function( query ) {
// try heredoc first
diff --git "a/wikibase/tests/queryService/api/code-examples/empty/Python 
\050Pywikibot\051.txt" 
"b/wikibase/tests/queryService/api/code-examples/empty/Python 
\050Pywikibot\051.txt"
new file mode 100644
index 000..d196e77
--- /dev/null
+++ "b/wikibase/tests/queryService/api/code-examples/empty/Python 
\050Pywikibot\051.txt"
@@ -0,0 +1,11 @@
+# https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Pywikibot
+import pywikibot
+from pywikibot import pagegenerators
+
+site = pywikibot.Site()
+repo = site.data_repository()
+query = ""
+generator = pagegenerators.WikidataSPARQLPageGenerator(query, site=repo)
+
+for item in generator:
+print(item)
diff --git "a/wikibase/tests/queryService/api/code-examples/simple/Python 
\050Pywikibot\051.txt" 
"b/wikibase/tests/queryService/api/code-examples/simple/Python 
\050Pywikibot\051.txt"
new file mode 100644
index 000..46a844c
--- /dev/null
+++ "b/wikibase/tests/queryService/api/code-examples/simple/Python 
\050Pywikibot\051.txt"
@@ -0,0 +1,16 @@
+# https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Pywikibot
+import pywikibot
+from pywikibot import pagegenerators
+
+site = pywikibot.Site()
+repo = site.data_repository()
+query = """# cats
+SELECT ?cat ?catLabel WHERE {
+  ?cat wdt:P31 wd:Q146.
+  SERVICE wikibase:label { bd:serviceParam wikibase:language 
"[AUTO_LANGUAGE],en". }
+}
+"""
+generator = pagegenerators.WikidataSPARQLPageGenerator(query, site=repo)
+
+for item in generator:
+print(item)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5052a436d8aadcdf82ff952c2950f71afab629c2
Gerrit-PatchSet: 5
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: Matěj Suchánek 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: php7.0: Convert php5 to php

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

Change subject: php7.0: Convert php5 to php
..


php7.0: Convert php5 to php

Most of the changes are straight forward replacements of "php5" with
"php" in package names. The php5-xhprof extension is replaced with
php-tideways (). The
php5 session cleanup script patches that we had added are also removed.

Bug: T181354
Change-Id: I33e74217203c037c29d6389c29f367e639131ba3
---
M puppet/hieradata/common.yaml
M puppet/modules/apache/files/envvars
M puppet/modules/apache/manifests/init.pp
A puppet/modules/apache/manifests/mod/php.pp
D puppet/modules/apache/manifests/mod/php5.pp
M puppet/modules/crm/manifests/civicrm.pp
M puppet/modules/mediawiki/manifests/apache.pp
R puppet/modules/mediawiki/templates/mediawiki-php7-site.erb
M puppet/modules/mediawiki/templates/multiwiki/alldbs.erb
M puppet/modules/mediawiki/templates/multiwiki/multiversion-install.erb
M puppet/modules/mediawiki/templates/multiwiki/mwscript.erb
M puppet/modules/mediawiki/templates/mwrepl/mwrepl.erb
M puppet/modules/mediawiki/templates/systemd/jobchron.erb
M puppet/modules/mediawiki/templates/systemd/jobrunner.erb
M puppet/modules/memcached/manifests/php.pp
M puppet/modules/phabricator/manifests/init.pp
D puppet/modules/php/files/php5.cron.d
D puppet/modules/php/files/sessionclean
M puppet/modules/php/manifests/composer.pp
M puppet/modules/php/manifests/ini.pp
M puppet/modules/php/manifests/init.pp
M puppet/modules/php/manifests/remote_debug.pp
D puppet/modules/php/manifests/sessionclean.pp
M puppet/modules/php/manifests/xhprof.pp
M puppet/modules/php/templates/prune_php_ini_files.bash.erb
M puppet/modules/redis/manifests/php.pp
M puppet/modules/role/manifests/fss.pp
M puppet/modules/role/manifests/ldapauth.pp
M puppet/modules/role/manifests/mediawiki.pp
M puppet/modules/role/manifests/zend.pp
30 files changed, 70 insertions(+), 164 deletions(-)

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



diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index fdf9553..3eb1b97 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -225,7 +225,7 @@
 mediawiki::branch: master
 
 mediawiki::apache::docroot: "%{hiera('apache::docroot')}"
-mediawiki::apache::php5_site_name: "php5%{hiera('mwv::tld')}"
+mediawiki::apache::php7_site_name: "php7%{hiera('mwv::tld')}"
 
 mediawiki::jobrunner::enable: true
 mediawiki::jobrunner::dir: "%{hiera('mwv::services_dir')}/jobrunner"
@@ -287,8 +287,6 @@
 phabricator::log_dir: "/vagrant/logs/phd"
 phabricator::vhost_name: "phabricator%{hiera('mwv::tld')}"
 phabricator::remote: https://secure.phabricator.com/diffusion/P/phabricator.git
-
-php::sessionclean::ensure: present
 
 php::xhprof::profile_storage_dir: /vagrant/profiles
 
diff --git a/puppet/modules/apache/files/envvars 
b/puppet/modules/apache/files/envvars
index 430884f..27823ea 100644
--- a/puppet/modules/apache/files/envvars
+++ b/puppet/modules/apache/files/envvars
@@ -15,9 +15,9 @@
   . "$envfile"
 done
 
-for ini in /etc/php5/conf.d/*.ini; do
+for ini in /etc/php/7.0/conf.d/*.ini; do
   [ -r "$ini" ] || break
-  mv "$ini" /etc/php5/mods-available
-  /usr/sbin/php5enmod -s ALL "$(basename $ini .ini)"
+  mv "$ini" /etc/php/7.0/mods-available
+  /usr/sbin/phpenmod -s ALL "$(basename $ini .ini)"
 done
-rm -rf /etc/php5/conf.d
+rm -rf /etc/php/7.0/conf.d
diff --git a/puppet/modules/apache/manifests/init.pp 
b/puppet/modules/apache/manifests/init.pp
index 6d6de02..bcbb314 100644
--- a/puppet/modules/apache/manifests/init.pp
+++ b/puppet/modules/apache/manifests/init.pp
@@ -14,7 +14,7 @@
 ensure  => present,
 }
 
-include apache::mod::php5
+include apache::mod::php
 include apache::mod::access_compat
 
 file { '/etc/apache2/ports.conf':
diff --git a/puppet/modules/apache/manifests/mod/php.pp 
b/puppet/modules/apache/manifests/mod/php.pp
new file mode 100644
index 000..2380e32
--- /dev/null
+++ b/puppet/modules/apache/manifests/mod/php.pp
@@ -0,0 +1,8 @@
+# == Class: apache::mod::php
+#
+class apache::mod::php {
+package { 'libapache2-mod-php': }
+apache::mod_conf { 'php7.0':
+require => Package['libapache2-mod-php'],
+}
+}
diff --git a/puppet/modules/apache/manifests/mod/php5.pp 
b/puppet/modules/apache/manifests/mod/php5.pp
deleted file mode 100644
index 3da7d3b..000
--- a/puppet/modules/apache/manifests/mod/php5.pp
+++ /dev/null
@@ -1,8 +0,0 @@
-# == Class: apache::mod::php5
-#
-class apache::mod::php5 {
-package { 'libapache2-mod-php5': }
-apache::mod_conf { 'php5':
-require => Package['libapache2-mod-php5'],
-}
-}
diff --git a/puppet/modules/crm/manifests/civicrm.pp 
b/puppet/modules/crm/manifests/civicrm.pp
index df56792..3b2ed8a 100644
--- a/puppet/modules/crm/manifests/civicrm.pp
+++ 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: apt: Remove jessie-backports pinning

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

Change subject: apt: Remove jessie-backports pinning
..


apt: Remove jessie-backports pinning

Backports are not needed (yet) on stretch.

Bug: T181354
Change-Id: I5c5bc73a9e38afe71aea3a0b39b2cb6b30e08bb9
---
M puppet/modules/apt/manifests/ppa.pp
M puppet/modules/git/manifests/init.pp
M puppet/modules/role/manifests/horizon.pp
M puppet/modules/role/manifests/keystone.pp
M puppet/modules/swift/manifests/init.pp
M puppet/modules/thumbor/manifests/init.pp
6 files changed, 2 insertions(+), 46 deletions(-)

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



diff --git a/puppet/modules/apt/manifests/ppa.pp 
b/puppet/modules/apt/manifests/ppa.pp
index 67e15ce..260cc93 100644
--- a/puppet/modules/apt/manifests/ppa.pp
+++ b/puppet/modules/apt/manifests/ppa.pp
@@ -33,7 +33,7 @@
 $onlyif  = "/usr/bin/test -e ${listfile}"
 } else {
 # PPA's are for Ubuntu, not Debian but may work if we hack the distro
-# name to be a modern Ubuntu LTS instead of jessie.
+# name to be a modern Ubuntu LTS instead of stretch.
 $command = "/usr/bin/add-apt-repository --yes ppa:${ppa} && /bin/sed 
-i 's/${::lsbdistcodename}/xenial/g' ${listfile} && /usr/bin/apt-get update"
 $onlyif  = "/usr/bin/test ! -e ${listfile}"
 }
diff --git a/puppet/modules/git/manifests/init.pp 
b/puppet/modules/git/manifests/init.pp
index acc39e5..ce8663d 100644
--- a/puppet/modules/git/manifests/init.pp
+++ b/puppet/modules/git/manifests/init.pp
@@ -32,15 +32,9 @@
 'git',
 'git-man',
 ]
-apt::pin { 'git':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1001',
-}
 
 package { $packages:
 ensure  => 'present',
-require => Apt::Pin['git'],
 }
 
 package { 'git-review':
diff --git a/puppet/modules/role/manifests/horizon.pp 
b/puppet/modules/role/manifests/horizon.pp
index b3c7324..739292e 100644
--- a/puppet/modules/role/manifests/horizon.pp
+++ b/puppet/modules/role/manifests/horizon.pp
@@ -94,15 +94,8 @@
   'python-xstatic-term.js',
 ]
 
-apt::pin { 'horizon':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1001',
-}
-
 package { $packages:
 ensure  => 'present',
-require => Apt::Pin['horizon'],
 }
 
 file { "${log_dir}/horizon":
diff --git a/puppet/modules/role/manifests/keystone.pp 
b/puppet/modules/role/manifests/keystone.pp
index bf21d54..0bc0ff2 100644
--- a/puppet/modules/role/manifests/keystone.pp
+++ b/puppet/modules/role/manifests/keystone.pp
@@ -68,15 +68,8 @@
 'websockify',
 ]
 
-apt::pin { 'keystone':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1001',
-}
-
 package { $packages:
 ensure  => 'present',
-require => Apt::Pin['keystone'],
 }
 
 mysql::db { 'keystone':
diff --git a/puppet/modules/swift/manifests/init.pp 
b/puppet/modules/swift/manifests/init.pp
index ceac5fa..51c3bfc 100644
--- a/puppet/modules/swift/manifests/init.pp
+++ b/puppet/modules/swift/manifests/init.pp
@@ -62,23 +62,8 @@
 'swift*'
 ]
 
-apt::pin { 'swift-python-backports':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1000',
-}
-
-package { ['swift', 'swift-account', 'swift-container', 'swift-object', 
'swift-proxy', 'python-webob']:
+package { ['swift', 'swift-account', 'swift-container', 'swift-object', 
'swift-proxy', 'python-webob', 'python-swiftclient']:
 ensure  => 'present',
-require => [
-Apt::Pin['swift-python-backports'],
-],
-}
-
-exec { 'ins-apt-python-swiftclient':
-command => '/usr/bin/apt-get update && /usr/bin/apt-get install -y 
--force-yes -t jessie-backports "python-swiftclient"',
-environment => 'DEBIAN_FRONTEND=noninteractive',
-unless  => '/usr/bin/dpkg -l python-swiftclient',
 }
 
 user { 'swift':
diff --git a/puppet/modules/thumbor/manifests/init.pp 
b/puppet/modules/thumbor/manifests/init.pp
index d27ef9b..784e4e7 100644
--- a/puppet/modules/thumbor/manifests/init.pp
+++ b/puppet/modules/thumbor/manifests/init.pp
@@ -32,12 +32,6 @@
 'python-pil',
 ]
 
-apt::pin { 'thumbor-python-backports':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1000',
-}
-
 package { 'raven':
 provider => 'pip',
 }
@@ -45,9 +39,6 @@
 package { 'python-thumbor-wikimedia':
 ensure  => 'present',
 notify  => 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: apt: Update Wikimedia apt config

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

Change subject: apt: Update Wikimedia apt config
..


apt: Update Wikimedia apt config

* New PGP signing key
* Remove components not present for Stretch per
  

Bug: T181354
Change-Id: If3c897d81d06d38f214de6dda58944d44ecbbe4c
---
M puppet/modules/apt/files/wikimedia-pubkey.asc
M puppet/modules/apt/manifests/init.pp
2 files changed, 30 insertions(+), 28 deletions(-)

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



diff --git a/puppet/modules/apt/files/wikimedia-pubkey.asc 
b/puppet/modules/apt/files/wikimedia-pubkey.asc
index f2a0487..30a45ec 100644
--- a/puppet/modules/apt/files/wikimedia-pubkey.asc
+++ b/puppet/modules/apt/files/wikimedia-pubkey.asc
@@ -1,30 +1,32 @@
+
 -BEGIN PGP PUBLIC KEY BLOCK-
-Version: GnuPG v1.4.11 (GNU/Linux)
+Version: GnuPG v1
 
-mQGiBEUtBY8RBACJTZdWEBZHlibArWM1HrX5rcPCb+o2nmeTfNrtMpmVbkmi9vBE
-VmIDnjc+VQlJNoiBOKMhAhRSO0rIwEbOTewiQSPERfsClGpv0ikb3kQVFls5HpfZ
-49u9EAERRez+P2VJUH7CBmigKdxtKRGM5aLI+eOLUl+lZUn4NU6BsQOUGwCgtLiL
-I+8DSNkoiV40UR3uFsS9KLMD/30Lth9A9JgwrDTFl8rlNxq3Eluulv0+2MYoDutW
-2p384vJ8Vil+x1GPzZXT1NVHCPdJMXqfnUl33XkPJEFSJ3B1WhwU3muItPoM+GKM
-cnJMn2rYJa6Fae7UZy8iRJwSuqSg4mGNa900m/izyYoijJzl1u4HtZhbV++lgubO
-j+YfA/4sz68H/ZQZwG+d8X/xTgZ3+9qekqGFgxdGTICtiD7IRPPaQ7EUWOBml6tn
-SHfd0TBkCKtfFkr6+rA3ZJ5pyo3OwO2yUAvlBOPeaX4ZKTl7+8lG9kqqGIBm/iZy
-bHC75DF506Zm4IiesAXRmRqfB8gReOHEJybZkaCg8FZqhdGErLQ8V2lraW1lZGlh
-IEFyY2hpdmUgQXV0b21hdGljIFNpZ25pbmcgS2V5IDxyb290QHdpa2ltZWRpYS5v
-cmc+iF8EExECACAFAkUtBY8CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRAJ
-29n5P2zUSmaGAJjipA+xkWInJJHCCcoJrf7rBzqEAJ9OEsJuxbBOvOJBovwpWtNh
-goMcubkCDQRFLQWdEAgAvEAe6PnzhGdOC3ZYIeJalQyBEelRZiEdzjtdojTNEf29
-6J75O8QqjQt/pyOZ9w/DCiy81dym3GlXeS61tcfNdSBMXqGtgXAskLV1djz0U7SU
-89MiwjrSiYhYRYNSQcrshVDjzpHkj8HY0gwNyN5yZ1xnZ9/WG46Kay6quHQbfKn7
-Egxs6ONJJaW7H1MM2cPzsJuzk1aXq4PJOFHgDo9J2j+nGVgk8XdGqgk5t0we69Oh
-YXlxUTjgOE+XMxk4PEOFDjk0pTmxOUMP0b08dpvJf652O4jpnylBIiT9ZxRadENM
-zmeBT//sJJIleYDh2a1xeDDQwzRig1swFnfYeuEugwADBQf/b7xdqYrLZYqtJVLO
-fgh3HOJ605KNYlyreKj67x04fy8lIhrkp3wraVTN74+jObNhJTq3VesUoPPgJqRi
-sABCwbGQeKriz7NUAflBliVapPjSd7qD696zO+wQd03z8wJecdxAcmw89+8jyHWV
-bgSf3Thy0pfCDBOZL5ApDzPp/zveTAJJdl9xJ+kQA9g4kXIbqdsv0ytqfT56CAOC
-vBIJ7JuzIz8eKZ5LlPoGosU5C6TPwlHwfrh1ttD5/LdoSbcz1ThCM3Q9nasvmQjQ
-EGZteBiJH8UogRLTsqbJCtQM6aQL8J/+bWjSrmPdCp2z/dzFTgtga4DKcXiSYo+U
-JVwilYhJBBgRAgAJBQJFLQWdAhsMAAoJEAnb2fk/bNRK/HEAn0ud2S4zsHv4Ayzp
-QqdXQFnLYQ6mAJ9LlSuxDwXm+ln+7o++xUBMQCKJ7g==
-=XekF
+mQINBFieKQEBEACZXCSJEwJnXsEofPUIunQTqF8p1IipjkDF4sNSgyuA17AD235h
+EEll1Czzd13bajM4D9dO+Yz4q9lWcrdoaHXklTEnA1Dhjk0wgTRqEqa37PBxjm7p
+xTuSOEFAHnQfjM9ZzV6Bd3kzIlfxnTguiYbN1pf4KQ7u4TQSchKr8V4p+mf4Y+Xg
+6hhskLrvMRYO7mNGEzm0vdfWsGbbvPZlhrRMea4oyCrOGd2piXAIPLR6DFXpyrb9
+GdEKrg8evTUnntsIqQ60h8veFETGNUmtpSF9OwzVGfH8TKACV7qA30Bbp6wDSLeY
+JefpX4yBexY3FbNx1oxXbXTZbDR8RZ4olWjP+inKYJTwHxQnvYjXWgMeNR/BgX2s
+ontLXqK5BzBP+1E0vHdAAYSU/8vjr+zmy1qyDWYtIlqdMXzDkXTCZIkJE0WPp5Sx
+sEFqpLdO7ggqJV5UF7h/yIq9bcxoaNxYGJFRDWg3Lj6ZLCxiSN/QHuqascMijKAU
+2RHzQtXhfXzZA8PwZp92dalOZOguytEYyhzrPfJlysvOnXTigHa9WeybDcJgsOO8
+xFbgU9P98NgyE4ZIel6P1GpLnBY8j0KpbhWfCi5mmomwwK5OUWe0g9/u4z5FmN3z
+/WWA/8BjuJI9MFnS3YoU3safEUi0vD5pnuktVQGJOkSnR6gAN4dAoCcVEwARAQAB
+tDxXaWtpbWVkaWEgQXJjaGl2ZSBBdXRvbWF0aWMgU2lnbmluZyBLZXkgPHJvb3RA
+d2lraW1lZGlhLm9yZz6JAjcEEwEKACEFAlieKQECGwMFCwkIBwMFFQoJCAsFFgID
+AQACHgECF4AACgkQnTktP/rfGPtmohAAhQhGkOe0DX5ZSK6uEs2IpB1W3EvCPK87
+vSgI6FZyGEURH7s/MknQR2lMShgHZ1oqLwZV1DE5ao/D4khPw1JZFeYajXOxQ3Sr
+/Qjg6ZayrJ/r9sSchC4nd6m+rFpzuRsx22FWrVenzRBau6/J6OUz3WawsjX3Bwrg
+/Hw11/+kgsabkdsdK28ENWdVj0tLp5asSxrs4L4d2RjKpfiufBAGpkqFV5p2J8aw
+cJ7Wh3/1mMo+biTtuemHtWf4XfWmXv99ltSEVe8PpMYQ+FjNUHDzEZMS5K39em+V
+EOC7GsE+SHHF6lgjH2BtDcpkimbU9uROnGeIWtpRr+PNMu/yhFLUCxe7tf4yffIJ
+NIAL3RFcRhLj0xCbL3fd5DbQP4eB68k9pLHwYxpKba7DDmH0aMstvk5xrpphdHAP
+p03VbE6ZThKxA828yb2jWtumDhoYRlkHs2KrVufUPA411mUE+A53pwqBse/KM9Iq
+Pidc+TwMwy2nByRB9WFyyGS08wqhewpwp8mwIOejvRf+3yi+CGHM2Xi4bTmEqVL+
+Jm1D5W49O5/j1T6HyVPGsyH/0QgYwg2IVZwL5Jfy9w3974jTV3QAcCBafR9hcZCS
+S2wOIo0ckRI0APw6DQSFMyBrNs9rWy72Ixu9RC1GtzCCn5OaMRUM9FaqjRnTKX4m
+grWsU8i35fI=
+=ib96
 -END PGP PUBLIC KEY BLOCK-
+
\ No newline at end of file
diff --git a/puppet/modules/apt/manifests/init.pp 
b/puppet/modules/apt/manifests/init.pp
index f294535..9498871 100644
--- a/puppet/modules/apt/manifests/init.pp
+++ b/puppet/modules/apt/manifests/init.pp
@@ -34,7 +34,7 @@
 apt::repository { 'wikimedia':
 uri => 'https://apt.wikimedia.org/wikimedia',
 dist=> "${::lsbdistcodename}-wikimedia",
-components  => 'main backports thirdparty',
+components  => 'main',
 keyfile => 'puppet:///modules/apt/wikimedia-pubkey.asc',
 comment_old => true,
 }

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

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: Change Vagrantfile for Puppet4

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

Change subject: puppet4: Change Vagrantfile for Puppet4
..


puppet4: Change Vagrantfile for Puppet4

Vagrant will use Puppet4 command semantics when puppet.environment_path
is set in the Vagrantfile.

Bug: T181354
Change-Id: I369cae97aa92d2d1447241dcfb4a5bc73174b6f9
---
M Vagrantfile
A puppet/environments/vagrant/.gitignore
2 files changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/Vagrantfile b/Vagrantfile
index 673a85d..b26a372 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -226,6 +226,9 @@
 puppet.manifests_path = [:guest, '/vagrant/puppet/manifests']
 puppet.manifest_file = 'site.pp'
 
+puppet.environment_path = [:guest, '/vagrant/puppet/environments']
+puppet.environment = 'vagrant'
+
 puppet.options = [
   '--modulepath', '/vagrant/puppet/modules',
   '--hiera_config', '/vagrant/puppet/hiera.yaml',
diff --git a/puppet/environments/vagrant/.gitignore 
b/puppet/environments/vagrant/.gitignore
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/puppet/environments/vagrant/.gitignore

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I369cae97aa92d2d1447241dcfb4a5bc73174b6f9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
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]: nodejs: Switch to jessie apt repo

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

Change subject: nodejs: Switch to jessie apt repo
..


nodejs: Switch to jessie apt repo

Bug: T181354
Change-Id: I3c95bc017b12e91809888055fbdda9a8dac14b49
---
M puppet/modules/npm/files/nodesource.sources.list
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/puppet/modules/npm/files/nodesource.sources.list 
b/puppet/modules/npm/files/nodesource.sources.list
index 69ce671..d027f78 100644
--- a/puppet/modules/npm/files/nodesource.sources.list
+++ b/puppet/modules/npm/files/nodesource.sources.list
@@ -1,2 +1,2 @@
-deb https://deb.nodesource.com/node_6.x jessie main
-deb-src https://deb.nodesource.com/node_6.x jessie main
+deb https://deb.nodesource.com/node_6.x stretch main
+deb-src https://deb.nodesource.com/node_6.x stretch main

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c95bc017b12e91809888055fbdda9a8dac14b49
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
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]: puppet4: type safe comparisons

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

Change subject: puppet4: type safe comparisons
..


puppet4: type safe comparisons

Puppet4 is strict about argument type matching when making comparisons.
Use data type comparisons to either replace or guard string comparisons.

Bug: T181354
Change-Id: I129f50036c5afbb28ce7121b8b51b6e3b9147dee
---
M puppet/modules/apache/manifests/conf.pp
M puppet/modules/env/manifests/profile_script.pp
M puppet/modules/mediawiki/manifests/settings.pp
M puppet/modules/motd/manifests/script.pp
M puppet/modules/rsyslog/manifests/conf.pp
5 files changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/puppet/modules/apache/manifests/conf.pp 
b/puppet/modules/apache/manifests/conf.pp
index 9c14849..9172f01 100644
--- a/puppet/modules/apache/manifests/conf.pp
+++ b/puppet/modules/apache/manifests/conf.pp
@@ -45,7 +45,7 @@
 ) {
 include ::apache
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail('"priority" must be between 0 - 99')
 }
 if $ensure !~ /^(present|absent)$/ {
diff --git a/puppet/modules/env/manifests/profile_script.pp 
b/puppet/modules/env/manifests/profile_script.pp
index 886f3d0..c0bf3e4 100644
--- a/puppet/modules/env/manifests/profile_script.pp
+++ b/puppet/modules/env/manifests/profile_script.pp
@@ -36,7 +36,7 @@
 ) {
 include ::env
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail('"priority" must be between 0 - 99')
 }
 if $ensure !~ /^(present|absent)$/ {
diff --git a/puppet/modules/mediawiki/manifests/settings.pp 
b/puppet/modules/mediawiki/manifests/settings.pp
index b78293b..bde54d5 100644
--- a/puppet/modules/mediawiki/manifests/settings.pp
+++ b/puppet/modules/mediawiki/manifests/settings.pp
@@ -113,7 +113,7 @@
 
 if $wiki_name == $::mediawiki::wiki_name {
 $db_name = $::mediawiki::db_name
-} elsif $wiki_name =~ /wiki$/ {
+} elsif $wiki_name =~ String and $wiki_name =~ /wiki$/ {
 $db_name = $wiki_name
 } else {
 $db_name = "${wiki_name}wiki"
diff --git a/puppet/modules/motd/manifests/script.pp 
b/puppet/modules/motd/manifests/script.pp
index 5e07efd..fd76142 100644
--- a/puppet/modules/motd/manifests/script.pp
+++ b/puppet/modules/motd/manifests/script.pp
@@ -33,7 +33,7 @@
 ) {
 include ::motd
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail('"priority" must be between 0 - 99')
 }
 if $ensure !~ /^(present|absent)$/ {
diff --git a/puppet/modules/rsyslog/manifests/conf.pp 
b/puppet/modules/rsyslog/manifests/conf.pp
index 6f5f7c6..54d3669 100644
--- a/puppet/modules/rsyslog/manifests/conf.pp
+++ b/puppet/modules/rsyslog/manifests/conf.pp
@@ -34,7 +34,7 @@
 ) {
 include ::rsyslog
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail("'priority' must be an integer between 0 - 99 (got: 
${priority}).")
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I129f50036c5afbb28ce7121b8b51b6e3b9147dee
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
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]: wmflib: Copy from 626a7ccc09 upstream

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

Change subject: wmflib: Copy from 626a7ccc09 upstream
..


wmflib: Copy from 626a7ccc09 upstream

Copy in the upstream operations/puppet.git wmflib module@ 626a7ccc09

Bug: T181354
Change-Id: I1d0fd5be73fccb606a699abefc2dfd101aacee32
---
M puppet/modules/wmflib/README.md
M puppet/modules/wmflib/Rakefile
M puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/mwyaml_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/nuyaml_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/proxy_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/role_backend.rb
M puppet/modules/wmflib/lib/hiera/httpcache.rb
M puppet/modules/wmflib/lib/hiera/mwcache.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/conftool.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/cron_splay.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ensure_mounted.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/get_clusters.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/hash_deselect_re.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/hash_select_re.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/init_template.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/os_version.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/puppet_ssldir.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/require_package.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/requires_os.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/role.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/shell_exports.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/systemd_template.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/sysvinit_template.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/upstart_template.rb
A 
puppet/modules/wmflib/spec/fixtures/modules/foo/templates/initscripts/fooservice.systemd.erb
M puppet/modules/wmflib/spec/functions/conftool_spec.rb
M puppet/modules/wmflib/spec/functions/ensure_mounted_spec.rb
A puppet/modules/wmflib/spec/functions/init_template_spec.rb
M puppet/modules/wmflib/spec/functions/ipresolve_spec.rb
A puppet/modules/wmflib/spec/functions/os_version_spec.rb
M puppet/modules/wmflib/spec/functions/role_spec.rb
M puppet/modules/wmflib/spec/hiera/proxy_backend_spec.rb
M puppet/modules/wmflib/spec/hiera/role_backend_spec.rb
38 files changed, 348 insertions(+), 215 deletions(-)

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



diff --git a/puppet/modules/wmflib/README.md b/puppet/modules/wmflib/README.md
index f6ab3fe..baea3fb 100644
--- a/puppet/modules/wmflib/README.md
+++ b/puppet/modules/wmflib/README.md
@@ -231,8 +231,8 @@
 
 ### Examples
 
-# True if Ubuntu Trusty or newer or Debian Jessie or newer
-os_version('ubuntu >= trusty || debian >= Jessie')
+# True if Ubuntu Trusty or newer or Debian jessie or newer
+os_version('ubuntu >= trusty || debian >= jessie')
 
 # True if exactly Debian Jessie
 os_version('debian jessie')
diff --git a/puppet/modules/wmflib/Rakefile b/puppet/modules/wmflib/Rakefile
index a0c3b79..cd3d379 100644
--- a/puppet/modules/wmflib/Rakefile
+++ b/puppet/modules/wmflib/Rakefile
@@ -1,37 +1 @@
-require 'rake'
-require 'fileutils'
-
-require 'rspec/core/rake_task'
-
-modulename = File.basename(File.expand_path(File.dirname(__FILE__)))
-
-symlinks = { 'spec/fixtures/modules/%s/files' % modulename => 
'../../../../files',
- 'spec/fixtures/modules/%s/manifests' % modulename => 
'../../../../manifests',
- 'spec/fixtures/modules/%s/templates' % modulename => 
'../../../../templates',
-   }
-
-
-task :setup do
-  FileUtils.mkdir_p('spec/fixtures/modules/%s' % modulename)
-  symlinks.each do |x|
-if !File.exist?(x[0])
-  FileUtils.ln_s(x[1], x[0])
-end
-  end
-end
-
-task :teardown do
-  symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
-  FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
-  FileUtils.rmdir('spec/fixtures/modules')
-end
-
-RSpec::Core::RakeTask.new(:realspec) do |t|
-  t.fail_on_error = false
-  t.pattern = 'spec/*/*_spec.rb'
-end
-
-task :spec_standalone => [ :setup, :realspec, :teardown]
-
-task :default => :spec do
-end
+require 'puppetlabs_spec_helper/rake_tasks'
diff --git a/puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb 
b/puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb
index fae9f51..3106cf5 100644
--- a/puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb
+++ 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: Update rake tests and fix errors

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

Change subject: puppet4: Update rake tests and fix errors
..


puppet4: Update rake tests and fix errors

* Update Gemfile to test with Rubocop 0.51
* Update Gemfile to test with Puppet 4.8.2
* Update Gemfile to test with Puppet-lint 2.3.3
* Disable new rubocop errors
* Fix Puppet4 lint errors
* Run cucumber inline with rake process. Fixes a working directory
  related error in local testing environment.

Bug: T181354
Change-Id: I753a57d55636c5a398d2b80cfe976946367d3c51
---
M .gitignore
M .rubocop.yml
M .rubocop_todo.yml
M Gemfile
M Gemfile.lock
M Rakefile
M puppet/manifests/site.pp
M puppet/modules/mediawiki/manifests/wiki.pp
M puppet/modules/role/manifests/articlecreationworkflow.pp
M puppet/modules/role/manifests/articleplaceholder.pp
M puppet/modules/role/manifests/betafeatures.pp
M puppet/modules/role/manifests/cldr.pp
M puppet/modules/role/manifests/commons.pp
M puppet/modules/role/manifests/education.pp
M puppet/modules/role/manifests/eventbus.pp
M puppet/modules/role/manifests/eventlogging.pp
M puppet/modules/role/manifests/flow.pp
M puppet/modules/role/manifests/gadgets2.pp
M puppet/modules/role/manifests/geodata.pp
M puppet/modules/role/manifests/geodata_elastic.pp
M puppet/modules/role/manifests/jsonconfig.pp
M puppet/modules/role/manifests/offline.pp
M puppet/modules/role/manifests/poolcounter.pp
M puppet/modules/role/manifests/questycaptcha.pp
M puppet/modules/role/manifests/restbase.pp
M puppet/modules/role/manifests/semanticmediawiki.pp
M puppet/modules/role/manifests/simple_performant.pp
M puppet/modules/role/manifests/visualeditor.pp
M puppet/modules/role/manifests/wikidata.pp
M puppet/modules/role/manifests/zero.pp
30 files changed, 159 insertions(+), 126 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index 4bfa27f..919a88f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
 /.gem
 /.idea
 /.rbenv-version
+/.ruby-version
 /.settings.yaml
 /.yardoc/
 /*.gem
diff --git a/.rubocop.yml b/.rubocop.yml
index f7a8364..e8367dd 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -30,7 +30,7 @@
 
 # Ignoring for now as many instances of strictly aligned parameters look
 # strange
-Style/AlignParameters:
+Layout/AlignParameters:
   Enabled: false
 
 Style/NumericLiterals:
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 87348c8..784972e 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -33,7 +33,7 @@
 
 # Offense count: 7
 # Configuration parameters: Exclude.
-Style/FileName:
+Naming/FileName:
   Exclude:
 - 'lib/labs-vagrant.rb'
 - 'lib/mediawiki-vagrant.rb'
@@ -72,9 +72,46 @@
 # Offense count: 5
 # Cop supports --auto-correct.
 # Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
-Style/TrailingComma:
+Style/TrailingCommaInArguments:
   Exclude:
 - 'Vagrantfile'
 - 'lib/mediawiki-vagrant/config.rb'
 - 'lib/mediawiki-vagrant/hiera.rb'
 - 'lib/mediawiki-vagrant/roles/change.rb'
+
+# Checks turned off when updating to rubocop 0.51
+Style/SymbolArray:
+  Enabled: false
+
+Style/TrailingCommaInLiteral:
+  Enabled: false
+
+Naming/HeredocDelimiterNaming:
+  Enabled: false
+
+Style/NumericPredicate:
+  Enabled: false
+
+Performance/HashEachMethods:
+  Enabled: false
+
+Style/PercentLiteralDelimiters:
+  Enabled: false
+
+Naming/HeredocDelimiterCase:
+  Enabled: false
+
+Lint/RescueWithoutErrorClass:
+  Enabled: false
+
+Layout/EmptyLines:
+  Enabled: false
+
+Layout/EmptyLinesAroundMethodBody:
+  Enabled: false
+
+Layout/EmptyLinesAroundClassBody:
+  Enabled: false
+
+Style/ClassAndModuleChildren:
+  Enabled: false
diff --git a/Gemfile b/Gemfile
index ac5462f..46d7c7a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,20 +4,18 @@
   # Upstream no more updates rubygems.org and we need a more recent version
   # https://github.com/mitchellh/vagrant/issues/5546
   gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git', tag: 'v1.8.1'
-
-  gem 'rubocop', '~> 0.35.1', require: false
-  gem 'puppet', '~> 3.7.0'
-  gem 'puppet-lint', '1.1.0'
+  gem 'rubocop', '~> 0.51', require: false
+  gem 'puppet', '~> 4.8.2'
+  gem 'puppet-lint', '2.3.3'
   gem 'puppetlabs_spec_helper', '< 2.0.0', require: false
   gem 'puppet-strings', '~> 1.0.0'
-  # Puppet 3.7 fails on ruby 2.2+
-  # https://tickets.puppetlabs.com/browse/PUP-3796
   gem 'safe_yaml', '~> 1.0.4'
-  gem 'rake', '~> 10.4.2'
+  gem 'rake', '~> 12.0.0'
 end
 
 group :development, :test do
   gem 'fakefs', '~> 0.6.5'
+  gem 'byebug', '~> 9.0.6'
   gem 'pry-byebug'
 end
 
diff --git a/Gemfile.lock b/Gemfile.lock
index 28f7bc5..db35020 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -31,13 +31,11 @@
   specs:
 CFPropertyList (2.2.8)
 ast (2.3.0)
-astrolabe (1.3.1)
-  parser (~> 2.2)
-builder (3.2.2)
-byebug (9.0.5)
+builder 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: s/trusted/can_trust/

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

Change subject: puppet4: s/trusted/can_trust/
..


puppet4: s/trusted/can_trust/

'trusted' is a reserved variable name in Puppet4

Bug: T181354
Change-Id: If4a5a9673ac2dbb7d955c6783c742c51e0d39082
---
M puppet/modules/apt/manifests/init.pp
M puppet/modules/apt/manifests/repository.pp
2 files changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/puppet/modules/apt/manifests/init.pp 
b/puppet/modules/apt/manifests/init.pp
index 9498871..5af3c83 100644
--- a/puppet/modules/apt/manifests/init.pp
+++ b/puppet/modules/apt/manifests/init.pp
@@ -51,7 +51,7 @@
 uri=> 'https://mwv-apt.wmflabs.org/repo',
 dist   => "${::lsbdistcodename}-mwv-apt",
 components => 'main',
-trusted=> true,
+can_trust  => true,
 source => false,
 }
 
diff --git a/puppet/modules/apt/manifests/repository.pp 
b/puppet/modules/apt/manifests/repository.pp
index ee11914..23a6c12 100644
--- a/puppet/modules/apt/manifests/repository.pp
+++ b/puppet/modules/apt/manifests/repository.pp
@@ -26,7 +26,7 @@
 # [*keyfile*]
 #   GPG key used to sign packages in this repo. Default undef.
 #
-# [*trusted*]
+# [*can_trust*]
 #   Should this repo be trusted for installing unsinged packages?
 #   Default false.
 #
@@ -42,11 +42,11 @@
 $components,
 $source  = true,
 $keyfile = undef,
-$trusted = false,
+$can_trust   = false,
 $comment_old = false,
 $ensure  = 'present',
 ) {
-$trust = $trusted ? {
+$trust = $can_trust ? {
 true=> '[trusted=yes] ',
 default => '',
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If4a5a9673ac2dbb7d955c6783c742c51e0d39082
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
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...cxserver[master]: test: Add test for Matxin MT

2017-11-26 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393520 )

Change subject: test: Add test for Matxin MT
..

test: Add test for Matxin MT

Change-Id: I87cb79e3889d8c6ec0220aa18b9e0bc1e9c63040
---
M lib/mt/Matxin.js
A test/mt/Matxin.test.js
2 files changed, 24 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/20/393520/1

diff --git a/lib/mt/Matxin.js b/lib/mt/Matxin.js
index c39e7dd..e8ade33 100644
--- a/lib/mt/Matxin.js
+++ b/lib/mt/Matxin.js
@@ -30,7 +30,8 @@
} ).then( ( response ) => response.body.translation.replace( 
/\. ॥ ॥\. /g, '.॥॥.' ) )
.catch( ( response ) => {
throw new Error( 'Translation with Matxin 
failed. Error: ' +
-   this.getErrorName( response.status ) + 
' ' + sourceLang + '-' + targetLang );
+   this.getErrorName( response.status ) +
+   ` for ${sourceLang} + > + 
${targetLang}` );
} );
}
 
diff --git a/test/mt/Matxin.test.js b/test/mt/Matxin.test.js
new file mode 100644
index 000..1c039b9
--- /dev/null
+++ b/test/mt/Matxin.test.js
@@ -0,0 +1,22 @@
+'use strict';
+
+const assert = require( '../utils/assert.js' );
+const server = require( '../utils/server.js' );
+const Matxin = require( '../../lib/mt' ).Matxin;
+
+describe( 'Matxin machine translation', function () {
+   it( 'Should fail because of wrong key ', () => {
+   const cxConfig = server.config.service;
+   cxConfig.conf.mt.Matxin.key = 'wrongkey';
+   const matxin = new Matxin( cxConfig );
+   const testSourceContent = 'Esta es una prueba';
+   assert.fails(
+   matxin.translate( 'es', 'eu', testSourceContent ),
+   function ( err ) {
+   if ( ( err instanceof Error ) && /value/.test( 
err ) ) {
+   return true;
+   }
+   }
+   );
+   } );
+} );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I87cb79e3889d8c6ec0220aa18b9e0bc1e9c63040
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: KartikMistry 

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


[MediaWiki-commits] [Gerrit] mediawiki...cxserver[master]: Youdao: Fix the error code reading

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

Change subject: Youdao: Fix the error code reading
..


Youdao: Fix the error code reading

First check if response.body.errorCode is present. If not go for
response.body. This was reverse in I9738d71971753f4

Change-Id: Id8ff3ff26f92a30c1eb7baa8ea471067f415e223
---
M lib/mt/Youdao.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/lib/mt/Youdao.js b/lib/mt/Youdao.js
index 8f16a82..5ec5cc1 100644
--- a/lib/mt/Youdao.js
+++ b/lib/mt/Youdao.js
@@ -103,7 +103,7 @@
return response.body.translation[ 0 ];
} else {
throw new Error( 'Translation with Youdao 
failed. Error: ' +
-   this.getErrorName( response.body || 
response.body.errorCode ) +
+   this.getErrorName( 
response.body.errorCode || response.body ) +
` for ${sourceLang} > 
${targetLang}` );
}
} );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id8ff3ff26f92a30c1eb7baa8ea471067f415e223
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: Santhosh 
Gerrit-Reviewer: KartikMistry 
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...cxserver[master]: Youdao: Fix the error code reading

2017-11-26 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393519 )

Change subject: Youdao: Fix the error code reading
..

Youdao: Fix the error code reading

First check if response.body.errorCode is present. If not go for
response.body. This was reverse in I9738d71971753f4

Change-Id: Id8ff3ff26f92a30c1eb7baa8ea471067f415e223
---
M lib/mt/Youdao.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/19/393519/1

diff --git a/lib/mt/Youdao.js b/lib/mt/Youdao.js
index 8f16a82..5ec5cc1 100644
--- a/lib/mt/Youdao.js
+++ b/lib/mt/Youdao.js
@@ -103,7 +103,7 @@
return response.body.translation[ 0 ];
} else {
throw new Error( 'Translation with Youdao 
failed. Error: ' +
-   this.getErrorName( response.body || 
response.body.errorCode ) +
+   this.getErrorName( 
response.body.errorCode || response.body ) +
` for ${sourceLang} > 
${targetLang}` );
}
} );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8ff3ff26f92a30c1eb7baa8ea471067f415e223
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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


[MediaWiki-commits] [Gerrit] mediawiki...cxserver[master]: Add test for Yandex client

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

Change subject: Add test for Yandex client
..


Add test for Yandex client

Similar to Changeset 393171.

Change-Id: Ie6722d22c559710b55f332dadacf40ee11e26e54
---
M lib/mt/Yandex.js
A test/mt/Yandex.test.js
2 files changed, 25 insertions(+), 2 deletions(-)

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



diff --git a/lib/mt/Yandex.js b/lib/mt/Yandex.js
index 1840dfc..2b563ee 100644
--- a/lib/mt/Yandex.js
+++ b/lib/mt/Yandex.js
@@ -51,7 +51,8 @@
.then( ( response ) => response.body.text[ 0 ] )
.catch( ( response ) => {
throw new Error( 'Translation with Yandex 
failed. Error: ' +
-   this.getErrorName( response.body.code ) 
+ ' ' + sourceLang + '-' + targetLang );
+   this.getErrorName( response.body.code 
|| response.body ) +
+   ` for ${sourceLang} + '>' + 
${targetLang}` );
} );
}
 
@@ -78,7 +79,7 @@
return errormap[ code ];
}
 
-   return 'Unknown error';
+   return `Unknown error: ${code}`;
}
 
requiresAuthorization() {
diff --git a/test/mt/Yandex.test.js b/test/mt/Yandex.test.js
new file mode 100644
index 000..18c9059
--- /dev/null
+++ b/test/mt/Yandex.test.js
@@ -0,0 +1,22 @@
+'use strict';
+
+const assert = require( '../utils/assert.js' );
+const server = require( '../utils/server.js' );
+const Yandex = require( '../../lib/mt' ).Yandex;
+
+describe( 'Yandex machine translation', function () {
+   it( 'Should fail because of wrong key ', () => {
+   const cxConfig = server.config.service;
+   cxConfig.conf.mt.Yandex.key = 'wrongkey';
+   const yandex = new Yandex( cxConfig );
+   const testSourceContent = 'This is a test';
+   assert.fails(
+   yandex.translate( 'en', 'gu', testSourceContent ),
+   function ( err ) {
+   if ( ( err instanceof Error ) && /value/.test( 
err ) ) {
+   return true;
+   }
+   }
+   );
+   } );
+} );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie6722d22c559710b55f332dadacf40ee11e26e54
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: KartikMistry 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Santhosh 
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...PageForms[master]: Changed forminput autocompletion to always be remote

2017-11-26 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393518 )

Change subject: Changed forminput autocompletion to always be remote
..


Changed forminput autocompletion to always be remote

Local autocompletion sometimes didn't work, apparently due to caching.

Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
---
M includes/PF_ParserFunctions.php
1 file changed, 7 insertions(+), 10 deletions(-)

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



diff --git a/includes/PF_ParserFunctions.php b/includes/PF_ParserFunctions.php
index 02017cf..be102d1 100644
--- a/includes/PF_ParserFunctions.php
+++ b/includes/PF_ParserFunctions.php
@@ -303,16 +303,13 @@
$inputID = 'input_' . $input_num;
$formInputAttrs['id'] = $inputID;
$formInputAttrs['class'] = 'autocompleteInput 
createboxInput formInput';
-   global $wgPageFormsMaxLocalAutocompleteValues;
-   $autocompletion_values = 
PFValuesUtils::getAutocompleteValues( $inAutocompletionSource, 
$autocompletionType );
-   if ( count( $autocompletion_values ) > 
$wgPageFormsMaxLocalAutocompleteValues ) {
-   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
-   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
-   } else {
-   global $wgPageFormsAutocompleteValues;
-   $wgPageFormsAutocompleteValues[$inputID] = 
$autocompletion_values;
-   $formInputAttrs['autocompletesettings'] = 
$inputID;
-   }
+   // This code formerly only used remote autocompletion
+   // when the number of autocompletion values was above
+   // a certain limit - as happens in regular forms -
+   // but local autocompletion didn't always work,
+   // apparently due to page caching.
+   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
+   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
}
 
// The value has already been HTML-encoded as a parameter,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Changed forminput autocompletion to always be remote

2017-11-26 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393518 )

Change subject: Changed forminput autocompletion to always be remote
..

Changed forminput autocompletion to always be remote

Local autocompletion sometimes didn't work, apparently due to caching.

Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
---
M includes/PF_ParserFunctions.php
1 file changed, 7 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/18/393518/2

diff --git a/includes/PF_ParserFunctions.php b/includes/PF_ParserFunctions.php
index 02017cf..be102d1 100644
--- a/includes/PF_ParserFunctions.php
+++ b/includes/PF_ParserFunctions.php
@@ -303,16 +303,13 @@
$inputID = 'input_' . $input_num;
$formInputAttrs['id'] = $inputID;
$formInputAttrs['class'] = 'autocompleteInput 
createboxInput formInput';
-   global $wgPageFormsMaxLocalAutocompleteValues;
-   $autocompletion_values = 
PFValuesUtils::getAutocompleteValues( $inAutocompletionSource, 
$autocompletionType );
-   if ( count( $autocompletion_values ) > 
$wgPageFormsMaxLocalAutocompleteValues ) {
-   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
-   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
-   } else {
-   global $wgPageFormsAutocompleteValues;
-   $wgPageFormsAutocompleteValues[$inputID] = 
$autocompletion_values;
-   $formInputAttrs['autocompletesettings'] = 
$inputID;
-   }
+   // This code formerly only used remote autocompletion
+   // when the number of autocompletion values was above
+   // a certain limit - as happens in regular forms -
+   // but local autocompletion didn't always work,
+   // apparently due to page caching.
+   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
+   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
}
 
// The value has already been HTML-encoded as a parameter,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...cxserver[master]: Add Dockerfile to .gitignore

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

Change subject: Add Dockerfile to .gitignore
..


Add Dockerfile to .gitignore

Dockerfile is used in deployment of cxserver.

Change-Id: Ic869afdfe294f0598a792e9062cebec9f9e494f9
---
M .gitignore
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index bcf2333..3ba945a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,6 @@
 docs
 node_modules
 log/
+
+# Dockerfile (used for deploy)
+Dockerfile

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic869afdfe294f0598a792e9062cebec9f9e494f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: KartikMistry 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: Santhosh 
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]: objectcache: do not send old version values to getWithSetCal...

2017-11-26 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393517 )

Change subject: objectcache: do not send old version values to 
getWithSetCallback() callbacks
..

objectcache: do not send old version values to getWithSetCallback() callbacks

The code might not be able to handle missing, new, or changed fields
if it happens to use $oldValue. Avoid making that assumption.

Change-Id: If108a73078c530c985d30bdadcbfa9ddd53dc2be
---
M includes/libs/objectcache/WANObjectCache.php
1 file changed, 4 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/393517/1

diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index f5c561f..2c7beff 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -899,25 +899,17 @@
$cur = $this->doGetWithSetCallback(
$key,
$ttl,
-   function ( $oldValue, &$ttl, &$setOpts, 
$oldAsOf )
-   use ( $callback, $version ) {
-   if ( is_array( $oldValue )
-   && array_key_exists( 
self::VFLD_DATA, $oldValue )
-   ) {
-   $oldData = 
$oldValue[self::VFLD_DATA];
-   } else {
-   // VFLD_DATA is not set 
if an old, unversioned, key is present
-   $oldData = false;
-   }
-
+   function ( $oldValue, &$ttl, &$setOpts 
) use ( $callback, $version ) {
+   // Do not send an old version 
value to a newer version callback
return [
-   self::VFLD_DATA => 
$callback( $oldData, $ttl, $setOpts, $oldAsOf ),
+   self::VFLD_DATA => 
$callback( false, $ttl, $setOpts, null ),
self::VFLD_VERSION => 
$version
];
},
$opts,
$asOf
);
+
if ( $cur[self::VFLD_VERSION] === $version ) {
// Value created or existed before with 
version; use it
$value = $cur[self::VFLD_DATA];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If108a73078c530c985d30bdadcbfa9ddd53dc2be
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: objectcache: add more comments to WANObjectCache getWithSetC...

2017-11-26 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393516 )

Change subject: objectcache: add more comments to WANObjectCache 
getWithSetCallback()
..

objectcache: add more comments to WANObjectCache getWithSetCallback()

Change-Id: I567f45fa7b33226b0ccf7d80440802eab71ff753
---
M includes/libs/objectcache/WANObjectCache.php
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/393516/1

diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index e63b32e..d6a850e 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -857,14 +857,16 @@
 *  Default: WANObjectCache::MIN_TIMESTAMP_NONE.
 *   - hotTTR: Expected time-till-refresh (TTR) for keys that average 
~1 hit/second (1 Hz).
 *  Keys with a hit rate higher than 1Hz will refresh sooner than 
this TTR and vise versa.
-*  Such refreshes won't happen until keys are "ageNew" seconds 
old. The TTR is useful at
-*  reducing the impact of missed cache purges, since the effect of 
a heavily referenced
-*  key being stale is worse than that of a rarely referenced key. 
Unlike simply lowering
-*  $ttl, seldomly used keys are largely unaffected by this option, 
which makes it possible
-*  to have a high hit rate for the "long-tail" of less-used keys.
+*  Such refreshes won't happen until keys are "ageNew" seconds 
old. This also uses
+*  randomization to avoid triggering stampedes. The TTR is useful 
at reducing the impact
+*  of missed cache purges, since the effect of a heavily 
referenced key being stale is
+*  worse than that of a rarely referenced key. Unlike simply 
lowering $ttl, seldomly
+*  used keys are largely unaffected by this option, which makes it 
possible to have a
+*  high hit rate for the "long-tail" of less-used keys.
 *  Default: WANObjectCache::HOT_TTR.
 *   - lowTTL: Consider pre-emptive updates when the current TTL 
(seconds) of the key is less
 *  than this. It becomes more likely over time, becoming certain 
once the key is expired.
+*  This helps avoid stampedes that might be triggered due to the 
key expiring.
 *  Default: WANObjectCache::LOW_TTL.
 *   - ageNew: Consider popularity refreshes only once a key reaches 
this age in seconds.
 *  Default: WANObjectCache::AGE_NEW.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I567f45fa7b33226b0ccf7d80440802eab71ff753
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtensions[master]: Replace MimeMagic::singleton() call

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393515 )

Change subject: Replace MimeMagic::singleton() call
..

Replace MimeMagic::singleton() call

Change-Id: Id944953ce139a15b080280353369ebc5eff09024
---
M Flexiskin/includes/FlexiskinFormatter.class.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/Flexiskin/includes/FlexiskinFormatter.class.php 
b/Flexiskin/includes/FlexiskinFormatter.class.php
index 1c8bebe..94bda41 100644
--- a/Flexiskin/includes/FlexiskinFormatter.class.php
+++ b/Flexiskin/includes/FlexiskinFormatter.class.php
@@ -14,7 +14,7 @@
$oStatus = BsFileSystemHelper::getFileContent( 
$aConfig->backgroundImage, 'flexiskin' . DS . $sNewId . DS . 'images' );
if( $oStatus->isGood() ){
$oFileInfo = new SplFileInfo( 
$aConfig->backgroundImage );
-   $sMime = 
MimeMagic::singleton()->guessTypesForExtension( $oFileInfo->getExtension() );
+   $sMime = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()->guessTypesForExtension(
 $oFileInfo->getExtension() );
$aReturn[] = 
"body.mediawiki{background-image:url('data:$sMime;base64," . base64_encode( 
$oStatus->getValue() ) . "') !important;}";
}
else{
@@ -78,7 +78,7 @@
$oStatus = BsFileSystemHelper::getFileContent( $sFileName, 
'flexiskin' . DS . $sNewId . DS . 'images' );
if( $oStatus->isGood() ){
$oFileInfo = new SplFileInfo( $sFileName );
-   $sMime = 
MimeMagic::singleton()->guessTypesForExtension( $oFileInfo->getExtension() );
+   $sMime 
=\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()->guessTypesForExtension(
 $oFileInfo->getExtension() );
return "#bs-logo > 
a{background-image:url('data:$sMime;base64," . base64_encode( 
$oStatus->getValue() ) . "') !important;}";
}
return '';

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtendedSearch[master]: Replace MimeMagic::singleton() call

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393514 )

Change subject: Replace MimeMagic::singleton() call
..

Replace MimeMagic::singleton() call

Change-Id: Iea5155d3e2ef050ce51bfeb922ccc0185964fe7a
---
M src/Source/DocumentProvider/File.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/src/Source/DocumentProvider/File.php 
b/src/Source/DocumentProvider/File.php
index 75964ee..f2dd19d 100644
--- a/src/Source/DocumentProvider/File.php
+++ b/src/Source/DocumentProvider/File.php
@@ -12,10 +12,11 @@
 */
public function getDataConfig( $sUri, $oFile ) {
$aDC = $this->oDecoratedDP->getDataConfig( $sUri, $oFile );
+   $magic = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$aDC += [
'basename' => $oFile->getBasename(),
'extension' => $oFile->getExtension(),
-   'mime_type' => \MimeMagic::singleton()->guessMimeType( 
$oFile->getPathname() ),
+   'mime_type' => $magic->guessMimeType( 
$oFile->getPathname() ),
'mtime' => $oFile->getMTime(),
'ctime' => $oFile->getCTime(),
'size' => $oFile->getSize(),

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...SemanticPageMaker[master]: Replace MimeMagic::singleton() call

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393513 )

Change subject: Replace MimeMagic::singleton() call
..

Replace MimeMagic::singleton() call

Change-Id: I8ea0c15c2320e998a5434b12e05fd55763311910
---
M specials/WidgetAssembler/SPM_UploadWindow.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/specials/WidgetAssembler/SPM_UploadWindow.php 
b/specials/WidgetAssembler/SPM_UploadWindow.php
index 2e31958..5ba60e4 100644
--- a/specials/WidgetAssembler/SPM_UploadWindow.php
+++ b/specials/WidgetAssembler/SPM_UploadWindow.php
@@ -1132,7 +1132,7 @@
 */
function verify( $tmpfile, $extension ) {
# magically determine mime type
-   $magic =& MimeMagic::singleton();
+   $magic = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$mime = $magic->guessMimeType( $tmpfile, false );
 
# check mime type, if desired
@@ -1178,7 +1178,7 @@
 * @return bool
 */
function verifyExtension( $mime, $extension ) {
-   $magic =& MimeMagic::singleton();
+   $magic = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
 
if ( ! $mime || $mime == 'unknown' || $mime == 
'unknown/unknown' )
if ( ! $magic->isRecognizableExtension( $extension ) ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...SocialProfile[master]: Replace MimeMagic::singleton() call

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393512 )

Change subject: Replace MimeMagic::singleton() call
..

Replace MimeMagic::singleton() call

Change-Id: I7a3639992a5b612470309c2c5c0906078aaa4f38
---
M SystemGifts/SpecialSystemGiftManagerLogo.php
M UserGifts/SpecialGiftManagerLogo.php
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/SystemGifts/SpecialSystemGiftManagerLogo.php 
b/SystemGifts/SpecialSystemGiftManagerLogo.php
index 2031d5f..ebad268 100644
--- a/SystemGifts/SpecialSystemGiftManagerLogo.php
+++ b/SystemGifts/SpecialSystemGiftManagerLogo.php
@@ -692,7 +692,7 @@
global $wgDisableUploadScriptChecks, $wgVerifyMimeType, 
$wgMimeTypeBlacklist;
 
# magically determine mime type
-   $magic = MimeMagic::singleton();
+   $magic = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$mime = $magic->guessMimeType( $tmpfile, false );
 
# check mime type, if desired
diff --git a/UserGifts/SpecialGiftManagerLogo.php 
b/UserGifts/SpecialGiftManagerLogo.php
index 9f05bb0..c64ab27 100644
--- a/UserGifts/SpecialGiftManagerLogo.php
+++ b/UserGifts/SpecialGiftManagerLogo.php
@@ -687,7 +687,7 @@
global $wgDisableUploadScriptChecks, $wgVerifyMimeType, 
$wgMimeTypeBlacklist;
 
# magically determine mime type
-   $magic = MimeMagic::singleton();
+   $magic = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$mime = $magic->guessMimeType( $tmpfile, false );
 
# check mime type, if desired

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...SportsTeams[master]: Replace MimeMagic::singleton() call

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393511 )

Change subject: Replace MimeMagic::singleton() call
..

Replace MimeMagic::singleton() call

Change-Id: I5ebad6c750f7409109e15bf32116543ed9259106
---
M includes/specials/SpecialSportsManagerLogo.php
M includes/specials/SpecialSportsTeamsManagerLogo.php
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/includes/specials/SpecialSportsManagerLogo.php 
b/includes/specials/SpecialSportsManagerLogo.php
index 6247438..5644098 100644
--- a/includes/specials/SpecialSportsManagerLogo.php
+++ b/includes/specials/SpecialSportsManagerLogo.php
@@ -641,7 +641,7 @@
 */
function verify( $tmpfile, $extension ) {
# magically determine mime type
-   $magic = MimeMagic::singleton();
+   $magic = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$mime = $magic->guessMimeType( $tmpfile, false );
 
# check mime type, if desired
diff --git a/includes/specials/SpecialSportsTeamsManagerLogo.php 
b/includes/specials/SpecialSportsTeamsManagerLogo.php
index c609fb3..8ab2e0c 100644
--- a/includes/specials/SpecialSportsTeamsManagerLogo.php
+++ b/includes/specials/SpecialSportsTeamsManagerLogo.php
@@ -668,7 +668,7 @@
 */
function verify( $tmpfile, $extension ) {
# magically determine mime type
-   $magic = MimeMagic::singleton();
+   $magic = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$mime = $magic->guessMimeType( $tmpfile, false );
 
# check mime type, if desired

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MolHandler[master]: Replace MimeMagic::singleton() call

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393510 )

Change subject: Replace MimeMagic::singleton() call
..

Replace MimeMagic::singleton() call

Change-Id: I031203a2678adf777bd656b2aed0e0b93bbb8ec9
---
M tests/phpunit/MolHandler.mimeTest.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/tests/phpunit/MolHandler.mimeTest.php 
b/tests/phpunit/MolHandler.mimeTest.php
index 2ac74bb..20a2982 100644
--- a/tests/phpunit/MolHandler.mimeTest.php
+++ b/tests/phpunit/MolHandler.mimeTest.php
@@ -40,7 +40,7 @@
fclose( $handle );
 
# Set up prerequisites
-   $mimeMagic = MimeMagic::singleton();
+   $mimeMagic = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$mimeByExt = 'text/plain';
$ext = strtolower( preg_replace( '/.*\.(\w{2,})$/', 
'\1', $filePath ) );
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...GWToolset[master]: Replace MimeMagic::singleton() call

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393509 )

Change subject: Replace MimeMagic::singleton() call
..

Replace MimeMagic::singleton() call

Change-Id: I32551466c2ccc08f655c24c9a8b151530f0820fc
---
M includes/Handlers/UploadHandler.php
M includes/Helpers/FileChecks.php
M includes/Php/File.php
3 files changed, 3 insertions(+), 6 deletions(-)


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

diff --git a/includes/Handlers/UploadHandler.php 
b/includes/Handlers/UploadHandler.php
index 39754fb..7f33901 100644
--- a/includes/Handlers/UploadHandler.php
+++ b/includes/Handlers/UploadHandler.php
@@ -19,7 +19,6 @@
 use GWToolset\Helpers\FileChecks;
 use GWToolset\Jobs\UploadMediafileJob;
 use Http;
-use MimeMagic;
 use MWException;
 use MWHttpRequest;
 use Status;
@@ -433,7 +432,7 @@
}
 
$pathinfo = pathinfo( $options['url'] );
-   $MimeMagic = MimeMagic::singleton();
+   $MimeMagic = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
 
if ( !empty( $pathinfo['extension'] )
&& in_array( $pathinfo['extension'], $wgFileExtensions )
diff --git a/includes/Helpers/FileChecks.php b/includes/Helpers/FileChecks.php
index 562376b..623dda4 100644
--- a/includes/Helpers/FileChecks.php
+++ b/includes/Helpers/FileChecks.php
@@ -12,7 +12,6 @@
 use GWToolset\Config;
 use GWToolset\GWTException;
 use GWToolset\Utils;
-use MimeMagic;
 use MWException;
 use Php\File;
 use Status;
@@ -289,7 +288,7 @@
return Status::newFatal( 
'gwtoolset-unaccepted-extension' );
}
 
-   $mime_type_extension_match = 
MimeMagic::singleton()->isMatchingExtension(
+   $mime_type_extension_match = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()->isMatchingExtension(
$File->pathinfo['extension'], $File->mime_type
);
 
diff --git a/includes/Php/File.php b/includes/Php/File.php
index bf92a54..a38ca0d 100644
--- a/includes/Php/File.php
+++ b/includes/Php/File.php
@@ -11,7 +11,6 @@
 
 use GWToolset\GWTException;
 use GWToolset\Utils;
-use MimeMagic;
 use MWException;
 
 /**
@@ -115,7 +114,7 @@
}
 
protected function setMimeType() {
-   $this->mime_type = MimeMagic::singleton()->guessMimeType(
+   $this->mime_type = 
\MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()->guessMimeType(
$this->tmp_name,
$this->pathinfo['extension']
);

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...PdfHandler[master]: Replace MimeMagic::singleton() call

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393508 )

Change subject: Replace MimeMagic::singleton() call
..

Replace MimeMagic::singleton() call

Change-Id: I963ed531fd6b1748c006ab64dd7bc22fac44d167
---
M CreatePdfThumbnailsJob.class.php
M PdfHandler_body.php
2 files changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/CreatePdfThumbnailsJob.class.php b/CreatePdfThumbnailsJob.class.php
index 6e9d3c1..65edb8e 100644
--- a/CreatePdfThumbnailsJob.class.php
+++ b/CreatePdfThumbnailsJob.class.php
@@ -97,7 +97,8 @@
if ( !$wgPdfCreateThumbnailsInJobQueue ) {
return true;
}
-   if ( !MimeMagic::singleton()->isMatchingExtension( 'pdf', $mime 
) ) {
+   $magic = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
+   if ( !$magic->isMatchingExtension( 'pdf', $mime ) ) {
return true; // not a PDF, abort
}
 
diff --git a/PdfHandler_body.php b/PdfHandler_body.php
index 01da498..a55d7be 100644
--- a/PdfHandler_body.php
+++ b/PdfHandler_body.php
@@ -296,7 +296,7 @@
static $mime;
 
if ( !isset( $mime ) ) {
-   $magic = MimeMagic::singleton();
+   $magic = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
$mime = $magic->guessTypesForExtension( 
$wgPdfOutputExtension );
}
return [ $wgPdfOutputExtension, $mime ];

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ConfirmAccount[master]: Replace MimeMagic::singleton() call

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393507 )

Change subject: Replace MimeMagic::singleton() call
..

Replace MimeMagic::singleton() call

Change-Id: I3278509ef2ee1a1a5dd0aaad394fa4fce43abfd9
---
M backend/ConfirmAccount.class.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/backend/ConfirmAccount.class.php b/backend/ConfirmAccount.class.php
index 8ca46ee..9d93d96 100644
--- a/backend/ConfirmAccount.class.php
+++ b/backend/ConfirmAccount.class.php
@@ -214,7 +214,7 @@
public static function verifyAttachment( $tmpfile, $extension ) {
global $wgVerifyMimeType, $wgMimeTypeBlacklist;
 
-   $magic = MimeMagic::singleton(); // magically determine mime 
type
+   $magic = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer(); // magically 
determine mime type
$mime = $magic->guessMimeType( $tmpfile, false );
# check mime type, if desired
if ( $wgVerifyMimeType ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Replace MimeMagic::singleton() call

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393506 )

Change subject: Replace MimeMagic::singleton() call
..

Replace MimeMagic::singleton() call

Change-Id: Ib01a23b909cb3e19c6d5ea9a8cf03d06ff8dab99
---
M includes/AbuseFilter.hooks.php
1 file changed, 4 insertions(+), 1 deletion(-)


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

diff --git a/includes/AbuseFilter.hooks.php b/includes/AbuseFilter.hooks.php
index fd71955..3b90f04 100644
--- a/includes/AbuseFilter.hooks.php
+++ b/includes/AbuseFilter.hooks.php
@@ -710,7 +710,10 @@
$vars->setVar( 'file_size', $upload->getFileSize() );
 
$vars->setVar( 'file_mime', $props['mime'] );
-   $vars->setVar( 'file_mediatype', 
MimeMagic::singleton()->getMediaType( null, $props['mime'] ) );
+   $vars->setVar(
+   'file_mediatype',
+   
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()->getMediaType( 
null, $props['mime'] )
+   );
$vars->setVar( 'file_width', $props['width'] );
$vars->setVar( 'file_height', $props['height'] );
$vars->setVar( 'file_bits_per_channel', $props['bits'] );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add wfDeprecated() call to MimeMagic::singleton()

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393505 )

Change subject: Add wfDeprecated() call to MimeMagic::singleton()
..

Add wfDeprecated() call to MimeMagic::singleton()

Change-Id: I8f7733e61ea1d8798b0e29fca4df724e4f39e549
---
M includes/MimeMagic.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/393505/1

diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php
index a2a44bb..6152d22 100644
--- a/includes/MimeMagic.php
+++ b/includes/MimeMagic.php
@@ -31,6 +31,7 @@
 * @deprecated since 1.28 get a MimeAnalyzer instance from 
MediaWikiServices
 */
public static function singleton() {
+   wfDeprecated( __METHOD__, '1.28' );
// XXX: We know that the MimeAnalyzer is currently an instance 
of MimeMagic
$instance = MediaWikiServices::getInstance()->getMimeAnalyzer();
Assert::postcondition(

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Replace MimeMagic::singleton() calls

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393504 )

Change subject: Replace MimeMagic::singleton() calls
..

Replace MimeMagic::singleton() calls

Change-Id: Ieed41b5d6b0f568fe2872e7754f2feae7868fe7a
---
M includes/Feed.php
M includes/StreamFile.php
M includes/api/ApiFormatBase.php
M includes/filebackend/FileBackendGroup.php
M includes/filerepo/FileRepo.php
M includes/filerepo/RepoGroup.php
M includes/filerepo/file/File.php
M includes/filerepo/file/ForeignAPIFile.php
M includes/filerepo/file/LocalFile.php
M includes/filerepo/file/UnregisteredLocalFile.php
M includes/media/DjVu.php
M includes/media/MediaHandler.php
M includes/specials/SpecialMediaStatistics.php
M includes/upload/UploadBase.php
M includes/upload/UploadStash.php
M includes/utils/MWFileProps.php
M maintenance/importImages.php
M tests/phpunit/includes/media/WebPTest.php
18 files changed, 27 insertions(+), 26 deletions(-)


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

diff --git a/includes/Feed.php b/includes/Feed.php
index fd223e6..55913c6 100644
--- a/includes/Feed.php
+++ b/includes/Feed.php
@@ -232,7 +232,7 @@
header( "Content-type: $mimetype; charset=UTF-8" );
 
// Set a sane filename
-   $exts = MimeMagic::singleton()->getExtensionsForType( $mimetype 
);
+   $exts = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()->getExtensionsForType(
 $mimetype );
$ext = $exts ? strtok( $exts, ' ' ) : 'xml';
header( "Content-Disposition: inline; filename=\"feed.{$ext}\"" 
);
 
diff --git a/includes/StreamFile.php b/includes/StreamFile.php
index 71113a8..2ad42e5 100644
--- a/includes/StreamFile.php
+++ b/includes/StreamFile.php
@@ -113,7 +113,7 @@
return 'unknown/unknown';
}
 
-   $magic = MimeMagic::singleton();
+   $magic = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
// Use the extension only, rather than magic numbers, to avoid 
opening
// up vulnerabilities due to uploads of files with allowed 
extensions
// but disallowed types.
diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php
index c5f2fcf..4348fc8 100644
--- a/includes/api/ApiFormatBase.php
+++ b/includes/api/ApiFormatBase.php
@@ -78,7 +78,8 @@
} elseif ( $this->getIsHtml() ) {
return 'api-result.html';
} else {
-   $exts = MimeMagic::singleton()->getExtensionsForType( 
$this->getMimeType() );
+   $exts = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer()
+   ->getExtensionsForType( $this->getMimeType() );
$ext = $exts ? strtok( $exts, ' ' ) : strtolower( 
$this->mFormat );
return "api-result.$ext";
}
diff --git a/includes/filebackend/FileBackendGroup.php 
b/includes/filebackend/FileBackendGroup.php
index 5d0da6d..0b61979 100644
--- a/includes/filebackend/FileBackendGroup.php
+++ b/includes/filebackend/FileBackendGroup.php
@@ -229,7 +229,7 @@
 * @since 1.27
 */
public function guessMimeInternal( $storagePath, $content, $fsPath ) {
-   $magic = MimeMagic::singleton();
+   $magic = 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
// Trust the extension of the storage path (caller must 
validate)
$ext = FileBackend::extensionFromPath( $storagePath );
$type = $magic->guessTypesForExtension( $ext );
diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php
index 5005280..5d22b8d 100644
--- a/includes/filerepo/FileRepo.php
+++ b/includes/filerepo/FileRepo.php
@@ -1543,7 +1543,7 @@
 */
public function getFileProps( $virtualUrl ) {
$fsFile = $this->getLocalReference( $virtualUrl );
-   $mwProps = new MWFileProps( MimeMagic::singleton() );
+   $mwProps = new MWFileProps( 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer() );
if ( $fsFile ) {
$props = $mwProps->getPropsFromPath( 
$fsFile->getPath(), true );
} else {
diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php
index 2edd6d0..5e37d67 100644
--- a/includes/filerepo/RepoGroup.php
+++ b/includes/filerepo/RepoGroup.php
@@ -452,7 +452,7 @@
 
return $repo->getFileProps( $fileName );
} else {
-   $mwProps = new MWFileProps( MimeMagic::singleton() );
+   $mwProps = new MWFileProps( 
MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer() );
 
return $mwProps->getPropsFromPath( 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: API:Siteinfo: Include wgCategoryCollation in Siteinfo response

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

Change subject: API:Siteinfo: Include wgCategoryCollation in Siteinfo response
..


API:Siteinfo: Include wgCategoryCollation in Siteinfo response

Include the value of $wgCategoryCollation in the siteinfo general array.  This 
will allow AWB to get this information without needing to scrape the NOC 
InitialiseSettings.php.txt file.

Bug: T179795
Change-Id: I76f85c71d2fe0d7a0482fb5eda0458708057e48d
---
M includes/api/ApiQuerySiteinfo.php
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/includes/api/ApiQuerySiteinfo.php 
b/includes/api/ApiQuerySiteinfo.php
index 6b896c9..2e9e69c 100644
--- a/includes/api/ApiQuerySiteinfo.php
+++ b/includes/api/ApiQuerySiteinfo.php
@@ -283,6 +283,8 @@
$data['interwikimagic'] = (bool)$config->get( 'InterwikiMagic' 
);
$data['magiclinks'] = $config->get( 'EnableMagicLinks' );
 
+   $data['categorycollation'] = $config->get( 'CategoryCollation' 
);
+
Hooks::run( 'APIQuerySiteInfoGeneralInfo', [ $this, &$data ] );
 
return $this->getResult()->addValue( 'query', $property, $data 
);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I76f85c71d2fe0d7a0482fb5eda0458708057e48d
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Imarlier 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Imarlier 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add optional EXPLAIN logging

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

Change subject: Add optional EXPLAIN logging
..

Add optional EXPLAIN logging

Adds an option to Database to EXPLAIN all queries and
log the output to the DBExplain channel, as a convenience
for performance debugging. Adds a MediaWiki config flag
($wgDebugExplainSql) to enable it.

Change-Id: Ide5a83fc832b1f72d8e62c7b0932ebc90973afb7
---
M includes/DefaultSettings.php
M includes/db/MWLBFactory.php
M includes/libs/rdbms/database/Database.php
M includes/libs/rdbms/lbfactory/ILBFactory.php
M includes/libs/rdbms/lbfactory/LBFactory.php
M includes/libs/rdbms/loadbalancer/ILoadBalancer.php
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
7 files changed, 96 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/393503/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index d9f032c..f781c88 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -6123,6 +6123,11 @@
 $wgDebugDumpSql = false;
 
 /**
+ * Run EXPLAIN on all queries and log the output to the DBExplain channel.
+ */
+$wgDebugExplainSql = false;
+
+/**
  * Performance expectations for DB usage
  *
  * @since 1.26
diff --git a/includes/db/MWLBFactory.php b/includes/db/MWLBFactory.php
index aa1918d..e3a1d08 100644
--- a/includes/db/MWLBFactory.php
+++ b/includes/db/MWLBFactory.php
@@ -60,6 +60,9 @@
'hostname' => wfHostname(),
'readOnlyReason' => $readOnlyMode->getReason(),
];
+   if ( $mainConfig->get( 'DebugExplainSql' ) ) {
+   $lbConf['explainLogger'] = LoggerFactory::getInstance( 
'DBExplain' );
+   }
 
// When making changes here, remember to also specify 
MediaWiki-specific options
// for Database classes in the relevant Installer subclass.
diff --git a/includes/libs/rdbms/database/Database.php 
b/includes/libs/rdbms/database/Database.php
index e04566e..cce31c6 100644
--- a/includes/libs/rdbms/database/Database.php
+++ b/includes/libs/rdbms/database/Database.php
@@ -85,6 +85,8 @@
protected $connLogger;
/** @var LoggerInterface */
protected $queryLogger;
+   /** @var LoggerInterface|null */
+   protected $explainLogger;
/** @var callback Error logging callback */
protected $errorLogger;
 
@@ -276,6 +278,7 @@
$this->trxProfiler = $params['trxProfiler'];
$this->connLogger = $params['connLogger'];
$this->queryLogger = $params['queryLogger'];
+   $this->explainLogger = isset( $params['explainLogger'] ) ? 
$params['explainLogger'] : null;
$this->errorLogger = $params['errorLogger'];
 
// Set initial dummy domain until open() sets the final 
DB/prefix
@@ -323,6 +326,8 @@
 *  used to adjust lock timeouts or encoding modes and the like.
 *   - connLogger: Optional PSR-3 logger interface instance.
 *   - queryLogger: Optional PSR-3 logger interface instance.
+*   - explainLogger: Optional PSR-3 logger interface instance. When 
present, all appropriate
+*  queries will be EXPLAINed first and the output sent to this 
channel.
 *   - profiler: Optional class name or object with 
profileIn()/profileOut() methods.
 *  These will be called in query(), using a simplified version of 
the SQL that also
 *  includes the agent as a SQL comment.
@@ -847,6 +852,20 @@
}
 
/**
+* Determine whether EXPLAIN works with this query.
+*
+* @param string $sql
+* @return bool
+*/
+   protected function isExplainableQuery( $sql ) {
+   return in_array(
+   $this->getQueryVerb( $sql ),
+   [ 'SELECT', 'INSERT', 'UPDATE', 'REPLACE', 'DELETE' ],
+   true
+   );
+   }
+
+   /**
 * @param string $sql A SQL query
 * @return bool Whether $sql is SQL for TEMPORARY table operation
 */
@@ -997,6 +1016,16 @@
 * object for a successful read query, or false on failure
 */
private function doProfiledQuery( $sql, $commentedSql, $isWrite, $fname 
) {
+   if ( $this->explainLogger && $this->isExplainableQuery( $sql ) 
) {
+   $res = $this->doQuery( "EXPLAIN $commentedSql" );
+   if ( $res ) {
+   $explain = $this->formatResult( $res );
+   $this->explainLogger->info( 
"$commentedSql\n$explain", [
+   'caller' => $fname,
+   ] );
+   }
+   }
+
$isMaster = !is_null( 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: swap defaultbranch=master to track=1

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

Change subject: swap defaultbranch=master to track=1
..


swap defaultbranch=master to track=1

Change-Id: I7e5e98f060ada77aaaf0117df995994cb37c18b4
---
M .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/.gitreview b/.gitreview
index f9039ba..7ddbad6 100644
--- a/.gitreview
+++ b/.gitreview
@@ -2,5 +2,5 @@
 host=gerrit.wikimedia.org
 port=29418
 project=mediawiki/vagrant.git
-defaultbranch=stretch-migration
+track=1
 defaultrebase=0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e5e98f060ada77aaaf0117df995994cb37c18b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: Reedy 
Gerrit-Reviewer: BryanDavis 
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]: swap defaultbranch=master to track=1

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393502 )

Change subject: swap defaultbranch=master to track=1
..

swap defaultbranch=master to track=1

Change-Id: I7e5e98f060ada77aaaf0117df995994cb37c18b4
---
M .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/02/393502/1

diff --git a/.gitreview b/.gitreview
index f9039ba..7ddbad6 100644
--- a/.gitreview
+++ b/.gitreview
@@ -2,5 +2,5 @@
 host=gerrit.wikimedia.org
 port=29418
 project=mediawiki/vagrant.git
-defaultbranch=stretch-migration
+track=1
 defaultrebase=0

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Switch base image to Debian Stretch

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

Change subject: Switch base image to Debian Stretch
..


Switch base image to Debian Stretch

Bug: T181354
Change-Id: Iab5e0647b9e71c91d0c39c5a043ea45e89eb4d44
---
M Vagrantfile
1 file changed, 10 insertions(+), 11 deletions(-)

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



diff --git a/Vagrantfile b/Vagrantfile
index f39293e..673a85d 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -57,13 +57,13 @@
 
   # Default VirtualBox provider
   config.vm.provider :virtualbox do |_vb, override|
-override.vm.box = 'debian/contrib-jessie64'
+override.vm.box = 'debian/contrib-stretch64'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
   # VMWare Fusion provider. Enable with `--provider=vmware_fusion`
   config.vm.provider :vmware_fusion do |_vw, override|
-override.vm.box = 'dhoppe/debian-8.8.0-amd64-nocm'
+override.vm.box = 'generic/debian9'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
@@ -77,14 +77,14 @@
   # NAT and port redirection are not automatically set up for you.
   #
   config.vm.provider :hyperv do |_hyperv, override|
-override.vm.box = 'ira/leap'
+override.vm.box = 'generic/debian9'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
   # LXC provider. Enable wtih `--provider=lxc`
   # Requires vagrant-lxc plugin and Vagrant 1.7+
   config.vm.provider :lxc do |_lxc, override|
-override.vm.box = 'LEAP/jessie'
+override.vm.box = 'debian/stretch64'
   end
 
   # Parallels provider. Enable with `--provider=parallels`
@@ -96,16 +96,15 @@
   # Note that port forwarding works via localhost but not via external
   # interfaces of the host machine by default...
   config.vm.provider :parallels do |_parallels, override|
-override.vm.box = 'bento/debian-8.9'
+override.vm.box = 'kolaephant/debian9-amd64'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
   # libvirt (KVM/QEMU) provider.  Enable with `--provider=libvirt`.
-  # config.vm.provider :libvirt do |_libvirt, override|
-  #   override.vm.box = 'trusty-cloud'
-
-  #   override.vm.network :private_network, ip: settings[:static_ip]
-  # end
+  config.vm.provider :libvirt do |_libvirt, override|
+override.vm.box = 'debian/stretch64'
+override.vm.network :private_network, ip: settings[:static_ip]
+  end
 
   config.vm.network :forwarded_port,
 guest: settings[:http_port], host: settings[:http_port], host_ip: 
settings[:host_ip],
@@ -210,7 +209,7 @@
 
   config.vm.provision :lsb_check do |lsb|
 lsb.vendor = 'Debian'
-lsb.version = '^8'
+lsb.version = '^9'
   end
 
   config.vm.provision :mediawiki_reload if mwv.reload?

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iab5e0647b9e71c91d0c39c5a043ea45e89eb4d44
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: swap defaultbranch=master to track=1

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

Change subject: swap defaultbranch=master to track=1
..


swap defaultbranch=master to track=1

Change-Id: I7e5e98f060ada77aaaf0117df995994cb37c18b4
---
M .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/.gitreview b/.gitreview
index 94edce0..7ddbad6 100644
--- a/.gitreview
+++ b/.gitreview
@@ -2,5 +2,5 @@
 host=gerrit.wikimedia.org
 port=29418
 project=mediawiki/vagrant.git
-defaultbranch=master
+track=1
 defaultrebase=0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e5e98f060ada77aaaf0117df995994cb37c18b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
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[master]: swap defaultbranch=master to track=1

2017-11-26 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393501 )

Change subject: swap defaultbranch=master to track=1
..

swap defaultbranch=master to track=1

Change-Id: I7e5e98f060ada77aaaf0117df995994cb37c18b4
---
M .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/01/393501/1

diff --git a/.gitreview b/.gitreview
index 94edce0..7ddbad6 100644
--- a/.gitreview
+++ b/.gitreview
@@ -2,5 +2,5 @@
 host=gerrit.wikimedia.org
 port=29418
 project=mediawiki/vagrant.git
-defaultbranch=master
+track=1
 defaultrebase=0

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: gerrit: configure for feature branch development

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

Change subject: gerrit: configure for feature branch development
..


gerrit: configure for feature branch development

Bug: T181353
Change-Id: I3acb4cffd286246d6ba52e259ae42fa99a8bac62
---
M .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/.gitreview b/.gitreview
index 94edce0..f9039ba 100644
--- a/.gitreview
+++ b/.gitreview
@@ -2,5 +2,5 @@
 host=gerrit.wikimedia.org
 port=29418
 project=mediawiki/vagrant.git
-defaultbranch=master
+defaultbranch=stretch-migration
 defaultrebase=0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3acb4cffd286246d6ba52e259ae42fa99a8bac62
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: apt: Update Wikimedia apt config

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393500 )

Change subject: apt: Update Wikimedia apt config
..

apt: Update Wikimedia apt config

* New PGP signing key
* Remove components not present for Stretch per
  

Bug: T181354
Change-Id: If3c897d81d06d38f214de6dda58944d44ecbbe4c
---
M puppet/modules/apt/files/wikimedia-pubkey.asc
M puppet/modules/apt/manifests/init.pp
2 files changed, 30 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/00/393500/1

diff --git a/puppet/modules/apt/files/wikimedia-pubkey.asc 
b/puppet/modules/apt/files/wikimedia-pubkey.asc
index f2a0487..30a45ec 100644
--- a/puppet/modules/apt/files/wikimedia-pubkey.asc
+++ b/puppet/modules/apt/files/wikimedia-pubkey.asc
@@ -1,30 +1,32 @@
+
 -BEGIN PGP PUBLIC KEY BLOCK-
-Version: GnuPG v1.4.11 (GNU/Linux)
+Version: GnuPG v1
 
-mQGiBEUtBY8RBACJTZdWEBZHlibArWM1HrX5rcPCb+o2nmeTfNrtMpmVbkmi9vBE
-VmIDnjc+VQlJNoiBOKMhAhRSO0rIwEbOTewiQSPERfsClGpv0ikb3kQVFls5HpfZ
-49u9EAERRez+P2VJUH7CBmigKdxtKRGM5aLI+eOLUl+lZUn4NU6BsQOUGwCgtLiL
-I+8DSNkoiV40UR3uFsS9KLMD/30Lth9A9JgwrDTFl8rlNxq3Eluulv0+2MYoDutW
-2p384vJ8Vil+x1GPzZXT1NVHCPdJMXqfnUl33XkPJEFSJ3B1WhwU3muItPoM+GKM
-cnJMn2rYJa6Fae7UZy8iRJwSuqSg4mGNa900m/izyYoijJzl1u4HtZhbV++lgubO
-j+YfA/4sz68H/ZQZwG+d8X/xTgZ3+9qekqGFgxdGTICtiD7IRPPaQ7EUWOBml6tn
-SHfd0TBkCKtfFkr6+rA3ZJ5pyo3OwO2yUAvlBOPeaX4ZKTl7+8lG9kqqGIBm/iZy
-bHC75DF506Zm4IiesAXRmRqfB8gReOHEJybZkaCg8FZqhdGErLQ8V2lraW1lZGlh
-IEFyY2hpdmUgQXV0b21hdGljIFNpZ25pbmcgS2V5IDxyb290QHdpa2ltZWRpYS5v
-cmc+iF8EExECACAFAkUtBY8CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRAJ
-29n5P2zUSmaGAJjipA+xkWInJJHCCcoJrf7rBzqEAJ9OEsJuxbBOvOJBovwpWtNh
-goMcubkCDQRFLQWdEAgAvEAe6PnzhGdOC3ZYIeJalQyBEelRZiEdzjtdojTNEf29
-6J75O8QqjQt/pyOZ9w/DCiy81dym3GlXeS61tcfNdSBMXqGtgXAskLV1djz0U7SU
-89MiwjrSiYhYRYNSQcrshVDjzpHkj8HY0gwNyN5yZ1xnZ9/WG46Kay6quHQbfKn7
-Egxs6ONJJaW7H1MM2cPzsJuzk1aXq4PJOFHgDo9J2j+nGVgk8XdGqgk5t0we69Oh
-YXlxUTjgOE+XMxk4PEOFDjk0pTmxOUMP0b08dpvJf652O4jpnylBIiT9ZxRadENM
-zmeBT//sJJIleYDh2a1xeDDQwzRig1swFnfYeuEugwADBQf/b7xdqYrLZYqtJVLO
-fgh3HOJ605KNYlyreKj67x04fy8lIhrkp3wraVTN74+jObNhJTq3VesUoPPgJqRi
-sABCwbGQeKriz7NUAflBliVapPjSd7qD696zO+wQd03z8wJecdxAcmw89+8jyHWV
-bgSf3Thy0pfCDBOZL5ApDzPp/zveTAJJdl9xJ+kQA9g4kXIbqdsv0ytqfT56CAOC
-vBIJ7JuzIz8eKZ5LlPoGosU5C6TPwlHwfrh1ttD5/LdoSbcz1ThCM3Q9nasvmQjQ
-EGZteBiJH8UogRLTsqbJCtQM6aQL8J/+bWjSrmPdCp2z/dzFTgtga4DKcXiSYo+U
-JVwilYhJBBgRAgAJBQJFLQWdAhsMAAoJEAnb2fk/bNRK/HEAn0ud2S4zsHv4Ayzp
-QqdXQFnLYQ6mAJ9LlSuxDwXm+ln+7o++xUBMQCKJ7g==
-=XekF
+mQINBFieKQEBEACZXCSJEwJnXsEofPUIunQTqF8p1IipjkDF4sNSgyuA17AD235h
+EEll1Czzd13bajM4D9dO+Yz4q9lWcrdoaHXklTEnA1Dhjk0wgTRqEqa37PBxjm7p
+xTuSOEFAHnQfjM9ZzV6Bd3kzIlfxnTguiYbN1pf4KQ7u4TQSchKr8V4p+mf4Y+Xg
+6hhskLrvMRYO7mNGEzm0vdfWsGbbvPZlhrRMea4oyCrOGd2piXAIPLR6DFXpyrb9
+GdEKrg8evTUnntsIqQ60h8veFETGNUmtpSF9OwzVGfH8TKACV7qA30Bbp6wDSLeY
+JefpX4yBexY3FbNx1oxXbXTZbDR8RZ4olWjP+inKYJTwHxQnvYjXWgMeNR/BgX2s
+ontLXqK5BzBP+1E0vHdAAYSU/8vjr+zmy1qyDWYtIlqdMXzDkXTCZIkJE0WPp5Sx
+sEFqpLdO7ggqJV5UF7h/yIq9bcxoaNxYGJFRDWg3Lj6ZLCxiSN/QHuqascMijKAU
+2RHzQtXhfXzZA8PwZp92dalOZOguytEYyhzrPfJlysvOnXTigHa9WeybDcJgsOO8
+xFbgU9P98NgyE4ZIel6P1GpLnBY8j0KpbhWfCi5mmomwwK5OUWe0g9/u4z5FmN3z
+/WWA/8BjuJI9MFnS3YoU3safEUi0vD5pnuktVQGJOkSnR6gAN4dAoCcVEwARAQAB
+tDxXaWtpbWVkaWEgQXJjaGl2ZSBBdXRvbWF0aWMgU2lnbmluZyBLZXkgPHJvb3RA
+d2lraW1lZGlhLm9yZz6JAjcEEwEKACEFAlieKQECGwMFCwkIBwMFFQoJCAsFFgID
+AQACHgECF4AACgkQnTktP/rfGPtmohAAhQhGkOe0DX5ZSK6uEs2IpB1W3EvCPK87
+vSgI6FZyGEURH7s/MknQR2lMShgHZ1oqLwZV1DE5ao/D4khPw1JZFeYajXOxQ3Sr
+/Qjg6ZayrJ/r9sSchC4nd6m+rFpzuRsx22FWrVenzRBau6/J6OUz3WawsjX3Bwrg
+/Hw11/+kgsabkdsdK28ENWdVj0tLp5asSxrs4L4d2RjKpfiufBAGpkqFV5p2J8aw
+cJ7Wh3/1mMo+biTtuemHtWf4XfWmXv99ltSEVe8PpMYQ+FjNUHDzEZMS5K39em+V
+EOC7GsE+SHHF6lgjH2BtDcpkimbU9uROnGeIWtpRr+PNMu/yhFLUCxe7tf4yffIJ
+NIAL3RFcRhLj0xCbL3fd5DbQP4eB68k9pLHwYxpKba7DDmH0aMstvk5xrpphdHAP
+p03VbE6ZThKxA828yb2jWtumDhoYRlkHs2KrVufUPA411mUE+A53pwqBse/KM9Iq
+Pidc+TwMwy2nByRB9WFyyGS08wqhewpwp8mwIOejvRf+3yi+CGHM2Xi4bTmEqVL+
+Jm1D5W49O5/j1T6HyVPGsyH/0QgYwg2IVZwL5Jfy9w3974jTV3QAcCBafR9hcZCS
+S2wOIo0ckRI0APw6DQSFMyBrNs9rWy72Ixu9RC1GtzCCn5OaMRUM9FaqjRnTKX4m
+grWsU8i35fI=
+=ib96
 -END PGP PUBLIC KEY BLOCK-
+
\ No newline at end of file
diff --git a/puppet/modules/apt/manifests/init.pp 
b/puppet/modules/apt/manifests/init.pp
index a7586e6..5af3c83 100644
--- a/puppet/modules/apt/manifests/init.pp
+++ b/puppet/modules/apt/manifests/init.pp
@@ -34,7 +34,7 @@
 apt::repository { 'wikimedia':
 uri => 'https://apt.wikimedia.org/wikimedia',
 dist=> "${::lsbdistcodename}-wikimedia",
-components  => 'main backports thirdparty',
+components  => 'main',
 keyfile => 'puppet:///modules/apt/wikimedia-pubkey.asc',
 comment_old => true,
 }

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

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: nodejs: Switch to jessie apt repo

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393498 )

Change subject: nodejs: Switch to jessie apt repo
..

nodejs: Switch to jessie apt repo

Bug: T181354
Change-Id: I3c95bc017b12e91809888055fbdda9a8dac14b49
---
M puppet/modules/npm/files/nodesource.sources.list
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/puppet/modules/npm/files/nodesource.sources.list 
b/puppet/modules/npm/files/nodesource.sources.list
index 69ce671..d027f78 100644
--- a/puppet/modules/npm/files/nodesource.sources.list
+++ b/puppet/modules/npm/files/nodesource.sources.list
@@ -1,2 +1,2 @@
-deb https://deb.nodesource.com/node_6.x jessie main
-deb-src https://deb.nodesource.com/node_6.x jessie main
+deb https://deb.nodesource.com/node_6.x stretch main
+deb-src https://deb.nodesource.com/node_6.x stretch main

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: type safe comparisons

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393496 )

Change subject: puppet4: type safe comparisons
..

puppet4: type safe comparisons

Puppet4 is strict about argument type matching when making comparisons.
Use data type comparisons to either replace or guard string comparisons.

Bug: T181354
Change-Id: I129f50036c5afbb28ce7121b8b51b6e3b9147dee
---
M puppet/modules/apache/manifests/conf.pp
M puppet/modules/env/manifests/profile_script.pp
M puppet/modules/mediawiki/manifests/settings.pp
M puppet/modules/motd/manifests/script.pp
M puppet/modules/rsyslog/manifests/conf.pp
5 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/96/393496/1

diff --git a/puppet/modules/apache/manifests/conf.pp 
b/puppet/modules/apache/manifests/conf.pp
index 9c14849..9172f01 100644
--- a/puppet/modules/apache/manifests/conf.pp
+++ b/puppet/modules/apache/manifests/conf.pp
@@ -45,7 +45,7 @@
 ) {
 include ::apache
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail('"priority" must be between 0 - 99')
 }
 if $ensure !~ /^(present|absent)$/ {
diff --git a/puppet/modules/env/manifests/profile_script.pp 
b/puppet/modules/env/manifests/profile_script.pp
index 886f3d0..c0bf3e4 100644
--- a/puppet/modules/env/manifests/profile_script.pp
+++ b/puppet/modules/env/manifests/profile_script.pp
@@ -36,7 +36,7 @@
 ) {
 include ::env
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail('"priority" must be between 0 - 99')
 }
 if $ensure !~ /^(present|absent)$/ {
diff --git a/puppet/modules/mediawiki/manifests/settings.pp 
b/puppet/modules/mediawiki/manifests/settings.pp
index b78293b..bde54d5 100644
--- a/puppet/modules/mediawiki/manifests/settings.pp
+++ b/puppet/modules/mediawiki/manifests/settings.pp
@@ -113,7 +113,7 @@
 
 if $wiki_name == $::mediawiki::wiki_name {
 $db_name = $::mediawiki::db_name
-} elsif $wiki_name =~ /wiki$/ {
+} elsif $wiki_name =~ String and $wiki_name =~ /wiki$/ {
 $db_name = $wiki_name
 } else {
 $db_name = "${wiki_name}wiki"
diff --git a/puppet/modules/motd/manifests/script.pp 
b/puppet/modules/motd/manifests/script.pp
index 5e07efd..fd76142 100644
--- a/puppet/modules/motd/manifests/script.pp
+++ b/puppet/modules/motd/manifests/script.pp
@@ -33,7 +33,7 @@
 ) {
 include ::motd
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail('"priority" must be between 0 - 99')
 }
 if $ensure !~ /^(present|absent)$/ {
diff --git a/puppet/modules/rsyslog/manifests/conf.pp 
b/puppet/modules/rsyslog/manifests/conf.pp
index 6f5f7c6..54d3669 100644
--- a/puppet/modules/rsyslog/manifests/conf.pp
+++ b/puppet/modules/rsyslog/manifests/conf.pp
@@ -34,7 +34,7 @@
 ) {
 include ::rsyslog
 
-if $priority !~ /^\d?\d$/ {
+if $priority !~ Integer[0, 99] {
 fail("'priority' must be an integer between 0 - 99 (got: 
${priority}).")
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: php7.0: Convert php5 to php7.0

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393499 )

Change subject: php7.0: Convert php5 to php7.0
..

php7.0: Convert php5 to php7.0

Most of the changes are straight forward replacements of "php5" with
"php7.0" in package names. The php5-xhprof extension is replaced with
php-tideways (). The
php5 session cleanup script patches that we had added are also removed.

Bug: T181354
Change-Id: I33e74217203c037c29d6389c29f367e639131ba3
---
M puppet/hieradata/common.yaml
M puppet/modules/apache/files/envvars
M puppet/modules/apache/manifests/init.pp
D puppet/modules/apache/manifests/mod/php5.pp
A puppet/modules/apache/manifests/mod/php70.pp
M puppet/modules/crm/manifests/civicrm.pp
M puppet/modules/mediawiki/manifests/apache.pp
R puppet/modules/mediawiki/templates/mediawiki-php7-site.erb
M puppet/modules/mediawiki/templates/multiwiki/alldbs.erb
M puppet/modules/mediawiki/templates/multiwiki/multiversion-install.erb
M puppet/modules/mediawiki/templates/multiwiki/mwscript.erb
M puppet/modules/mediawiki/templates/mwrepl/mwrepl.erb
M puppet/modules/mediawiki/templates/systemd/jobchron.erb
M puppet/modules/mediawiki/templates/systemd/jobrunner.erb
M puppet/modules/memcached/manifests/php.pp
M puppet/modules/phabricator/manifests/init.pp
D puppet/modules/php/files/php5.cron.d
D puppet/modules/php/files/sessionclean
M puppet/modules/php/manifests/composer.pp
M puppet/modules/php/manifests/ini.pp
M puppet/modules/php/manifests/init.pp
M puppet/modules/php/manifests/remote_debug.pp
D puppet/modules/php/manifests/sessionclean.pp
M puppet/modules/php/manifests/xhprof.pp
M puppet/modules/php/templates/prune_php_ini_files.bash.erb
M puppet/modules/redis/manifests/php.pp
M puppet/modules/role/manifests/fss.pp
M puppet/modules/role/manifests/ldapauth.pp
M puppet/modules/role/manifests/mediawiki.pp
M puppet/modules/role/manifests/zend.pp
30 files changed, 70 insertions(+), 164 deletions(-)


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

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index fdf9553..3eb1b97 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -225,7 +225,7 @@
 mediawiki::branch: master
 
 mediawiki::apache::docroot: "%{hiera('apache::docroot')}"
-mediawiki::apache::php5_site_name: "php5%{hiera('mwv::tld')}"
+mediawiki::apache::php7_site_name: "php7%{hiera('mwv::tld')}"
 
 mediawiki::jobrunner::enable: true
 mediawiki::jobrunner::dir: "%{hiera('mwv::services_dir')}/jobrunner"
@@ -287,8 +287,6 @@
 phabricator::log_dir: "/vagrant/logs/phd"
 phabricator::vhost_name: "phabricator%{hiera('mwv::tld')}"
 phabricator::remote: https://secure.phabricator.com/diffusion/P/phabricator.git
-
-php::sessionclean::ensure: present
 
 php::xhprof::profile_storage_dir: /vagrant/profiles
 
diff --git a/puppet/modules/apache/files/envvars 
b/puppet/modules/apache/files/envvars
index 430884f..27823ea 100644
--- a/puppet/modules/apache/files/envvars
+++ b/puppet/modules/apache/files/envvars
@@ -15,9 +15,9 @@
   . "$envfile"
 done
 
-for ini in /etc/php5/conf.d/*.ini; do
+for ini in /etc/php/7.0/conf.d/*.ini; do
   [ -r "$ini" ] || break
-  mv "$ini" /etc/php5/mods-available
-  /usr/sbin/php5enmod -s ALL "$(basename $ini .ini)"
+  mv "$ini" /etc/php/7.0/mods-available
+  /usr/sbin/phpenmod -s ALL "$(basename $ini .ini)"
 done
-rm -rf /etc/php5/conf.d
+rm -rf /etc/php/7.0/conf.d
diff --git a/puppet/modules/apache/manifests/init.pp 
b/puppet/modules/apache/manifests/init.pp
index 6d6de02..0327cd5 100644
--- a/puppet/modules/apache/manifests/init.pp
+++ b/puppet/modules/apache/manifests/init.pp
@@ -14,7 +14,7 @@
 ensure  => present,
 }
 
-include apache::mod::php5
+include apache::mod::php70
 include apache::mod::access_compat
 
 file { '/etc/apache2/ports.conf':
diff --git a/puppet/modules/apache/manifests/mod/php5.pp 
b/puppet/modules/apache/manifests/mod/php5.pp
deleted file mode 100644
index 3da7d3b..000
--- a/puppet/modules/apache/manifests/mod/php5.pp
+++ /dev/null
@@ -1,8 +0,0 @@
-# == Class: apache::mod::php5
-#
-class apache::mod::php5 {
-package { 'libapache2-mod-php5': }
-apache::mod_conf { 'php5':
-require => Package['libapache2-mod-php5'],
-}
-}
diff --git a/puppet/modules/apache/manifests/mod/php70.pp 
b/puppet/modules/apache/manifests/mod/php70.pp
new file mode 100644
index 000..ff85eb8
--- /dev/null
+++ b/puppet/modules/apache/manifests/mod/php70.pp
@@ -0,0 +1,8 @@
+# == Class: apache::mod::php70
+#
+class apache::mod::php70 {
+package { 'libapache2-mod-php7.0': }
+apache::mod_conf { 'php7.0':
+require => Package['libapache2-mod-php7.0'],
+}
+}
diff --git a/puppet/modules/crm/manifests/civicrm.pp 
b/puppet/modules/crm/manifests/civicrm.pp
index df56792..3b2ed8a 100644
--- 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: s/trusted/can_trust/

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393495 )

Change subject: puppet4: s/trusted/can_trust/
..

puppet4: s/trusted/can_trust/

'trusted' is a reserved variable name in Puppet4

Bug: T181354
Change-Id: If4a5a9673ac2dbb7d955c6783c742c51e0d39082
---
M puppet/modules/apt/manifests/init.pp
M puppet/modules/apt/manifests/repository.pp
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/95/393495/1

diff --git a/puppet/modules/apt/manifests/init.pp 
b/puppet/modules/apt/manifests/init.pp
index f294535..a7586e6 100644
--- a/puppet/modules/apt/manifests/init.pp
+++ b/puppet/modules/apt/manifests/init.pp
@@ -51,7 +51,7 @@
 uri=> 'https://mwv-apt.wmflabs.org/repo',
 dist   => "${::lsbdistcodename}-mwv-apt",
 components => 'main',
-trusted=> true,
+can_trust  => true,
 source => false,
 }
 
diff --git a/puppet/modules/apt/manifests/repository.pp 
b/puppet/modules/apt/manifests/repository.pp
index ee11914..23a6c12 100644
--- a/puppet/modules/apt/manifests/repository.pp
+++ b/puppet/modules/apt/manifests/repository.pp
@@ -26,7 +26,7 @@
 # [*keyfile*]
 #   GPG key used to sign packages in this repo. Default undef.
 #
-# [*trusted*]
+# [*can_trust*]
 #   Should this repo be trusted for installing unsinged packages?
 #   Default false.
 #
@@ -42,11 +42,11 @@
 $components,
 $source  = true,
 $keyfile = undef,
-$trusted = false,
+$can_trust   = false,
 $comment_old = false,
 $ensure  = 'present',
 ) {
-$trust = $trusted ? {
+$trust = $can_trust ? {
 true=> '[trusted=yes] ',
 default => '',
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: wmflib: Copy from 626a7ccc09 upstream

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393494 )

Change subject: wmflib: Copy from 626a7ccc09 upstream
..

wmflib: Copy from 626a7ccc09 upstream

Copy in the upstream operations/puppet.git wmflib module@ 626a7ccc09

Bug: T181354
Change-Id: I1d0fd5be73fccb606a699abefc2dfd101aacee32
---
M puppet/modules/wmflib/README.md
M puppet/modules/wmflib/Rakefile
M puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/mwyaml_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/nuyaml_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/proxy_backend.rb
M puppet/modules/wmflib/lib/hiera/backend/role_backend.rb
M puppet/modules/wmflib/lib/hiera/httpcache.rb
M puppet/modules/wmflib/lib/hiera/mwcache.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/conftool.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/cron_splay.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ensure_mounted.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/get_clusters.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/hash_deselect_re.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/hash_select_re.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/htpasswd.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/init_template.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ipresolve.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ordered_yaml.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/os_version.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/puppet_ssldir.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/require_package.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/requires_os.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/role.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/shell_exports.rb
M puppet/modules/wmflib/lib/puppet/parser/functions/ssl_ciphersuite.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/systemd_template.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/sysvinit_template.rb
A puppet/modules/wmflib/lib/puppet/parser/functions/upstart_template.rb
A 
puppet/modules/wmflib/spec/fixtures/modules/foo/templates/initscripts/fooservice.systemd.erb
M puppet/modules/wmflib/spec/functions/conftool_spec.rb
M puppet/modules/wmflib/spec/functions/ensure_mounted_spec.rb
A puppet/modules/wmflib/spec/functions/init_template_spec.rb
M puppet/modules/wmflib/spec/functions/ipresolve_spec.rb
A puppet/modules/wmflib/spec/functions/os_version_spec.rb
M puppet/modules/wmflib/spec/functions/role_spec.rb
M puppet/modules/wmflib/spec/hiera/proxy_backend_spec.rb
M puppet/modules/wmflib/spec/hiera/role_backend_spec.rb
38 files changed, 348 insertions(+), 215 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/94/393494/1

diff --git a/puppet/modules/wmflib/README.md b/puppet/modules/wmflib/README.md
index f6ab3fe..baea3fb 100644
--- a/puppet/modules/wmflib/README.md
+++ b/puppet/modules/wmflib/README.md
@@ -231,8 +231,8 @@
 
 ### Examples
 
-# True if Ubuntu Trusty or newer or Debian Jessie or newer
-os_version('ubuntu >= trusty || debian >= Jessie')
+# True if Ubuntu Trusty or newer or Debian jessie or newer
+os_version('ubuntu >= trusty || debian >= jessie')
 
 # True if exactly Debian Jessie
 os_version('debian jessie')
diff --git a/puppet/modules/wmflib/Rakefile b/puppet/modules/wmflib/Rakefile
index a0c3b79..cd3d379 100644
--- a/puppet/modules/wmflib/Rakefile
+++ b/puppet/modules/wmflib/Rakefile
@@ -1,37 +1 @@
-require 'rake'
-require 'fileutils'
-
-require 'rspec/core/rake_task'
-
-modulename = File.basename(File.expand_path(File.dirname(__FILE__)))
-
-symlinks = { 'spec/fixtures/modules/%s/files' % modulename => 
'../../../../files',
- 'spec/fixtures/modules/%s/manifests' % modulename => 
'../../../../manifests',
- 'spec/fixtures/modules/%s/templates' % modulename => 
'../../../../templates',
-   }
-
-
-task :setup do
-  FileUtils.mkdir_p('spec/fixtures/modules/%s' % modulename)
-  symlinks.each do |x|
-if !File.exist?(x[0])
-  FileUtils.ln_s(x[1], x[0])
-end
-  end
-end
-
-task :teardown do
-  symlinks.each { |x| FileUtils.rm(x[0], :force => true) }
-  FileUtils.rmdir('spec/fixtures/modules/%s' % modulename)
-  FileUtils.rmdir('spec/fixtures/modules')
-end
-
-RSpec::Core::RakeTask.new(:realspec) do |t|
-  t.fail_on_error = false
-  t.pattern = 'spec/*/*_spec.rb'
-end
-
-task :spec_standalone => [ :setup, :realspec, :teardown]
-
-task :default => :spec do
-end
+require 'puppetlabs_spec_helper/rake_tasks'
diff --git a/puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb 
b/puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb
index fae9f51..3106cf5 100644
--- a/puppet/modules/wmflib/lib/hiera/backend/httpyaml_backend.rb
+++ 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: gerrit: configure for feature branch development

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393490 )

Change subject: gerrit: configure for feature branch development
..

gerrit: configure for feature branch development

Bug: T181353
Change-Id: I3acb4cffd286246d6ba52e259ae42fa99a8bac62
---
M .gitreview
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/90/393490/1

diff --git a/.gitreview b/.gitreview
index 94edce0..f9039ba 100644
--- a/.gitreview
+++ b/.gitreview
@@ -2,5 +2,5 @@
 host=gerrit.wikimedia.org
 port=29418
 project=mediawiki/vagrant.git
-defaultbranch=master
+defaultbranch=stretch-migration
 defaultrebase=0

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: Update $::LOAD_* for Puppet4 compatibility

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393493 )

Change subject: puppet4: Update $::LOAD_* for Puppet4 compatibility
..

puppet4: Update $::LOAD_* for Puppet4 compatibility

Puppet4 requires variables to begin with a lowercase letter, so change
our "constants" from uppercase to lowercase.

Bug: T181354
Change-Id: I753a57d55636c5a398d2b80cfe976946367d3c51
---
M puppet/manifests/site.pp
M puppet/modules/mediawiki/manifests/wiki.pp
M puppet/modules/role/manifests/articlecreationworkflow.pp
M puppet/modules/role/manifests/articleplaceholder.pp
M puppet/modules/role/manifests/betafeatures.pp
M puppet/modules/role/manifests/cldr.pp
M puppet/modules/role/manifests/commons.pp
M puppet/modules/role/manifests/education.pp
M puppet/modules/role/manifests/eventbus.pp
M puppet/modules/role/manifests/eventlogging.pp
M puppet/modules/role/manifests/flow.pp
M puppet/modules/role/manifests/gadgets2.pp
M puppet/modules/role/manifests/geodata.pp
M puppet/modules/role/manifests/geodata_elastic.pp
M puppet/modules/role/manifests/jsonconfig.pp
M puppet/modules/role/manifests/offline.pp
M puppet/modules/role/manifests/poolcounter.pp
M puppet/modules/role/manifests/questycaptcha.pp
M puppet/modules/role/manifests/restbase.pp
M puppet/modules/role/manifests/semanticmediawiki.pp
M puppet/modules/role/manifests/visualeditor.pp
M puppet/modules/role/manifests/wikidata.pp
M puppet/modules/role/manifests/zero.pp
23 files changed, 30 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/93/393493/1

diff --git a/puppet/manifests/site.pp b/puppet/manifests/site.pp
index e67bd18..a71ba7f 100644
--- a/puppet/manifests/site.pp
+++ b/puppet/manifests/site.pp
@@ -17,11 +17,11 @@
 # Human-readable constants which may be used in lieu of literal numbers
 # for specifying loading priority of resource types which support this
 # notion (like mediawiki::extension, mediawiki::settings, and mediawiki::wiki).
-$LOAD_FIRST  = 0
-$LOAD_EARLY  = 5
-$LOAD_NORMAL = 10
-$LOAD_LATER  = 15
-$LOAD_LAST   = 20
+$load_first  = 0
+$load_early  = 5
+$load_normal = 10
+$load_later  = 15
+$load_last   = 20
 
 # Declares a default search path for executables, allowing the path to
 # be omitted from individual resources. Also configures Puppet to log
diff --git a/puppet/modules/mediawiki/manifests/wiki.pp 
b/puppet/modules/mediawiki/manifests/wiki.pp
index dc0fab8..ca75d3e 100644
--- a/puppet/modules/mediawiki/manifests/wiki.pp
+++ b/puppet/modules/mediawiki/manifests/wiki.pp
@@ -65,7 +65,7 @@
 #
 # [*priority*]
 #   Position of this wiki in foreachwiki.  Uses the scale of
-#   the LOAD_ constants from site.php. (default: $LOAD_NORMAL)
+#   the $::load_* constants from site.php. (default: $::load_normal)
 #
 # [*wgconf*]
 #   Hash of extra wgConf settings for this wiki. One use case for this is
@@ -102,7 +102,7 @@
 $upload_path  = "/${title}images",
 $server_url   = 
"http://${title}${::mediawiki::multiwiki::base_domain}${::port_fragment};,
 $primary_wiki = false,
-$priority = $::LOAD_NORMAL,
+$priority = $::load_normal,
 $wgconf   = {},
 ) {
 include ::mwv
diff --git a/puppet/modules/role/manifests/articlecreationworkflow.pp 
b/puppet/modules/role/manifests/articlecreationworkflow.pp
index cd31439..7641e58 100644
--- a/puppet/modules/role/manifests/articlecreationworkflow.pp
+++ b/puppet/modules/role/manifests/articlecreationworkflow.pp
@@ -4,6 +4,6 @@
 # [1] https://www.mediawiki.org/wiki/Extension:ArticleCreationWorkflow
 class role::articlecreationworkflow {
   mediawiki::extension { 'ArticleCreationWorkflow':
-  priority => $::LOAD_EARLY, # Must load before VisualEditor
+  priority => $::load_early, # Must load before VisualEditor
   }
 }
diff --git a/puppet/modules/role/manifests/articleplaceholder.pp 
b/puppet/modules/role/manifests/articleplaceholder.pp
index 606b400..58cd876 100644
--- a/puppet/modules/role/manifests/articleplaceholder.pp
+++ b/puppet/modules/role/manifests/articleplaceholder.pp
@@ -14,7 +14,7 @@
 values   => {
 "wgWBRepoSettings['allowEntityImport']" => true,
 },
-priority => $::LOAD_LATER,
+priority => $::load_later,
 }
 
 mediawiki::import::dump { 'ImportImageProperty':
diff --git a/puppet/modules/role/manifests/betafeatures.pp 
b/puppet/modules/role/manifests/betafeatures.pp
index 3d10cb2..f3fb49f 100644
--- a/puppet/modules/role/manifests/betafeatures.pp
+++ b/puppet/modules/role/manifests/betafeatures.pp
@@ -3,6 +3,6 @@
 class role::betafeatures {
 mediawiki::extension { 'BetaFeatures':
 needs_update => true,
-priority => $::LOAD_EARLY,
+priority => $::load_early,
 }
 }
diff --git a/puppet/modules/role/manifests/cldr.pp 
b/puppet/modules/role/manifests/cldr.pp
index 039893e..2d7e2db 100644
--- a/puppet/modules/role/manifests/cldr.pp

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: Switch base image to Debian Stretch

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393491 )

Change subject: Switch base image to Debian Stretch
..

Switch base image to Debian Stretch

Bug: T181354
Change-Id: Iab5e0647b9e71c91d0c39c5a043ea45e89eb4d44
---
M Vagrantfile
1 file changed, 10 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/91/393491/1

diff --git a/Vagrantfile b/Vagrantfile
index f39293e..834298c 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -57,13 +57,13 @@
 
   # Default VirtualBox provider
   config.vm.provider :virtualbox do |_vb, override|
-override.vm.box = 'debian/contrib-jessie64'
+override.vm.box = 'debian/contrib-stretch64'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
   # VMWare Fusion provider. Enable with `--provider=vmware_fusion`
   config.vm.provider :vmware_fusion do |_vw, override|
-override.vm.box = 'dhoppe/debian-8.8.0-amd64-nocm'
+override.vm.box = 'gneric/debian9'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
@@ -77,14 +77,14 @@
   # NAT and port redirection are not automatically set up for you.
   #
   config.vm.provider :hyperv do |_hyperv, override|
-override.vm.box = 'ira/leap'
+override.vm.box = 'generic/debian9'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
   # LXC provider. Enable wtih `--provider=lxc`
   # Requires vagrant-lxc plugin and Vagrant 1.7+
   config.vm.provider :lxc do |_lxc, override|
-override.vm.box = 'LEAP/jessie'
+override.vm.box = 'debian/stretch64'
   end
 
   # Parallels provider. Enable with `--provider=parallels`
@@ -96,16 +96,15 @@
   # Note that port forwarding works via localhost but not via external
   # interfaces of the host machine by default...
   config.vm.provider :parallels do |_parallels, override|
-override.vm.box = 'bento/debian-8.9'
+override.vm.box = 'kolaephant/debian9-amd64'
 override.vm.network :private_network, ip: settings[:static_ip]
   end
 
   # libvirt (KVM/QEMU) provider.  Enable with `--provider=libvirt`.
-  # config.vm.provider :libvirt do |_libvirt, override|
-  #   override.vm.box = 'trusty-cloud'
-
-  #   override.vm.network :private_network, ip: settings[:static_ip]
-  # end
+  config.vm.provider :libvirt do |_libvirt, override|
+override.vm.box = 'debian/stretch64'
+override.vm.network :private_network, ip: settings[:static_ip]
+  end
 
   config.vm.network :forwarded_port,
 guest: settings[:http_port], host: settings[:http_port], host_ip: 
settings[:host_ip],
@@ -210,7 +209,7 @@
 
   config.vm.provision :lsb_check do |lsb|
 lsb.vendor = 'Debian'
-lsb.version = '^8'
+lsb.version = '^9'
   end
 
   config.vm.provision :mediawiki_reload if mwv.reload?

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: apt: Remove jessie-backports pinning

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393497 )

Change subject: apt: Remove jessie-backports pinning
..

apt: Remove jessie-backports pinning

Backports are not needed (yet) on stretch.

Bug: T181354
Change-Id: I5c5bc73a9e38afe71aea3a0b39b2cb6b30e08bb9
---
M puppet/modules/apt/manifests/ppa.pp
M puppet/modules/git/manifests/init.pp
M puppet/modules/role/manifests/horizon.pp
M puppet/modules/role/manifests/keystone.pp
M puppet/modules/swift/manifests/init.pp
M puppet/modules/thumbor/manifests/init.pp
6 files changed, 2 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/97/393497/1

diff --git a/puppet/modules/apt/manifests/ppa.pp 
b/puppet/modules/apt/manifests/ppa.pp
index 67e15ce..260cc93 100644
--- a/puppet/modules/apt/manifests/ppa.pp
+++ b/puppet/modules/apt/manifests/ppa.pp
@@ -33,7 +33,7 @@
 $onlyif  = "/usr/bin/test -e ${listfile}"
 } else {
 # PPA's are for Ubuntu, not Debian but may work if we hack the distro
-# name to be a modern Ubuntu LTS instead of jessie.
+# name to be a modern Ubuntu LTS instead of stretch.
 $command = "/usr/bin/add-apt-repository --yes ppa:${ppa} && /bin/sed 
-i 's/${::lsbdistcodename}/xenial/g' ${listfile} && /usr/bin/apt-get update"
 $onlyif  = "/usr/bin/test ! -e ${listfile}"
 }
diff --git a/puppet/modules/git/manifests/init.pp 
b/puppet/modules/git/manifests/init.pp
index acc39e5..ce8663d 100644
--- a/puppet/modules/git/manifests/init.pp
+++ b/puppet/modules/git/manifests/init.pp
@@ -32,15 +32,9 @@
 'git',
 'git-man',
 ]
-apt::pin { 'git':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1001',
-}
 
 package { $packages:
 ensure  => 'present',
-require => Apt::Pin['git'],
 }
 
 package { 'git-review':
diff --git a/puppet/modules/role/manifests/horizon.pp 
b/puppet/modules/role/manifests/horizon.pp
index b3c7324..739292e 100644
--- a/puppet/modules/role/manifests/horizon.pp
+++ b/puppet/modules/role/manifests/horizon.pp
@@ -94,15 +94,8 @@
   'python-xstatic-term.js',
 ]
 
-apt::pin { 'horizon':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1001',
-}
-
 package { $packages:
 ensure  => 'present',
-require => Apt::Pin['horizon'],
 }
 
 file { "${log_dir}/horizon":
diff --git a/puppet/modules/role/manifests/keystone.pp 
b/puppet/modules/role/manifests/keystone.pp
index bf21d54..0bc0ff2 100644
--- a/puppet/modules/role/manifests/keystone.pp
+++ b/puppet/modules/role/manifests/keystone.pp
@@ -68,15 +68,8 @@
 'websockify',
 ]
 
-apt::pin { 'keystone':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1001',
-}
-
 package { $packages:
 ensure  => 'present',
-require => Apt::Pin['keystone'],
 }
 
 mysql::db { 'keystone':
diff --git a/puppet/modules/swift/manifests/init.pp 
b/puppet/modules/swift/manifests/init.pp
index ceac5fa..51c3bfc 100644
--- a/puppet/modules/swift/manifests/init.pp
+++ b/puppet/modules/swift/manifests/init.pp
@@ -62,23 +62,8 @@
 'swift*'
 ]
 
-apt::pin { 'swift-python-backports':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1000',
-}
-
-package { ['swift', 'swift-account', 'swift-container', 'swift-object', 
'swift-proxy', 'python-webob']:
+package { ['swift', 'swift-account', 'swift-container', 'swift-object', 
'swift-proxy', 'python-webob', 'python-swiftclient']:
 ensure  => 'present',
-require => [
-Apt::Pin['swift-python-backports'],
-],
-}
-
-exec { 'ins-apt-python-swiftclient':
-command => '/usr/bin/apt-get update && /usr/bin/apt-get install -y 
--force-yes -t jessie-backports "python-swiftclient"',
-environment => 'DEBIAN_FRONTEND=noninteractive',
-unless  => '/usr/bin/dpkg -l python-swiftclient',
 }
 
 user { 'swift':
diff --git a/puppet/modules/thumbor/manifests/init.pp 
b/puppet/modules/thumbor/manifests/init.pp
index d27ef9b..784e4e7 100644
--- a/puppet/modules/thumbor/manifests/init.pp
+++ b/puppet/modules/thumbor/manifests/init.pp
@@ -32,12 +32,6 @@
 'python-pil',
 ]
 
-apt::pin { 'thumbor-python-backports':
-package  => join(sort($packages), ' '),
-pin  => 'release a=jessie-backports',
-priority => '1000',
-}
-
 package { 'raven':
 provider => 'pip',
 }
@@ -45,9 +39,6 @@
 package { 'python-thumbor-wikimedia':
 ensure  => 'present',
 notify  => 

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: puppet4: Change Vagrantfile for Puppet4

2017-11-26 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393492 )

Change subject: puppet4: Change Vagrantfile for Puppet4
..

puppet4: Change Vagrantfile for Puppet4

Vagrant will use Puppet4 command semantics when puppet.environment_path
is set in the Vagrantfile.

Bug: T181354
Change-Id: I369cae97aa92d2d1447241dcfb4a5bc73174b6f9
---
M Vagrantfile
A puppet/environments/vagrant/.gitignore
2 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/92/393492/1

diff --git a/Vagrantfile b/Vagrantfile
index 834298c..87c2a0c 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -226,6 +226,9 @@
 puppet.manifests_path = [:guest, '/vagrant/puppet/manifests']
 puppet.manifest_file = 'site.pp'
 
+puppet.environment_path = [:guest, '/vagrant/puppet/environments']
+puppet.environment = 'vagrant'
+
 puppet.options = [
   '--modulepath', '/vagrant/puppet/modules',
   '--hiera_config', '/vagrant/puppet/hiera.yaml',
diff --git a/puppet/environments/vagrant/.gitignore 
b/puppet/environments/vagrant/.gitignore
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/puppet/environments/vagrant/.gitignore

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...EventLogging[master]: RemoteSchema: Use SchemaApiUrl instead of DBname in cache key

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

Change subject: RemoteSchema: Use SchemaApiUrl instead of DBname in cache key
..


RemoteSchema: Use SchemaApiUrl instead of DBname in cache key

The RemoteSchema class fetches content from the SchemaApiUrl.
The DBname is not used and it doesn't seem right to use it
in the cache key as such. I suspect this might be a left-over
from a time where it used cross-wiki DB connections (or tried to).

* Update tests to use '::class' syntax for class names.
* Update code to use makeGlobalKey() instead of manually creating
  a key that is both unescaped and unnamescaped (all keys are expected
  to start with a db name or 'global', this one started with 'schema').
* Update key to be less generic ('eventlogging-schema' instead
  of just 'schema').

Change-Id: I43ceaf3a9132bcdf7e3a1028cfc03a676aecc051
---
M includes/RemoteSchema.php
M tests/phpunit/RemoteSchemaTest.php
2 files changed, 26 insertions(+), 16 deletions(-)

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



diff --git a/includes/RemoteSchema.php b/includes/RemoteSchema.php
index 0eeaec9..873eab6 100644
--- a/includes/RemoteSchema.php
+++ b/includes/RemoteSchema.php
@@ -22,13 +22,17 @@
 * @param Http $http (optional) HTTP client.
 */
public function __construct( $title, $revision, $cache = null, $http = 
null ) {
-   global $wgEventLoggingDBname;
+   global $wgEventLoggingSchemaApiUri;
 
$this->title = $title;
$this->revision = $revision;
$this->cache = $cache ?: wfGetCache( CACHE_ANYTHING );
$this->http = $http ?: new Http();
-   $this->key = 
"schema:{$wgEventLoggingDBname}:{$title}:{$revision}";
+   $this->key = $this->cache->makeGlobalKey(
+   'eventlogging-schema',
+   $wgEventLoggingSchemaApiUri,
+   $revision
+   );
}
 
/**
diff --git a/tests/phpunit/RemoteSchemaTest.php 
b/tests/phpunit/RemoteSchemaTest.php
index be9c877..d123ec4 100644
--- a/tests/phpunit/RemoteSchemaTest.php
+++ b/tests/phpunit/RemoteSchemaTest.php
@@ -14,7 +14,7 @@
  */
 class RemoteSchemaTest extends MediaWikiTestCase {
 
-   /** @var PHPUnit_Framework_MockObject_MockObject */
+   /** @var BagOStuff|PHPUnit_Framework_MockObject_MockObject */
private $cache;
/** @var PHPUnit_Framework_MockObject_MockObject */
private $http;
@@ -24,14 +24,26 @@
public $statusSchema = [ 'status' => [ 'type' => 'string' ] ];
 
function setUp() {
+   global $wgEventLoggingSchemaApiUri;
+
parent::setUp();
 
$this->cache = $this
-   ->getMockBuilder( 'MemcachedPhpBagOStuff' )
+   ->getMockBuilder( MemcachedPhpBagOStuff::class )
->disableOriginalConstructor()
->getMock();
 
-   $this->http = $this->getMock( 'stdClass', [ 'get' ] );
+   $this->cache
+   ->expects( $this->once() )
+   ->method( 'makeGlobalKey' )
+   ->with(
+   'eventlogging-schema',
+   $wgEventLoggingSchemaApiUri,
+   99
+   )
+   ->willReturn( 'eventlogging-schema:--:99' );
+
+   $this->http = $this->getMock( stdClass::class, [ 'get' ] );
$this->schema = new RemoteSchema( 'Test', 99, $this->cache, 
$this->http );
}
 
@@ -40,13 +52,11 @@
 * This is the most common scenario.
 */
function testSchemaInCache() {
-   global $wgEventLoggingDBname;
-
// If the revision was in memcached...
$this->cache
->expects( $this->once() )
->method( 'get' )
-   ->with( $this->equalTo( 
"schema:{$wgEventLoggingDBname}:Test:99" ) )
+   ->with( $this->equalTo( 'eventlogging-schema:--:99' ) )
->will( $this->returnValue( $this->statusSchema ) );
 
// ...no HTTP call will need to be made
@@ -83,20 +93,18 @@
 * be retrieved via HTTP instead.
 */
function testSchemaNotInCacheDoUpdate() {
-   global $wgEventLoggingDBname;
-
// If the revision was not in memcached...
$this->cache
->expects( $this->once() )
->method( 'get' )
-   ->with( $this->equalTo( 
"schema:{$wgEventLoggingDBname}:Test:99" ) )
+   ->with( $this->equalTo( 'eventlogging-schema:--:99' ) )
->will( 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: objectcache: add "staleTTL" into WANObjectCache::getWithSetC...

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

Change subject: objectcache: add "staleTTL" into 
WANObjectCache::getWithSetCallback()
..


objectcache: add "staleTTL" into WANObjectCache::getWithSetCallback()

This simply involves passing it through to the set() call

Also added some related commons to adaptiveTTL() involving
usage of this option.

Change-Id: Id5833a5d4efb6cad2eb646832e5b0188e86e12fc
---
M includes/libs/objectcache/HashBagOStuff.php
M includes/libs/objectcache/WANObjectCache.php
M tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
3 files changed, 93 insertions(+), 2 deletions(-)

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



diff --git a/includes/libs/objectcache/HashBagOStuff.php 
b/includes/libs/objectcache/HashBagOStuff.php
index 6d583da..f8e3b17 100644
--- a/includes/libs/objectcache/HashBagOStuff.php
+++ b/includes/libs/objectcache/HashBagOStuff.php
@@ -52,7 +52,7 @@
 
protected function expire( $key ) {
$et = $this->bag[$key][self::KEY_EXP];
-   if ( $et == self::TTL_INDEFINITE || $et > time() ) {
+   if ( $et == self::TTL_INDEFINITE || $et > 
$this->getCurrentTime() ) {
return false;
}
 
@@ -115,4 +115,8 @@
public function clear() {
$this->bag = [];
}
+
+   protected function getCurrentTime() {
+   return time();
+   }
 }
diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index e63b32e..723ccc0 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -135,7 +135,7 @@
const TTL_LAGGED = 30;
/** Idiom for delete() for "no hold-off" */
const HOLDOFF_NONE = 0;
-   /** Idiom for set() for "do not augment the storage medium TTL" */
+   /** Idiom for set()/getWithSetCallback() for "do not augment the 
storage medium TTL" */
const STALE_TTL_NONE = 0;
 
/** Idiom for getWithSetCallback() for "no minimum required as-of 
timestamp" */
@@ -868,6 +868,11 @@
 *  Default: WANObjectCache::LOW_TTL.
 *   - ageNew: Consider popularity refreshes only once a key reaches 
this age in seconds.
 *  Default: WANObjectCache::AGE_NEW.
+*   - staleTTL: Seconds to keep the key around if it is stale. This 
means that on cache
+*  miss the callback may get $oldValue/$oldAsOf values for keys 
that have already been
+*  expired for this specified time. This is useful if 
adaptiveTTL() is used on the old
+*  value's as-of time when it is verified as still being correct.
+*  Default: WANObjectCache::STALE_TTL_NONE
 * @return mixed Value found or written to the key
 * @note Options added in 1.28: version, busyValue, hotTTR, ageNew, 
pcGroup, minAsOf
 * @note Callable type hints are not used to avoid class-autoloading
@@ -957,6 +962,7 @@
protected function doGetWithSetCallback( $key, $ttl, $callback, array 
$opts, &$asOf = null ) {
$lowTTL = isset( $opts['lowTTL'] ) ? $opts['lowTTL'] : min( 
self::LOW_TTL, $ttl );
$lockTSE = isset( $opts['lockTSE'] ) ? $opts['lockTSE'] : 
self::TSE_NONE;
+   $staleTTL = isset( $opts['staleTTL'] ) ? $opts['staleTTL'] : 
self::STALE_TTL_NONE;
$checkKeys = isset( $opts['checkKeys'] ) ? $opts['checkKeys'] : 
[];
$busyValue = isset( $opts['busyValue'] ) ? $opts['busyValue'] : 
null;
$popWindow = isset( $opts['hotTTR'] ) ? $opts['hotTTR'] : 
self::HOT_TTR;
@@ -1056,6 +1062,7 @@
 
if ( $valueIsCacheable ) {
$setOpts['lockTSE'] = $lockTSE;
+   $setOpts['staleTTL'] = $staleTTL;
// Use best known "since" timestamp if not provided
$setOpts += [ 'since' => $preCallbackTime ];
// Update the cache; this will fail if the key is 
tombstoned
@@ -1496,6 +1503,46 @@
 * $ttl = $cache->adaptiveTTL( $mtime, $cache::TTL_DAY );
 * @endcode
 *
+* Another use case is when there are no applicable "last modified" 
fields in the DB,
+* and there are too many dependencies for explicit purges to be 
viable, and the rate of
+* change to relevant content is unstable, and it is highly valued to 
have the cached value
+* be as up-to-date as possible.
+*
+* Example usage:
+* @code
+* $query = "";
+* $idListFromComplexQuery = $cache->getWithSetCallback(
+* $cache->makeKey( 'complex-graph-query', $hashOfQuery ),
+* GraphQueryClass::STARTING_TTL,
+* function ( $oldValue, &$ttl, 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Reduce replication log spam from LoadBalancer

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

Change subject: Reduce replication log spam from LoadBalancer
..


Reduce replication log spam from LoadBalancer

Set the logging level there to INFO. Move the ERROR level
logging to LoadMonitor, where it will trigger only on cache
regenerations, rather than every DB connection attempt.

Change-Id: I96fd513a01601544ea30a562746c49c88f84d96d
---
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
M includes/libs/rdbms/loadmonitor/LoadMonitor.php
2 files changed, 30 insertions(+), 4 deletions(-)

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



diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index b622ddc..a67e6e9 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -189,6 +189,7 @@
} else {
$this->loadMonitorConfig = [ 'class' => 
'LoadMonitorNull' ];
}
+   $this->loadMonitorConfig += [ 'lagWarnThreshold' => 
$this->maxLag ];
 
foreach ( $params['servers'] as $i => $server ) {
$this->mLoads[$i] = $server['load'];
@@ -291,7 +292,7 @@
"Server {host} is not 
replicating?", [ 'host' => $host ] );
unset( $loads[$i] );
} elseif ( $lag > $maxServerLag ) {
-   $this->replLogger->warning(
+   $this->replLogger->info(
"Server {host} has {lag} 
seconds of lag (>= {maxlag})",
[ 'host' => $host, 'lag' => 
$lag, 'maxlag' => $maxServerLag ]
);
diff --git a/includes/libs/rdbms/loadmonitor/LoadMonitor.php 
b/includes/libs/rdbms/loadmonitor/LoadMonitor.php
index 8292c03..74c7765 100644
--- a/includes/libs/rdbms/loadmonitor/LoadMonitor.php
+++ b/includes/libs/rdbms/loadmonitor/LoadMonitor.php
@@ -45,9 +45,22 @@
 
/** @var float Moving average ratio (e.g. 0.1 for 10% weight to new 
weight) */
private $movingAveRatio;
+   /** @var int Amount of replication lag in seconds before warnings are 
logged */
+   private $lagWarnThreshold;
 
-   const VERSION = 1; // cache key version
+   /** @var int cache key version */
+   const VERSION = 1;
+   /** @var int Default 'max lag' in seconds when unspecified */
+   const LAG_WARN_THRESHOLD = 10;
 
+   /**
+* @param ILoadBalancer $lb
+* @param BagOStuff $srvCache
+* @param WANObjectCache $wCache
+* @param array $options
+*   - movingAveRatio: moving average constant for server weight 
updates based on lag
+*   - lagWarnThreshold: how many seconds of lag trigger warnings
+*/
public function __construct(
ILoadBalancer $lb, BagOStuff $srvCache, WANObjectCache $wCache, 
array $options = []
) {
@@ -59,6 +72,9 @@
$this->movingAveRatio = isset( $options['movingAveRatio'] )
? $options['movingAveRatio']
: 0.1;
+   $this->lagWarnThreshold = isset( $options['lagWarnThreshold'] )
+   ? $options['lagWarnThreshold']
+   : self::LAG_WARN_THRESHOLD;
}
 
public function setLogger( LoggerInterface $logger ) {
@@ -159,9 +175,10 @@
// Scale from 10% to 100% of nominal weight
$weightScales[$i] = max( $newWeight, 0.10 );
 
+   $host = $this->parent->getServerName( $i );
+
if ( !$conn ) {
$lagTimes[$i] = false;
-   $host = $this->parent->getServerName( $i );
$this->replLogger->error(
__METHOD__ . ": host {db_server} is 
unreachable",
[ 'db_server' => $host ]
@@ -174,11 +191,19 @@
} else {
$lagTimes[$i] = $conn->getLag();
if ( $lagTimes[$i] === false ) {
-   $host = $this->parent->getServerName( 
$i );
$this->replLogger->error(
__METHOD__ . ": host 
{db_server} is not replicating?",
[ 'db_server' => $host ]
);
+   } elseif ( $lagTimes[$i] > 
$this->lagWarnThreshold ) {
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make IDatabase return type documentation less confusing

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

Change subject: Make IDatabase return type documentation less confusing
..


Make IDatabase return type documentation less confusing

Disregard the effects of DBO_IGNORE, which is for internal use only
and is not part of publically observable behavior.

Change-Id: I056b7148bc53af524ea8c85c159d77fbfbd24520
---
M includes/libs/rdbms/database/IDatabase.php
1 file changed, 9 insertions(+), 6 deletions(-)

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



diff --git a/includes/libs/rdbms/database/IDatabase.php 
b/includes/libs/rdbms/database/IDatabase.php
index 868c2d4..bbf88dc 100644
--- a/includes/libs/rdbms/database/IDatabase.php
+++ b/includes/libs/rdbms/database/IDatabase.php
@@ -569,7 +569,8 @@
 * @param string|array $options The query options. See 
IDatabase::select() for details.
 * @param string|array $join_conds The query join conditions. See 
IDatabase::select() for details.
 *
-* @return bool|mixed The value from the field, or false on failure.
+* @return mixed The value from the field
+* @throws DBQueryError
 */
public function selectField(
$table, $var, $cond = '', $fname = __METHOD__, $options = [], 
$join_conds = []
@@ -591,7 +592,8 @@
 * @param string|array $options The query options. See 
IDatabase::select() for details.
 * @param string|array $join_conds The query join conditions. See 
IDatabase::select() for details.
 *
-* @return bool|array The values from the field, or false on failure
+* @return array The values from the field
+* @throws DBQueryError
 * @since 1.25
 */
public function selectFieldValues(
@@ -755,10 +757,8 @@
 *
 *[ 'page' => [ 'LEFT JOIN', 'page_latest=rev_id' ] ]
 *
-* @return IResultWrapper|bool If the query returned no rows, a 
IResultWrapper
-*   with no rows in it will be returned. If there was a query error, a
-*   DBQueryError exception will be thrown, except if the "ignore 
errors"
-*   option was set, in which case false will be returned.
+* @return IResultWrapper Resulting rows
+* @throws DBQueryError
 */
public function select(
$table, $vars, $conds = '', $fname = __METHOD__,
@@ -799,6 +799,7 @@
 * @param array|string $join_conds Join conditions
 *
 * @return stdClass|bool
+* @throws DBQueryError
 */
public function selectRow( $table, $vars, $conds, $fname = __METHOD__,
$options = [], $join_conds = []
@@ -823,6 +824,7 @@
 * @param string $fname Function name for profiling
 * @param array $options Options for select
 * @return int Row count
+* @throws DBQueryError
 */
public function estimateRowCount(
$table, $vars = '*', $conds = '', $fname = __METHOD__, $options 
= []
@@ -844,6 +846,7 @@
 * @param array $options Options for select
 * @param array $join_conds Join conditions (since 1.27)
 * @return int Row count
+* @throws DBQueryError
 */
public function selectRowCount(
$tables, $vars = '*', $conds = '', $fname = __METHOD__, 
$options = [], $join_conds = []

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: objectcache: improve touchCheckKey()/resetCheckKey() comments

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

Change subject: objectcache: improve touchCheckKey()/resetCheckKey() comments
..


objectcache: improve touchCheckKey()/resetCheckKey() comments

Change-Id: I91de1dff605adcf86e957bbf9e503fc4e5eed741
---
M includes/libs/objectcache/WANObjectCache.php
1 file changed, 18 insertions(+), 19 deletions(-)

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



diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index e63b32e..78a5dde 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -613,20 +613,22 @@
 * on all keys that should be changed. When get() is called on those
 * keys, the relevant "check" keys must be supplied for this to work.
 *
-* The "check" key essentially represents a last-modified field.
-* When touched, the field will be updated on all cache servers.
-* Keys using it via get(), getMulti(), or getWithSetCallback() will
-* be invalidated. It is treated as being HOLDOFF_TTL seconds in the 
future
-* by those methods to avoid race conditions where dependent keys get 
updated
-* with stale values (e.g. from a DB replica DB).
+* The "check" key essentially represents a last-modified time of an 
entity.
+* When the key is touched, the timestamp will be updated to the 
current time.
+* Keys using the "check" key via get(), getMulti(), or 
getWithSetCallback() will
+* be invalidated. The timestamp of "check" is treated as being 
HOLDOFF_TTL seconds
+* in the future by get*() methods in order to avoid race conditions 
where keys are
+* updated with stale values (e.g. from a DB replica DB).
 *
-* This is typically useful for keys with hardcoded names or in some 
cases
-* dynamically generated names where a low number of combinations exist.
-* When a few important keys get a large number of hits, a high cache
-* time is usually desired as well as "lockTSE" logic. The 
resetCheckKey()
-* method is less appropriate in such cases since the "time since 
expiry"
-* cannot be inferred, causing any get() after the reset to treat the 
key
-* as being "hot", resulting in more stale value usage.
+* This method is typically useful for keys with hardcoded names or in 
some cases
+* dynamically generated names, provided the number of such keys is 
modest. It sets a
+* high TTL on the "check" key, making it possible to know the 
timestamp of the last
+* change to the corresponding entities in most cases.
+*
+* When a few important keys get a large number of hits, a high cache 
time is usually
+* desired as well as "lockTSE" logic. The resetCheckKey() method is 
less appropriate
+* in such cases since the "time since expiry" cannot be inferred, 
causing any get()
+* after the reset to treat the key as being "hot", resulting in more 
stale value usage.
 *
 * Note that "check" keys won't collide with other regular keys.
 *
@@ -657,12 +659,9 @@
 *to, any temporary ejection of that server will cause the 
value to be
 *seen as purged as a new server will initialize the "check" 
key.
 *
-* The advantage is that this does not place high TTL keys on every 
cache
-* server, making it better for code that will cache many different keys
-* and either does not use lockTSE or uses a low enough TTL anyway.
-*
-* This is typically useful for keys with dynamically generated names
-* where a high number of combinations exist.
+* The advantage here is that the "check" keys, which have high TTLs, 
will only
+* be created when a get*() method actually uses that key. This is 
better when
+* a large number of "check" keys are invalided in a short period of 
time.
 *
 * Note that "check" keys won't collide with other regular keys.
 *

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: Let Html::element do the HTML escaping

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

Change subject: Let Html::element do the HTML escaping
..


Let Html::element do the HTML escaping

Change-Id: I83a738babed5cb0a68651e4d67753bce0b72c796
---
M TimelessTemplate.php
1 file changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/TimelessTemplate.php b/TimelessTemplate.php
index 21a09be..318839a 100644
--- a/TimelessTemplate.php
+++ b/TimelessTemplate.php
@@ -229,8 +229,8 @@
'div',
[ 'id' => Sanitizer::escapeId( $id ), 'class' => 
'sidebar-chunk' ],
Html::rawElement( 'h2', [],
-   Html::rawElement( 'span', [],
-   $this->getMsg( $headerMessage 
)->escaped()
+   Html::element( 'span', [],
+   $this->getMsg( $headerMessage )->text()
) .
Html::element( 'div', [ 'class' => 'pokey' ] )
) .
@@ -462,20 +462,20 @@
// Make sure it fits first (numbers slightly made up, 
may need adjusting)
$fit = empty( $extraTools ) ? 13 : 9;
if ( mb_strlen( $userName ) < $fit ) {
-   $dropdownHeader = htmlspecialchars( $userName, 
ENT_QUOTES );
+   $dropdownHeader = $userName;
} else {
-   $dropdownHeader = wfMessage( 
'timeless-loggedin' )->escaped();
+   $dropdownHeader = wfMessage( 
'timeless-loggedin' )->text();
}
$headerMsg = [ 'timeless-loggedinas', $user->getName() 
];
} else {
-   $dropdownHeader = wfMessage( 'timeless-anonymous' 
)->escaped();
+   $dropdownHeader = wfMessage( 'timeless-anonymous' 
)->text();
$headerMsg = 'timeless-notloggedin';
}
$html .= Html::openElement( 'div', [ 'id' => 'user-tools' ] );
 
$html .= Html::rawElement( 'div', [ 'id' => 'personal' ],
Html::rawElement( 'h2', [],
-   Html::rawElement( 'span', [], $dropdownHeader ) 
.
+   Html::element( 'span', [], $dropdownHeader ) .
Html::element( 'div', [ 'class' => 'pokey' ] )
) .
Html::rawElement( 'div', [ 'id' => 'personal-inner', 
'class' => 'dropdown' ],

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I83a738babed5cb0a68651e4d67753bce0b72c796
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/skins/Timeless
Gerrit-Branch: master
Gerrit-Owner: Fomafix 
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...Timeless[master]: Remove double HTML escaping

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

Change subject: Remove double HTML escaping
..


Remove double HTML escaping

Html::element() already does HTML escaping for attributes and content.

Change-Id: Ib62889d55a6ac3fa1aa70964dc87af42ee7e3848
---
M TimelessTemplate.php
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/TimelessTemplate.php b/TimelessTemplate.php
index 7fa4c31..21a09be 100644
--- a/TimelessTemplate.php
+++ b/TimelessTemplate.php
@@ -263,9 +263,9 @@
if ( $part !== 'image' ) {
$titleClass = '';
if ( $language->hasVariants() ) {
-   $siteTitle = $language->convert( $this->getMsg( 
'timeless-sitetitle' )->escaped() );
+   $siteTitle = $language->convert( $this->getMsg( 
'timeless-sitetitle' )->text() );
} else {
-   $siteTitle = $this->getMsg( 
'timeless-sitetitle' )->escaped();
+   $siteTitle = $this->getMsg( 
'timeless-sitetitle' )->text();
}
// width is 11em; 13 characters will probably fit?
if ( mb_strlen( $siteTitle ) > 13 ) {
@@ -274,7 +274,7 @@
$html .= Html::element( 'a', [
'id' => 'p-banner',
'class' => [ 'mw-wiki-title', 
$titleClass ],
-   'href' => htmlspecialchars( 
$this->data['nav_urls']['mainpage']['href'] )
+   'href' => 
$this->data['nav_urls']['mainpage']['href']
],
$siteTitle
);
@@ -283,7 +283,7 @@
$html .= Html::element( 'a', array_merge(
[
'class' => 'mw-wiki-logo',
-   'href' => htmlspecialchars( 
$this->data['nav_urls']['mainpage']['href'] )
+   'href' => 
$this->data['nav_urls']['mainpage']['href']
],
Linker::tooltipAndAccesskeyAttribs( 'p-logo' )
) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib62889d55a6ac3fa1aa70964dc87af42ee7e3848
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/skins/Timeless
Gerrit-Branch: master
Gerrit-Owner: Fomafix 
Gerrit-Reviewer: Brian Wolff 
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...ThrottleOverride[master]: Cleanup: Move files under /includes

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

Change subject: Cleanup: Move files under /includes
..


Cleanup: Move files under /includes

Add an /includes directory and move php classes there. Also rename the
hooks class to a proper filename (matching the class name).

Also uncomment the wfWarn within the deprecated entry point
ThrottleOverride.php, thus raising a warning when the deprecated entry
point is used.

Change-Id: I6a2ea370fc7550f2c7e9b2d1eee30c63b8cb6a27
---
M ThrottleOverride.php
M extension.json
R includes/SpecialOverrideThrottle.php
R includes/SpecialThrottleOverrideList.php
R includes/ThrottleOverrideHooks.php
R includes/ThrottleOverrideLogFormatter.php
R includes/ThrottleOverridePager.php
R includes/ThrottleOverridePurgeJob.php
R includes/ThrottleOverrideUtils.php
9 files changed, 12 insertions(+), 12 deletions(-)

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



diff --git a/ThrottleOverride.php b/ThrottleOverride.php
index 0c1ec2a..c8fbc22 100644
--- a/ThrottleOverride.php
+++ b/ThrottleOverride.php
@@ -4,11 +4,11 @@
// Keep i18n globals so mergeMessageFileList.php doesn't break
$wgMessagesDirs['OverrideThrottle'] = __DIR__ . '/i18n';
$wgExtensionMessagesFiles['OverrideThrottleAlias'] = __DIR__ . 
'/ThrottleOverride.i18n.alias.php';
-   /*wfWarn(
+   wfWarn(
'Deprecated PHP entry point used for ThrottleOverride 
extension. ' .
'Please use wfLoadExtension instead, ' .
'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
-   );*/
+   );
return;
 } else {
die( 'This version of the ThrottleOverride extension requires MediaWiki 
1.28+' );
diff --git a/extension.json b/extension.json
index 70edb02..f2a9059 100644
--- a/extension.json
+++ b/extension.json
@@ -44,13 +44,13 @@
"OverrideThrottleAlias": "ThrottleOverride.i18n.alias.php"
},
"AutoloadClasses": {
-   "ThrottleOverrideHooks": "ThrottleOverride.hooks.php",
-   "SpecialOverrideThrottle": "SpecialOverrideThrottle.php",
-   "SpecialThrottleOverrideList": 
"SpecialThrottleOverrideList.php",
-   "ThrottleOverridePager": "ThrottleOverridePager.php",
-   "ThrottleOverridePurgeJob": "ThrottleOverridePurgeJob.php",
-   "ThrottleOverrideLogFormatter": 
"ThrottleOverrideLogFormatter.php",
-   "ThrottleOverrideUtils": "ThrottleOverrideUtils.php"
+   "SpecialOverrideThrottle": 
"includes/SpecialOverrideThrottle.php",
+   "SpecialThrottleOverrideList": 
"includes/SpecialThrottleOverrideList.php",
+   "ThrottleOverrideHooks": "includes/ThrottleOverrideHooks.php",
+   "ThrottleOverrideLogFormatter": 
"includes/ThrottleOverrideLogFormatter.php",
+   "ThrottleOverridePager": "includes/ThrottleOverridePager.php",
+   "ThrottleOverridePurgeJob": 
"includes/ThrottleOverridePurgeJob.php",
+   "ThrottleOverrideUtils": "includes/ThrottleOverrideUtils.php"
},
"config": {
"ThrottleOverrideCentralWiki": {
diff --git a/SpecialOverrideThrottle.php b/includes/SpecialOverrideThrottle.php
similarity index 100%
rename from SpecialOverrideThrottle.php
rename to includes/SpecialOverrideThrottle.php
diff --git a/SpecialThrottleOverrideList.php 
b/includes/SpecialThrottleOverrideList.php
similarity index 100%
rename from SpecialThrottleOverrideList.php
rename to includes/SpecialThrottleOverrideList.php
diff --git a/ThrottleOverride.hooks.php b/includes/ThrottleOverrideHooks.php
similarity index 96%
rename from ThrottleOverride.hooks.php
rename to includes/ThrottleOverrideHooks.php
index de9656d..25f67f2 100644
--- a/ThrottleOverride.hooks.php
+++ b/includes/ThrottleOverrideHooks.php
@@ -128,17 +128,17 @@
public static function onLoadExtensionSchemaUpdates( DatabaseUpdater 
$updater ) {
$updater->addExtensionTable(
'throttle_override',
-   __DIR__ . '/patches/table.sql'
+   __DIR__ . '/../patches/table.sql'
);
$updater->addExtensionIndex(
'throttle_override',
'thr_expiry',
-   __DIR__ . '/patches/expiry_index.sql'
+   __DIR__ . '/../patches/expiry_index.sql'
);
$updater->addExtensionField(
'throttle_override',
'thr_target',
-   __DIR__ . '/patches/patch-thr_target.sql'
+   __DIR__ . '/../patches/patch-thr_target.sql'
);
 
return true;
diff --git a/ThrottleOverrideLogFormatter.php 

[MediaWiki-commits] [Gerrit] mediawiki...ThrottleOverride[master]: Cache results for duration of override

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

Change subject: Cache results for duration of override
..


Cache results for duration of override

Purging of cache on record change was introduced in 147b945 so it is
safe for us to cache a throttle override until its current expiration
time on successful lookup. The cache time for a negative lookup is kept
at one hour, not because a longer duration would be unsafe, but because
the key space is incredibly large (2^32 + 2^128).

Change-Id: I049d20f93b0d66f4109778e4e664d2f73c88ae24
---
M ThrottleOverride.hooks.php
1 file changed, 5 insertions(+), 14 deletions(-)

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



diff --git a/ThrottleOverride.hooks.php b/ThrottleOverride.hooks.php
index babb777..de9656d 100644
--- a/ThrottleOverride.hooks.php
+++ b/ThrottleOverride.hooks.php
@@ -86,21 +86,12 @@
[ 'ORDER BY' => 'thr_expiry DESC' ]
);
 
-   // Its tempting to set the TTL to match the 
expiration we
-   // found in the DB, but since the record is 
editable and we do
-   // not purge every key in the range when it 
changes we will
-   // just leave the default cache time alone. The 
exception to
-   // this rule is when we are caching a row which 
will expire in
-   // less than the default TTL.
-   // NOTE: this means that changes to an existing 
record may not
-   // effect all IPs in the range equally until 
the default cache
-   // period has elapsed.
if ( $expiry !== false ) {
-   // An override exists; do not cache for 
more than the
-   // override's current-time-left
-   $nowUnix = time();
-   $overrideCTL = wfTimestamp( TS_UNIX, 
$expiry ) - $nowUnix;
-   $ttl = min( $ttl, max( $overrideCTL, 1 
) );
+   // An override exists; cache for the 
override's
+   // current-time-left. Cache will be 
purged via checkKey
+   // updates on record modification. 
Avoid "0" (infinite)
+   // and negative numbers for sanity.
+   $ttl = max( wfTimestamp( TS_UNIX, 
$expiry ) - time(), 1 );
}
 
// If we return false the value will not be 
cached

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I049d20f93b0d66f4109778e4e664d2f73c88ae24
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ThrottleOverride
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: EddieGP 
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...ThrottleOverride[master]: Move expired record purge to a job

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

Change subject: Move expired record purge to a job
..


Move expired record purge to a job

Purge expired throttle override records using a job queued after any
creation or edit of another record. Expired records are hidden from the
list special page. Expired records are also filtered out when searching
for rules that apply to a request. These changes ensure that GET
requests remain nullipotent.

Bug: T181025
Change-Id: I31e8f464e097a7d62cb02f717cdf68a02256a204
---
M SpecialOverrideThrottle.php
M SpecialThrottleOverrideList.php
M ThrottleOverride.hooks.php
M ThrottleOverridePager.php
A ThrottleOverridePurgeJob.php
M extension.json
6 files changed, 104 insertions(+), 44 deletions(-)

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



diff --git a/SpecialOverrideThrottle.php b/SpecialOverrideThrottle.php
index 20109a4..70f96d7 100644
--- a/SpecialOverrideThrottle.php
+++ b/SpecialOverrideThrottle.php
@@ -209,6 +209,11 @@
$cache = 
MediaWikiServices::getInstance()->getMainWANObjectCache();
$cache->touchCheckKey( ThrottleOverrideUtils::getBucketKey( 
$cache, $rangeStart ) );
 
+   // Queue a job that will delete expired records
+   JobQueueGroup::singleton()->lazyPush(
+   new ThrottleOverridePurgeJob()
+   );
+
return true;
}
 
diff --git a/SpecialThrottleOverrideList.php b/SpecialThrottleOverrideList.php
index 72e6819..c4af7c1 100644
--- a/SpecialThrottleOverrideList.php
+++ b/SpecialThrottleOverrideList.php
@@ -65,23 +65,6 @@
}
 
function onSubmit( array $data, HTMLForm $form = null ) {
-   if ( !wfReadOnly() && !mt_rand( 0, 10 ) ) {
-   // Purge expired entries on one in every 10 queries
-   $dbw = ThrottleOverrideUtils::getCentralDB( DB_MASTER );
-   $method = __METHOD__;
-   $dbw->onTransactionIdle( function () use ( $dbw, 
$method ) {
-   $dbw->delete(
-   'throttle_override',
-   [
-   $dbw->addIdentifierQuotes( 
'thr_expiry' ) .
-   ' < ' .
-   $dbw->addQuotes( 
$dbw->timestamp() )
-   ],
-   $method
-   );
-   } );
-   }
-
$pager = new ThrottleOverridePager( $this, [
'throttleType' => $data['ThrottleType'],
] );
diff --git a/ThrottleOverride.hooks.php b/ThrottleOverride.hooks.php
index 40dc2cd..babb777 100644
--- a/ThrottleOverride.hooks.php
+++ b/ThrottleOverride.hooks.php
@@ -71,10 +71,17 @@
$dbr = ThrottleOverrideUtils::getCentralDB( 
DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr 
);
 
+   $quotedIp = $db->addQuotes( $hexIp );
$expiry = $dbr->selectField(
'throttle_override',
'thr_expiry',
-   ThrottleOverrideHooks::makeConds( $dbr, 
$hexIp, $action ),
+   [
+   "thr_range_start <= $quotedIp",
+   "thr_range_end >= $quotedIp",
+   'thr_expiry > ' . 
$dbr->addQuotes( $dbr->timestamp() ),
+   'thr_type' . $dbr->buildLike(
+   $dbr->anyString(), 
$action, $dbr->anyString() ),
+   ],
'ThrottleOverrideHooks::onPingLimiter',
[ 'ORDER BY' => 'thr_expiry DESC' ]
);
@@ -118,35 +125,9 @@
 
$result = false;
return false;
-   } elseif ( $expiry !== false ) {
-   // Expired exemption. Delete it from the DB.
-   $dbw = ThrottleOverrideUtils::getCentralDB( DB_MASTER );
-   $dbw->delete(
-   'throttle_override',
-   self::makeConds( $dbw, $hexIp, $action ),
-   __METHOD__
-   );
}
 
return true;
-   }
-
-   /**
-* Make SQL query conditions.
-*
-* @param 

[MediaWiki-commits] [Gerrit] mediawiki...ThrottleOverride[master]: Add multi-wiki support

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

Change subject: Add multi-wiki support
..


Add multi-wiki support

Add a $wgThrottleOverrideCentralWiki configuration setting which can be
used to designate a single wiki in a wiki farm as the location for
managing ThrottleOverride exemptions.

Bug: T147364
Change-Id: I56fa0866133668a2151ce04510e0021f0ae3cbdd
---
M SpecialOverrideThrottle.php
M SpecialThrottleOverrideList.php
M ThrottleOverride.hooks.php
A ThrottleOverrideUtils.php
M extension.json
5 files changed, 104 insertions(+), 34 deletions(-)

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



diff --git a/SpecialOverrideThrottle.php b/SpecialOverrideThrottle.php
index a9e1f7b..20109a4 100644
--- a/SpecialOverrideThrottle.php
+++ b/SpecialOverrideThrottle.php
@@ -125,7 +125,7 @@
$data['Target']['default'] = $this->par;
 
// We need the most recent data here, we're about to 
change the throttle.
-   $dbw = wfGetDB( DB_MASTER );
+   $dbw = ThrottleOverrideUtils::getCentralDB( DB_MASTER );
$row = $dbw->selectRow(
'throttle_override',
[ 'thr_expiry', 'thr_reason', 'thr_type' ],
@@ -184,7 +184,7 @@
list( $rangeStart, $rangeEnd ) = $parsedRange;
 
// Save the new exemption
-   $dbw = wfGetDB( DB_MASTER );
+   $dbw = ThrottleOverrideUtils::getCentralDB( DB_MASTER );
$row = [
'thr_target' => $this->target,
'thr_expiry' => $dbw->encodeExpiry( $data['Expiry'] ),
@@ -207,7 +207,7 @@
 
// Purge the cache
$cache = 
MediaWikiServices::getInstance()->getMainWANObjectCache();
-   $cache->touchCheckKey( ThrottleOverrideHooks::getBucketKey( 
$cache, $rangeStart ) );
+   $cache->touchCheckKey( ThrottleOverrideUtils::getBucketKey( 
$cache, $rangeStart ) );
 
return true;
}
@@ -221,7 +221,7 @@
 * @return int
 */
public static function getThrottleOverrideId( $ip, $dbtype = DB_REPLICA 
) {
-   $db = wfGetDB( $dbtype );
+   $db = ThrottleOverrideUtils::getCentralDB( $dbtype );
$field = $db->selectField(
'throttle_override',
'thr_id',
diff --git a/SpecialThrottleOverrideList.php b/SpecialThrottleOverrideList.php
index 7113ce3..72e6819 100644
--- a/SpecialThrottleOverrideList.php
+++ b/SpecialThrottleOverrideList.php
@@ -67,7 +67,7 @@
function onSubmit( array $data, HTMLForm $form = null ) {
if ( !wfReadOnly() && !mt_rand( 0, 10 ) ) {
// Purge expired entries on one in every 10 queries
-   $dbw = wfGetDB( DB_MASTER );
+   $dbw = ThrottleOverrideUtils::getCentralDB( DB_MASTER );
$method = __METHOD__;
$dbw->onTransactionIdle( function () use ( $dbw, 
$method ) {
$dbw->delete(
diff --git a/ThrottleOverride.hooks.php b/ThrottleOverride.hooks.php
index a08e8ce..40dc2cd 100644
--- a/ThrottleOverride.hooks.php
+++ b/ThrottleOverride.hooks.php
@@ -45,7 +45,7 @@
 * @return bool
 */
public static function onPingLimiter( User &$user, $action, &$result, 
$ip = null ) {
-   global $wgRateLimits;
+   global $wgRateLimits, $wgThrottleOverrideCentralWiki;
 
if ( $action !== 'actcreate' && !isset( $wgRateLimits[$action] 
) ) {
return true;
@@ -60,10 +60,15 @@
 
$cache = 
MediaWikiServices::getInstance()->getMainWANObjectCache();
$expiry = $cache->getWithSetCallback(
-   $cache->makeKey( 'throttle_override', $action, $hexIp ),
+   $cache->makeGlobalKey(
+   'throttle_override',
+   $wgThrottleOverrideCentralWiki,
+   $action,
+   $hexIp
+   ),
$cache::TTL_HOUR,
function ( $cValue, &$ttl, &$setOpts, $asOf ) use ( 
$ip, $hexIp, $action ) {
-   $dbr = wfGetDB( DB_REPLICA );
+   $dbr = ThrottleOverrideUtils::getCentralDB( 
DB_REPLICA );
$setOpts += Database::getCacheSetOptions( $dbr 
);
 
$expiry = $dbr->selectField(
@@ -95,7 +100,7 @@
return ( $expiry === false ) ? 
self::NO_OVERRIDE : $expiry;
},
[
-  

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: setup.py: Use flickrapi<2.3.1 for Python 3.3

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

Change subject: setup.py: Use flickrapi<2.3.1 for Python 3.3
..


setup.py: Use flickrapi<2.3.1 for Python 3.3

Bug: T181351
Change-Id: I848bf7c30e7bcf0102494ccfd438422191edc1ad
---
M requirements.txt
M setup.py
2 files changed, 8 insertions(+), 3 deletions(-)

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



diff --git a/requirements.txt b/requirements.txt
index 98c9c0d..13598af 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -71,7 +71,8 @@
 # If you see that on Python 2, change this to flickrapi==1.4.5
 # On Python 3, force pip to install requests 2.2.1, or remove flickrapi below.
 flickrapi>=1.4.5,<2 ; python_version < '2.7'
-flickrapi ; python_version >= '2.7'
+flickrapi<2.3.1 ; python_version == '3.3'
+flickrapi ; python_version >= '2.7' and python_version != '3.3'
 
 # incomplete core component botirc
 irc ; python_version > '2.6'
diff --git a/setup.py b/setup.py
index efa5dc8..aa28872 100644
--- a/setup.py
+++ b/setup.py
@@ -92,8 +92,12 @@
 # and will be first packaged for Fedora Core 21.
 # flickrapi 1.4.x does not run on Python 3, and setuptools can only
 # select flickrapi 2.x for Python 3 installs.
-script_deps['flickrripper.py'].append(
-'flickrapi>=1.4.5,<2' if PY26 else 'flickrapi')
+# flickrapi 2.3.1 dropped support for Python 3.3.
+if PYTHON_VERSION[:2] == (3, 3):
+script_deps['flickrripper.py'].append('flickrapi<2.3.1')
+else:
+script_deps['flickrripper.py'].append(
+'flickrapi>=1.4.5,<2' if PY26 else 'flickrapi')
 
 # lunatic-python is only available for Linux
 if sys.platform.startswith('linux'):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I848bf7c30e7bcf0102494ccfd438422191edc1ad
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Dalba 
Gerrit-Reviewer: Dalba 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Magul 
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] operations/puppet[production]: keep misc dumps dirs owner on generating host same as on web...

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

Change subject: keep misc dumps dirs owner on generating host same as on web 
server for now
..


keep misc dumps dirs owner on generating host same as on web server for now

As these jobs move from web server to generating host, we can
change the owner, but not until then; otherwise jobs are unable
to create the subdir needed for their output

Change-Id: I16d84c2b5ea7e11d0019f084abab5c884f9b3f09
---
M modules/dumps/manifests/generation/server/dirs.pp
M modules/profile/manifests/dumps/generation/server/fallback.pp
M modules/profile/manifests/dumps/generation/server/primary.pp
3 files changed, 22 insertions(+), 14 deletions(-)

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



diff --git a/modules/dumps/manifests/generation/server/dirs.pp 
b/modules/dumps/manifests/generation/server/dirs.pp
index 17d7ae5..16f95b0 100644
--- a/modules/dumps/manifests/generation/server/dirs.pp
+++ b/modules/dumps/manifests/generation/server/dirs.pp
@@ -1,6 +1,8 @@
 class dumps::generation::server::dirs(
 $user  = undef,
 $group = undef,
+$deprecated_user = undef,
+$deprecated_group = undef,
 ) {
 # Directories where dumps of any type are generated
 # This list is not for one-off directories, nor for
@@ -44,15 +46,15 @@
 file { $cirrussearchdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $user,
-group  => $group,
+owner  => $deprecated_user,
+group  => $deprecated_group,
 }
 
 file { $xlationdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $user,
-group  => $group,
+owner  => $deprecated_user,
+group  => $deprecated_group,
 }
 
 file { $globalblocksdir:
@@ -65,8 +67,8 @@
 file { $medialistsdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $user,
-group  => $group,
+owner  => $deprecated_user,
+group  => $deprecated_group,
 }
 
 file { $incrsdir:
@@ -79,8 +81,8 @@
 file { $mediatitlesdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $user,
-group  => $group,
+owner  => $deprecated_user,
+group  => $deprecated_group,
 }
 
 file { $othermiscdir:
@@ -93,8 +95,8 @@
 file { $pagetitlesdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $user,
-group  => $group,
+owner  => $deprecated_user,
+group  => $deprecated_group,
 }
 
 file { $othertestfilesdir:
diff --git a/modules/profile/manifests/dumps/generation/server/fallback.pp 
b/modules/profile/manifests/dumps/generation/server/fallback.pp
index cd8e303..1e41caa 100644
--- a/modules/profile/manifests/dumps/generation/server/fallback.pp
+++ b/modules/profile/manifests/dumps/generation/server/fallback.pp
@@ -1,8 +1,11 @@
 class profile::dumps::generation::server::fallback {
 class { '::dumpsuser': }
+class { '::dumps::deprecated::user': }
 
 class { '::dumps::generation::server::dirs':
-user  => $dumpsuser::user,
-group => $dumpsuser::group,
+user => $dumpsuser::user,
+group=> $dumpsuser::group,
+deprecated_user  => 'datasets',
+deprecated_group => 'datasets',
 }
 }
diff --git a/modules/profile/manifests/dumps/generation/server/primary.pp 
b/modules/profile/manifests/dumps/generation/server/primary.pp
index dfb52fc..5ac8ce5 100644
--- a/modules/profile/manifests/dumps/generation/server/primary.pp
+++ b/modules/profile/manifests/dumps/generation/server/primary.pp
@@ -1,9 +1,12 @@
 class profile::dumps::generation::server::primary {
 class { '::dumpsuser': }
+class { '::dumps::deprecated::user': }
 
 class { '::dumps::generation::server::dirs':
-user  => $dumpsuser::user,
-group => $dumpsuser::group,
+user => $dumpsuser::user,
+group=> $dumpsuser::group,
+deprecated_user  => 'datasets',
+deprecated_group => 'datasets',
 }
 
 class { '::dumps::generation::server::rsyncer':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I16d84c2b5ea7e11d0019f084abab5c884f9b3f09
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
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/puppet[production]: keep misc dumps dirs owner on generating host same as on web...

2017-11-26 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393443 )

Change subject: keep misc dumps dirs owner on generating host same as on web 
server for now
..

keep misc dumps dirs owner on generating host same as on web server for now

As these jobs move from web server to generating host, we can
change the owner, but not until then; otherwise jobs are unable
to create the subdir needed for their output

Change-Id: I16d84c2b5ea7e11d0019f084abab5c884f9b3f09
---
M modules/dumps/manifests/generation/server/dirs.pp
M modules/profile/manifests/dumps/generation/server/fallback.pp
M modules/profile/manifests/dumps/generation/server/primary.pp
3 files changed, 17 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/43/393443/1

diff --git a/modules/dumps/manifests/generation/server/dirs.pp 
b/modules/dumps/manifests/generation/server/dirs.pp
index 17d7ae5..16f95b0 100644
--- a/modules/dumps/manifests/generation/server/dirs.pp
+++ b/modules/dumps/manifests/generation/server/dirs.pp
@@ -1,6 +1,8 @@
 class dumps::generation::server::dirs(
 $user  = undef,
 $group = undef,
+$deprecated_user = undef,
+$deprecated_group = undef,
 ) {
 # Directories where dumps of any type are generated
 # This list is not for one-off directories, nor for
@@ -44,15 +46,15 @@
 file { $cirrussearchdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $user,
-group  => $group,
+owner  => $deprecated_user,
+group  => $deprecated_group,
 }
 
 file { $xlationdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $user,
-group  => $group,
+owner  => $deprecated_user,
+group  => $deprecated_group,
 }
 
 file { $globalblocksdir:
@@ -65,8 +67,8 @@
 file { $medialistsdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $user,
-group  => $group,
+owner  => $deprecated_user,
+group  => $deprecated_group,
 }
 
 file { $incrsdir:
@@ -79,8 +81,8 @@
 file { $mediatitlesdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $user,
-group  => $group,
+owner  => $deprecated_user,
+group  => $deprecated_group,
 }
 
 file { $othermiscdir:
@@ -93,8 +95,8 @@
 file { $pagetitlesdir:
 ensure => 'directory',
 mode   => '0755',
-owner  => $user,
-group  => $group,
+owner  => $deprecated_user,
+group  => $deprecated_group,
 }
 
 file { $othertestfilesdir:
diff --git a/modules/profile/manifests/dumps/generation/server/fallback.pp 
b/modules/profile/manifests/dumps/generation/server/fallback.pp
index cd8e303..e45478e 100644
--- a/modules/profile/manifests/dumps/generation/server/fallback.pp
+++ b/modules/profile/manifests/dumps/generation/server/fallback.pp
@@ -4,5 +4,7 @@
 class { '::dumps::generation::server::dirs':
 user  => $dumpsuser::user,
 group => $dumpsuser::group,
+deprecated_user  => 'datasets',
+deprecated_group => 'datasets',
 }
 }
diff --git a/modules/profile/manifests/dumps/generation/server/primary.pp 
b/modules/profile/manifests/dumps/generation/server/primary.pp
index dfb52fc..5ee7b34 100644
--- a/modules/profile/manifests/dumps/generation/server/primary.pp
+++ b/modules/profile/manifests/dumps/generation/server/primary.pp
@@ -1,9 +1,12 @@
 class profile::dumps::generation::server::primary {
 class { '::dumpsuser': }
+class { '::dumps::deprecated::user': }
 
 class { '::dumps::generation::server::dirs':
 user  => $dumpsuser::user,
 group => $dumpsuser::group,
+deprecated_user  => 'datasets',
+deprecated_group => 'datasets',
 }
 
 class { '::dumps::generation::server::rsyncer':

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: IP cap lift for Semaine contributive 2017-2018

2017-11-26 Thread Jayprakash12345 (Code Review)
Jayprakash12345 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393442 )

Change subject: IP cap lift for Semaine contributive 2017-2018
..

IP cap lift for Semaine contributive 2017-2018

Change-Id: I4191bcd26867540b029915504682e6449e5ad4d6
---
M wmf-config/throttle.php
1 file changed, 6 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/42/393442/2

diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php
index 9a4c6a3..7c8afb3 100644
--- a/wmf-config/throttle.php
+++ b/wmf-config/throttle.php
@@ -28,21 +28,14 @@
 # ];
 ## Add throttling definitions below.
 
-$wmgThrottlingExceptions[] = [ // T178689 - Working Class Movement Library 
(Salford)
-   'from' => '2017-11-19T09:00 -0:00',
-   'to' => '2017-11-19T17:00 -0:00',
-   'IP' => '212.121.214.227',
-   'dbname' => [ 'enwiki', 'commonswiki' ],
-   'value' => 50,
+$wmgThrottlingExceptions[] = [ // T181360
+   'from' => '2017-11-29T09:00 +1:00',
+   'to' =>   '2017-11-29T18:00 +1:00',
+   'IP' =>   '81.246.2.2',
+   'dbname' => [ 'frwiki', 'commonswiki' ],
+   'value' => 30,
 ];
 
-$wmgThrottlingExceptions[] = [ // T180441 - Medicine Faculty campus
-   'from'   => '2017-11-14T00:00 +0:00',
-   'to' => '2017-11-22T00:00 +0:00',
-   'IP' => '84.89.157.249',
-   'dbname' => [ 'cawiki' ],
-   'value'  => 50 // Just in case value is 50
-];
 
 $wmgThrottlingExceptions[] = [ // T180046
'from' => '2017-12-11T07:00 -0:00',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4191bcd26867540b029915504682e6449e5ad4d6
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Jayprakash12345 <0freerunn...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] integration/config[master]: [WikivoteMapsYandex] Use composer unit tests

2017-11-26 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393441 )

Change subject: [WikivoteMapsYandex] Use composer unit tests
..

[WikivoteMapsYandex] Use composer unit tests

Needed for I1b5ebddf9a74f34f2a6eb9082e0188fff99382d0

Change-Id: I7e639b67ec1ea273fe7dc10873d362d5e749810f
---
M zuul/layout.yaml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/41/393441/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index a1a2a0b..1ec679d 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -6191,7 +6191,7 @@
 
   - name: mediawiki/extensions/WikivoteMapsYandex
 template:
-  - name: extension-unittests-non-voting
+  - name: extension-unittests-composer-non-voting
   - name: mwgate-npm
 
   - name: mediawiki/extensions/WindowsAzureStorage

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e639b67ec1ea273fe7dc10873d362d5e749810f
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
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...DisplayTitle[master]: Follow 1 level of redirect getting display title.

2017-11-26 Thread Cicalese (Code Review)
Cicalese has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393350 )

Change subject: Follow 1 level of redirect getting display title.
..


Follow 1 level of redirect getting display title.

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

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



diff --git a/extension.json b/extension.json
index ff5bf23..3775ed5 100644
--- a/extension.json
+++ b/extension.json
@@ -1,6 +1,6 @@
 {
"name": "DisplayTitle",
-   "version": "1.5.2",
+   "version": "1.5.3",
"author": [
"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]",
"[https://www.semantic-mediawiki.org/wiki/User:Oetterer Tobias 
Oetterer]"
diff --git a/includes/DisplayTitleHooks.php b/includes/DisplayTitleHooks.php
index c7fb01f..647a99e 100644
--- a/includes/DisplayTitleHooks.php
+++ b/includes/DisplayTitleHooks.php
@@ -226,23 +226,33 @@
 */
private static function getDisplayTitle( Title $title, &$displaytitle,
$wrap = false ) {
-   $pagetitle = $title->getPrefixedText();
-   // remove fragment
-   $title = Title::newFromText( $pagetitle );
-   if ( $title instanceof Title ) {
-   $values = PageProps::getInstance()->getProperties( 
$title, 'displaytitle' );
-   $id = $title->getArticleID();
-   if ( array_key_exists( $id, $values ) ) {
-   $value = $values[$id];
-   if ( trim( str_replace( '', '', 
strip_tags( $value ) ) ) !== '' &&
-   $value !== $pagetitle ) {
-   $displaytitle = $value;
-   if ( $wrap ) {
-   $displaytitle = new HtmlArmor( 
$displaytitle );
-   }
-   return true;
+   $title = $title->createFragmentTarget('');
+   $originalPageName = $title->getPrefixedText();
+   $wikipage = new WikiPage( $title );
+   $redirect = false;
+   $redirectTarget = $wikipage->getRedirectTarget();
+   if ( !is_null( $redirectTarget ) ) {
+   $redirect = true;
+   $title = $redirectTarget;
+   }
+   $id = $title->getArticleID();
+   $values = PageProps::getInstance()->getProperties( $title, 
'displaytitle' );
+   if ( array_key_exists( $id, $values ) ) {
+   $value = $values[$id];
+   if ( trim( str_replace( '', '', strip_tags( 
$value ) ) ) !== '' &&
+   $value !== $originalPageName ) {
+   $displaytitle = $value;
+   if ( $wrap ) {
+   $displaytitle = new HtmlArmor( 
$displaytitle );
}
+   return true;
}
+   } else if ( $redirect ) {
+   $displaytitle = $title->getPrefixedText();
+   if ( $wrap ) {
+   $displaytitle = new HtmlArmor( $displaytitle );
+   }
+   return true;
}
return false;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9675c87d4dc2042fde643a2cd190b95ae8343aa6
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DisplayTitle
Gerrit-Branch: master
Gerrit-Owner: Cicalese 
Gerrit-Reviewer: Cicalese 
Gerrit-Reviewer: Kghbln 
Gerrit-Reviewer: Samwilson 
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...UniversalLanguageSelector[master]: Update eslint and stylelint and fixes

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

Change subject: Update eslint and stylelint and fixes
..


Update eslint and stylelint and fixes

Change-Id: I02e615e0efa95b673702f1ce8c957a37397ced13
---
M package.json
M resources/js/ext.uls.common.js
M resources/js/ext.uls.inputsettings.js
3 files changed, 13 insertions(+), 13 deletions(-)

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



diff --git a/package.json b/package.json
index 7d53d98..e5a4f66 100644
--- a/package.json
+++ b/package.json
@@ -4,12 +4,12 @@
 "test": "grunt test"
   },
   "devDependencies": {
-"eslint-config-wikimedia": "0.4.0",
+"eslint-config-wikimedia": "0.5.0",
 "grunt": "1.0.1",
-"grunt-banana-checker": "0.5.0",
-"grunt-eslint": "19.0.0",
+"grunt-banana-checker": "0.6.0",
+"grunt-eslint": "20.0.0",
 "grunt-jsonlint": "1.1.0",
-"grunt-stylelint": "0.7.0",
+"grunt-stylelint": "0.8.0",
 "stylelint": "7.8.0",
 "stylelint-config-wikimedia": "0.4.1"
   }
diff --git a/resources/js/ext.uls.common.js b/resources/js/ext.uls.common.js
index 265e2ad..7aaecb8 100644
--- a/resources/js/ext.uls.common.js
+++ b/resources/js/ext.uls.common.js
@@ -59,14 +59,14 @@
 
api = new mw.Api();
api.saveOption( 'language', language )
-   .done( function () {
-   location.reload();
-   } )
-   .fail( function () {
-   // Set options failed. Maybe the user has 
logged off.
-   // Continue like anonymous user and set cookie.
-   changeLanguageAnon();
-   } );
+   .done( function () {
+   location.reload();
+   } )
+   .fail( function () {
+   // Set options failed. Maybe the user 
has logged off.
+   // Continue like anonymous user and set 
cookie.
+   changeLanguageAnon();
+   } );
} );
 
mw.hook( 'mw.uls.interface.language.change' ).fire( language, 
deferred );
diff --git a/resources/js/ext.uls.inputsettings.js 
b/resources/js/ext.uls.inputsettings.js
index bb1f653..e18eeab 100644
--- a/resources/js/ext.uls.inputsettings.js
+++ b/resources/js/ext.uls.inputsettings.js
@@ -178,7 +178,7 @@
id: imeId,
value: imeId
} )
-   .prop( 'checked', selected );
+   .prop( 'checked', selected );
 
if ( imeId === 'system' ) {
name = $.i18n( 'ext-uls-disable-input-method' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I02e615e0efa95b673702f1ce8c957a37397ced13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: KartikMistry 
Gerrit-Reviewer: Amire80 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: New Wikidata Build - 2017-11-26T10:00:01+0000

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

Change subject: New Wikidata Build - 2017-11-26T10:00:01+
..


New Wikidata Build - 2017-11-26T10:00:01+

Change-Id: I4fc70eda116956ae4dee4fac4f77bca67b54bc33
---
M composer.lock
M extensions/Wikibase/lib/i18n/my.json
M extensions/Wikibase/repo/i18n/be-tarask.json
M extensions/Wikibase/repo/i18n/fa.json
M vendor/composer/installed.json
5 files changed, 9 insertions(+), 5 deletions(-)

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



diff --git a/composer.lock b/composer.lock
index f18e964..905650e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1228,7 +1228,7 @@
 "source": {
 "type": "git",
 "url": 
"https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase;,
-"reference": "14bed7070fc07bb9ca6a2cc653d727228029360a"
+"reference": "45dabf27253840cc8271fbf59a8c05324e6b9400"
 },
 "require": {
 "composer/installers": ">=1.0.1",
@@ -1289,7 +1289,7 @@
 "issues": "https://phabricator.wikimedia.org/;,
 "irc": "irc://irc.freenode.net/wikidata"
 },
-"time": "2017-11-24 22:28:34"
+"time": "2017-11-25 21:59:04"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/lib/i18n/my.json 
b/extensions/Wikibase/lib/i18n/my.json
index cc45ace..b1a9c41 100644
--- a/extensions/Wikibase/lib/i18n/my.json
+++ b/extensions/Wikibase/lib/i18n/my.json
@@ -4,5 +4,6 @@
"Ninjastrikers"
]
},
-   "wikibase-sitelinks-wikipedia": "ဝီကီပီးဒီးယား"
+   "wikibase-sitelinks-wikipedia": "ဝီကီပီးဒီးယား",
+   "wikibase-sitelinks-sitename-columnheading": "ဘာသာစကား"
 }
diff --git a/extensions/Wikibase/repo/i18n/be-tarask.json 
b/extensions/Wikibase/repo/i18n/be-tarask.json
index 53eea32..e832840 100644
--- a/extensions/Wikibase/repo/i18n/be-tarask.json
+++ b/extensions/Wikibase/repo/i18n/be-tarask.json
@@ -143,6 +143,7 @@
"wikibase-itembytitle-lookup-page": "Старонка:",
"wikibase-itembytitle-submit": "Шукаць",
"wikibase-itembytitle-error-site": "Калі ласка, увядзіце існы 
ідэнтыфікатар сайту, напрыклад, «enwiki» для ангельскай Вікіпэдыі.",
+   "wikibase-itembytitle-error-item": "Элемэнт, які спасылаецца на 
пададзеную старонку, ня знойдзены.",
"wikibase-itembytitle-create": "Вы можаце таксама [$1 стварыць новы 
аб’ект].",
"wikibase-gotolinkedpage-lookup-site": "Сайт:",
"wikibase-gotolinkedpage-error-item-not-found": "Элемэнт ня знойдзены",
diff --git a/extensions/Wikibase/repo/i18n/fa.json 
b/extensions/Wikibase/repo/i18n/fa.json
index d1a25dd..3d77c4c 100644
--- a/extensions/Wikibase/repo/i18n/fa.json
+++ b/extensions/Wikibase/repo/i18n/fa.json
@@ -41,6 +41,7 @@
"wikibase-remove-inprogress": "در حال حذف‌کردن...",
"wikibase-statementlistview-add": "افزودن ارزش",
"wikibase-statementlistview-add-tooltip": "افزودن ارزش جدید",
+   "wikibase-statementgrouplistview-add": "افزودن استیتمنت",
"wikibase-entitytermsview-entitytermsforlanguagelistview-toggler": "به 
زبان‌های بیشتر",

"wikibase-entitytermsview-entitytermsforlanguagelistview-configure-link-label": 
"پیکربندی",
"wikibase-setting-entitytermsview-showEntitytermslistview": "نمایش 
برچسب‌ها، نام‌های مستعار و توضیحات‌ها به تمام زبان‌هایی که بلدم",
@@ -175,6 +176,7 @@
"wikibase-newproperty-datatype": "نوع داده:",
"wikibase-newproperty-invalid-datatype": "نوع داده غیر معتبر است",
"wikibase-newproperty-pick-data-type": "(یک نوع داده انتخاب کنید)",
+   "wikibase-description-helppage": "Help:توضیحات",
"wikibase-label-helppage": "Help:برچسب‌ها",
"special-newitem": "ایجاد یک آیتم تازه",
"wikibase-newitem-summary": "مطمئن شوید که [[Special:Search|اگر آیتم 
مربوطه از قبل وجود داشته باشد]]! شما باید یک 
[[{{int:Wikibase-label-helppage}}|برچسب]] و 
[[{{int:Wikibase-description-helppage}}|توضیح]] برای همهٔ آیتم‌های تازه ایجاد 
کنید.",
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index e1a7841..d37eef8 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1298,7 +1298,7 @@
 "source": {
 "type": "git",
 "url": 
"https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase;,
-"reference": "14bed7070fc07bb9ca6a2cc653d727228029360a"
+"reference": "45dabf27253840cc8271fbf59a8c05324e6b9400"
 },
 "require": {
 "composer/installers": ">=1.0.1",
@@ -1327,7 +1327,7 @@
 "mediawiki/minus-x": "0.1.0",
 "wikibase/wikibase-codesniffer": "^0.2.0"
 },
-"time": "2017-11-24 22:28:34",
+"time": 

[MediaWiki-commits] [Gerrit] mediawiki...WikipediaExtracts[master]: Respond to Reedy's code review

2017-11-26 Thread Sophivorus (Code Review)
Sophivorus has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393440 )

Change subject: Respond to Reedy's code review
..

Respond to Reedy's code review

- Add README with install, config and usage instructions
- Improve parseParams method
- Clean API requests in the getExtract method
- Remove language guessing for config option to set target wiki
- Add config option to customize user-agent
- Remove span crediting Wikipedia, see docs
- Remove obsolete messages

Bug: T149766
Change-Id: I3eabcd6dd4d089441a8397d09dce6d45bfb74e6d
---
A README
M WikipediaExtracts.php
M WikipediaExtractsError.php
M extension.json
M i18n/ast.json
M i18n/be-tarask.json
M i18n/bn.json
M i18n/de.json
M i18n/en.json
M i18n/es.json
M i18n/fa.json
M i18n/fr.json
M i18n/gl.json
M i18n/it.json
M i18n/kab.json
M i18n/ko.json
M i18n/lb.json
M i18n/lt.json
M i18n/mk.json
M i18n/nb.json
M i18n/nl.json
M i18n/oc.json
M i18n/pl.json
M i18n/pt-br.json
M i18n/pt.json
M i18n/qqq.json
M i18n/roa-tara.json
M i18n/ru.json
M i18n/sr-ec.json
M i18n/sv.json
M i18n/uk.json
M i18n/vi.json
M i18n/zh-hans.json
33 files changed, 77 insertions(+), 136 deletions(-)


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

diff --git a/README b/README
new file mode 100644
index 000..40df729
--- /dev/null
+++ b/README
@@ -0,0 +1,34 @@
+# WikipediaExtracts
+
+MediaWiki extension that enables users to insert content extracted directly 
from Wikipedia.
+
+## Installation
+
+Simply add the following code to the bottom of your LocalSettings.php:
+
+wfLoadExtension( 'WikipediaExtracts' );
+
+## Configuration
+
+By default, WikipediaExtracts will extract content from the English Wikipedia.
+To extract content from other Wikipedias, or other MediaWiki wikis altogether,
+set $WikipediaExtractsAPI to the URL of the API of the target wiki in your
+LocalSettings.php. For example, to extract content from the Spanish Wikipedia:
+
+$WikipediaExtractsAPI = "https://es.wikipedia.org/w/api.php;;
+
+Warning! The target wiki has to have the Extension:TextExtracts enabled!
+
+## Usage
+
+Basic usage to extract a full article:
+
+{{#WikipediaExtract:Title of the article}}
+
+To extract just the introduction of the article:
+
+{{#WikipediaExtract:Title of the article
+|intro = true
+}}
+
+See more options at https://www.mediawiki.org/wiki/Extension:WikipediaExtracts
\ No newline at end of file
diff --git a/WikipediaExtracts.php b/WikipediaExtracts.php
index 7795fad..1bf84e2 100644
--- a/WikipediaExtracts.php
+++ b/WikipediaExtracts.php
@@ -3,20 +3,9 @@
 class WikipediaExtracts {
 
/**
-* @var string $userAgent User agent for querying the API
-*/
-   private static $userAgent =
-   'Extension:WikipediaExtracts/2.1 
(https://www.mediawiki.org/wiki/Extension:WikipediaExtracts)';
-
-   /**
 * @var Parser $parser Parser object
 */
private static $parser;
-
-   /**
-* @var Language $contentLanguage Language object of the content 
language of the local wiki
-*/
-   public static $contentLanguage;
 
/**
 * @var array $params Associative array of the parameters passed to the 
parser function
@@ -27,11 +16,6 @@
 * @var string $wikipediaTitle Title of the Wikipedia article to extract
 */
private static $wikipediaTitle;
-
-   /**
-* @var string $wikipediaLanguage Language code of the Wikipedia to 
query
-*/
-   private static $wikipediaLanguage;
 
/**
 * Main hook
@@ -51,18 +35,9 @@
 */
public static function onFunctionHook( Parser $parser, $input = null ) {
try {
-   self::$parser = $parser;
-   self::$contentLanguage = $parser->getTargetLanguage();
self::$params = self::parseParams( array_slice( 
func_get_args(), 2 ) );
self::$wikipediaTitle = self::getWikipediaTitle( $input 
);
-   self::$wikipediaLanguage = self::getWikipediaLanguage( 
$input );
-
$html = self::getExtract();
-
-   global $wgWikipediaExtractsAddCredits;
-   if ( $wgWikipediaExtractsAddCredits ) {
-   $html .= self::getCredits();
-   }
} catch ( WikipediaExtractsError $error ) {
$html = $error->getHtmlMessage();
}
@@ -92,27 +67,6 @@
}
 
/**
-* Get the language code of the Wikipedia to query
-*
-* @param string $input A language code or a URL from which to extract 
the language code
-* @return string $wikipediaLanguage The language code of the Wikipedia 
to query
-*/
-   private static function getWikipediaLanguage( $input ) {
-   if ( 

[MediaWiki-commits] [Gerrit] mediawiki...ThrottleOverride[master]: Add feature to remove exemptions

2017-11-26 Thread EddieGP (Code Review)
EddieGP has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393439 )

Change subject: Add feature to remove exemptions
..

Add feature to remove exemptions

This adds a new special page, Special:DeleteThrottleOverride, which
takes a ip range and reason and will remove all exemptions from that
range (if any) and create a log entry with the given reason. The range
parameter is prefilled and a log excerpt for that range is shown if this
parameter is given as the subpage name (e.g.
Special:DeleteThrottleOverride/127.0.0.0/8).

On Special:ThrottleOverrideList a link is added to remove that throttle
(in the same place where the "change throttle" link already is).

Re-uses CSS from Special:OverrideThrottle, the css file and module names
have been altered to reflect that.

Change-Id: Ie7283b7f0498d28c9f03a7d884c0af2f30aa23a6
---
A SpecialDeleteThrottleOverride.php
M SpecialOverrideThrottle.php
M ThrottleOverride.i18n.alias.php
M ThrottleOverrideLogFormatter.php
M ThrottleOverridePager.php
M extension.json
M i18n/en.json
M i18n/qqq.json
R resources/ext.throttleoverride.specials.css
9 files changed, 177 insertions(+), 18 deletions(-)


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

diff --git a/SpecialDeleteThrottleOverride.php 
b/SpecialDeleteThrottleOverride.php
new file mode 100644
index 000..4aba8a2
--- /dev/null
+++ b/SpecialDeleteThrottleOverride.php
@@ -0,0 +1,134 @@
+http://www.gnu.org/licenses/>.
+ *
+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
3.0 or later
+ */
+
+use MediaWiki\MediaWikiServices;
+
+/**
+ * Deletes a throttle override for a given IP.
+ */
+class SpecialDeleteThrottleOverride extends FormSpecialPage {
+
+   private $ip;
+
+   public function __construct() {
+   parent::__construct( 'DeleteThrottleOverride', 
'throttleoverride' );
+
+   $out = $this->getOutput();
+   $out->addModules( 'ext.throttleoverride.specials' );
+   }
+
+   function getFormFields() {
+   $data = [
+   'Target' => [
+   'type' => 'text',
+   'label-message' => 'throttleoverride-ipaddress',
+   'required' => true,
+   'autofocus' => true
+   ],
+   'Reason' => [
+   'type' => 'text',
+   'label-message' => 'ipbreason',
+   ],
+   ];
+
+   // If this site was called as 
Special:DeleteThrottleOverride/$this->par, set the target
+   if ( $this->par ) {
+   $data['Target']['default'] = $this->par;
+   }
+
+   return $data;
+   }
+
+   function onSubmit( array $data ) {
+   $reason = trim( $data['Reason'] );
+
+   $ip = IP::sanitizeIP( $data[ 'Target' ] );
+   if ( !IP::isIPAddress( $ip ) ) {
+   // Invalid IP address.
+   return [ 'throttleoverride-validation-ipinvalid' ];
+   }
+   $this->ip = IP::sanitizeRange( $ip );
+
+   // Create a log entry
+   $logEntry = new ManualLogEntry( 'throttleoverride', 'deleted' );
+   $logEntry->setPerformer( $this->getUser() );
+   $logEntry->setTarget( Title::makeTitle( NS_USER, $this->ip ) );
+   $logEntry->setComment( $reason );
+   $logId = $logEntry->insert();
+   $logEntry->publish( $logId );
+
+   // Delete the exemption
+   $dbw = wfGetDB( DB_MASTER );
+   $dbw->delete( 'throttle_override', [ 'thr_target' => $this->ip 
], __METHOD__ );
+
+   // Purge the cache
+   $parsedRange = IP::parseRange( $data['Target'] );
+   list( $rangeStart, $rangeEnd ) = $parsedRange;
+   $cache = 
MediaWikiServices::getInstance()->getMainWANObjectCache();
+   $cache->touchCheckKey( ThrottleOverrideHooks::getBucketKey( 
$cache, $rangeStart ) );
+
+   return true;
+   }
+
+   protected function postText() {
+   $out = '';
+   if ( $this->par ) {
+   # Get the relevant extract from the log.
+   $ipTitle = Title::makeTitleSafe( NS_USER, $this->par );
+
+   LogEventsList::showLogExtract(
+   $out,
+   'throttleoverride',
+   $ipTitle,
+   '',
+   [
+   'lim' => 10,
+   'msgKey' => [ 
'throttleoverride-showlog' ],
+   

[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: Let Html::element do the HTML escaping

2017-11-26 Thread Fomafix (Code Review)
Fomafix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393438 )

Change subject: Let Html::element do the HTML escaping
..

Let Html::element do the HTML escaping

Change-Id: I83a738babed5cb0a68651e4d67753bce0b72c796
---
M TimelessTemplate.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Timeless 
refs/changes/38/393438/1

diff --git a/TimelessTemplate.php b/TimelessTemplate.php
index 21a09be..6b859cb 100644
--- a/TimelessTemplate.php
+++ b/TimelessTemplate.php
@@ -462,20 +462,20 @@
// Make sure it fits first (numbers slightly made up, 
may need adjusting)
$fit = empty( $extraTools ) ? 13 : 9;
if ( mb_strlen( $userName ) < $fit ) {
-   $dropdownHeader = htmlspecialchars( $userName, 
ENT_QUOTES );
+   $dropdownHeader = $userName;
} else {
-   $dropdownHeader = wfMessage( 
'timeless-loggedin' )->escaped();
+   $dropdownHeader = wfMessage( 
'timeless-loggedin' )->text();
}
$headerMsg = [ 'timeless-loggedinas', $user->getName() 
];
} else {
-   $dropdownHeader = wfMessage( 'timeless-anonymous' 
)->escaped();
+   $dropdownHeader = wfMessage( 'timeless-anonymous' 
)->text();
$headerMsg = 'timeless-notloggedin';
}
$html .= Html::openElement( 'div', [ 'id' => 'user-tools' ] );
 
$html .= Html::rawElement( 'div', [ 'id' => 'personal' ],
Html::rawElement( 'h2', [],
-   Html::rawElement( 'span', [], $dropdownHeader ) 
.
+   Html::element( 'span', [], $dropdownHeader ) .
Html::element( 'div', [ 'class' => 'pokey' ] )
) .
Html::rawElement( 'div', [ 'id' => 'personal-inner', 
'class' => 'dropdown' ],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83a738babed5cb0a68651e4d67753bce0b72c796
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Timeless
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...Wikidata[master]: New Wikidata Build - 2017-11-26T10:00:01+0000

2017-11-26 Thread WikidataBuilder (Code Review)
WikidataBuilder has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393437 )

Change subject: New Wikidata Build - 2017-11-26T10:00:01+
..

New Wikidata Build - 2017-11-26T10:00:01+

Change-Id: I4fc70eda116956ae4dee4fac4f77bca67b54bc33
---
M composer.lock
M extensions/Wikibase/lib/i18n/my.json
M extensions/Wikibase/repo/i18n/be-tarask.json
M extensions/Wikibase/repo/i18n/fa.json
M vendor/composer/installed.json
5 files changed, 9 insertions(+), 5 deletions(-)


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

diff --git a/composer.lock b/composer.lock
index f18e964..905650e 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1228,7 +1228,7 @@
 "source": {
 "type": "git",
 "url": 
"https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase;,
-"reference": "14bed7070fc07bb9ca6a2cc653d727228029360a"
+"reference": "45dabf27253840cc8271fbf59a8c05324e6b9400"
 },
 "require": {
 "composer/installers": ">=1.0.1",
@@ -1289,7 +1289,7 @@
 "issues": "https://phabricator.wikimedia.org/;,
 "irc": "irc://irc.freenode.net/wikidata"
 },
-"time": "2017-11-24 22:28:34"
+"time": "2017-11-25 21:59:04"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/lib/i18n/my.json 
b/extensions/Wikibase/lib/i18n/my.json
index cc45ace..b1a9c41 100644
--- a/extensions/Wikibase/lib/i18n/my.json
+++ b/extensions/Wikibase/lib/i18n/my.json
@@ -4,5 +4,6 @@
"Ninjastrikers"
]
},
-   "wikibase-sitelinks-wikipedia": "ဝီကီပီးဒီးယား"
+   "wikibase-sitelinks-wikipedia": "ဝီကီပီးဒီးယား",
+   "wikibase-sitelinks-sitename-columnheading": "ဘာသာစကား"
 }
diff --git a/extensions/Wikibase/repo/i18n/be-tarask.json 
b/extensions/Wikibase/repo/i18n/be-tarask.json
index 53eea32..e832840 100644
--- a/extensions/Wikibase/repo/i18n/be-tarask.json
+++ b/extensions/Wikibase/repo/i18n/be-tarask.json
@@ -143,6 +143,7 @@
"wikibase-itembytitle-lookup-page": "Старонка:",
"wikibase-itembytitle-submit": "Шукаць",
"wikibase-itembytitle-error-site": "Калі ласка, увядзіце існы 
ідэнтыфікатар сайту, напрыклад, «enwiki» для ангельскай Вікіпэдыі.",
+   "wikibase-itembytitle-error-item": "Элемэнт, які спасылаецца на 
пададзеную старонку, ня знойдзены.",
"wikibase-itembytitle-create": "Вы можаце таксама [$1 стварыць новы 
аб’ект].",
"wikibase-gotolinkedpage-lookup-site": "Сайт:",
"wikibase-gotolinkedpage-error-item-not-found": "Элемэнт ня знойдзены",
diff --git a/extensions/Wikibase/repo/i18n/fa.json 
b/extensions/Wikibase/repo/i18n/fa.json
index d1a25dd..3d77c4c 100644
--- a/extensions/Wikibase/repo/i18n/fa.json
+++ b/extensions/Wikibase/repo/i18n/fa.json
@@ -41,6 +41,7 @@
"wikibase-remove-inprogress": "در حال حذف‌کردن...",
"wikibase-statementlistview-add": "افزودن ارزش",
"wikibase-statementlistview-add-tooltip": "افزودن ارزش جدید",
+   "wikibase-statementgrouplistview-add": "افزودن استیتمنت",
"wikibase-entitytermsview-entitytermsforlanguagelistview-toggler": "به 
زبان‌های بیشتر",

"wikibase-entitytermsview-entitytermsforlanguagelistview-configure-link-label": 
"پیکربندی",
"wikibase-setting-entitytermsview-showEntitytermslistview": "نمایش 
برچسب‌ها، نام‌های مستعار و توضیحات‌ها به تمام زبان‌هایی که بلدم",
@@ -175,6 +176,7 @@
"wikibase-newproperty-datatype": "نوع داده:",
"wikibase-newproperty-invalid-datatype": "نوع داده غیر معتبر است",
"wikibase-newproperty-pick-data-type": "(یک نوع داده انتخاب کنید)",
+   "wikibase-description-helppage": "Help:توضیحات",
"wikibase-label-helppage": "Help:برچسب‌ها",
"special-newitem": "ایجاد یک آیتم تازه",
"wikibase-newitem-summary": "مطمئن شوید که [[Special:Search|اگر آیتم 
مربوطه از قبل وجود داشته باشد]]! شما باید یک 
[[{{int:Wikibase-label-helppage}}|برچسب]] و 
[[{{int:Wikibase-description-helppage}}|توضیح]] برای همهٔ آیتم‌های تازه ایجاد 
کنید.",
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index e1a7841..d37eef8 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1298,7 +1298,7 @@
 "source": {
 "type": "git",
 "url": 
"https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikibase;,
-"reference": "14bed7070fc07bb9ca6a2cc653d727228029360a"
+"reference": "45dabf27253840cc8271fbf59a8c05324e6b9400"
 },
 "require": {
 "composer/installers": ">=1.0.1",
@@ -1327,7 +1327,7 @@
 "mediawiki/minus-x": "0.1.0",
 "wikibase/wikibase-codesniffer": "^0.2.0"
 },
-"time": "2017-11-24