[MediaWiki-commits] [Gerrit] mediawiki/core[master]: parserTests: Do not check for DjVu support

2016-09-27 Thread Tim Starling (Code Review)
Tim Starling has uploaded a new change for review.

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

Change subject: parserTests: Do not check for DjVu support
..

parserTests: Do not check for DjVu support

Unnecessary now that we have MockMediaHandlerFactory. Have
MockDjVuHandler::isEnabled() always return true so that we don't have to
hack the configuration. May possibly help the ProofreadPage tests pass
in Jenkins.

Also remove a couple of unnecessary debug log calls.

Change-Id: Ic8aea8fe235b4b5336a7377c4b61379ed06a67ab
---
M tests/parser/ParserTestRunner.php
M tests/phpunit/mocks/media/MockDjVuHandler.php
2 files changed, 4 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/313184/1

diff --git a/tests/parser/ParserTestRunner.php 
b/tests/parser/ParserTestRunner.php
index 369cd0e..374bd0e 100644
--- a/tests/parser/ParserTestRunner.php
+++ b/tests/parser/ParserTestRunner.php
@@ -60,11 +60,6 @@
private $dbClone;
 
/**
-* @var DjVuSupport
-*/
-   private $djVuSupport;
-
-   /**
 * @var TidySupport
 */
private $tidySupport;
@@ -138,7 +133,6 @@
$this->runDisabled = !empty( $options['run-disabled'] );
$this->runParsoid = !empty( $options['run-parsoid'] );
 
-   $this->djVuSupport = new DjVuSupport();
$this->tidySupport = new TidySupport( !empty( 
$options['use-tidy-config'] ) );
if ( !$this->tidySupport->isEnabled() ) {
$this->recorder->warning(
@@ -456,7 +450,6 @@
}
$this->setupDone[$funcName] = true;
return function () use ( $funcName ) {
-   wfDebug( "markSetupDone unmarked $funcName" );
$this->setupDone[$funcName] = false;
};
}
@@ -752,14 +745,6 @@
$user = $context->getUser();
$options = ParserOptions::newFromContext( $context );
 
