[MediaWiki-commits] [Gerrit] Convert autoloader to PSR-4 - change (wikimedia/wikimania-scholarships)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Convert autoloader to PSR-4
..


Convert autoloader to PSR-4

Change-Id: If74ba93656c1ef2000d909783b2cd5fd6a3bc19f
---
M composer.json
R src/App.php
R src/Auth/AuthManager.php
R src/Auth/UserData.php
R src/Communities.php
R src/Controllers/Admin/Settings.php
R src/Controllers/Admin/User.php
R src/Controllers/Admin/Users.php
R src/Controllers/Login.php
R src/Controllers/RevalidateCsrf.php
R src/Controllers/Review/Application.php
R src/Controllers/Review/Communities.php
R src/Controllers/Review/Countries.php
R src/Controllers/Review/Phase1List.php
R src/Controllers/Review/Phase2List.php
R src/Controllers/Review/PhaseGrid.php
R src/Controllers/Review/Regions.php
R src/Controllers/Review/Scores.php
R src/Controllers/Review/Search.php
R src/Controllers/ScholarshipApplication.php
R src/Controllers/User/ChangePassword.php
R src/Countries.php
R src/Dao/Apply.php
R src/Dao/Settings.php
R src/Dao/User.php
R src/Forms/Apply.php
R src/Wikis.php
R tests/CountriesTest.php
M vendor/composer/autoload_classmap.php
M vendor/composer/autoload_namespaces.php
M vendor/composer/autoload_psr4.php
31 files changed, 34 insertions(+), 28 deletions(-)

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