-   if ( isset( $opts['djvu'] ) ) {
-   if ( !$this->djVuSupport->isEnabled() ) {
-   $this->recorder->skipped( $test,
-   'djvu binaries do not exist or are not 
executable' );
-   return false;
-   }
-   }
-
if ( isset( $opts['tidy'] ) ) {
if ( !$this->tidySupport->isEnabled() ) {
$this->recorder->skipped( $test, 'tidy 
extension is not installed' );
@@ -1028,7 +1013,6 @@
};
 
// Set content language. This invalidates the magic word cache 
and title services
-   wfDebug( "Setting up language $langCode" );
$lang = Language::factory( $langCode );
$setup['wgContLang'] = $lang;
$reset = function () {
diff --git a/tests/phpunit/mocks/media/MockDjVuHandler.php 
b/tests/phpunit/mocks/media/MockDjVuHandler.php
index 018d978..0e0b943 100644
--- a/tests/phpunit/mocks/media/MockDjVuHandler.php
+++ b/tests/phpunit/mocks/media/MockDjVuHandler.php
@@ -22,6 +22,10 @@
  */
 
 class MockDjVuHandler extends DjVuHandler {
+   function isEnabled() {
+   return true;
+   }
+
function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 ) {
if ( !$this->normaliseParams( $image, $params ) ) {
return new TransformParameterError( $params );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8aea8fe235b4b5336a7377c4b61379ed06a67ab
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Tim Starling 

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


[MediaWiki-commits] [Gerrit] mediawiki...GlobalUsage[master]: Remove pointless getGlobalUsage() singleton

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

Change subject: Remove pointless getGlobalUsage() singleton
..


Remove pointless getGlobalUsage() singleton

This only results in connections being tied up as "in use"
in LoadBalancer for no reason, now that DBConnRef is used.

Bug: T146811
Change-Id: If5a96898e11e4ea8f6f6e0c5818e6a5c79673db5
---
M GlobalUsageHooks.php
1 file changed, 1 insertion(+), 7 deletions(-)

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



diff --git a/GlobalUsageHooks.php b/GlobalUsageHooks.php
index 3f85336..3b88380 100644
--- a/GlobalUsageHooks.php
+++ b/GlobalUsageHooks.php
@@ -6,8 +6,6 @@
  */
 
 class GlobalUsageHooks {
-   private static $gu = null;
-
/**
 * Hook to LinksUpdateComplete
 * Deletes old links from usage table and insert new ones.
@@ -184,11 +182,7 @@
 * @return GlobalUsage
 */
private static function getGlobalUsage() {
-   if ( is_null( self::$gu ) ) {
-   self::$gu = new GlobalUsage( wfWikiID(), 
GlobalUsage::getGlobalDB( DB_MASTER ) );
-   }
-
-   return self::$gu;
+   return new GlobalUsage( wfWikiID(), GlobalUsage::getGlobalDB( 
DB_MASTER ) );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If5a96898e11e4ea8f6f6e0c5818e6a5c79673db5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalUsage
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...GlobalUsage[master]: Remove pointless getGlobalUsage() singleton

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

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

Change subject: Remove pointless getGlobalUsage() singleton
..

Remove pointless getGlobalUsage() singleton

This only results in connections being tied up as "in use"
in LoadBalancer for no reason, now that DBConnRef is used.

Bug: T146811
Change-Id: If5a96898e11e4ea8f6f6e0c5818e6a5c79673db5
---
M GlobalUsageHooks.php
1 file changed, 1 insertion(+), 7 deletions(-)


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

diff --git a/GlobalUsageHooks.php b/GlobalUsageHooks.php
index 3f85336..3b88380 100644
--- a/GlobalUsageHooks.php
+++ b/GlobalUsageHooks.php
@@ -6,8 +6,6 @@
  */
 
 class GlobalUsageHooks {
-   private static $gu = null;
-
/**
 * Hook to LinksUpdateComplete
 * Deletes old links from usage table and insert new ones.
@@ -184,11 +182,7 @@
 * @return GlobalUsage
 */
private static function getGlobalUsage() {
-   if ( is_null( self::$gu ) ) {
-   self::$gu = new GlobalUsage( wfWikiID(), 
GlobalUsage::getGlobalDB( DB_MASTER ) );
-   }
-
-   return self::$gu;
+   return new GlobalUsage( wfWikiID(), GlobalUsage::getGlobalDB( 
DB_MASTER ) );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5a96898e11e4ea8f6f6e0c5818e6a5c79673db5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GlobalUsage
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Add query parsing tests for morelike

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

Change subject: Add query parsing tests for morelike
..


Add query parsing tests for morelike

Change-Id: Iaa76166db48aafd9e009b2e4f3c1eb8a00e58f9a
---
M tests/unit/SearcherTest.php
A tests/unit/fixtures/searchText/morelike_001.expected
A tests/unit/fixtures/searchText/morelike_001.query
A tests/unit/fixtures/searchText/morelike_002.expected
A tests/unit/fixtures/searchText/morelike_002.query
A tests/unit/fixtures/searchText/morelike_003.expected
A tests/unit/fixtures/searchText/morelike_003.query
A tests/unit/fixtures/searchText/morelike_004.expected
A tests/unit/fixtures/searchText/morelike_004.query
9 files changed, 496 insertions(+), 0 deletions(-)

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



diff --git a/tests/unit/SearcherTest.php b/tests/unit/SearcherTest.php
index 49d2673..274146a 100644
--- a/tests/unit/SearcherTest.php
+++ b/tests/unit/SearcherTest.php
@@ -64,6 +64,11 @@
] + $GLOBALS['wgHooks']
] );
 
+   // Set a couple pre-defined pages for anything (morelike) that 
needs valid pages
+   $linkCache = MediaWikiServices::getInstance()->getLinkCache();
+   $linkCache->addGoodLinkObj( 12345, Title::newFromText( 'Some 
page' ) );
+   $linkCache->addGoodLinkObj( 23456, Title::newFromText( 'Other 
page' ) );
+
\RequestContext::getMain()->setRequest( new \FauxRequest( [
'cirrusDumpQuery' => 1,
] ) );
diff --git a/tests/unit/fixtures/searchText/morelike_001.expected 
b/tests/unit/fixtures/searchText/morelike_001.expected
new file mode 100644
index 000..0064d44
--- /dev/null
+++ b/tests/unit/fixtures/searchText/morelike_001.expected
@@ -0,0 +1,241 @@
+{
+"description": "more_like search for 'Some page'",
+"path": "wiki\/page\/_search",
+"params": {
+"search_type": "dfs_query_then_fetch",
+"timeout": "20s"
+},
+"query": {
+"_source": [
+"id",
+"title",
+"namespace",
+"redirect.*",
+"timestamp",
+"text_bytes"
+],
+"fields": "text.word_count",
+"query": {
+"bool": {
+"must": [
+{
+"more_like_this": {
+"min_doc_freq": 2,
+"max_doc_freq": null,
+"max_query_terms": 25,
+"min_term_freq": 2,
+"min_word_len": 0,
+"max_word_len": 0,
+"minimum_should_match": "30%",
+"fields": [
+"text"
+],
+"like": [
+{
+"_id": "12345"
+}
+]
+}
+}
+],
+"filter": [
+{
+"terms": {
+"namespace": [
+0,
+1,
+2,
+3
+]
+}
+}
+]
+}
+},
+"highlight": {
+"pre_tags": [
+""
+],
+"post_tags": [
+"<\/span>"
+],
+"fields": {
+"title": {
+"type": "experimental",
+"fragmenter": "none",
+"number_of_fragments": 1,
+"matched_fields": [
+"title",
+"title.plain"
+]
+},
+"redirect.title": {
+"type": "experimental",
+"fragmenter": "none",
+"order": "score",
+"number_of_fragments": 1,
+"options": {
+"skip_if_last_matched": true
+},
+"matched_fields": [
+"redirect.title",
+"redirect.title.plain"
+]
+},
+"category": {
+"type": "experimental",
+"fragmenter": "none",
+"order": "score",
+"number_of_fragments": 1,
+"options": {
+

[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Add AllowedNamespaces configuration variables for hubs and l...

2016-09-27 Thread Isarra (Code Review)
Isarra has uploaded a new change for review.

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

Change subject: Add AllowedNamespaces configuration variables for hubs and lists
..

Add AllowedNamespaces configuration variables for hubs and lists

Users* may want to change the namespaces in which hubs/lists are
allowed in order to fullfill unexpected use cases. We don't care;
we'll just leave it an option.

Separate variables are used for hubs and lists as uses may vary for
each.

Hubs now also specifically check if subpages are allowed for the
namespace in case a user misconfigures their wiki.

Allowed namespaces are set to user (2) and project (4) by default.
Unless that's the other way around. I've forgotten already, but it's
those two.

* All mentions of 'users' here refers to sysadmins with localsettings
access, not onwiki users.

This is a follow-up on initial implementation for T141004.

Change-Id: If70bff87c8324f425d32511d94beaac17017cf41
---
M extension.json
M includes/content/CollaborationHubContentHandler.php
M includes/content/CollaborationListContentHandler.php
3 files changed, 19 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/82/313182/1

diff --git a/extension.json b/extension.json
index dbdfeb3..8637e25 100644
--- a/extension.json
+++ b/extension.json
@@ -33,6 +33,16 @@
"CollaborationHubContent": "CollaborationHubContentHandler",
"CollaborationListContent": "CollaborationListContentHandler"
},
+   "config": {
+   "CollaborationHubAllowedNamespaces": [
+   2,
+   4
+   ],
+   "CollaborationListAllowedNamespaces": [
+   2,
+   4
+   ]
+   },
"SpecialPages": {
"CreateCollaborationHub": "SpecialCreateCollaborationHub",
"CreateHubFeature": "SpecialCreateHubFeature"
diff --git a/includes/content/CollaborationHubContentHandler.php 
b/includes/content/CollaborationHubContentHandler.php
index d6a8e0e..11e8969 100644
--- a/includes/content/CollaborationHubContentHandler.php
+++ b/includes/content/CollaborationHubContentHandler.php
@@ -7,7 +7,12 @@
}
 
public function canBeUsedOn( Title $title ) {
-   if ( $title->inNamespace( NS_PROJECT ) || $title->inNamespace( 
NS_USER ) ) {
+   global $wgCollaborationHubAllowedNamespaces;
+
+   $namespace = $title->getNamespace();
+   if ( in_array( $namespace, $wgCollaborationHubAllowedNamespaces 
)
+   && MWNamespace::hasSubpages( $namespace ) ) {
+
return true;
}
return false;
diff --git a/includes/content/CollaborationListContentHandler.php 
b/includes/content/CollaborationListContentHandler.php
index b10da7c..2fcb69a 100644
--- a/includes/content/CollaborationListContentHandler.php
+++ b/includes/content/CollaborationListContentHandler.php
@@ -20,7 +20,9 @@
}
 
public function canBeUsedOn( Title $title ) {
-   if ( $title->inNamespace( NS_PROJECT ) || $title->inNamespace( 
NS_USER ) ) {
+   global $wgCollaborationListAllowedNamespaces;
+
+   if ( in_array( $title->getNamespace(), 
$wgCollaborationListAllowedNamespaces ) ) {
return true;
}
return false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If70bff87c8324f425d32511d94beaac17017cf41
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Isarra 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid DBPerformance log warnings in SpecialEditWatchlist

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

Change subject: Avoid DBPerformance log warnings in SpecialEditWatchlist
..


Avoid DBPerformance log warnings in SpecialEditWatchlist

Change-Id: I97b31f5e805e9e3e4192d15195ff26ec416ad6b2
---
M includes/specials/SpecialEditWatchlist.php
1 file changed, 17 insertions(+), 16 deletions(-)

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



diff --git a/includes/specials/SpecialEditWatchlist.php 
b/includes/specials/SpecialEditWatchlist.php
index a5a45d5..0defcd1 100644
--- a/includes/specials/SpecialEditWatchlist.php
+++ b/includes/specials/SpecialEditWatchlist.php
@@ -68,8 +68,7 @@
 */
private function initServices() {
if ( !$this->titleParser ) {
-   $lang = $this->getContext()->getLanguage();
-   $this->titleParser = new MediaWikiTitleCodec( $lang, 
GenderCache::singleton() );
+   $this->titleParser = 
MediaWikiServices::getInstance()->getTitleParser();
}
}
 
@@ -205,7 +204,7 @@
}
}
 
-   GenderCache::singleton()->doTitlesArray( $titles );
+   
MediaWikiServices::getInstance()->getGenderCache()->doTitlesArray( $titles );
 
$list = [];
/** @var Title $title */
@@ -355,7 +354,7 @@
}
}
 
-   GenderCache::singleton()->doTitlesArray( $titles );
+   
MediaWikiServices::getInstance()->getGenderCache()->doTitlesArray( $titles );
 
foreach ( $titles as $title ) {
$list[] = $title->getPrefixedText();
@@ -431,20 +430,22 @@
}
 
$user = $this->getUser();
-   $store = 
MediaWikiServices::getInstance()->getWatchedItemStore();
+   $badItems = $this->badItems;
+   DeferredUpdates::addCallableUpdate( function () use ( $user, 
$badItems ) {
+   $store = 
MediaWikiServices::getInstance()->getWatchedItemStore();
+   foreach ( $badItems as $row ) {
+   list( $title, $namespace, $dbKey ) = $row;
+   $action = $title ? 'cleaning up' : 'deleting';
+   wfDebug( "User {$user->getName()} has broken 
watchlist item " .
+   "ns($namespace):$dbKey, $action.\n" );
 
-   foreach ( $this->badItems as $row ) {
-   list( $title, $namespace, $dbKey ) = $row;
-   $action = $title ? 'cleaning up' : 'deleting';
-   wfDebug( "User {$user->getName()} has broken watchlist 
item ns($namespace):$dbKey, $action.\n" );
-
-   $store->removeWatch( $user, new TitleValue( 
(int)$namespace, $dbKey ) );
-
-   // Can't just do an UPDATE instead of DELETE/INSERT due 
to unique index
-   if ( $title ) {
-   $user->addWatch( $title );
+   $store->removeWatch( $user, new TitleValue( 
(int)$namespace, $dbKey ) );
+   // Can't just do an UPDATE instead of 
DELETE/INSERT due to unique index
+   if ( $title ) {
+   $user->addWatch( $title );
+   }
}
-   }
+   } );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I97b31f5e805e9e3e4192d15195ff26ec416ad6b2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix "Incorrect watchlist token provided" unit test errors

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

Change subject: Fix "Incorrect watchlist token provided" unit test errors
..


Fix "Incorrect watchlist token provided" unit test errors

Change-Id: Ib133ffe9b9ef438ff5716ad25a897e2c5a4f7d58
---
M tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php 
b/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php
index 582c076..d6f315d 100644
--- a/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php
+++ b/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php
@@ -477,6 +477,7 @@
new TitleValue( 1, 
'ApiQueryWatchlistRawIntegrationTestPage1' ),
] );
 
+   ObjectCache::getMainWANInstance()->clearProcessCache();
$result = $this->doListWatchlistRawRequest( [
'wrowner' => $otherUser->getName(),
'wrtoken' => '1234567890',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Fix undefined getPrefixedText()

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

Change subject: resourceloader: Fix undefined getPrefixedText()
..


resourceloader: Fix undefined getPrefixedText()

Follows-up dbe592df. Used to go in one-way only and silenced by
addObj(). Now that we're iterating directly as well, need a
conditional.

Bug: T146728
Change-Id: Ief9d44cc5cb8f5d687560f59cc696c5671546163
---
M includes/resourceloader/ResourceLoaderWikiModule.php
1 file changed, 15 insertions(+), 3 deletions(-)

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



diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php 
b/includes/resourceloader/ResourceLoaderWikiModule.php
index 4fdd86e..7cbec70 100644
--- a/includes/resourceloader/ResourceLoaderWikiModule.php
+++ b/includes/resourceloader/ResourceLoaderWikiModule.php
@@ -305,7 +305,11 @@
$titleInfo = [];
$batch = new LinkBatch;
foreach ( $pages as $titleText ) {
-   $batch->addObj( Title::newFromText( $titleText ) );
+   $title = Title::newFromText( $titleText );
+   if ( $title ) {
+   // Page name may be invalid if user-provided 
(e.g. gadgets)
+   $batch->addObj( $title );
+   }
}
if ( !$batch->isEmpty() ) {
$res = $db->select( 'page',
@@ -359,8 +363,16 @@
// Before we intersect, map the names to canonical form 
(T145673).
$intersect = [];
foreach ( $pages as $page => $unused ) {
-   $title = Title::newFromText( $page 
)->getPrefixedText();
-   $intersect[$title] = 1;
+   $title = Title::newFromText( $page );
+   if ( $title ) {
+   $intersect[ $title->getPrefixedText() ] 
= 1;
+   } else {
+   // Page name may be invalid if 
user-provided (e.g. gadgets)
+   $rl->getLogger()->info(
+   'Invalid wiki page title 
"{title}" in ' . __METHOD__,
+   [ 'title' => $page ]
+   );
+   }
}
$info = array_intersect_key( $allInfo, $intersect );
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix "Incorrect watchlist token provided" unit test errors

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

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

Change subject: Fix "Incorrect watchlist token provided" unit test errors
..

Fix "Incorrect watchlist token provided" unit test errors

Change-Id: Ib133ffe9b9ef438ff5716ad25a897e2c5a4f7d58
---
M tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/81/313181/1

diff --git a/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php 
b/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php
index 582c076..d6f315d 100644
--- a/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php
+++ b/tests/phpunit/includes/api/ApiQueryWatchlistRawIntegrationTest.php
@@ -477,6 +477,7 @@
new TitleValue( 1, 
'ApiQueryWatchlistRawIntegrationTestPage1' ),
] );
 
+   ObjectCache::getMainWANInstance()->clearProcessCache();
$result = $this->doListWatchlistRawRequest( [
'wrowner' => $otherUser->getName(),
'wrtoken' => '1234567890',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add @deprecated annotations to NS_IMAGE and NS_IMAGE_TALK

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

Change subject: Add @deprecated annotations to NS_IMAGE and NS_IMAGE_TALK
..


Add @deprecated annotations to NS_IMAGE and NS_IMAGE_TALK

Hopefully this will discourage people from using them in new code.

Change-Id: I165a19406dfc0bcc471252e416480fa3af92d969
---
M includes/Defines.php
M tests/parser/ParserTestRunner.php
2 files changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/includes/Defines.php b/includes/Defines.php
index 529dfb3..02930ea 100644
--- a/includes/Defines.php
+++ b/includes/Defines.php
@@ -77,8 +77,13 @@
  * When writing code that should be compatible with older MediaWiki
  * versions, either stick to the old names or define the new constants
  * yourself, if they're not defined already.
+ *
+ * @deprecated since 1.14
  */
 define( 'NS_IMAGE', NS_FILE );
+/**
+ * @deprecated since 1.14
+ */
 define( 'NS_IMAGE_TALK', NS_FILE_TALK );
 /**@}*/
 
diff --git a/tests/parser/ParserTestRunner.php 
b/tests/parser/ParserTestRunner.php
index 369cd0e..6ca851e 100644
--- a/tests/parser/ParserTestRunner.php
+++ b/tests/parser/ParserTestRunner.php
@@ -1524,7 +1524,7 @@
}
 
// The RepoGroup cache is invalidated by the creation of file 
redirects
-   if ( $title->getNamespace() === NS_IMAGE ) {
+   if ( $title->inNamespace( NS_FILE ) ) {
RepoGroup::singleton()->clearCache( $title );
}
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ActiveAbstract[master]: Don't use NS_IMAGE

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

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

Change subject: Don't use NS_IMAGE
..

Don't use NS_IMAGE

Change-Id: I8d7aa201507bb6c42faaa21b1110b44666b64b1d
---
M AbstractFilter.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/AbstractFilter.php b/AbstractFilter.php
index b433cee..78b2466 100644
--- a/AbstractFilter.php
+++ b/AbstractFilter.php
@@ -133,7 +133,7 @@
 
$text = substr( $text, 0, 4096 ); // don't bother with long 
text...
 
-   $image = preg_quote( $wgContLang->getNsText( NS_IMAGE ), '#' );
+   $image = preg_quote( $wgContLang->getNsText( NS_FILE ), '#' );
$text = str_replace( "'''", "", $text );
$text = str_replace( "''", "", $text );
// HTML-style comments

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Translate[master]: Don't use NS_IMAGE

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

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

Change subject: Don't use NS_IMAGE
..

Don't use NS_IMAGE

Change-Id: I2d3304674c6b49504054aeaba733741088bd9099
---
M tests/phpunit/MessageGroupBaseTest.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/tests/phpunit/MessageGroupBaseTest.php 
b/tests/phpunit/MessageGroupBaseTest.php
index be2dfa5..88ad27e 100644
--- a/tests/phpunit/MessageGroupBaseTest.php
+++ b/tests/phpunit/MessageGroupBaseTest.php
@@ -61,11 +61,11 @@
 
public function testGetNamespaceNumber() {
$conf = $this->groupConfiguration;
-   $conf['BASIC']['namespace'] = NS_IMAGE;
+   $conf['BASIC']['namespace'] = NS_FILE;
$this->group = MessageGroupBase::factory( $conf );
 
$this->assertEquals(
-   NS_IMAGE,
+   NS_FILE,
$this->group->getNamespace(),
'should parse integer namespace number.'
);
@@ -77,7 +77,7 @@
$this->group = MessageGroupBase::factory( $conf );
 
$this->assertEquals(
-   NS_IMAGE,
+   NS_FILE,
$this->group->getNamespace(),
'should parse string namespace name.'
);

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...RandomImage[master]: Don't use NS_IMAGE

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

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

Change subject: Don't use NS_IMAGE
..

Don't use NS_IMAGE

Change-Id: I1eb7195de9513b7517ba25973522338288e9e478
---
M RandomImage.class.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/RandomImage.class.php b/RandomImage.class.php
index 5b60bbd..013c015 100644
--- a/RandomImage.class.php
+++ b/RandomImage.class.php
@@ -170,7 +170,7 @@
$name = count( $this->choices ) > 1
? $this->choices[ array_rand( $this->choices ) ]
: $this->choices[0];
-   return Title::makeTitleSafe( NS_IMAGE, $name );
+   return Title::makeTitleSafe( NS_FILE, $name );
}

/**
@@ -189,7 +189,7 @@
'page_title',
),
array(
-   'page_namespace' => NS_IMAGE,
+   'page_namespace' => NS_FILE,
'page_is_redirect' => 0,
'page_random > ' . $dbr->addQuotes( wfRandom() 
),
) + $conds,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...DynamicPageList[master]: Don't use NS_IMAGE

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

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

Change subject: Don't use NS_IMAGE
..

Don't use NS_IMAGE

Change-Id: I6d28aafd3c961bd88b579490bacb3e9dc6e930e4
---
M DPL.php
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DynamicPageList 
refs/changes/77/313177/1

diff --git a/DPL.php b/DPL.php
index d0fc425..ff1b352 100644
--- a/DPL.php
+++ b/DPL.php
@@ -359,19 +359,20 @@
$article = $this->mArticles[$i];
$pagename = $article->mTitle->getPrefixedText();
$imageUrl = '';
-   if ( $article->mNamespace == 6 ) {
+   if ( $article->mNamespace == NS_FILE ) {
// calculate URL for existing images
-   // $img = 
Image::newFromName($article->mTitle->getText());
-   $img = wfFindFile( Title::makeTitle( NS_IMAGE, 
$article->mTitle->getText() ) );
+   $img = wfFindFile( Title::makeTitle( NS_FILE, 
$article->mTitle->getText() ) );
if ( $img && $img->exists() ) {
$imageUrl = $img->getURL();
$imageUrl = preg_replace( 
'~^.*images/(.*)~', '\1', $imageUrl );
} else {
-   $iTitle = Title::makeTitleSafe( 6, 
$article->mTitle->getDBkey() );
+   $iTitle = Title::makeTitleSafe( 
NS_FILE, $article->mTitle->getDBkey() );
$imageUrl = preg_replace( 
'~^.*images/(.*)~', '\1', RepoGroup::singleton()->getLocalRepo()->newFile( 
$iTitle )->getPath() );
}
}
-   if ( $this->mEscapeLinks && ( $article->mNamespace == 
14 || $article->mNamespace == 6 ) ) {
+   if ( $this->mEscapeLinks && ( $article->mNamespace == 
NS_CATEGORY
+   || $article->mNamespace == NS_FILE
+   ) ) {
// links to categories or images need an 
additional ":"
$pagename = ':' . $pagename;
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[master]: Don't use NS_IMAGE

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

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

Change subject: Don't use NS_IMAGE
..

Don't use NS_IMAGE

Change-Id: Ibf6a9895f8147b33a5fc4c075407ea0521aec86d
---
M ProofreadPage.body.php
M includes/page/ProofreadPagePage.php
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/ProofreadPage.body.php b/ProofreadPage.body.php
index 0df1ad0..8716f08 100644
--- a/ProofreadPage.body.php
+++ b/ProofreadPage.body.php
@@ -146,7 +146,7 @@
if ( !isset( $m[1] ) ) {
return;
}
-   $imageTitle = Title::makeTitleSafe( NS_IMAGE, $m[0] );
+   $imageTitle = Title::makeTitleSafe( NS_FILE, $m[0] );
if ( $imageTitle === null ) {
return;
}
diff --git a/includes/page/ProofreadPagePage.php 
b/includes/page/ProofreadPagePage.php
index f2a2cb3..1d4ad82 100644
--- a/includes/page/ProofreadPagePage.php
+++ b/includes/page/ProofreadPagePage.php
@@ -111,7 +111,7 @@
 
$m = explode( '/', $this->title->getText(), 2 );
if ( isset( $m[1] ) ) {
-   $imageTitle = Title::makeTitleSafe( NS_IMAGE, $m[0] );
+   $imageTitle = Title::makeTitleSafe( NS_FILE, $m[0] );
if ( $imageTitle !== null ) {
$image = wfFindFile( $imageTitle );
// if it is multipage, we use the page order of 
the file

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...WikidataPageBanner[master]: Don't use NS_IMAGE

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

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

Change subject: Don't use NS_IMAGE
..

Don't use NS_IMAGE

Change-Id: I27ba53f1f73e26e10e21cc5500a5768c9feb13cc
---
M includes/WikidataPageBanner.functions.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikidataPageBanner 
refs/changes/75/313175/1

diff --git a/includes/WikidataPageBanner.functions.php 
b/includes/WikidataPageBanner.functions.php
index 8ee93cb..3f2216e 100644
--- a/includes/WikidataPageBanner.functions.php
+++ b/includes/WikidataPageBanner.functions.php
@@ -196,7 +196,7 @@
 */
public static function getImageUrl( $filename, $imagewidth = null ) {
// make title object from image name
-   $title = Title::makeTitleSafe( NS_IMAGE, $filename );
+   $title = Title::makeTitleSafe( NS_FILE, $filename );
$file = wfFindFile( $title );
$options = [
'options' => [ 'min_range' => 0, 'max_range' => 3000 ]

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Nuke[master]: Don't use NS_IMAGE

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

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

Change subject: Don't use NS_IMAGE
..

Don't use NS_IMAGE

Change-Id: Icabf2534963ce2701402f211327f7f39b61735cc
---
M Nuke_body.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Nuke 
refs/changes/74/313174/1

diff --git a/Nuke_body.php b/Nuke_body.php
index bafd758..019653e 100644
--- a/Nuke_body.php
+++ b/Nuke_body.php
@@ -204,7 +204,7 @@
 */
list( $title, $userName ) = $info;
 
-   $image = $title->getNamespace() === NS_IMAGE ? 
wfLocalFile( $title ) : false;
+   $image = $title->inNamespace( NS_FILE ) ? wfLocalFile( 
$title ) : false;
$thumb = $image && $image->exists() ?
$image->transform( [ 'width' => 120, 'height' 
=> 120 ], 0 ) :
false;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ImageMap[master]: Don't use NS_IMAGE

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

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

Change subject: Don't use NS_IMAGE
..

Don't use NS_IMAGE

Change-Id: Ie47300631ce074597ef2ce5cc370fb407f9f440f
---
M ImageMap_body.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/ImageMap_body.php b/ImageMap_body.php
index 225341f..b65bb02 100644
--- a/ImageMap_body.php
+++ b/ImageMap_body.php
@@ -79,7 +79,7 @@
list( $image, $options ) = $bits;
}
$imageTitle = Title::newFromText( $image );
-   if ( !$imageTitle || 
$imageTitle->getNamespace() != NS_IMAGE ) {
+   if ( !$imageTitle || !$imageTitle->inNamespace( 
NS_FILE ) ) {
return self::error( 'imagemap_no_image' 
);
}
if ( wfIsBadImage( $imageTitle->getDBkey(), 
$parser->mTitle ) ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CategoryTree[master]: Don't use NS_IMAGE

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

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

Change subject: Don't use NS_IMAGE
..

Don't use NS_IMAGE

Change-Id: I541a4eb662a6a6814f2031aa4744bdfdffdbf5ca
---
M CategoryTreeFunctions.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/CategoryTreeFunctions.php b/CategoryTreeFunctions.php
index b6f7696..69fb6a3 100644
--- a/CategoryTreeFunctions.php
+++ b/CategoryTreeFunctions.php
@@ -48,7 +48,7 @@
if ( sizeof( $this->mOptions['namespaces'] ) === 1
&& $this->mOptions['namespaces'][0] == 
NS_CATEGORY ) {
$this->mOptions['mode'] = 
CategoryTreeMode::CATEGORIES;
-   } elseif ( !in_array( NS_IMAGE, 
$this->mOptions['namespaces'] ) ) {
+   } elseif ( !in_array( NS_FILE, 
$this->mOptions['namespaces'] ) ) {
$this->mOptions['mode'] = 
CategoryTreeMode::PAGES;
} else {
$this->mOptions['mode'] = CategoryTreeMode::ALL;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add @deprecated annotations to NS_IMAGE and NS_IMAGE_TALK

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

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

Change subject: Add @deprecated annotations to NS_IMAGE and NS_IMAGE_TALK
..

Add @deprecated annotations to NS_IMAGE and NS_IMAGE_TALK

Hopefully this will discourage people from using them in new code.

Change-Id: I165a19406dfc0bcc471252e416480fa3af92d969
---
M includes/Defines.php
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/includes/Defines.php b/includes/Defines.php
index 529dfb3..02930ea 100644
--- a/includes/Defines.php
+++ b/includes/Defines.php
@@ -77,8 +77,13 @@
  * When writing code that should be compatible with older MediaWiki
  * versions, either stick to the old names or define the new constants
  * yourself, if they're not defined already.
+ *
+ * @deprecated since 1.14
  */
 define( 'NS_IMAGE', NS_FILE );
+/**
+ * @deprecated since 1.14
+ */
 define( 'NS_IMAGE_TALK', NS_FILE_TALK );
 /**@}*/
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Set ignore_user_abort( true ) during DB commit for sanity

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

Change subject: Set ignore_user_abort( true ) during DB commit for sanity
..


Set ignore_user_abort( true ) during DB commit for sanity

MediaWiki already does this in preOutputCommit(), but it should
also be in the DB layer.

Change-Id: I3193c236a7823f27938077b372887867aeaf78c5
---
M includes/libs/rdbms/chronologyprotector/ChronologyProtector.php
M includes/libs/rdbms/lbfactory/ILBFactory.php
M includes/libs/rdbms/lbfactory/LBFactory.php
M includes/libs/rdbms/loadbalancer/LoadBalancer.php
4 files changed, 43 insertions(+), 4 deletions(-)

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



diff --git a/includes/libs/rdbms/chronologyprotector/ChronologyProtector.php 
b/includes/libs/rdbms/chronologyprotector/ChronologyProtector.php
index 94a3b6c..1f9aff1 100644
--- a/includes/libs/rdbms/chronologyprotector/ChronologyProtector.php
+++ b/includes/libs/rdbms/chronologyprotector/ChronologyProtector.php
@@ -27,7 +27,7 @@
  * Class for ensuring a consistent ordering of events as seen by the user, 
despite replication.
  * Kind of like Hawking's [[Chronology Protection Agency]].
  */
-class ChronologyProtector implements LoggerAwareInterface{
+class ChronologyProtector implements LoggerAwareInterface {
/** @var BagOStuff */
protected $store;
/** @var LoggerInterface */
diff --git a/includes/libs/rdbms/lbfactory/ILBFactory.php 
b/includes/libs/rdbms/lbfactory/ILBFactory.php
index d7ca7cd..9c9f18d 100644
--- a/includes/libs/rdbms/lbfactory/ILBFactory.php
+++ b/includes/libs/rdbms/lbfactory/ILBFactory.php
@@ -136,9 +136,9 @@
public function flushReplicaSnapshots( $fname = __METHOD__ );
 
/**
-* Commit on all connections. Done for two reasons:
-* 1. To commit changes to the masters.
-* 2. To release the snapshot on all connections, master and replica DB.
+* Commit open transactions on all connections. This is useful for two 
main cases:
+*   - a) To commit changes to the masters.
+*   - b) To release the snapshot on all connections, master and 
replica DBs.
 * @param string $fname Caller name
 * @param array $options Options map:
 *   - maxWriteDuration: abort if more than this much time was spent in 
write queries
diff --git a/includes/libs/rdbms/lbfactory/LBFactory.php 
b/includes/libs/rdbms/lbfactory/LBFactory.php
index 85194bc..0635d04 100644
--- a/includes/libs/rdbms/lbfactory/LBFactory.php
+++ b/includes/libs/rdbms/lbfactory/LBFactory.php
@@ -178,6 +178,8 @@
"$fname: transaction round 
'{$this->trxRoundId}' still running."
);
}
+   /** @noinspection PhpUnusedLocalVariableInspection */
+   $scope = $this->getScopedPHPBehaviorForCommit(); // try to 
ignore client aborts
// Run pre-commit callbacks and suppress post-commit callbacks, 
aborting on failure
$this->forEachLBCallMethod( 'finalizeMasterChanges' );
$this->trxRoundId = false;
@@ -516,6 +518,23 @@
$this->requestInfo = $info + $this->requestInfo;
}
 
+   /**
+* Make PHP ignore user aborts/disconnects until the returned
+* value leaves scope. This returns null and does nothing in CLI mode.
+*
+* @return ScopedCallback|null
+*/
+   final protected function getScopedPHPBehaviorForCommit() {
+   if ( PHP_SAPI != 'cli' ) { // 
http://bugs.php.net/bug.php?id=47540
+   $old = ignore_user_abort( true ); // avoid 
half-finished operations
+   return new ScopedCallback( function () use ( $old ) {
+   ignore_user_abort( $old );
+   } );
+   }
+
+   return null;
+   }
+
function __destruct() {
$this->destroy();
}
diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php 
b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
index 36e4c6c6..7ad275a 100644
--- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php
+++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php
@@ -1101,6 +1101,9 @@
public function commitMasterChanges( $fname = __METHOD__ ) {
$failures = [];
 
+   /** @noinspection PhpUnusedLocalVariableInspection */
+   $scope = $this->getScopedPHPBehaviorForCommit(); // try to 
ignore client aborts
+
$restore = ( $this->trxRoundId !== false );
$this->trxRoundId = false;
$this->forEachOpenMasterConnection(
@@ -1516,6 +1519,23 @@
} );
}
 
+   /**
+* Make PHP ignore user aborts/disconnects until the returned
+* value leaves scope. This returns null and does nothing in CLI mode.
+*
+* 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use getConnectionRef in WatchedItemStore

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

Change subject: Use getConnectionRef in WatchedItemStore
..


Use getConnectionRef in WatchedItemStore

Change-Id: Ica6fce8aeec08ace34cd23d3bb0390a859175e71
---
M includes/WatchedItemStore.php
M tests/phpunit/includes/WatchedItemStoreUnitTest.php
2 files changed, 20 insertions(+), 49 deletions(-)

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



diff --git a/includes/WatchedItemStore.php b/includes/WatchedItemStore.php
index 478cc5f..90d45ce 100644
--- a/includes/WatchedItemStore.php
+++ b/includes/WatchedItemStore.php
@@ -192,20 +192,11 @@
/**
 * @param int $dbIndex DB_MASTER or DB_REPLICA
 *
-* @return DatabaseBase
+* @return IDatabase
 * @throws MWException
 */
-   private function getConnection( $dbIndex ) {
-   return $this->loadBalancer->getConnection( $dbIndex, [ 
'watchlist' ] );
-   }
-
-   /**
-* @param Database $connection
-*
-* @throws MWException
-*/
-   private function reuseConnection( $connection ) {
-   $this->loadBalancer->reuseConnection( $connection );
+   private function getConnectionRef( $dbIndex ) {
+   return $this->loadBalancer->getConnectionRef( $dbIndex, [ 
'watchlist' ] );
}
 
/**
@@ -217,7 +208,7 @@
 * @return int
 */
public function countWatchedItems( User $user ) {
-   $dbr = $this->getConnection( DB_REPLICA );
+   $dbr = $this->getConnectionRef( DB_REPLICA );
$return = (int)$dbr->selectField(
'watchlist',
'COUNT(*)',
@@ -226,7 +217,6 @@
],
__METHOD__
);
-   $this->reuseConnection( $dbr );
 
return $return;
}
@@ -237,7 +227,7 @@
 * @return int
 */
public function countWatchers( LinkTarget $target ) {
-   $dbr = $this->getConnection( DB_REPLICA );
+   $dbr = $this->getConnectionRef( DB_REPLICA );
$return = (int)$dbr->selectField(
'watchlist',
'COUNT(*)',
@@ -247,7 +237,6 @@
],
__METHOD__
);
-   $this->reuseConnection( $dbr );
 
return $return;
}
@@ -263,7 +252,7 @@
 * @throws MWException
 */
public function countVisitingWatchers( LinkTarget $target, $threshold ) 
{
-   $dbr = $this->getConnection( DB_REPLICA );
+   $dbr = $this->getConnectionRef( DB_REPLICA );
$visitingWatchers = (int)$dbr->selectField(
'watchlist',
'COUNT(*)',
@@ -276,7 +265,6 @@
],
__METHOD__
);
-   $this->reuseConnection( $dbr );
 
return $visitingWatchers;
}
@@ -293,7 +281,7 @@
public function countWatchersMultiple( array $targets, array $options = 
[] ) {
$dbOptions = [ 'GROUP BY' => [ 'wl_namespace', 'wl_title' ] ];
 
-   $dbr = $this->getConnection( DB_REPLICA );
+   $dbr = $this->getConnectionRef( DB_REPLICA );
 
if ( array_key_exists( 'minimumWatchers', $options ) ) {
$dbOptions['HAVING'] = 'COUNT(*) >= ' . 
(int)$options['minimumWatchers'];
@@ -307,8 +295,6 @@
__METHOD__,
$dbOptions
);
-
-   $this->reuseConnection( $dbr );
 
$watchCounts = [];
foreach ( $targets as $linkTarget ) {
@@ -341,7 +327,7 @@
array $targetsWithVisitThresholds,
$minimumWatchers = null
) {
-   $dbr = $this->getConnection( DB_REPLICA );
+   $dbr = $this->getConnectionRef( DB_REPLICA );
 
$conds = $this->getVisitingWatchersCondition( $dbr, 
$targetsWithVisitThresholds );
 
@@ -356,8 +342,6 @@
__METHOD__,
$dbOptions
);
-
-   $this->reuseConnection( $dbr );
 
$watcherCounts = [];
foreach ( $targetsWithVisitThresholds as list( $target ) ) {
@@ -452,14 +436,13 @@
return false;
}
 
-   $dbr = $this->getConnection( DB_REPLICA );
+   $dbr = $this->getConnectionRef( DB_REPLICA );
$row = $dbr->selectRow(
'watchlist',
'wl_notificationtimestamp',
$this->dbCond( $user, $target ),
__METHOD__
);
-   $this->reuseConnection( $dbr 

[MediaWiki-commits] [Gerrit] mediawiki...GlobalUsage[master]: Use getConnectionRef() to handle missing reuseConnection() c...

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

Change subject: Use getConnectionRef() to handle missing reuseConnection() calls
..


Use getConnectionRef() to handle missing reuseConnection() calls

Bug: T146811
Change-Id: I120158aee3839fa15ed0e6d39ac00a102e35377c
---
M GlobalUsageCachePurgeJob.php
M GlobalUsageHooks.php
M GlobalUsageQuery.php
M GlobalUsage_body.php
M SpecialMostGloballyLinkedFiles.php
M refreshGlobalimagelinks.php
6 files changed, 36 insertions(+), 25 deletions(-)

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



diff --git a/GlobalUsageCachePurgeJob.php b/GlobalUsageCachePurgeJob.php
index 29967a5..dfcc8a4 100644
--- a/GlobalUsageCachePurgeJob.php
+++ b/GlobalUsageCachePurgeJob.php
@@ -11,8 +11,6 @@
}
 
function run() {
-   global $wgGlobalUsageDatabase;
-
$title = $this->getTitle();
if ( !$title->inNamespace( NS_FILE ) ) {
return true; // umm, OK
@@ -33,11 +31,11 @@
$filesForPurge = array_values( array_unique( $filesForPurge ) );
 
// Find all wikis that use any of these files in any of their 
pages...
-   $dbr = wfGetDB( DB_SLAVE, array(), $wgGlobalUsageDatabase );
+   $dbr = GlobalUsage::getGlobalDB( DB_REPLICA );
$res = $dbr->select(
'globalimagelinks',
array( 'gil_wiki', 'gil_to' ),
-   array( 'gil_to' => $filesForPurge, 'gil_wiki != ' . 
$dbr->addQuotes( wfWikiId() ) ),
+   array( 'gil_to' => $filesForPurge, 'gil_wiki != ' . 
$dbr->addQuotes( wfWikiID() ) ),
__METHOD__,
array( 'DISTINCT' )
);
diff --git a/GlobalUsageHooks.php b/GlobalUsageHooks.php
index b1363de..3f85336 100644
--- a/GlobalUsageHooks.php
+++ b/GlobalUsageHooks.php
@@ -184,11 +184,8 @@
 * @return GlobalUsage
 */
private static function getGlobalUsage() {
-   global $wgGlobalUsageDatabase;
if ( is_null( self::$gu ) ) {
-   self::$gu = new GlobalUsage( wfWikiId(),
-   wfGetDB( DB_MASTER, array(), 
$wgGlobalUsageDatabase )
-   );
+   self::$gu = new GlobalUsage( wfWikiID(), 
GlobalUsage::getGlobalDB( DB_MASTER ) );
}
 
return self::$gu;
diff --git a/GlobalUsageQuery.php b/GlobalUsageQuery.php
index 26cafc2..55820c1 100644
--- a/GlobalUsageQuery.php
+++ b/GlobalUsageQuery.php
@@ -23,8 +23,7 @@
 * If a title, can be a category or a file
 */
public function __construct( $target ) {
-   global $wgGlobalUsageDatabase;
-   $this->db = wfGetDB( DB_SLAVE, array(), $wgGlobalUsageDatabase 
);
+   $this->db = GlobalUsage::getGlobalDB( DB_REPLICA );
if ( $target instanceof Title ) {
$this->target = $target;
} elseif ( is_array( $target ) ) {
diff --git a/GlobalUsage_body.php b/GlobalUsage_body.php
index 49f6229..808264b 100644
--- a/GlobalUsage_body.php
+++ b/GlobalUsage_body.php
@@ -6,7 +6,7 @@
private $interwiki;
 
/**
-* @var DatabaseBase
+* @var IDatabase
 */
private $db;
 
@@ -14,9 +14,9 @@
 * Construct a GlobalUsage instance for a certain wiki.
 *
 * @param $interwiki string Interwiki prefix of the wiki
-* @param $db mixed Database object
+* @param $db IDatabase Database object
 */
-   public function __construct( $interwiki, $db ) {
+   public function __construct( $interwiki, IDatabase $db ) {
$this->interwiki = $interwiki;
$this->db = $db;
}
@@ -237,7 +237,8 @@
 * Adding a utility method here, as this same query is used in
 * two different special page classes.
 *
-* @return Array Query info array, as a QueryPage would expect.
+* @param string|bool $wiki
+* @return array Query info array, as a QueryPage would expect.
 */
public static function getWantedFilesQueryInfo( $wiki = false ) {
$qi = array(
@@ -284,4 +285,18 @@
 
return $qi;
}
+
+   /**
+* @param integer $index DB_MASTER/DB_REPLICA
+* @param array $groups
+* @return IDatabase
+*/
+   public static function getGlobalDB( $index, $groups = [] ) {
+   global $wgGlobalUsageDatabase;
+
+   $lbFactory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+   $lb = $lbFactory->getMainLB( $wgGlobalUsageDatabase );
+
+   return $lb->getConnectionRef( $index, [], 
$wgGlobalUsageDatabase );
+   }
 }
diff --git 

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Add method to compare elements and their annotations

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

Change subject: Add method to compare elements and their annotations
..


Add method to compare elements and their annotations

Change-Id: Iaf11d16a01b0f8def516015126f425608065fc3f
---
M src/ce/ve.ce.Surface.js
M src/dm/lineardata/ve.dm.ElementLinearData.js
M tests/dm/lineardata/ve.dm.ElementLinearData.test.js
3 files changed, 45 insertions(+), 5 deletions(-)

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



diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index 6e1167b..c52a197 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -2142,7 +2142,7 @@
left = 0;
while (
context.getLength() &&
-   ve.dm.ElementLinearData.static.compareElements(
+   
ve.dm.ElementLinearData.static.compareElementsUnannotated(
data.getData( left ),
data.isElementData( left ) ? 
context.getData( 0 ) : beforePasteData.leftText
)
@@ -2156,7 +2156,7 @@
while (
right > 0 &&
context.getLength() &&
-   ve.dm.ElementLinearData.static.compareElements(
+   
ve.dm.ElementLinearData.static.compareElementsUnannotated(
data.getData( right - 1 ),
data.isElementData( right - 1 ) ? 
context.getData( context.getLength() - 1 ) : beforePasteData.rightText
)
diff --git a/src/dm/lineardata/ve.dm.ElementLinearData.js 
b/src/dm/lineardata/ve.dm.ElementLinearData.js
index 58f300c..4485d41 100644
--- a/src/dm/lineardata/ve.dm.ElementLinearData.js
+++ b/src/dm/lineardata/ve.dm.ElementLinearData.js
@@ -46,7 +46,7 @@
  * @param {Object|Array|string} b Second element
  * @return {boolean} Elements are comparable
  */
-ve.dm.ElementLinearData.static.compareElements = function ( a, b ) {
+ve.dm.ElementLinearData.static.compareElementsUnannotated = function ( a, b ) {
var aPlain = a,
bPlain = b;
 
@@ -75,6 +75,46 @@
return ve.compare( aPlain, bPlain );
 };
 
+/**
+ * Compare two elements' basic properties and annotations
+ *
+ * Elements are comparable if they have the same type, attributes,
+ * text data and annotations, as determined by
+ * ve.dm.AnnotationSet#compareTo .
+ *
+ * @param {Object|Array|string} a First element
+ * @param {Object|Array|string} b Second element
+ * @param {ve.dm.IndexValueStore} aStore First element's store
+ * @param {ve.dm.IndexValueStore} [bStore] Second element's store, if different
+ * @return {boolean} Elements are comparable
+ */
+ve.dm.ElementLinearData.static.compareElements = function ( a, b, aStore, 
bStore ) {
+   var aSet, bSet, aAnnotations, bAnnotations;
+
+   bStore = bStore || aStore;
+
+   if ( !this.compareElementsUnannotated( a, b ) ) {
+   return false;
+   }
+   if ( Array.isArray( a ) ) {
+   aAnnotations = a[ 1 ];
+   }
+   if ( Array.isArray( b ) ) {
+   bAnnotations = b[ 1 ];
+   }
+   if ( a && a.type ) {
+   aAnnotations = a.annotations;
+   }
+   if ( b && b.type ) {
+   bAnnotations = b.annotations;
+   }
+
+   aSet = new ve.dm.AnnotationSet( aStore, aAnnotations || [] );
+   bSet = new ve.dm.AnnotationSet( bStore, bAnnotations || [] );
+
+   return aSet.compareTo( bSet );
+};
+
 /* Methods */
 
 /**
diff --git a/tests/dm/lineardata/ve.dm.ElementLinearData.test.js 
b/tests/dm/lineardata/ve.dm.ElementLinearData.test.js
index ad738b2..e65456a 100644
--- a/tests/dm/lineardata/ve.dm.ElementLinearData.test.js
+++ b/tests/dm/lineardata/ve.dm.ElementLinearData.test.js
@@ -1927,7 +1927,7 @@
 
 } );
 
-QUnit.test( 'compareElements', function ( assert ) {
+QUnit.test( 'compareElementsUnannotated', function ( assert ) {
var i,
cases = [
{
@@ -1995,7 +1995,7 @@
QUnit.expect( cases.length );
for ( i = 0; i < cases.length; i++ ) {
assert.equal(
-   ve.dm.ElementLinearData.static.compareElements( cases[ 
i ].a, cases[ i ].b ),
+   
ve.dm.ElementLinearData.static.compareElementsUnannotated( cases[ i ].a, cases[ 
i ].b ),
cases[ i ].comparison,
cases[ i ].msg
);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaf11d16a01b0f8def516015126f425608065fc3f

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix call to EntityRevisionLookup::getEntityRevision in Prope...

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

Change subject: Fix call to EntityRevisionLookup::getEntityRevision in 
PropertyDataTypeChanger
..


Fix call to EntityRevisionLookup::getEntityRevision in PropertyDataTypeChanger

Bug: T146833
Change-Id: Ia39fd7fca194d742ad88355f3bb38bc1feb61861
---
M repo/includes/PropertyDataTypeChanger.php
M repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
2 files changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/repo/includes/PropertyDataTypeChanger.php 
b/repo/includes/PropertyDataTypeChanger.php
index 4992501..e26ef38 100644
--- a/repo/includes/PropertyDataTypeChanger.php
+++ b/repo/includes/PropertyDataTypeChanger.php
@@ -63,6 +63,7 @@
public function changeDataType( PropertyId $propertyId, User $user, 
$dataTypeId ) {
$entityRevision = 
$this->entityRevisionLookup->getEntityRevision(
$propertyId,
+   0,
EntityRevisionLookup::LATEST_FROM_MASTER
);
 
diff --git a/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php 
b/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
index 0849b7c..a3531e7 100644
--- a/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
+++ b/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
@@ -104,6 +104,11 @@
 
$entityRevisionLookup->expects( $this->once() )
->method( 'getEntityRevision' )
+   ->with(
+   $this->isInstanceOf( PropertyId::class ),
+   0,
+   EntityRevisionLookup::LATEST_FROM_MASTER
+   )
->will( $this->returnCallback( function( PropertyId 
$propertyId ) {
if ( $propertyId->getSerialization() === 'P42' 
) {
$property = new Property(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia39fd7fca194d742ad88355f3bb38bc1feb61861
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: registration: Improve license-name validation

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

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

Change subject: registration: Improve license-name validation
..

registration: Improve license-name validation

Our hardcoded enum list in the extension.json schema for license-name
values was incomplete and did not cover the full SPDX license identifier
specification, which includes things like "AND" for specifying multiple
licenses.

Composer already has solid code in a library to do this validation, so
let's use it! This updates both the validateRegistrationFile.php and
ExtensionJsonValidationTest.php to use the composer/spdx-licenses
library (a new development dependency) to ensure the license-name field
is a valid SPDX identifier.

Also fix a silly typo in the validateRegistrationFile script which
prevented it from running, and use ::class so it will be easier to
detect typos like that in the future.

Bug: T146862
Change-Id: Ibb8973ed7950ae81c90558f9630f73746b2aff2c
---
M composer.json
M docs/extension.schema.json
M docs/extension.schema.v1.json
M maintenance/validateRegistrationFile.php
M tests/phpunit/structure/ExtensionJsonValidationTest.php
5 files changed, 43 insertions(+), 442 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/70/313170/1

diff --git a/composer.json b/composer.json
index eedaa4e..9424a73b 100644
--- a/composer.json
+++ b/composer.json
@@ -44,6 +44,7 @@
"zordius/lightncandy": "0.23"
},
"require-dev": {
+   "composer/spdx-licenses": "1.1.4",
"jakub-onderka/php-parallel-lint": "0.9.2",
"justinrainbow/json-schema": "~3.0",
"mediawiki/mediawiki-codesniffer": "0.7.2",
diff --git a/docs/extension.schema.json b/docs/extension.schema.json
index 384bfb4..84a404a 100644
--- a/docs/extension.schema.json
+++ b/docs/extension.schema.json
@@ -51,224 +51,7 @@
},
"license-name": {
"type": "string",
-   "description": "Short identifier for the license under 
which the extension is released.",
-   "enum": [
-   "AFL-1.1",
-   "AFL-1.2",
-   "AFL-2.0",
-   "AFL-2.1",
-   "AFL-3.0",
-   "APL-1.0",
-   "Aladdin",
-   "ANTLR-PD",
-   "Apache-1.0",
-   "Apache-1.1",
-   "Apache-2.0",
-   "APSL-1.0",
-   "APSL-1.1",
-   "APSL-1.2",
-   "APSL-2.0",
-   "Artistic-1.0",
-   "Artistic-1.0-cl8",
-   "Artistic-1.0-Perl",
-   "Artistic-2.0",
-   "AAL",
-   "BitTorrent-1.0",
-   "BitTorrent-1.1",
-   "BSL-1.0",
-   "BSD-2-Clause",
-   "BSD-2-Clause-FreeBSD",
-   "BSD-2-Clause-NetBSD",
-   "BSD-3-Clause",
-   "BSD-3-Clause-Clear",
-   "BSD-4-Clause",
-   "BSD-4-Clause-UC",
-   "CECILL-1.0",
-   "CECILL-1.1",
-   "CECILL-2.0",
-   "CECILL-B",
-   "CECILL-C",
-   "ClArtistic",
-   "CNRI-Python",
-   "CNRI-Python-GPL-Compatible",
-   "CPOL-1.02",
-   "CDDL-1.0",
-   "CDDL-1.1",
-   "CPAL-1.0",
-   "CPL-1.0",
-   "CATOSL-1.1",
-   "Condor-1.1",
-   "CC-BY-1.0",
-   "CC-BY-2.0",
-   "CC-BY-2.5",
-   "CC-BY-3.0",
-   "CC-BY-ND-1.0",
-   "CC-BY-ND-2.0",
-   "CC-BY-ND-2.5",
-   "CC-BY-ND-3.0",
-   "CC-BY-NC-1.0",
-   "CC-BY-NC-2.0",
-   "CC-BY-NC-2.5",
-   "CC-BY-NC-3.0",
-   "CC-BY-NC-ND-1.0",
-   "CC-BY-NC-ND-2.0",
-   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove full form of ChangeTags::buildTagFilterSelector

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

Change subject: Remove full form of ChangeTags::buildTagFilterSelector
..


Remove full form of ChangeTags::buildTagFilterSelector

This removes the full form option of ChangeTags::buildTagFilterSelector
since it is completely unused, either in core or extensions.
OOUI for tag selectors aren't implemented yet so the change in signature
shouldn't affect anything.

Change-Id: Ie97b77244b6a9596b53b562b71009686932cf97e
---
M includes/changetags/ChangeTags.php
1 file changed, 4 insertions(+), 27 deletions(-)

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



diff --git a/includes/changetags/ChangeTags.php 
b/includes/changetags/ChangeTags.php
index 6455a3a..15911bd 100644
--- a/includes/changetags/ChangeTags.php
+++ b/includes/changetags/ChangeTags.php
@@ -656,21 +656,15 @@
 * Build a text box to select a change tag
 *
 * @param string $selected Tag to select by default
-* @param bool $fullForm Affects return value, see below
-* @param Title $title Title object to send the form to. Used only if 
$fullForm is true.
 * @param bool $ooui Use an OOUI TextInputWidget as selector instead of 
a non-OOUI input field
 *You need to call OutputPage::enableOOUI() yourself.
-* @return string|array
-*- if $fullForm is false: an array of (label, selector).
-*- if $fullForm is true: HTML of entire form built around the 
selector.
+* @return array an array of (label, selector)
 */
-   public static function buildTagFilterSelector( $selected = '',
-   $fullForm = false, Title $title = null, $ooui = false
-   ) {
+   public static function buildTagFilterSelector( $selected = '', $ooui = 
false ) {
global $wgUseTagFilter;
 
if ( !$wgUseTagFilter || !count( self::listDefinedTags() ) ) {
-   return $fullForm ? '' : [];
+   return [];
}
 
$data = [
@@ -697,24 +691,7 @@
);
}
 
-   if ( !$fullForm ) {
-   return $data;
-   }
-
-   $html = implode( '', $data );
-   $html .= "\n" .
-   Xml::element(
-   'input',
-   [ 'type' => 'submit', 'value' => wfMessage( 
'tag-filter-submit' )->text() ]
-   );
-   $html .= "\n" . Html::hidden( 'title', 
$title->getPrefixedText() );
-   $html = Xml::tags(
-   'form',
-   [ 'action' => $title->getLocalURL(), 'class' => 
'mw-tagfilter-form', 'method' => 'get' ],
-   $html
-   );
-
-   return $html;
+   return $data;
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie97b77244b6a9596b53b562b71009686932cf97e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cenarium 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: TTO 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Create ChangeTagsUpdate hook

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

Change subject: Create ChangeTagsUpdate hook
..


Create ChangeTagsUpdate hook

This creates a hook triggered when updating change tags, so that
extensions can take actions when tags are updated.
When tagging accompanies the action, the recent change is passed
while when tagging is subsequent to the action, the user who
performs the tagging is passed.

Bug: T118698
Change-Id: Ifb0cdc43252c4185e4f216d23b8a21fb31595a37
---
M docs/hooks.txt
M includes/changes/RecentChange.php
M includes/changetags/ChangeTags.php
3 files changed, 28 insertions(+), 7 deletions(-)

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



diff --git a/docs/hooks.txt b/docs/hooks.txt
index 2bfeb66..2dc1270 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -1019,6 +1019,18 @@
 uses are in active use.
 &$tags: list of all active tags. Append to this array.
 
+'ChangeTagsAfterUpdateTags': Called after tags have been updated with the
+ChangeTags::updateTags function. Params:
+$addedTags: tags effectively added in the update
+$removedTags: tags effectively removed in the update
+$prevTags: tags that were present prior to the update
+$rc_id: recentchanges table id
+$rev_id: revision table id
+$log_id: logging table id
+$params: tag params
+$rc: RecentChange being tagged when the tagging accompanies the action or null
+$user: User who performed the tagging when the tagging is subsequent to the 
action or null
+
 'Collation::factory': Called if $wgCategoryCollation is an unknown collation.
 $collationName: Name of the collation in question
 &$collationObject: Null. Replace with a subclass of the Collation class that
diff --git a/includes/changes/RecentChange.php 
b/includes/changes/RecentChange.php
index 7ae1f29..ec915f0 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -333,7 +333,7 @@
 
if ( count( $this->tags ) ) {
ChangeTags::addTags( $this->tags, 
$this->mAttribs['rc_id'],
-   $this->mAttribs['rc_this_oldid'], 
$this->mAttribs['rc_logid'], null );
+   $this->mAttribs['rc_this_oldid'], 
$this->mAttribs['rc_logid'], null, $this );
}
 
# Notify external application via UDP
diff --git a/includes/changetags/ChangeTags.php 
b/includes/changetags/ChangeTags.php
index 955e972..42f0eac 100644
--- a/includes/changetags/ChangeTags.php
+++ b/includes/changetags/ChangeTags.php
@@ -124,14 +124,16 @@
 * @param int|null $rev_id The rev_id of the change to add the tags to
 * @param int|null $log_id The log_id of the change to add the tags to
 * @param string $params Params to put in the ct_params field of table 
'change_tag'
+* @param RecentChange|null $rc Recent change, in case the tagging 
accompanies the action
+* (this should normally be the case)
 *
 * @throws MWException
 * @return bool False if no changes are made, otherwise true
 */
public static function addTags( $tags, $rc_id = null, $rev_id = null,
-   $log_id = null, $params = null
+   $log_id = null, $params = null, RecentChange $rc = null
) {
-   $result = self::updateTags( $tags, null, $rc_id, $rev_id, 
$log_id, $params );
+   $result = self::updateTags( $tags, null, $rc_id, $rev_id, 
$log_id, $params, $rc );
return (bool)$result[0];
}
 
@@ -154,6 +156,9 @@
 * Pass a variable whose value is null if the log_id is not relevant or 
unknown.
 * @param string $params Params to put in the ct_params field of table
 * 'change_tag' when adding tags
+* @param RecentChange|null $rc Recent change being tagged, in case the 
tagging accompanies
+* the action
+* @param User|null $user Tagging user, in case the tagging is 
subsequent to the tagged action
 *
 * @throws MWException When $rc_id, $rev_id and $log_id are all null
 * @return array Index 0 is an array of tags actually added, index 1 is 
an
@@ -162,9 +167,9 @@
 *
 * @since 1.25
 */
-   public static function updateTags(
-   $tagsToAdd, $tagsToRemove,
-   &$rc_id = null, &$rev_id = null, &$log_id = null, $params = null
+   public static function updateTags( $tagsToAdd, $tagsToRemove, &$rc_id = 
null,
+   &$rev_id = null, &$log_id = null, $params = null, RecentChange 
$rc = null,
+   User $user = null
) {
 
$tagsToAdd = array_filter( (array)$tagsToAdd ); // Make sure 
we're submitting all tags...
@@ -284,6 +289,10 @@
}
 
self::purgeTagUsageCache();
+
+   Hooks::run( 'ChangeTagsAfterUpdateTags', [ $tagsToAdd, 
$tagsToRemove, $prevTags,
+   

[MediaWiki-commits] [Gerrit] wikimedia...tools[deploy]: Merge branch 'master' of https://gerrit.wikimedia.org/r/wiki...

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

Change subject: Merge branch 'master' of 
https://gerrit.wikimedia.org/r/wikimedia/fundraising/tools into deploy
..


Merge branch 'master' of 
https://gerrit.wikimedia.org/r/wikimedia/fundraising/tools into deploy

+ 75b422a9d9fc882f30f808789873b9905be2ceb2 Flesh out required modules for all 
projects in this repo
+ 6f6415913d297dca61cfeeb85982039a0bcc578d [deploy with crm code] Rely on 
CiviCRM address rather than contribution tracking language.

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

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9e818ca90a62d94601665422c002e47b3b80d434
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: deploy
Gerrit-Owner: Eileen 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Use RecentChange::addTags rather than ChangeTags::addTags

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

Change subject: Use RecentChange::addTags rather than ChangeTags::addTags
..


Use RecentChange::addTags rather than ChangeTags::addTags

To avoid consecutive DB writes on changetag table.
See I8df2fd983c12632337e8d2922fa357808482338c

Change-Id: Id168581956001902f1c02727a6692f5d65b262e9
---
M AbuseFilter.hooks.php
1 file changed, 2 insertions(+), 10 deletions(-)

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



diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php
index c162a7d..a347250 100644
--- a/AbuseFilter.hooks.php
+++ b/AbuseFilter.hooks.php
@@ -466,16 +466,8 @@
$title->getPrefixedText(), 
$recentChange->mAttribs['rc_user_text'], $action
) );
 
-   if ( !empty( AbuseFilter::$tagsToSet[$actionID] ) ) {
-   $tags = AbuseFilter::$tagsToSet[$actionID];
-   if ( count( $tags ) ) {
-   ChangeTags::addTags(
-   $tags,
-   $recentChange->mAttribs['rc_id'],
-   
$recentChange->mAttribs['rc_this_oldid'],
-   $recentChange->mAttribs['rc_logid']
-   );
-   }
+   if ( isset( AbuseFilter::$tagsToSet[$actionID] ) ) {
+   $recentChange->addTags( 
AbuseFilter::$tagsToSet[$actionID] );
}
 
return true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id168581956001902f1c02727a6692f5d65b262e9
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Cenarium 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Cenarium 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...TorBlock[master]: Use RecentChange::addTags rather than ChangeTags::addTags

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

Change subject: Use RecentChange::addTags rather than ChangeTags::addTags
..


Use RecentChange::addTags rather than ChangeTags::addTags

To avoid consecutive DB writes on changetag table.
See I8df2fd983c12632337e8d2922fa357808482338c

Change-Id: Ibf70e570ce360cc62a8acd857438bf143d359d61
---
M includes/TorBlockHooks.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/TorBlockHooks.php b/includes/TorBlockHooks.php
index 71421c4..ee1719e 100644
--- a/includes/TorBlockHooks.php
+++ b/includes/TorBlockHooks.php
@@ -250,7 +250,7 @@
global $wgTorTagChanges;
 
if ( class_exists('ChangeTags') && $wgTorTagChanges && 
TorExitNodes::isExitNode() ) {
-   ChangeTags::addTags( 'tor', 
$recentChange->mAttribs['rc_id'], $recentChange->mAttribs['rc_this_oldid'], 
$recentChange->mAttribs['rc_logid'] );
+   $recentChange->addTags( 'tor' );
}
return true;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibf70e570ce360cc62a8acd857438bf143d359d61
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/TorBlock
Gerrit-Branch: master
Gerrit-Owner: Cenarium 
Gerrit-Reviewer: Cenarium 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...OAuth[master]: Use RecentChange::addTags rather than ChangeTags::addTags

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

Change subject: Use RecentChange::addTags rather than ChangeTags::addTags
..


Use RecentChange::addTags rather than ChangeTags::addTags

To avoid consecutive DB writes on changetag table.
See I8df2fd983c12632337e8d2922fa357808482338c

Change-Id: I160c5b2ffdfe3a88e85bba190bb5f38e584d3af6
---
M api/MWOAuthAPI.setup.php
M api/MWOAuthSessionProvider.php
2 files changed, 2 insertions(+), 12 deletions(-)

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



diff --git a/api/MWOAuthAPI.setup.php b/api/MWOAuthAPI.setup.php
index b1a4538..d0a6899 100755
--- a/api/MWOAuthAPI.setup.php
+++ b/api/MWOAuthAPI.setup.php
@@ -283,12 +283,7 @@
$consumerId = $access->get( 'consumerId' );
$consumer = MWOAuthConsumer::newFromId( $dbr, 
$consumerId );
if ( !$consumer->get( 'ownerOnly' ) ) {
-   \ChangeTags::addTags(
-   "OAuth CID: $consumerId",
-   $rc->mAttribs['rc_id'],
-   $rc->mAttribs['rc_this_oldid'],
-   $rc->mAttribs['rc_logid']
-   );
+   $rc->addTags( "OAuth CID: $consumerId" );
}
}
return true;
diff --git a/api/MWOAuthSessionProvider.php b/api/MWOAuthSessionProvider.php
index 889d131..7d64634 100644
--- a/api/MWOAuthSessionProvider.php
+++ b/api/MWOAuthSessionProvider.php
@@ -275,12 +275,7 @@
$consumerId = $access->get( 'consumerId' );
$consumer = MWOAuthConsumer::newFromId( $dbr, 
$consumerId );
if ( !$consumer->get( 'ownerOnly' ) ) {
-   \ChangeTags::addTags(
-   "OAuth CID: $consumerId",
-   $rc->mAttribs['rc_id'],
-   $rc->mAttribs['rc_this_oldid'],
-   $rc->mAttribs['rc_logid']
-   );
+   $rc->addTags( "OAuth CID: $consumerId" );
}
}
return true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I160c5b2ffdfe3a88e85bba190bb5f38e584d3af6
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Cenarium 
Gerrit-Reviewer: Cenarium 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...tools[deploy]: Merge branch 'master' of https://gerrit.wikimedia.org/r/wiki...

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

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

Change subject: Merge branch 'master' of 
https://gerrit.wikimedia.org/r/wikimedia/fundraising/tools into deploy
..

Merge branch 'master' of 
https://gerrit.wikimedia.org/r/wikimedia/fundraising/tools into deploy

+ 75b422a9d9fc882f30f808789873b9905be2ceb2 Flesh out required modules for all 
projects in this repo
+ 6f6415913d297dca61cfeeb85982039a0bcc578d [deploy with crm code] Rely on 
CiviCRM address rather than contribution tracking language.

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


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools 
refs/changes/69/313169/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e818ca90a62d94601665422c002e47b3b80d434
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools
Gerrit-Branch: deploy
Gerrit-Owner: Eileen 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileApp[master]: Use RecentChange::addTags rather than ChangeTags::addTags

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

Change subject: Use RecentChange::addTags rather than ChangeTags::addTags
..


Use RecentChange::addTags rather than ChangeTags::addTags

To avoid consecutive DB writes on changetag table.
See I8df2fd983c12632337e8d2922fa357808482338c

Change-Id: Ic4373dbbe0368e8966938563d0a098d1c679e7aa
---
M MobileApp.hooks.php
1 file changed, 1 insertion(+), 4 deletions(-)

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

Objections:
  Mholloway: There's a problem with this change, please improve



diff --git a/MobileApp.hooks.php b/MobileApp.hooks.php
index 205650a..e7c0ee8 100644
--- a/MobileApp.hooks.php
+++ b/MobileApp.hooks.php
@@ -34,10 +34,7 @@
( $isWikipediaApp && is_null( $logType ) )
|| ( $isCommonsApp && ( is_null( $logType ) || $logType 
== 'upload' ) )
) {
-   $rcId = $rc->getAttribute( 'rc_id' );
-   $revId = $rc->getAttribute( 'rc_this_oldid' );
-   $logId = $rc->getAttribute( 'rc_logid' );
-   ChangeTags::addTags( 'mobile app edit', $rcId, $revId, 
$logId );
+   $rc->addTags( 'mobile app edit' );
}
return true;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic4373dbbe0368e8966938563d0a098d1c679e7aa
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileApp
Gerrit-Branch: master
Gerrit-Owner: Cenarium 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Cenarium 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Fjalapeno 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Mhurd 
Gerrit-Reviewer: Niedzielski 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaEvents[master]: Use RecentChange::addTags rather than ChangeTags::addTags

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

Change subject: Use RecentChange::addTags rather than ChangeTags::addTags
..


Use RecentChange::addTags rather than ChangeTags::addTags

To avoid consecutive DB writes on changetag table.
See I8df2fd983c12632337e8d2922fa357808482338c

Change-Id: Ib9393ed84979105694207abf4487824182dffa05
---
M WikimediaEventsHooks.php
1 file changed, 1 insertion(+), 6 deletions(-)

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



diff --git a/WikimediaEventsHooks.php b/WikimediaEventsHooks.php
index 352accd..844e557 100644
--- a/WikimediaEventsHooks.php
+++ b/WikimediaEventsHooks.php
@@ -498,12 +498,7 @@
if ( $bucket ) {
$tags[] = "cross-wiki-upload-$bucket";
}
-   ChangeTags::addTags(
-   $tags,
-   $recentChange->getAttribute( 'rc_id' ),
-   $recentChange->getAttribute( 'rc_this_oldid' ),
-   $recentChange->getAttribute( 'rc_logid' )
-   );
+   $recentChange->addTags( $tags );
 
return true;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib9393ed84979105694207abf4487824182dffa05
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: Cenarium 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Cenarium 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Use RecentChange::addTags rather than ChangeTags::addTags

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

Change subject: Use RecentChange::addTags rather than ChangeTags::addTags
..


Use RecentChange::addTags rather than ChangeTags::addTags

To avoid consecutive DB writes on changetag table.
See I8df2fd983c12632337e8d2922fa357808482338c

Change-Id: I246b26ff1506b0ba82ef4eb08e06e3ef59ff8cad
---
M VisualEditor.hooks.php
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 0d6dc14..28337c3 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -389,8 +389,7 @@
public static function onRecentChange_save( RecentChange $rc ) {
$request = RequestContext::getMain()->getRequest();
if ( $request->getBool( 'veswitched' ) && 
$rc->mAttribs['rc_this_oldid'] ) {
-   ChangeTags::addTags( 'visualeditor-switched',
-   $rc->mAttribs['rc_id'], 
$rc->mAttribs['rc_this_oldid'] );
+   $rc->addTags( 'visualeditor-switched' );
}
return true;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I246b26ff1506b0ba82ef4eb08e06e3ef59ff8cad
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cenarium 
Gerrit-Reviewer: Cenarium 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Use RecentChange::addTags rather than ChangeTags::addTags

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

Change subject: Use RecentChange::addTags rather than ChangeTags::addTags
..


Use RecentChange::addTags rather than ChangeTags::addTags

To avoid consecutive DB writes on changetag table.
See I8df2fd983c12632337e8d2922fa357808482338c

Change-Id: I3177b8d71a93890c432f570a68b8fd08d94d2126
---
M includes/MobileFrontend.hooks.php
1 file changed, 2 insertions(+), 5 deletions(-)

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



diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 7518f70..e62b6a0 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -535,13 +535,10 @@
$logType = $rc->getAttribute( 'rc_log_type' );
// Only log edits and uploads
if ( $context->shouldDisplayMobileView() && ( $logType === 
'upload' || is_null( $logType ) ) ) {
-   $rcId = $rc->getAttribute( 'rc_id' );
-   $revId = $rc->getAttribute( 'rc_this_oldid' );
-   $logId = $rc->getAttribute( 'rc_logid' );
-   ChangeTags::addTags( 'mobile edit', $rcId, $revId, 
$logId );
+   $rc->addTags( 'mobile edit' );
// Tag as mobile web edit specifically, if it isn't 
coming from the apps
if ( strpos( $userAgent, 'WikipediaApp/' ) !== 0 ) {
-   ChangeTags::addTags( 'mobile web edit', $rcId, 
$revId, $logId );
+   $rc->addTags( 'mobile web edit' );
}
}
return true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3177b8d71a93890c432f570a68b8fd08d94d2126
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Cenarium 
Gerrit-Reviewer: Cenarium 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Add alias for Special:CreateHubFeature

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

Change subject: Add alias for Special:CreateHubFeature
..


Add alias for Special:CreateHubFeature

Change-Id: I5ad3632962da3c4a9a9a4118f53a28758211ab32
---
M CollaborationKit.alias.php
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/CollaborationKit.alias.php b/CollaborationKit.alias.php
index 052c9ba..51e9f23 100644
--- a/CollaborationKit.alias.php
+++ b/CollaborationKit.alias.php
@@ -9,5 +9,6 @@
 
 /** English (English) */
 $specialPageAliases['en'] = [
-   'CreateCollaborationHub' => [ 'CreateCollaborationHub' ]
+   'CreateCollaborationHub' => [ 'CreateCollaborationHub' ],
+   'CreateHubFeature' => [ 'CreateHubFeature' ]
 ];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5ad3632962da3c4a9a9a4118f53a28758211ab32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Isarra 
Gerrit-Reviewer: Harej 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Align last modified bar active color to new color palette

2016-09-27 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review.

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

Change subject: Align last modified bar active color to new color palette
..

Align last modified bar active color to new color palette

Aligning active color of last modified bar variable
`@lastModifiedBarActiveBackgroundColor` to improved color palette
https://phabricator.wikimedia.org/M82

Bug: T146799
Change-Id: Id2a120c9cc002f2289d98f8a0862e7ead5ada2dd
---
M minerva.less/minerva.variables.less
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/68/313168/1

diff --git a/minerva.less/minerva.variables.less 
b/minerva.less/minerva.variables.less
index 6bc5100..f57eef2 100644
--- a/minerva.less/minerva.variables.less
+++ b/minerva.less/minerva.variables.less
@@ -40,7 +40,7 @@
 @redBase: @colorErrorText;
 @colorTutorial: #2e76ff;
 @linkColor: #002bb8;
-@lastModifiedBarActiveBackgroundColor: #00af8b;
+@lastModifiedBarActiveBackgroundColor: #00af89;
 @toastNotificationColor: @colorGray2;
 
 // Use when an element is selected. FIXME: This should be in mediawiki ui.
@@ -58,7 +58,7 @@
 
 // typography
 @fontFamily: 'Helvetica Neue', 'Helvetica', 'Nimbus Sans L', 'Arial', 
'Liberation Sans', sans-serif;
-@fontFamilyHeading: 'Linux Libertine', 'Georgia',' Times', serif;
+@fontFamilyHeading: 'Linux Libertine', 'Georgia', 'Times', serif;
 @fontScalingFactor: 1;
 @contentLineHeight: 1.65;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id2a120c9cc002f2289d98f8a0862e7ead5ada2dd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: VolkerE 

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


[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Add alias for Special:CreateHubFeature

2016-09-27 Thread Isarra (Code Review)
Isarra has uploaded a new change for review.

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

Change subject: Add alias for Special:CreateHubFeature
..

Add alias for Special:CreateHubFeature

Change-Id: I5ad3632962da3c4a9a9a4118f53a28758211ab32
---
M CollaborationKit.alias.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit 
refs/changes/67/313167/1

diff --git a/CollaborationKit.alias.php b/CollaborationKit.alias.php
index 052c9ba..51e9f23 100644
--- a/CollaborationKit.alias.php
+++ b/CollaborationKit.alias.php
@@ -9,5 +9,6 @@
 
 /** English (English) */
 $specialPageAliases['en'] = [
-   'CreateCollaborationHub' => [ 'CreateCollaborationHub' ]
+   'CreateCollaborationHub' => [ 'CreateCollaborationHub' ],
+   'CreateHubFeature' => [ 'CreateHubFeature' ]
 ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ad3632962da3c4a9a9a4118f53a28758211ab32
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Isarra 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: throttle: remove expired exceptions

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

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

Change subject: throttle: remove expired exceptions
..

throttle: remove expired exceptions

Change-Id: If0e352269c6a8183882d9d74202ee87b4b6a4c89
---
M wmf-config/throttle.php
1 file changed, 0 insertions(+), 55 deletions(-)


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

diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php
index b01b23e..11b6ad4 100644
--- a/wmf-config/throttle.php
+++ b/wmf-config/throttle.php
@@ -28,66 +28,11 @@
 # ];
 ## Add throttling definitions below.
 
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # #
-# Woman in Science
-#
-
-$wmgThrottlingExceptions[] = [ // T145253 - Vancouver, British Columbia 
Institute of Technology
-   'from'   => '2016-09-21T09:30 -7:00',
-   'to' => '2016-09-21T16:00 -7:00',
-   'range'  => '142.232.0.0/16',
-   'dbname' => [ 'enwiki', 'frwiki', 'commonswiki' ],
-   'value'  => 70 // 50 expected
-];
-
-$wmgThrottlingExceptions[] = [ // T143951 - Vancouver, University of British 
Columbia
-   'from' => '2016-09-21T10:00 -8:00',
-   'to' => '2016-09-21T16:00 -8:00',
-   'range' => [ '128.189.64.0/19', '128.189.192.0/18', '206.12.64.0/21', 
'206.87.112.0/21', '206.87.120.0/21', '206.87.128.0/19', '206.87.192.0/21', 
'206.87.208.0/21', '206.87.216.0/21', '137.82.104.0/24', '137.82.79.0/24', 
'137.82.82.128/25' ],
-   'dbname' => [ 'enwiki' ],
-   'value' => 70 //50 expected
-];
-
-$wmgThrottlingExceptions[] = [ // T145115 - Montréal, Concordia Library and 
McGill University
-   'from' => '2016-09-21T13:00 -4:00',
-   'to' => '2016-09-21T17:00 -4:00',
-   'range' => '132.205.228.0/24',
-   'dbname' => [ 'enwiki', 'frwiki' ],
-   'value' => 50 //40 expected
-];
-$wmgThrottlingExceptions[] = [ // T145838
-   'from' => '2016-09-19T8:00 -8:00',
-   'to' => '2016-09-19T17:00 -8:00',
-   'range' => [ '142.58.113.128/26', '142.58.128.0/21', '207.23.160.0/19', 
'207.23.192.0/19', '142.58.80.0/21', '142.58.160.0/21', '142.58.168.0/21' ],
-   'dbname' => [ 'enwiki', 'frwiki', 'commonswiki' ],
-   'value' => 70 // 50 expected
-];
-
-$wmgThrottlingExceptions[] = [ // T145838
-   'from' => '2016-09-21T8:00 -8:00', 
-   'to' => '2016-09-21T17:00 -8:00', 
-   'range' => [ '142.58.113.128/26', '142.58.128.0/21', '207.23.160.0/19', 
'207.23.192.0/19', '142.58.80.0/21', '142.58.160.0/21', '142.58.168.0/21' ],
-   'dbname' => [ 'enwiki', 'frwiki', 'commonswiki' ],
-   'value' => 70 // 50 expected
-];
-
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# # # #
-# Other rules
-#
-
 $wmgThrottlingExceptions[] = [ // 
https://www.mediawiki.org/wiki/Wikimedia_Hackathon_Amrita_University
'from' => '2016-09-07T00:00 +5:30',
'to' => '2016-10-03T00:00 +5:30',
'IP' => '182.19.48.18',
'dbname' => 'labswiki',
-   'value' => 60 //50 expected
-];
-
-$wmgThrottlingExceptions[] = [
-   'from' => '2016-09-17T9:00 +12:00',
-   'to' => '2016-09-18T16:00 +12:00',
-   'IP' => '49.224.252.88',
-   'dbname' => [ 'enwiki' ],
'value' => 60 //50 expected
 ];
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove outdated deprecated .mw-ui-primary class

2016-09-27 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review.

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

Change subject: Remove outdated deprecated .mw-ui-primary class
..

Remove outdated deprecated .mw-ui-primary class

Removing outdated `.mw-ui-primary` button class, that was deprecated
more than two years ago.

Change-Id: I0f9be4dec4aea83d182e919add1ef8495b293907
---
M resources/src/mediawiki.ui/components/buttons.less
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/65/313165/1

diff --git a/resources/src/mediawiki.ui/components/buttons.less 
b/resources/src/mediawiki.ui/components/buttons.less
index 5931efb..f63bd61 100644
--- a/resources/src/mediawiki.ui/components/buttons.less
+++ b/resources/src/mediawiki.ui/components/buttons.less
@@ -118,7 +118,6 @@
// Progressive buttons
//
// Use progressive buttons for actions which lead to a next step in the 
process.
-   // .mw-ui-primary is deprecated, kept for compatibility.
//
// Markup:
// 
@@ -129,8 +128,7 @@
// 
//
// Styleguide 2.1.1.
-   &.mw-ui-progressive,
-   &.mw-ui-primary {
+   &.mw-ui-progressive {
.button-colors( @colorProgressive, @colorProgressiveHighlight, 
@colorProgressiveActive );
 
&.mw-ui-quiet {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Made PHPStorm happy on includes/Hooks.php

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

Change subject: Made PHPStorm happy on includes/Hooks.php
..


Made PHPStorm happy on includes/Hooks.php

Mostly doc fixes

Change-Id: I52f71ee35918becfdeded3c1de4988dd53c85535
---
M includes/Hooks.php
1 file changed, 92 insertions(+), 30 deletions(-)

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



diff --git a/includes/Hooks.php b/includes/Hooks.php
index de5d5d8..73755d5 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -40,6 +40,9 @@
 
/**
 * Ask the ORES server for scores on this recent change
+*
+* @param RecentChange $rc
+* @return bool|null
 */
public static function onRecentChange_save( RecentChange $rc ) {
global $wgOresExcludeBots, $wgOresEnabledNamespaces;
@@ -50,8 +53,9 @@
// Check if we actually want score for this namespace
$ns = $rc->getAttribute( 'rc_namespace' );
if ( $wgOresEnabledNamespaces &&
-   !( isset( $wgOresEnabledNamespaces[$ns] ) &&
-   $wgOresEnabledNamespaces[$ns] ) ) {
+   !( isset( $wgOresEnabledNamespaces[$ns] ) &&
+   $wgOresEnabledNamespaces[$ns] )
+   ) {
return true;
}
 
@@ -82,7 +86,10 @@
 * @param $filters
 * @return bool
 */
-   public static function onChangesListSpecialPageFilters( 
ChangesListSpecialPage $clsp, &$filters ) {
+   public static function onChangesListSpecialPageFilters(
+   ChangesListSpecialPage $clsp,
+   &$filters
+   ) {
if ( !self::oresEnabled( $clsp->getUser() ) || 
!self::isModelEnabled( 'damaging' ) ) {
return true;
}
@@ -109,7 +116,7 @@
/**
 * Pull in ORES score columns during recent changes queries
 *
-* @param $name
+* @param string $name
 * @param array $tables
 * @param array $fields
 * @param array $conds
@@ -142,20 +149,25 @@
 
$conds[] = '(oresm_is_current != 0 OR oresm_is_current IS 
NULL)';
 
-   $join_conds['ores_classification'] = [ 'LEFT JOIN',
+   $join_conds['ores_classification'] = [
+   'LEFT JOIN',
'rc_this_oldid = oresc_rev ' .
-   'AND oresc_class = 1' ];
+   'AND oresc_class = 1'
+   ];
 
-   $join_conds['ores_model'] = [ 'LEFT JOIN',
+   $join_conds['ores_model'] = [
+   'LEFT JOIN',
'oresc_model = oresm_id ' .
'AND oresm_is_current = 1'
];
 
if ( self::isModelEnabled( 'damaging' ) && $opts->getValue( 
'hidenondamaging' ) ) {
// Override the join conditions.
-   $join_conds['ores_classification'] = [ 'INNER JOIN',
+   $join_conds['ores_classification'] = [
+   'INNER JOIN',
'rc_this_oldid = oresc_rev ' .
-   'AND oresc_class = 1' ];
+   'AND oresc_class = 1'
+   ];
 
// Filter out non-damaging edits.
$conds[] = 'oresc_probability > '
@@ -174,10 +186,15 @@
 * @param array $data
 * @param RCCacheEntry[] $block
 * @param RCCacheEntry $rcObj
+* @param string[] $classes
 * @return bool
 */
-   public static function onEnhancedChangesListModifyLineData( 
EnhancedChangesList $ecl, array &$data,
-   array $block, RCCacheEntry $rcObj, array &$classes
+   public static function onEnhancedChangesListModifyLineData(
+   EnhancedChangesList $ecl,
+   array &$data,
+   array $block,
+   RCCacheEntry $rcObj,
+   array &$classes
) {
if ( !self::oresEnabled( $ecl->getUser() ) ) {
return true;
@@ -196,8 +213,10 @@
 * @param RCCacheEntry $rcObj
 * @return bool
 */
-   public static function onEnhancedChangesListModifyBlockLineData( 
EnhancedChangesList $ecl,
-   array &$data, RCCacheEntry $rcObj
+   public static function onEnhancedChangesListModifyBlockLineData(
+   EnhancedChangesList $ecl,
+   array &$data,
+   RCCacheEntry $rcObj
) {
if ( !self::oresEnabled( $ecl->getUser() ) ) {
return true;
@@ -219,8 +238,11 @@
 *
 * @return bool
 */
-   public static function onOldChangesListRecentChangesLine( ChangesList 

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Add CiviCRM initialize to upgrade function.

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

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

Change subject: Add CiviCRM initialize to upgrade function.
..

Add CiviCRM initialize to upgrade function.

Required when no other upgrade functions running

Change-Id: I45c1f978775f37802600e5f66ddb391f9e9cd2f5
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/64/313164/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index d31ad5f..bfb9e76 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2234,6 +2234,7 @@
  * Bug: T96410
 */
 function wmf_civicrm_update_7260() {
+  civicrm_initialize();
   require_once('update_7260.php');
   _wmf_civicrm_update_7260_update_preferred_language();
 }

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Add CiviCRM initialize to upgrade function.

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

Change subject: Add CiviCRM initialize to upgrade function.
..


Add CiviCRM initialize to upgrade function.

Required when no other upgrade functions running

Change-Id: I45c1f978775f37802600e5f66ddb391f9e9cd2f5
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index d31ad5f..bfb9e76 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2234,6 +2234,7 @@
  * Bug: T96410
 */
 function wmf_civicrm_update_7260() {
+  civicrm_initialize();
   require_once('update_7260.php');
   _wmf_civicrm_update_7260_update_preferred_language();
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I45c1f978775f37802600e5f66ddb391f9e9cd2f5
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Eileen 
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] wikimedia...crm[deployment]: Add CiviCRM initialize to upgrade function.

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

Change subject: Add CiviCRM initialize to upgrade function.
..


Add CiviCRM initialize to upgrade function.

Required when no other upgrade functions running

Change-Id: I45c1f978775f37802600e5f66ddb391f9e9cd2f5
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index d31ad5f..bfb9e76 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2234,6 +2234,7 @@
  * Bug: T96410
 */
 function wmf_civicrm_update_7260() {
+  civicrm_initialize();
   require_once('update_7260.php');
   _wmf_civicrm_update_7260_update_preferred_language();
 }

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Add CiviCRM initialize to upgrade function.

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

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

Change subject: Add CiviCRM initialize to upgrade function.
..

Add CiviCRM initialize to upgrade function.

Required when no other upgrade functions running

Change-Id: I45c1f978775f37802600e5f66ddb391f9e9cd2f5
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/63/313163/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index d31ad5f..bfb9e76 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2234,6 +2234,7 @@
  * Bug: T96410
 */
 function wmf_civicrm_update_7260() {
+  civicrm_initialize();
   require_once('update_7260.php');
   _wmf_civicrm_update_7260_update_preferred_language();
 }

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Remove dead pybal link

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

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

Change subject: Remove dead pybal link
..

Remove dead pybal link

Change-Id: I6634a5a996253da3f611fb7b62cb628a19c5a81a
---
M docroot/noc/index.html
1 file changed, 0 insertions(+), 3 deletions(-)


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

diff --git a/docroot/noc/index.html b/docroot/noc/index.html
index 9a3e039..4033a94 100644
--- a/docroot/noc/index.html
+++ b/docroot/noc/index.html
@@ -41,9 +41,6 @@
https://config-master.wikimedia.org/conftool/;>Conftool 
configuration
   Config files of Wikimedia's https://wikitech.wikimedia.org/wiki/Etcd;>etcd
used for pooling services in LVS
-   https://config-master.wikimedia.org/pybal/;>PyBal/LVS 
configuration
-   Config files of Wikimedia's https://wikitech.wikimedia.org/wiki/PyBal;>PyBal
-   https://wikitech.wikimedia.org/wiki/LVS;>LVS 
installation
https://dbtree.wikimedia.org/;>Core dbs
   Core DB Replication Layout and Lag
   DB clusters

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6634a5a996253da3f611fb7b62cb628a19c5a81a
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] wikimedia...crm[deployment]: Fix previous update query.

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

Change subject: Fix previous update query.
..


Fix previous update query.

Bug:  T96410
Change-Id: Iaa57186d2ba1d0ffe5ab4ff163a5cc73b1224d3c
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index a446124..d31ad5f 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2246,6 +2246,7 @@
  * Bug: T96410
  */
 function wmf_civicrm_update_7270() {
+  civicrm_initialize();
   $nonUsefulEnglishes = array(
 // these ones have information in CldrData.php so don't alter.
 //'en_BE', 'en_ZA', 'en_BW', 'en_BZ', 'en_HK', 'en_IN', 'en_JM', 'en_NA', 
'en_PK', 'en_SG', 'en_TT', 'en_ZW',
@@ -2275,8 +2276,8 @@
 'en_KI', 'en_NU', 'en_SY', 'en_SO', 'en_TG', 'en_CU', 'en_HM', 'en_BV', 
'en_MS',
   );
   CRM_Core_DAO::executeQuery("UPDATE civicrm_contact SET preferred_language = 
'en' WHERE preferred_language IN('"
-. implode("',", $nonUsefulEnglishes) . "')");
+. implode("', '", $nonUsefulEnglishes) . "')");
   // This only needs to run on production so hard-coding option_group_id seems 
OK.
   CRM_Core_DAO::executeQuery("UPDATE civicrm_option_value SET is_active = 0 
WHERE option_group_id = 86 AND value IN('"
-. implode("',", $nonUsefulEnglishes) . "')");
+. implode("', '", $nonUsefulEnglishes) . "')");
 }

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: [deploy with tools] Update preferred language based on contr...

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

Change subject: [deploy with tools] Update preferred language based on 
contribution_tracking.
..


[deploy with tools] Update preferred language based on contribution_tracking.

This is done with the intent that afterwards only preferred language should be 
used to calculate
silverpop language exports. We need to co-ordinate deployment with updating
silverpop and ensuring no more data is being nulled out.

Bug: T96410
Change-Id: I099efa8aaddc78268450a3ff3e12c27c38c4ec9a
---
A sites/all/modules/wmf_civicrm/update_7260.php
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
2 files changed, 1,035 insertions(+), 0 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/update_7260.php 
b/sites/all/modules/wmf_civicrm/update_7260.php
new file mode 100644
index 000..8c08397
--- /dev/null
+++ b/sites/all/modules/wmf_civicrm/update_7260.php
@@ -0,0 +1,1025 @@
+ ''
+  AND language NOT LIKE '?%'
+  AND language NOT LIKE '\"% '
+  AND language NOT LIKE '\'%'
+  AND language NOT LIKE '!%'
+  AND language NOT LIKE '\%%'
+  AND language NOT LIKE '(%'
+  AND language NOT LIKE '*%'
+  AND language NOT LIKE '.%'
+  AND language NOT LIKE '-%'
+  AND language NOT LIKE '0%'
+  AND language NOT LIKE '1%'
+  AND language NOT LIKE '2%'
+  AND language NOT LIKE '3%'
+  AND language NOT LIKE '4%'
+  AND language NOT LIKE '5%'
+  AND language NOT LIKE '6%'
+  AND language NOT LIKE '7%'
+  AND language NOT LIKE '8%'
+  AND language NOT LIKE '9%'
+  AND language NOT LIKE 'Donat%'
+  AND language NOT LIKE 'http%'
+  AND language <> 'en¢´cy'
+  AND language <> 'nl¤cy=EU'
+  AND language <> 'simple'
+  AND language <> 'en¤cy=JP'
+  AND language <> 'en¤cy=US'
+  AND language <> '

[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update English languages to only keep a small number of reco...

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

Change subject: Update English languages to only keep a small number of 
recognised variants
..


Update English languages to only keep a small number of recognised variants

I have not touched
en_US English (United States)
en_GB English (United Kingdom)
en_CA English (Canada)
en_AU English (Australia)

or the ones with data in CldrData.php

Bug: T96410
Change-Id: Ie2ddb017eeba24ed3b996917cd57c71d956f109b
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 43 insertions(+), 0 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 26a8724..f192e69 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2227,3 +2227,46 @@
   civicrm_initialize();
   CRM_Core_BAO_SchemaHandler::createIndexes(array('civicrm_contact' => 
array('preferred_language')));
 }
+
+/**
+ * Clean up weird English variants from preferred_language field.
+ *
+ * Good bye Dutch English, Uzbekastani English etc.
+ *
+ * Bug: T96410
+ */
+function wmf_civicrm_update_7270() {
+  $nonUsefulEnglishes = array(
+// these ones have information in CldrData.php so don't alter.
+//'en_BE', 'en_ZA', 'en_BW', 'en_BZ', 'en_HK', 'en_IN', 'en_JM', 'en_NA', 
'en_PK', 'en_SG', 'en_TT', 'en_ZW',
+'en_NZ', // :-(
+'en_EN', // en_GB instead? Only 3 - who cares.
+'en_SE', 'en_NO', 'en_NL', 'en_ES', 'en_IT', 'en_IL', 'en_DK', 'en_FR', 
'en_IE',
+'en_MY', 'en_BR', 'en_RO', 'en_AT', 'en_HU', 'en_PL', 'en_MX', 'en_PT', 
'en_JP',
+'en_CN', 'en_CZ', 'en_SK', 'en_GR', 'en_DE', 'en_AE', 'en_UA', 'en_TH', 
'en_TW', 'en_LV', 'en_LU',
+'en_CH', 'en_PH', 'en_SI', 'en_BG', 'en_AR', 'en_HR', 'en_CL', 'en_CO', 
'en_IS', 'en_LT', 'en_CY',
+'en_XX', 'en_KW', 'en_UY', 'en_QA', 'en_MT', 'en_PE', 'en_VN', 'en_CR', 
'en_RS', 'en_LK', 'en_KZ',
+'en_EG', 'en_BH', 'en_DO', 'en_PR', 'en_NG', 'en_VE', 'en_EC', 'en_PA', 
'en_OM',
+'en_BA', 'en_JO', 'en_KE', 'en_GT', 'en_MU', 'en_GE', 'en_AZ', 'en_AM', 
'en_BN', 'en_MK',
+'en_NI', 'en_AL', 'en_BD', 'en_BS', 'en_BM', 'en_KH', 'en_BB', 'en_SV', 
'en_MD', 'en_HN', 'en_MO',
+'en_NP', 'en_VI', 'en_MV', 'en_GI', 'en_KY', 'en_TZ', 'en_ET', 'en_AO', 
'en_ME', 'en_MA',
+'en_MZ', 'en_AF', 'en_GU', 'en_PY', 'en_AD', 'en_FO', 'en_BO', 'en_MN', 
'en_AW', 'en_UG',
+'en_FJ', 'en_GN', 'en_PG', 'en_GH', 'en_ZM', 'en_KG', 'en_GY', 'en_JE', 
'en_CW', 'en_LC',
+'en_IM', 'en_BL', 'en_MC', 'en_SB', 'en_DZ', 'en_GL', 'en_HT', 'en_AG', 
'en_GD', 'en_LA', 'en_UZ',
+'en_LI', 'en_PF', 'en_KN', 'en_DM', 'en_GG', 'en_NC', 'en_SC', 'en_GP', 
'en_TC', 'en_VC', 'en_VG',
+'en_VU', 'en_PS', 'en_TN', 'en_MW', 'en_SX', 'en_SM', 'en_SR', 'en_SZ', 
'en_FM', 'en_RE', 'en_RW',
+'en_SN', 'en_TJ', 'en_CM', 'en_AI', 'en_CK', 'en_LR', 'en_MG', 'en_LS', 
'en_SL', 'en_TM', 'en_BJ',
+'en_MH', 'en_ML', 'en_WS', 'en_AS', 'en_BF', 'en_BQ', 'en_FK', 'en_GA', 
'en_MP', 'en_MQ', 'en_CV',
+'en_GF', 'en_MF', 'en_MR', 'en_KR', 'en_NE', 'en_TL', 'en_RU', 'en_AX', 
'en_BI', 'en_ID', 'en_TO',
+'en_FI', 'en_TR', 'en_SA', 'en_GM', 'en_GQ', 'en_HO', 'en_SP', 'en_AN', 
'en_TA', 'en_SJ', 'en_IO',
+'en_PW', 'en_JA', 'en_CD', 'en_IR', 'en_UN', 'en_WW', 'en_CG', 'en_DJ', 
'en_TD', 'en_TV', 'en_NF',
+'en_OS', 'en_DN', 'en_YE', 'en_ER', 'en_VA', 'en_BY', 'en_LB', 'en_IQ', 
'en_MM', 'en_EH', 'en_LY',
+'en_BT', 'en_CF', 'en_SD', 'en_SS', 'en_KP', 'en_AQ', 'en_SH', 'en_CI', 
'en_UM', 'en_WF',
+'en_KI', 'en_NU', 'en_SY', 'en_SO', 'en_TG', 'en_CU', 'en_HM', 'en_BV', 
'en_MS',
+  );
+  CRM_Core_DAO::executeQuery("UPDATE civicrm_contact SET preferred_language = 
'en' WHERE preferred_language IN('"
+. implode("',", $nonUsefulEnglishes) . "')");
+  // This only needs to run on production so hard-coding option_group_id seems 
OK.
+  CRM_Core_DAO::executeQuery("UPDATE civicrm_option_value SET is_active = 0 
WHERE option_group_id = 86 AND value IN('"
+. implode("',", $nonUsefulEnglishes) . "')");
+}

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Fix previous update query.

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

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

Change subject: Fix previous update query.
..

Fix previous update query.

Bug:  T96410
Change-Id: Iaa57186d2ba1d0ffe5ab4ff163a5cc73b1224d3c
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/61/313161/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index a446124..d31ad5f 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2246,6 +2246,7 @@
  * Bug: T96410
  */
 function wmf_civicrm_update_7270() {
+  civicrm_initialize();
   $nonUsefulEnglishes = array(
 // these ones have information in CldrData.php so don't alter.
 //'en_BE', 'en_ZA', 'en_BW', 'en_BZ', 'en_HK', 'en_IN', 'en_JM', 'en_NA', 
'en_PK', 'en_SG', 'en_TT', 'en_ZW',
@@ -2275,8 +2276,8 @@
 'en_KI', 'en_NU', 'en_SY', 'en_SO', 'en_TG', 'en_CU', 'en_HM', 'en_BV', 
'en_MS',
   );
   CRM_Core_DAO::executeQuery("UPDATE civicrm_contact SET preferred_language = 
'en' WHERE preferred_language IN('"
-. implode("',", $nonUsefulEnglishes) . "')");
+. implode("', '", $nonUsefulEnglishes) . "')");
   // This only needs to run on production so hard-coding option_group_id seems 
OK.
   CRM_Core_DAO::executeQuery("UPDATE civicrm_option_value SET is_active = 0 
WHERE option_group_id = 86 AND value IN('"
-. implode("',", $nonUsefulEnglishes) . "')");
+. implode("', '", $nonUsefulEnglishes) . "')");
 }

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: [deploy with tools] Update preferred language based on contr...

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

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

Change subject: [deploy with tools] Update preferred language based on 
contribution_tracking.
..

[deploy with tools] Update preferred language based on contribution_tracking.

This is done with the intent that afterwards only preferred language should be 
used to calculate
silverpop language exports. We need to co-ordinate deployment with updating
silverpop and ensuring no more data is being nulled out.

Bug: T96410
Change-Id: I099efa8aaddc78268450a3ff3e12c27c38c4ec9a
---
A sites/all/modules/wmf_civicrm/update_7260.php
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
2 files changed, 1,035 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/60/313160/1

diff --git a/sites/all/modules/wmf_civicrm/update_7260.php 
b/sites/all/modules/wmf_civicrm/update_7260.php
new file mode 100644
index 000..8c08397
--- /dev/null
+++ b/sites/all/modules/wmf_civicrm/update_7260.php
@@ -0,0 +1,1025 @@
+ ''
+  AND language NOT LIKE '?%'
+  AND language NOT LIKE '\"% '
+  AND language NOT LIKE '\'%'
+  AND language NOT LIKE '!%'
+  AND language NOT LIKE '\%%'
+  AND language NOT LIKE '(%'
+  AND language NOT LIKE '*%'
+  AND language NOT LIKE '.%'
+  AND language NOT LIKE '-%'
+  AND language NOT LIKE '0%'
+  AND language NOT LIKE '1%'
+  AND language NOT LIKE '2%'
+  AND language NOT LIKE '3%'
+  AND language NOT LIKE '4%'
+  AND language NOT LIKE '5%'
+  AND language NOT LIKE '6%'
+  AND language NOT LIKE '7%'
+  AND language NOT LIKE '8%'
+  AND language NOT LIKE '9%'
+  AND language NOT LIKE 'Donat%'
+  AND language NOT LIKE 'http%'
+  AND language <> 'en¢´cy'
+  AND language <> 'nl¤cy=EU'
+  AND language <> 'simple'
+  AND language <> 'en¤cy=JP'
+  AND language <> 'en¤cy=US'
+  AND language <> '

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Set spellcheck=true on nested contentEditables

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

Change subject: Set spellcheck=true on nested contentEditables
..


Set spellcheck=true on nested contentEditables

Chrome doesn't inherit this value from the document node (although
it probably should), so explicitly set it everywhere.

Also only override right click on table cells if the cell isn't
being edited as this would prevent showing the spell check menu otherwise.

Bug: T145810
Change-Id: I0d27a9895f2d846c96984dfe45547c98c5af2513
---
M src/ce/nodes/ve.ce.SectionNode.js
M src/ce/nodes/ve.ce.TableCaptionNode.js
M src/ce/nodes/ve.ce.TableCellNode.js
M src/ce/nodes/ve.ce.TableNode.js
4 files changed, 8 insertions(+), 6 deletions(-)

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



diff --git a/src/ce/nodes/ve.ce.SectionNode.js 
b/src/ce/nodes/ve.ce.SectionNode.js
index 3618db4..4b81f6f 100644
--- a/src/ce/nodes/ve.ce.SectionNode.js
+++ b/src/ce/nodes/ve.ce.SectionNode.js
@@ -25,7 +25,7 @@
 
this.$element
.addClass( 've-ce-sectionNode' )
-   .prop( 'contentEditable', 'true' );
+   .prop( { contentEditable: 'true', spellcheck: true } );
 };
 
 /* Inheritance */
diff --git a/src/ce/nodes/ve.ce.TableCaptionNode.js 
b/src/ce/nodes/ve.ce.TableCaptionNode.js
index e261db9..bcf3e74 100644
--- a/src/ce/nodes/ve.ce.TableCaptionNode.js
+++ b/src/ce/nodes/ve.ce.TableCaptionNode.js
@@ -20,7 +20,7 @@
// DOM changes
this.$element
.addClass( 've-ce-tableCaptionNode' )
-   .prop( 'contentEditable', 'true' );
+   .prop( { contentEditable: 'true', spellcheck: true } );
 };
 
 /* Inheritance */
diff --git a/src/ce/nodes/ve.ce.TableCellNode.js 
b/src/ce/nodes/ve.ce.TableCellNode.js
index 3027168..9319212 100644
--- a/src/ce/nodes/ve.ce.TableCellNode.js
+++ b/src/ce/nodes/ve.ce.TableCellNode.js
@@ -41,8 +41,10 @@
this.$element.attr( 'colspan', colspan );
}
 
-   // Add tooltip
-   this.$element.attr( 'title', ve.msg( 'visualeditor-tablecell-tooltip' ) 
);
+   this.$element
+   // Add tooltip
+   .attr( 'title', ve.msg( 'visualeditor-tablecell-tooltip' ) )
+   .prop( 'spellcheck', true );
 
// Events
this.model.connect( this, {
diff --git a/src/ce/nodes/ve.ce.TableNode.js b/src/ce/nodes/ve.ce.TableNode.js
index 8b390e4..0a2a0fe 100644
--- a/src/ce/nodes/ve.ce.TableNode.js
+++ b/src/ce/nodes/ve.ce.TableNode.js
@@ -139,8 +139,8 @@
return;
}
 
-   // Right-click
-   if ( e.which === OO.ui.MouseButtons.RIGHT ) {
+   // Right-click on a cell which isn't being edited
+   if ( e.which === OO.ui.MouseButtons.RIGHT && !this.getActiveCellNode() 
) {
// Select the cell to the browser renders the correct context 
menu
ve.selectElement( cellNode.$element[ 0 ] );
setTimeout( function () {

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Update English languages to only keep a small number of reco...

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

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

Change subject: Update English languages to only keep a small number of 
recognised variants
..

Update English languages to only keep a small number of recognised variants

I have not touched
en_US English (United States)
en_GB English (United Kingdom)
en_CA English (Canada)
en_AU English (Australia)

or the ones with data in CldrData.php

Bug: T96410
Change-Id: Ie2ddb017eeba24ed3b996917cd57c71d956f109b
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 43 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/59/313159/1

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index 26a8724..f192e69 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2227,3 +2227,46 @@
   civicrm_initialize();
   CRM_Core_BAO_SchemaHandler::createIndexes(array('civicrm_contact' => 
array('preferred_language')));
 }
+
+/**
+ * Clean up weird English variants from preferred_language field.
+ *
+ * Good bye Dutch English, Uzbekastani English etc.
+ *
+ * Bug: T96410
+ */
+function wmf_civicrm_update_7270() {
+  $nonUsefulEnglishes = array(
+// these ones have information in CldrData.php so don't alter.
+//'en_BE', 'en_ZA', 'en_BW', 'en_BZ', 'en_HK', 'en_IN', 'en_JM', 'en_NA', 
'en_PK', 'en_SG', 'en_TT', 'en_ZW',
+'en_NZ', // :-(
+'en_EN', // en_GB instead? Only 3 - who cares.
+'en_SE', 'en_NO', 'en_NL', 'en_ES', 'en_IT', 'en_IL', 'en_DK', 'en_FR', 
'en_IE',
+'en_MY', 'en_BR', 'en_RO', 'en_AT', 'en_HU', 'en_PL', 'en_MX', 'en_PT', 
'en_JP',
+'en_CN', 'en_CZ', 'en_SK', 'en_GR', 'en_DE', 'en_AE', 'en_UA', 'en_TH', 
'en_TW', 'en_LV', 'en_LU',
+'en_CH', 'en_PH', 'en_SI', 'en_BG', 'en_AR', 'en_HR', 'en_CL', 'en_CO', 
'en_IS', 'en_LT', 'en_CY',
+'en_XX', 'en_KW', 'en_UY', 'en_QA', 'en_MT', 'en_PE', 'en_VN', 'en_CR', 
'en_RS', 'en_LK', 'en_KZ',
+'en_EG', 'en_BH', 'en_DO', 'en_PR', 'en_NG', 'en_VE', 'en_EC', 'en_PA', 
'en_OM',
+'en_BA', 'en_JO', 'en_KE', 'en_GT', 'en_MU', 'en_GE', 'en_AZ', 'en_AM', 
'en_BN', 'en_MK',
+'en_NI', 'en_AL', 'en_BD', 'en_BS', 'en_BM', 'en_KH', 'en_BB', 'en_SV', 
'en_MD', 'en_HN', 'en_MO',
+'en_NP', 'en_VI', 'en_MV', 'en_GI', 'en_KY', 'en_TZ', 'en_ET', 'en_AO', 
'en_ME', 'en_MA',
+'en_MZ', 'en_AF', 'en_GU', 'en_PY', 'en_AD', 'en_FO', 'en_BO', 'en_MN', 
'en_AW', 'en_UG',
+'en_FJ', 'en_GN', 'en_PG', 'en_GH', 'en_ZM', 'en_KG', 'en_GY', 'en_JE', 
'en_CW', 'en_LC',
+'en_IM', 'en_BL', 'en_MC', 'en_SB', 'en_DZ', 'en_GL', 'en_HT', 'en_AG', 
'en_GD', 'en_LA', 'en_UZ',
+'en_LI', 'en_PF', 'en_KN', 'en_DM', 'en_GG', 'en_NC', 'en_SC', 'en_GP', 
'en_TC', 'en_VC', 'en_VG',
+'en_VU', 'en_PS', 'en_TN', 'en_MW', 'en_SX', 'en_SM', 'en_SR', 'en_SZ', 
'en_FM', 'en_RE', 'en_RW',
+'en_SN', 'en_TJ', 'en_CM', 'en_AI', 'en_CK', 'en_LR', 'en_MG', 'en_LS', 
'en_SL', 'en_TM', 'en_BJ',
+'en_MH', 'en_ML', 'en_WS', 'en_AS', 'en_BF', 'en_BQ', 'en_FK', 'en_GA', 
'en_MP', 'en_MQ', 'en_CV',
+'en_GF', 'en_MF', 'en_MR', 'en_KR', 'en_NE', 'en_TL', 'en_RU', 'en_AX', 
'en_BI', 'en_ID', 'en_TO',
+'en_FI', 'en_TR', 'en_SA', 'en_GM', 'en_GQ', 'en_HO', 'en_SP', 'en_AN', 
'en_TA', 'en_SJ', 'en_IO',
+'en_PW', 'en_JA', 'en_CD', 'en_IR', 'en_UN', 'en_WW', 'en_CG', 'en_DJ', 
'en_TD', 'en_TV', 'en_NF',
+'en_OS', 'en_DN', 'en_YE', 'en_ER', 'en_VA', 'en_BY', 'en_LB', 'en_IQ', 
'en_MM', 'en_EH', 'en_LY',
+'en_BT', 'en_CF', 'en_SD', 'en_SS', 'en_KP', 'en_AQ', 'en_SH', 'en_CI', 
'en_UM', 'en_WF',
+'en_KI', 'en_NU', 'en_SY', 'en_SO', 'en_TG', 'en_CU', 'en_HM', 'en_BV', 
'en_MS',
+  );
+  CRM_Core_DAO::executeQuery("UPDATE civicrm_contact SET preferred_language = 
'en' WHERE preferred_language IN('"
+. implode("',", $nonUsefulEnglishes) . "')");
+  // This only needs to run on production so hard-coding option_group_id seems 
OK.
+  CRM_Core_DAO::executeQuery("UPDATE civicrm_option_value SET is_active = 0 
WHERE option_group_id = 86 AND value IN('"
+. implode("',", $nonUsefulEnglishes) . "')");
+}

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: GeoData: get rid of wmg, part 1

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

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

Change subject: GeoData: get rid of wmg, part 1
..

GeoData: get rid of wmg, part 1

Change-Id: If296080686b8af576fefa06c7183cf1eba2be78f
---
M wmf-config/CommonSettings.php
1 file changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 4abb974..a966356 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2590,7 +2590,9 @@
$wgGeoDataBackend = 'elastic';
 
$wgMaxCoordinatesPerPage = 2000;
-   $wgMaxGeoSearchRadius = $wmgMaxGeoSearchRadius;
+   if ( isset ( $wmgMaxGeoSearchRadius ) ) {
+   $wgMaxGeoSearchRadius = $wmgMaxGeoSearchRadius;
+   }
$wgGeoDataDebug = true;
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If296080686b8af576fefa06c7183cf1eba2be78f
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] operations/mediawiki-config[master]: No reason to ever vary $wgGeoDataDebug by wiki

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

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

Change subject: No reason to ever vary $wgGeoDataDebug by wiki
..

No reason to ever vary $wgGeoDataDebug by wiki

Change-Id: I174e380e488ca65921d50eafb21662f5ef7d0a4b
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 1 insertion(+), 4 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 854e20a..4abb974 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2591,7 +2591,7 @@
 
$wgMaxCoordinatesPerPage = 2000;
$wgMaxGeoSearchRadius = $wmgMaxGeoSearchRadius;
-   $wgGeoDataDebug = $wmgGeoDataDebug;
+   $wgGeoDataDebug = true;
 }
 
 if ( $wmgUseEcho ) {
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index f58d7c0..f0e6853 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15726,9 +15726,6 @@
'default' => 1,
'wikivoyage' => 2,
 ],
-'wmgGeoDataDebug' => [
-   'default' => true,
-],
 
 'wmgUseEcho' => [
'default' => true,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I174e380e488ca65921d50eafb21662f5ef7d0a4b
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] operations/mediawiki-config[master]: Kill $wmgEnableGeoSearch

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

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

Change subject: Kill $wmgEnableGeoSearch
..

Kill $wmgEnableGeoSearch

GeoData is stable enough these days to make this setting
an unneeded cruft. Wikis with this setting different from
default don't have GD enabled anyway. Also, one dbname is
invalid.

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


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index e9418f3..854e20a 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2589,10 +2589,6 @@
wfLoadExtension( 'GeoData' );
$wgGeoDataBackend = 'elastic';
 
-   if ( !$wmgEnableGeoSearch ) {
-   $wgAPIListModules['geosearch'] = 'ApiQueryDisabled';
-   }
-
$wgMaxCoordinatesPerPage = 2000;
$wgMaxGeoSearchRadius = $wmgMaxGeoSearchRadius;
$wgGeoDataDebug = $wmgGeoDataDebug;
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 7b8fc72..f58d7c0 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15706,9 +15706,6 @@
'enwiki' => true,
 ],
 
-# *** DO NOT disable this extension if it causes an overload via API ***
-# or you will break a lot of pages where its parser function is used. Instead,
-# disable its API modules in CommonSettings.php or below
 'wmgEnableGeoData' => [
'default' => false,
'wikipedia' => true,
@@ -15724,12 +15721,6 @@
'wg_enwiki' => false,
'wikidata' => true,
'incubatorwiki' => true,
-],
-'wmgEnableGeoSearch' => [
-   'default' => true,
-   'wikitech' => false, // FIXME: this does nothing in absence of GeoData
-   'loginwiki' => false,
-   'votewiki' => false,
 ],
 'wmgMaxGeoSearchRadius' => [
'default' => 1,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6bbc718bab47595b980b358bad75e599d34975c3
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] wikimedia...crm[master]: Fix previous update query.

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

Change subject: Fix previous update query.
..


Fix previous update query.

Bug:  T96410
Change-Id: Iaa57186d2ba1d0ffe5ab4ff163a5cc73b1224d3c
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.install 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
index a446124..d31ad5f 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.install
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.install
@@ -2246,6 +2246,7 @@
  * Bug: T96410
  */
 function wmf_civicrm_update_7270() {
+  civicrm_initialize();
   $nonUsefulEnglishes = array(
 // these ones have information in CldrData.php so don't alter.
 //'en_BE', 'en_ZA', 'en_BW', 'en_BZ', 'en_HK', 'en_IN', 'en_JM', 'en_NA', 
'en_PK', 'en_SG', 'en_TT', 'en_ZW',
@@ -2275,8 +2276,8 @@
 'en_KI', 'en_NU', 'en_SY', 'en_SO', 'en_TG', 'en_CU', 'en_HM', 'en_BV', 
'en_MS',
   );
   CRM_Core_DAO::executeQuery("UPDATE civicrm_contact SET preferred_language = 
'en' WHERE preferred_language IN('"
-. implode("',", $nonUsefulEnglishes) . "')");
+. implode("', '", $nonUsefulEnglishes) . "')");
   // This only needs to run on production so hard-coding option_group_id seems 
OK.
   CRM_Core_DAO::executeQuery("UPDATE civicrm_option_value SET is_active = 0 
WHERE option_group_id = 86 AND value IN('"
-. implode("',", $nonUsefulEnglishes) . "')");
+. implode("', '", $nonUsefulEnglishes) . "')");
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa57186d2ba1d0ffe5ab4ff163a5cc73b1224d3c
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Eileen 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
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] operations/mediawiki-config[master]: wfLoadExtension( 'GeoData' )

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

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

Change subject: wfLoadExtension( 'GeoData' )
..

wfLoadExtension( 'GeoData' )

Change-Id: I0d2c6891ccbbcd592702fffecfe3c029582368d1
---
M wmf-config/CommonSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 7d6f19e..e9418f3 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2586,7 +2586,7 @@
 }
 
 if ( $wmgEnableGeoData ) {
-   require_once( "$IP/extensions/GeoData/GeoData.php" );
+   wfLoadExtension( 'GeoData' );
$wgGeoDataBackend = 'elastic';
 
if ( !$wmgEnableGeoSearch ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d2c6891ccbbcd592702fffecfe3c029582368d1
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] operations/mediawiki-config[master]: GeoData: get rid of wmg, part 2

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

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

Change subject: GeoData: get rid of wmg, part 2
..

GeoData: get rid of wmg, part 2

Change-Id: Idc16b64116258d9ac7abf7e6516d631b0f911bd5
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
2 files changed, 1 insertion(+), 4 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index a966356..818bc79 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2590,9 +2590,6 @@
$wgGeoDataBackend = 'elastic';
 
$wgMaxCoordinatesPerPage = 2000;
-   if ( isset ( $wmgMaxGeoSearchRadius ) ) {
-   $wgMaxGeoSearchRadius = $wmgMaxGeoSearchRadius;
-   }
$wgGeoDataDebug = true;
 }
 
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index f0e6853..958f9c2 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15722,7 +15722,7 @@
'wikidata' => true,
'incubatorwiki' => true,
 ],
-'wmgMaxGeoSearchRadius' => [
+'wgMaxGeoSearchRadius' => [
'default' => 1,
'wikivoyage' => 2,
 ],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc16b64116258d9ac7abf7e6516d631b0f911bd5
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] wikimedia...crm[master]: [deploy with tools] Update preferred language based on contr...

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

Change subject: [deploy with tools] Update preferred language based on 
contribution_tracking.
..


[deploy with tools] Update preferred language based on contribution_tracking.

This is done with the intent that afterwards only preferred language should be 
used to calculate
silverpop language exports. We need to co-ordinate deployment with updating
silverpop and ensuring no more data is being nulled out.

Bug: T96410
Change-Id: I099efa8aaddc78268450a3ff3e12c27c38c4ec9a
---
A sites/all/modules/wmf_civicrm/update_7260.php
M sites/all/modules/wmf_civicrm/wmf_civicrm.install
2 files changed, 1,035 insertions(+), 0 deletions(-)

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



diff --git a/sites/all/modules/wmf_civicrm/update_7260.php 
b/sites/all/modules/wmf_civicrm/update_7260.php
new file mode 100644
index 000..8c08397
--- /dev/null
+++ b/sites/all/modules/wmf_civicrm/update_7260.php
@@ -0,0 +1,1025 @@
+ ''
+  AND language NOT LIKE '?%'
+  AND language NOT LIKE '\"% '
+  AND language NOT LIKE '\'%'
+  AND language NOT LIKE '!%'
+  AND language NOT LIKE '\%%'
+  AND language NOT LIKE '(%'
+  AND language NOT LIKE '*%'
+  AND language NOT LIKE '.%'
+  AND language NOT LIKE '-%'
+  AND language NOT LIKE '0%'
+  AND language NOT LIKE '1%'
+  AND language NOT LIKE '2%'
+  AND language NOT LIKE '3%'
+  AND language NOT LIKE '4%'
+  AND language NOT LIKE '5%'
+  AND language NOT LIKE '6%'
+  AND language NOT LIKE '7%'
+  AND language NOT LIKE '8%'
+  AND language NOT LIKE '9%'
+  AND language NOT LIKE 'Donat%'
+  AND language NOT LIKE 'http%'
+  AND language <> 'en¢´cy'
+  AND language <> 'nl¤cy=EU'
+  AND language <> 'simple'
+  AND language <> 'en¤cy=JP'
+  AND language <> 'en¤cy=US'
+  AND language <> '

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.20]: resourceloader: Fix undefined getPrefixedText()

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

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

Change subject: resourceloader: Fix undefined getPrefixedText()
..

resourceloader: Fix undefined getPrefixedText()

Follows-up dbe592df. Used to go in one-way only and silenced by
addObj(). Now that we're iterating directly as well, need a
conditional.

Bug: T146728
Change-Id: Ief9d44cc5cb8f5d687560f59cc696c5671546163
---
M includes/resourceloader/ResourceLoaderWikiModule.php
1 file changed, 15 insertions(+), 3 deletions(-)


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

diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php 
b/includes/resourceloader/ResourceLoaderWikiModule.php
index 4fdd86e..127f498 100644
--- a/includes/resourceloader/ResourceLoaderWikiModule.php
+++ b/includes/resourceloader/ResourceLoaderWikiModule.php
@@ -305,7 +305,11 @@
$titleInfo = [];
$batch = new LinkBatch;
foreach ( $pages as $titleText ) {
-   $batch->addObj( Title::newFromText( $titleText ) );
+   $title = Title::newFromText( $titleText );
+   if ( $title ) {
+   // Page name may be invalid if user-provided 
(e.g. gadgets)
+   $batch->addObj( Title::newFromText( $titleText 
) );
+   }
}
if ( !$batch->isEmpty() ) {
$res = $db->select( 'page',
@@ -359,8 +363,16 @@
// Before we intersect, map the names to canonical form 
(T145673).
$intersect = [];
foreach ( $pages as $page => $unused ) {
-   $title = Title::newFromText( $page 
)->getPrefixedText();
-   $intersect[$title] = 1;
+   $title = Title::newFromText( $page );
+   if ( $title ) {
+   $intersect[ $title->getPrefixedText() ] 
= 1;
+   } else {
+   // Page name may be invalid if 
user-provided (e.g. gadgets)
+   $rl->getLogger()->info(
+   'Invalid wiki page title 
"{title}" in ' . __METHOD__,
+   [ 'title' => $page ]
+   );
+   }
}
$info = array_intersect_key( $allInfo, $intersect );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief9d44cc5cb8f5d687560f59cc696c5671546163
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.20
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Switch query parsing tests from Searcher to CirrusSearch class

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

Change subject: Switch query parsing tests from Searcher to CirrusSearch class
..


Switch query parsing tests from Searcher to CirrusSearch class

To generate and test the appropriate more like query parsing fixtures we
need to start at CirrusSearch class, where the branching for more like
happens. I wasn't expecting it, but this also caused minor changes in
all the fixtures:

* Queries get appropriately trimmed of \n. Almost all the fixture files
  finish with a \n and we never bothered trimming it. This is probably
  a desired change
* file_text query portion removed from most queries. This also more
  accurately matches how real queries are built. For the most part only
  insource: queries have kept their file_text portion of the query.

There are so many files changed checking what changed is a bit of a
pain, but 90%+ of the changes are the exact same change. This can be
seen by using `git log -1 -p` and setting the console height to the size
of that change, then paging down changes only a few characters and it's
quite obvious the change is consistent (and the exceptions are obvious).

Change-Id: I977b990573fcb3ee6d04f37fca8f6ec41a4a7fba
---
M includes/CirrusSearch.php
M tests/unit/SearcherTest.php
M tests/unit/fixtures/searchText/boost_templates_001.expected
M tests/unit/fixtures/searchText/boost_templates_002.expected
M tests/unit/fixtures/searchText/browsertest_001.expected
M tests/unit/fixtures/searchText/browsertest_002.expected
M tests/unit/fixtures/searchText/browsertest_003.expected
M tests/unit/fixtures/searchText/browsertest_004.expected
M tests/unit/fixtures/searchText/browsertest_005.expected
M tests/unit/fixtures/searchText/browsertest_006.expected
M tests/unit/fixtures/searchText/browsertest_007.expected
M tests/unit/fixtures/searchText/browsertest_008.expected
M tests/unit/fixtures/searchText/browsertest_009.expected
M tests/unit/fixtures/searchText/browsertest_010.expected
M tests/unit/fixtures/searchText/browsertest_011.expected
M tests/unit/fixtures/searchText/browsertest_012.expected
M tests/unit/fixtures/searchText/browsertest_013.expected
M tests/unit/fixtures/searchText/browsertest_014.expected
M tests/unit/fixtures/searchText/browsertest_015.expected
M tests/unit/fixtures/searchText/browsertest_016.expected
M tests/unit/fixtures/searchText/browsertest_017.expected
M tests/unit/fixtures/searchText/browsertest_018.expected
M tests/unit/fixtures/searchText/browsertest_019.expected
M tests/unit/fixtures/searchText/browsertest_020.expected
M tests/unit/fixtures/searchText/browsertest_021.expected
M tests/unit/fixtures/searchText/browsertest_022.expected
M tests/unit/fixtures/searchText/browsertest_023.expected
M tests/unit/fixtures/searchText/browsertest_024.expected
M tests/unit/fixtures/searchText/browsertest_025.expected
M tests/unit/fixtures/searchText/browsertest_026.expected
M tests/unit/fixtures/searchText/browsertest_027.expected
M tests/unit/fixtures/searchText/browsertest_028.expected
M tests/unit/fixtures/searchText/browsertest_029.expected
M tests/unit/fixtures/searchText/browsertest_030.expected
M tests/unit/fixtures/searchText/browsertest_031.expected
M tests/unit/fixtures/searchText/browsertest_032.expected
M tests/unit/fixtures/searchText/browsertest_033.expected
M tests/unit/fixtures/searchText/browsertest_034.expected
M tests/unit/fixtures/searchText/browsertest_035.expected
M tests/unit/fixtures/searchText/browsertest_036.expected
M tests/unit/fixtures/searchText/browsertest_037.expected
M tests/unit/fixtures/searchText/browsertest_038.expected
M tests/unit/fixtures/searchText/browsertest_039.expected
M tests/unit/fixtures/searchText/browsertest_040.expected
M tests/unit/fixtures/searchText/browsertest_041.expected
M tests/unit/fixtures/searchText/browsertest_042.expected
M tests/unit/fixtures/searchText/browsertest_043.expected
M tests/unit/fixtures/searchText/browsertest_044.expected
M tests/unit/fixtures/searchText/browsertest_045.expected
M tests/unit/fixtures/searchText/browsertest_046.expected
M tests/unit/fixtures/searchText/browsertest_047.expected
M tests/unit/fixtures/searchText/browsertest_048.expected
M tests/unit/fixtures/searchText/browsertest_049.expected
M tests/unit/fixtures/searchText/browsertest_050.expected
M tests/unit/fixtures/searchText/browsertest_051.expected
M tests/unit/fixtures/searchText/browsertest_052.expected
M tests/unit/fixtures/searchText/browsertest_053.expected
M tests/unit/fixtures/searchText/browsertest_054.expected
M tests/unit/fixtures/searchText/browsertest_055.expected
M tests/unit/fixtures/searchText/browsertest_056.expected
M tests/unit/fixtures/searchText/browsertest_057.expected
M tests/unit/fixtures/searchText/browsertest_058.expected
M tests/unit/fixtures/searchText/browsertest_059.expected
M tests/unit/fixtures/searchText/browsertest_060.expected
M 

[MediaWiki-commits] [Gerrit] labs...staticfiles[master]: Add parsley javascript library

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Add parsley javascript library
..

Add parsley javascript library

- Add the parsley javascript library.
- Add register.js for registration wizard.
- New css for parsley and registration wizard.

Bug: T144710
Change-Id: Id351c9d99c9cf8597c54e7d614be768e6667a92d
---
A css/site.70075b35c56a.css
M css/site.css
A js/parsley.min.9423fbd825cc.js
A js/parsley.min.js
A js/parsley.min.js.5b8729e5acc1.map
A js/parsley.min.js.map
A js/register.859d3221d1c9.js
A js/register.js
M staticfiles.json
9 files changed, 203 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker/staticfiles 
refs/changes/52/313152/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id351c9d99c9cf8597c54e7d614be768e6667a92d
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker/staticfiles
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: striker: Add config for Wikitech URL

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

Change subject: striker: Add config for Wikitech URL
..


striker: Add config for Wikitech URL

Change-Id: I5c1629516ef22b5b24e28e27e14611ca05caf548
---
M puppet/hieradata/common.yaml
M puppet/modules/role/manifests/striker.pp
M puppet/modules/role/templates/striker/striker.ini.erb
3 files changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index fbc6a85..58c3223 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -389,6 +389,7 @@
 role::striker::phabricator_user: striker
 role::striker::phabricator_token: "!Set in local.yaml after creating bot!"
 role::striker::phabricator_repo_admin_group: "!Set in local.yaml after 
creating group!"
+role::striker::wikitech_url: 
"http://ldapauth%{hiera('mediawiki::multiwiki::base_domain')}%{::port_fragment}"
 role::striker::use_xff: false
 
 role::oauth::dir: "%{hiera('mwv::services_dir')}/oauth-hello-world"
diff --git a/puppet/modules/role/manifests/striker.pp 
b/puppet/modules/role/manifests/striker.pp
index 3c852f8..7bd2487 100644
--- a/puppet/modules/role/manifests/striker.pp
+++ b/puppet/modules/role/manifests/striker.pp
@@ -43,6 +43,9 @@
 # [*phabricator_repo_admin_group*]
 #   PHID of git repository administrators group
 #
+# [*wikitech_url*]
+#   URL to Wikitech instance.
+#
 # [*use_xff*]
 #   Use X-Forwared-For provided IP address for rate limiting
 #
@@ -62,6 +65,7 @@
 $phabricator_user,
 $phabricator_token,
 $phabricator_repo_admin_group,
+$wikitech_url,
 $use_xff,
 $xff_trusted_hosts = undef,
 ){
diff --git a/puppet/modules/role/templates/striker/striker.ini.erb 
b/puppet/modules/role/templates/striker/striker.ini.erb
index ce8ec7f..c5fe26a 100644
--- a/puppet/modules/role/templates/striker/striker.ini.erb
+++ b/puppet/modules/role/templates/striker/striker.ini.erb
@@ -53,3 +53,6 @@
 HANDLERS = file
 LEVEL = DEBUG
 FILE_FILENAME = <%= @log_dir %>/striker/django.log
+
+[wikitech]
+SERVER_URL = <%= @wikitech_url %>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5c1629516ef22b5b24e28e27e14611ca05caf548
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: striker: Add config for Wikitech URL

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: striker: Add config for Wikitech URL
..

striker: Add config for Wikitech URL

Change-Id: I5c1629516ef22b5b24e28e27e14611ca05caf548
---
M puppet/hieradata/common.yaml
M puppet/modules/role/manifests/striker.pp
M puppet/modules/role/templates/striker/striker.ini.erb
3 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/51/313151/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index fbc6a85..58c3223 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -389,6 +389,7 @@
 role::striker::phabricator_user: striker
 role::striker::phabricator_token: "!Set in local.yaml after creating bot!"
 role::striker::phabricator_repo_admin_group: "!Set in local.yaml after 
creating group!"
+role::striker::wikitech_url: 
"http://ldapauth%{hiera('mediawiki::multiwiki::base_domain')}%{::port_fragment}"
 role::striker::use_xff: false
 
 role::oauth::dir: "%{hiera('mwv::services_dir')}/oauth-hello-world"
diff --git a/puppet/modules/role/manifests/striker.pp 
b/puppet/modules/role/manifests/striker.pp
index 3c852f8..7bd2487 100644
--- a/puppet/modules/role/manifests/striker.pp
+++ b/puppet/modules/role/manifests/striker.pp
@@ -43,6 +43,9 @@
 # [*phabricator_repo_admin_group*]
 #   PHID of git repository administrators group
 #
+# [*wikitech_url*]
+#   URL to Wikitech instance.
+#
 # [*use_xff*]
 #   Use X-Forwared-For provided IP address for rate limiting
 #
@@ -62,6 +65,7 @@
 $phabricator_user,
 $phabricator_token,
 $phabricator_repo_admin_group,
+$wikitech_url,
 $use_xff,
 $xff_trusted_hosts = undef,
 ){
diff --git a/puppet/modules/role/templates/striker/striker.ini.erb 
b/puppet/modules/role/templates/striker/striker.ini.erb
index ce8ec7f..c5fe26a 100644
--- a/puppet/modules/role/templates/striker/striker.ini.erb
+++ b/puppet/modules/role/templates/striker/striker.ini.erb
@@ -53,3 +53,6 @@
 HANDLERS = file
 LEVEL = DEBUG
 FILE_FILENAME = <%= @log_dir %>/striker/django.log
+
+[wikitech]
+SERVER_URL = <%= @wikitech_url %>

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: WIP: Expose references in a new endpoint

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

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

Change subject: WIP: Expose references in a new endpoint
..

WIP: Expose references in a new endpoint

Bug: T146398
Change-Id: I047a05d5bc4d4386f3b606d2f3aed33ee61cd109
---
M routes/mobile-sections.js
M test/features/mobile-sections/pagecontent.js
2 files changed, 35 insertions(+), 0 deletions(-)


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

diff --git a/routes/mobile-sections.js b/routes/mobile-sections.js
index 1bbd12f..8479e89 100644
--- a/routes/mobile-sections.js
+++ b/routes/mobile-sections.js
@@ -154,6 +154,19 @@
 };
 }
 
+function buildReferences(input) {
+var remaining = buildRemaining(input);
+var sections = [];
+remaining.sections.forEach(function (section) {
+  if (section.isReferenceSection) {
+sections.push(section);
+  }
+});
+return {
+  sections: sections
+};
+}
+
 function buildAll(input) {
 return {
 lead: buildLead(input),
@@ -236,6 +249,21 @@
 });
 });
 
+/**
+ * GET {domain}/v1/page/references/{title}/{revision:?}
+ * Gets any sections which are part of a reference sections for a given wiki 
page.
+ */
+router.get('/mobile-sections-references/:title/:revision?', function (req, 
res) {
+return BBPromise.props({
+page: parsoid.pageContentPromise(app, req)
+}).then(function (response) {
+res.status(200);
+mUtil.setETag(req, res, response.page.revision);
+mUtil.setContentType(res, mUtil.CONTENT_TYPES.mobileSections);
+res.json(buildReferences(response)).end();
+});
+});
+
 module.exports = function (appObj) {
 app = appObj;
 return {
diff --git a/test/features/mobile-sections/pagecontent.js 
b/test/features/mobile-sections/pagecontent.js
index e7ff9e6..0bd96f5 100644
--- a/test/features/mobile-sections/pagecontent.js
+++ b/test/features/mobile-sections/pagecontent.js
@@ -166,6 +166,13 @@
 });
 });
 });
+it('Any sections that contain references should have a reference section', 
function() {
+return preq.get({uri: server.config.uri + 
'en.wikipedia.org/v1/page/mobile-sections-references/Barack_Obama'})
+.then(function (res) {
+assert.equal(res.status, 200);
+assert.equal(res.body.sections.length, 4, 'Barack Obama has 4 
reference sections');
+});
+});
 it('Page with math formulas should load without error', function() {
 return preq.get({uri: server.config.uri + 
'de.wikipedia.org/v1/page/mobile-sections/Verallgemeinerter_Laplace-Operator'})
 .then(function (res) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I047a05d5bc4d4386f3b606d2f3aed33ee61cd109
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Mark reference sections with isReferenceSection flag

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

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

Change subject: Mark reference sections with isReferenceSection flag
..

Mark reference sections with isReferenceSection flag

When a section is a reference section add a flag for API consumers.
This is helpful for the lazy loading use case in MobileFrontend.

a follow up patch will expose reference sections in a separate endpoint

Bug: T146398
Change-Id: I2ed205781c65576f0b874491497268c4b5291442
---
M routes/mobile-sections.js
M test/features/mobile-sections/pagecontent.js
2 files changed, 58 insertions(+), 1 deletion(-)


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

diff --git a/routes/mobile-sections.js b/routes/mobile-sections.js
index 3dee7ac..1bbd12f 100644
--- a/routes/mobile-sections.js
+++ b/routes/mobile-sections.js
@@ -58,6 +58,46 @@
 });
 }
 
+/**
+ * Scan an array of sections and add an isReferenceSection property to any 
sections that
+ * contain references.
+ *
+ * @param {Array} sections to scan for references
+ * @param {Boolean} [removeText] whether to remove references from the section 
text after marking
+ */
+function markReferenceSections( sections, removeText ) {
+  var topHeadingLevel = sections[0] ? sections[0].toclevel : 2;
+  var lastTopLevelSection,
+isReferenceSection = false;
+
+  function mark( from, to ) {
+if ( isReferenceSection && from !== undefined ) {
+  // Mark all the sections between the last heading and this one as 
reference sections
+  sections.slice( from, to ).forEach( function ( section ) {
+section.isReferenceSection = true;
+if ( removeText ) {
+  delete section.text;
+}
+  } );
+}
+  }
+
+  sections.forEach( function ( section, i ) {
+var text = section.text;
+if ( section.toclevel === topHeadingLevel ) {
+  mark( lastTopLevelSection, i );
+  // reset the top level section and begin the hunt for references again.
+  lastTopLevelSection = i;
+  isReferenceSection = false;
+}
+if ( text.indexOf( 'class="mw-references' ) > -1 || text.indexOf( 
'class="refbegin' ) > -1 ) {
+  isReferenceSection = true;
+}
+  } );
+  // the last section may have been a reference section
+  mark( lastTopLevelSection, sections.length - 1 );
+}
+
 function buildLeadSections(sections) {
 var out = [],
 section,
@@ -105,8 +145,12 @@
 }
 
 function buildRemaining(input) {
+   // don't repeat the first section in remaining
+var sections = input.page.sections.slice(1);
+// mark references sections with a flag
+markReferenceSections( sections, false );
 return {
-sections: input.page.sections.slice(1) // don't repeat the first 
section
+sections: sections
 };
 }
 
diff --git a/test/features/mobile-sections/pagecontent.js 
b/test/features/mobile-sections/pagecontent.js
index 1bb4e3d..e7ff9e6 100644
--- a/test/features/mobile-sections/pagecontent.js
+++ b/test/features/mobile-sections/pagecontent.js
@@ -153,6 +153,19 @@
 assert.contains(res.body.lead.sections[0].text, '');
 });
 });
+it('Any sections that contain references should have a reference section', 
function() {
+return preq.get({uri: server.config.uri + 
'en.wikipedia.org/v1/page/mobile-sections/Barack_Obama'})
+.then(function (res) {
+assert.equal(res.status, 200);
+res.body.remaining.sections.forEach(function(section) {
+  if ( [ 'Notes and references', 'Notes', 'References', 
'Further reading' ].indexOf( section.line ) > -1 ) {
+assert.ok(section.isReferenceSection === true, 
section.line + ' should have a reference flag');
+  } else {
+assert.ok(section.isReferenceSection === undefined, 
section.line + ' should have no reference flag');
+  }
+});
+});
+});
 it('Page with math formulas should load without error', function() {
 return preq.get({uri: server.config.uri + 
'de.wikipedia.org/v1/page/mobile-sections/Verallgemeinerter_Laplace-Operator'})
 .then(function (res) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ed205781c65576f0b874491497268c4b5291442
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: [wip] Store the number of pageviews users have before seeing...

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

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

Change subject: [wip] Store the number of pageviews users have before seeing 
notifs
..

[wip] Store the number of pageviews users have before seeing notifs

Bug: T114841
Change-Id: Ia16638b3decfb9a01d0359ddc76990b64deac1c8
---
A includes/PageViewsLogger.php
1 file changed, 180 insertions(+), 0 deletions(-)


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

diff --git a/includes/PageViewsLogger.php b/includes/PageViewsLogger.php
new file mode 100644
index 000..05a
--- /dev/null
+++ b/includes/PageViewsLogger.php
@@ -0,0 +1,180 @@
+user = $user;
+   }
+
+   /**
+* @param User $user
+* @return EchoPageViews
+*/
+   public static function newFromUser( User $user ) {
+   return new self( $user );
+   }
+
+   /**
+* Increment the counter for this notification type
+*
+* @param string $type Given type
+*/
+   public function increment( $type = 'all', $currSeenTime = null ) {
+   if ( $type === 'all' ) {
+   foreach ( self::$allowedTypes as $allowed ) {
+   $this->increment( $allowed );
+   }
+   return;
+   }
+
+   if ( !$this->validateType( $type ) ) {
+   return;
+   }
+
+   // Get the current relevant seen time
+   $currSeenTime = $currSeenTime !== null ?
+   $currSeenTime :
+   EchoSeenTime::newFromUser( $this->user )->getTime( 
$type );
+
+   // Store the new value in the cache, if relevant
+   $this->cache()->merge(
+   $this->getMemcKey( $type ),
+   function ( BagOStuff $cache, $key, $value ) use ( 
$currSeenTime ) {
+   $count = 1;
+   $newSeenTime = $currSeenTime;
+
+   // Value is an array of [ count => 0, seenTime 
=> seenTimeItCountsFor ]
+   if (
+   $value &&
+   isset( $value[ 'count' ] ) &&
+   isset( $value[ 'seenTime' ] ) &&
+   $currSeenTime === $value[ 'seenTime' ]
+   ) {
+   $newSeenTime = $value[ 'seenTime' ];
+   // Increase count
+   $count = ( (int)$value[ 'count' ] )++;
+   }
+
+   return array( 'count' => $count, 'seenTime' => 
$newSeenTime );
+   }
+   );
+   }
+
+   public function getStoredCount( $type ) {
+   // It makes no sense to ask for "all" here in
+   // case the count is different.
+   if ( !$this->validateType( $type ) ) {
+   return false;
+   }
+
+   $data = self::cache()->get( $this->getMemcKey( $type ) );
+
+   if ( $data && isset( $data[ 'count' ] ) ) {
+   return $data[ 'count' ];
+   } else {
+   // Nonexisting. Return 0
+   return 0;
+   }
+   }
+
+   public function getStoredSeenTime( $type ) {
+   // It makes no sense to ask for "all" here in
+   // case the count is different.
+   if ( !$this->validateType( $type ) ) {
+   return false;
+   }
+
+   $data = self::cache()->get( $this->getMemcKey( $type ) );
+
+   if ( $data && isset( $data[ 'seenTime' ] ) ) {
+   return $data[ 'seenTime' ];
+   } else {
+   // Nonexisting. Return 0
+   return 0;
+   }
+   }
+
+   /**
+* Hold onto a cache for our operations. Static so it can reuse the same
+* in-process cache in different instances.
+*
+* @return BagOStuff
+*/
+   private static function cache() {
+   static $c = null;
+
+   // Use main stash for persistent storage, and
+   // wrap it with CachedBagOStuff for an in-process
+   // cache. (T144534)
+   if ( $c === null ) {
+   $c = new CachedBagOStuff(
+   ObjectCache::getMainStashInstance()
+   );
+   }
+
+   return $c;
+   }
+
+   /**
+* Build a memcached key.
+*
+* @param string $type Given notification type
+* 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove obsolete search bar variables

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

Change subject: Remove obsolete search bar variables
..


Remove obsolete search bar variables

Removing Less variables for search bar, which are not
used any more.

Change-Id: I2fcda0e682253186c131b1e4f6a5c8de0e231fd5
---
M minerva.less/minerva.variables.less
M resources/mobile.pagelist.styles/pagelist.less
2 files changed, 1 insertion(+), 7 deletions(-)

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



diff --git a/minerva.less/minerva.variables.less 
b/minerva.less/minerva.variables.less
index 658c6a2..6bc5100 100644
--- a/minerva.less/minerva.variables.less
+++ b/minerva.less/minerva.variables.less
@@ -2,12 +2,6 @@
 
 @skinContentBgColor: #fff;
 
-// Search bar
-@searchBarPaddingLeft: 40px;
-@searchBarPaddingRight: 40px;
-@searchResultPaddingVertical: 12px;
-@searchBoxColor: #fafafa;
-
 // Navigation Drawers
 @menuWidth: 240px;
 @rightDrawerWidth: 60%;
diff --git a/resources/mobile.pagelist.styles/pagelist.less 
b/resources/mobile.pagelist.styles/pagelist.less
index a40bcee..3cb6c66 100644
--- a/resources/mobile.pagelist.styles/pagelist.less
+++ b/resources/mobile.pagelist.styles/pagelist.less
@@ -6,7 +6,7 @@
 @thumbGap: 15px;
 @thumbWidth: 70px;
 @thumbSpace: @thumbWidth + @thumbGap;
-@thumbOverlayWidth: @searchBarPaddingLeft;
+@thumbOverlayWidth: 40px;
 @thumbOverlaySpace: @thumbOverlayWidth + @thumbGap;
 @pageSummaryHeaderColor: #404040;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2fcda0e682253186c131b1e4f6a5c8de0e231fd5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: VolkerE 
Gerrit-Reviewer: Bmansurov 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove obsolete search bar variables

2016-09-27 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review.

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

Change subject: Remove obsolete search bar variables
..

Remove obsolete search bar variables

Removing Less variables for search bar, which are not
used any more.

Change-Id: I2fcda0e682253186c131b1e4f6a5c8de0e231fd5
---
M minerva.less/minerva.variables.less
M resources/mobile.pagelist.styles/pagelist.less
2 files changed, 1 insertion(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/47/313147/1

diff --git a/minerva.less/minerva.variables.less 
b/minerva.less/minerva.variables.less
index 658c6a2..6bc5100 100644
--- a/minerva.less/minerva.variables.less
+++ b/minerva.less/minerva.variables.less
@@ -2,12 +2,6 @@
 
 @skinContentBgColor: #fff;
 
-// Search bar
-@searchBarPaddingLeft: 40px;
-@searchBarPaddingRight: 40px;
-@searchResultPaddingVertical: 12px;
-@searchBoxColor: #fafafa;
-
 // Navigation Drawers
 @menuWidth: 240px;
 @rightDrawerWidth: 60%;
diff --git a/resources/mobile.pagelist.styles/pagelist.less 
b/resources/mobile.pagelist.styles/pagelist.less
index a40bcee..3cb6c66 100644
--- a/resources/mobile.pagelist.styles/pagelist.less
+++ b/resources/mobile.pagelist.styles/pagelist.less
@@ -6,7 +6,7 @@
 @thumbGap: 15px;
 @thumbWidth: 70px;
 @thumbSpace: @thumbWidth + @thumbGap;
-@thumbOverlayWidth: @searchBarPaddingLeft;
+@thumbOverlayWidth: 40px;
 @thumbOverlaySpace: @thumbOverlayWidth + @thumbGap;
 @pageSummaryHeaderColor: #404040;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fcda0e682253186c131b1e4f6a5c8de0e231fd5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: VolkerE 

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Null out default config in tearDown

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

Change subject: Null out default config in tearDown
..


Null out default config in tearDown

Change-Id: I2152fd99730b504d8d7f646fee6d077d9702244f
---
M Tests/BaseSmashPigUnitTestCase.php
M Tests/TestingConfiguration.php
2 files changed, 9 insertions(+), 0 deletions(-)

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



diff --git a/Tests/BaseSmashPigUnitTestCase.php 
b/Tests/BaseSmashPigUnitTestCase.php
index 90a6cf1..bc6cb9c 100644
--- a/Tests/BaseSmashPigUnitTestCase.php
+++ b/Tests/BaseSmashPigUnitTestCase.php
@@ -19,6 +19,7 @@
 
function tearDown() {
Context::set(); // Nullify the context for next run.
+   TestingConfiguration::tearDownConfiguration(); // And the 
default config
}
 
function loadJson( $path ) {
diff --git a/Tests/TestingConfiguration.php b/Tests/TestingConfiguration.php
index 0b8db27..c710566 100644
--- a/Tests/TestingConfiguration.php
+++ b/Tests/TestingConfiguration.php
@@ -2,6 +2,7 @@
 
 namespace SmashPig\Tests;
 
+use ReflectionClass;
 use SmashPig\Core\Configuration;
 
 /**
@@ -37,4 +38,11 @@
$config->override( $data );
return $config;
}
+
+   public static function tearDownConfiguration() {
+   $konfig = new ReflectionClass( 'SmashPig\Core\Configuration' );
+   $defaultConfig = $konfig->getProperty( 'defaultObj' );
+   $defaultConfig->setAccessible( true );
+   $defaultConfig->setValue( null );
+   }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2152fd99730b504d8d7f646fee6d077d9702244f
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Align greys to improved color palette

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

Change subject: Align greys to improved color palette
..


Align greys to improved color palette

Aligning greys to new & improved color palette
https://phabricator.wikimedia.org/M82
Also unifying color values, removing obsolete variables and replacing
fixed `border-radius` values with global variable.

Bug: T146799
Change-Id: I581cfae10a3c99b1a7513933a4ad938d7a5139e2
Depends-on: I40d69e5fdb5456511be4884f947635179aaf1020
---
M minerva.less/minerva.variables.less
M resources/mobile.editor.ve/VisualEditorOverlay.less
M resources/mobile.messageBox/messageBox.less
M resources/mobile.notifications.overlay/NotificationsOverlay.less
M resources/mobile.overlays/Overlay.less
M resources/mobile.pagelist.styles/pagelist.less
M resources/mobile.pointerOverlay/PointerOverlay.less
M resources/mobile.special.pagefeed.styles/pagefeed.less
M resources/mobile.toast/toast.less
M resources/skins.minerva.base.styles/ui.less
M resources/skins.minerva.content.styles/main.less
M resources/skins.minerva.special.styles/common.less
M resources/skins.minerva.special.userlogin.styles/userlogin.less
M resources/skins.minerva.userpage.styles/userpage.less
14 files changed, 30 insertions(+), 42 deletions(-)

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



diff --git a/minerva.less/minerva.variables.less 
b/minerva.less/minerva.variables.less
index 495c906..658c6a2 100644
--- a/minerva.less/minerva.variables.less
+++ b/minerva.less/minerva.variables.less
@@ -23,10 +23,7 @@
 // Content
 @contentMargin: 16px;
 
-// old header
-@headerBorderBottom: #e3e3e3;
-
-// new header
+// Header
 @headerTitleFontSize: 1em;
 @headerHeight: 3.35em;
 @headerMarginTop: -1px;  // used to hide the header border top when a banner 
is not present
@@ -34,7 +31,7 @@
 @titleSectionSpacingTop: 20px;
 @titleSectionSpacingBottom: 25px;
 
-@grayDark: #252525;
+@grayDark: @colorGray2;
 @grayMediumDark: @colorGray5;
 @grayMedium: @colorGray7;
 @grayMediumLight: @colorGray10;
@@ -50,7 +47,7 @@
 @colorTutorial: #2e76ff;
 @linkColor: #002bb8;
 @lastModifiedBarActiveBackgroundColor: #00af8b;
-@toastNotificationColor: #373737;
+@toastNotificationColor: @colorGray2;
 
 // Use when an element is selected. FIXME: This should be in mediawiki ui.
 @selectedBackgroundColor: #e6eeff;
@@ -72,12 +69,10 @@
 @contentLineHeight: 1.65;
 
 @headingMargin: 0.5em;
-// FIXME: Merge with @grayLightest (?)
-@sectionBorderColor: #e2e3e4;
 @sectionIconWidth: 30px;
 
 // information messages, e.g. empty watchlist message
-@infoColor: #707070;
+@infoColor: @colorGray7;
 
 // blockquotes
 @blockquotePaddingRight: 25px;
@@ -92,9 +87,6 @@
 // note since content does not use view border box we have to include padding.
 @contentMaxWidthTablet: @wgMFDeviceWidthDesktop - ( 2 * @contentPaddingTablet 
);
 @contentTopPadding: 1.6em;
-
-// calculated colors
-@searchBoxColorTo: darken( @searchBoxColor, 2.75% );
 
 // Wiki specific variables
 @infoboxWidth: 320px;
diff --git a/resources/mobile.editor.ve/VisualEditorOverlay.less 
b/resources/mobile.editor.ve/VisualEditorOverlay.less
index c5de245..9b69745 100644
--- a/resources/mobile.editor.ve/VisualEditorOverlay.less
+++ b/resources/mobile.editor.ve/VisualEditorOverlay.less
@@ -7,7 +7,7 @@
// heading styles to the header tags directly.
h1, h2 {
margin-bottom: 0.5em;
-   border-bottom: solid 1px @sectionBorderColor;
+   border-bottom: solid 1px @colorGray14;
overflow: hidden;
}
 
diff --git a/resources/mobile.messageBox/messageBox.less 
b/resources/mobile.messageBox/messageBox.less
index 1e5a659..debf81f 100644
--- a/resources/mobile.messageBox/messageBox.less
+++ b/resources/mobile.messageBox/messageBox.less
@@ -8,7 +8,7 @@
 .mw-revision {
border: 1px solid @colorGray12;
background-color: @colorGray14;
-   color: @grayDark;
+   color: @colorGray2;
 }
 
 .successbox {
diff --git a/resources/mobile.notifications.overlay/NotificationsOverlay.less 
b/resources/mobile.notifications.overlay/NotificationsOverlay.less
index f57b292..494c478 100644
--- a/resources/mobile.notifications.overlay/NotificationsOverlay.less
+++ b/resources/mobile.notifications.overlay/NotificationsOverlay.less
@@ -26,7 +26,7 @@
padding: 0.5em;
font-size: 1.5em;
box-shadow: none;
-   border: 1px solid #666;
+   border: 1px solid @colorGray6;
// Override the positioning of the menu
// so it is "stuck" on the bottom of the
// notification overlay panel
diff --git a/resources/mobile.overlays/Overlay.less 
b/resources/mobile.overlays/Overlay.less
index c45cdc7..f0cdc8d 100644
--- 

[MediaWiki-commits] [Gerrit] labs/striker[master]: Use consistent naming for accounts

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Use consistent naming for accounts
..

Use consistent naming for accounts

Don't use the confusing and  mostly WMF internal "SUL" name for Wikimedia
unified accounts. Since the SUL unification is complete, just say
"Wikimedia" or "Wikimedia account" as appropriate. Similarly, don't add
the "Labs" qualifier when talking about a user's LDAP account. We only
have one LDAP system and it is used in both Labs and WMF production for
various things.

Change-Id: I868047619681365a8a8a94d6ecc2a467e75579a9
---
M striker/templates/goals/ACCOUNT_PHAB.html
M striker/templates/goals/ACCOUNT_SUL.html
M striker/templates/profile/settings/base.html
M striker/templates/profile/settings/phabricator.html
M striker/templates/profile/settings/sul.html
5 files changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/45/313145/1

diff --git a/striker/templates/goals/ACCOUNT_PHAB.html 
b/striker/templates/goals/ACCOUNT_PHAB.html
index 4b0784f..96b8824 100644
--- a/striker/templates/goals/ACCOUNT_PHAB.html
+++ b/striker/templates/goals/ACCOUNT_PHAB.html
@@ -4,6 +4,6 @@
 {% block title %}{% trans "Connect with your Phabricator account" %}{% 
endblock %}
 
 {% block body %}
-{% blocktrans %}Connect your Tool Labs account with your Phabricator 
account so that you can manage git repositories for your tools.{% endblocktrans 
%}
+{% blocktrans %}Connect with your Phabricator account so that you can 
manage git repositories for your tools.{% endblocktrans %}
 {% trans "Connect now" %}
 {% endblock %}
diff --git a/striker/templates/goals/ACCOUNT_SUL.html 
b/striker/templates/goals/ACCOUNT_SUL.html
index 86283ec..f13792f 100644
--- a/striker/templates/goals/ACCOUNT_SUL.html
+++ b/striker/templates/goals/ACCOUNT_SUL.html
@@ -1,9 +1,9 @@
 {% extends "goals/base.html" %}
 {% load i18n %}
 
-{% block title %}{% trans "Connect with your Wikimedia unified account" %}{% 
endblock %}
+{% block title %}{% trans "Connect with your Wikimedia account" %}{% endblock 
%}
 
 {% block body %}
-{% blocktrans %}Connect your Tool Labs account with your Wikimedia unified 
account.{% endblocktrans %}
+{% blocktrans %}Connect your LDAP account with your Wikimedia account.{% 
endblocktrans %}
 Connect now
 {% endblock %}
diff --git a/striker/templates/profile/settings/base.html 
b/striker/templates/profile/settings/base.html
index d557727..42d61dd 100644
--- a/striker/templates/profile/settings/base.html
+++ b/striker/templates/profile/settings/base.html
@@ -13,8 +13,8 @@
   
 {% trans "Accounts" %}
 
-{% trans "Labs LDAP" %}
-{% trans "Wikimedia SUL" %}
+{% trans "LDAP" %}
+{% trans "Wikimedia" %}
   {% trans "Phabricator" 
%}
 
   
diff --git a/striker/templates/profile/settings/phabricator.html 
b/striker/templates/profile/settings/phabricator.html
index b3f2682..a793438 100644
--- a/striker/templates/profile/settings/phabricator.html
+++ b/striker/templates/profile/settings/phabricator.html
@@ -23,7 +23,7 @@
 {% bootstrap_icon "pushpin" %} {% trans "Linked 
Phabricator account not found" %}
   
   
-{% blocktrans with url=phab_url%}Login to Phabricator using your Wikimedia unified account or your Labs LDAP 
account to create a new Phabricator account if you do not have one.{% 
endblocktrans %}
+{% blocktrans with url=phab_url%}Login to Phabricator using your Wikimedia unified account or your LDAP account 
to create a new Phabricator account if you do not have one.{% endblocktrans 
%}
 {% trans "Connect Phabricator account" %}
   
 
diff --git a/striker/templates/profile/settings/sul.html 
b/striker/templates/profile/settings/sul.html
index e181ae8..cd91443 100644
--- a/striker/templates/profile/settings/sul.html
+++ b/striker/templates/profile/settings/sul.html
@@ -20,10 +20,10 @@
 {% else %}
 
   
-{% bootstrap_icon "pushpin" %} {% trans "Linked 
Wikimedia OAuth account not found" %}
+{% bootstrap_icon "pushpin" %} {% trans "Linked 
Wikimedia account not found" %}
   
   
-{% blocktrans %}Link your Labs LDAP and Wikimedia unified accounts by 
logging in using OAuth.{% endblocktrans %}
+{% blocktrans %}Link your LDAP and Wikimedia accounts by logging in 
using OAuth.{% endblocktrans %}
 {% trans "Login using OAuth" %}
   
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I868047619681365a8a8a94d6ecc2a467e75579a9
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org

[MediaWiki-commits] [Gerrit] labs/striker[master]: Add client side registration form validation

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Add client side registration form validation
..

Add client side registration form validation

Add client side form validation to the registration wizard forms using
the parsley javascript library. We are using django-parsley for its
helper functions, but a newer version of the parsley library than it
ships.

Bug: T144710
Change-Id: Id4cf08cb9e233f7436cb7910eb22f451ce2f6e74
---
M requirements.txt
A static/js/parsley.min.js
A static/js/parsley.min.js.map
A static/js/register.js
M striker/register/forms.py
M striker/register/urls.py
M striker/register/views.py
M striker/templates/register/base.html
M striker/templates/register/confirm.html
M striker/templates/register/email.html
M striker/templates/register/ldap.html
M striker/templates/register/password.html
M striker/templates/register/shell.html
13 files changed, 165 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/42/313142/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4cf08cb9e233f7436cb7910eb22f451ce2f6e74
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Lower $wgTrxProfilerLimits for JobRunner a bit

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

Change subject: Lower $wgTrxProfilerLimits for JobRunner a bit
..


Lower $wgTrxProfilerLimits for JobRunner a bit

Jobs should always use query batching.

Change-Id: Iddbcc32b44e6c71feb66e2f52afb20e824e6eb72
---
M includes/DefaultSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 7facf2f..f8626e9 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -6022,7 +6022,7 @@
'JobRunner' => [
'readQueryTime' => 30,
'writeQueryTime' => 5,
-   'maxAffected' => 1000
+   'maxAffected' => 500 // ballpark of $wgUpdateRowsPerQuery
],
// Command-line scripts
'Maintenance' => [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iddbcc32b44e6c71feb66e2f52afb20e824e6eb72
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
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] labs/striker[master]: Add check for unique sul account, username, and shell account

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Add check for unique sul account, username, and shell account
..

Add check for unique sul account, username, and shell account

Check that the SUL account, username, and shell name used to create the
new account are unique.

Bug: T144710
Change-Id: I0eb71683f3dbd306bf1be83d6b725c28768d515a
---
M striker/register/forms.py
M striker/register/urls.py
A striker/register/utils.py
M striker/register/views.py
M striker/templates/register/index.html
5 files changed, 99 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/40/313140/1

diff --git a/striker/register/forms.py b/striker/register/forms.py
index fa3b139..f4328ac 100644
--- a/striker/register/forms.py
+++ b/striker/register/forms.py
@@ -25,6 +25,8 @@
 from django.core.exceptions import ValidationError
 from django.utils.translation import ugettext_lazy as _
 
+from striker.register import utils
+
 
 logger = logging.getLogger(__name__)
 
@@ -40,9 +42,11 @@
 )
 
 def clean_username(self):
-# TODO: check that is unused globally
+username = self.cleaned_data['username']
+if not utils.username_available(username):
+raise forms.ValidationError(_('Username is already in use.'))
 # TODO: check that it isn't banned by some abusefilter type rule
-pass
+return username
 
 
 class ShellUsername(forms.Form):
@@ -64,9 +68,11 @@
 )
 
 def clean_shellname(self):
-# TODO: check that is unused globally
+shellname = self.cleaned_data['shellname']
+if not utils.shellname_available(shellname):
+raise forms.ValidationError(_('Shell account is already in use.'))
 # TODO: check that it isn't banned by some abusefilter type rule
-pass
+return shellname
 
 
 class Email(forms.Form):
@@ -92,7 +98,7 @@
 )
 confirm = forms.CharField(
 label=_('Confirm password'),
-min_length=10,
+required=True,
 widget=forms.PasswordInput
 )
 
diff --git a/striker/register/urls.py b/striker/register/urls.py
index ef22fcd..54b3957 100644
--- a/striker/register/urls.py
+++ b/striker/register/urls.py
@@ -28,6 +28,6 @@
 
 urlpatterns = [
 urls.url(r'^$', 'striker.register.views.index', name='index'),
-# urls.url(r'^done$', wizard, name='done'),
+urls.url(r'^oauth$', 'striker.register.views.oauth', name='oauth'),
 urls.url(r'^(?P.+)$', wizard, name='wizard'),
 ]
diff --git a/striker/register/utils.py b/striker/register/utils.py
new file mode 100644
index 000..3e9ece9
--- /dev/null
+++ b/striker/register/utils.py
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2016 Wikimedia Foundation and contributors.
+# All Rights Reserved.
+#
+# This file is part of Striker.
+#
+# Striker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Striker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Striker.  If not, see .
+
+import logging
+
+from striker.tools.models import Maintainer
+from striker.labsauth.models import LabsUser
+
+
+logger = logging.getLogger(__name__)
+
+
+def sul_available(name):
+try:
+LabsUser.objects.get(sulname=name)
+except LabsUser.DoesNotExist:
+return True
+else:
+return False
+
+
+def username_available(name):
+try:
+Maintainer.objects.get(full_name=name)
+except Maintainer.DoesNotExist:
+return True
+else:
+return False
+
+
+def shellname_available(name):
+try:
+Maintainer.objects.get(username=name)
+except Maintainer.DoesNotExist:
+return True
+else:
+return False
diff --git a/striker/register/views.py b/striker/register/views.py
index cb81e4e..e407fc0 100644
--- a/striker/register/views.py
+++ b/striker/register/views.py
@@ -18,12 +18,14 @@
 # You should have received a copy of the GNU General Public License
 # along with Striker.  If not, see .
 
+import functools
 import logging
 import re
 
 from django import shortcuts
 from django.contrib import messages
 from django.core import urlresolvers
+from django.utils.decorators import method_decorator
 from django.utils.translation import ugettext_lazy as _
 
 from formtools.wizard.views import NamedUrlSessionWizardView
@@ -31,9 +33,22 @@
 from striker.labsauth.views import OAUTH_EMAIL_KEY
 

[MediaWiki-commits] [Gerrit] labs/striker[master]: Add a goal prompt for SSH public key upload

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Add a goal prompt for SSH public key upload
..

Add a goal prompt for SSH public key upload

We need to add support for two-factor auth users before we can allow
managing ssh keys directly in Striker, but for now we can at least add
a goal that prompts the user to upload their key via the existing
screens on Wikitech.

Bug: T144710
Change-Id: I0684d47e9699af4a631636193ab869ab10dc2870
---
M striker/goals/__init__.py
M striker/goals/signals/handlers.py
M striker/labsauth/models.py
M striker/settings.py
M striker/striker.ini
M striker/templates/goals/ACCOUNT_PHAB.html
A striker/templates/goals/ACCOUNT_SSH.html
M striker/views.py
8 files changed, 62 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/46/313146/1

diff --git a/striker/goals/__init__.py b/striker/goals/__init__.py
index 3ebe6cf..a3974dd 100644
--- a/striker/goals/__init__.py
+++ b/striker/goals/__init__.py
@@ -21,6 +21,7 @@
 GOALS = {
 'ACCOUNT_SUL': 101,
 'ACCOUNT_PHAB': 102,
+'ACCOUNT_SSH': 103,
 'TOOL_MEMBER': 201,
 'TOOL_MAINTAINER': 202,
 'TOOL_GIT': 203,
diff --git a/striker/goals/signals/handlers.py 
b/striker/goals/signals/handlers.py
index 8e35b8b..b64267a 100644
--- a/striker/goals/signals/handlers.py
+++ b/striker/goals/signals/handlers.py
@@ -26,35 +26,55 @@
 from django.dispatch import receiver
 
 from striker.goals import GOALS
+from striker.labsauth.models import LabsUser
+from striker.labsauth.models import LdapUser
 
 
 logger = logging.getLogger(__name__)
 
 
 def check_goal_phab(user):
+"""Check LabsUser model for Phabricator data."""
 if user.phabname is not None:
 user.milestones.recordMilestone(GOALS['ACCOUNT_PHAB'])
 
 
 def check_goal_sul(user):
+"""Check LabsUser model for SUL data."""
 if user.oauthtoken is not None:
 user.milestones.recordMilestone(GOALS['ACCOUNT_SUL'])
+
+
+def check_goal_ssh(ldap):
+"""Check LdapUser model for SSH data."""
+if ldap.ssh_keys:
+user = LabsUser.objects.get(ldapname=ldap.cn)
+user.milestones.recordMilestone(GOALS['ACCOUNT_SSH'])
+
+
+def check_goal_member(user):
+"""Check LabsUser model for Tool Labs membership."""
+groups = user.groups.values_list('name', flat=True)
+if settings.TOOLS_TOOL_LABS_GROUP_NAME in groups:
+user.milestones.recordMilestone(GOALS['TOOL_MEMBER'])
+
+
+def check_goal_tool(user):
+"""Check LabsUser model for Tool maintainership."""
+groups = user.groups.values_list('name', flat=True)
+for g in groups:
+if g.startswith('tools.'):
+user.milestones.recordMilestone(GOALS['TOOL_MAINTAINER'])
+break
 
 
 @receiver(user_logged_in, dispatch_uid=__name__)
 def on_user_login(sender, request, user, **kwargs):
 check_goal_phab(user)
 check_goal_sul(user)
-
-groups = user.groups.values_list('name', flat=True)
-
-if settings.TOOLS_TOOL_LABS_GROUP_NAME in groups:
-user.milestones.recordMilestone(GOALS['TOOL_MEMBER'])
-for g in groups:
-if g.startswith('tools.'):
-user.milestones.recordMilestone(GOALS['TOOL_MAINTAINER'])
-break
-
+check_goal_member(user)
+check_goal_tool(user)
+check_goal_ssh(user.ldapuser)
 
 @receiver(post_save, sender=settings.AUTH_USER_MODEL, dispatch_uid=__name__)
 def on_user_save(sender, instance, **kwargs):
@@ -62,7 +82,11 @@
 check_goal_sul(instance)
 
 
-@receiver(
-post_save, sender='tools.DiffusionRepo', dispatch_uid=__name__)
+@receiver(post_save, sender='tools.DiffusionRepo', dispatch_uid=__name__)
 def on_diffusion_save(sender, instance, **kwargs):
 instance.created_by.milestones.recordMilestone(GOALS['TOOL_GIT'])
+
+
+@receiver(post_save, sender='labsauth.LdapUser',  dispatch_uid=__name__)
+def on_ldapuser_save(sender, instance, **kwargs):
+check_goal_ssh(instance)
diff --git a/striker/labsauth/models.py b/striker/labsauth/models.py
index a4203cb..88c8d8e 100644
--- a/striker/labsauth/models.py
+++ b/striker/labsauth/models.py
@@ -147,6 +147,10 @@
 return 'uid={0},{1}'.format(
 self.shellname, settings.LABSAUTH_USER_BASE)
 
+@property
+def ldapuser(self):
+return LdapUser.objects.get(dn=self.ldap_dn)
+
 
 class PosixGroup(ldapdb.models.Model):
 base_dn = settings.LABSAUTH_GROUP_BASE
diff --git a/striker/settings.py b/striker/settings.py
index 18fc638..e8f680f 100644
--- a/striker/settings.py
+++ b/striker/settings.py
@@ -360,6 +360,9 @@
 # phid of group granted Diffusion admin rights (i.e. #Repository-Admins)
 PHABRICATOR_REPO_ADMIN_GROUP = ini.get('phabricator', 'REPO_ADMIN_GROUP')
 
+# == Wikitech settings ==
+WIKITECH_URL = ini.get('wikitech', 'SERVER_URL')
+
 # == Tools settings ==
 TOOLS_MAINTAINER_BASE_DN = ini.get('ldap', 'TOOLS_MAINTAINER_BASE_DN')
 

[MediaWiki-commits] [Gerrit] labs/striker[master]: Add confirmation step to account creation wizard

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Add confirmation step to account creation wizard
..

Add confirmation step to account creation wizard

Add an explicit TOU agreement and confirmation step to the account
creation wizard.

Bug: T144710
Change-Id: I0c415e166b410578dc9e7955d3ff49c156bbe086
---
M static/css/site.css
M striker/register/forms.py
M striker/register/views.py
M striker/templates/register/base.html
A striker/templates/register/confirm.html
M striker/templates/register/password.html
M striker/templates/register/shell.html
7 files changed, 112 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/41/313141/1

diff --git a/static/css/site.css b/static/css/site.css
index c98e4ab..069fc77 100644
--- a/static/css/site.css
+++ b/static/css/site.css
@@ -68,3 +68,6 @@
   background-color:#fcf8e3;
   color:#8a6d3b;
 }
+.panel-success > .panel-heading > .text-muted {
+  color:inherit;
+}
diff --git a/striker/register/forms.py b/striker/register/forms.py
index f4328ac..54b2a31 100644
--- a/striker/register/forms.py
+++ b/striker/register/forms.py
@@ -35,10 +35,12 @@
 username = forms.CharField(
 label=_('Username'),
 widget=forms.TextInput(
-attrs={'placeholder': _('Enter your desired username')}
+attrs={
+'placeholder': _('Enter your desired username'),
+'autofocus': 'autofocus',
+}
 ),
-max_length=255,
-required=True
+max_length=255
 )
 
 def clean_username(self):
@@ -51,12 +53,14 @@
 
 class ShellUsername(forms.Form):
 shellname = forms.CharField(
-label=_('Shell account'),
+label=_('Shell username'),
 widget=forms.TextInput(
-attrs={'placeholder': _('Enter your desired shell account name')}
+attrs={
+'placeholder': _('Enter your desired shell account username'),
+'autofocus': 'autofocus',
+}
 ),
 max_length=32,
-required=True,
 validators=[
 validators.RegexValidator(
 regex=r'^[a-z][0-9a-z-]{0,31}$',
@@ -81,11 +85,11 @@
 widget=forms.TextInput(
 attrs={
 'placeholder': _('Enter a valid email address'),
-'type': 'email'
+'type': 'email',
+'autofocus': 'autofocus',
 }
 ),
-max_length=255,
-required=True
+max_length=255
 )
 
 
@@ -93,12 +97,15 @@
 passwd = forms.CharField(
 label=_('Password'),
 min_length=10,
-required=True,
-widget=forms.PasswordInput(render_value=True)
+widget=forms.PasswordInput(
+render_value=True,
+attrs={
+'autofocus': 'autofocus',
+}
+)
 )
 confirm = forms.CharField(
 label=_('Confirm password'),
-required=True,
 widget=forms.PasswordInput
 )
 
@@ -113,3 +120,8 @@
 if passwd != confirm:
 self.add_error(
 'confirm', ValidationError(_('Passwords do not match.')))
+
+
+class Confirm(forms.Form):
+agree = forms.BooleanField(
+label=_('I agree to comply with the Terms of Use'))
diff --git a/striker/register/views.py b/striker/register/views.py
index e407fc0..6adc21d 100644
--- a/striker/register/views.py
+++ b/striker/register/views.py
@@ -18,6 +18,7 @@
 # You should have received a copy of the GNU General Public License
 # along with Striker.  If not, see .
 
+import collections
 import functools
 import logging
 import re
@@ -76,6 +77,7 @@
 ('shell', forms.ShellUsername),
 ('email', forms.Email),
 ('password', forms.Password),
+('confirm', forms.Confirm),
 ]
 
 @method_decorator(oauth_required)
@@ -105,6 +107,28 @@
 else:
 return {}
 
+def _get_all_forms(self):
+forms = collections.OrderedDict()
+for k in self.get_form_list():
+forms[k] = self.get_form(
+step=k,
+data=self.storage.get_step_data(k)
+)
+forms[k].is_valid()
+return forms
+
+def get_context_data(self, form, **kwargs):
+context = super(AccountWizard, self).get_context_data(
+form=form, **kwargs)
+if self.steps.current == 'confirm':
+context.update({
+'forms': self._get_all_forms(),
+'sul': {
+'username': self.request.session[OAUTH_USERNAME_KEY],
+}
+})
+return context
+
 def done(self, form_list, **kwargs):
 # TODO: create account
 messages.success(
diff --git a/striker/templates/register/base.html 

[MediaWiki-commits] [Gerrit] labs/striker[master]: Add account creation initial screen

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Add account creation initial screen
..

Add account creation initial screen

Add a new "register" app that will handle account creation. This is just
a stub at this point, but it should give a reasonable idea of where I'm
headed with the feature. A wizard style multi-step process will collect
information from the user, validate it, and eventually add a new LDAP
user account.

The TOU warning is taken directly from Special:CreateAccount on wikitech.

Note: the addition of new css styles here means that Django's
collectstatic process needs to be run when this is tested/deployed.

Bug: T144710
Change-Id: Ic8f5171a1ed43585def3d9ffe5b92f5295ca4f1c
---
M static/css/site.css
A striker/register/__init__.py
A striker/register/forms.py
A striker/register/urls.py
A striker/register/views.py
M striker/settings.py
M striker/templates/index/anon.html
M striker/templates/labsauth/login.html
A striker/templates/register/index.html
M striker/urls.py
10 files changed, 163 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/38/313138/1

diff --git a/static/css/site.css b/static/css/site.css
index 39bb4dd..c98e4ab 100644
--- a/static/css/site.css
+++ b/static/css/site.css
@@ -64,3 +64,7 @@
 .footer {
   margin-top:2em;
 }
+.panel-body-warning {
+  background-color:#fcf8e3;
+  color:#8a6d3b;
+}
diff --git a/striker/register/__init__.py b/striker/register/__init__.py
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/striker/register/__init__.py
diff --git a/striker/register/forms.py b/striker/register/forms.py
new file mode 100644
index 000..6911ee8
--- /dev/null
+++ b/striker/register/forms.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2016 Wikimedia Foundation and contributors.
+# All Rights Reserved.
+#
+# This file is part of Striker.
+#
+# Striker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Striker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Striker.  If not, see .
diff --git a/striker/register/urls.py b/striker/register/urls.py
new file mode 100644
index 000..4dd92cb
--- /dev/null
+++ b/striker/register/urls.py
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2016 Wikimedia Foundation and contributors.
+# All Rights Reserved.
+#
+# This file is part of Striker.
+#
+# Striker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Striker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Striker.  If not, see .
+
+from django.conf import urls
+
+
+urlpatterns = [
+urls.url(r'^$', 'striker.register.views.index', name='index'),
+]
diff --git a/striker/register/views.py b/striker/register/views.py
new file mode 100644
index 000..541b9dd
--- /dev/null
+++ b/striker/register/views.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2016 Wikimedia Foundation and contributors.
+# All Rights Reserved.
+#
+# This file is part of Striker.
+#
+# Striker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Striker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Striker.  If not, see .
+
+import logging
+
+from django import shortcuts
+from django.contrib import messages
+from django.core import urlresolvers
+from django.utils.translation import ugettext_lazy as _
+
+
+logger = logging.getLogger(__name__)
+
+
+def index(req):
+ctx = {}
+if not req.user.is_anonymous():
+messages.error(
+ 

[MediaWiki-commits] [Gerrit] labs/striker[master]: Allow OAuth authentication for anon users

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Allow OAuth authentication for anon users
..

Allow OAuth authentication for anon users

Update labsauth.views.oauth_callback to store OAuth credentials in the
session if the Django user is anonymous. This will make it easier to add
workflows in the future where we want to get OAuth info from a user
before they have LDAP credentials.

Bug: T144710
Change-Id: If67f54d8a67f4541b3376f478e2f179cdcb22c50
---
M striker/labsauth/views.py
1 file changed, 24 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/37/313137/1

diff --git a/striker/labsauth/views.py b/striker/labsauth/views.py
index 7d9261e..8ecf2c0 100644
--- a/striker/labsauth/views.py
+++ b/striker/labsauth/views.py
@@ -37,6 +37,9 @@
 NEXT_PAGE = 'striker.oauth.next_page'
 REQUEST_TOKEN_KEY = 'striker.oauth.request_token'
 ACCESS_TOKEN_KEY = 'striker.oauth.access_token'
+OAUTH_USERNAME_KEY = 'striker.oauth.username'
+OAUTH_EMAIL_KEY = 'striker.oauth.email'
+OAUTH_REALNAME_KEY = 'striker.oauth.realname'
 
 logger = logging.getLogger(__name__)
 
@@ -101,22 +104,31 @@
 req.META['QUERY_STRING'])
 # Convert to unicode for session storage
 req.session[ACCESS_TOKEN_KEY] = utils.tuple_to_unicode(access_token)
-req.user.set_accesstoken(access_token)
-
 sul_user = mwoauth.identify(
 settings.OAUTH_MWURL, consumer_token, access_token)
-req.user.sulname = sul_user['username']
-req.user.sulemail = sul_user['email']
-req.user.realname = sul_user['realname']
-try:
-req.user.save()
+
+if req.user.is_authenticated():
+req.user.set_accesstoken(access_token)
+req.user.sulname = sul_user['username']
+req.user.sulemail = sul_user['email']
+req.user.realname = sul_user['realname']
+try:
+req.user.save()
+messages.info(
+req, _("Updated OAuth credentials for {user}".format(
+user=sul_user['username'])))
+except DatabaseError:
+logger.exception('user.save failed')
+messages.error(
+req,
+_("Error saving OAuth credentials. [req id: {id}]").format(
+id=req.id))
+else:
+req.session[OAUTH_USERNAME_KEY] = sul_user['username']
+req.session[OAUTH_EMAIL_KEY] = sul_user['email']
+req.session[OAUTH_REALNAME_KEY] = sul_user['realname']
 messages.info(
 req, _("Authenticated as OAuth user {user}".format(
 user=sul_user['username'])))
-except DatabaseError:
-logger.exception('user.save failed')
-messages.error(
-req, _("Error updating database. [req id: {id}]").format(
-id=req.id))
 
 return shortcuts.redirect(req.session.get(NEXT_PAGE, '/'))

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If67f54d8a67f4541b3376f478e2f179cdcb22c50
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 

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


[MediaWiki-commits] [Gerrit] labs/striker[master]: Add striker.labsauth.utils.oauth_from_session helper

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Add striker.labsauth.utils.oauth_from_session helper
..

Add striker.labsauth.utils.oauth_from_session helper

Add a helper function for gathering OAuth data from a user's session.

Bug: T144710
Change-Id: Ic81ea70839805652a7d578b92889574049288457
---
A striker/labsauth/constants.py
M striker/labsauth/utils.py
M striker/labsauth/views.py
M striker/register/views.py
4 files changed, 70 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/44/313144/1

diff --git a/striker/labsauth/constants.py b/striker/labsauth/constants.py
new file mode 100644
index 000..f5c3b87
--- /dev/null
+++ b/striker/labsauth/constants.py
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2016 Wikimedia Foundation and contributors.
+# All Rights Reserved.
+#
+# This file is part of Striker.
+#
+# Striker is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Striker is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Striker.  If not, see .
+
+NEXT_PAGE = 'striker.oauth.next_page'
+REQUEST_TOKEN_KEY = 'striker.oauth.request_token'
+ACCESS_TOKEN_KEY = 'striker.oauth.access_token'
+OAUTH_USERNAME_KEY = 'striker.oauth.username'
+OAUTH_EMAIL_KEY = 'striker.oauth.email'
+OAUTH_REALNAME_KEY = 'striker.oauth.realname'
diff --git a/striker/labsauth/utils.py b/striker/labsauth/utils.py
index e768ebb..7d431d2 100644
--- a/striker/labsauth/utils.py
+++ b/striker/labsauth/utils.py
@@ -18,13 +18,13 @@
 # You should have received a copy of the GNU General Public License
 # along with Striker.  If not, see .
 
+import ldap
 import logging
 import operator
 
 from django.conf import settings
 
-import ldap
-
+from striker.labsauth import constants
 from striker.labsauth import models
 
 
@@ -41,6 +41,20 @@
 return tuple([i.encode('utf-8') for i in t])
 
 
+def oauth_from_session(session):
+"""Get OAuth data from a user's session.
+
+:return: dict of username, email, realname, token, and secret
+"""
+token = session.get(constants.ACCESS_TOKEN_KEY, (None, None))
+return {
+'username': session.get(constants.OAUTH_USERNAME_KEY, None),
+'email': session.get(constants.OAUTH_EMAIL_KEY, None),
+'realname': session.get(constants.OAUTH_REALNAME_KEY, None),
+'token': token[0],
+'secret': token[1],
+}
+
 def get_next_id_number(clazz, attr):
 """Get the next id number for a given class and attribute.
 
diff --git a/striker/labsauth/views.py b/striker/labsauth/views.py
index 8ecf2c0..c887ebe 100644
--- a/striker/labsauth/views.py
+++ b/striker/labsauth/views.py
@@ -31,15 +31,10 @@
 from ratelimitbackend import views as ratelimit_views
 import mwoauth
 
+from striker.labsauth import constants
 from striker.labsauth import forms
 from striker.labsauth import utils
 
-NEXT_PAGE = 'striker.oauth.next_page'
-REQUEST_TOKEN_KEY = 'striker.oauth.request_token'
-ACCESS_TOKEN_KEY = 'striker.oauth.access_token'
-OAUTH_USERNAME_KEY = 'striker.oauth.username'
-OAUTH_EMAIL_KEY = 'striker.oauth.email'
-OAUTH_REALNAME_KEY = 'striker.oauth.realname'
 
 logger = logging.getLogger(__name__)
 
@@ -64,7 +59,7 @@
 """Initiate an OAuth login."""
 next_page = req.GET.get('next', None)
 if next_page is not None:
-req.session[NEXT_PAGE] = next_page
+req.session[constants.NEXT_PAGE] = next_page
 consumer_token = mwoauth.ConsumerToken(
 settings.OAUTH_CONSUMER_KEY, settings.OAUTH_CONSUMER_SECRET)
 try:
@@ -80,13 +75,14 @@
 return shortcuts.redirect(next_page or '/')
 else:
 # Convert to unicode for session storage
-req.session[REQUEST_TOKEN_KEY] = utils.tuple_to_unicode(request_token)
+req.session[constants.REQUEST_TOKEN_KEY] = utils.tuple_to_unicode(
+request_token)
 return shortcuts.redirect(redirect)
 
 
 def oauth_callback(req):
 """OAuth handshake callback."""
-serialized_token = req.session.get(REQUEST_TOKEN_KEY, None)
+serialized_token = req.session.get(constants.REQUEST_TOKEN_KEY, None)
 if serialized_token is None:
 messages.error(req, _("Session invalid."))
 return shortcuts.redirect(
@@ -103,9 +99,13 @@
 request_token,
 req.META['QUERY_STRING'])
 # Convert to unicode for session storage
-req.session[ACCESS_TOKEN_KEY] = 

[MediaWiki-commits] [Gerrit] labs/striker[master]: Create LDAP and Striker users from registration form data

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Create LDAP and Striker users from registration form data
..

Create LDAP and Striker users from registration form data

Use the data collected by the registration form wizard to create a new
LDAP record. When that succeeds, add a Striker user model that ties the
new LDAP record to the SUL account.

The LDAP record created is follows the same core logic as the
combination of LdapAuthentication and OpenStackManager used on Wikitech:
- ObjectClass attributes: person, inetOrgPerson, organizationalPerson,
  ldapPublicKey, posixAccount, shadowAccount
- Cn and sn attributes both set to the wiki/gerrit/apache username.
- Uid attribute set to unix shell name.
- Numeric uid chosen by adding one to the current max posixAccount uid
  in LDAP.
- Numeric uid allocation retried once in case of collision due to race
  with another account creation.
- Numeric gid set to 500 (configurable).
- Login shell set to /bin/bash (configurable).
- Home directory set to /home/{uid}
- Password attribute added with no client side hashing.

The existing PosixGroup LDAP model has also been updated to use field
naming that follows the LDAP attribute naming. This convention should
make working with LDAP models easier than remembering some arbitrary
remapping of the attribute names.

Bug: T144710
Change-Id: Ib09262ab6fdb8d6d490e436c4a27cb60d2beafb7
---
A striker/labsauth/migrations/0002_ldapuser_posixaccount_posixgroup.py
M striker/labsauth/models.py
A striker/labsauth/router.py
M striker/labsauth/utils.py
M striker/register/forms.py
M striker/register/views.py
M striker/settings.py
M striker/striker.ini
M striker/views.py
9 files changed, 269 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/43/313143/1

diff --git 
a/striker/labsauth/migrations/0002_ldapuser_posixaccount_posixgroup.py 
b/striker/labsauth/migrations/0002_ldapuser_posixaccount_posixgroup.py
new file mode 100644
index 000..b978312
--- /dev/null
+++ b/striker/labsauth/migrations/0002_ldapuser_posixaccount_posixgroup.py
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import ldapdb.models.fields
+
+
+class Migration(migrations.Migration):
+
+dependencies = [
+('labsauth', '0001_squashed'),
+]
+
+operations = [
+migrations.CreateModel(
+# Unmanaged model. This won't actually apply when you run the
+# migration. There's no way to convince Django not to generate
+# these migrations in the first place.
+name='LdapUser',
+fields=[
+('dn', models.CharField(max_length=200)),
+('uid', ldapdb.models.fields.CharField(primary_key=True, 
serialize=False, db_column='uid', max_length=200)),
+('cn', ldapdb.models.fields.CharField(unique=True, 
db_column='cn', max_length=200)),
+('uid_number', ldapdb.models.fields.IntegerField(unique=True, 
db_column='uidNumber')),
+('gid_number', 
ldapdb.models.fields.IntegerField(db_column='gidNumber')),
+('home_dir', 
ldapdb.models.fields.CharField(db_column='homeDirectory', max_length=200)),
+('login_shell', 
ldapdb.models.fields.CharField(db_column='loginShell', max_length=200)),
+('password', 
ldapdb.models.fields.CharField(db_column='userPassword', max_length=200)),
+('sn', ldapdb.models.fields.CharField(unique=True, 
db_column='sn', max_length=200)),
+('mail', ldapdb.models.fields.CharField(db_column='mail', 
max_length=200)),
+('ssh_keys', 
ldapdb.models.fields.ListField(db_column='sshPublicKey')),
+],
+options={
+'managed': False,
+},
+),
+migrations.CreateModel(
+# Unmanaged model. This won't actually apply when you run the
+# migration. There's no way to convince Django not to generate
+# these migrations in the first place.
+name='PosixAccount',
+fields=[
+('dn', models.CharField(max_length=200)),
+('uid', ldapdb.models.fields.CharField(primary_key=True, 
serialize=False, db_column='uid', max_length=200)),
+('cn', ldapdb.models.fields.CharField(unique=True, 
db_column='cn', max_length=200)),
+('uid_number', ldapdb.models.fields.IntegerField(unique=True, 
db_column='uidNumber')),
+('gid_number', 
ldapdb.models.fields.IntegerField(db_column='gidNumber')),
+('home_directory', 
ldapdb.models.fields.CharField(db_column='homeDirectory', max_length=200)),
+],
+options={
+'managed': False,
+},
+),
+

[MediaWiki-commits] [Gerrit] labs/striker[master]: Collect data needed to create a new LDAP account

2016-09-27 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review.

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

Change subject: Collect data needed to create a new LDAP account
..

Collect data needed to create a new LDAP account

Collect the username, shell account name, email address and password
needed to create a new LDAP account. This does not yet create the
account. It also doesn't validate that the username and shell account
name are available.

This change introduces a new Python library (django-formtools). Virtual
environments will need to be updated for testing and wheels will need to
be updated after merging before it can be deployed to production.

Bug: T144710
Change-Id: I47e76a228d5eeacf540c0b1d49e0f4472ca26196
---
M requirements.txt
M striker/register/forms.py
M striker/register/urls.py
M striker/register/views.py
M striker/settings.py
A striker/templates/register/base.html
A striker/templates/register/email.html
M striker/templates/register/index.html
A striker/templates/register/ldap.html
A striker/templates/register/password.html
A striker/templates/register/shell.html
11 files changed, 355 insertions(+), 58 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker 
refs/changes/39/313139/1

diff --git a/requirements.txt b/requirements.txt
index 86b875f..7b1d303 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,6 +4,7 @@
 django-auth-ldap>=1.2.8  # BSD
 django-bootstrap3<8.0.0,>=7.0.0  # Apache 2.0
 django-csp>=2.0.3  # BSD
+django-formtools>=1.0  # BSD
 django-ipware>=1.1.5  # BSD
 django-ldapdb>=0.6.0  # BSD
 django-log-request-id>=1.3.1  # BSD
diff --git a/striker/register/forms.py b/striker/register/forms.py
index 6911ee8..fa3b139 100644
--- a/striker/register/forms.py
+++ b/striker/register/forms.py
@@ -17,3 +17,93 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with Striker.  If not, see .
+
+import logging
+
+from django import forms
+from django.core import validators
+from django.core.exceptions import ValidationError
+from django.utils.translation import ugettext_lazy as _
+
+
+logger = logging.getLogger(__name__)
+
+
+class LDAPUsername(forms.Form):
+username = forms.CharField(
+label=_('Username'),
+widget=forms.TextInput(
+attrs={'placeholder': _('Enter your desired username')}
+),
+max_length=255,
+required=True
+)
+
+def clean_username(self):
+# TODO: check that is unused globally
+# TODO: check that it isn't banned by some abusefilter type rule
+pass
+
+
+class ShellUsername(forms.Form):
+shellname = forms.CharField(
+label=_('Shell account'),
+widget=forms.TextInput(
+attrs={'placeholder': _('Enter your desired shell account name')}
+),
+max_length=32,
+required=True,
+validators=[
+validators.RegexValidator(
+regex=r'^[a-z][0-9a-z-]{0,31}$',
+message=_(
+'Must start with a-z, and can only contain '
+'lowercase a-z, 0-9, and - characters.')
+)
+]
+)
+
+def clean_shellname(self):
+# TODO: check that is unused globally
+# TODO: check that it isn't banned by some abusefilter type rule
+pass
+
+
+class Email(forms.Form):
+email = forms.EmailField(
+label=_('Email address'),
+widget=forms.TextInput(
+attrs={
+'placeholder': _('Enter a valid email address'),
+'type': 'email'
+}
+),
+max_length=255,
+required=True
+)
+
+
+class Password(forms.Form):
+passwd = forms.CharField(
+label=_('Password'),
+min_length=10,
+required=True,
+widget=forms.PasswordInput(render_value=True)
+)
+confirm = forms.CharField(
+label=_('Confirm password'),
+min_length=10,
+widget=forms.PasswordInput
+)
+
+def clean_password(self):
+# TODO: complexity checks?
+pass
+
+def clean(self):
+super(Password, self).clean()
+passwd = self.cleaned_data.get('passwd')
+confirm = self.cleaned_data.get('confirm')
+if passwd != confirm:
+self.add_error(
+'confirm', ValidationError(_('Passwords do not match.')))
diff --git a/striker/register/urls.py b/striker/register/urls.py
index 4dd92cb..ef22fcd 100644
--- a/striker/register/urls.py
+++ b/striker/register/urls.py
@@ -20,7 +20,14 @@
 
 from django.conf import urls
 
+from striker.register import views
+
+
+wizard = views.AccountWizard.as_view(url_name='register:wizard')
+
 
 urlpatterns = [
 urls.url(r'^$', 'striker.register.views.index', name='index'),
+# urls.url(r'^done$', wizard, name='done'),
+urls.url(r'^(?P.+)$', wizard, name='wizard'),
 ]
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Used parsed section titles for anchors

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

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

Change subject: Used parsed section titles for anchors
..

Used parsed section titles for anchors

This allows us to link to the right section when the section
title contains templates or magic words.

* Add getParsedSectionTitle()
* Use it in getTitleWithSection()
** Stop using Parser::guessSectionNameFromWikiText() because it
   wants preprocessed wikitext, not fully parsed and stripped text
* Move getTruncatedSectionTitle() from EventPresentationModel to
  PresentationModelSectionTrait and make it use getParsedSectionTitle()

Bug: T134216
Change-Id: I877ff6b0ce4e64400f6e5f6284ae47a11cd4335b
---
M includes/formatters/EditUserTalkPresentationModel.php
M includes/formatters/EventPresentationModel.php
M includes/formatters/MentionPresentationModel.php
M includes/formatters/PresentationModelSectionTrait.php
4 files changed, 50 insertions(+), 24 deletions(-)


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

diff --git a/includes/formatters/EditUserTalkPresentationModel.php 
b/includes/formatters/EditUserTalkPresentationModel.php
index 0ed6f5f..d03c47c 100644
--- a/includes/formatters/EditUserTalkPresentationModel.php
+++ b/includes/formatters/EditUserTalkPresentationModel.php
@@ -47,7 +47,7 @@
} elseif ( $this->hasSection() ) {
$msg = $this->getMessageWithAgent( 
"notification-header-{$this->type}-with-section" );
$msg->params( $this->getViewingUserForGender() );
-   $msg->plaintextParams( $this->getTruncatedSectionTitle( 
$this->getSection() ) );
+   $msg->plaintextParams( 
$this->getTruncatedSectionTitle() );
return $msg;
} else {
$msg = parent::getHeaderMessage();
diff --git a/includes/formatters/EventPresentationModel.php 
b/includes/formatters/EventPresentationModel.php
index 7826f5c..020e1f8 100644
--- a/includes/formatters/EventPresentationModel.php
+++ b/includes/formatters/EventPresentationModel.php
@@ -509,15 +509,6 @@
return $this->language->embedBidi( $this->language->truncate( 
$text, self::PAGE_NAME_RECOMMENDED_LENGTH, '...', false ) );
}
 
-   protected function getTruncatedSectionTitle( $section ) {
-   return $this->language->embedBidi( $this->language->truncate(
-   EchoDiscussionParser::getTextSnippet( $section, 
$this->language, 150, $this->event->getTitle() ),
-   self::SECTION_TITLE_RECOMMENDED_LENGTH,
-   '...',
-   false
-   ) );
-   }
-
/**
 * @param User|null $user
 * @return array|null
diff --git a/includes/formatters/MentionPresentationModel.php 
b/includes/formatters/MentionPresentationModel.php
index fe38ba8..82abdac 100644
--- a/includes/formatters/MentionPresentationModel.php
+++ b/includes/formatters/MentionPresentationModel.php
@@ -50,7 +50,7 @@
}
 
if ( $this->hasSection() ) {
-   $msg->plaintextParams( $this->getTruncatedSectionTitle( 
$this->getSection() ) );
+   $msg->plaintextParams( 
$this->getTruncatedSectionTitle() );
}
 
return $msg;
diff --git a/includes/formatters/PresentationModelSectionTrait.php 
b/includes/formatters/PresentationModelSectionTrait.php
index a286330..87b7ab5 100644
--- a/includes/formatters/PresentationModelSectionTrait.php
+++ b/includes/formatters/PresentationModelSectionTrait.php
@@ -3,29 +3,52 @@
  * Trait that adds section title handling to an EchoEventPresentationModel 
subclass.
  */
 trait EchoPresentationModelSectionTrait {
-   private $sectionTitle = null;
+   private $rawSectionTitle = null;
+   private $parsedSectionTitle = null;
 
/**
-* Get the section title
+* Get the raw (unparsed) section title
 * @return string Section title
 */
-   protected function getSection() {
-   if ( $this->sectionTitle !== null ) {
-   return $this->sectionTitle;
+   protected function getRawSectionTitle() {
+   if ( $this->rawSectionTitle !== null ) {
+   return $this->rawSectionTitle;
}
$sectionTitle = $this->event->getExtraParam( 'section-title' );
if ( !$sectionTitle ) {
-   $this->sectionTitle = false;
+   $this->rawSectionTitle = false;
return false;
}
// Check permissions
if ( !$this->userCan( Revision::DELETED_TEXT ) ) {
-   $this->sectionTitle = false;
+   $this->rawSectionTitle = false;
   

[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Null out default config in tearDown

2016-09-27 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: Null out default config in tearDown
..

Null out default config in tearDown

Change-Id: I2152fd99730b504d8d7f646fee6d077d9702244f
---
M Tests/BaseSmashPigUnitTestCase.php
M Tests/TestingConfiguration.php
2 files changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/35/313135/1

diff --git a/Tests/BaseSmashPigUnitTestCase.php 
b/Tests/BaseSmashPigUnitTestCase.php
index 90a6cf1..bc6cb9c 100644
--- a/Tests/BaseSmashPigUnitTestCase.php
+++ b/Tests/BaseSmashPigUnitTestCase.php
@@ -19,6 +19,7 @@
 
function tearDown() {
Context::set(); // Nullify the context for next run.
+   TestingConfiguration::tearDownConfiguration(); // And the 
default config
}
 
function loadJson( $path ) {
diff --git a/Tests/TestingConfiguration.php b/Tests/TestingConfiguration.php
index 0b8db27..c710566 100644
--- a/Tests/TestingConfiguration.php
+++ b/Tests/TestingConfiguration.php
@@ -2,6 +2,7 @@
 
 namespace SmashPig\Tests;
 
+use ReflectionClass;
 use SmashPig\Core\Configuration;
 
 /**
@@ -37,4 +38,11 @@
$config->override( $data );
return $config;
}
+
+   public static function tearDownConfiguration() {
+   $konfig = new ReflectionClass( 'SmashPig\Core\Configuration' );
+   $defaultConfig = $konfig->getProperty( 'defaultObj' );
+   $defaultConfig->setAccessible( true );
+   $defaultConfig->setValue( null );
+   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2152fd99730b504d8d7f646fee6d077d9702244f
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] mediawiki...MobileFrontend[master]: Remove obsolete CSS rules

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

Change subject: Remove obsolete CSS rules
..


Remove obsolete CSS rules

Removing obsolete or duplicated CSS rules for Watchlist and last
modified bar.

Change-Id: I77c1fcfb2007538f2975e0d9a586a859e34a1e1f
---
M resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
M resources/skins.minerva.tablet.styles/common.less
2 files changed, 0 insertions(+), 29 deletions(-)

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



diff --git 
a/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less 
b/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
index da8a360..dd5fefe 100644
--- a/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
+++ b/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
@@ -6,16 +6,3 @@
visibility: hidden;
}
 }
-
-@media all and ( min-width: @deviceWidthTablet ) {
-   #bodyContent {
-   .content-header {
-   border-bottom: 0;
-   padding-bottom: 0;
-   .button-bar {
-   border-bottom: 1px solid @headerBorderBottom;
-   padding-bottom: 20px;
-   }
-   }
-   }
-}
diff --git a/resources/skins.minerva.tablet.styles/common.less 
b/resources/skins.minerva.tablet.styles/common.less
index 98dcfc1..ac34e0d 100644
--- a/resources/skins.minerva.tablet.styles/common.less
+++ b/resources/skins.minerva.tablet.styles/common.less
@@ -123,22 +123,6 @@
padding-left: 0;
padding-right: 0;
font-size: 1em;
-
-   // This rule must be scoped to .last-modified-bar to prevent 
side effects on the MainPage bar
-   #mw-mf-last-modified {
-   background-color: @colorGray14;
-   font-size: 0.9em;
-   padding-left: 16px;
-   padding-right: 16px;
-   }
-
-   &.active {
-   background-color: transparent;
-   #mw-mf-last-modified {
-   background-color: 
@lastModifiedBarActiveBackgroundColor;
-   }
-   }
-
}
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I77c1fcfb2007538f2975e0d9a586a859e34a1e1f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: VolkerE 
Gerrit-Reviewer: Bmansurov 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mediawiki.UI: Align further greys to improved color palette

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

Change subject: mediawiki.UI: Align further greys to improved color palette
..


mediawiki.UI: Align further greys to improved color palette

Aligning more of the base grey shades to improved color palette
https://phabricator.wikimedia.org/M82

Bug: T146799
Change-Id: I40d69e5fdb5456511be4884f947635179aaf1020
---
M resources/src/mediawiki.less/mediawiki.ui/variables.less
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/resources/src/mediawiki.less/mediawiki.ui/variables.less 
b/resources/src/mediawiki.less/mediawiki.ui/variables.less
index 77e80b0..28ad10a 100644
--- a/resources/src/mediawiki.less/mediawiki.ui/variables.less
+++ b/resources/src/mediawiki.less/mediawiki.ui/variables.less
@@ -6,16 +6,16 @@
 @colorGray2: #222;
 @colorGray3: #333;
 @colorGray4: #444;
-@colorGray5: #555;
+@colorGray5: #54595d;
 @colorGray6: #666;
 @colorGray7: #72777d;
 @colorGray8: #888;
 @colorGray9: #999;
-@colorGray10: #aaa;
+@colorGray10: #a2a9b1;
 @colorGray11: #bbb;
-@colorGray12: #ccc;
+@colorGray12: #c8ccd1;
 @colorGray13: #ddd;
-@colorGray14: #eee;
+@colorGray14: #eaecf0;
 @colorGray15: #f8f9fa; // lightest
 
 // Semantic background colors

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I40d69e5fdb5456511be4884f947635179aaf1020
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: VolkerE 
Gerrit-Reviewer: Bmansurov 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove obsolete CSS rules

2016-09-27 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review.

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

Change subject: Remove obsolete CSS rules
..

Remove obsolete CSS rules

Removing obsolete or duplicated CSS rules for Watchlist and last
modified bar.

Change-Id: I77c1fcfb2007538f2975e0d9a586a859e34a1e1f
---
M resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
M resources/skins.minerva.tablet.styles/common.less
2 files changed, 0 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/34/313134/1

diff --git 
a/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less 
b/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
index da8a360..dd5fefe 100644
--- a/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
+++ b/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less
@@ -6,16 +6,3 @@
visibility: hidden;
}
 }
-
-@media all and ( min-width: @deviceWidthTablet ) {
-   #bodyContent {
-   .content-header {
-   border-bottom: 0;
-   padding-bottom: 0;
-   .button-bar {
-   border-bottom: 1px solid @headerBorderBottom;
-   padding-bottom: 20px;
-   }
-   }
-   }
-}
diff --git a/resources/skins.minerva.tablet.styles/common.less 
b/resources/skins.minerva.tablet.styles/common.less
index 98dcfc1..ac34e0d 100644
--- a/resources/skins.minerva.tablet.styles/common.less
+++ b/resources/skins.minerva.tablet.styles/common.less
@@ -123,22 +123,6 @@
padding-left: 0;
padding-right: 0;
font-size: 1em;
-
-   // This rule must be scoped to .last-modified-bar to prevent 
side effects on the MainPage bar
-   #mw-mf-last-modified {
-   background-color: @colorGray14;
-   font-size: 0.9em;
-   padding-left: 16px;
-   padding-right: 16px;
-   }
-
-   &.active {
-   background-color: transparent;
-   #mw-mf-last-modified {
-   background-color: 
@lastModifiedBarActiveBackgroundColor;
-   }
-   }
-
}
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I77c1fcfb2007538f2975e0d9a586a859e34a1e1f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: VolkerE 

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


[MediaWiki-commits] [Gerrit] mediawiki...Petition[master]: Set doesWrites() for SpecialPetition

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

Change subject: Set doesWrites() for SpecialPetition
..


Set doesWrites() for SpecialPetition

Change-Id: Ib0c5c1507e0ef093ca3b53cf12c56f23ee31ab6e
---
M SpecialPetition.php
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/SpecialPetition.php b/SpecialPetition.php
index da32998..9b3e81e 100755
--- a/SpecialPetition.php
+++ b/SpecialPetition.php
@@ -5,6 +5,10 @@
parent::__construct( 'Petition' );
}
 
+   public function doesWrites() {
+   return true;
+   }
+
function execute($par) {
$out = $this->getOutput();
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib0c5c1507e0ef093ca3b53cf12c56f23ee31ab6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Petition
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Add config profiles to SearcherTest

2016-09-27 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Add config profiles to SearcherTest
..

Add config profiles to SearcherTest

Adds a way to define configuration profiles to be used with query
parsing. This is needed for a few reasons:

* The queries generated differ, and we would like to know if it changes
  under only one set of configurations
* jenkins and mediawiki-vagrant have slightly different configurations,
  making it a pain to run the tests locally without special sauce. This
  normalizes the differences.
* The integration of interwiki searching will need to make sure it
  doesn't accidentaly change how the queries are generated. This doesn't
  go all the way to making that possible (CirrusSearch only returns the
  main query) but is a start in that direction.

Change-Id: Ibffaa6e75ad7a3e0cb7f7ddb8e120d4af6593854
---
M tests/unit/SearcherTest.php
R tests/unit/fixtures/searchText/boost_templates_001.default.expected
A tests/unit/fixtures/searchText/boost_templates_001.fullyfeatured.expected
R tests/unit/fixtures/searchText/boost_templates_002.default.expected
A tests/unit/fixtures/searchText/boost_templates_002.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_001.default.expected
A tests/unit/fixtures/searchText/browsertest_001.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_002.default.expected
A tests/unit/fixtures/searchText/browsertest_002.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_003.default.expected
A tests/unit/fixtures/searchText/browsertest_003.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_004.default.expected
A tests/unit/fixtures/searchText/browsertest_004.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_005.default.expected
A tests/unit/fixtures/searchText/browsertest_005.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_006.default.expected
A tests/unit/fixtures/searchText/browsertest_006.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_007.default.expected
A tests/unit/fixtures/searchText/browsertest_007.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_008.default.expected
A tests/unit/fixtures/searchText/browsertest_008.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_009.default.expected
A tests/unit/fixtures/searchText/browsertest_009.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_010.default.expected
A tests/unit/fixtures/searchText/browsertest_010.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_011.default.expected
A tests/unit/fixtures/searchText/browsertest_011.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_012.default.expected
A tests/unit/fixtures/searchText/browsertest_012.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_013.default.expected
A tests/unit/fixtures/searchText/browsertest_013.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_014.default.expected
A tests/unit/fixtures/searchText/browsertest_014.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_015.default.expected
A tests/unit/fixtures/searchText/browsertest_015.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_016.default.expected
A tests/unit/fixtures/searchText/browsertest_016.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_017.default.expected
A tests/unit/fixtures/searchText/browsertest_017.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_018.default.expected
A tests/unit/fixtures/searchText/browsertest_018.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_019.default.expected
A tests/unit/fixtures/searchText/browsertest_019.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_020.default.expected
A tests/unit/fixtures/searchText/browsertest_020.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_021.default.expected
A tests/unit/fixtures/searchText/browsertest_021.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_022.default.expected
A tests/unit/fixtures/searchText/browsertest_022.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_023.default.expected
A tests/unit/fixtures/searchText/browsertest_023.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_024.default.expected
A tests/unit/fixtures/searchText/browsertest_024.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_025.default.expected
A tests/unit/fixtures/searchText/browsertest_025.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_026.default.expected
A tests/unit/fixtures/searchText/browsertest_026.fullyfeatured.expected
R tests/unit/fixtures/searchText/browsertest_027.default.expected
A 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Add interwiki search parsing tests

2016-09-27 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Add interwiki search parsing tests
..

Add interwiki search parsing tests

Adjusts how cirrusDumpQuery / cirrusDumpResult works to also handle
interwiki searching. With this new functionality add a query parsing
configuration profile for interwiki search, which will help ensure
upcoming refactors to use a MultiSearch for interwiki don't change
any behaviour.

Change-Id: I1eeaba9c4787a2ecb3e8277b81016497d37c1467
---
M includes/CirrusSearch.php
A 
tests/unit/fixtures/searchText/boost_templates_001.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/boost_templates_002.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_001.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_002.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_003.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_004.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_005.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_006.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_007.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_008.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_009.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_010.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_011.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_012.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_013.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_014.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_015.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_016.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_017.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_018.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_019.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_020.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_021.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_022.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_023.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_024.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_025.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_026.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_027.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_028.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_029.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_030.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_031.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_032.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_033.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_034.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_035.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_036.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_037.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_038.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_039.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_040.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_041.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_042.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_043.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_044.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_045.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_046.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_047.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_048.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_049.fullyfeatured-interwiki.expected
A 
tests/unit/fixtures/searchText/browsertest_050.fullyfeatured-interwiki.expected
A 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Switch wgCirrusSearchSimiliarityProfile to string

2016-09-27 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review.

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

Change subject: Switch wgCirrusSearchSimiliarityProfile to string
..

Switch wgCirrusSearchSimiliarityProfile to string

Having this duplicate an entire array, rather than a string that
points into the main array, makes setting this outside php (such as
from runSearch.php, extension.json, or upcoming config definitions
for query parsing tests) a pain. Instead make it a simple string and
point into the main array.

Change-Id: Id713e03e69955205d0ba815deb36b63cc7e6ce27
---
M CirrusSearch.php
M includes/Maintenance/AnalysisConfigBuilder.php
M includes/Search/TextIndexField.php
M tests/jenkins/FullyFeaturedConfig.php
M tests/relforge/RelForgeSettings.php
5 files changed, 11 insertions(+), 5 deletions(-)


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

diff --git a/CirrusSearch.php b/CirrusSearch.php
index 1856f8c..122f79c 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -363,7 +363,7 @@
 
 // Configure the similarity module
 // see profile/SimilarityProfiles.php for more details
-$wgCirrusSearchSimilarityProfile = 
$wgCirrusSearchSimilarityProfiles['default'];
+$wgCirrusSearchSimilarityProfile = 'default';
 
 // Weight of fields.  Must be integers not decimals.  If 
$wgCirrusSearchAllFields['use']
 // is false this can be changed on the fly.  If it is true then changes to 
this require
diff --git a/includes/Maintenance/AnalysisConfigBuilder.php 
b/includes/Maintenance/AnalysisConfigBuilder.php
index 28b1e5f..291f4d8 100644
--- a/includes/Maintenance/AnalysisConfigBuilder.php
+++ b/includes/Maintenance/AnalysisConfigBuilder.php
@@ -73,7 +73,10 @@
->getConfigFactory()
->makeConfig( 'CirrusSearch' );
}
-   $this->similarity = $config->get( 
'CirrusSearchSimilarityProfile' );
+   $this->similarity = $config->getElement(
+   'CirrusSearchSimilarityProfiles',
+   $config->get( 'CirrusSearchSimilarityProfile' )
+   );
$this->config = $config;
}
 
diff --git a/includes/Search/TextIndexField.php 
b/includes/Search/TextIndexField.php
index 2f307e3..bffd813 100644
--- a/includes/Search/TextIndexField.php
+++ b/includes/Search/TextIndexField.php
@@ -214,7 +214,10 @@
 * @return string
 */
public static function getSimilarity( SearchConfig $config, $field, 
$analyzer = null ) {
-   $similarity = $config->get( 'CirrusSearchSimilarityProfile' );
+   $similarity = $config->getElement(
+   'CirrusSearchSimilarityProfiles',
+   $config->get( 'CirrusSearchSimilarityProfile' )
+   );
$fieldSimilarity = 'default';
if ( isset( $similarity['fields'] ) ) {
if( isset( $similarity['fields'][$field] ) ) {
diff --git a/tests/jenkins/FullyFeaturedConfig.php 
b/tests/jenkins/FullyFeaturedConfig.php
index bfc87bd..6549a00 100644
--- a/tests/jenkins/FullyFeaturedConfig.php
+++ b/tests/jenkins/FullyFeaturedConfig.php
@@ -48,7 +48,7 @@
 );
 
 // Set defaults to BM25 and the new query builder
-$wgCirrusSearchSimilarityProfile = 
$wgCirrusSearchSimilarityProfiles['bm25_browser_tests'];
+$wgCirrusSearchSimilarityProfile = 'bm25_browser_tests';
 $wgCirrusSearchFullTextQueryBuilderProfile = 'browser_tests';
 
 $wgJobQueueAggregator = array(
diff --git a/tests/relforge/RelForgeSettings.php 
b/tests/relforge/RelForgeSettings.php
index a335c50..975e43e 100644
--- a/tests/relforge/RelForgeSettings.php
+++ b/tests/relforge/RelForgeSettings.php
@@ -31,7 +31,7 @@
 }
 if ( file_exists( __DIR__ . "/$wgCirrusSearchRelforgeProfile/similarity.inc" ) 
) {
require_once( __DIR__ . 
"/$wgCirrusSearchRelforgeProfile/similarity.inc" );
-   $wgCirrusSearchSimilarityProfile = 
$wgCirrusSearchSimilarityProfiles['relforge'];
+   $wgCirrusSearchSimilarityProfile = 'relforge';
 }
 if ( file_exists( __DIR__ . "/$wgCirrusSearchRelforgeProfile/ftbuilder.inc" ) 
) {
require_once( __DIR__ . "/$wgCirrusSearchRelforgeProfile/ftbuilder.inc" 
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id713e03e69955205d0ba815deb36b63cc7e6ce27
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
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] mediawiki...Flow[master]: Fix typo in sans-serif classname

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

Change subject: Fix typo in sans-serif classname
..


Fix typo in sans-serif classname

Change-Id: Idb89598672d97829e21b7515ab568cd922383818
---
M modules/flow/ui/widgets/editor/editors/mw.flow.ui.WikitextEditorWidget.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git 
a/modules/flow/ui/widgets/editor/editors/mw.flow.ui.WikitextEditorWidget.js 
b/modules/flow/ui/widgets/editor/editors/mw.flow.ui.WikitextEditorWidget.js
index a15fa8d..35daa7e 100644
--- a/modules/flow/ui/widgets/editor/editors/mw.flow.ui.WikitextEditorWidget.js
+++ b/modules/flow/ui/widgets/editor/editors/mw.flow.ui.WikitextEditorWidget.js
@@ -26,7 +26,7 @@
// The following classes can be used here:
// * mw-editfont-default
// * mw-editfont-monospace
-   // * mw-editfont-sansserif
+   // * mw-editfont-sans-serif
// * mw-editfont-serif
classes: [ 'flow-ui-wikitextEditorWidget-input', 
'mw-editfont-' + mw.user.options.get( 'editfont' ) ]
} );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb89598672d97829e21b7515ab568cd922383818
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Esanders 
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] wikimedia...SmashPig[master]: WIP use redis for Adyen jobs

2016-09-27 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review.

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

Change subject: WIP use redis for Adyen jobs
..

WIP use redis for Adyen jobs

Hmm, looks like this pushing not-arrays actually works for paypal.

Change-Id: I457c8940cdbc476fad8691ccf3ec17426c75f524
---
M PaymentProviders/Adyen/Actions/CaptureResponseAction.php
M PaymentProviders/Adyen/Actions/PaymentCaptureAction.php
M PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php
M SmashPig.yaml
4 files changed, 13 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/30/313130/1

diff --git a/PaymentProviders/Adyen/Actions/CaptureResponseAction.php 
b/PaymentProviders/Adyen/Actions/CaptureResponseAction.php
index ffc9f3c..2dae705 100644
--- a/PaymentProviders/Adyen/Actions/CaptureResponseAction.php
+++ b/PaymentProviders/Adyen/Actions/CaptureResponseAction.php
@@ -22,8 +22,8 @@
"Adding record capture job for 
{$msg->currency} {$msg->amount} with id {$msg->correlationId} and psp reference 
{$msg->pspReference}."
);
$recordJob = RecordCaptureJob::factory( $msg );
-   $jobQueue = QueueFactory::getQueue( 'jobs' );
-   $jobQueue->addObject( $recordJob );
+   $jobQueue = QueueFactory::getQueue( 
'jobs-adyen' );
+   $jobQueue->push( $recordJob );
} else {
$tl->warning(
"Capture failed for payment with 
reference {$msg->pspReference} and correlation id {$msg->correlationId}.",
diff --git a/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php 
b/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php
index 943575e..25e7a1c 100644
--- a/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php
+++ b/PaymentProviders/Adyen/Actions/PaymentCaptureAction.php
@@ -18,7 +18,7 @@
$tl = new TaggedLogger( 'PaymentCaptureAction' );
 
if ( $msg instanceof Authorisation ) {
-   $jobQueueObj = QueueFactory::getQueue( 'jobs' );
+   $jobQueueObj = QueueFactory::getQueue( 'jobs-adyen' );
if ( $msg->success ) {
// Here we need to capture the payment, the job 
runner will collect the
// orphan message
@@ -26,7 +26,7 @@
"Adding Adyen capture job for 
{$msg->currency} {$msg->amount} " .
"with id {$msg->correlationId} and psp 
reference {$msg->pspReference}."
);
-   $jobQueueObj->addObject(
+   $jobQueueObj->push(
ProcessCaptureRequestJob::factory( $msg 
)
);
 
@@ -37,7 +37,7 @@
"reported status failed: 
'{$msg->reason}'. " .
'Queueing job to delete pending 
records.'
);
-   $jobQueueObj->addObject(
+   $jobQueueObj->push(
DeletePendingJob::factory(
'adyen',
$msg->merchantReference,
diff --git a/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php 
b/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php
index b0ac3d0..80ac7d3 100644
--- a/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php
+++ b/PaymentProviders/Adyen/ExpatriatedMessages/ReportAvailable.php
@@ -20,9 +20,9 @@
$this->reason
);
 
-   $jobQueueObj = QueueFactory::getQueue( 'jobs' );
+   $jobQueueObj = QueueFactory::getQueue( 'jobs-adyen' );
if ( strpos( $this->pspReference, 'settlement_detail_report' ) 
=== 0 ) {
-   $jobQueueObj->addObject(
+   $jobQueueObj->push(
DownloadReportJob::factory(
$this->merchantAccountCode,
$this->reason
diff --git a/SmashPig.yaml b/SmashPig.yaml
index fb65a57..0f5a8e8 100644
--- a/SmashPig.yaml
+++ b/SmashPig.yaml
@@ -98,6 +98,12 @@
 -
 <<: *REDIS
 
+jobs-adyen:
+class: PHPQueue\Backend\Predis
+constructor-parameters:
+-
+<<: *REDIS
+
 verified:
 class: SmashPig\Core\DataStores\MultiQueueWriter
 constructor-parameters:

-- 
To view, 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make RecentChange::addTags() accept a string

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

Change subject: Make RecentChange::addTags() accept a string
..


Make RecentChange::addTags() accept a string

Most planned callers of RecentChange::addTags() only want to add a
single tag, so forcing them to create an array seems unfriendly. Plus
this lets us avoid a array_merge call.

Change-Id: If001ba9ff01a33be158e7edd5c5e4de9825fa180
---
M includes/changes/RecentChange.php
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  Cenarium: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/changes/RecentChange.php 
b/includes/changes/RecentChange.php
index 7ae1f29..584c813 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -1037,9 +1037,13 @@
 *
 * @since 1.28
 *
-* @param array $tags
+* @param string|array $tags
 */
public function addTags( $tags ) {
-   $this->tags = array_merge( $tags, $this->tags );
+   if ( is_string( $tags ) ) {
+   $this->tags[] = $tags;
+   } else {
+   $this->tags = array_merge( $tags, $this->tags );
+   }
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix call to EntityRevisionLookup::getEntityRevision in Prope...

2016-09-27 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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

Change subject: Fix call to EntityRevisionLookup::getEntityRevision in 
PropertyDataTypeChanger
..

Fix call to EntityRevisionLookup::getEntityRevision in PropertyDataTypeChanger

Bug: T146833
Change-Id: Ia39fd7fca194d742ad88355f3bb38bc1feb61861
---
M repo/includes/PropertyDataTypeChanger.php
M repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
2 files changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/repo/includes/PropertyDataTypeChanger.php 
b/repo/includes/PropertyDataTypeChanger.php
index 4992501..e26ef38 100644
--- a/repo/includes/PropertyDataTypeChanger.php
+++ b/repo/includes/PropertyDataTypeChanger.php
@@ -63,6 +63,7 @@
public function changeDataType( PropertyId $propertyId, User $user, 
$dataTypeId ) {
$entityRevision = 
$this->entityRevisionLookup->getEntityRevision(
$propertyId,
+   0,
EntityRevisionLookup::LATEST_FROM_MASTER
);
 
diff --git a/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php 
b/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
index 0849b7c..a3531e7 100644
--- a/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
+++ b/repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
@@ -104,6 +104,11 @@
 
$entityRevisionLookup->expects( $this->once() )
->method( 'getEntityRevision' )
+   ->with(
+   $this->isInstanceOf( PropertyId::class ),
+   0,
+   EntityRevisionLookup::LATEST_FROM_MASTER
+   )
->will( $this->returnCallback( function( PropertyId 
$propertyId ) {
if ( $propertyId->getSerialization() === 'P42' 
) {
$property = new Property(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia39fd7fca194d742ad88355f3bb38bc1feb61861
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man 

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


[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Set spellcheck=true on nested contentEditables

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

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

Change subject: Set spellcheck=true on nested contentEditables
..

Set spellcheck=true on nested contentEditables

Chrome doesn't inherit this value from the document node (although
it probably should), so explicitly set it everywhere.

Also only override right click on table cells if the cell isn't
being edited as this would prevent showing the spell check menu otherwise.

Bug: T145810
Change-Id: I0d27a9895f2d846c96984dfe45547c98c5af2513
---
M src/ce/nodes/ve.ce.SectionNode.js
M src/ce/nodes/ve.ce.TableCaptionNode.js
M src/ce/nodes/ve.ce.TableCellNode.js
M src/ce/nodes/ve.ce.TableNode.js
4 files changed, 8 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/28/313128/1

diff --git a/src/ce/nodes/ve.ce.SectionNode.js 
b/src/ce/nodes/ve.ce.SectionNode.js
index 3618db4..4b81f6f 100644
--- a/src/ce/nodes/ve.ce.SectionNode.js
+++ b/src/ce/nodes/ve.ce.SectionNode.js
@@ -25,7 +25,7 @@
 
this.$element
.addClass( 've-ce-sectionNode' )
-   .prop( 'contentEditable', 'true' );
+   .prop( { contentEditable: 'true', spellcheck: true } );
 };
 
 /* Inheritance */
diff --git a/src/ce/nodes/ve.ce.TableCaptionNode.js 
b/src/ce/nodes/ve.ce.TableCaptionNode.js
index e261db9..bcf3e74 100644
--- a/src/ce/nodes/ve.ce.TableCaptionNode.js
+++ b/src/ce/nodes/ve.ce.TableCaptionNode.js
@@ -20,7 +20,7 @@
// DOM changes
this.$element
.addClass( 've-ce-tableCaptionNode' )
-   .prop( 'contentEditable', 'true' );
+   .prop( { contentEditable: 'true', spellcheck: true } );
 };
 
 /* Inheritance */
diff --git a/src/ce/nodes/ve.ce.TableCellNode.js 
b/src/ce/nodes/ve.ce.TableCellNode.js
index 3027168..9319212 100644
--- a/src/ce/nodes/ve.ce.TableCellNode.js
+++ b/src/ce/nodes/ve.ce.TableCellNode.js
@@ -41,8 +41,10 @@
this.$element.attr( 'colspan', colspan );
}
 
-   // Add tooltip
-   this.$element.attr( 'title', ve.msg( 'visualeditor-tablecell-tooltip' ) 
);
+   this.$element
+   // Add tooltip
+   .attr( 'title', ve.msg( 'visualeditor-tablecell-tooltip' ) )
+   .prop( 'spellcheck', true );
 
// Events
this.model.connect( this, {
diff --git a/src/ce/nodes/ve.ce.TableNode.js b/src/ce/nodes/ve.ce.TableNode.js
index 8b390e4..0a2a0fe 100644
--- a/src/ce/nodes/ve.ce.TableNode.js
+++ b/src/ce/nodes/ve.ce.TableNode.js
@@ -139,8 +139,8 @@
return;
}
 
-   // Right-click
-   if ( e.which === OO.ui.MouseButtons.RIGHT ) {
+   // Right-click on a cell which isn't being edited
+   if ( e.which === OO.ui.MouseButtons.RIGHT && !this.getActiveCellNode() 
) {
// Select the cell to the browser renders the correct context 
menu
ve.selectElement( cellNode.$element[ 0 ] );
setTimeout( function () {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d27a9895f2d846c96984dfe45547c98c5af2513
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Blank user pages should be editable

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

Change subject: Blank user pages should be editable
..


Blank user pages should be editable

* Untangle checking if a page is editable from display of the edit icon.
* Improve existing isCurrentPageEditable method to also consider content
  type - the benefit of this is that editor code will now not load for
  pages with incompatible content types
* Use existing method in page action logic
* Add a browser test to avoid this regression in future.

Bug: T143854
Change-Id: Ice5f5b8fd93c5f541d4877b1baca08719e9df484
---
M includes/skins/SkinMinerva.php
M tests/browser/features/step_definitions/user_page_steps.rb
M tests/browser/features/support/pages/user_page.rb
M tests/browser/features/user_page.feature
4 files changed, 32 insertions(+), 9 deletions(-)

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



diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index d85f9b1..4d7952a 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -140,8 +140,8 @@
 *   the user is on the main page
 * 
 *
-* The "edit" page action is allowed if the content of the page 
supports direct editing via the
-* API.
+* The "edit" page action is not allowed if editing is not possible on 
the page
+* see @method: isCurrentPageEditable
 *
 * The "switch-language" is allowed if 
$wgMinervaUsePageActionBarV2 is truthy and
 * there are interlanguage links on the page, or 
$wgMinervaAlwaysShowLanguageButton
@@ -163,10 +163,7 @@
}
 
if ( $action === 'edit' ) {
-   $contentHandler = $this->getContentHandler();
-
-   return $contentHandler->supportsDirectEditing() &&
-   $contentHandler->supportsDirectApiEditing();
+   return $this->isCurrentPageEditable();
}
 
if ( $action === 'switch-language' ) {
@@ -1064,17 +1061,22 @@
}
 
/**
-* Checks to see if the current page is (probably) editable.
+* Checks to see if the current page is (probably) editable and it is 
possible for the
+* editor to handle the existing content handler type.
 *
-* This is the same check that sets wgIsProbablyEditable later in the 
page output
+* This is mostly the same check that sets wgIsProbablyEditable later 
in the page output
 * process.
 *
 * @return boolean
 */
protected function isCurrentPageEditable() {
+   $contentHandler = $this->getContentHandler();
+
$title = $this->getTitle();
$user = $this->getUser();
return $title->quickUserCan( 'edit', $user )
+   && $contentHandler->supportsDirectEditing()
+   && $contentHandler->supportsDirectApiEditing()
&& ( $title->exists() || $title->quickUserCan( 
'create', $user ) );
}
 
@@ -1170,7 +1172,7 @@
// Explicitly add the mobile watchstar code.
$modules[] = 'skins.minerva.watchstar';
}
-   if ( $this->isAllowedPageAction( 'edit' ) ) {
+   if ( $this->isCurrentPageEditable() ) {
$modules[] = 'skins.minerva.editor';
}
}
diff --git a/tests/browser/features/step_definitions/user_page_steps.rb 
b/tests/browser/features/step_definitions/user_page_steps.rb
index a10c0cd..936ed10 100644
--- a/tests/browser/features/step_definitions/user_page_steps.rb
+++ b/tests/browser/features/step_definitions/user_page_steps.rb
@@ -22,3 +22,14 @@
 Then(/^there should be a link to my uploads$/) do
   expect(on(UserPage).uploads_link_element).to be_visible
 end
+
+Then(/^there should be a link to create my user page$/) do
+  expect(on(UserPage).edit_link_element).to be_visible
+end
+
+When(/^I click the create my user page link$/) do
+  on(UserPage) do |page|
+page.wait_until_rl_module_ready('skins.minerva.editor')
+page.edit_link_element.click
+  end
+end
diff --git a/tests/browser/features/support/pages/user_page.rb 
b/tests/browser/features/support/pages/user_page.rb
index 1c82d8e..77b0803 100644
--- a/tests/browser/features/support/pages/user_page.rb
+++ b/tests/browser/features/support/pages/user_page.rb
@@ -5,6 +5,7 @@
 
   h1(:heading, css: '#section_0')
   ul(:user_links, css: '.user-links')
+  div(:cta_holder, css: '.cta-holder')
   a(:talk_link) do |page|
 page.user_links_element.element.a(href: /User_talk:/)
   end
@@ -14,4 +15,7 @@
   a(:uploads_link) do |page|
 page.user_links_element.element.a(href: /Special:Uploads\//)
   end
+  a(:edit_link) do |page|
+  

  1   2   3   >