diff --git a/composer.json b/composer.json
index 3a15e9b..aaf6414 100644
--- a/composer.json
+++ b/composer.json
@@ -8,10 +8,15 @@
"wikimedia/slimapp": "0.6.0"
},
"autoload": {
-   "psr-0": {
+   "psr-4": {
"Wikimania\\Scholarship\\": "src/"
}
},
+   "autoload-dev": {
+   "psr-4": {
+   "Wikimania\\Scholarship\\": "tests/"
+   }
+   },
"config": {
"optimize-autoloader": true,
"preferred-install": "dist"
diff --git a/src/Wikimania/Scholarship/App.php b/src/App.php
similarity index 100%
rename from src/Wikimania/Scholarship/App.php
rename to src/App.php
diff --git a/src/Wikimania/Scholarship/Auth/AuthManager.php 
b/src/Auth/AuthManager.php
similarity index 100%
rename from src/Wikimania/Scholarship/Auth/AuthManager.php
rename to src/Auth/AuthManager.php
diff --git a/src/Wikimania/Scholarship/Auth/UserData.php b/src/Auth/UserData.php
similarity index 100%
rename from src/Wikimania/Scholarship/Auth/UserData.php
rename to src/Auth/UserData.php
diff --git a/src/Wikimania/Scholarship/Communities.php b/src/Communities.php
similarity index 100%
rename from src/Wikimania/Scholarship/Communities.php
rename to src/Communities.php
diff --git a/src/Wikimania/Scholarship/Controllers/Admin/Settings.php 
b/src/Controllers/Admin/Settings.php
similarity index 100%
rename from src/Wikimania/Scholarship/Controllers/Admin/Settings.php
rename to src/Controllers/Admin/Settings.php
diff --git a/src/Wikimania/Scholarship/Controllers/Admin/User.php 
b/src/Controllers/Admin/User.php
similarity index 100%
rename from src/Wikimania/Scholarship/Controllers/Admin/User.php
rename to src/Controllers/Admin/User.php
diff --git a/src/Wikimania/Scholarship/Controllers/Admin/Users.php 
b/src/Controllers/Admin/Users.php
similarity index 100%
rename from src/Wikimania/Scholarship/Controllers/Admin/Users.php
rename to src/Controllers/Admin/Users.php
diff --git a/src/Wikimania/Scholarship/Controllers/Login.php 
b/src/Controllers/Login.php
similarity index 100%
rename from src/Wikimania/Scholarship/Controllers/Login.php
rename to src/Controllers/Login.php
diff --git a/src/Wikimania/Scholarship/Controllers/RevalidateCsrf.php 
b/src/Controllers/RevalidateCsrf.php
similarity index 100%
rename from src/Wikimania/Scholarship/Controllers/RevalidateCsrf.php
rename to src/Controllers/RevalidateCsrf.php
diff --git a/src/Wikimania/Scholarship/Controllers/Review/Application.php 
b/src/Controllers/Review/Application.php
similarity index 100%
rename from src/Wikimania/Scholarship/Controllers/Review/Application.php
rename to src/Controllers/Review/Application.php
diff --git a/src/Wikimania/Scholarship/Controllers/Review/Communities.php 
b/src/Controllers/Review/Communities.php
similarity index 100%
rename from src/Wikimania/Scholarship/Controllers/Review/Communities.php
rename to src/Controllers/Review/Communities.php
diff --git a/src/Wikimania/Scholarship/Controllers/Review/Countries.php 
b/src/Controllers/Review/Countries.php
similarity index 100%
rename from src/Wikimania/Scholarship/Controllers/Review/Countries.php
rename to src/Controllers/Review/Countries.php
diff --git a/src/Wikimania/Scholarship/Controllers/Review/Phase1List.php 
b/src/Controllers/Review/Phase1List.php
similarity index 100%
rename from src/Wikimania/Scholarship/Controllers/Review/Phase1List.php
rename to src/Controllers/Review/Phase1List.php
diff --git a/src/Wikimania/Scholarship/Controllers/Review/Phase2List.php 
b/src/Controllers/Review/Phase2List.php
simi

[MediaWiki-commits] [Gerrit] Update firebase/php-jwt to 3.0.0 - change (mediawiki/vendor)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update firebase/php-jwt to 3.0.0
..


Update firebase/php-jwt to 3.0.0

Bug: T119294
Change-Id: I0abdddb3716fb585528fd01d9aaf6050b1b8b659
---
M composer.json
M composer.lock
M composer/autoload_classmap.php
M composer/autoload_psr4.php
M composer/installed.json
M firebase/php-jwt/.gitignore
D firebase/php-jwt/Exceptions/BeforeValidException.php
D firebase/php-jwt/Exceptions/ExpiredException.php
D firebase/php-jwt/Exceptions/SignatureInvalidException.php
M firebase/php-jwt/README.md
M firebase/php-jwt/composer.json
A firebase/php-jwt/composer.lock
M firebase/php-jwt/package.xml
A firebase/php-jwt/src/BeforeValidException.php
A firebase/php-jwt/src/ExpiredException.php
R firebase/php-jwt/src/JWT.php
A firebase/php-jwt/src/SignatureInvalidException.php
M firebase/php-jwt/tests/JWTTest.php
18 files changed, 256 insertions(+), 155 deletions(-)

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



diff --git a/composer.json b/composer.json
index badf00a..0b88736 100644
--- a/composer.json
+++ b/composer.json
@@ -11,7 +11,7 @@
"require": {
"composer/semver": "1.2.0",
"cssjanus/cssjanus": "1.1.1",
-   "firebase/php-jwt": "2.1.0",
+   "firebase/php-jwt": "3.0.0",
"kzykhys/pygments": "1.0",
"liuggio/statsd-php-client": "1.0.16",
"mediawiki/at-ease": "1.1.0",
diff --git a/composer.lock b/composer.lock
index e975304..715e1cc 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file";,
 "This file is @generated automatically"
 ],
-"hash": "2ee039fecd20f1c1039e1e81db0343ef",
-"content-hash": "a8f89a030e0ee24078766f8f467769a4",
+"hash": "e5cc6ed39a0396942cb1bd9447a12204",
+"content-hash": "35145185a983e3c784e513b7c3533149",
 "packages": [
 {
 "name": "composer/semver",
@@ -106,27 +106,26 @@
 },
 {
 "name": "firebase/php-jwt",
-"version": "v2.1.0",
+"version": "v3.0.0",
 "source": {
 "type": "git",
 "url": "https://github.com/firebase/php-jwt.git";,
-"reference": "fb219727e199dd80a72d5274ebb5c8b24d58dd9b"
+"reference": "fa8a06e96526eb7c0eeaa47e4f39be59d21f16e1"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/firebase/php-jwt/zipball/fb219727e199dd80a72d5274ebb5c8b24d58dd9b";,
-"reference": "fb219727e199dd80a72d5274ebb5c8b24d58dd9b",
+"url": 
"https://api.github.com/repos/firebase/php-jwt/zipball/fa8a06e96526eb7c0eeaa47e4f39be59d21f16e1";,
+"reference": "fa8a06e96526eb7c0eeaa47e4f39be59d21f16e1",
 "shasum": ""
 },
 "require": {
-"php": ">=5.2.0"
+"php": ">=5.3.0"
 },
 "type": "library",
 "autoload": {
-"classmap": [
-"Authentication/",
-"Exceptions/"
-]
+"psr-4": {
+"Firebase\\JWT\\": "src"
+}
 },
 "notification-url": "https://packagist.org/downloads/";,
 "license": [
@@ -146,7 +145,7 @@
 ],
 "description": "A simple library to encode and decode JSON Web 
Tokens (JWT) in PHP. Should conform to the current spec.",
 "homepage": "https://github.com/firebase/php-jwt";,
-"time": "2015-05-20 19:16:04"
+"time": "2015-07-22 18:31:08"
 },
 {
 "name": "kzykhys/pygments",
diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php
index c76a51a..ed971b5 100644
--- a/composer/autoload_classmap.php
+++ b/composer/autoload_classmap.php
@@ -41,7 +41,6 @@
 'AvroStringIO' => $vendorDir . '/wikimedia/avro/lib/avro/io.php',
 'AvroUnionSchema' => $vendorDir . '/wikimedia/avro/lib/avro/schema.php',
 'AvroUtil' => $vendorDir . '/wikimedia/avro/lib/avro/util.php',
-'BeforeValidException' => $vendorDir . 
'/firebase/php-jwt/Exceptions/BeforeValidException.php',
 'CLDRPluralRuleParser\\Converter' => $vendorDir . 
'/wikimedia/cldr-plural-rule-parser/src/Converter.php',
 'CLDRPluralRuleParser\\Converter\\Expression' => $vendorDir . 
'/wikimedia/cldr-plural-rule-parser/src/Converter/Expression.php',
 'CLDRPluralRuleParser\\Converter\\Fragment' => $vendorDir . 
'/wikimedia/cldr-plural-rule-parser/src/Converter/Fragment.php',
@@ -282,9 +281,11 @@
 'Elastica\\Type\\AbstractType' => $vendorDir . 
'/ruflin/elastica/lib/Elastica/Type/AbstractType.php',
 'Elastica\\Type\\

[MediaWiki-commits] [Gerrit] Dump Flow data - change (mediawiki...Flow)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Dump Flow data
..


Dump Flow data

A big chunk of this patch is a refactoring of the search updaters.
I wanted to reuse the code that already iterators over all header
& topics, but it was unwieldly. I split that into separate classes
that are now Iterator objects.

Other changes:
* Fixed Flow\Search\Connection, which could no longer call
parent::__construct since that no longer exists
* Flow\Container couldn’t be autoloaded from maintenance
script's constructor (autoload not yet initialized, I assume)
* FlowFixWorkflowLastUpdateTimestamp.php was failing because
getBinary now returns a UUIDBlob instead of the plain binary string

Bug: T89398
Change-Id: I52bc7c0ce7813a78f9006ca4b7d931a905726c05
---
M autoload.php
M container.php
A includes/Dump/Exporter.php
A includes/Search/Iterators/AbstractIterator.php
A includes/Search/Iterators/HeaderIterator.php
A includes/Search/Iterators/TopicIterator.php
D includes/Search/TopicUpdater.php
D includes/Search/Updater.php
A includes/Search/Updaters/AbstractUpdater.php
R includes/Search/Updaters/HeaderUpdater.php
A includes/Search/Updaters/TopicUpdater.php
M maintenance/FlowFixWorkflowLastUpdateTimestamp.php
M maintenance/FlowForceSearchIndex.php
A maintenance/dumpBackup.php
14 files changed, 1,133 insertions(+), 482 deletions(-)

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



diff --git a/autoload.php b/autoload.php
index 91d368e..5dfa95f 100644
--- a/autoload.php
+++ b/autoload.php
@@ -114,6 +114,7 @@
'Flow\\Data\\Utils\\SortRevisionsByRevisionId' => __DIR__ . 
'/includes/Data/Utils/SortRevisionsByRevisionId.php',
'Flow\\Data\\Utils\\UserMerger' => __DIR__ . 
'/includes/Data/Utils/UserMerger.php',
'Flow\\DbFactory' => __DIR__ . '/includes/DbFactory.php',
+   'Flow\\Dump\\Exporter' => __DIR__ . '/includes/Dump/Exporter.php',
'Flow\\Exception\\CatchableFatalErrorException' => __DIR__ . 
'/includes/Exception/CatchableFatalErrorException.php',
'Flow\\Exception\\CrossWikiException' => __DIR__ . 
'/includes/Exception/ExceptionHandling.php',
'Flow\\Exception\\DataModelException' => __DIR__ . 
'/includes/Exception/ExceptionHandling.php',
@@ -279,12 +280,15 @@
'Flow\\Repository\\UserName\\UserNameQuery' => __DIR__ . 
'/includes/Repository/UserName/UserNameQuery.php',
'Flow\\RevisionActionPermissions' => __DIR__ . 
'/includes/RevisionActionPermissions.php',
'Flow\\Search\\Connection' => __DIR__ . 
'/includes/Search/Connection.php',
-   'Flow\\Search\\HeaderUpdater' => __DIR__ . 
'/includes/Search/HeaderUpdater.php',
+   'Flow\\Search\\Iterators\\AbstractIterator' => __DIR__ . 
'/includes/Search/Iterators/AbstractIterator.php',
+   'Flow\\Search\\Iterators\\HeaderIterator' => __DIR__ . 
'/includes/Search/Iterators/HeaderIterator.php',
+   'Flow\\Search\\Iterators\\TopicIterator' => __DIR__ . 
'/includes/Search/Iterators/TopicIterator.php',
'Flow\\Search\\Maintenance\\MappingConfigBuilder' => __DIR__ . 
'/includes/Search/maintenance/MappingConfigBuilder.php',
'Flow\\Search\\SearchEngine' => __DIR__ . 
'/includes/Search/SearchEngine.php',
'Flow\\Search\\Searcher' => __DIR__ . '/includes/Search/Searcher.php',
-   'Flow\\Search\\TopicUpdater' => __DIR__ . 
'/includes/Search/TopicUpdater.php',
-   'Flow\\Search\\Updater' => __DIR__ . '/includes/Search/Updater.php',
+   'Flow\\Search\\Updaters\\AbstractUpdater' => __DIR__ . 
'/includes/Search/Updaters/AbstractUpdater.php',
+   'Flow\\Search\\Updaters\\HeaderUpdater' => __DIR__ . 
'/includes/Search/Updaters/HeaderUpdater.php',
+   'Flow\\Search\\Updaters\\TopicUpdater' => __DIR__ . 
'/includes/Search/Updaters/TopicUpdater.php',
'Flow\\SpamFilter\\AbuseFilter' => __DIR__ . 
'/includes/SpamFilter/AbuseFilter.php',
'Flow\\SpamFilter\\ConfirmEdit' => __DIR__ . 
'/includes/SpamFilter/ConfirmEdit.php',
'Flow\\SpamFilter\\ContentLengthFilter' => __DIR__ . 
'/includes/SpamFilter/ContentLengthFilter.php',
diff --git a/container.php b/container.php
index 31dabde..6eb11b0 100644
--- a/container.php
+++ b/container.php
@@ -1032,12 +1032,18 @@
global $wgFlowSearchServers, $wgFlowSearchConnectionAttempts;
return new Flow\Search\Connection( $wgFlowSearchServers, 
$wgFlowSearchConnectionAttempts );
 };
+$c['search.index.iterators.header'] = function( $c ) {
+   return new \Flow\Search\Iterators\HeaderIterator( $c['db.factory'] );
+};
+$c['search.index.iterators.topic'] = function( $c ) {
+   return new \Flow\Search\Iterators\TopicIterator( $c['db.factory'], 
$c['loader.root_post'] );
+};
 $c['search.index.updaters'] = function( $c ) {
// permissions for anon user
$anonPermissions = new Flow\RevisionActionPermissions( 
$c['flow_actions'], new User );
return array(
- 

[MediaWiki-commits] [Gerrit] Import Flow data dump - change (mediawiki...Flow)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Import Flow data dump
..


Import Flow data dump

Meanwhile also changes some Models to allow empty values as well
for nullable columns.

Bug: T114703
Change-Id: Ieae618d4aaa4b21a4eb8fe8d1f0627ee8bd1ff8d
---
M Flow.php
M Hooks.php
M autoload.php
M includes/Data/Listener/ReferenceRecorder.php
A includes/Dump/Importer.php
M includes/Model/AbstractRevision.php
M includes/Model/PostRevision.php
7 files changed, 303 insertions(+), 6 deletions(-)

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



diff --git a/Flow.php b/Flow.php
index 925b372..000d7be 100644
--- a/Flow.php
+++ b/Flow.php
@@ -154,6 +154,7 @@
 $wgHooks['ArticleDeleteComplete'][] = 'FlowHooks::onArticleDeleteComplete';
 $wgHooks['ArticleUndelete'][] = 'FlowHooks::onArticleUndelete';
 $wgHooks['SearchableNamespaces'][] = 'FlowHooks::onSearchableNamespaces';
+$wgHooks['ImportHandleToplevelXMLTag'][] = 
'FlowHooks::onImportHandleToplevelXMLTag';
 
 // Extension:UserMerge support
 $wgHooks['UserMergeAccountFields'][] = 'FlowHooks::onUserMergeAccountFields';
diff --git a/Hooks.php b/Hooks.php
index 7fbca28..4aa7289 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -1768,4 +1768,61 @@
return true;
}
 
+   /**
+* @param WikiImporter $importer
+* @return bool
+*/
+   public static function onImportHandleToplevelXMLTag( WikiImporter 
$importer ) {
+   // only init Flow's importer once, then re-use it
+   static $flowImporter = null;
+   if ( $flowImporter === null ) {
+   // importer can be dry-run (= parse, but don't store), 
but we can only
+   // derive that from mPageOutCallback. I'll set a new 
value (which will
+   // return the existing value) to see if it's in dry-run 
mode (= null)
+   $callback = $importer->setPageOutCallback( null );
+   // restore previous mPageOutCallback value
+   $importer->setPageOutCallback( $callback );
+
+   $flowImporter = new \Flow\Dump\Importer( $importer );
+   if ( $callback !== null ) {
+   // not in dry-run mode
+   $flowImporter->setStorage( Container::get( 
'storage' ) );
+   }
+   }
+
+   $reader = $importer->getReader();
+   $tag = $reader->localName;
+   $type = $reader->nodeType;
+
+   if ( $tag == 'board' ) {
+   if ( $type === XMLReader::ELEMENT ) {
+   $flowImporter->handleBoard();
+   }
+   return false;
+   } elseif ( $tag == 'description' ) {
+   if ( $type === XMLReader::ELEMENT ) {
+   $flowImporter->handleHeader();
+   }
+   return false;
+   } elseif ( $tag == 'topic' ) {
+   if ( $type === XMLReader::ELEMENT ) {
+   $flowImporter->handleTopic();
+   }
+   return false;
+   } elseif ( $tag == 'post' ) {
+   if ( $type === XMLReader::ELEMENT ) {
+   $flowImporter->handlePost();
+   }
+   return false;
+   } elseif ( $tag == 'summary' ) {
+   if ( $type === XMLReader::ELEMENT ) {
+   $flowImporter->handleSummary();
+   }
+   return false;
+   } elseif ( $tag == 'children' ) {
+   return false;
+   }
+
+   return true;
+   }
 }
diff --git a/autoload.php b/autoload.php
index 5dfa95f..583baf3 100644
--- a/autoload.php
+++ b/autoload.php
@@ -115,6 +115,7 @@
'Flow\\Data\\Utils\\UserMerger' => __DIR__ . 
'/includes/Data/Utils/UserMerger.php',
'Flow\\DbFactory' => __DIR__ . '/includes/DbFactory.php',
'Flow\\Dump\\Exporter' => __DIR__ . '/includes/Dump/Exporter.php',
+   'Flow\\Dump\\Importer' => __DIR__ . '/includes/Dump/Importer.php',
'Flow\\Exception\\CatchableFatalErrorException' => __DIR__ . 
'/includes/Exception/CatchableFatalErrorException.php',
'Flow\\Exception\\CrossWikiException' => __DIR__ . 
'/includes/Exception/ExceptionHandling.php',
'Flow\\Exception\\DataModelException' => __DIR__ . 
'/includes/Exception/ExceptionHandling.php',
diff --git a/includes/Data/Listener/ReferenceRecorder.php 
b/includes/Data/Listener/ReferenceRecorder.php
index 358ec64..95baa62 100644
--- a/includes/Data/Listener/ReferenceRecorder.php
+++ b/includes/Data/Listener/ReferenceRecorder.php
@@

[MediaWiki-commits] [Gerrit] Improve snippet generation - change (mediawiki...MathSearch)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Improve snippet generation
..


Improve snippet generation

Change-Id: Ib201ba5a2693f516ac377ac28df6cb100bb6a93e
---
M includes/special/SpecialMlpEval.php
1 file changed, 48 insertions(+), 7 deletions(-)

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



diff --git a/includes/special/SpecialMlpEval.php 
b/includes/special/SpecialMlpEval.php
index a2dc2fe..7b1eaba 100644
--- a/includes/special/SpecialMlpEval.php
+++ b/includes/special/SpecialMlpEval.php
@@ -13,13 +13,14 @@
  */
 class SpecialMlpEval extends SpecialPage {
const MAX_ATTEMPTS = 10;
-   const WINDOW_SIZE = 500;
+   const WINDOW_SIZE = 1200;
private $step = 1;
/**
 * @var Title
 */
private $title;
private $wikitext;
+   private $snippet;
private $mathTags;
private $revison;
private $lastError = false;
@@ -179,6 +180,7 @@
return LoggerFactory::getInstance( 'MathSearch' );
}
 
+
/**
 * @return array
 * @throws MWException
@@ -190,23 +192,62 @@
$tag = $this->mathTags[$unique];
$formDescriptor = array();
$this->getOutput()->addWikiText( $tag[3] );
-
$tagPos = strpos( $this->wikitext, $unique );
$wikiText = $this->wikitext;
-   $wikiText = substr( $wikiText,
-   max( $tagPos - self::WINDOW_SIZE, 0 ),
-   min( 2 * self::WINDOW_SIZE, strlen( $wikiText ) - 
$tagPos ) );
+   $startPos = $this->getStartPos( $tagPos, $wikiText );
+   $length = $this->getEndPos( $tagPos, $wikiText ) - $startPos;
+   $wikiText = substr( $wikiText, $startPos, $length );
$wikiText = str_replace( $unique,
'' . $tag[3] . '',
$wikiText );
foreach ( $this->mathTags as $key => $content ) {
$wikiText = str_replace( $key, $content[3], $wikiText );
}
-
-   $this->getOutput()->addWikiText( "== Extract 
==\n...\n$wikiText\n..." );
+   $this->snippet = "== Extract ==\nStart of the 
extract...\n\n$wikiText\n\n...end of the extract";
+   $this->getOutput()->addWikiText( $this->snippet );
$url = $this->title->getLinkURL();
$this->getOutput()
->addHTML( "Full 
article (new Window)" );
return array( $tagCount, $formDescriptor, $wikiText );
}
+
+   /**
+* @param $tagPos
+* @param $wikiText
+* @return array
+*/
+   private function getStartPos( $tagPos, $wikiText ) {
+   $startPos = max( $tagPos - round( self::WINDOW_SIZE / 2 ), 0 );
+   if ( $startPos > 0 ) {
+   // Heuristics to find a reasonable cutting point
+   $newPos = strpos( $wikiText, "\n", $startPos );
+   if ( $newPos !== false && ( $newPos - $startPos ) < 
round( self::WINDOW_SIZE / 4 ) ) {
+   // only change startPos, if it seems reasonable
+   $startPos = $newPos;
+   }
+   }
+   return $startPos;
+   }
+
+   /**
+* @param $wikiText
+* @param $tagPos
+* @return bool|int|mixed
+*/
+   private function getEndPos( $tagPos, $wikiText ) {
+   $halfWindow = round( self::WINDOW_SIZE / 2 );
+   $distance2End = strlen( $wikiText ) - $tagPos;
+   if ( $distance2End > $halfWindow ) {
+   $newPos = strpos( $wikiText, "\n", $tagPos + 
$halfWindow );
+   if ( $newPos !== false && ( $newPos - $tagPos ) < 
round( 3 / 4 * self::WINDOW_SIZE ) ) {
+   // only change startPos, if it seems reasonable
+   return $newPos;
+   } else {
+   return $tagPos + $halfWindow;
+   }
+   } else {
+   return strlen( $wikiText );
+   }
+   }
+
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib201ba5a2693f516ac377ac28df6cb100bb6a93e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt 
Gerrit-Reviewer: Dyiop 
Gerrit-Reviewer: Hcohl 
Gerrit-Reviewer: Physikerwelt 
Gerrit-Reviewer: Whyameri 
Gerrit-Reviewer: jenkins-bot <>

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

[MediaWiki-commits] [Gerrit] role: Move quarry to use autolayout - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: role: Move quarry to use autolayout
..

role: Move quarry to use autolayout

Change-Id: If3ebe3c804de25029e0f176dae6d7b24fb4f8eda
---
D manifests/role/labsquarry.pp
A manifests/role/quarry.pp
2 files changed, 43 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/82/255082/1

diff --git a/manifests/role/labsquarry.pp b/manifests/role/labsquarry.pp
deleted file mode 100644
index 7fb90c0..000
--- a/manifests/role/labsquarry.pp
+++ /dev/null
@@ -1,39 +0,0 @@
-class role::labs::quarry::web {
-include role::labs::lvm::srv
-include ::labs_debrepo
-
-class { '::quarry::web':
-require => [Mount['/srv'], Class['::labs_debrepo']],
-}
-}
-
-class role::labs::quarry::celeryrunner {
-include role::labs::lvm::srv
-include ::labs_debrepo
-
-class { '::quarry::celeryrunner':
-require => [Mount['/srv'], Class['::labs_debrepo']],
-}
-}
-
-class role::labs::quarry::database {
-include role::labs::lvm::srv
-
-class { '::quarry::database':
-require => Mount['/srv']
-}
-}
-
-class role::labs::quarry::redis {
-include role::labs::lvm::srv
-
-class { '::quarry::redis':
-require => Mount['/srv']
-}
-}
-
-# Should be included on an instance that already has
-# a Quarry install (celery or web) setup
-class role::labs::quarry::killer {
-include quarry::querykiller
-}
diff --git a/manifests/role/quarry.pp b/manifests/role/quarry.pp
new file mode 100644
index 000..46845a1
--- /dev/null
+++ b/manifests/role/quarry.pp
@@ -0,0 +1,43 @@
+class role::quarry::web {
+include ::labs_debrepo
+
+requires_realm('labs')
+
+class { '::quarry::web':
+require => Class['::labs_debrepo'],
+}
+}
+
+class role::quarry::celeryrunner {
+include ::labs_debrepo
+
+requires_realm('labs')
+
+class { '::quarry::celeryrunner':
+require => Class['::labs_debrepo'],
+}
+}
+
+class role::quarry::database {
+
+requires_realm('labs')
+
+class { '::quarry::database':
+}
+}
+
+class role::quarry::redis {
+include role::labs::lvm::srv
+
+requires_realm('labs')
+
+class { '::quarry::redis':
+require => Mount['/srv']
+}
+}
+
+# Should be included on an instance that already has
+# a Quarry install (celery or web) setup
+class role::quarry::killer {
+include quarry::querykiller
+}

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

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

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


[MediaWiki-commits] [Gerrit] k8s: Remove standalone role - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: k8s: Remove standalone role
..

k8s: Remove standalone role

Isn't really used anywhere - All the actual roles are in tools.pp

Change-Id: I8734f6535b6f57090fe7b9e717dc19ba145a8e15
---
D manifests/role/labsk8s.pp
1 file changed, 0 insertions(+), 32 deletions(-)


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

diff --git a/manifests/role/labsk8s.pp b/manifests/role/labsk8s.pp
deleted file mode 100644
index 9aca91c..000
--- a/manifests/role/labsk8s.pp
+++ /dev/null
@@ -1,32 +0,0 @@
-class role::labs::k8s::master {
-$master_host = hiera('k8s_master', $::fqdn)
-$etcd_servers = hiera('etcd_servers')
-
-class { 'k8s::apiserver':
-master_host => $master_host,
-etcd_servers => $etcd_servers,
-
-}
-
-class { 'k8s::scheduler':
-master_host => $master_host,
-}
-
-class { 'k8s::controller':
-master_host => $master_host,
-}
-}
-
-class role::labs::k8s::worker {
-include k8s::docker
-
-$master_host = hiera('k8s_master', $::fqdn)
-
-class { 'k8s::proxy':
-master_host => $master_host,
-}
-
-class { 'k8s::kubelet':
-master_host => $master_host,
-}
-}

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

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

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


[MediaWiki-commits] [Gerrit] Move all monitoring groups to one file - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: Move all monitoring groups to one file
..

Move all monitoring groups to one file

Since they have to be imported directly into site.pp (for now),
we shall keep them cleanly in a separate file

Change-Id: Ieb322327e5471c97a5d7707ae25d90972482f61a
---
A manifests/monitoring_groups.pp
M manifests/role/analytics.pp
M manifests/role/aqs.pp
D manifests/role/cache.pp
M manifests/role/coredb.pp
M manifests/role/elasticsearch.pp
M manifests/role/etcd.pp
M manifests/role/ganeti.pp
M manifests/role/logstash.pp
D manifests/role/lvs.pp
M manifests/role/maps.pp
M manifests/role/mediawiki.pp
M manifests/role/memcached.pp
M manifests/role/ocg.pp
M manifests/role/openldap.pp
M manifests/role/parsoid.pp
M manifests/role/rcstream.pp
M manifests/role/redisdb.pp
M manifests/role/restbase.pp
M manifests/role/sca.pp
M manifests/role/scb.pp
M manifests/role/swift.pp
M manifests/role/wdqs.pp
M manifests/role/zotero.pp
M manifests/site.pp
M modules/role/manifests/labs/openstack/nova.pp
26 files changed, 119 insertions(+), 129 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/80/255080/1

diff --git a/manifests/monitoring_groups.pp b/manifests/monitoring_groups.pp
new file mode 100644
index 000..8a394ed
--- /dev/null
+++ b/manifests/monitoring_groups.pp
@@ -0,0 +1,118 @@
+# This file contains virtual resources for setting up monitoring groups
+# This needs to be directly 'imported' for now and hence is in a separate
+# file. 
+# Please keep this list alphabetically ordered!
+
+# Analytics
+@monitoring::group { 'analytics_eqiad': description => 'analytics servers in 
eqiad' }
+
+# Analytics Query Service
+@monitoring::group { 'aqs_eqiad': description => 'Analytics Query Service 
eqiad' }
+@monitoring::group { 'aqs_codfw': description => 'Analytics Query Service 
codfw' }
+
+# Cache
+@monitoring::group { 'cache_text_codfw': description => 'codfw text Varnish' }
+@monitoring::group { 'cache_text_eqiad': description => 'eqiad text Varnish' }
+@monitoring::group { 'cache_text_esams': description => 'esams text Varnish' }
+@monitoring::group { 'cache_text_ulsfo': description => 'ulsfo text Varnish' }
+@monitoring::group { 'cache_upload_codfw': description => 'codfw upload 
Varnish' }
+@monitoring::group { 'cache_upload_eqiad': description => 'eqiad upload 
Varnish' }
+@monitoring::group { 'cache_upload_esams': description => 'esams upload 
Varnish' }
+@monitoring::group { 'cache_upload_ulsfo': description => 'ulsfo upload 
Varnish' }
+@monitoring::group { 'cache_mobile_codfw': description => 'codfw mobile 
Varnish' }
+@monitoring::group { 'cache_mobile_eqiad': description => 'eqiad mobile 
Varnish' }
+@monitoring::group { 'cache_mobile_esams': description => 'esams mobile 
Varnish' }
+@monitoring::group { 'cache_mobile_ulsfo': description => 'ulsfo mobile 
Varnish' }
+@monitoring::group { 'cache_parsoid_eqiad': description => 'Parsoid caches 
eqiad' }
+@monitoring::group { 'cache_parsoid_codfw': description => 'Parsoid caches 
codfw' }
+@monitoring::group { 'cache_misc_eqiad': description => 'Misc caches eqiad' }
+@monitoring::group { 'cache_maps_eqiad': description => 'Maps caches eqiad' }
+
+# Elasticsearch
+@monitoring::group { 'elasticsearch_eqiad': description => 'eqiad 
elasticsearch servers' }
+@monitoring::group { 'elasticsearch_codfw': description => 'codfw 
elasticsearch servers' }
+@monitoring::group { 'elasticsearch_esams': description => 'esams 
elasticsearch servers' }
+@monitoring::group { 'elasticsearch_ulsfo': description => 'ulsfo 
elasticsearch servers' }
+
+# Etcd
+@monitoring::group { 'etcd_eqiad': description => 'eqiad Etcd' }
+
+# Ganeti
+@monitoring::group { 'ganeti_eqiad': description => 'Ganeti virt cluster 
eqiad' }
+@monitoring::group { 'ganeti_codfw': description => 'Ganeti virt cluster 
codfw' }
+
+# Labs OpenStack Nova (labvirt***)
+@monitoring::group { 'virt_eqiad': description => 'eqiad virt servers' }
+@monitoring::group { 'virt_codfw': description => 'codfw virt servers' }
+
+# LVS
+@monitoring::group { 'lvs': description => 'LVS' }
+@monitoring::group { 'lvs_eqiad': description => 'eqiad LVS servers' }
+@monitoring::group { 'lvs_codfw': description => 'codfw LVS servers' }
+@monitoring::group { 'lvs_ulsfo': description => 'ulsfo LVS servers' }
+@monitoring::group { 'lvs_esams': description => 'esams LVS servers' }
+
+# Logstash
+@monitoring::group { 'logstash_eqiad': description => 'eqiad logstash' }
+
+# Maps
+@monitoring::group { 'maps_eqiad': description => 'eqiad maps servers' }
+@monitoring::group { 'maps_codfw': description => 'codfw maps servers' }
+
+# MediaWiki
+@monitoring::group { 'appserver_eqiad': description => 'eqiad application 
servers' }
+@monitoring::group { 'api_appserver_eqiad': description => 'eqiad API 
application servers' }
+@monitoring::group { 'imagescaler_

[MediaWiki-commits] [Gerrit] Improve snippet generation - change (mediawiki...MathSearch)

2015-11-23 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Improve snippet generation
..

Improve snippet generation

Change-Id: Ib201ba5a2693f516ac377ac28df6cb100bb6a93e
---
M includes/special/SpecialMlpEval.php
1 file changed, 48 insertions(+), 7 deletions(-)


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

diff --git a/includes/special/SpecialMlpEval.php 
b/includes/special/SpecialMlpEval.php
index a2dc2fe..7b1eaba 100644
--- a/includes/special/SpecialMlpEval.php
+++ b/includes/special/SpecialMlpEval.php
@@ -13,13 +13,14 @@
  */
 class SpecialMlpEval extends SpecialPage {
const MAX_ATTEMPTS = 10;
-   const WINDOW_SIZE = 500;
+   const WINDOW_SIZE = 1200;
private $step = 1;
/**
 * @var Title
 */
private $title;
private $wikitext;
+   private $snippet;
private $mathTags;
private $revison;
private $lastError = false;
@@ -179,6 +180,7 @@
return LoggerFactory::getInstance( 'MathSearch' );
}
 
+
/**
 * @return array
 * @throws MWException
@@ -190,23 +192,62 @@
$tag = $this->mathTags[$unique];
$formDescriptor = array();
$this->getOutput()->addWikiText( $tag[3] );
-
$tagPos = strpos( $this->wikitext, $unique );
$wikiText = $this->wikitext;
-   $wikiText = substr( $wikiText,
-   max( $tagPos - self::WINDOW_SIZE, 0 ),
-   min( 2 * self::WINDOW_SIZE, strlen( $wikiText ) - 
$tagPos ) );
+   $startPos = $this->getStartPos( $tagPos, $wikiText );
+   $length = $this->getEndPos( $tagPos, $wikiText ) - $startPos;
+   $wikiText = substr( $wikiText, $startPos, $length );
$wikiText = str_replace( $unique,
'' . $tag[3] . '',
$wikiText );
foreach ( $this->mathTags as $key => $content ) {
$wikiText = str_replace( $key, $content[3], $wikiText );
}
-
-   $this->getOutput()->addWikiText( "== Extract 
==\n...\n$wikiText\n..." );
+   $this->snippet = "== Extract ==\nStart of the 
extract...\n\n$wikiText\n\n...end of the extract";
+   $this->getOutput()->addWikiText( $this->snippet );
$url = $this->title->getLinkURL();
$this->getOutput()
->addHTML( "Full 
article (new Window)" );
return array( $tagCount, $formDescriptor, $wikiText );
}
+
+   /**
+* @param $tagPos
+* @param $wikiText
+* @return array
+*/
+   private function getStartPos( $tagPos, $wikiText ) {
+   $startPos = max( $tagPos - round( self::WINDOW_SIZE / 2 ), 0 );
+   if ( $startPos > 0 ) {
+   // Heuristics to find a reasonable cutting point
+   $newPos = strpos( $wikiText, "\n", $startPos );
+   if ( $newPos !== false && ( $newPos - $startPos ) < 
round( self::WINDOW_SIZE / 4 ) ) {
+   // only change startPos, if it seems reasonable
+   $startPos = $newPos;
+   }
+   }
+   return $startPos;
+   }
+
+   /**
+* @param $wikiText
+* @param $tagPos
+* @return bool|int|mixed
+*/
+   private function getEndPos( $tagPos, $wikiText ) {
+   $halfWindow = round( self::WINDOW_SIZE / 2 );
+   $distance2End = strlen( $wikiText ) - $tagPos;
+   if ( $distance2End > $halfWindow ) {
+   $newPos = strpos( $wikiText, "\n", $tagPos + 
$halfWindow );
+   if ( $newPos !== false && ( $newPos - $tagPos ) < 
round( 3 / 4 * self::WINDOW_SIZE ) ) {
+   // only change startPos, if it seems reasonable
+   return $newPos;
+   } else {
+   return $tagPos + $halfWindow;
+   }
+   } else {
+   return strlen( $wikiText );
+   }
+   }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib201ba5a2693f516ac377ac28df6cb100bb6a93e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MathSearch
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt 

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


[MediaWiki-commits] [Gerrit] Use Slimapp classes - change (wikimedia/wikimania-scholarships)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use Slimapp classes
..


Use Slimapp classes

Replace local classes with their Slimapp equivalents.

Bug: T114968
Change-Id: I7b3b584ee86ca83fc7ec7b900ac278442fc27630
---
M public/index.php
M src/Wikimania/Scholarship/App.php
A src/Wikimania/Scholarship/Auth/AuthManager.php
A src/Wikimania/Scholarship/Auth/UserData.php
D src/Wikimania/Scholarship/AuthManager.php
D src/Wikimania/Scholarship/Config.php
D src/Wikimania/Scholarship/Controller.php
M src/Wikimania/Scholarship/Controllers/Admin/Settings.php
M src/Wikimania/Scholarship/Controllers/Admin/User.php
M src/Wikimania/Scholarship/Controllers/Admin/Users.php
M src/Wikimania/Scholarship/Controllers/Login.php
M src/Wikimania/Scholarship/Controllers/RevalidateCsrf.php
M src/Wikimania/Scholarship/Controllers/Review/Application.php
M src/Wikimania/Scholarship/Controllers/Review/Communities.php
M src/Wikimania/Scholarship/Controllers/Review/Countries.php
M src/Wikimania/Scholarship/Controllers/Review/Phase1List.php
M src/Wikimania/Scholarship/Controllers/Review/Phase2List.php
M src/Wikimania/Scholarship/Controllers/Review/PhaseGrid.php
M src/Wikimania/Scholarship/Controllers/Review/Regions.php
M src/Wikimania/Scholarship/Controllers/Review/Scores.php
M src/Wikimania/Scholarship/Controllers/Review/Search.php
M src/Wikimania/Scholarship/Controllers/ScholarshipApplication.php
M src/Wikimania/Scholarship/Controllers/User/ChangePassword.php
D src/Wikimania/Scholarship/CsrfMiddleware.php
D src/Wikimania/Scholarship/Dao/AbstractDao.php
M src/Wikimania/Scholarship/Dao/Apply.php
M src/Wikimania/Scholarship/Dao/Settings.php
M src/Wikimania/Scholarship/Dao/User.php
D src/Wikimania/Scholarship/Form.php
M src/Wikimania/Scholarship/Forms/Apply.php
D src/Wikimania/Scholarship/HeaderMiddleware.php
D src/Wikimania/Scholarship/Mailer.php
D src/Wikimania/Scholarship/Password.php
D src/Wikimania/Scholarship/TwigExtension.php
D tests/Wikimania/Scholarship/ConfigTest.env
D tests/Wikimania/Scholarship/ConfigTest.php
D tests/Wikimania/Scholarship/FormTest.php
D tests/Wikimania/Scholarship/PasswordTest.php
M vendor/composer/autoload_classmap.php
39 files changed, 342 insertions(+), 2,092 deletions(-)

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



diff --git a/public/index.php b/public/index.php
index 7f567ea..0e7d2a9 100644
--- a/public/index.php
+++ b/public/index.php
@@ -34,7 +34,7 @@
 // Ensure that a default timezone is set
 set_error_handler(function ($errno, $errstr) {
throw new Exception( $errstr );
-});
+} );
 try {
date_default_timezone_get();
 } catch( Exception $e ) {
@@ -45,7 +45,7 @@
 
 // Load environment settings from .env if present
 if ( is_readable( APP_ROOT . '/.env' ) ) {
-   \Wikimania\Scholarship\Config::load( APP_ROOT . '/.env' );
+   \Wikimedia\Slimapp\Config::load( APP_ROOT . '/.env' );
 }
 
 $app = new \Wikimania\Scholarship\App( APP_ROOT );
diff --git a/src/Wikimania/Scholarship/App.php 
b/src/Wikimania/Scholarship/App.php
index 575d816..b720324 100644
--- a/src/Wikimania/Scholarship/App.php
+++ b/src/Wikimania/Scholarship/App.php
@@ -22,52 +22,50 @@
 
 namespace Wikimania\Scholarship;
 
+use Wikimania\Scholarship\Auth\AuthManager;
+
+use Wikimedia\SimpleI18n\I18nContext;
+use Wikimedia\SimpleI18n\JsonCache;
+use Wikimedia\Slimapp\AbstractApp;
+use Wikimedia\Slimapp\Config;
+use Wikimedia\Slimapp\CsrfMiddleware;
+use Wikimedia\Slimapp\Form;
+use Wikimedia\Slimapp\HeaderMiddleware;
+use Wikimedia\Slimapp\Mailer;
+use Wikimedia\Slimapp\ParsoidClient;
+use Wikimedia\Slimapp\TwigExtension;
+
 /**
  * Wikimania scholarships.
  *
  * @author Bryan Davis 
  * @copyright © 2013 Bryan Davis and Wikimedia Foundation.
  */
-class App {
+class App extends AbstractApp {
 
/**
-* @var string $deployDir
+* Apply settings to the Slim application.
+*
+* @param \Slim\Slim $slim Application
 */
-   protected $deployDir;
-
-   /**
-* @var \Slim\Slim $slim
-*/
-   protected $slim;
-
-   /**
-* @param string $deployDir Full path to code deployment
-*/
-   public function __construct( $deployDir ) {
-   $this->deployDir = $deployDir;
-
+   protected function configureSlim( \Slim\Slim $slim ) {
// Common configuration
-   $this->slim = new \Slim\Slim( array(
-   'mode' => 'production',
-   'debug' => false,
-   'log.level' => Config::getStr( 'LOG_LEVEL', 
\Psr\Log\LogLevel::NOTICE ),
-   'log.file' => Config::getStr( 'LOG_FILE', 
'php://stderr' ),
-   'view' => new \Slim\Views\Twig(),
-   'view.cache' => Config::getStr( 'CACHE_DIR', 
"{$this->deployDir}/data/cache" ),
-   'smtp.host' => Config::getStr( 'SMTP_

[MediaWiki-commits] [Gerrit] Add rights to CU+OS groups on en.wikipedia.org - change (operations/mediawiki-config)

2015-11-23 Thread Mdann52 (Code Review)
Mdann52 has uploaded a new change for review.

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

Change subject: Add rights to CU+OS groups on en.wikipedia.org
..

Add rights to CU+OS groups on en.wikipedia.org

Adding the 'abusefilter-view-private' right to
the checkuser and oversight groups on enwiki.

Bug:T119446
Change-Id: Ibe51652ac1ecfc4f97642bdbc59ccb9c015f70cc
---
M wmf-config/InitialiseSettings.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 60d4526..6c96140 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -7383,8 +7383,8 @@
'ipblock-exempt' => true, // T30914
'changetags' => true, // T97013
),
-   'oversight' => array( 'browsearchive' => true, 'deletedhistory' 
=> true, 'deletedtext' => true ), // T30465
-   'checkuser' => array( 'browsearchive' => true, 'deletedhistory' 
=> true, 'deletedtext' => true ), // T30465
+   'oversight' => array( 'browsearchive' => true, 'deletedhistory' 
=> true, 'deletedtext' => true 'abusefilter-view-private' => true), // T30465, 
T119446
+   'checkuser' => array( 'browsearchive' => true, 'deletedhistory' 
=> true, 'deletedtext' => true 'abusefilter-view-private' => true), // T30465, 
T119446
'bureaucrat' => array( 'move-subpages' => true, 
'suppressredirect' => true, 'tboverride' => true, ),
'templateeditor' => array( 'templateeditor' => true, 
'tboverride' => true, ), // T57432
'sysop' => array(

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

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

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


[MediaWiki-commits] [Gerrit] Require wikimedia/slimapp - change (wikimedia/wikimania-scholarships)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Require wikimedia/slimapp
..


Require wikimedia/slimapp

Require wikimedia/slimapp in preparation for replacing local classes
with their shared library replacements. The phpmailer/phpmailer package
is kept pinned to a version that is compatible with PHP 5.3.

Bug: T114968
Change-Id: I344bcb0b902a94e1e3788e27c8633eba416e118c
---
M composer.json
M composer.lock
D vendor/bd808/monolog-udp2log-handler/.gitignore
D vendor/bd808/monolog-udp2log-handler/.travis.yml
D vendor/bd808/monolog-udp2log-handler/phpunit.xml.dist
M vendor/bd808/monolog-udp2log-handler/src/Udp2log/StreamWriter.php
D vendor/bd808/monolog-udp2log-handler/tests/TestCase.php
D vendor/bd808/monolog-udp2log-handler/tests/Udp2log/UdpWriterTest.php
D vendor/bd808/monolog-udp2log-handler/tests/Udp2logHandlerTest.php
D vendor/bd808/monolog-udp2log-handler/tests/bootstrap.php
M vendor/composer/autoload_classmap.php
M vendor/composer/autoload_namespaces.php
M vendor/composer/autoload_psr4.php
M vendor/composer/installed.json
A vendor/monolog/monolog/.php_cs
M vendor/monolog/monolog/CHANGELOG.mdown
M vendor/monolog/monolog/LICENSE
M vendor/monolog/monolog/README.mdown
M vendor/monolog/monolog/composer.json
A vendor/monolog/monolog/doc/01-usage.md
A vendor/monolog/monolog/doc/02-handlers-formatters-processors.md
A vendor/monolog/monolog/doc/03-utilities.md
R vendor/monolog/monolog/doc/04-extending.md
M vendor/monolog/monolog/doc/sockets.md
D vendor/monolog/monolog/doc/usage.md
M vendor/monolog/monolog/phpunit.xml.dist
M vendor/monolog/monolog/src/Monolog/ErrorHandler.php
M vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php
M vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php
M vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php
M vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php
M vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php
M vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php
A vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php
M vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php
M vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php
D vendor/monolog/monolog/src/Monolog/Handler/ExceptionTestHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php
M vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php
M vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php
A vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php
M vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php
M vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php
M vendor/monolog/monolog/src/Monolog/Logger.php
M vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php
M vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php
M vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php
M vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php
M vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php
M vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php
M vendor/monolo

[MediaWiki-commits] [Gerrit] Make $.fn.updateTooltipAccessKeys() less expensive - change (mediawiki/core)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Make $.fn.updateTooltipAccessKeys() less expensive
..


Make $.fn.updateTooltipAccessKeys() less expensive

On page.ready on desktop skins, we call $.fn.updateTooltipAccessKeys(), which
updates about 20 elements (depending on the page and skin). Each invocation
parser the 'brackets' message, which ends up being quite expensive. We
previously had some caching to mitigate the cost, but it was removed in
I955ee61f6.

We can re-introduce caching without re-introducing the bug that I955ee61f6
sought to mitigate by making the astCache property unique to each parser
instance, as suggested in T54042#545717, and by ensuring the message function
is cached.

Change-Id: Ia1b42c70d8fc6ce03c8708f03c2b835942c4ead3
---
M resources/src/mediawiki/mediawiki.jqueryMsg.js
M tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
2 files changed, 22 insertions(+), 19 deletions(-)

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



diff --git a/resources/src/mediawiki/mediawiki.jqueryMsg.js 
b/resources/src/mediawiki/mediawiki.jqueryMsg.js
index ba2b684..620dd5e 100644
--- a/resources/src/mediawiki/mediawiki.jqueryMsg.js
+++ b/resources/src/mediawiki/mediawiki.jqueryMsg.js
@@ -132,10 +132,9 @@
 * @return {jQuery} return.return
 */
function getFailableParserFn( options ) {
-   var parser = new mw.jqueryMsg.parser( options );
-
return function ( args ) {
var fallback,
+   parser = new mw.jqueryMsg.parser( options ),
key = args[ 0 ],
argsArray = $.isArray( args[ 1 ] ) ? args[ 1 ] 
: slice.call( args, 1 );
try {
@@ -265,6 +264,7 @@
mw.jqueryMsg.parser = function ( options ) {
this.settings = $.extend( {}, parserDefaults, options );
this.settings.onlyCurlyBraceTransform = ( this.settings.format 
=== 'text' || this.settings.format === 'escaped' );
+   this.astCache = {};
 
this.emitter = new mw.jqueryMsg.htmlEmitter( 
this.settings.language, this.settings.magic );
};
@@ -280,7 +280,8 @@
 * @return {jQuery}
 */
parse: function ( key, replacements ) {
-   return this.emitter.emit( this.getAst( key ), 
replacements );
+   var ast = this.getAst( key );
+   return this.emitter.emit( ast, replacements );
},
 
/**
@@ -291,11 +292,16 @@
 * @return {string|Array} string of '[key]' if message missing, 
simple string if possible, array of arrays if needs parsing
 */
getAst: function ( key ) {
-   var wikiText = this.settings.messages.get( key );
-   if ( typeof wikiText !== 'string' ) {
-   wikiText = '\\[' + key + '\\]';
+   var wikiText;
+
+   if ( !this.astCache.hasOwnProperty( key ) ) {
+   wikiText = this.settings.messages.get( key );
+   if ( typeof wikiText !== 'string' ) {
+   wikiText = '\\[' + key + '\\]';
+   }
+   this.astCache[ key ] = this.wikiTextToAst( 
wikiText );
}
-   return this.wikiTextToAst( wikiText );
+   return this.astCache[ key ];
},
 
/**
@@ -1260,23 +1266,19 @@
// Replace the default message parser with jqueryMsg
oldParser = mw.Message.prototype.parser;
mw.Message.prototype.parser = function () {
-   var messageFunction;
-
-   // TODO: should we cache the message function so we don't 
create a new one every time? Benchmark this maybe?
-   // Caching is somewhat problematic, because we do need 
different message functions for different maps, so
-   // we'd have to cache the parser as a member of this.map, which 
sounds a bit ugly.
-   // Do not use mw.jqueryMsg unless required
if ( this.format === 'plain' || !/\{\{|[\[<>&]/.test( 
this.map.get( this.key ) ) ) {
// Fall back to mw.msg's simple parser
return oldParser.apply( this );
}
 
-   messageFunction = mw.jqueryMsg.getMessageFunction( {
-   messages: this.map,
-   // For format 'escaped', escaping part is handled by 
mediawiki.js
-   format: this.format
-   } );
-   return messageFunction( this.key, this.parameters );
+   if ( !th

[MediaWiki-commits] [Gerrit] Remove obsolete "claimTTL" settings - change (operations/mediawiki-config)

2015-11-23 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Remove obsolete "claimTTL" settings
..

Remove obsolete "claimTTL" settings

This are unused and managed by config in puppet instead

Change-Id: I4e21eda0f303854742e63beb7a85ae64668e7067
---
M wmf-config/CommonSettings.php
1 file changed, 0 insertions(+), 4 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 3c4b7c6..78a20ea 100755
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2342,9 +2342,6 @@
 # Avoid excessive CPU due to cache misses from rapid invalidations
 $wgJobBackoffThrottling['htmlCacheUpdate'] = 20; // pages/sec per runner
 
-# If a job runner takes too long to finish a job, assume it died and re-assign 
the job
-$wgJobTypeConf['default']['claimTTL'] = 3600;
-
 # Job types to exclude from the default queue processing. Aka the very long
 # one. That will exclude the types from any queries such as nextJobDB.php
 # We have to set this for any project cause we usually run PHP script against
@@ -2352,7 +2349,6 @@
 
 # Timed Media Handler:
 $wgJobTypesExcludedFromDefaultQueue[] = 'webVideoTranscode';
-$wgJobTypeConf['webVideoTranscode'] = array( 'claimTTL' => 86400 ) + 
$wgJobTypeConf['default'];
 
 # GWToolset
 $wgJobTypesExcludedFromDefaultQueue[] = 'gwtoolsetUploadMetadataJob';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4e21eda0f303854742e63beb7a85ae64668e7067
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] Add 0 hold-off TTL support to WANObjectCache::delete() - change (mediawiki/core)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add 0 hold-off TTL support to WANObjectCache::delete()
..


Add 0 hold-off TTL support to WANObjectCache::delete()

This removes the peculiar >= 1 restriction

Change-Id: I255dc6ef9750ad2ed6234e3fcfed9ae22a038748
---
M includes/libs/objectcache/WANObjectCache.php
M tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
2 files changed, 33 insertions(+), 8 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 128999a..16e894e 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -101,6 +101,8 @@
const TSE_NONE = -1;
/** Max TTL to store keys when a data sourced is lagged */
const TTL_LAGGED = 30;
+   /** Idiom for delete() for "no hold-off" */
+   const HOLDOFF_NONE = 0;
 
/** Tiny negative float to use when CTL comes up >= 0 due to clock skew 
*/
const TINY_NEGATIVE = -0.01;
@@ -254,7 +256,8 @@
$checkKeyTimesForAll = $this->processCheckKeys( $checksForAll, 
$wrappedValues, $now );
$checkKeyTimesByKey = array();
foreach ( $checksByKey as $cacheKey => $checks ) {
-   $checkKeyTimesByKey[$cacheKey] = 
$this->processCheckKeys( $checks, $wrappedValues, $now );
+   $checkKeyTimesByKey[$cacheKey] =
+   $this->processCheckKeys( $checks, 
$wrappedValues, $now );
}
 
// Get the main cache value for each key and validate them
@@ -456,7 +459,7 @@
 *
 * The $ttl parameter can be used when purging values that have not 
actually changed
 * recently. For example, a cleanup script to purge cache entries does 
not really need
-* a hold-off period, so it can use the value 1. Likewise for 
user-requested purge.
+* a hold-off period, so it can use HOLDOFF_NONE. Likewise for 
user-requested purge.
 * Note that $ttl limits the effective range of 'lockTSE' for 
getWithSetCallback().
 *
 * If called twice on the same key, then the last hold-off TTL takes 
precedence. For
@@ -468,12 +471,20 @@
 */
final public function delete( $key, $ttl = self::HOLDOFF_TTL ) {
$key = self::VALUE_KEY_PREFIX . $key;
-   // Avoid indefinite key salting for sanity
-   $ttl = max( $ttl, 1 );
-   // Update the local datacenter immediately
-   $ok = $this->cache->set( $key, self::PURGE_VAL_PREFIX . 
microtime( true ), $ttl );
-   // Publish the purge to all datacenters
-   return $this->relayPurge( $key, $ttl ) && $ok;
+
+   if ( $ttl <= 0 ) {
+   // Update the local datacenter immediately
+   $ok = $this->cache->delete( $key );
+   // Publish the purge to all datacenters
+   $ok = $this->relayDelete( $key ) && $ok;
+   } else {
+   // Update the local datacenter immediately
+   $ok = $this->cache->set( $key, self::PURGE_VAL_PREFIX . 
microtime( true ), $ttl );
+   // Publish the purge to all datacenters
+   $ok = $this->relayPurge( $key, $ttl ) && $ok;
+   }
+
+   return $ok;
}
 
/**
diff --git a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php 
b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
index 90b4bd0..e2c6ac7 100644
--- a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
+++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
@@ -391,8 +391,22 @@
$this->assertLessThan( 0, $curTTL, "Deleted key has current TTL 
< 0" );
 
$this->cache->set( $key, $value . 'more' );
+   $v = $this->cache->get( $key, $curTTL );
$this->assertFalse( $v, "Deleted key is tombstoned and has 
false value" );
$this->assertLessThan( 0, $curTTL, "Deleted key is tombstoned 
and has current TTL < 0" );
+
+   $this->cache->set( $key, $value );
+   $this->cache->delete( $key, WANObjectCache::HOLDOFF_NONE );
+
+   $curTTL = null;
+   $v = $this->cache->get( $key, $curTTL );
+   $this->assertFalse( $v, "Deleted key has false value" );
+   $this->assertNull( $curTTL, "Deleted key has null current TTL" 
);
+
+   $this->cache->set( $key, $value );
+   $v = $this->cache->get( $key, $curTTL );
+   $this->assertEquals( $value, $v, "Key was created with value" );
+   $this->assertGreaterThan( 0, $curTTL, "Existi

[MediaWiki-commits] [Gerrit] Cleanup notification sent for new issues - change (mediawiki...Newsletter)

2015-11-23 Thread Glaisher (Code Review)
Glaisher has uploaded a new change for review.

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

Change subject: Cleanup notification sent for new issues
..

Cleanup notification sent for new issues

NOTE: This is a BREAKING CHANGE. All previous notifications will
have to be purged from the table as they are not supported. This is
not backwards-compatible as this is still in beta status and I don't
want to keep code just for supporting those old notifications (probably
only in development instances).

* Escape raw HTML
* Add secondary link
* Add payload ("summary")
* Set category so that prefs are actually used
* Add agent info
* Expand i18n messages documentation
* Set default user options (web and email) for this newsletter
* Remove redundant code; just use code provided by Echo

Bug: T116382
Change-Id: Iaca3a3d88b08adf74333aeaf6b328fc35fe65b97
---
M Newsletter.hooks.php
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/Echo/EchoNewsletterFormatter.php
M includes/Echo/EchoNewsletterUserLocator.php
M includes/specials/SpecialNewsletter.php
7 files changed, 44 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/76/255076/1

diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php
index 84719e4..551f7d1 100755
--- a/Newsletter.hooks.php
+++ b/Newsletter.hooks.php
@@ -19,20 +19,26 @@
);
 
$notifications['newsletter-announce'] = array(
+   'category' => 'newsletter',
+   'section' => 'alert',
'primary-link' => array(
'message' => 
'newsletter-notification-link-text-new-issue',
'destination' => 'new-issue'
+   ),
+   'secondary-link' => array(
+   'message' => 
'newsletter-notification-link-text-view-newsletter',
+   'destination' => 'newsletter'
),
'user-locators' => array(

'EchoNewsletterUserLocator::locateNewsletterSubscribedUsers',
),
'formatter-class' => 'EchoNewsletterFormatter',
'title-message' => 'newsletter-notification-title',
-   'title-params' => array( 'newsletter', 'title' ),
+   'title-params' => array( 'newsletter', 'title', 'agent' 
),
'flyout-message' => 'newsletter-notification-flyout',
-   'flyout-params' => array( 'newsletter', 'title' ),
-
+   'payload' => array( 'summary' ),
);
+
return true;
}
 
@@ -61,6 +67,7 @@
}
 
public static function onUnitTestsList( &$files ) {
+   // @fixme This does NOT work. 
https://gerrit.wikimedia.org/r/248377
$files = array_merge( $files, glob( __DIR__ . 
'/tests/*Test.php' ) );
 
return true;
diff --git a/extension.json b/extension.json
index 6a83a20..c7a6e6e 100644
--- a/extension.json
+++ b/extension.json
@@ -57,6 +57,10 @@
"EchoNewsletterFormatter": 
"includes/Echo/EchoNewsletterFormatter.php",
"EchoNewsletterUserLocator": 
"includes/Echo/EchoNewsletterUserLocator.php"
},
+   "DefaultUserOptions": {
+   "echo-subscriptions-web-newsletter": true,
+   "echo-subscriptions-email-newsletter": true
+   },
"ResourceModules": {
"ext.newsletter": {
"scripts": "ext.newsletter.js",
diff --git a/i18n/en.json b/i18n/en.json
index e18ec3b..474edeb 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -81,9 +81,10 @@
"newsletter-list-search-none-found": "No newsletters match your query.",
"echo-category-title-newsletter": "Newsletters",
"echo-pref-tooltip-newsletter": "Notify me when any of the newsletters 
to which I have subscribed to announces a new issue.",
-   "newsletter-notification-title": "$1 has announced an issue",
-   "newsletter-notification-flyout": "$1 has announced a new issue",
+   "newsletter-notification-title": "[[User:$3|$3]] has announced a 
[[$2|new issue]] of $1.",
+   "newsletter-notification-flyout": "$3 has announced a new issue of $1.",
"newsletter-notification-link-text-new-issue": "View new issue",
+   "newsletter-notification-link-text-view-newsletter": "View newsletter",
"newsletter-header-name": "Name of newsletter",
"newsletter-header-description": "Description",
"newsletter-header-action": "Subscribed?",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 7074128..693aee1 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -84,9 +84,10 @@
"newsletter-list-search-none-found": "Error message shown on 
[[Spe

[MediaWiki-commits] [Gerrit] archiva: Move nginx proxy template into module - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: archiva: Move nginx proxy template into module
..

archiva: Move nginx proxy template into module

Helps clean up templates/ - these aren't being used anywhere
else

Change-Id: I3d185501203c9843b7b11a8982d7617cdc746028
---
M modules/archiva/manifests/proxy.pp
R modules/archiva/templates/proxy.nginx.erb
D templates/nginx/sites/force-https.erb
3 files changed, 9 insertions(+), 17 deletions(-)


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

diff --git a/modules/archiva/manifests/proxy.pp 
b/modules/archiva/manifests/proxy.pp
index 6b7583c..16e7cae 100644
--- a/modules/archiva/manifests/proxy.pp
+++ b/modules/archiva/manifests/proxy.pp
@@ -24,7 +24,7 @@
 
 # $archiva_server_properties and
 # $ssl_server_properties will be concatenated together to form
-# a single $server_properties array for the simple-proxy.erb
+# a single $server_properties array for proxy.nginx.erb
 # nginx site template.
 $archiva_server_properties = [
 # Need large body size to allow for .jar deployment.
@@ -61,22 +61,15 @@
 ],
 ]
 
-$force_https_site_ensure = 'present'
 }
 else {
 $listen = 80
 $server_properties = $archiva_server_properties
-
-$force_https_site_ensure = 'absent'
 }
 
 $proxy_pass = "http://127.0.0.1:${::archiva::port}/";
 
 nginx::site { 'archiva':
-content => template('nginx/sites/simple-proxy.erb'),
-}
-nginx::site { 'archiva-force-https':
-ensure  => $force_https_site_ensure,
-content => template('nginx/sites/force-https.erb'),
+content => template('archiva/proxy.nginx.erb'),
 }
 }
diff --git a/templates/nginx/sites/simple-proxy.erb 
b/modules/archiva/templates/proxy.nginx.erb
similarity index 84%
rename from templates/nginx/sites/simple-proxy.erb
rename to modules/archiva/templates/proxy.nginx.erb
index 788140f..e540283 100644
--- a/templates/nginx/sites/simple-proxy.erb
+++ b/modules/archiva/templates/proxy.nginx.erb
@@ -10,6 +10,13 @@
 
 
 -%>
+<% if @ssl_enabled %>
+server {
+listen 80;
+return 301 https://$host$request_uri;
+}
+<% end %>
+
 server {
   listen <%= @listen %>;
 
diff --git a/templates/nginx/sites/force-https.erb 
b/templates/nginx/sites/force-https.erb
deleted file mode 100644
index df69915..000
--- a/templates/nginx/sites/force-https.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-# This file is managed by Puppet.
-
-## Nginx site to force all requests on port 80 to https
-
-server {
-listen 80;
-return 301 https://$host$request_uri;
-}

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

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

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


[MediaWiki-commits] [Gerrit] Add 0 hold-off TTL support to WANObjectCache::delete() - change (mediawiki/core)

2015-11-23 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

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

Change subject: Add 0 hold-off TTL support to WANObjectCache::delete()
..

Add 0 hold-off TTL support to WANObjectCache::delete()

This removes the peculiar >= 1 restriction

Change-Id: I255dc6ef9750ad2ed6234e3fcfed9ae22a038748
---
M includes/libs/objectcache/WANObjectCache.php
M tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
2 files changed, 33 insertions(+), 8 deletions(-)


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

diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index 128999a..16e894e 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -101,6 +101,8 @@
const TSE_NONE = -1;
/** Max TTL to store keys when a data sourced is lagged */
const TTL_LAGGED = 30;
+   /** Idiom for delete() for "no hold-off" */
+   const HOLDOFF_NONE = 0;
 
/** Tiny negative float to use when CTL comes up >= 0 due to clock skew 
*/
const TINY_NEGATIVE = -0.01;
@@ -254,7 +256,8 @@
$checkKeyTimesForAll = $this->processCheckKeys( $checksForAll, 
$wrappedValues, $now );
$checkKeyTimesByKey = array();
foreach ( $checksByKey as $cacheKey => $checks ) {
-   $checkKeyTimesByKey[$cacheKey] = 
$this->processCheckKeys( $checks, $wrappedValues, $now );
+   $checkKeyTimesByKey[$cacheKey] =
+   $this->processCheckKeys( $checks, 
$wrappedValues, $now );
}
 
// Get the main cache value for each key and validate them
@@ -456,7 +459,7 @@
 *
 * The $ttl parameter can be used when purging values that have not 
actually changed
 * recently. For example, a cleanup script to purge cache entries does 
not really need
-* a hold-off period, so it can use the value 1. Likewise for 
user-requested purge.
+* a hold-off period, so it can use HOLDOFF_NONE. Likewise for 
user-requested purge.
 * Note that $ttl limits the effective range of 'lockTSE' for 
getWithSetCallback().
 *
 * If called twice on the same key, then the last hold-off TTL takes 
precedence. For
@@ -468,12 +471,20 @@
 */
final public function delete( $key, $ttl = self::HOLDOFF_TTL ) {
$key = self::VALUE_KEY_PREFIX . $key;
-   // Avoid indefinite key salting for sanity
-   $ttl = max( $ttl, 1 );
-   // Update the local datacenter immediately
-   $ok = $this->cache->set( $key, self::PURGE_VAL_PREFIX . 
microtime( true ), $ttl );
-   // Publish the purge to all datacenters
-   return $this->relayPurge( $key, $ttl ) && $ok;
+
+   if ( $ttl <= 0 ) {
+   // Update the local datacenter immediately
+   $ok = $this->cache->delete( $key );
+   // Publish the purge to all datacenters
+   $ok = $this->relayDelete( $key ) && $ok;
+   } else {
+   // Update the local datacenter immediately
+   $ok = $this->cache->set( $key, self::PURGE_VAL_PREFIX . 
microtime( true ), $ttl );
+   // Publish the purge to all datacenters
+   $ok = $this->relayPurge( $key, $ttl ) && $ok;
+   }
+
+   return $ok;
}
 
/**
diff --git a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php 
b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
index 90b4bd0..e2c6ac7 100644
--- a/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
+++ b/tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
@@ -391,8 +391,22 @@
$this->assertLessThan( 0, $curTTL, "Deleted key has current TTL 
< 0" );
 
$this->cache->set( $key, $value . 'more' );
+   $v = $this->cache->get( $key, $curTTL );
$this->assertFalse( $v, "Deleted key is tombstoned and has 
false value" );
$this->assertLessThan( 0, $curTTL, "Deleted key is tombstoned 
and has current TTL < 0" );
+
+   $this->cache->set( $key, $value );
+   $this->cache->delete( $key, WANObjectCache::HOLDOFF_NONE );
+
+   $curTTL = null;
+   $v = $this->cache->get( $key, $curTTL );
+   $this->assertFalse( $v, "Deleted key has false value" );
+   $this->assertNull( $curTTL, "Deleted key has null current TTL" 
);
+
+   $this->cache->set( $key, $value );
+   $v = $this->cache->get( $key, $curTTL );
+   $this->assertEquals( $value, $v, "Key was created with value" );
+   

[MediaWiki-commits] [Gerrit] Display text snippet for evaluation - change (mediawiki...MathSearch)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Display text snippet for evaluation
..


Display text snippet for evaluation

Change-Id: I63a3bc1ba40338ea954ac2ee15821d3bab3df36a
---
M includes/special/SpecialMlpEval.php
1 file changed, 151 insertions(+), 25 deletions(-)

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



diff --git a/includes/special/SpecialMlpEval.php 
b/includes/special/SpecialMlpEval.php
index bea58c6..a2dc2fe 100644
--- a/includes/special/SpecialMlpEval.php
+++ b/includes/special/SpecialMlpEval.php
@@ -12,6 +12,18 @@
  * @ingroup extensions
  */
 class SpecialMlpEval extends SpecialPage {
+   const MAX_ATTEMPTS = 10;
+   const WINDOW_SIZE = 500;
+   private $step = 1;
+   /**
+* @var Title
+*/
+   private $title;
+   private $wikitext;
+   private $mathTags;
+   private $revison;
+   private $lastError = false;
+
function __construct() {
parent::__construct( 'MlpEval' );
}
@@ -20,29 +32,9 @@
 * The main function
 */
public function execute( $par ) {
-   $request = $this->getRequest();
$this->setHeaders();
-   $this->selectPageForm()->show();
+   $this->displayForm();
}
-
-   /**
-* Generates the search input form
-*/
-   private function selectPageForm() {
-   $this->getOutput()->addModules( 'ext.MathSearch.special' );
-   $formDescriptor = array(
-   'evalPage' => array(
-   'label' => 'Page to evaluate', # What's the 
label of the field
-   'class' => 'HTMLTextField' # What's the input 
type
-   )
-   );
-   $htmlForm = new HTMLForm( $formDescriptor, 
$this->getContext() );
-   $htmlForm->setSubmitText( 'Select' );
-   $htmlForm->setSubmitCallback( array( $this, 'processInput' ) );
-   $htmlForm->setHeaderText( "Step 1: Select a page" );
-   return $htmlForm;
-   }
-
 
 
/**
@@ -51,15 +43,26 @@
 * @return bool
 */
public function processInput( $formData ) {
-
-   $this->performSearch();
+   switch ( $this->step ) {
+   case 1:
+   $title = Title::newFromText( 
$formData['evalPage'] );
+   if ( $this->setPage( $title ) ) {
+   $this->step ++;
+   return false;
+   } else {
+   return $this->lastError;
+   }
+   break;
+   case 2:
+   return false;
+   }
}
 
public function performSearch() {
$out = $this->getOutput();
$out->addWikiText( '==Results==' );
$out->addWikiText( 'You searched for the following terms:' );
-
+   return false;
}
 
/**
@@ -75,7 +78,7 @@
private function enableMathStyles() {
$out = $this->getOutput();
$out->addModuleStyles(
-   array( 'ext.math.styles' , 'ext.math.desktop.styles', 
'ext.math.scripts' )
+   array( 'ext.math.styles', 'ext.math.desktop.styles', 
'ext.math.scripts' )
);
}
 
@@ -83,4 +86,127 @@
protected function getGroupName() {
return 'mathsearch';
}
+
+   private function getRandomPage() {
+   $rp = new RandomPage();
+   for ( $i = 0; $i < self::MAX_ATTEMPTS; $i ++ ) {
+   $title = $rp->getRandomTitle();
+   if ( $this->setPage( $title ) ) {
+   $this->lastError = "";
+   return $title;
+   }
+   }
+   $this->log()->warning( "Could not find suitable Page with 
math", $this->lastError );
+   $this->lastError = "";
+   return "";
+   }
+
+   private function displayForm() {
+   $startStep = $this->step;
+   switch ( $this->step ) {
+   case 1:
+   $this->getOutput()->addModules( 
'ext.MathSearch.special' );
+   $formDescriptor = array(
+   'evalPage' => array(
+   'label'   => 'Page to evaluate',
+   'class'   => 'HTMLTextField',
+   'default' => 
$this->getRandomPage()
+  

[MediaWiki-commits] [Gerrit] labsvagrant: Move role to deprecated - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: labsvagrant: Move role to deprecated
..

labsvagrant: Move role to deprecated

Will be followed by a LDAP based role name rename for all
the instances that currently have this role

Change-Id: I5e78f2fad4dadcb9c3fa80adbeef9ae2eb38b426
---
R modules/role/manifests/deprecated/labsvagrant.pp
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/73/255073/1

diff --git a/manifests/role/labsvagrant.pp 
b/modules/role/manifests/deprecated/labsvagrant.pp
similarity index 76%
rename from manifests/role/labsvagrant.pp
rename to modules/role/manifests/deprecated/labsvagrant.pp
index 39f03ff..496c6e4 100644
--- a/manifests/role/labsvagrant.pp
+++ b/modules/role/manifests/deprecated/labsvagrant.pp
@@ -1,6 +1,6 @@
+# DEPRECATED, DO NOT USE!
 # Install Mediawiki-Vagrant puppet repo, manage manually from CLI
-class role::labs::vagrant {
-include ::role::labs::lvm::srv
+class role::deprecated::labsvagrant {
 
 # Mount secondary disk before applying labs_vagrant
 class { '::labs_vagrant':

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

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

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


[MediaWiki-commits] [Gerrit] wdq: Rename role to fit with autolayout - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: wdq: Rename role to fit with autolayout
..


wdq: Rename role to fit with autolayout

Also mark it clearly as labs only

Change-Id: I236f8e7a854529c60c2a3928ded54e7971fa6660
---
R manifests/role/wdq_mm.pp
1 file changed, 7 insertions(+), 3 deletions(-)

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



diff --git a/manifests/role/labswdq_mm.pp b/manifests/role/wdq_mm.pp
similarity index 79%
rename from manifests/role/labswdq_mm.pp
rename to manifests/role/wdq_mm.pp
index 0680f75..9e3507b 100644
--- a/manifests/role/labswdq_mm.pp
+++ b/manifests/role/wdq_mm.pp
@@ -1,7 +1,9 @@
-# == Class: role::labs::wdq_mm
+# == Class: role::wdq_mm
 # Role class for setting up an instance of
 # Magnus' WDQ on labs
-class role::labs::wdq_mm {
+class role::wdq_mm {
+requires_realm('labs')
+
 include ::labs_debrepo
 
 include labs_lvm
@@ -18,10 +20,12 @@
 }
 }
 
-# == Class: role::labs::wdq_mm::lb
+# == Class: role::wdq_mm::lb
 # Load balancer for balancing across multiple instances
 # of role::labs::wdq_mm
 class role::labs::wdq_mm::lb {
+requires_realm('labs')
+
 class { '::wdq_mm::lb':
 }
 }

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

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

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


[MediaWiki-commits] [Gerrit] Add some extra information to save failure logging - change (mediawiki...ContentTranslation)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add some extra information to save failure logging
..


Add some extra information to save failure logging

Bug: T116908
Change-Id: If721811c39408ba28c87d7fee1387b0d3b40261b
---
M modules/draft/ext.cx.draft.js
1 file changed, 14 insertions(+), 1 deletion(-)

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



diff --git a/modules/draft/ext.cx.draft.js b/modules/draft/ext.cx.draft.js
index 5141a57..64e5e83 100644
--- a/modules/draft/ext.cx.draft.js
+++ b/modules/draft/ext.cx.draft.js
@@ -316,7 +316,7 @@
 * Save the translation
 */
ContentTranslationDraft.prototype.save = function () {
-   var targetTitle, params, apiParams,
+   var targetTitle, params, apiParams, now,
api = new mw.Api();
 
if ( this.disabled ) {
@@ -347,6 +347,8 @@
 
return;
}
+
+   now = Date.now();
apiParams = $.extend( {}, params, {
assert: 'user',
action: 'cxpublish'
@@ -364,13 +366,24 @@
checkAndSave();
}, 5 * 60 * 1000 );
} ).fail( function ( errorCode, details ) {
+   var extra;
+
if ( errorCode === 'assertuserfailed' ) {
mw.hook( 'mw.cx.error' ).fire( mw.msg( 
'cx-lost-session-draft' ) );
}
+
+   extra = {
+   d: Date.now() - now,
+   s: params.html.length
+   };
+   // Hope these will be in the beginning of the string
+   details = $.extend( extra, details );
+
if ( details.exception instanceof Error ) {
details.exception = 
details.exception.toString();
}
details.errorCode = errorCode;
+
mw.hook( 'mw.cx.translation.save-failed' ).fire(
mw.cx.sourceLanguage,
mw.cx.targetLanguage,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If721811c39408ba28c87d7fee1387b0d3b40261b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: 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] wdq: Rename role to fit with autolayout - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: wdq: Rename role to fit with autolayout
..

wdq: Rename role to fit with autolayout

Also mark it clearly as labs only

Change-Id: I236f8e7a854529c60c2a3928ded54e7971fa6660
---
R manifests/role/wdq_mm.pp
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/72/255072/1

diff --git a/manifests/role/labswdq_mm.pp b/manifests/role/wdq_mm.pp
similarity index 79%
rename from manifests/role/labswdq_mm.pp
rename to manifests/role/wdq_mm.pp
index 0680f75..9e3507b 100644
--- a/manifests/role/labswdq_mm.pp
+++ b/manifests/role/wdq_mm.pp
@@ -1,7 +1,9 @@
-# == Class: role::labs::wdq_mm
+# == Class: role::wdq_mm
 # Role class for setting up an instance of
 # Magnus' WDQ on labs
-class role::labs::wdq_mm {
+class role::wdq_mm {
+requires_realm('labs')
+
 include ::labs_debrepo
 
 include labs_lvm
@@ -18,10 +20,12 @@
 }
 }
 
-# == Class: role::labs::wdq_mm::lb
+# == Class: role::wdq_mm::lb
 # Load balancer for balancing across multiple instances
 # of role::labs::wdq_mm
 class role::labs::wdq_mm::lb {
+requires_realm('labs')
+
 class { '::wdq_mm::lb':
 }
 }

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

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

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


[MediaWiki-commits] [Gerrit] Fixup and move 'mediawiki_singlenode' role to role/deprecated - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: Fixup and move 'mediawiki_singlenode' role to role/deprecated
..


Fixup and move 'mediawiki_singlenode' role to role/deprecated

- Clearly marks it as deprecated
- Removes the 'latest' variety - these two roles have been
  broken for a long time anyway (in many ways). There was one
  instance using it (in the mwreview project) that I replaced
  with the non-latest variety

Change-Id: I2b72cdf551e906221c47de1bb54e281e4be78e6b
---
D manifests/role/labsmediawiki.pp
A modules/role/manifests/deprecated/README
A modules/role/manifests/deprecated/mediawiki.pp
3 files changed, 18 insertions(+), 19 deletions(-)

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



diff --git a/manifests/role/labsmediawiki.pp b/manifests/role/labsmediawiki.pp
deleted file mode 100644
index dd13283..000
--- a/manifests/role/labsmediawiki.pp
+++ /dev/null
@@ -1,19 +0,0 @@
-#  Install Mediawiki from git and keep in sync with git trunk
-#
-#  Uses the mediawiki_singlenode class with minimal alterations or 
customizations.
-class role::mediawiki-install-latest::labs {
-
-class { 'mediawiki_singlenode':
-ensure => latest
-}
-}
-
-#  Install Mediawiki from git and then leave it alone.
-#
-#  Uses the mediawiki_singlenode class with no alterations or customizations.
-class role::mediawiki-install::labs {
-
-class { 'mediawiki_singlenode':
-ensure => present
-}
-}
diff --git a/modules/role/manifests/deprecated/README 
b/modules/role/manifests/deprecated/README
new file mode 100644
index 000..95f8a60
--- /dev/null
+++ b/modules/role/manifests/deprecated/README
@@ -0,0 +1,6 @@
+This is for roles that should have died, but for some reason,
+can not. The biggest legit reason being that there are a 
+lot of labs instances that rely on it and there is no migration
+path other than 'remove and redo'. Sometimes when someone
+has enough energy they should all be killed, but until then
+let us mark them as clearly deprecated and move them here.
diff --git a/modules/role/manifests/deprecated/mediawiki.pp 
b/modules/role/manifests/deprecated/mediawiki.pp
new file mode 100644
index 000..4610f97
--- /dev/null
+++ b/modules/role/manifests/deprecated/mediawiki.pp
@@ -0,0 +1,12 @@
+# WARNING: TOTALLY DEPRECATED, DO NOT USE
+#  Install Mediawiki from git and then leave it alone.
+#
+#  Uses the mediawiki_singlenode class with no alterations or customizations.
+class role::deprecated::mediawiki::install {
+
+requires_realm('labs')
+
+class { 'mediawiki_singlenode':
+ensure => present
+}
+}

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

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

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


[MediaWiki-commits] [Gerrit] Fixup and move 'mediawiki_singlenode' role to role/deprecated - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: Fixup and move 'mediawiki_singlenode' role to role/deprecated
..

Fixup and move 'mediawiki_singlenode' role to role/deprecated

- Clearly marks it as deprecated
- Removes the 'latest' variety - these two roles have been
  broken for a long time anyway (in many ways). There was one
  instance using it (in the mwreview project) that I replaced
  with the non-latest variety

Change-Id: I2b72cdf551e906221c47de1bb54e281e4be78e6b
---
D manifests/role/labsmediawiki.pp
A modules/role/manifests/deprecated/README
A modules/role/manifests/deprecated/mediawiki.pp
3 files changed, 18 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/71/255071/1

diff --git a/manifests/role/labsmediawiki.pp b/manifests/role/labsmediawiki.pp
deleted file mode 100644
index dd13283..000
--- a/manifests/role/labsmediawiki.pp
+++ /dev/null
@@ -1,19 +0,0 @@
-#  Install Mediawiki from git and keep in sync with git trunk
-#
-#  Uses the mediawiki_singlenode class with minimal alterations or 
customizations.
-class role::mediawiki-install-latest::labs {
-
-class { 'mediawiki_singlenode':
-ensure => latest
-}
-}
-
-#  Install Mediawiki from git and then leave it alone.
-#
-#  Uses the mediawiki_singlenode class with no alterations or customizations.
-class role::mediawiki-install::labs {
-
-class { 'mediawiki_singlenode':
-ensure => present
-}
-}
diff --git a/modules/role/manifests/deprecated/README 
b/modules/role/manifests/deprecated/README
new file mode 100644
index 000..95f8a60
--- /dev/null
+++ b/modules/role/manifests/deprecated/README
@@ -0,0 +1,6 @@
+This is for roles that should have died, but for some reason,
+can not. The biggest legit reason being that there are a 
+lot of labs instances that rely on it and there is no migration
+path other than 'remove and redo'. Sometimes when someone
+has enough energy they should all be killed, but until then
+let us mark them as clearly deprecated and move them here.
diff --git a/modules/role/manifests/deprecated/mediawiki.pp 
b/modules/role/manifests/deprecated/mediawiki.pp
new file mode 100644
index 000..4610f97
--- /dev/null
+++ b/modules/role/manifests/deprecated/mediawiki.pp
@@ -0,0 +1,12 @@
+# WARNING: TOTALLY DEPRECATED, DO NOT USE
+#  Install Mediawiki from git and then leave it alone.
+#
+#  Uses the mediawiki_singlenode class with no alterations or customizations.
+class role::deprecated::mediawiki::install {
+
+requires_realm('labs')
+
+class { 'mediawiki_singlenode':
+ensure => present
+}
+}

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

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

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


[MediaWiki-commits] [Gerrit] labs: Move db_aliases template into role module - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: labs: Move db_aliases template into role module
..


labs: Move db_aliases template into role module

Change-Id: Ib8411bc88b3f917e99f99c78dde63849c5c66228
---
M modules/role/manifests/labs/dnsrecursor.pp
R modules/role/templates/labs/dns/db_aliases.erb
2 files changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/role/manifests/labs/dnsrecursor.pp 
b/modules/role/manifests/labs/dnsrecursor.pp
index b1bff99..cb12262 100644
--- a/modules/role/manifests/labs/dnsrecursor.pp
+++ b/modules/role/manifests/labs/dnsrecursor.pp
@@ -301,7 +301,7 @@
 group   => 'root',
 mode=> '0444',
 notify  => Service['pdns-recursor'],
-content => template('labsdns/labsdb.erb'),
+content => template('role/labs/dns/db_aliases.erb'),
 require => File['/var/zones']
 }
 
diff --git a/templates/labsdns/labsdb.erb 
b/modules/role/templates/labs/dns/db_aliases.erb
similarity index 100%
rename from templates/labsdns/labsdb.erb
rename to modules/role/templates/labs/dns/db_aliases.erb

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

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

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


[MediaWiki-commits] [Gerrit] labs: Move db_aliases template into role module - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: labs: Move db_aliases template into role module
..

labs: Move db_aliases template into role module

Change-Id: Ib8411bc88b3f917e99f99c78dde63849c5c66228
---
M modules/role/manifests/labs/dnsrecursor.pp
R modules/role/templates/labs/dns/db_aliases.erb
2 files changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/70/255070/1

diff --git a/modules/role/manifests/labs/dnsrecursor.pp 
b/modules/role/manifests/labs/dnsrecursor.pp
index b1bff99..cb12262 100644
--- a/modules/role/manifests/labs/dnsrecursor.pp
+++ b/modules/role/manifests/labs/dnsrecursor.pp
@@ -301,7 +301,7 @@
 group   => 'root',
 mode=> '0444',
 notify  => Service['pdns-recursor'],
-content => template('labsdns/labsdb.erb'),
+content => template('role/labs/dns/db_aliases.erb'),
 require => File['/var/zones']
 }
 
diff --git a/templates/labsdns/labsdb.erb 
b/modules/role/templates/labs/dns/db_aliases.erb
similarity index 100%
rename from templates/labsdns/labsdb.erb
rename to modules/role/templates/labs/dns/db_aliases.erb

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

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

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


[MediaWiki-commits] [Gerrit] Move labs::dns role's hiera file to proper location - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: Move labs::dns role's hiera file to proper location
..


Move labs::dns role's hiera file to proper location

Change-Id: Ifd003527c50cb59f469e16f8746b373ac4edd7b0
---
R hieradata/role/common/labs/dns.yaml
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/role/common/labsdns.yaml 
b/hieradata/role/common/labs/dns.yaml
similarity index 100%
rename from hieradata/role/common/labsdns.yaml
rename to hieradata/role/common/labs/dns.yaml

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

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

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


[MediaWiki-commits] [Gerrit] CX: Fix article-recommender campaign - change (operations/mediawiki-config)

2015-11-23 Thread KartikMistry (Code Review)
KartikMistry has uploaded a new change for review.

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

Change subject: CX: Fix article-recommender campaign
..

CX: Fix article-recommender campaign

* Fix article-recommender-1 campaign.
* Merge defaults.

Change-Id: I3afb8dcc5b43e0931ad179b5cdc8f21dfcb32561
Follow-up: Change-Id: I549df847194d469f1b87b6dc00a05d2bae6e93ba
---
M wmf-config/InitialiseSettings.php
1 file changed, 4 insertions(+), 20 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 91a7b03..1d078a5 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -14910,47 +14910,31 @@
'newarticle' => true,
'staff-recommender' => true
),
-   'cawiki' => array(
-   'newarticle' => true,
-   'cxstats' => true,
-   'staff-recommender' => true
-   ),
'dewiki' => array(
+   'article-recommender-1' => true,
'cxstats' => true,
'newarticle' => false,
'staff-recommender' => true
),
'enwiki' => array(
+   'article-recommender-1' => true,
'cxstats' => true,
'newarticle' => false,
'staff-recommender' => true
),
'eswiki' => array(
+   'article-recommender-1' => true,
'newarticle' => true,
'cxstats' => true,
'staff-recommender' => true,
'eswiki-recommender' => true
),
-   'fawiki' => array(
-   'newarticle' => true,
-   'cxstats' => true,
-   'staff-recommender' => true
-   ),
'frwiki' => array(
+   'article-recommender-1' => true,
'newarticle' => true,
'cxstats' => true,
'staff-recommender' => true,
'frwiki-recommender' => true
-   ),
-   'itwiki' => array(
-   'cxstats' => true,
-   'newarticle' => true,
-   'staff-recommender' => true
-   ),
-   'swwiki' => array(
-   'newarticle' => true,
-   'cxstats' => true,
-   'staff-recommender' => true
),
 ),
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3afb8dcc5b43e0931ad179b5cdc8f21dfcb32561
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] labs: Move labmon role to labs::graphite role - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: labs: Move labmon role to labs::graphite role
..


labs: Move labmon role to labs::graphite role

And some small misc cleanup and consolidation

Change-Id: Ida0ee5059350853684abd859bd0fcf2a051947ba
---
R hieradata/role/common/labs/graphite.yaml
M manifests/role/graphite.pp
D manifests/role/labmon.pp
M manifests/site.pp
A modules/role/manifests/labs/graphite.pp
5 files changed, 24 insertions(+), 32 deletions(-)

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



diff --git a/hieradata/role/common/labmon.yaml 
b/hieradata/role/common/labs/graphite.yaml
similarity index 100%
rename from hieradata/role/common/labmon.yaml
rename to hieradata/role/common/labs/graphite.yaml
diff --git a/manifests/role/graphite.pp b/manifests/role/graphite.pp
index ada0f35..665cbf9 100644
--- a/manifests/role/graphite.pp
+++ b/manifests/role/graphite.pp
@@ -316,17 +316,3 @@
 }
 
 }
-
-# == Class: role::graphite::labmon
-#
-# Sets up graphite instance for monitoring labs, running on production 
hardware.
-# Instance is open to all, no password required to see metrics
-class role::graphite::labmon {
-class { 'role::graphite::base':
-storage_dir => '/srv/carbon',
-auth=> false,
-hostname=> 'graphite.wmflabs.org',
-}
-
-include graphite::labs::archiver
-}
diff --git a/manifests/role/labmon.pp b/manifests/role/labmon.pp
deleted file mode 100644
index 1b38836..000
--- a/manifests/role/labmon.pp
+++ /dev/null
@@ -1,17 +0,0 @@
-# = Class: labmon
-# Role for misc. setup of labs monitoring
-
-class role::labmon {
-
-class { 'role::graphite::labmon': }
-
-file { '/var/lib/carbon':
-ensure  => link,
-target  => '/srv/carbon',
-owner   => '_graphite',
-group   => '_graphite',
-require => Class['role::graphite::labmon']
-}
-
-include role::statsite
-}
diff --git a/manifests/site.pp b/manifests/site.pp
index ca17275..c3f2b34 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1195,7 +1195,7 @@
 
 # Labs Graphite and StatsD host
 node 'labmon1001.eqiad.wmnet' {
-role labmon
+role labs::graphite
 include standard
 }
 
diff --git a/modules/role/manifests/labs/graphite.pp 
b/modules/role/manifests/labs/graphite.pp
new file mode 100644
index 000..2bf3ce1
--- /dev/null
+++ b/modules/role/manifests/labs/graphite.pp
@@ -0,0 +1,23 @@
+# = Class: role::labs::graphite
+# Sets up graphite instance for monitoring labs, running on production 
hardware.
+# Instance is open to all, no password required to see metrics
+class role::labs::graphite {
+
+class { 'role::graphite::base':
+storage_dir => '/srv/carbon',
+auth=> false,
+hostname=> 'graphite.wmflabs.org',
+}
+
+include graphite::labs::archiver
+
+file { '/var/lib/carbon':
+ensure  => link,
+target  => '/srv/carbon',
+owner   => '_graphite',
+group   => '_graphite',
+require => Class['role::graphite::base']
+}
+
+include role::statsite
+}

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

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

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


[MediaWiki-commits] [Gerrit] Move labs::dns role's hiera file to proper location - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: Move labs::dns role's hiera file to proper location
..

Move labs::dns role's hiera file to proper location

Change-Id: Ifd003527c50cb59f469e16f8746b373ac4edd7b0
---
R hieradata/role/common/labs/dns.yaml
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/68/255068/1

diff --git a/hieradata/role/common/labsdns.yaml 
b/hieradata/role/common/labs/dns.yaml
similarity index 100%
rename from hieradata/role/common/labsdns.yaml
rename to hieradata/role/common/labs/dns.yaml

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

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

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


[MediaWiki-commits] [Gerrit] labs: Move labmon role to labs::graphite role - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: labs: Move labmon role to labs::graphite role
..

labs: Move labmon role to labs::graphite role

And some small misc cleanup and consolidation

Change-Id: Ida0ee5059350853684abd859bd0fcf2a051947ba
---
R hieradata/role/common/labs/graphite.pp
M manifests/role/graphite.pp
D manifests/role/labmon.pp
M manifests/site.pp
A modules/role/manifests/labs/graphite.pp
5 files changed, 24 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/67/255067/1

diff --git a/hieradata/role/common/labmon.yaml 
b/hieradata/role/common/labs/graphite.pp
similarity index 100%
rename from hieradata/role/common/labmon.yaml
rename to hieradata/role/common/labs/graphite.pp
diff --git a/manifests/role/graphite.pp b/manifests/role/graphite.pp
index ada0f35..665cbf9 100644
--- a/manifests/role/graphite.pp
+++ b/manifests/role/graphite.pp
@@ -316,17 +316,3 @@
 }
 
 }
-
-# == Class: role::graphite::labmon
-#
-# Sets up graphite instance for monitoring labs, running on production 
hardware.
-# Instance is open to all, no password required to see metrics
-class role::graphite::labmon {
-class { 'role::graphite::base':
-storage_dir => '/srv/carbon',
-auth=> false,
-hostname=> 'graphite.wmflabs.org',
-}
-
-include graphite::labs::archiver
-}
diff --git a/manifests/role/labmon.pp b/manifests/role/labmon.pp
deleted file mode 100644
index 1b38836..000
--- a/manifests/role/labmon.pp
+++ /dev/null
@@ -1,17 +0,0 @@
-# = Class: labmon
-# Role for misc. setup of labs monitoring
-
-class role::labmon {
-
-class { 'role::graphite::labmon': }
-
-file { '/var/lib/carbon':
-ensure  => link,
-target  => '/srv/carbon',
-owner   => '_graphite',
-group   => '_graphite',
-require => Class['role::graphite::labmon']
-}
-
-include role::statsite
-}
diff --git a/manifests/site.pp b/manifests/site.pp
index ca17275..c3f2b34 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1195,7 +1195,7 @@
 
 # Labs Graphite and StatsD host
 node 'labmon1001.eqiad.wmnet' {
-role labmon
+role labs::graphite
 include standard
 }
 
diff --git a/modules/role/manifests/labs/graphite.pp 
b/modules/role/manifests/labs/graphite.pp
new file mode 100644
index 000..2bf3ce1
--- /dev/null
+++ b/modules/role/manifests/labs/graphite.pp
@@ -0,0 +1,23 @@
+# = Class: role::labs::graphite
+# Sets up graphite instance for monitoring labs, running on production 
hardware.
+# Instance is open to all, no password required to see metrics
+class role::labs::graphite {
+
+class { 'role::graphite::base':
+storage_dir => '/srv/carbon',
+auth=> false,
+hostname=> 'graphite.wmflabs.org',
+}
+
+include graphite::labs::archiver
+
+file { '/var/lib/carbon':
+ensure  => link,
+target  => '/srv/carbon',
+owner   => '_graphite',
+group   => '_graphite',
+require => Class['role::graphite::base']
+}
+
+include role::statsite
+}

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

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

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


[MediaWiki-commits] [Gerrit] Rename phragile role and mark it as labs-only - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: Rename phragile role and mark it as labs-only
..


Rename phragile role and mark it as labs-only

Change-Id: I5f9dd8e00900d05791d72de96f8e21c85eec19ca
---
D manifests/role/labsphragile.pp
A manifests/role/phragile.pp
2 files changed, 6 insertions(+), 3 deletions(-)

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



diff --git a/manifests/role/labsphragile.pp b/manifests/role/labsphragile.pp
deleted file mode 100644
index 7e49a09..000
--- a/manifests/role/labsphragile.pp
+++ /dev/null
@@ -1,3 +0,0 @@
-class role::labsphragile {
-include ::phragile
-}
diff --git a/manifests/role/phragile.pp b/manifests/role/phragile.pp
new file mode 100644
index 000..bb240be
--- /dev/null
+++ b/manifests/role/phragile.pp
@@ -0,0 +1,6 @@
+class role::phragile {
+# Only on labs!
+requires_realm('labs')
+
+include ::phragile
+}

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

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

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


[MediaWiki-commits] [Gerrit] Rename phragile role and mark it as labs-only - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has uploaded a new change for review.

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

Change subject: Rename phragile role and mark it as labs-only
..

Rename phragile role and mark it as labs-only

Change-Id: I5f9dd8e00900d05791d72de96f8e21c85eec19ca
---
D manifests/role/labsphragile.pp
A manifests/role/phragile.pp
2 files changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/66/255066/1

diff --git a/manifests/role/labsphragile.pp b/manifests/role/labsphragile.pp
deleted file mode 100644
index 7e49a09..000
--- a/manifests/role/labsphragile.pp
+++ /dev/null
@@ -1,3 +0,0 @@
-class role::labsphragile {
-include ::phragile
-}
diff --git a/manifests/role/phragile.pp b/manifests/role/phragile.pp
new file mode 100644
index 000..bb240be
--- /dev/null
+++ b/manifests/role/phragile.pp
@@ -0,0 +1,6 @@
+class role::phragile {
+# Only on labs!
+requires_realm('labs')
+
+include ::phragile
+}

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

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

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


[MediaWiki-commits] [Gerrit] CRM-17454 fix slow dedupe query - change (wikimedia...civicrm)

2015-11-23 Thread Eileen (Code Review)
Eileen has uploaded a new change for review.

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

Change subject: CRM-17454 fix slow dedupe query
..

CRM-17454 fix slow dedupe query

See https://github.com/civicrm/civicrm-core/pull/7282/ for the unit test for 
this
Note I have submitted against 4.6 & 4.7 upstream but not sure about whether it 
will go
into 4.6 upstream - my comments are on 
https://github.com/civicrm/civicrm-core/pull/7283
and more discussion on https://issues.civicrm.org/jira/browse/CRM-17454

Bug: T116886
Change-Id: Ifc2de89521ab60b7b424fe04ee39e6c322106cb9
---
M CRM/Dedupe/Merger.php
1 file changed, 44 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/65/255065/1

diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php
index 4ae5018..3310878 100644
--- a/CRM/Dedupe/Merger.php
+++ b/CRM/Dedupe/Merger.php
@@ -195,33 +195,34 @@
   }
 
   /**
-   * Return tables and their fields referencing civicrm_contact.contact_id 
explicitly
+   * Get array tables and fields that reference civicrm_contact.id.
+   *
+   * This includes core tables, custom group tables, tables added by the merge
+   * hook and (somewhat randomly) the entity_tag table.
+   *
+   * Refer to CRM-17454 for information on the danger of querying the 
information
+   * schema to derive this.
+   *
+   * @todo create an 'entity hook' to allow entities to be registered to 
CiviCRM
+   * including all info that is normally in the DAO.
*/
   public static function cidRefs() {
-static $cidRefs;
-if (!$cidRefs) {
-  $sql = "
-SELECT
-table_name,
-column_name
-FROM information_schema.key_column_usage
-WHERE
-referenced_table_schema = database() AND
-referenced_table_name = 'civicrm_contact' AND
-referenced_column_name = 'id';
-  ";
-  $dao = CRM_Core_DAO::executeQuery($sql);
-  while ($dao->fetch()) {
-$cidRefs[$dao->table_name][] = $dao->column_name;
+$cidRefs = array();
+$coreReferences = CRM_Core_DAO::getReferencesToTable('civicrm_contact');
+foreach ($coreReferences as $coreReference) {
+  if (!is_a($coreReference, 'CRM_Core_Reference_Dynamic')) {
+$cidRefs[$coreReference->getReferenceTable()][] = 
$coreReference->getReferenceKey();
   }
-
-  // FixME for time being adding below line statically as no Foreign key 
constraint defined for table 'civicrm_entity_tag'
-  $cidRefs['civicrm_entity_tag'][] = 'entity_id';
-  $dao->free();
-
-  // Allow hook_civicrm_merge() to adjust $cidRefs
-  CRM_Utils_Hook::merge('cidRefs', $cidRefs);
 }
+self::addCustomTablesExtendingContactsToCidRefs($cidRefs);
+
+// FixME for time being adding below line statically as no Foreign key 
constraint defined for table 'civicrm_entity_tag'
+$cidRefs['civicrm_entity_tag'][] = 'entity_id';
+
+// Allow hook_civicrm_merge() to adjust $cidRefs.
+// @todo consider adding a way to register entities and have them
+// automatically added to this list.
+CRM_Utils_Hook::merge('cidRefs', $cidRefs);
 return $cidRefs;
   }
 
@@ -1663,4 +1664,24 @@
 }
   }
 
+  /**
+   * Add custom tables that extend contacts to the list of contact references.
+   *
+   * CRM_Core_BAO_CustomGroup::getAllCustomGroupsByBaseEntity seems like a 
safe-ish
+   * function to be sure all are retrieved & we don't miss subtypes or 
inactive or multiples
+   * - the down side is it is not cached.
+   *
+   * Further changes should be include tests in the CRM_Core_MergerTest class
+   * to ensure that disabled, subtype, multiple etc groups are still captured.
+   *
+   * @param array $cidRefs
+   */
+  public static function addCustomTablesExtendingContactsToCidRefs(&$cidRefs) {
+$customValueTables = 
CRM_Core_BAO_CustomGroup::getAllCustomGroupsByBaseEntity('Contact');
+$customValueTables->find();
+while ($customValueTables->fetch()) {
+  $cidRefs[$customValueTables->table_name] = array('entity_id');
+}
+  }
+
 }

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

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

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


[MediaWiki-commits] [Gerrit] Make redisdb role conform to autolayout - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: Make redisdb role conform to autolayout
..


Make redisdb role conform to autolayout

Change-Id: I24b196d2a1e4ff0566ae7bfae5e9fa8a2546a6b9
---
D hieradata/role/codfw/db/redis.yaml
A hieradata/role/codfw/redisdb.yaml
D hieradata/role/common/db/redis.yaml
A hieradata/role/common/redisdb.yaml
R hieradata/role/eqiad/redisdb.yaml
M manifests/role/redisdb.pp
M manifests/site.pp
7 files changed, 17 insertions(+), 17 deletions(-)

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



diff --git a/hieradata/role/codfw/db/redis.yaml 
b/hieradata/role/codfw/db/redis.yaml
deleted file mode 100644
index 72c3e20..000
--- a/hieradata/role/codfw/db/redis.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-role::db::redis::redis_replication:
-  rdb2003: rdb2001
-  rdb2004: rdb2002
-role::db::redis::dir: "/srv/redis"
-debdeploy::grains:
-  debdeploy-redis-codfw:
-value: standard
-
diff --git a/hieradata/role/codfw/redisdb.yaml 
b/hieradata/role/codfw/redisdb.yaml
new file mode 100644
index 000..56c5bbb
--- /dev/null
+++ b/hieradata/role/codfw/redisdb.yaml
@@ -0,0 +1,8 @@
+role::redisdb::redis_replication:
+  rdb2003: rdb2001
+  rdb2004: rdb2002
+role::redisdb::dir: "/srv/redis"
+debdeploy::grains:
+  debdeploy-redis-codfw:
+value: standard
+
diff --git a/hieradata/role/common/db/redis.yaml 
b/hieradata/role/common/db/redis.yaml
deleted file mode 100644
index 4e6f695..000
--- a/hieradata/role/common/db/redis.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-cluster: redis
-role::db::redis::redis_replication:
-  rdb1002: rdb1001
-  rdb1004: rdb1003
-  rdb1008: rdb1007
-role::db::redis::dir: "/a/redis"
diff --git a/hieradata/role/common/redisdb.yaml 
b/hieradata/role/common/redisdb.yaml
new file mode 100644
index 000..cc32c78
--- /dev/null
+++ b/hieradata/role/common/redisdb.yaml
@@ -0,0 +1,6 @@
+cluster: redis
+role::redisdb::redis_replication:
+  rdb1002: rdb1001
+  rdb1004: rdb1003
+  rdb1008: rdb1007
+role::redisdb::dir: "/a/redis"
diff --git a/hieradata/role/eqiad/db/redis.yaml 
b/hieradata/role/eqiad/redisdb.yaml
similarity index 100%
rename from hieradata/role/eqiad/db/redis.yaml
rename to hieradata/role/eqiad/redisdb.yaml
diff --git a/manifests/role/redisdb.pp b/manifests/role/redisdb.pp
index 60dd86e..6089270 100644
--- a/manifests/role/redisdb.pp
+++ b/manifests/role/redisdb.pp
@@ -10,7 +10,7 @@
 description => 'codfw Redis',
 }
 
-class role::db::redis (
+class role::redisdb (
 $maxmemory = inline_template('<%= (Float(@memorysize.split[0]) * 
0.82).round %>Gb'),
 $redis_replication = undef,
 $dir   = '/srv/redis'
diff --git a/manifests/site.pp b/manifests/site.pp
index 54b0ca1..ca17275 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2172,11 +2172,11 @@
 }
 
 node /^rdb100[0-9]\.eqiad\.wmnet/ {
-role db::redis
+role redisdb
 }
 
 node /^rdb200[1-4]\.codfw\.wmnet/ {
-role db::redis
+role redisdb
 }
 
 # restbase eqiad cluster

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

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

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


[MediaWiki-commits] [Gerrit] WIP use SHA-256 HMAC for Adyen - change (mediawiki...DonationInterface)

2015-11-23 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: WIP use SHA-256 HMAC for Adyen
..

WIP use SHA-256 HMAC for Adyen

SHA-1 is broken and deprecated, and can't be used with new accounts.
Request signature docs:
https://docs.adyen.com/pages/viewpage.action?pageId=5376964
Response signature docs:
https://docs.adyen.com/display/TD/HPP+payment+response

Bug: T116679
Change-Id: I2fd32ea915c6c3f7502c128973d8fb3df85b5ff7
---
M adyen_gateway/adyen.adapter.php
1 file changed, 37 insertions(+), 75 deletions(-)


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

diff --git a/adyen_gateway/adyen.adapter.php b/adyen_gateway/adyen.adapter.php
index d85e182..ffe3def 100644
--- a/adyen_gateway/adyen.adapter.php
+++ b/adyen_gateway/adyen.adapter.php
@@ -64,7 +64,6 @@
'street',
'zip',
'risk_score',
-   'billing_signature',
'hpp_signature',
);
}
@@ -78,7 +77,6 @@
'billingAddress.city' => 'city',
'billingAddress.country' => 'country',
'billingAddress.postalCode' => 'zip',
-   'billingAddressSig' => 'billing_signature',
'billingAddress.stateOrProvince' => 'state',
'billingAddress.street' => 'street',
'billingAddressType' => 'billing_address_type',
@@ -109,7 +107,9 @@
'authResult' => 'result',
'merchantReference' => 'order_id',
'merchantReturnData' => 'return_data',
+   'paymentMethod' => 'payment_method',
'pspReference' => 'gateway_txn_id',
+   'shopperLocale' => 'language',
'skinCode' => 'skin_code',
);
}
@@ -145,7 +145,6 @@
'billingAddress.postalCode',
'billingAddress.stateOrProvince',
'billingAddress.country',
-   'billingAddressSig',
'billingAddressType',
'currencyCode',
'merchantAccount',
@@ -563,88 +562,51 @@
}
 
protected function stage_hpp_signature() {
-   $keys = array(
-   'amount',
-   'currency_code',
-   'expiration',
-   'order_id',
-   'skin_code',
-   'merchant_account',
-   'session_expiration',
-   'email',
-   'customer_id',
-   'recurring_type',
-   'allowed_methods',
-   'blocked_methods',
-   'statement_template',
-   'return_data',
-   'billing_address_type',
-   'delivery_address_type',
-   'risk_score',
-   );
-   $sig_values = $this->getStagedValues( $this->getGatewayKeys( 
$keys ) );
-   $this->staged_data['hpp_signature'] = 
$this->calculateSignature( $sig_values );
+   $this->staged_data['hpp_signature'] = 
$this->calculateSignature( $this->buildRequestParams() );
}
 
-   protected function stage_billing_signature() {
-   $keys = array(
-   'street',
-   'city',
-   'zip',
-   'state',
-   'country',
-   );
-   $sig_values = $this->getStagedValues( $this->getGatewayKeys( 
$keys ) );
-   $this->staged_data['billing_signature'] = 
$this->calculateSignature( $sig_values );
+   /**
+* Overriding @see GatewayAdapter::getTransactionSpecificValue to strip
+* newlines.
+* @param string $gateway_field_name
+* @param boolean $token
+* @return mixed
+*/
+   protected function getTransactionSpecificValue( $gateway_field_name, 
$token = false ) {
+   $value = parent::getTransactionSpecificValue( 
$gateway_field_name, $token );
+   return str_replace( '\n', '', $value );
}
 
-   // TODO: make the signature code more reusable.  Generalize the idea of
-   // mapping keys and fetching matching values.
-   protected function getGatewayKeys( $keys ) {
-   $staged = array();
-   $staging_map = array_flip( $this->var_map );
-   foreach ( $keys as $normal_form_key ) {
-   $staged[] = $staging_map[ $normal_form_key ];
+   funct

[MediaWiki-commits] [Gerrit] extdist: Make role name autolayout compatible - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: extdist: Make role name autolayout compatible
..


extdist: Make role name autolayout compatible

Change-Id: I2f730d1c1b748bd8a653dd2a48a8091ccec72839
---
M manifests/role/extdist.pp
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/manifests/role/extdist.pp b/manifests/role/extdist.pp
index a73f0b8..eda9066 100644
--- a/manifests/role/extdist.pp
+++ b/manifests/role/extdist.pp
@@ -3,7 +3,7 @@
 # This class sets up a tarball generator for the Extension Distributor
 # extension enabled on mediawiki.org.
 #
-class role::labs::extdist {
+class role::extdist {
 
 include role::labs::lvm::srv
 

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

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

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


[MediaWiki-commits] [Gerrit] Move debdeploy role into autolayout compatible names - change (operations/puppet)

2015-11-23 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: Move debdeploy role into autolayout compatible names
..


Move debdeploy role into autolayout compatible names

Change-Id: I1e2c86b96cc0789f6b11438a4bcebbf46e3166ee
---
M manifests/role/debdeploy.pp
M manifests/site.pp
2 files changed, 7 insertions(+), 5 deletions(-)

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



diff --git a/manifests/role/debdeploy.pp b/manifests/role/debdeploy.pp
index 303f046..cbcdcc4 100644
--- a/manifests/role/debdeploy.pp
+++ b/manifests/role/debdeploy.pp
@@ -1,7 +1,9 @@
-class role::debdeploymaster {
+class role::debdeploy::master {
 include standard
 
-system::role { 'role::debdeploymaster': description => 'debdeploy master' }
+system::role { 'role::debdeploymaster':
+description => 'debdeploy master',
+}
 
-include debdeploy::master
+include ::debdeploy::master
 }
diff --git a/manifests/site.pp b/manifests/site.pp
index a0f3074..54b0ca1 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2015,7 +2015,7 @@
 
 # secondary salt master
 node 'neodymium.eqiad.wmnet' {
-#role salt::masters::production, deployment::salt_masters, debdeploymaster
+#role salt::masters::production, deployment::salt_masters, 
debdeploy::master
 role salt::masters::production
 include standard
 }
@@ -2092,7 +2092,7 @@
 
 # primary puppet master
 node 'palladium.eqiad.wmnet' {
-role ipmi, salt::masters::production, deployment::salt_masters, 
access_new_install, puppetmaster::frontend, pybal_config, debdeploymaster
+role ipmi, salt::masters::production, deployment::salt_masters, 
access_new_install, puppetmaster::frontend, pybal_config, debdeploy::master
 include standard
 include role::conftool::master
 }

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

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

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


[MediaWiki-commits] [Gerrit] Enable data access for wikinews, meta-wiki, mediawiki.org an... - change (operations/mediawiki-config)

2015-11-23 Thread Aude (Code Review)
Aude has uploaded a new change for review.

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

Change subject: Enable data access for wikinews, meta-wiki, mediawiki.org and 
wikispecies
..

Enable data access for wikinews, meta-wiki, mediawiki.org and wikispecies

this is tentatively scheduled for December 2, if such deployment
is allowed for that time.

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 91a7b03..201b39e 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15110,10 +15110,6 @@
 
 'wmgWikibaseEnableData' => array(
'default' => true,
-   'wikinews' => false,
-   'mediawikiwiki' => false,
-   'metawiki' => false,
-   'specieswiki' => false
 ),
 
 'wmgWikibaseEnableArbitraryAccess' => array(

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

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

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


[MediaWiki-commits] [Gerrit] Fix undefined var - change (wikimedia...SmashPig)

2015-11-23 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Fix undefined var
..

Fix undefined var

*sigh*

Change-Id: I6449092c564cb9a438fba873e9c70ba9a421ed02
---
M Core/Logging/LogEvent.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/62/255062/1

diff --git a/Core/Logging/LogEvent.php b/Core/Logging/LogEvent.php
index 49e7019..34454d2 100644
--- a/Core/Logging/LogEvent.php
+++ b/Core/Logging/LogEvent.php
@@ -49,6 +49,7 @@
$this->exception = $exception;
 
if ( !is_null( $data ) ) {
+   $jdata = false;
if ( $data instanceof JsonSerializableObject ) {
try {
$jdata = $data->toJson();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6449092c564cb9a438fba873e9c70ba9a421ed02
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] EventPresentationModel: Cache the result of getBundledEvents() - change (mediawiki...Echo)

2015-11-23 Thread Catrope (Code Review)
Catrope has uploaded a new change for review.

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

Change subject: EventPresentationModel: Cache the result of getBundledEvents()
..

EventPresentationModel: Cache the result of getBundledEvents()

Change-Id: I83ce3b7754055dd494fcde41f043144294da2f3f
---
M includes/formatters/EventPresentationModel.php
1 file changed, 5 insertions(+), 2 deletions(-)


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

diff --git a/includes/formatters/EventPresentationModel.php 
b/includes/formatters/EventPresentationModel.php
index a7a4110..7cb523e 100644
--- a/includes/formatters/EventPresentationModel.php
+++ b/includes/formatters/EventPresentationModel.php
@@ -88,17 +88,20 @@
if ( !$this->event->getBundleHash() ) {
return array();
}
+   if ( isset( $this->bundledEvents ) ) {
+   return $this->bundledEvents;
+   }
 
// FIXME: We really shouldn't be making db queries like this
// in the presentation model
$eventMapper = new EchoEventMapper();
-   $events = $eventMapper->fetchByUserBundleHash(
+   $this->bundledEvents = $eventMapper->fetchByUserBundleHash(
$this->user,
$this->event->getBundleHash()
// default params: web, DESC, limit=250
);
 
-   return $events;
+   return $this->bundledEvents;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83ce3b7754055dd494fcde41f043144294da2f3f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Catrope 

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


[MediaWiki-commits] [Gerrit] Catch exceptions in LogEvent constructor - change (wikimedia...SmashPig)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Catch exceptions in LogEvent constructor
..


Catch exceptions in LogEvent constructor

In the real world, logging is a very dangerous occupation.  In
programming, it should be safe as houses.

FIXME: relegate custom logging framework to slag heap

Change-Id: Id3fd469f9e4459599f58446bcf84d3f1e73292c7
---
M Core/Logging/LogEvent.php
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/Core/Logging/LogEvent.php b/Core/Logging/LogEvent.php
index f8c3047..49e7019 100644
--- a/Core/Logging/LogEvent.php
+++ b/Core/Logging/LogEvent.php
@@ -1,5 +1,6 @@
 toJson();
+   try {
+   $jdata = $data->toJson();
+   }
+   catch( DataSerializationException $ex ) {}
} else {
$jdata = json_encode( $data );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id3fd469f9e4459599f58446bcf84d3f1e73292c7
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Katie Horn 
Gerrit-Reviewer: Pcoombe 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] sudo journalctl: make missing restrictions obvious - change (operations/puppet)

2015-11-23 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: sudo journalctl: make missing restrictions obvious
..


sudo journalctl: make missing restrictions obvious

sudoers command argument wildcard '*' does not restrict anthing. journalctl
allows multiple -u arguments, thus this does not restrict invoking journalctl
on one unit.

Bug: T115067
Change-Id: I941fd1f797c3b57fb97fdfbf1c9cd27ece0e9daa
---
M modules/admin/data/data.yaml
1 file changed, 2 insertions(+), 3 deletions(-)

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



diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 80c28cd..428d59a 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -359,7 +359,7 @@
  'ALL = NOPASSWD: /bin/systemctl mask kartotherian.service',
  'ALL = NOPASSWD: /bin/systemctl unmask kartotherian.service',
  'ALL = (kartotherian) NOPASSWD: ALL',
- 'ALL = NOPASSWD: /bin/journalctl -u kartotherian *']
+ 'ALL = NOPASSWD: /bin/journalctl *']
   wdqs-admins:
 gid: 755
 description: Admins for the WikiData Query Service project
@@ -383,12 +383,11 @@
  'ALL = NOPASSWD: /bin/systemctl mask tilerator.service',
  'ALL = NOPASSWD: /bin/systemctl unmask tilerator.service',
  'ALL = (tilerator) NOPASSWD: ALL',
- 'ALL = NOPASSWD: /bin/journalctl -u tilerator *',
  'ALL = NOPASSWD: /usr/sbin/service tileratorui *',
  'ALL = NOPASSWD: /bin/systemctl mask tileratorui.service',
  'ALL = NOPASSWD: /bin/systemctl unmask tileratorui.service',
  'ALL = (tileratorui) NOPASSWD: ALL',
- 'ALL = NOPASSWD: /bin/journalctl -u tileratorui *']
+ 'ALL = NOPASSWD: /bin/journalctl *']
   mobileapps-admin:
 description: Group of mobileapps admins
 gid: 759

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

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

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


[MediaWiki-commits] [Gerrit] WIP: publishing for visibility, don't merge this - change (mediawiki...DonationInterface)

2015-11-23 Thread Cdentinger (Code Review)
Cdentinger has uploaded a new change for review.

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

Change subject: WIP: publishing for visibility, don't merge this
..

WIP: publishing for visibility, don't merge this

only one test fails with this patch instead of a bunch but i have to
investiage further. php bails when array_key_exists gets a "needle" that
is false (null is fine), because php, and that cascades in weird ways
here.

as far as the remaining test failure we'll see if it happens on jenkins
or not.  was related to server IP in wgRequest

Change-Id: I20b2461d22185cc1950b6844d7be9fcb526c15e1
---
M gateway_common/DonationData.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php
index dcae0fa..075f3a8 100644
--- a/gateway_common/DonationData.php
+++ b/gateway_common/DonationData.php
@@ -469,7 +469,7 @@
$currency = strtoupper( $currency );
}
// If it's blank or not a currency code, guess it from the 
country.
-   if ( !array_key_exists( $currency, 
CurrencyRates::getCurrencyRates() ) ) {
+   if ( $currency && !array_key_exists( $currency, 
CurrencyRates::getCurrencyRates() ) ) {
//TODO: This is going to fail miserably if there's no 
country yet.
$currency = NationalCurrencies::getNationalCurrency( 
$this->getVal( 'country' ) );
$this->logger->debug( "Got currency from 'country', 
now: $currency" );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I20b2461d22185cc1950b6844d7be9fcb526c15e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Cdentinger 

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


[MediaWiki-commits] [Gerrit] Removed support for unnamed params for #forminput - change (mediawiki...SemanticForms)

2015-11-23 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Removed support for unnamed params for #forminput
..


Removed support for unnamed params for #forminput

Also made some general improvements to the code.

Change-Id: Ia1f99f66527ae916a41c31a090796704ed10c801
---
M includes/SF_ParserFunctions.php
1 file changed, 44 insertions(+), 65 deletions(-)

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



diff --git a/includes/SF_ParserFunctions.php b/includes/SF_ParserFunctions.php
index 57f8773..60edde6 100644
--- a/includes/SF_ParserFunctions.php
+++ b/includes/SF_ParserFunctions.php
@@ -236,42 +236,40 @@
 
$params = func_get_args();
array_shift( $params ); // don't need the parser
-   // set defaults
+
+   // Set defaults.
$inFormName = $inValue = $inButtonStr = $inQueryStr = '';
$inQueryArr = array();
-   $positionalParameters = false;
$inAutocompletionSource = '';
$inRemoteAutocompletion = false;
$inSize = 25;
$classStr = "sfFormInput";
$inPlaceholder = "";
$inAutofocus = true; // Only evaluated if $wgHtml5 is true.
-   // assign params - support unlabelled params, for backwards 
compatibility
+
+   // Assign params.
foreach ( $params as $i => $param ) {
$elements = explode( '=', $param, 2 );
 
-   // set param_name and value
-   if ( count( $elements ) > 1 && !$positionalParameters ) 
{
-   $param_name = trim( $elements[0] );
-
-   // parse (and sanitize) parameter values
+   // Set param name and value.
+   if ( count( $elements ) > 1 ) {
+   $paramName = trim( $elements[0] );
+   // Parse (and sanitize) parameter values.
$value = trim( $parser->recursiveTagParse( 
$elements[1] ) );
} else {
-   $param_name = null;
-
-   // parse (and sanitize) parameter values
-   $value = trim( $parser->recursiveTagParse( 
$param ) );
+   $paramName = trim( $param );
+   $value = null;
}
 
-   if ( $param_name == 'form' )
+   if ( $paramName == 'form' ) {
$inFormName = $value;
-   elseif ( $param_name == 'size' )
+   } elseif ( $paramName == 'size' ) {
$inSize = $value;
-   elseif ( $param_name == 'default value' )
+   } elseif ( $paramName == 'default value' ) {
$inValue = $value;
-   elseif ( $param_name == 'button text' )
+   } elseif ( $paramName == 'button text' ) {
$inButtonStr = $value;
-   elseif ( $param_name == 'query string' ) {
+   } elseif ( $paramName == 'query string' ) {
// Change HTML-encoded ampersands directly to
// URL-encoded ampersands, so that the string
// doesn't get split up on the '&'.
@@ -281,43 +279,24 @@
 
parse_str($inQueryStr, $arr);
$inQueryArr = 
SFUtils::array_merge_recursive_distinct( $inQueryArr, $arr );
-   } elseif ( $param_name == 'autocomplete on category' ) {
+   } elseif ( $paramName == 'autocomplete on category' ) {
$inAutocompletionSource = $value;
-   $autocompletion_type = 'category';
-   } elseif ( $param_name == 'autocomplete on namespace' ) 
{
+   $autocompletionType = 'category';
+   } elseif ( $paramName == 'autocomplete on namespace' ) {
$inAutocompletionSource = $value;
-   $autocompletion_type = 'namespace';
-   } elseif ( $param_name == 'remote autocompletion' ) {
+   $autocompletionType = 'namespace';
+   } elseif ( $paramName == 'remote autocompletion' ) {
$inRemoteAutocompletion = true;
-   } elseif ( $param_name == 'placeholder' ) {
+   } elseif ( $paramName == 'placeholder' ) {
$inPlaceholder = $value;
-  

[MediaWiki-commits] [Gerrit] Removed support for unnamed params for #forminput - change (mediawiki...SemanticForms)

2015-11-23 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: Removed support for unnamed params for #forminput
..

Removed support for unnamed params for #forminput

Also made some general improvements to the code.

Change-Id: Ia1f99f66527ae916a41c31a090796704ed10c801
---
M includes/SF_ParserFunctions.php
1 file changed, 44 insertions(+), 65 deletions(-)


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

diff --git a/includes/SF_ParserFunctions.php b/includes/SF_ParserFunctions.php
index 57f8773..60edde6 100644
--- a/includes/SF_ParserFunctions.php
+++ b/includes/SF_ParserFunctions.php
@@ -236,42 +236,40 @@
 
$params = func_get_args();
array_shift( $params ); // don't need the parser
-   // set defaults
+
+   // Set defaults.
$inFormName = $inValue = $inButtonStr = $inQueryStr = '';
$inQueryArr = array();
-   $positionalParameters = false;
$inAutocompletionSource = '';
$inRemoteAutocompletion = false;
$inSize = 25;
$classStr = "sfFormInput";
$inPlaceholder = "";
$inAutofocus = true; // Only evaluated if $wgHtml5 is true.
-   // assign params - support unlabelled params, for backwards 
compatibility
+
+   // Assign params.
foreach ( $params as $i => $param ) {
$elements = explode( '=', $param, 2 );
 
-   // set param_name and value
-   if ( count( $elements ) > 1 && !$positionalParameters ) 
{
-   $param_name = trim( $elements[0] );
-
-   // parse (and sanitize) parameter values
+   // Set param name and value.
+   if ( count( $elements ) > 1 ) {
+   $paramName = trim( $elements[0] );
+   // Parse (and sanitize) parameter values.
$value = trim( $parser->recursiveTagParse( 
$elements[1] ) );
} else {
-   $param_name = null;
-
-   // parse (and sanitize) parameter values
-   $value = trim( $parser->recursiveTagParse( 
$param ) );
+   $paramName = trim( $param );
+   $value = null;
}
 
-   if ( $param_name == 'form' )
+   if ( $paramName == 'form' ) {
$inFormName = $value;
-   elseif ( $param_name == 'size' )
+   } elseif ( $paramName == 'size' ) {
$inSize = $value;
-   elseif ( $param_name == 'default value' )
+   } elseif ( $paramName == 'default value' ) {
$inValue = $value;
-   elseif ( $param_name == 'button text' )
+   } elseif ( $paramName == 'button text' ) {
$inButtonStr = $value;
-   elseif ( $param_name == 'query string' ) {
+   } elseif ( $paramName == 'query string' ) {
// Change HTML-encoded ampersands directly to
// URL-encoded ampersands, so that the string
// doesn't get split up on the '&'.
@@ -281,43 +279,24 @@
 
parse_str($inQueryStr, $arr);
$inQueryArr = 
SFUtils::array_merge_recursive_distinct( $inQueryArr, $arr );
-   } elseif ( $param_name == 'autocomplete on category' ) {
+   } elseif ( $paramName == 'autocomplete on category' ) {
$inAutocompletionSource = $value;
-   $autocompletion_type = 'category';
-   } elseif ( $param_name == 'autocomplete on namespace' ) 
{
+   $autocompletionType = 'category';
+   } elseif ( $paramName == 'autocomplete on namespace' ) {
$inAutocompletionSource = $value;
-   $autocompletion_type = 'namespace';
-   } elseif ( $param_name == 'remote autocompletion' ) {
+   $autocompletionType = 'namespace';
+   } elseif ( $paramName == 'remote autocompletion' ) {
$inRemoteAutocompletion = true;
-   } elseif ( $param_name == 'placeholder' ) {
+   } elseif ( $paramName == 'placeholder' ) {
 

[MediaWiki-commits] [Gerrit] Update the privacy policy - change (wikimedia/iegreview)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update the privacy policy
..


Update the privacy policy

Bug: T96882
Change-Id: I38f8c46ba32a3d2c76c7be1a019c924135eafba7
---
M data/i18n/en.json
M data/i18n/qqq.json
M data/templates/privacy.html
3 files changed, 86 insertions(+), 3 deletions(-)

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



diff --git a/data/i18n/en.json b/data/i18n/en.json
index fd7d5db..78aa775 100644
--- a/data/i18n/en.json
+++ b/data/i18n/en.json
@@ -34,7 +34,6 @@
"credits-page-logo": "The https://commons.wikimedia.org/wiki/File%3AIEG_glasses_lightblue.png\";>glasses
 logo is by Wikimedia Commons user Heatherawalls and used under the 
Creative Commons CC0 1.0 Universal Public Domain Dedication license.",
 
"privacy": "Privacy",
-   "privacy-page": "All personal information will be held strictly 
confidential by the grants reviewers and the http://wikimediafoundation.org\";>Wikimedia Foundation, in accordance 
to the Wikimedia Foundation http://wikimediafoundation.org/wiki/Privacy_policy\";>privacy 
policy.",
 
"footer-credits": "credits",
"footer-privacy": "privacy",
diff --git a/data/i18n/qqq.json b/data/i18n/qqq.json
index 35b20c5..adecd8e 100644
--- a/data/i18n/qqq.json
+++ b/data/i18n/qqq.json
@@ -123,7 +123,6 @@
"password": "Input label, followed by text 
box.\n{{Identical|Password}}",
"password-username": "Input label, followed by authenticated user's 
username.\n{{Identical|Username}}",
"privacy": "Privacy page title",
-   "privacy-page": "Privacy policy page content.",
"proposal-summary": "Section title",
"proposals-edit-amount": "Input label, followed by text box.",
"proposals-edit-amount-placeholder": "Placeholder for input text box",
diff --git a/data/templates/privacy.html b/data/templates/privacy.html
index ce6e2ad..fc35e1e 100644
--- a/data/templates/privacy.html
+++ b/data/templates/privacy.html
@@ -8,7 +8,92 @@
 
   
 {{ 'privacy'|message }}
-{{ 'privacy-page'|message|raw }}
+  
+  
+Welcome!
+Welcome to the Wikimedia Foundation’s grant review application. The 
grant review app is a flexible scoring system for grant administrators and 
volunteers to review and score grant proposals.
+
+Definitions
+For the sake of clarity, "WMF", "us", "we", and "our" refer to the http://www.wikimediafoundation.org/";>Wikimedia Foundation; the "app" 
refers to the grant review application, and the "app privacy policy" refers to 
this document.
+"Personal information" means information you provide us or information 
we collect from you that could be used to personally identify you. To be clear, 
while we do not necessarily collect all of the following types of information, 
we consider at least the following to be "personal information" if it is 
otherwise nonpublic and can be used to identify you: (a) your real name, 
address, phone number, email address, password, identification number on 
government-issued ID, IP address, user-agent information, credit card number; 
(b) when associated with one of the items in subsection (a), any sensitive data 
such as date of birth, gender, sexual orientation, racial or ethnic origins, 
marital or familial status, medical conditions or disabilities, political 
affiliation, and religion; and (c) any of the items in subsections (a) or (b) 
when associated with your user account.
+
+Important Information
+
+By using the app, you agree to the terms of this grant review app 
privacy policy and the WMF https://wikimediafoundation.org/wiki/Terms_of_Use";>terms of use. 
Furthermore, by using the app, you consent to the collection, transfer, 
processing, storage, disclosure, and use of your information as described in 
this app privacy policy.
+
+If you do not agree to these terms, you may not use this app.
+
+If you have any questions or suggestions about the app privacy policy 
or WMF terms of use, please https://wikimediafoundation.org/wiki/Contact_us";>contact us.
+
+What This Policy Covers
+
+This app privacy policy applies to our collection and handling of 
information about you that we receive as a result of your use of the app. As a 
http://www.mediawiki.org/wiki/Wikimedia_Labs";>Wikimedia Labs 
project, the grant review app is http://wikimediafoundation.org/wiki/Privacy_policy#What_This_Privacy_Policy_Does_.26_Doesn.27t_Cover";>not
 covered by the general http://wikimediafoundation.org/wiki/Privacy_policy";>Wikimedia Privacy 
Policy. This app privacy policy only applies to use of this Wikimedia grant 
review application and does not cover use of any other Wikimedia projects, 
sites, or services.
+
+What Info We Collect
+We may collect information, including but not limited to:
+
+  User account information
+  User-submitted information
+  Information we collect re

[MediaWiki-commits] [Gerrit] Add nsp - change (mediawiki...deploy)

2015-11-23 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review.

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

Change subject: Add nsp
..

Add nsp

 * For I669b66457d55803c972f126bd98717616835173f

Change-Id: I46081cd8915a50b69a87a179618d49050d1471da
---
A node_modules/.bin/nsp
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/.bin/uglifyjs
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/.npmignore
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/.travis.yml
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/LICENSE
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/README.md
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/bin/uglifyjs
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/lib/ast.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/lib/compress.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/lib/mozilla-ast.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/lib/output.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/lib/parse.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/lib/scope.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/lib/sourcemap.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/lib/transform.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/lib/utils.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/async/LICENSE
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/async/README.md
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/async/component.json
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/async/lib/async.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/async/package.json
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/bool.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/boolean_double.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/boolean_single.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/default_hash.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/default_singles.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/divide.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count_options.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/line_count_wrap.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/nonopt.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/reflect.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/short.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/string.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/usage-options.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/example/xup.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/index.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/README.markdown
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/center.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/example/meat.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/index.js
D 
node_modules/express-handlebars/node_modules/handlebars/node_modules/uglify-js/node_modules/optimist/node_modules/wordwrap/

[MediaWiki-commits] [Gerrit] Tweak title pronunciation icon appearance - change (apps...wikipedia)

2015-11-23 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

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

Change subject: Tweak title pronunciation icon appearance
..

Tweak title pronunciation icon appearance

* Reduce the size of the icon[0] and increase the hit area.
* Seperate the view and collision concerns.

[0] https://veuwer.com/i/3e7s,3e7t

Bug: T114524
Change-Id: I5d506c96069584bc861441fd6612e04d17d58067
---
M app/src/main/java/org/wikipedia/richtext/AudioUrlSpan.java
M app/src/main/java/org/wikipedia/richtext/ClickSpan.java
A app/src/main/java/org/wikipedia/richtext/DefaultClickSpan.java
M app/src/main/java/org/wikipedia/richtext/DrawableSpan.java
M app/src/main/java/org/wikipedia/richtext/TextViewSpanOnTouchListener.java
M app/src/main/res/values/dimens.xml
6 files changed, 170 insertions(+), 68 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/richtext/AudioUrlSpan.java 
b/app/src/main/java/org/wikipedia/richtext/AudioUrlSpan.java
index b7ec392..35c0972 100644
--- a/app/src/main/java/org/wikipedia/richtext/AudioUrlSpan.java
+++ b/app/src/main/java/org/wikipedia/richtext/AudioUrlSpan.java
@@ -1,7 +1,11 @@
 package org.wikipedia.richtext;
 
 import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Canvas;
 import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.PointF;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.LevelListDrawable;
 import android.support.annotation.ColorInt;
@@ -18,6 +22,7 @@
 import org.wikipedia.media.AvPlayer;
 
 public class AudioUrlSpan extends AnimatedImageSpan implements ClickSpan {
+
 private static final int STOP_ICON_LEVEL = 0;
 private static final int PLAY_ICON_LEVEL = 1;
 
@@ -30,6 +35,9 @@
 @NonNull
 private final String path;
 
+@NonNull
+private final DefaultClickSpan clickSpan;
+
 public AudioUrlSpan(@NonNull View view,
 @NonNull AvPlayer player,
 @NonNull String path,
@@ -37,6 +45,7 @@
 super(view, drawable(view.getContext()), verticalAlignment);
 this.player = player;
 this.path = path;
+clickSpan = clickSpan(view.getResources());
 }
 
 public void setTint(@ColorInt int color) {
@@ -44,8 +53,13 @@
 }
 
 @Override
-public void onClick(TextView textView) {
+public void onClick(@NonNull TextView textView) {
 toggle();
+}
+
+@Override
+public boolean contains(@NonNull PointF point) {
+return clickSpan.contains(point);
 }
 
 @Override
@@ -74,6 +88,28 @@
 return super.getDrawable();
 }
 
+@Override
+@SuppressWarnings("checkstyle:parameternumber")
+public void draw(Canvas canvas,
+ CharSequence text,
+ int start,
+ int end,
+ float x,
+ int top,
+ int y,
+ int bottom,
+ Paint paint) {
+super.draw(canvas, text, start, end, x, top, y, bottom, paint);
+
+clickSpan.setOriginX(x + getDrawable().getBounds().centerX());
+clickSpan.setOriginY(drawY(y, bottom) + 
getDrawable().getBounds().centerY());
+
+final boolean debugClickBounds = false;
+if (debugClickBounds) {
+clickSpan.draw(canvas);
+}
+}
+
 private void showIcon(int level) {
 getDrawable().setLevel(level);
 }
@@ -82,23 +118,37 @@
 return getDrawable().getLevel();
 }
 
+@NonNull
 private static Drawable drawable(Context context) {
 LevelListDrawable levels = new AppLevelListDrawable();
 levels.addLevel(PLAY_ICON_LEVEL, PLAY_ICON_LEVEL, 
spinnerDrawable(context));
 levels.addLevel(STOP_ICON_LEVEL, STOP_ICON_LEVEL, 
speakerDrawable(context));
+int radius = getDimensionPixelSize(context, 
R.dimen.audio_url_span_loading_spinner_radius);
+levels.setBounds(0, 0, radius * 2, radius * 2);
 return levels;
 }
 
+@NonNull
 private static Drawable speakerDrawable(Context context) {
 return getDrawable(context, R.drawable.ic_volume_up_black_24dp);
 }
 
+@NonNull
 private static Drawable spinnerDrawable(Context context) {
 return new CircularProgressDrawable(Color.WHITE,
 getDimensionPixelSize(context, 
R.dimen.audio_url_span_loading_spinner_border_thickness),
 getDimensionPixelSize(context, 
R.dimen.audio_url_span_loading_spinner_radius));
 }
 
+@NonNull
+private DefaultClickSpan clickSpan(Resources resources) {
+DefaultClickSpan span = new DefaultClickSpan();
+float leg = resources.getDimension(R.dimen.audio_url_span_click_size);
+span.setWidth(leg);
+span.setHeight(

[MediaWiki-commits] [Gerrit] Update DonationInterface submodule - change (mediawiki/core)

2015-11-23 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged.

Change subject: Update DonationInterface submodule
..


Update DonationInterface submodule

Change-Id: Iebe28053235d675f195f06e6e0454589b5602e36
---
M extensions/DonationInterface
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 5630b74..583d6bf 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
-Subproject commit 5630b749388391c44193359abbf17336317f4e1d
+Subproject commit 583d6bf85c0c49aa9fc850b58f43b7d519579c60

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iebe28053235d675f195f06e6e0454589b5602e36
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_25
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Ejegg 

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


[MediaWiki-commits] [Gerrit] Update DonationInterface submodule - change (mediawiki/core)

2015-11-23 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Update DonationInterface submodule
..

Update DonationInterface submodule

Change-Id: Iebe28053235d675f195f06e6e0454589b5602e36
---
M extensions/DonationInterface
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/255056/1

diff --git a/extensions/DonationInterface b/extensions/DonationInterface
index 5630b74..583d6bf 16
--- a/extensions/DonationInterface
+++ b/extensions/DonationInterface
-Subproject commit 5630b749388391c44193359abbf17336317f4e1d
+Subproject commit 583d6bf85c0c49aa9fc850b58f43b7d519579c60

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iebe28053235d675f195f06e6e0454589b5602e36
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_25
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] Disallow associative arguments in ObjectFactory - change (mediawiki/core)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Disallow associative arguments in ObjectFactory
..


Disallow associative arguments in ObjectFactory

There is no strong use case for associative "decoration"
of constructor arguments (the documentation benefits
mentioned in I43aa085 are outweighed by the confusion
caused by not failing loudly when someone passes an
associative argument by accident, e.g. by omitting an
array nesting level), so disallow them but make sure
they fail nicely, not with an invalid offset error.

Change-Id: I09e4af85ded6a1497b0db0265d2ee6707f91f5e3
---
M includes/libs/ObjectFactory.php
M tests/phpunit/includes/libs/ObjectFactoryTest.php
2 files changed, 7 insertions(+), 3 deletions(-)

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



diff --git a/includes/libs/ObjectFactory.php b/includes/libs/ObjectFactory.php
index bd0da57..2ffc1d3 100644
--- a/includes/libs/ObjectFactory.php
+++ b/includes/libs/ObjectFactory.php
@@ -128,8 +128,10 @@
 * @return mixed Constructed instance
 */
public static function constructClassInstance( $clazz, $args ) {
-   // args are sometimes specified in a 'name' => $value format 
for readability
-   $args = array_values( $args );
+   // $args should be a non-associative array; show nice error if 
that's not the case
+   if ( $args && array_keys( $args ) !== range( 0, count( $args ) 
- 1 ) ) {
+   throw new InvalidArgumentException( __METHOD__ . ': 
$args cannot be an associative array' );
+   }
 
// TODO: when PHP min version supported is >=5.6.0 replace this
// with `return new $clazz( ... $args );`.
diff --git a/tests/phpunit/includes/libs/ObjectFactoryTest.php 
b/tests/phpunit/includes/libs/ObjectFactoryTest.php
index 6337210..f338633 100644
--- a/tests/phpunit/includes/libs/ObjectFactoryTest.php
+++ b/tests/phpunit/includes/libs/ObjectFactoryTest.php
@@ -109,12 +109,14 @@
);
}
 
+   /**
+* @expectedException InvalidArgumentException
+*/
public function testNamedArgs() {
$args = array( 'foo' => 1, 'bar' => 2, 'baz' => 3 );
$obj = ObjectFactory::constructClassInstance(
'ObjectFactoryTestFixture', $args
);
-   $this->assertSame( array( 1, 2, 3 ), $obj->args );
}
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I09e4af85ded6a1497b0db0265d2ee6707f91f5e3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: BryanDavis 
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] Add documentation to setupOutlineItem in SpecialCharacterPage - change (VisualEditor/VisualEditor)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add documentation to setupOutlineItem in SpecialCharacterPage
..


Add documentation to setupOutlineItem in SpecialCharacterPage

Change-Id: I540b828d0660c7f1985f1cd1c5a3a23b65a5e4b8
---
M src/ui/pages/ve.ui.SpecialCharacterPage.js
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/src/ui/pages/ve.ui.SpecialCharacterPage.js 
b/src/ui/pages/ve.ui.SpecialCharacterPage.js
index 8c77614..63eeb52 100644
--- a/src/ui/pages/ve.ui.SpecialCharacterPage.js
+++ b/src/ui/pages/ve.ui.SpecialCharacterPage.js
@@ -52,6 +52,9 @@
 
 /* Methods */
 
+/**
+ * @inheritdoc
+ */
 ve.ui.SpecialCharacterPage.prototype.setupOutlineItem = function ( outlineItem 
) {
ve.ui.SpecialCharacterPage.super.prototype.setupOutlineItem.call( this, 
outlineItem );
this.outlineItem.setLabel( this.label );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I540b828d0660c7f1985f1cd1c5a3a23b65a5e4b8
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Tchanders 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add parameter to SpecialCharacterDialog onListClick document... - change (VisualEditor/VisualEditor)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add parameter to SpecialCharacterDialog onListClick 
documentation
..


Add parameter to SpecialCharacterDialog onListClick documentation

Change-Id: Ib6c3964336565f7539d429e71c66a677c29b2050
---
M src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js 
b/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
index 24ccf75..74c0f6a 100644
--- a/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
+++ b/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
@@ -150,6 +150,8 @@
 
 /**
  * Handle the click event on the list
+ *
+ * @param {jQuery.Event} e Mouse click event
  */
 ve.ui.SpecialCharacterDialog.prototype.onListClick = function ( e ) {
var

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6c3964336565f7539d429e71c66a677c29b2050
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Tchanders 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Run nsp check when testing - change (mediawiki...parsoid)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Run nsp check when testing
..


Run nsp check when testing

 * nodesecurity/nsp helps you keep your node applications secure.

 * Removes the handlebars optional deps on uglify-js since those have a
   vulnerability and aren't being used.

 * Upgrade mocha to eliminate a vulnerability in one of its deps' deps.

Change-Id: I669b66457d55803c972f126bd98717616835173f
---
M npm-shrinkwrap.json
M package.json
2 files changed, 631 insertions(+), 60 deletions(-)

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



diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 5802302..e27c96c 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -838,30 +838,6 @@
   "resolved": 
"https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz";
 }
   }
-},
-"uglify-js": {
-  "version": "2.3.6",
-  "from": 
"https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.6.tgz";,
-  "resolved": 
"https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.6.tgz";,
-  "dependencies": {
-"async": {
-  "version": "0.2.10",
-  "from": 
"https://registry.npmjs.org/async/-/async-0.2.10.tgz";,
-  "resolved": 
"https://registry.npmjs.org/async/-/async-0.2.10.tgz";
-},
-"optimist": {
-  "version": "0.3.7",
-  "from": 
"https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz";,
-  "resolved": 
"https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz";,
-  "dependencies": {
-"wordwrap": {
-  "version": "0.0.3",
-  "from": 
"https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz";,
-  "resolved": 
"https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz";
-}
-  }
-}
-  }
 }
   }
 },
@@ -1063,23 +1039,6 @@
   "version": "0.1.1",
   "from": 
"https://registry.npmjs.org/amdefine/-/amdefine-0.1.1.tgz";,
   "resolved": 
"https://registry.npmjs.org/amdefine/-/amdefine-0.1.1.tgz";
-}
-  }
-},
-"uglify-js": {
-  "version": "2.3.6",
-  "from": 
"https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.6.tgz";,
-  "resolved": 
"https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.6.tgz";,
-  "dependencies": {
-"async": {
-  "version": "0.2.10",
-  "from": 
"https://registry.npmjs.org/async/-/async-0.2.10.tgz";,
-  "resolved": 
"https://registry.npmjs.org/async/-/async-0.2.10.tgz";
-},
-"optimist": {
-  "version": "0.3.7",
-  "from": 
"https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz";,
-  "resolved": 
"https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz";
 }
   }
 }
@@ -2606,9 +2565,9 @@
   }
 },
 "mocha": {
-  "version": "2.2.5",
-  "from": "https://registry.npmjs.org/mocha/-/mocha-2.2.5.tgz";,
-  "resolved": "https://registry.npmjs.org/mocha/-/mocha-2.2.5.tgz";,
+  "version": "2.3.4",
+  "from": "https://registry.npmjs.org/mocha/-/mocha-2.3.4.tgz";,
+  "resolved": "https://registry.npmjs.org/mocha/-/mocha-2.3.4.tgz";,
   "dependencies": {
 "commander": {
   "version": "2.3.0",
@@ -2616,14 +2575,14 @@
   "resolved": 
"https://registry.npmjs.org/commander/-/commander-2.3.0.tgz";
 },
 "debug": {
-  "version": "2.0.0",
-  "from": "https://registry.npmjs.org/debug/-/debug-2.0.0.tgz";,
-  "resolved": "https://registry.npmjs.org/debug/-/debug-2.0.0.tgz";,
+  "version": "2.2.0",
+  "from": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz";,
+  "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz";,
   "dependencies": {
 "ms": {
-  "version": "0.6.2",
-  "from": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz";,
-  "resolved": "https://registry.npmjs.org/ms/-/ms-0.6.2.tgz";
+  "version": "0.7.1",
+  "from": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz";,
+  "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz";
 }
   }
 },
@@ -2648,9 +2607,9 @@
   "resolved": 
"https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz";,
   "dependencies": {
 "lru-cache": {
-  "version": "2.6.5",
-

[MediaWiki-commits] [Gerrit] Update VisualEditor for Iee9ae2bb - change (mediawiki/core)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update VisualEditor for Iee9ae2bb
..


Update VisualEditor for Iee9ae2bb

Change-Id: Iaaac212b3299ceba3601e06f9baf0c44a05db2d9
---
M extensions/VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/extensions/VisualEditor b/extensions/VisualEditor
index 79a388a..8951a7b 16
--- a/extensions/VisualEditor
+++ b/extensions/VisualEditor
-Subproject commit 79a388aa2351271ef9148b61777d5a69d9b7c0de
+Subproject commit 8951a7ba73518e6eff97ae16e778a54224b579d2

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaaac212b3299ceba3601e06f9baf0c44a05db2d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.7
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Enable commonswiki writes for ES labs replica - change (operations/mediawiki-config)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Enable commonswiki writes for ES labs replica
..


Enable commonswiki writes for ES labs replica

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

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 44fc9b5..91a7b03 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15378,6 +15378,7 @@
'enwiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'dewiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'wikidatawiki' => array( 'eqiad', 'codfw', 'labsearch' ),
+   'commonswiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'testwiki' => array( 'eqiad', 'codfw', 'labsearch' )
 ),
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I64cb867b5b13a1cf22552ddd7412c21a4308ec13
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Enable commonswiki writes for ES labs replica - change (operations/mediawiki-config)

2015-11-23 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Enable commonswiki writes for ES labs replica
..

Enable commonswiki writes for ES labs replica

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 44fc9b5..91a7b03 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15378,6 +15378,7 @@
'enwiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'dewiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'wikidatawiki' => array( 'eqiad', 'codfw', 'labsearch' ),
+   'commonswiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'testwiki' => array( 'eqiad', 'codfw', 'labsearch' )
 ),
 

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

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

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


[MediaWiki-commits] [Gerrit] Use downloader from https://github.com/rndme/download - change (wikidata...rdf)

2015-11-23 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review.

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

Change subject: Use downloader from https://github.com/rndme/download
..

Use downloader from https://github.com/rndme/download

This should allow us dealing with larger result sets
Bug: T119239

Change-Id: I5fb654bd1358f92af69bad5c501633b7a93dec86
---
A gui/download.min.js
M gui/gui.js
M gui/index.html
3 files changed, 4 insertions(+), 22 deletions(-)


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

diff --git a/gui/download.min.js b/gui/download.min.js
new file mode 100644
index 000..082fc20
--- /dev/null
+++ b/gui/download.min.js
@@ -0,0 +1,2 @@
+//download.js v3.1, by dandavis; 2008-2015. [CCBY2] see 
http://danml.com/download.html for tests/usage
+(function(f,a){"function"==typeof 
define&&define.amd?define([],a):"object"==typeof 
exports?module.exports=a():f.download=a()})(this,function(){return 
function(f,a,b){function n(l){var a=l.split(/[:;,]/);l=a[1];var 
a=("base64"==a[2]?atob:decodeURIComponent)(a.pop()),c=a.length,b=0,d=new 
Uint8Array(c);for(b;b
 
 
+
 
 
 

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

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

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


[MediaWiki-commits] [Gerrit] Update VisualEditor for Iee9ae2bb - change (mediawiki/core)

2015-11-23 Thread Alex Monk (Code Review)
Alex Monk has uploaded a new change for review.

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

Change subject: Update VisualEditor for Iee9ae2bb
..

Update VisualEditor for Iee9ae2bb

Change-Id: Iaaac212b3299ceba3601e06f9baf0c44a05db2d9
---
M extensions/VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/extensions/VisualEditor b/extensions/VisualEditor
index 79a388a..8951a7b 16
--- a/extensions/VisualEditor
+++ b/extensions/VisualEditor
-Subproject commit 79a388aa2351271ef9148b61777d5a69d9b7c0de
+Subproject commit 8951a7ba73518e6eff97ae16e778a54224b579d2

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaaac212b3299ceba3601e06f9baf0c44a05db2d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.7
Gerrit-Owner: Alex Monk 

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


[MediaWiki-commits] [Gerrit] Disallow associative arguments in ObjectFactory - change (mediawiki/core)

2015-11-23 Thread Code Review
Gergő Tisza has uploaded a new change for review.

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

Change subject: Disallow associative arguments in ObjectFactory
..

Disallow associative arguments in ObjectFactory

There is no strong use case for associative "decoration"
of constructor arguments (the documentation benefits
mentioned in I43aa085 are outweighed by the confusion
caused by not failing loudly when someone passes an
associative argument by accident, e.g. by omitting an
array nesting level), so disallow them but make sure
they fail nicely, not with an invalid offset error.

Change-Id: I09e4af85ded6a1497b0db0265d2ee6707f91f5e3
---
M includes/libs/ObjectFactory.php
M tests/phpunit/includes/libs/ObjectFactoryTest.php
2 files changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/52/255052/1

diff --git a/includes/libs/ObjectFactory.php b/includes/libs/ObjectFactory.php
index bd0da57..2ffc1d3 100644
--- a/includes/libs/ObjectFactory.php
+++ b/includes/libs/ObjectFactory.php
@@ -128,8 +128,10 @@
 * @return mixed Constructed instance
 */
public static function constructClassInstance( $clazz, $args ) {
-   // args are sometimes specified in a 'name' => $value format 
for readability
-   $args = array_values( $args );
+   // $args should be a non-associative array; show nice error if 
that's not the case
+   if ( $args && array_keys( $args ) !== range( 0, count( $args ) 
- 1 ) ) {
+   throw new InvalidArgumentException( __METHOD__ . ': 
$args cannot be an associative array' );
+   }
 
// TODO: when PHP min version supported is >=5.6.0 replace this
// with `return new $clazz( ... $args );`.
diff --git a/tests/phpunit/includes/libs/ObjectFactoryTest.php 
b/tests/phpunit/includes/libs/ObjectFactoryTest.php
index 6337210..f338633 100644
--- a/tests/phpunit/includes/libs/ObjectFactoryTest.php
+++ b/tests/phpunit/includes/libs/ObjectFactoryTest.php
@@ -109,12 +109,14 @@
);
}
 
+   /**
+* @expectedException InvalidArgumentException
+*/
public function testNamedArgs() {
$args = array( 'foo' => 1, 'bar' => 2, 'baz' => 3 );
$obj = ObjectFactory::constructClassInstance(
'ObjectFactoryTestFixture', $args
);
-   $this->assertSame( array( 1, 2, 3 ), $obj->args );
}
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I09e4af85ded6a1497b0db0265d2ee6707f91f5e3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 

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


[MediaWiki-commits] [Gerrit] Enable wikidatawiki for es labs replica - change (operations/mediawiki-config)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Enable wikidatawiki for es labs replica
..


Enable wikidatawiki for es labs replica

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

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 96c4907..44fc9b5 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15377,6 +15377,7 @@
'default' => array( 'eqiad', 'codfw' ),
'enwiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'dewiki' => array( 'eqiad', 'codfw', 'labsearch' ),
+   'wikidatawiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'testwiki' => array( 'eqiad', 'codfw', 'labsearch' )
 ),
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb1cd30077034fc9043454fdf1278be4a5927dc3
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Enable wikidatawiki for es labs replica - change (operations/mediawiki-config)

2015-11-23 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Enable wikidatawiki for es labs replica
..

Enable wikidatawiki for es labs replica

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 96c4907..44fc9b5 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15377,6 +15377,7 @@
'default' => array( 'eqiad', 'codfw' ),
'enwiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'dewiki' => array( 'eqiad', 'codfw', 'labsearch' ),
+   'wikidatawiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'testwiki' => array( 'eqiad', 'codfw', 'labsearch' )
 ),
 

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

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

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


[MediaWiki-commits] [Gerrit] Require a User object to be passed to EchoEvent::userCan() - change (mediawiki...Echo)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Require a User object to be passed to EchoEvent::userCan()
..


Require a User object to be passed to EchoEvent::userCan()

All callers were already doing this.

Change-Id: If9e20e3d4740bcdb8842592e4cd988f8b35e1300
---
M includes/model/Event.php
1 file changed, 2 insertions(+), 7 deletions(-)

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



diff --git a/includes/model/Event.php b/includes/model/Event.php
index 4aff388..0f36efa 100644
--- a/includes/model/Event.php
+++ b/includes/model/Event.php
@@ -356,10 +356,10 @@
 * @param $field Integer:one of Revision::DELETED_TEXT,
 *  Revision::DELETED_COMMENT,
 *  Revision::DELETED_USER
-* @param $user User object to check, or null to use $wgUser
+* @param $user User object to check
 * @return Boolean
 */
-   public function userCan( $field, User $user = null ) {
+   public function userCan( $field, User $user ) {
$revision = $this->getRevision();
// User is handled specially
if ( $field === Revision::DELETED_USER ) {
@@ -374,11 +374,6 @@
return $revision->userCan( $field, $user );
} else {
// Use User::isHidden()
-   if ( !$user ) {
-   // @FIXME Require a user object for 
this function
-   global $wgUser;
-   $user = $wgUser;
-   }
return $user->isAllowedAny( 'viewsuppressed', 
'hideuser' ) || !$agent->isHidden();
}
} elseif ( $revision ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If9e20e3d4740bcdb8842592e4cd988f8b35e1300
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Reset adapter account config in test setup - change (mediawiki...DonationInterface)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Reset adapter account config in test setup
..


Reset adapter account config in test setup

Hadn't been resetting account config for some gateways, leading to
tests using LocalSettings configuration instead of config from
TestConfiguration.php.  Also moves Amazon test config to that file.

Change-Id: I589d17c51acbaaa47dfb34c78c9074a4c1b49d7b
---
M tests/Adapter/Amazon/AmazonTest.php
M tests/TestConfiguration.php
2 files changed, 13 insertions(+), 15 deletions(-)

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



diff --git a/tests/Adapter/Amazon/AmazonTest.php 
b/tests/Adapter/Amazon/AmazonTest.php
index 3e439a0..d60084b 100644
--- a/tests/Adapter/Amazon/AmazonTest.php
+++ b/tests/Adapter/Amazon/AmazonTest.php
@@ -53,16 +53,6 @@
'recurring',
),
),
-   'wgAmazonGatewayAccountInfo' => array( 'test' => array(
-   'SellerID' => 'ABCDEFGHIJKL',
-   'ClientID' => 
'amzn1.application-oa2-client.1a2b3c4d5e',
-   'ClientSecret' => 
'12432g134e3421a41234b1341c324123d',
-   'MWSAccessKey' => 'N0NSENSEXYZ',
-   'MWSSecretKey' => 
'iuasd/2jhaslk2j49lkaALksdJLsJLas+',
-   'Region' => 'us',
-   'WidgetScriptURL' => 
'https://static-na.payments-amazon.com/OffAmazonPayments/us/sandbox/js/Widgets.js',
-   'ReturnURL' => 
"https://example.org/index.php/Special:AmazonGateway?debug=true";,
-   ) ),
) );
}
 
diff --git a/tests/TestConfiguration.php b/tests/TestConfiguration.php
index b35945d..fb7c288 100644
--- a/tests/TestConfiguration.php
+++ b/tests/TestConfiguration.php
@@ -99,7 +99,7 @@
 
 
 /** Paypal **/
-$wgPaypalGatewayAccountInfo = array ( );
+$wgPaypalGatewayAccountInfo = array ();
 $wgPaypalGatewayAccountInfo['testing'] = array (
'AccountEmail' => 'phpunittest...@wikimedia.org',
 );
@@ -108,15 +108,21 @@
 
 /** Amazon **/
 $wgAmazonGatewayReturnURL = 
'https://payments.wikimedia.org/index.php/Special:AmazonGateway';
+$wgAmazonGatewayAccountInfo = array();
 $wgAmazonGatewayAccountInfo['test'] = array (
-   'AccessKey' => 'testkey',
-   'SecretKey' => 'testsecret',
-   'PaymentsAccountID' => 'testaccountid',
-   'IpnOverride' => 'https://test.wikimedia.org/amazon',
+   'SellerID' => 'ABCDEFGHIJKL',
+   'ClientID' => 'amzn1.application-oa2-client.1a2b3c4d5e',
+   'ClientSecret' => '12432g134e3421a41234b1341c324123d',
+   'MWSAccessKey' => 'N0NSENSEXYZ',
+   'MWSSecretKey' => 'iuasd/2jhaslk2j49lkaALksdJLsJLas+',
+   'Region' => 'us',
+   'WidgetScriptURL' => 
'https://static-na.payments-amazon.com/OffAmazonPayments/us/sandbox/js/Widgets.js',
+   'ReturnURL' => 
"https://example.org/index.php/Special:AmazonGateway?debug=true";,
 );
 
 /** Adyen **/
 $wgAdyenGatewayBaseURL = 'https://testorwhatever.adyen.com';
+$wgAdyenGatewayAccountInfo = array();
 $wgAdyenGatewayAccountInfo['test'] = array (
'AccountName' => 'wikitest',
'SharedSecret' => 'long-cat-is-long',
@@ -126,6 +132,7 @@
 /** Astropay **/
 $wgAstropayGatewayURL = 'https://astropay.example.com/';
 $wgAstropayGatewayTestingURL = 'https://sandbox.astropay.example.com/';
+$wgAstropayGatewayAccountInfo = array();
 $wgAstropayGatewayAccountInfo['test'] = array (
'Create' => array(
'Login' => 'createlogin',
@@ -138,6 +145,7 @@
'SecretKey' => 'NanananananananananananananananaBatman',
 );
 
+$wgWorldpayGatewayAccountInfo = array();
 /** Worldpay **/
 $wgWorldpayGatewayAccountInfo['test'] = array (
'Username' => 'testname',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I589d17c51acbaaa47dfb34c78c9074a4c1b49d7b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Ssmith 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Require a User object to be passed to EchoEvent::userCan() - change (mediawiki...Echo)

2015-11-23 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Require a User object to be passed to EchoEvent::userCan()
..

Require a User object to be passed to EchoEvent::userCan()

All callers were already doing this.

Change-Id: If9e20e3d4740bcdb8842592e4cd988f8b35e1300
---
M includes/model/Event.php
1 file changed, 2 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/50/255050/1

diff --git a/includes/model/Event.php b/includes/model/Event.php
index 4aff388..0f36efa 100644
--- a/includes/model/Event.php
+++ b/includes/model/Event.php
@@ -356,10 +356,10 @@
 * @param $field Integer:one of Revision::DELETED_TEXT,
 *  Revision::DELETED_COMMENT,
 *  Revision::DELETED_USER
-* @param $user User object to check, or null to use $wgUser
+* @param $user User object to check
 * @return Boolean
 */
-   public function userCan( $field, User $user = null ) {
+   public function userCan( $field, User $user ) {
$revision = $this->getRevision();
// User is handled specially
if ( $field === Revision::DELETED_USER ) {
@@ -374,11 +374,6 @@
return $revision->userCan( $field, $user );
} else {
// Use User::isHidden()
-   if ( !$user ) {
-   // @FIXME Require a user object for 
this function
-   global $wgUser;
-   $user = $wgUser;
-   }
return $user->isAllowedAny( 'viewsuppressed', 
'hideuser' ) || !$agent->isHidden();
}
} elseif ( $revision ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If9e20e3d4740bcdb8842592e4cd988f8b35e1300
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Legoktm 

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


[MediaWiki-commits] [Gerrit] Use enableModuleContentVersion() instead of tracking getScri... - change (mediawiki...Citoid)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use enableModuleContentVersion() instead of tracking 
getScript() manually
..


Use enableModuleContentVersion() instead of tracking getScript() manually

See also 4613449b6561d18e8e59ebe52a162a735a2e12a6

Change-Id: I33b40c3879696d8e09dfa16123d338b9340139e0
---
M CitoidDataModule.php
1 file changed, 2 insertions(+), 6 deletions(-)

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



diff --git a/CitoidDataModule.php b/CitoidDataModule.php
index 7fefd86..912aa88 100644
--- a/CitoidDataModule.php
+++ b/CitoidDataModule.php
@@ -36,11 +36,7 @@
);
}
 
-   public function getDefinitionSummary( ResourceLoaderContext $context ) {
-   $summary = parent::getDefinitionSummary( $context );
-   $summary[] = array(
-   'script' => $this->getScript( $context ),
-   );
-   return $summary;
+   public function enableModuleContentVersion() {
+   return true;
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I33b40c3879696d8e09dfa16123d338b9340139e0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Citoid
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Prevent switching from unedited section directly into VE - change (mediawiki...VisualEditor)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Prevent switching from unedited section directly into VE
..


Prevent switching from unedited section directly into VE

Bug: T117713
Change-Id: Iee9ae2bbe4757cb07e9aa2bd5f41a46c0ebb391a
(cherry picked from commit 67a51aee9b8ce440807bd3bcc9d787a793e3aec8)
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 468ce54..9eb732e 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -535,7 +535,10 @@
 
if (
mw.config.get( 'wgAction' ) === 'submit' ||
-   ( mw.config.get( 'wgAction' ) === 'edit' && 
wikitextModified )
+   ( mw.config.get( 'wgAction' ) === 'edit' && 
wikitextModified ) ||
+   // switching from section editing must prompt 
because we can't
+   // keep changes from that (yet?)
+   $( 'input[name=wpSection]' ).val()
) {
mw.loader.using( 'ext.visualEditor.switching' )
.done( function () {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iee9ae2bbe4757cb07e9aa2bd5f41a46c0ebb391a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.27.0-wmf.7
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Return from function after redirect - change (mediawiki...DonationInterface)

2015-11-23 Thread Ejegg (Code Review)
Ejegg has submitted this change and it was merged.

Change subject: Return from function after redirect
..


Return from function after redirect

Prevents unintended fallthrough to fail page redirect, which was
superceding the intended one.

Bug: T118349
Change-Id: Ib25877badb79c1ab1c097fc4fc085d8f9b40e576
---
M globalcollect_gateway/globalcollect_resultswitcher.body.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/globalcollect_gateway/globalcollect_resultswitcher.body.php 
b/globalcollect_gateway/globalcollect_resultswitcher.body.php
index c194cb9..d1355e4 100644
--- a/globalcollect_gateway/globalcollect_resultswitcher.body.php
+++ b/globalcollect_gateway/globalcollect_resultswitcher.body.php
@@ -142,6 +142,7 @@
if ( $go ) {
$this->getOutput()->addHTML( 
"Redirecting to page $go" );
$this->getOutput()->redirect( 
$go );
+   return;
} else {
$this->logger->error( 
"Resultswitcher: No redirect defined. Order ID: $oid" );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib25877badb79c1ab1c097fc4fc085d8f9b40e576
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: deployment
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Ssmith 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] CRM-17464 remove deadlock inducing query - change (wikimedia...civicrm)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: CRM-17464 remove deadlock inducing query
..


CRM-17464 remove deadlock inducing query

Note this removes an instance where a subquery is used when deleting from the 
acl_contact_cache - the subquery would lock the entire table
and could be to blame for the failmail we have been seeing

The patch is in 4.7 & involves more limited clearing. The only risk is in 
deleted contacts
maybe possibly being viewable if the cache is in some way not being managed 
correctly still
and the calling query does not specify this status adequately.

This code is a bit complex and ... in need of rework but I think scary fallout 
from this change
is unlikely. (We have deployed this patch to Fuzion customers)

Bug: T119447
Change-Id: I6c430af088cd04e8af71f41da85eeadeccaff185
---
M CRM/Contact/BAO/Contact.php
M CRM/Contact/BAO/Contact/Permission.php
2 files changed, 27 insertions(+), 9 deletions(-)

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



diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php
index 7c92761..bacdc17 100644
--- a/CRM/Contact/BAO/Contact.php
+++ b/CRM/Contact/BAO/Contact.php
@@ -880,14 +880,7 @@
 
 //delete the contact id from recently view
 CRM_Utils_Recent::delContact($id);
-
-// Update the group contact cache
-if ($restore) {
-  CRM_Contact_BAO_GroupContactCache::remove();
-}
-else {
-  CRM_Contact_BAO_GroupContactCache::removeContact($id);
-}
+self::updateContactCache($id, empty($restore));
 
 // delete any dupe cache entry
 CRM_Core_BAO_PrevNextCache::deleteItem($id);
@@ -906,6 +899,32 @@
   }
 
   /**
+   * Action to update any caches relating to a recently update contact.
+   *
+   * I was going to call this from delete as well as from create to ensure the 
delete is being
+   * done whenever a contact is set to is_deleted=1 BUT I found create is 
already over-aggressive in
+   * that regard so adding it to delete seems to be enough to remove it from 
CRM_Contact_BAO_Contact_Permission
+   * where the call involved a subquery that was locking the table.
+   *
+   * @param int $contactID
+   * @param bool $isTrashed
+   */
+  public static function updateContactCache($contactID, $isTrashed = FALSE) {
+
+if ($isTrashed) {
+  CRM_Contact_BAO_GroupContactCache::removeContact($contactID);
+  // This has been moved to here from CRM_Contact_BAO_Contact_Permission 
as that was causing
+  // a table-locking query. It still seems a bit inadequate as it assumes 
the acl users can't see deleted
+  // but this should not cause any change as long as contacts are not 
being trashed outside the
+  // main functions for that.
+  CRM_Core_DAO::executeQuery('DELETE FROM civicrm_acl_contact_cache WHERE 
contact_id = %1', array(1 => array($contactID, 'Integer')));
+}
+else {
+  CRM_Contact_BAO_GroupContactCache::remove();
+}
+  }
+
+  /**
* Delete the image of a contact.
*
* @param int $id
diff --git a/CRM/Contact/BAO/Contact/Permission.php 
b/CRM/Contact/BAO/Contact/Permission.php
index 2d42840..3a326ca 100644
--- a/CRM/Contact/BAO/Contact/Permission.php
+++ b/CRM/Contact/BAO/Contact/Permission.php
@@ -141,7 +141,6 @@
  operation=VALUES(operation)"
 );
 
-CRM_Core_DAO::executeQuery('DELETE FROM civicrm_acl_contact_cache WHERE 
contact_id IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)');
 $_processed[$userID] = 1;
   }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6c430af088cd04e8af71f41da85eeadeccaff185
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Eileen 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use enableModuleContentVersion() instead of tracking getScri... - change (mediawiki...Citoid)

2015-11-23 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: Use enableModuleContentVersion() instead of tracking 
getScript() manually
..

Use enableModuleContentVersion() instead of tracking getScript() manually

See also 4613449b6561d18e8e59ebe52a162a735a2e12a6

Change-Id: I33b40c3879696d8e09dfa16123d338b9340139e0
---
M CitoidDataModule.php
1 file changed, 2 insertions(+), 6 deletions(-)


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

diff --git a/CitoidDataModule.php b/CitoidDataModule.php
index 7fefd86..912aa88 100644
--- a/CitoidDataModule.php
+++ b/CitoidDataModule.php
@@ -36,11 +36,7 @@
);
}
 
-   public function getDefinitionSummary( ResourceLoaderContext $context ) {
-   $summary = parent::getDefinitionSummary( $context );
-   $summary[] = array(
-   'script' => $this->getScript( $context ),
-   );
-   return $summary;
+   public function enableModuleContentVersion() {
+   return true;
}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I33b40c3879696d8e09dfa16123d338b9340139e0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Citoid
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] CRM-17464 remove deadlock inducing query - change (wikimedia...civicrm)

2015-11-23 Thread Eileen (Code Review)
Eileen has uploaded a new change for review.

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

Change subject: CRM-17464 remove deadlock inducing query
..

CRM-17464 remove deadlock inducing query

Note this removes an instance where a subquery is used when deleting from the 
acl_contact_cache - the subquery would lock the entire table
and could be to blame for the failmail we have been seeing

The patch is in 4.7 & involves more limited clearing. The only risk is in 
deleted contacts
maybe possibly being viewable if the cache is in some way not being managed 
correctly still
and the calling query does not specify this status adequately.

This code is a bit complex and ... in need of rework but I think scary fallout 
from this change
is unlikely. (We have deployed this patch to Fuzion customers)

Bug: T119447
Change-Id: I6c430af088cd04e8af71f41da85eeadeccaff185
---
M CRM/Contact/BAO/Contact.php
M CRM/Contact/BAO/Contact/Permission.php
2 files changed, 27 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm 
refs/changes/48/255048/1

diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php
index 7c92761..bacdc17 100644
--- a/CRM/Contact/BAO/Contact.php
+++ b/CRM/Contact/BAO/Contact.php
@@ -880,14 +880,7 @@
 
 //delete the contact id from recently view
 CRM_Utils_Recent::delContact($id);
-
-// Update the group contact cache
-if ($restore) {
-  CRM_Contact_BAO_GroupContactCache::remove();
-}
-else {
-  CRM_Contact_BAO_GroupContactCache::removeContact($id);
-}
+self::updateContactCache($id, empty($restore));
 
 // delete any dupe cache entry
 CRM_Core_BAO_PrevNextCache::deleteItem($id);
@@ -906,6 +899,32 @@
   }
 
   /**
+   * Action to update any caches relating to a recently update contact.
+   *
+   * I was going to call this from delete as well as from create to ensure the 
delete is being
+   * done whenever a contact is set to is_deleted=1 BUT I found create is 
already over-aggressive in
+   * that regard so adding it to delete seems to be enough to remove it from 
CRM_Contact_BAO_Contact_Permission
+   * where the call involved a subquery that was locking the table.
+   *
+   * @param int $contactID
+   * @param bool $isTrashed
+   */
+  public static function updateContactCache($contactID, $isTrashed = FALSE) {
+
+if ($isTrashed) {
+  CRM_Contact_BAO_GroupContactCache::removeContact($contactID);
+  // This has been moved to here from CRM_Contact_BAO_Contact_Permission 
as that was causing
+  // a table-locking query. It still seems a bit inadequate as it assumes 
the acl users can't see deleted
+  // but this should not cause any change as long as contacts are not 
being trashed outside the
+  // main functions for that.
+  CRM_Core_DAO::executeQuery('DELETE FROM civicrm_acl_contact_cache WHERE 
contact_id = %1', array(1 => array($contactID, 'Integer')));
+}
+else {
+  CRM_Contact_BAO_GroupContactCache::remove();
+}
+  }
+
+  /**
* Delete the image of a contact.
*
* @param int $id
diff --git a/CRM/Contact/BAO/Contact/Permission.php 
b/CRM/Contact/BAO/Contact/Permission.php
index 2d42840..3a326ca 100644
--- a/CRM/Contact/BAO/Contact/Permission.php
+++ b/CRM/Contact/BAO/Contact/Permission.php
@@ -141,7 +141,6 @@
  operation=VALUES(operation)"
 );
 
-CRM_Core_DAO::executeQuery('DELETE FROM civicrm_acl_contact_cache WHERE 
contact_id IN (SELECT id FROM civicrm_contact WHERE is_deleted = 1)');
 $_processed[$userID] = 1;
   }
 

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

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

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


[MediaWiki-commits] [Gerrit] git-ssh.wm.o IPv6 reservation - change (operations/dns)

2015-11-23 Thread Rush (Code Review)
Rush has submitted this change and it was merged.

Change subject: git-ssh.wm.o IPv6 reservation
..


git-ssh.wm.o IPv6 reservation

Change-Id: Iaa329a76b41d9e9a0538ff45a68700f7a7bfd327
---
M templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
M templates/wikimedia.org
2 files changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa 
b/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
index 14c8ff3..9fbb146 100644
--- a/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
+++ b/templates/1.6.8.0.0.0.0.0.0.2.6.2.ip6.arpa
@@ -243,6 +243,7 @@
 
 4.1.0.0 1H IN PTR   parsoid-lb.eqiad.wikimedia.org.
 5.1.0.0 1H IN PTR   stream-lb.eqiad.wikimedia.org.
+6.1.0.0 1H IN PTR   git-ssh.eqiad.wikimedia.org.
 e.f.0.0 1H IN PTR   dns-rec-lb.eqiad.wikimedia.org.
 
 ; Neighbor blocks
diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index f6f3688..54b722b 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -238,7 +238,9 @@
 restbase1H  IN CNAME restbase.eqiad
 rest1H  IN CNAME restbase.eqiad
 git-ssh.eqiad   1H  IN A208.80.154.250
+1H  IN  2620:0:861:ed1a::3:16
 git-ssh 1H  IN A208.80.154.250
+1H  IN  2620:0:861:ed1a::3:16
 
 ;;; ulsfo
 text-lb.ulsfo   600 IN DYNA geoip!text-addrs/ulsfo

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa329a76b41d9e9a0538ff45a68700f7a7bfd327
Gerrit-PatchSet: 2
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Rush 
Gerrit-Reviewer: BBlack 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Rush 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] build: Updating development dependencies - change (AhoCorasick)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: build: Updating development dependencies
..


build: Updating development dependencies

* mediawiki/mediawiki-codesniffer: 0.3.0 → 0.5.0

Change-Id: Id2ed15ab3713f750dd483fafc44587fe37b0c314
---
M composer.json
M src/MultiStringMatcher.php
M tests/AhoCorasickTest.php
3 files changed, 12 insertions(+), 4 deletions(-)

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



diff --git a/composer.json b/composer.json
index 0bbf629..56a383d 100644
--- a/composer.json
+++ b/composer.json
@@ -20,7 +20,7 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9",
"phpunit/phpunit": "4.6.*",
-   "mediawiki/mediawiki-codesniffer": "0.3.0"
+   "mediawiki/mediawiki-codesniffer": "0.5.0"
},
"scripts": {
"test": [
diff --git a/src/MultiStringMatcher.php b/src/MultiStringMatcher.php
index 9a549ee..150bef0 100644
--- a/src/MultiStringMatcher.php
+++ b/src/MultiStringMatcher.php
@@ -206,7 +206,11 @@
$this->noTransitions[$toState] = 0;
}
 
-   while ( ( $fromState = array_shift( $queue ) ) !== null ) {
+   while ( true ) {
+   $fromState = array_shift( $queue );
+   if ( $fromState === null ) {
+   break;
+   }
foreach ( $this->yesTransitions[$fromState] as $ch => 
$toState ) {
$queue[] = $toState;
$state = $this->noTransitions[$fromState];
diff --git a/tests/AhoCorasickTest.php b/tests/AhoCorasickTest.php
index 14b225f..7269b3e 100644
--- a/tests/AhoCorasickTest.php
+++ b/tests/AhoCorasickTest.php
@@ -44,7 +44,11 @@
$matches = array();
foreach ( $this->searchKeywords as $keyword => $length ) {
$offset = 0;
-   while ( ( $offset = strpos( $text, $keyword, $offset ) 
) !== false ) {
+   while ( true ) {
+   $offset = strpos( $text, $keyword, $offset );
+   if ( $offset === false ) {
+   break;
+   }
$matches[] = array( $offset, $keyword );
$offset = $offset + $length;
}
@@ -63,7 +67,7 @@
 *
 * Helps us assert equivalence.
 *
-* @param &$matches Results array.
+* @param &$matches array Results array.
 */
public function sortMatcherResults( &$matches ) {
// Sort the results by match offset, then by match length,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2ed15ab3713f750dd483fafc44587fe37b0c314
Gerrit-PatchSet: 3
Gerrit-Project: AhoCorasick
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Umherirrender 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] minor adyen iframe css changes - change (mediawiki...DonationInterface)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: minor adyen iframe css changes
..


minor adyen iframe css changes

diff is noisy cause file is full of windows newlines

Change-Id: I65c62c2446f3513afd53e98d48f666bb99f1570c
---
M adyen_gateway/forms/css/iframe.screen.css
1 file changed, 60 insertions(+), 46 deletions(-)

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



diff --git a/adyen_gateway/forms/css/iframe.screen.css 
b/adyen_gateway/forms/css/iframe.screen.css
index 690c9ec..ba45697 100644
--- a/adyen_gateway/forms/css/iframe.screen.css
+++ b/adyen_gateway/forms/css/iframe.screen.css
@@ -6,9 +6,24 @@
 }
 
 /* Match input styling */
-input[type="text"] {
-   border: 1px solid #C0C0C0;
-   padding: 3px;
+input[type="text"], select {
+   background-color: #f6f6f6;
+   padding: 1em !important;
+   -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(0, 
0, 0, .1);
+   -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2), inset 0 0 0 1px 
rgba(0, 0, 0, .1);
+   box-shadow: 0 1px 1px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(0, 0, 0, 
.1);
+   -moz-border-radius: 4px;
+   -webkit-border-radius: 4px;
+   border-radius: 4px;
+   border: 0 !important;
+   color: #006699;
+   cursor: pointer;
+   margin-bottom: .2em;
+   -webkit-transition: all .3s ease-in-out;
+   -moz-transition:all .3s ease-in-out;
+   -o-transition:  all .3s ease-in-out;
+   -ms-transition: all .3s ease-in-out;
+   transition: all .3s ease-in-out;
 }
 
 #card\.cardNumber, #card\.cardHolderName {
@@ -40,7 +55,6 @@
font-size: 80%;
 }
 
-
 html {
height: 100%;
max-height: 100%;
@@ -49,8 +63,8 @@
 }
 
 body {
-   color: #00;
-   background-color: #CCE7CD;
+   color: #7c7c7c;
+   padding: 2%;
 }
 
 /* Main Elements */
@@ -523,59 +537,59 @@
 /* ivr specific css */
 
 .ivricon {
-display: block;
-margin-right: 10px;
-float: left;
+   display: block;
+   margin-right: 10px;
+   float: left;
 }
 .ivrmessage {
-display: block;
-font-weight: bold;
+   display: block;
+   font-weight: bold;
 }
 .ivrdetail {
-display: block;
-margin-top: 5px;
-font-weight: bold;
-font-family: arial, sans-serif;
+   display: block;
+   margin-top: 5px;
+   font-weight: bold;
+   font-family: arial, sans-serif;
 }
 
 
 #phoneNumber .ivrdetail {
-color: #57A022;
-font-size: 2.4em;
+   color: #57A022;
+   font-size: 2.4em;
 }
 
 #payCode .ivrdetail {
-color: #1F5F98;
-font-size: 2.4em;
+   color: #1F5F98;
+   font-size: 2.4em;
 }
 #timeToCall .ivrmessage {
-font-weight: normal;
-line-height: 1.1em;
+   font-weight: normal;
+   line-height: 1.1em;
 }
 
 #timeToCall .ivrmessage .phoneDetails, #timeLeft {
-font-weight: bold;
-color:  #57A022;
-font-family: arial, sans-serif;
+   font-weight: bold;
+   color:  #57A022;
+   font-family: arial, sans-serif;
 }
 
 
 .progressW {
-width: 400px; 
-margin-left: 50px; 
-padding: 1px;
-border: 1px solid #666;
-background-color: transparent
+   width: 400px; 
+   margin-left: 50px; 
+   padding: 1px;
+   border: 1px solid #666;
+   background-color: transparent
 }
 .progress {
-width: 0px;
-font-size: 1px;
-height: 14px;
-margin: 0px;
-padding:0px;
-background-color: #66C931;
-background-image: url(/hpp/img/progress3.png);
-background-repeat: repeat-x;
+   width: 0px;
+   font-size: 1px;
+   height: 14px;
+   margin: 0px;
+   padding:0px;
+   background-color: #66C931;
+   background-image: url(/hpp/img/progress3.png);
+   background-repeat: repeat-x;
 }
 
 .ebanking_FIFrame {
@@ -584,21 +598,21 @@
 }
 
 .ebanking_FIHeader {
-font-weight:bold;
-margin-bottom:  5px;
-margin-top: 5px;
-color:  #1678A5;
+   font-weight:bold;
+   margin-bottom:  5px;
+   margin-top: 5px;
+   color:  #1678A5;
 }
 
 .ebanking_FIText {
-padding:5px;
+   padding:5px;
 }
 
 .invoicestat {
-width: 55%;
-border: 2px solid black;
-font-family: courier, monospace;
-padding: 17px 10px 17px 61px;
+   width: 55%;
+   border: 2px solid black;
+   font-family: courier, monospace;
+   padding: 17px 10px 17px 61px;
 }
 
 .invoicestatPaid  { border-color: green; background-color: #efe; }  

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I65c62c2446f3513afd53e98d48f666bb99f1570c
Gerrit-PatchSet: 2
Gerrit-Project

[MediaWiki-commits] [Gerrit] Various improvements and fixes - change (mediawiki...Timeless)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Various improvements and fixes
..


Various improvements and fixes

* Consistent dark colours stolen from wikimediadc.org, probably stolen from
  that header template
* More consistent colours for headers
* Fixes for extension:templatesandbox
* pre and center rules, which for some reason aren't in core
* Fix for anchor offset issues caused by the fixed header
* Fixes for the personal dropdown menu
* Update font stack to use only ones with known consistent metrics

Change-Id: I88350e837b96de812c9d5f1308ae83703da6d0b4
---
M resources/forms.less
M resources/screen-common.less
M resources/screen-desktop.less
M resources/variables.less
4 files changed, 66 insertions(+), 26 deletions(-)

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



diff --git a/resources/forms.less b/resources/forms.less
index d5879f8..cb31b11 100644
--- a/resources/forms.less
+++ b/resources/forms.less
@@ -189,6 +189,25 @@
label {
margin-right: 1.5em;
}
+
+   // For Extension:TemplateSandbox and the like
+   fieldset,
+   legend {
+   background: inherit;
+   border: none;
+   box-shadow: none;
+   padding: 0;
+   margin-top: 2em;
+   }
+}
+
+
+/* Extension:TemplateSandbox stuff */
+.mw-templatesandbox-page label {
+   padding: 0;
+}
+#wpTemplateSandboxPreview {
+   margin-left: .5em;
 }
 
 /* Recent changes and watchlist options */
diff --git a/resources/screen-common.less b/resources/screen-common.less
index af07e7d..54def45 100644
--- a/resources/screen-common.less
+++ b/resources/screen-common.less
@@ -82,7 +82,7 @@
}
 
h1, h2 {
-   border-bottom: solid 2px @blue-bright;
+   border-bottom: solid 2px @blue;
 
}
 
@@ -120,6 +120,17 @@
}
 }
 
+pre {
+   overflow: auto;
+   white-space: pre-wrap;
+}
+
+.center,
+.center * {
+   margin: auto;
+   text-align: center;
+}
+
 /* Thumbnails */
 .tright {
margin: 0 0 .5em .5em;
diff --git a/resources/screen-desktop.less b/resources/screen-desktop.less
index a0ac638..b5acdb0 100644
--- a/resources/screen-desktop.less
+++ b/resources/screen-desktop.less
@@ -32,27 +32,36 @@
background: @background;
color: @text;
padding: 0.5em 0 0;
-   box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.5);
+   box-shadow: 0 3px 3px 2px rgba(0, 0, 0, 0.075), 0 0 2px rgba(0, 0, 0, 
0.2);
+   min-height: 2.85em;
+}
+
+/* Add offset to make anchor links work with the fixed header */
+:target:before {
+   content: "";
+   display: block;
+   height: 2.85em;
+   margin: -2.85em 0 0;
 }
 
 @color-height: 4px;
 .color-left {
float:left;
height: @color-height;
-   background: @red;
+   background: @red-dark;
width: 50%;
 }
 .color-right {
display: inline-block;
height: @color-height;
-   background: @green;
+   background: @green-dark;
width: 50%;
float:right;
 }
 .color-middle {
height: @color-height;
-   background: @blue;
-   margin-top: .3em;
+   background: @blue-dark;
+   margin-top: .4em;
margin-bottom: -@color-height;
position: relative;
 }
@@ -69,8 +78,8 @@
line-height: 1;
 }
 #p-personal h3 {
-   margin: 0;
-   padding: .7em 0 .55em 25px;
+   margin: 0 0 -1em;
+   padding: .7em 0 1.25em 25px;
font-family: @fonts-secondary;
font-weight: normal;
font-size: 1.1em;
@@ -158,7 +167,7 @@
position: absolute;
padding: 20px 2em 0;
min-width: 6em;
-   top: 2.45em;
+   top: 2.95em;
right: 0;
overflow: visible;
line-height: 1.1;
diff --git a/resources/variables.less b/resources/variables.less
index 8bbe005..5ea87bc 100644
--- a/resources/variables.less
+++ b/resources/variables.less
@@ -12,43 +12,44 @@
 @link: @blue;
 @link-red: @red;
 
-@grey: #ddd;
+@grey: #ccc;
 @grey-bright: #eee;
-@grey-dark: #aaa;
+@grey-dark: #666;
 
-@red: #b22;
-@red-bright: #f44;
-@red-dark: #800;
+@red: #d44;
+@red-bright: #f55;
+@red-dark: #900;
 
-@green: #194;
-@green-bright: #4c7;
-@green-dark: #071;
+@green: #3b7;
+@green-bright: #4c8;
+@green-dark: #396;
 
-@blue: #07c;
-@blue-bright: #08d;
-@blue-dark: #047;
+@blue: #08d;
+@blue-bright: #2af;
+@blue-dark: #069;
 
 @link: @blue;
 @link-red: @red;
 
 
-/* Flair */
-
-@fonts-secondary: 'Linux Libertine', 'Georgia', serif;
-@fonts: 'Open Sans', 'Helvetica Neue', 'Arial', sans-serif;
+// Flair
+// Fonts are chosen for consistent metrics, not necessarily overall prettiness.
+// This will NEED fixes for different languages.
+@fonts-secondary: 'Linux Libertine', 'Times New Roman', serif;
+@fonts: 'Helvetica Neue', 'Nimbus Sans L', 'Arial', sans-serif;
 @border: .2em;

[MediaWiki-commits] [Gerrit] Add accessor for bundled events in EventPresentationModel - change (mediawiki...Echo)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add accessor for bundled events in EventPresentationModel
..


Add accessor for bundled events in EventPresentationModel

The implementation of this sucks as the presentation model
should not be making database queries. But the API it provides
is what we want and will be supported even if the backend
implementation is changed.

Change-Id: Ifd0d11260990fd0e00e8f32eee273f9717d3e1fb
---
M includes/formatters/EventPresentationModel.php
1 file changed, 20 insertions(+), 0 deletions(-)

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



diff --git a/includes/formatters/EventPresentationModel.php 
b/includes/formatters/EventPresentationModel.php
index 2d2f8bb..2245f73 100644
--- a/includes/formatters/EventPresentationModel.php
+++ b/includes/formatters/EventPresentationModel.php
@@ -81,6 +81,26 @@
}
 
/**
+* @return EchoEvent[]
+*/
+   final protected function getBundledEvents() {
+   if ( !$this->event->getBundleHash() ) {
+   return array();
+   }
+
+   // FIXME: We really shouldn't be making db queries like this
+   // in the presentation model
+   $eventMapper = new EchoEventMapper();
+   $events = $eventMapper->fetchByUserBundleHash(
+   $this->user,
+   $this->event->getBundleHash()
+   // default params: web, DESC, limit=250
+   );
+
+   return $events;
+   }
+
+   /**
 * @return string The symbolic icon name as defined in 
$wgEchoNotificationIcons
 */
abstract public function getIconType();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd0d11260990fd0e00e8f32eee273f9717d3e1fb
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Sbisson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Rename holmium to labservices1002. - change (operations/dns)

2015-11-23 Thread Andrew Bogott (Code Review)
Andrew Bogott has uploaded a new change for review.

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

Change subject: Rename holmium to labservices1002.
..

Rename holmium to labservices1002.

Bug: T106303
Change-Id: I88d74bcc13d0cf6fb765f1332bd59addf596302e
---
M templates/10.in-addr.arpa
M templates/154.80.208.in-addr.arpa
M templates/wikimedia.org
M templates/wmnet
4 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/47/255047/1

diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa
index cf0fcbf..9a28985 100644
--- a/templates/10.in-addr.arpa
+++ b/templates/10.in-addr.arpa
@@ -1877,7 +1877,7 @@
 118 1H  IN PTR  tin.mgmt.eqiad.wmnet.
 119 1H  IN PTR  wmf4074.mgmt.eqiad.wmnet.
 119 1H  IN PTR  antimony.mgmt.eqiad.wmnet.
-120 1H  IN PTR  holmium.mgmt.eqiad.wmnet.
+120 1H  IN PTR  labservices1002.mgmt.eqiad.wmnet.
 120 1H  IN PTR  wmf4075.mgmt.eqiad.wmnet.
 121 1H  IN PTR  barium.mgmt.eqiad.wmnet.
 121 1H  IN PTR  wmf4076.mgmt.eqiad.wmnet.
diff --git a/templates/154.80.208.in-addr.arpa 
b/templates/154.80.208.in-addr.arpa
index db0cbb0..c4e78c1 100644
--- a/templates/154.80.208.in-addr.arpa
+++ b/templates/154.80.208.in-addr.arpa
@@ -25,7 +25,7 @@
 7   1H  IN PTR  antimony.wikimedia.org.
 10  1H  IN PTR  carbon.wikimedia.org.
 11  1H  IN PTR  dataset1001.wikimedia.org.
-12  1H  IN PTR  holmium.wikimedia.org.
+12  1H  IN PTR  labservices1002.wikimedia.org.
 13  1H  IN PTR  protactinium.wikimedia.org.
 14  1H  IN PTR  neon.wikimedia.org.
 16  1H  IN PTR  ms1001.wikimedia.org.
diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index f6f3688..967c40d 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -121,7 +121,7 @@
 
 gadolinium  1H  IN A208.80.154.73
 gallium 1H  IN A208.80.154.135
-holmium 1H  IN A208.80.154.12
+labservices1002 1H  IN A208.80.154.12
 hydrogen1H  IN A208.80.154.50
 1H  IN  2620:0:861:1:208:80:154:50
 install2001 1H  IN A208.80.153.4
diff --git a/templates/wmnet b/templates/wmnet
index 3a44457..3844b39 100644
--- a/templates/wmnet
+++ b/templates/wmnet
@@ -1914,7 +1914,7 @@
 WMF4074 1H  IN A10.65.3.119
 antimony1H  IN A10.65.3.119
 WMF4075 1H  IN A10.65.3.120
-holmium 1H  IN A10.65.3.120
+labservices1002 1H  IN A10.65.3.120
 WMF4076 1H  IN A10.65.3.121
 barium  1H  IN A10.65.3.121
 WMF4077 1H  IN A10.65.3.122

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88d74bcc13d0cf6fb765f1332bd59addf596302e
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Andrew Bogott 

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


[MediaWiki-commits] [Gerrit] Prevent switching from unedited section directly into VE - change (mediawiki...VisualEditor)

2015-11-23 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review.

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

Change subject: Prevent switching from unedited section directly into VE
..

Prevent switching from unedited section directly into VE

Bug: T117713
Change-Id: Iee9ae2bbe4757cb07e9aa2bd5f41a46c0ebb391a
(cherry picked from commit 67a51aee9b8ce440807bd3bcc9d787a793e3aec8)
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
1 file changed, 4 insertions(+), 1 deletion(-)


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

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
index 468ce54..9eb732e 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js
@@ -535,7 +535,10 @@
 
if (
mw.config.get( 'wgAction' ) === 'submit' ||
-   ( mw.config.get( 'wgAction' ) === 'edit' && 
wikitextModified )
+   ( mw.config.get( 'wgAction' ) === 'edit' && 
wikitextModified ) ||
+   // switching from section editing must prompt 
because we can't
+   // keep changes from that (yet?)
+   $( 'input[name=wpSection]' ).val()
) {
mw.loader.using( 'ext.visualEditor.switching' )
.done( function () {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee9ae2bbe4757cb07e9aa2bd5f41a46c0ebb391a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.27.0-wmf.7
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Alex Monk 

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


[MediaWiki-commits] [Gerrit] Display text snippet for evaluation - change (mediawiki...MathSearch)

2015-11-23 Thread Physikerwelt (Code Review)
Physikerwelt has uploaded a new change for review.

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

Change subject: Display text snippet for evaluation
..

Display text snippet for evaluation

Change-Id: I63a3bc1ba40338ea954ac2ee15821d3bab3df36a
---
M includes/special/SpecialMlpEval.php
1 file changed, 151 insertions(+), 25 deletions(-)


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

diff --git a/includes/special/SpecialMlpEval.php 
b/includes/special/SpecialMlpEval.php
index bea58c6..a2dc2fe 100644
--- a/includes/special/SpecialMlpEval.php
+++ b/includes/special/SpecialMlpEval.php
@@ -12,6 +12,18 @@
  * @ingroup extensions
  */
 class SpecialMlpEval extends SpecialPage {
+   const MAX_ATTEMPTS = 10;
+   const WINDOW_SIZE = 500;
+   private $step = 1;
+   /**
+* @var Title
+*/
+   private $title;
+   private $wikitext;
+   private $mathTags;
+   private $revison;
+   private $lastError = false;
+
function __construct() {
parent::__construct( 'MlpEval' );
}
@@ -20,29 +32,9 @@
 * The main function
 */
public function execute( $par ) {
-   $request = $this->getRequest();
$this->setHeaders();
-   $this->selectPageForm()->show();
+   $this->displayForm();
}
-
-   /**
-* Generates the search input form
-*/
-   private function selectPageForm() {
-   $this->getOutput()->addModules( 'ext.MathSearch.special' );
-   $formDescriptor = array(
-   'evalPage' => array(
-   'label' => 'Page to evaluate', # What's the 
label of the field
-   'class' => 'HTMLTextField' # What's the input 
type
-   )
-   );
-   $htmlForm = new HTMLForm( $formDescriptor, 
$this->getContext() );
-   $htmlForm->setSubmitText( 'Select' );
-   $htmlForm->setSubmitCallback( array( $this, 'processInput' ) );
-   $htmlForm->setHeaderText( "Step 1: Select a page" );
-   return $htmlForm;
-   }
-
 
 
/**
@@ -51,15 +43,26 @@
 * @return bool
 */
public function processInput( $formData ) {
-
-   $this->performSearch();
+   switch ( $this->step ) {
+   case 1:
+   $title = Title::newFromText( 
$formData['evalPage'] );
+   if ( $this->setPage( $title ) ) {
+   $this->step ++;
+   return false;
+   } else {
+   return $this->lastError;
+   }
+   break;
+   case 2:
+   return false;
+   }
}
 
public function performSearch() {
$out = $this->getOutput();
$out->addWikiText( '==Results==' );
$out->addWikiText( 'You searched for the following terms:' );
-
+   return false;
}
 
/**
@@ -75,7 +78,7 @@
private function enableMathStyles() {
$out = $this->getOutput();
$out->addModuleStyles(
-   array( 'ext.math.styles' , 'ext.math.desktop.styles', 
'ext.math.scripts' )
+   array( 'ext.math.styles', 'ext.math.desktop.styles', 
'ext.math.scripts' )
);
}
 
@@ -83,4 +86,127 @@
protected function getGroupName() {
return 'mathsearch';
}
+
+   private function getRandomPage() {
+   $rp = new RandomPage();
+   for ( $i = 0; $i < self::MAX_ATTEMPTS; $i ++ ) {
+   $title = $rp->getRandomTitle();
+   if ( $this->setPage( $title ) ) {
+   $this->lastError = "";
+   return $title;
+   }
+   }
+   $this->log()->warning( "Could not find suitable Page with 
math", $this->lastError );
+   $this->lastError = "";
+   return "";
+   }
+
+   private function displayForm() {
+   $startStep = $this->step;
+   switch ( $this->step ) {
+   case 1:
+   $this->getOutput()->addModules( 
'ext.MathSearch.special' );
+   $formDescriptor = array(
+   'evalPage' => array(
+   'label'   => 'Page to evaluate',
+   'class'   => 'HTMLTextField',
+  

[MediaWiki-commits] [Gerrit] phab: strip spaces around addresses - change (operations/puppet)

2015-11-23 Thread Rush (Code Review)
Rush has submitted this change and it was merged.

Change subject: phab: strip spaces around addresses
..


phab: strip spaces around addresses

Change-Id: I2f8990b5e030a726fdec3d13380fcabc610cd5dd
---
M modules/phabricator/files/phab_epipe.py
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/phabricator/files/phab_epipe.py 
b/modules/phabricator/files/phab_epipe.py
index 12999f0..81c9ba5 100644
--- a/modules/phabricator/files/phab_epipe.py
+++ b/modules/phabricator/files/phab_epipe.py
@@ -59,8 +59,8 @@
 :param list_of_dests: list of dest email strings
 :returns: string
 """
-for dest in list_of_dests:
-task = re.match('^T(\d+)@', dest)
+for dest in [m.strip() for m in list_of_dests]:
+task = re.match('^[T|t](\d+)@', dest)
 if task:
 return int(task.group(1))
 return ''

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

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

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


[MediaWiki-commits] [Gerrit] Add script to reset user emails - change (mediawiki/core)

2015-11-23 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review.

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

Change subject: Add script to reset user emails
..

Add script to reset user emails

Current way to do it, via eval.php, is slightly scary.

Change-Id: I2b875326a0eb1e6d1f4bc758b8ac97b8f9324c4e
---
M RELEASE-NOTES-1.27
A maintenance/resetUserEmail.php
2 files changed, 70 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/44/255044/1

diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27
index 4a35948..b2d88f3 100644
--- a/RELEASE-NOTES-1.27
+++ b/RELEASE-NOTES-1.27
@@ -146,6 +146,8 @@
   ResourceLoaderContext instance is deprecated.
 * ResourceLoader::getLessCompiler() now takes an optional parameter of
   additional LESS variables to set for the compiler.
+* New maintenance script resetUserEmail.php allows sysadmins to reset user 
emails in case
+  a user forgot password/account was stolen.
 
 == Compatibility ==
 
diff --git a/maintenance/resetUserEmail.php b/maintenance/resetUserEmail.php
new file mode 100644
index 000..3668934
--- /dev/null
+++ b/maintenance/resetUserEmail.php
@@ -0,0 +1,68 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once __DIR__ . '/Maintenance.php';
+
+/**
+ * Maintenance script that resets user email.
+ *
+ * @ingroup Maintenance
+ */
+class ResetUserEmail extends Maintenance {
+   public function __construct() {
+   $this->mDescription = "Resets a user's email";
+   $this->addArg( 'user', 'Username or user ID, if starts with #', 
true );
+   $this->addArg( 'email', 'Email to assign' );
+   parent::__construct();
+   }
+
+   /**
+* Do the actual work. All child classes will need to implement this
+*/
+   public function execute() {
+   $userName = $this->getArg( 0 );
+   if ( $userName[0] == '#' ) {
+   $user = User::newFromId( substr( $userName, 1 ) );
+   } else {
+   $user = User::newFromName( $userName );
+   }
+   if ( !$user || !$user->getId() || !$user->loadFromId() ) {
+   $this->error( "Error: user '$userName' does not 
exist\n", 1 );
+   }
+
+   $email = $this->getArg( 1 );
+   if ( !Sanitizer::validateEmail( $email ) ) {
+   $this->error( "Error: email '$email' is not valid\n", 1 
);
+   }
+
+   // Code from https://wikitech.wikimedia.org/wiki/Password_reset
+   $user->setEmail( $email );
+   $user->setEmailAuthenticationTimestamp( wfTimestampNow() );
+   $user->saveSettings();
+   // Kick whomever is currently controlling the account off
+   $user->setPassword( 
PasswordFactory::generateRandomPasswordString( 128 ) );
+   }
+}
+
+$maintClass = 'ResetUserEmail';
+require_once RUN_MAINTENANCE_IF_MAIN;

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

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

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


[MediaWiki-commits] [Gerrit] phab: strip spaces around addresses - change (operations/puppet)

2015-11-23 Thread Rush (Code Review)
Rush has uploaded a new change for review.

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

Change subject: phab: strip spaces around addresses
..

phab: strip spaces around addresses

Change-Id: I2f8990b5e030a726fdec3d13380fcabc610cd5dd
---
M modules/phabricator/files/phab_epipe.py
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/modules/phabricator/files/phab_epipe.py 
b/modules/phabricator/files/phab_epipe.py
index 12999f0..81c9ba5 100644
--- a/modules/phabricator/files/phab_epipe.py
+++ b/modules/phabricator/files/phab_epipe.py
@@ -59,8 +59,8 @@
 :param list_of_dests: list of dest email strings
 :returns: string
 """
-for dest in list_of_dests:
-task = re.match('^T(\d+)@', dest)
+for dest in [m.strip() for m in list_of_dests]:
+task = re.match('^[T|t](\d+)@', dest)
 if task:
 return int(task.group(1))
 return ''

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

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

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


[MediaWiki-commits] [Gerrit] Detect MWNumberedExternalLinkNode as convertible - change (mediawiki...Citoid)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Detect MWNumberedExternalLinkNode as convertible
..


Detect MWNumberedExternalLinkNode as convertible

Bug: T119421
Change-Id: If72e8e9ba7e4f9fa307cdf557bed075a3aa4b05d
---
M modules/ve.ui.CiteFromIdInspectorTool.js
1 file changed, 12 insertions(+), 4 deletions(-)

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



diff --git a/modules/ve.ui.CiteFromIdInspectorTool.js 
b/modules/ve.ui.CiteFromIdInspectorTool.js
index a986f8a..5eb49a4 100644
--- a/modules/ve.ui.CiteFromIdInspectorTool.js
+++ b/modules/ve.ui.CiteFromIdInspectorTool.js
@@ -99,7 +99,7 @@
 * @inheritdoc
 */
ve.ui.MWReferenceContextItem.prototype.renderBody = function () {
-   var surfaceModel, fragment, annotations, annotation, 
convertButton,
+   var surfaceModel, fragment, annotations, annotation, 
convertButton, range, contentNode,
refNode = this.getReferenceNode();
 
this.$body.append( this.getRendering() );
@@ -109,16 +109,24 @@
}
 
surfaceModel = this.context.getSurface().getModel();
-   fragment = surfaceModel.getLinearFragment( refNode.getRange() );
+   range = refNode.getRange();
+   fragment = surfaceModel.getLinearFragment( range );
// Get covering annotations
annotations = fragment.getAnnotations( false );
+   // The reference consists of one single external link so
+   // offer the user a conversion to citoid-generated reference
if (
annotations.getLength() === 1 &&
( annotation = annotations.get( 0 ) ) instanceof 
ve.dm.MWExternalLinkAnnotation
) {
-   // The reference consists of one single external link so
-   // offer the user a conversion to citoid-generated 
reference
this.convertibleHref = annotation.getHref();
+   } else if ( range.getLength() === 4 ) {
+   contentNode = fragment.adjustLinearSelection( 1, -1 
).getSelectedNode();
+   if ( contentNode instanceof 
ve.dm.MWNumberedExternalLinkNode ) {
+   this.convertibleHref = contentNode.getHref();
+   }
+   }
+   if ( this.convertibleHref ) {
convertButton = new OO.ui.ButtonWidget( {
label: ve.msg( 
'citoid-referencecontextitem-convert-button' )
} ).connect( this, { click: 'onConvertButtonClick' } );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If72e8e9ba7e4f9fa307cdf557bed075a3aa4b05d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Citoid
Gerrit-Branch: master
Gerrit-Owner: Esanders 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Support named arguments in ObjectFactory - change (mediawiki/core)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Support named arguments in ObjectFactory
..


Support named arguments in ObjectFactory

Arguments are sometimes given as array( 'foo' => 1, 'bar' => 2 )
which makes the configuration self-documenting.

Change-Id: I43aa085090f1014ba841641867ebf9559d16e76d
---
M includes/libs/ObjectFactory.php
M tests/phpunit/includes/libs/ObjectFactoryTest.php
2 files changed, 12 insertions(+), 1 deletion(-)

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



diff --git a/includes/libs/ObjectFactory.php b/includes/libs/ObjectFactory.php
index 6191612..bd0da57 100644
--- a/includes/libs/ObjectFactory.php
+++ b/includes/libs/ObjectFactory.php
@@ -128,8 +128,11 @@
 * @return mixed Constructed instance
 */
public static function constructClassInstance( $clazz, $args ) {
+   // args are sometimes specified in a 'name' => $value format 
for readability
+   $args = array_values( $args );
+
// TODO: when PHP min version supported is >=5.6.0 replace this
-   // function body with `return new $clazz( ... $args );`.
+   // with `return new $clazz( ... $args );`.
$obj = null;
switch ( count( $args ) ) {
case 0:
diff --git a/tests/phpunit/includes/libs/ObjectFactoryTest.php 
b/tests/phpunit/includes/libs/ObjectFactoryTest.php
index 622fce2..6337210 100644
--- a/tests/phpunit/includes/libs/ObjectFactoryTest.php
+++ b/tests/phpunit/includes/libs/ObjectFactoryTest.php
@@ -108,6 +108,14 @@
'11 args' => array( array( 1, 2, 3, 4, 5, 6, 7, 8, 9, 
10, 11, ) ),
);
}
+
+   public function testNamedArgs() {
+   $args = array( 'foo' => 1, 'bar' => 2, 'baz' => 3 );
+   $obj = ObjectFactory::constructClassInstance(
+   'ObjectFactoryTestFixture', $args
+   );
+   $this->assertSame( array( 1, 2, 3 ), $obj->args );
+   }
 }
 
 class ObjectFactoryTestFixture {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I43aa085090f1014ba841641867ebf9559d16e76d
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: Anomie 
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] [WIP] Update refreshMessageBlobs.php to no longer use msg_re... - change (mediawiki...WikimediaMaintenance)

2015-11-23 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: [WIP] Update refreshMessageBlobs.php to no longer use 
msg_resource table
..

[WIP] Update refreshMessageBlobs.php to no longer use msg_resource table

Requires Id8c26f41a82597e in MediaWiki core

Change-Id: Ifa74e8eabda2ab282851fad3a82a4e1e124d2b2e
---
M refreshMessageBlobs.php
1 file changed, 7 insertions(+), 66 deletions(-)


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

diff --git a/refreshMessageBlobs.php b/refreshMessageBlobs.php
index bb9d44c..2ceb434 100644
--- a/refreshMessageBlobs.php
+++ b/refreshMessageBlobs.php
@@ -1,75 +1,16 @@
  $enModTime );
-
-   # To avoid cache stampede, fetch all the non-empty resource 
message
-   # blobs and update them one at a time manually. To avoid excess 
memory
-   # usage in LocalisationCache, order by language and clear the 
cache
-   # between each language.
-   $dbr = wfGetDB( DB_SLAVE );
-   $dbw = wfGetDB( DB_MASTER );
-   $res = $dbr->select( 'msg_resource',
-   array( 'mr_resource', 'mr_lang', 'mr_blob', 
'mr_timestamp' ),
-   "mr_blob != '{}'",
-   __METHOD__,
-   array( 'ORDER BY' => 'mr_lang' )
-   );
-   $prevLang = false;
-   foreach ( $res as $row ) {
-   # Check modification time for this language
-   if ( !isset( $langModTime[$row->mr_lang] ) ) {
-   $file = 
"$IP/cache/l10n/l10n_cache-$row->mr_lang.cdb";
-   if ( file_exists( $file ) ) {
-   $langModTime[$row->mr_lang] = 
filemtime( $file );
-   } else {
-   $langModTime[$row->mr_lang] = 
$enModTime;
-   }
-   }
-   if ( wfTimestamp( TS_UNIX, $row->mr_timestamp ) >= 
$langModTime[$row->mr_lang] ) {
-   continue;
-   }
-
-   # Clear LocalisationCache of the old language to reduce 
memory usage
-   if ( $prevLang !== false && $prevLang !== $row->mr_lang 
) {
-   Language::getLocalisationCache()->unload( 
$prevLang );
-   }
-   $prevLang = $row->mr_lang;
-
-   # Update message blob. Even though we read from a slave 
and are
-   # writing to master, it should be safe because we're 
including
-   # mr_timestamp in the WHERE clause.
-   $messages = FormatJson::decode( $row->mr_blob, true );
-   foreach ( $messages as $key => $value ) {
-   $messages[$key] = wfMessage( $key 
)->inLanguage( $row->mr_lang )->plain();
-   }
-   $dbw->update( 'msg_resource',
-   array(
-   'mr_blob' => FormatJson::encode( 
(object)$messages ),
-   'mr_timestamp' => $dbw->timestamp(),
-   ),
-   array(
-   'mr_resource' => $row->mr_resource,
-   'mr_lang' => $row->mr_lang,
-   'mr_timestamp' => $row->mr_timestamp,
-   ),
-   __METHOD__
-   );
-   wfWaitForSlaves();
-   }
+   public function execute() {
+   MessageBlobStore::clear();
+   wfWaitForSlaves();
}
 }
 
 $maintClass = 'RefreshMessageBlobs';
-require_once( DO_MAINTENANCE );
+require_once DO_MAINTENANCE;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa74e8eabda2ab282851fad3a82a4e1e124d2b2e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 23270f8..bbdb48a - change (mediawiki/extensions)

2015-11-23 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: 23270f8..bbdb48a
..


Syncronize VisualEditor: 23270f8..bbdb48a

Change-Id: I68c49b72e2b3aa25deedb6872f76aa36fa782c84
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index 23270f8..bbdb48a 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 23270f87f90a1b3f5df1b2456e91b30322e84cb8
+Subproject commit bbdb48abdf5ef3ce355aff636b20a563ebc6f004

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I68c49b72e2b3aa25deedb6872f76aa36fa782c84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 
Gerrit-Reviewer: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] Create MWPreviewElement which adds the mw-body-content class - change (mediawiki...VisualEditor)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Create MWPreviewElement which adds the mw-body-content class
..


Create MWPreviewElement which adds the mw-body-content class

This fixes some rendering issues, and also increases the font
size of reference contexts from 12.8px (interface) to 14px (content).

Bug: T119430
Change-Id: Ib1bae8cd4cfe86903d78406a33db78e1489fde86
---
M extension.json
M modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js
M modules/ve-mw/ui/dialogs/ve.ui.MWExtensionPreviewDialog.js
A modules/ve-mw/ui/elements/ve.ui.MWPreviewElement.js
M modules/ve-mw/ui/widgets/ve.ui.MWReferenceSearchWidget.js
5 files changed, 32 insertions(+), 3 deletions(-)

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



diff --git a/extension.json b/extension.json
index 8535166..5c29b5f 100644
--- a/extension.json
+++ b/extension.json
@@ -1032,6 +1032,7 @@

"modules/ve-mw/ui/dialogs/ve.ui.MWCancelConfirmDialog.js",

"modules/ve-mw/ui/dialogs/ve.ui.MWWikitextSwitchConfirmDialog.js",

"modules/ve-mw/ui/elements/ve.ui.MWExpandableErrorElement.js",
+   
"modules/ve-mw/ui/elements/ve.ui.MWPreviewElement.js",

"modules/ve-mw/ui/tools/ve.ui.MWEditModeTool.js",
"modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js",

"modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js",
diff --git a/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js 
b/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js
index 635b411..cfeeb36 100644
--- a/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js
+++ b/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js
@@ -50,7 +50,7 @@
 ve.ui.MWReferenceContextItem.prototype.getRendering = function () {
var refNode = this.getReferenceNode();
if ( refNode ) {
-   this.view = new ve.ui.PreviewElement( refNode );
+   this.view = new ve.ui.MWPreviewElement( refNode );
 
// The $element property may be rendered into asynchronously, 
update the context's size when the
// rendering is complete if that's the case
diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWExtensionPreviewDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWExtensionPreviewDialog.js
index 129721b..ee562b6 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWExtensionPreviewDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWExtensionPreviewDialog.js
@@ -38,7 +38,7 @@
 
// Properties
this.previewNode = null;
-   this.previewElement = new ve.ui.PreviewElement();
+   this.previewElement = new ve.ui.MWPreviewElement();
 
// Initialization
this.$element.addClass( 've-ui-mwExtensionPreviewDialog' );
diff --git a/modules/ve-mw/ui/elements/ve.ui.MWPreviewElement.js 
b/modules/ve-mw/ui/elements/ve.ui.MWPreviewElement.js
new file mode 100644
index 000..ff06382
--- /dev/null
+++ b/modules/ve-mw/ui/elements/ve.ui.MWPreviewElement.js
@@ -0,0 +1,28 @@
+/*!
+ * VisualEditor UserInterface MWPreviewElement class.
+ *
+ * @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * Creates an ve.ui.MWPreviewElement object.
+ *
+ * @class
+ * @extends ve.ui.PreviewElement
+ *
+ * @constructor
+ * @param {ve.dm.Node} [model]
+ * @param {Object} [config]
+ */
+ve.ui.MWPreviewElement = function VeUiMwPreviewElement() {
+   // Parent constructor
+   ve.ui.MWPreviewElement.super.apply( this, arguments );
+
+   // Initialize
+   this.$element.addClass( 've-ui-mwPreviewElement mw-body-content' );
+};
+
+/* Inheritance */
+
+OO.inheritClass( ve.ui.MWPreviewElement, ve.ui.PreviewElement );
diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWReferenceSearchWidget.js 
b/modules/ve-mw/ui/widgets/ve.ui.MWReferenceSearchWidget.js
index 98a3eea..fd5ee57 100644
--- a/modules/ve-mw/ui/widgets/ve.ui.MWReferenceSearchWidget.js
+++ b/modules/ve-mw/ui/widgets/ve.ui.MWReferenceSearchWidget.js
@@ -151,7 +151,7 @@
// Only increment counter for real references
n++;
refModel = 
ve.dm.MWReferenceModel.static.newFromReferenceNode( refNode );
-   view = new ve.ui.PreviewElement(
+   view = new ve.ui.MWPreviewElement(

refModel.getDocument().getInternalList().getItemNode( refModel.getListIndex() )
);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1bae8cd4cfe86903d78406a33db78e1489fde86
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Vis

[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 23270f8..bbdb48a - change (mediawiki/extensions)

2015-11-23 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: 23270f8..bbdb48a
..

Syncronize VisualEditor: 23270f8..bbdb48a

Change-Id: I68c49b72e2b3aa25deedb6872f76aa36fa782c84
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/VisualEditor b/VisualEditor
index 23270f8..bbdb48a 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit 23270f87f90a1b3f5df1b2456e91b30322e84cb8
+Subproject commit bbdb48abdf5ef3ce355aff636b20a563ebc6f004

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68c49b72e2b3aa25deedb6872f76aa36fa782c84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] Enable labs ES replica for english and german - change (operations/mediawiki-config)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Enable labs ES replica for english and german
..


Enable labs ES replica for english and german

Bug: T109715
Change-Id: Ia03b8363f00473a6c6398b1b9a4b1d96bfe56a67
---
M tests/cirrusTest.php
M wmf-config/InitialiseSettings.php
2 files changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/tests/cirrusTest.php b/tests/cirrusTest.php
index e3069fa..9b4fb1d 100644
--- a/tests/cirrusTest.php
+++ b/tests/cirrusTest.php
@@ -44,8 +44,7 @@
$this->assertArrayHasKey( $cluster, 
$config['wgCirrusSearchClientSideConnectTimeout'] );
}
 
-   // Only eqiad and codfw for now
-   $this->assertCount( 2, $config['wgCirrusSearchWriteClusters'] );
+   $this->assertCount( 3, $config['wgCirrusSearchWriteClusters'] );
foreach ( $config['wgCirrusSearchWriteClusters'] as $cluster ) {
$this->assertArrayHasKey(
$cluster,
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 60d4526..96c4907 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15375,6 +15375,8 @@
 
 'wmgCirrusSearchWriteClusters' => array(
'default' => array( 'eqiad', 'codfw' ),
+   'enwiki' => array( 'eqiad', 'codfw', 'labsearch' ),
+   'dewiki' => array( 'eqiad', 'codfw', 'labsearch' ),
'testwiki' => array( 'eqiad', 'codfw', 'labsearch' )
 ),
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia03b8363f00473a6c6398b1b9a4b1d96bfe56a67
Gerrit-PatchSet: 3
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] VE: Use MWPreviewElement instead of PreviewElement - change (mediawiki...Citoid)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: VE: Use MWPreviewElement instead of PreviewElement
..


VE: Use MWPreviewElement instead of PreviewElement

Depends-on: Ib1bae8cd4c
Change-Id: I464ecf5a01f92c9bd5a189ab21d164c36800b276
---
M modules/ve.ui.CiteFromIdReferenceWidget.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/modules/ve.ui.CiteFromIdReferenceWidget.js 
b/modules/ve.ui.CiteFromIdReferenceWidget.js
index 122b3b2..a19952e 100644
--- a/modules/ve.ui.CiteFromIdReferenceWidget.js
+++ b/modules/ve.ui.CiteFromIdReferenceWidget.js
@@ -64,7 +64,7 @@
documentModel.getHtmlDocument()
);
node = doc.getDocumentNode().getChildren()[ 0 ];
-   this.preview = new ve.ui.PreviewElement( node );
+   this.preview = new ve.ui.MWPreviewElement( node );
if ( this.preview.isGenerating() ) {
this.preview.once( 'render', this.renderPromise.resolve );
} else {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I464ecf5a01f92c9bd5a189ab21d164c36800b276
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Citoid
Gerrit-Branch: master
Gerrit-Owner: Esanders 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add parameter to SpecialCharacterDialog onListClick document... - change (VisualEditor/VisualEditor)

2015-11-23 Thread Tchanders (Code Review)
Tchanders has uploaded a new change for review.

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

Change subject: Add parameter to SpecialCharacterDialog onListClick 
documentation
..

Add parameter to SpecialCharacterDialog onListClick documentation

Change-Id: Ib6c3964336565f7539d429e71c66a677c29b2050
---
M src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/40/255040/1

diff --git a/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js 
b/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
index 24ccf75..74c0f6a 100644
--- a/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
+++ b/src/ui/dialogs/ve.ui.SpecialCharacterDialog.js
@@ -150,6 +150,8 @@
 
 /**
  * Handle the click event on the list
+ *
+ * @param {jQuery.Event} e Mouse click event
  */
 ve.ui.SpecialCharacterDialog.prototype.onListClick = function ( e ) {
var

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6c3964336565f7539d429e71c66a677c29b2050
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Tchanders 

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


[MediaWiki-commits] [Gerrit] Use Accept-Language headers to detect language of query - change (mediawiki...CirrusSearch)

2015-11-23 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Use Accept-Language headers to detect language of query
..

Use Accept-Language headers to detect language of query

Bug: T118280
Change-Id: Ib23155739b683a94fe317a9291be478f48befed4
---
M CirrusSearch.php
M includes/CirrusSearch.php
M includes/ElasticsearchIntermediary.php
M includes/Searcher.php
4 files changed, 66 insertions(+), 6 deletions(-)


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

diff --git a/CirrusSearch.php b/CirrusSearch.php
index 81197e2..20eedaa 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -811,6 +811,13 @@
  */
 $wgCirrusSearchInterwikiThreshold = 3;
 
+/**
+ * Utilize the Accept-Language header to decide on the secondary language
+ * to search when a query gets < $wgCirrusSearchInterwikiThreshold
+ * results.
+ */
+$wgCirrusSearchLangDetectAcceptLang = false;
+
 $includes = __DIR__ . "/includes/";
 $apiDir = $includes . 'Api/';
 $buildDocument = $includes . 'BuildDocument/';
diff --git a/includes/CirrusSearch.php b/includes/CirrusSearch.php
index bb39368..410cc14 100644
--- a/includes/CirrusSearch.php
+++ b/includes/CirrusSearch.php
@@ -119,7 +119,43 @@
return null;
}
 
-   $lang = Searcher::detectLanguage( $this->connection, $term );
+   $detectors = array();
+   // T118288 suggests accept-lang is 3x better than the ES
+   // plugin at converting from zero result to non-zero result. If
+   // proved in production this feature flag will be removed and 
this
+   // made permenant.
+   if ( $GLOBALS['wgCirrusSearchLangDetectAcceptLang'] ) {
+   $detectors['accept-lang'] = array(
+   array( 'CirrusSearch\Searcher', 
'detectLanguageViaAcceptLang' ),
+   array(),
+   );
+   }
+   $detectors['es-plugin'] = array(
+   array( 'CirrusSearch\Searcher', 'detectLanguageViaES' ),
+   array( $this->connection, $term ),
+   );
+   foreach ( $detectors as $name => $detector ) {
+   list( $callback, $arguments ) = $detector;
+   $lang = call_user_func_array( $callback, $arguments );
+   $wiki = self::wikiForLanguage( $lang );
+   if ( $wiki !== null ) {
+   Searcher::appendLastLogContext( array(
+   'langdetect' => $name,
+   ) );
+   return $wiki;
+   }
+   }
+   Searcher::appendLastLogContext( array(
+   'langdetect' => 'failed',
+   ) );
+   return null;
+   }
+
+   /**
+* @var string $lang Language code to find wiki for
+* @return string|null The wiki related to specified language code
+*/
+   private function wikiForLanguage( $lang ) {
if ( empty( $GLOBALS['wgCirrusSearchLanguageToWikiMap'][$lang] 
) ) {
return null;
}
@@ -161,9 +197,6 @@
}
}
}
-   Searcher::appendLastLogContext( array(
-   'langdetect' => true,
-   ) );
$altWiki = $this->hasSecondaryLanguage( $term );
if ( $altWiki ) {
try {
diff --git a/includes/ElasticsearchIntermediary.php 
b/includes/ElasticsearchIntermediary.php
index c5b0d68..b3a618f 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -215,7 +215,7 @@
$parameters['queryType'][] = 
$context['queryType'];
}
if ( !empty( $context['langdetect' ] ) ) {
-   $parameters['langdetect'] = true;
+   $parameters['langdetect'] = 
$context['langdetect'];
}
}
 
diff --git a/includes/Searcher.php b/includes/Searcher.php
index 0ee0bd9..3ea9a9c 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -1839,13 +1839,33 @@
}
 
/**
+* Try to detect language via Accept-Language header. Takes the
+* first accept-language that is not the current content language.
+* @return string|null Language name or null
+*/
+   public static function detectLanguageViaAcceptLang() {
+   $acceptLang = array_keys( 
$GLOBALS['wgRequest']->getAcceptLang() );
+   $currentShortLang = $GLOBALS['wgContLang']->getCode();
+ 

[MediaWiki-commits] [Gerrit] VipsScaler role - change (mediawiki/vagrant)

2015-11-23 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: VipsScaler role
..


VipsScaler role

Bug: T88077
Change-Id: I2be748cddbfba50f43e7e7f2288af7a78d41f03c
---
A puppet/modules/role/manifests/vipsscaler.pp
A puppet/modules/vipsscaler/templates/vipstest.php.erb
2 files changed, 37 insertions(+), 0 deletions(-)

Approvals:
  Dduvall: Looks good to me, approved
  Gergő Tisza: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/puppet/modules/role/manifests/vipsscaler.pp 
b/puppet/modules/role/manifests/vipsscaler.pp
new file mode 100644
index 000..829a928
--- /dev/null
+++ b/puppet/modules/role/manifests/vipsscaler.pp
@@ -0,0 +1,36 @@
+# == Class: role::vipsscaler
+# Configures a MediaWiki instance with
+# VipsScaler[https://www.mediawiki.org/wiki/Extension:VipsScaler]
+
+class role::vipsscaler {
+require_package('libvips-tools')
+
+mediawiki::extension { 'VipsScaler':
+settings => {
+wgVipsOptions=> [
+{
+conditions => {
+mimeType => 'image/png',
+minArea  => 2000,
+},
+},
+{
+conditions => {
+mimeType=> 'image/tiff',
+minShrinkFactor => 1.2,
+minArea => 5000,
+},
+sharpen=> {
+sigma => 0.8,
+},
+},
+],
+wgMaxShellMemory => 1048576,
+wgMaxShellTime   => 50,
+},
+}
+
+mediawiki::settings { 'VipsTest':
+values => template('vipsscaler/vipstest.php.erb'),
+}
+}
diff --git a/puppet/modules/vipsscaler/templates/vipstest.php.erb 
b/puppet/modules/vipsscaler/templates/vipstest.php.erb
new file mode 100644
index 000..00baf70
--- /dev/null
+++ b/puppet/modules/vipsscaler/templates/vipstest.php.erb
@@ -0,0 +1 @@
+require_once("$IP/extensions/VipsScaler/VipsTest.php");
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2be748cddbfba50f43e7e7f2288af7a78d41f03c
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gilles 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Doxygen: Disable verbose output - change (mediawiki/core)

2015-11-23 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: Doxygen: Disable verbose output
..

Doxygen: Disable verbose output

https://www.stack.nl/~dimitri/doxygen/manual/config.html#cfg_quiet

* To make the standard output in Jenkins more useful,
  disable the verbose messages about "Loading file .." in between
  all the errors.

* Remove obsolete config options XML_SCHEMA and XML_DTD that were
  producing warnings. We weren't using these anyway (set to their default
  blank value).

Change-Id: I6876cf4d783f7795a12d99623c8ce3717e9a51f5
---
M maintenance/Doxyfile
M maintenance/mwdocgen.php
2 files changed, 2 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/35/255035/1

diff --git a/maintenance/Doxyfile b/maintenance/Doxyfile
index 1f70f45..0c89c05 100644
--- a/maintenance/Doxyfile
+++ b/maintenance/Doxyfile
@@ -132,7 +132,7 @@
 #---
 # Configuration options related to warning and progress messages
 #---
-QUIET  = NO
+QUIET  = YES
 WARNINGS   = YES
 WARN_IF_UNDOCUMENTED   = YES
 WARN_IF_DOC_ERROR  = YES
@@ -322,8 +322,6 @@
 #---
 GENERATE_XML   = NO
 XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD=
 XML_PROGRAMLISTING = YES
 #---
 # Configuration options related to the DOCBOOK output
diff --git a/maintenance/mwdocgen.php b/maintenance/mwdocgen.php
index 49eae4a..00a15e5 100644
--- a/maintenance/mwdocgen.php
+++ b/maintenance/mwdocgen.php
@@ -86,8 +86,7 @@
 
$this->output = $this->getOption( 'output', "$IP/docs" );
 
-   $this->inputFilter = wfShellWikiCmd(
-   $IP . '/maintenance/mwdoc-filter.php' );
+   $this->inputFilter = wfShellWikiCmd( $IP . 
'/maintenance/mwdoc-filter.php' );
$this->template = $IP . '/maintenance/Doxyfile';
$this->excludes = array(
'vendor',

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

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

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


[MediaWiki-commits] [Gerrit] Doxygen: Rewrite mwdoc-filter to fix bug with slashes in com... - change (mediawiki/core)

2015-11-23 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: Doxygen: Rewrite mwdoc-filter to fix bug with slashes in 
comments
..

Doxygen: Rewrite mwdoc-filter to fix bug with slashes in comments

The behaviour stays the same (extract type from @var comment and
insert into source code between e.g. "protected" and "$name") but
implemented using PHP's tokenizer instead of global regexes.

This fixes the problem with slashes being found inside the
documentation comment and various other edge cases, such as use
of slashes inside comments.

Also fix the problem with PHP namespaces being misinterpreted
as a Doxygen /command by escaping slashes automatically. This
shouldn't conflict with actual commands, since we use '@' for
all commands (e.g. @param, @return, @since etc.)

Change-Id: Ic03a8fc9d4b4851f66c2e975d9955ba20ab92f0e
---
M maintenance/mwdoc-filter.php
1 file changed, 86 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/255037/1

diff --git a/maintenance/mwdoc-filter.php b/maintenance/mwdoc-filter.php
index 0cc7bde..f32bb4c 100644
--- a/maintenance/mwdoc-filter.php
+++ b/maintenance/mwdoc-filter.php
@@ -2,13 +2,40 @@
 /**
  * Doxygen filter to show correct member variable types in documentation.
  *
- * Should be filled in doxygen INPUT_FILTER as "php mwdoc-filter.php"
+ * Should be set in Doxygen INPUT_FILTER as "php mwdoc-filter.php"
  *
- * Original source code by Goran Rakic
- * http://blog.goranrakic.com/
- * http://stackoverflow.com/questions/4325224
+ * Based on
+ * 

  *
- * @file
+ * Improved to resolve various bugs and better MediaWiki PHPDoc conventions:
+ *
+ * - Insert variable name after typehint instead of at end of line so that
+ *   documentation text may follow after "@var Type".
+ * - Insert typehint into source code before $variable instead of inside the 
comment
+ *   so that Doxygen interprets it.
+ * - Strip the text after @var from the output to avoid Doxygen warnings aboug 
bogus
+ *   symbols being documented but not declared or defined.
+ *
+ * Copyright (C) 2012 Tamas Imrei  
http://virtualtee.blogspot.com/
+ * Copyright (C) 2015 Timo Tijhof
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */
 
 if ( PHP_SAPI != 'cli' ) {
@@ -16,33 +43,58 @@
 }
 
 $source = file_get_contents( $argv[1] );
-$regexp = '#'
-   . '\@var'
-   . '\s+'
-   // Type hint
-   . '([^\s]+)'
-   . '\s+'
-   // Any text or line(s) between type hint and '/' closing the comment
-   // (includes the star of "*/"). Descriptions containing a slash
-   // are not supported. Those will have to to be rewritten to have their
-   // description *before* the @var:
-   // /**
-   //  * Description with / in it.
-   //  * @var array
-   //  */
-   // instead of:
-   // /**
-   //  * @var array Description with / in it.
-   //  */
-   . '([^/]+)'
-   . '/'
-   . '\s+'
-   . '(var|public|protected|private)'
-   . '\s+'
-   // Variable name
-   . '(\$[^\s;=]+)'
-   . '#';
-$replac = '${2}/ ${3} ${1} ${4}';
-$source = preg_replace( $regexp, $replac, $source );
+$tokens = token_get_all( $source );
 
-echo $source;
+$buffer = $bufferType = null;
+foreach ( $tokens as $token ) {
+   if ( is_string( $token ) ) {
+   if ( $buffer !== null && $token === ';' ) {
+   // If we still have a buffer and the statement has 
ended,
+   // flush it and move on.
+   echo $buffer;
+   $buffer = $bufferType = null;
+   }
+   echo $token;
+   continue;
+   }
+   list( $id, $content ) = $token;
+   switch ( $id ) {
+   c

[MediaWiki-commits] [Gerrit] Remove redundant escaping for namespace references in docume... - change (mediawiki/core)

2015-11-23 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: Remove redundant escaping for namespace references in 
documentation
..

Remove redundant escaping for namespace references in documentation

Follows-up b264cee. No longer needed as of 0c9e9cc.

Change-Id: I31745f55885eeec2bb8cf2c9ffe9e98242cd5baa
---
M includes/GlobalFunctions.php
M includes/debug/logger/LegacyLogger.php
M includes/debug/logger/LegacySpi.php
M includes/debug/logger/LoggerFactory.php
M includes/debug/logger/MonologSpi.php
M includes/debug/logger/NullSpi.php
M includes/debug/logger/Spi.php
M includes/debug/logger/monolog/AvroFormatter.php
M includes/debug/logger/monolog/BufferHandler.php
M includes/debug/logger/monolog/LegacyFormatter.php
M includes/debug/logger/monolog/LegacyHandler.php
M includes/debug/logger/monolog/SyslogHandler.php
M includes/htmlform/HTMLButtonField.php
M includes/htmlform/HTMLCheckField.php
M includes/htmlform/HTMLFormField.php
M includes/htmlform/OOUIHTMLForm.php
16 files changed, 41 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/38/255038/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 421cd90..9566069 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -1238,7 +1238,7 @@
  * @param string $file Filename
  * @param array $context Additional logging context data
  * @throws MWException
- * @deprecated since 1.25 Use \\MediaWiki\\Logger\\LegacyLogger::emit or 
UDPTransport
+ * @deprecated since 1.25 Use \MediaWiki\Logger\LegacyLogger::emit or 
UDPTransport
  */
 function wfErrorLog( $text, $file, array $context = array() ) {
wfDeprecated( __METHOD__, '1.25' );
diff --git a/includes/debug/logger/LegacyLogger.php 
b/includes/debug/logger/LegacyLogger.php
index bb3c7e1..65719fa 100644
--- a/includes/debug/logger/LegacyLogger.php
+++ b/includes/debug/logger/LegacyLogger.php
@@ -41,7 +41,7 @@
  * See documentation in DefaultSettings.php for detailed explanations of each
  * variable.
  *
- * @see \\MediaWiki\\Logger\\LoggerFactory
+ * @see \MediaWiki\Logger\LoggerFactory
  * @since 1.25
  * @author Bryan Davis 
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -54,7 +54,7 @@
protected $channel;
 
/**
-* Convert Psr\\Log\\LogLevel constants into int for sane comparisons
+* Convert \Psr\Log\LogLevel constants into int for sane comparisons
 * These are the same values that Monlog uses
 *
 * @var array $levelMapping
@@ -101,7 +101,7 @@
 *
 * @param string $channel
 * @param string $message
-* @param string|int $level Psr\\Log\\LogEvent constant or Monlog level 
int
+* @param string|int $level \Psr\Log\LogEvent constant or Monlog level 
int
 * @param array $context
 * @return bool True if message should be sent to disk/network, false
 * otherwise
diff --git a/includes/debug/logger/LegacySpi.php 
b/includes/debug/logger/LegacySpi.php
index 6a7f1d0..1bf39e4 100644
--- a/includes/debug/logger/LegacySpi.php
+++ b/includes/debug/logger/LegacySpi.php
@@ -30,7 +30,7 @@
  * );
  * @endcode
  *
- * @see \\MediaWiki\\Logger\\LoggerFactory
+ * @see \MediaWiki\Logger\LoggerFactory
  * @since 1.25
  * @author Bryan Davis 
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -47,7 +47,7 @@
 * Get a logger instance.
 *
 * @param string $channel Logging channel
-* @return \\Psr\\Log\\LoggerInterface Logger instance
+* @return \Psr\Log\LoggerInterface Logger instance
 */
public function getLogger( $channel ) {
if ( !isset( $this->singletons[$channel] ) ) {
diff --git a/includes/debug/logger/LoggerFactory.php 
b/includes/debug/logger/LoggerFactory.php
index 92fbb46..1573d7b 100644
--- a/includes/debug/logger/LoggerFactory.php
+++ b/includes/debug/logger/LoggerFactory.php
@@ -25,7 +25,7 @@
 /**
  * PSR-3 logger instance factory.
  *
- * Creation of \\Psr\\Log\\LoggerInterface instances is managed via the
+ * Creation of \Psr\Log\LoggerInterface instances is managed via the
  * LoggerFactory::getInstance() static method which in turn delegates to the
  * currently registered service provider.
  *
@@ -38,7 +38,7 @@
  * $wgMWLoggerDefaultSpi is expected to be an array usable by
  * ObjectFactory::getObjectFromSpec() to create a class.
  *
- * @see \\MediaWiki\\Logger\\Spi
+ * @see \MediaWiki\Logger\Spi
  * @since 1.25
  * @author Bryan Davis 
  * @copyright © 2014 Bryan Davis and Wikimedia Foundation.
@@ -47,16 +47,16 @@
 
/**
 * Service provider.
-* @var \\MediaWiki\\Logger\\Spi $spi
+* @var \MediaWiki\Logger\Spi $spi
 */
private static $spi;
 
 
/**
-* Register a service provider to create new \\Psr\\Log\\LoggerInterface
+ 

[MediaWiki-commits] [Gerrit] StringUtils: Fixup Doxygen warnings - change (mediawiki/core)

2015-11-23 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: StringUtils: Fixup Doxygen warnings
..

StringUtils: Fixup Doxygen warnings

* Code blocks must be indented by 4 spaces (so 5 in total from the star).

* Code blocks are only supported in descriptions, and for some reason the first
  line is separate from the description, so there must be an additional line of
  text between the summary and the code block since it can't be the first thing
  in a description.

* Fix regex confusion with comment syntax due to "/*\/".

To verify these findings, use:

$ php maintenance/mwdocgen.php --file includes/libs/StringUtils.php

And check the output warnings and generated html pages.

Change-Id: I259b87c0bf3b48a95df0108eb6ee799c25b2853f
---
M includes/libs/StringUtils.php
1 file changed, 24 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/255036/1

diff --git a/includes/libs/StringUtils.php b/includes/libs/StringUtils.php
index 11ae0b2..c56ed07 100644
--- a/includes/libs/StringUtils.php
+++ b/includes/libs/StringUtils.php
@@ -36,16 +36,15 @@
 * true will skip the use of mb_check_encoding, this is mostly intended 
for
 * unit testing our internal implementation.
 *
-* @since 1.21
 * @note In MediaWiki 1.21, this function did not provide proper UTF-8 
validation.
 * In particular, the pure PHP code path did not in fact check for 
overlong forms.
 * Beware of this when backporting code to that version of MediaWiki.
 *
+* @since 1.21
 * @param string $value String to check
 * @param bool $disableMbstring Whether to use the pure PHP
-* implementation instead of trying mb_check_encoding. Intended for unit
-* testing. Default: false
-*
+*  implementation instead of trying mb_check_encoding. Intended for 
unit
+*  testing. Default: false
 * @return bool Whether the given $value is a valid UTF-8 encoded string
 */
static function isUtf8( $value, $disableMbstring = false ) {
@@ -111,21 +110,20 @@
}
 
/**
-* Perform an operation equivalent to
+* Perform an operation equivalent to `preg_replace()`
+*
+* Matches this code:
 *
 * preg_replace( "!$startDelim(.*?)$endDelim!", $replace, $subject 
);
 *
-* except that it's worst-case O(N) instead of O(N^2)
-*
-* Compared to delimiterReplace(), this implementation is fast but 
memory-
-* hungry and inflexible. The memory requirements are such that I don't
-* recommend using it on anything but guaranteed small chunks of text.
+* ..except that it's worst-case O(N) instead of O(N^2). Compared to 
delimiterReplace(), this
+* implementation is fast but memory-hungry and inflexible. The memory 
requirements are such
+* that I don't recommend using it on anything but guaranteed small 
chunks of text.
 *
 * @param string $startDelim
 * @param string $endDelim
 * @param string $replace
 * @param string $subject
-*
 * @return string
 */
static function hungryDelimiterReplace( $startDelim, $endDelim, 
$replace, $subject ) {
@@ -144,18 +142,20 @@
}
 
/**
-* Perform an operation equivalent to
+* Perform an operation equivalent to `preg_replace_callback()`
 *
-*   preg_replace_callback( "!$startDelim(.*)$endDelim!s$flags", 
$callback, $subject )
+* Matches this code:
 *
-* This implementation is slower than hungryDelimiterReplace but uses 
far less
-* memory. The delimiters are literal strings, not regular expressions.
+* preg_replace_callback( "!$startDelim(.*)$endDelim!s$flags", 
$callback, $subject );
 *
 * If the start delimiter ends with an initial substring of the end 
delimiter,
 * e.g. in the case of C-style comments, the behavior differs from the 
model
 * regex. In this implementation, the end must share no characters with 
the
-* start, so e.g. /*\/ is not considered to be both the start and end 
of a
-* comment. /*\/xy/*\/ is considered to be a single comment with 
contents /xy/.
+* start, so e.g. `/*\/` is not considered to be both the start and end 
of a
+* comment. `/*\/xy/*\/` is considered to be a single comment with 
contents `/xy/`.
+*
+* The implementation of delimiterReplaceCallback() is slower than 
hungryDelimiterReplace()
+* but uses far less memory. The delimiters are literal strings, not 
regular expressions.
 *
 * @param string $startDelim Start delimiter
 * @param string $endDelim End delimiter
@@ -241,14 +241,16 @@
}
 

[MediaWiki-commits] [Gerrit] VE: Use MWPreviewElement instead of PreviewElement - change (mediawiki...Citoid)

2015-11-23 Thread Esanders (Code Review)
Esanders has uploaded a new change for review.

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

Change subject: VE: Use MWPreviewElement instead of PreviewElement
..

VE: Use MWPreviewElement instead of PreviewElement

Depends on Ib1bae8cd4c in VE-MW.

Change-Id: I464ecf5a01f92c9bd5a189ab21d164c36800b276
---
M modules/ve.ui.CiteFromIdReferenceWidget.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/ve.ui.CiteFromIdReferenceWidget.js 
b/modules/ve.ui.CiteFromIdReferenceWidget.js
index 122b3b2..a19952e 100644
--- a/modules/ve.ui.CiteFromIdReferenceWidget.js
+++ b/modules/ve.ui.CiteFromIdReferenceWidget.js
@@ -64,7 +64,7 @@
documentModel.getHtmlDocument()
);
node = doc.getDocumentNode().getChildren()[ 0 ];
-   this.preview = new ve.ui.PreviewElement( node );
+   this.preview = new ve.ui.MWPreviewElement( node );
if ( this.preview.isGenerating() ) {
this.preview.once( 'render', this.renderPromise.resolve );
} else {

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

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

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


  1   2   3   4   5   >