[MediaWiki-commits] [Gerrit] Make extensionname-translate optional - change (translatewiki)

2015-09-24 Thread Amire80 (Code Review)
Amire80 has uploaded a new change for review.

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

Change subject: Make extensionname-translate optional
..

Make extensionname-translate optional

Change-Id: I6aefa8f914f9c5f32b91925acf2c9d5423cdc368
---
M groups/MediaWiki/mediawiki-extensions.txt
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/72/240972/1

diff --git a/groups/MediaWiki/mediawiki-extensions.txt 
b/groups/MediaWiki/mediawiki-extensions.txt
index 1b75ee3..3b3a772 100644
--- a/groups/MediaWiki/mediawiki-extensions.txt
+++ b/groups/MediaWiki/mediawiki-extensions.txt
@@ -2297,6 +2297,7 @@
 # aliasfile = Translate/Translate.MyLanguage.alias.php // Disabled due to a 
conflict with core
 optional = translate-page-paging-links, supportedlanguages-portallink, 
supportedlanguages-portallink-nocldr
 optional = group-translate-proofr.css, group-translate-proofr.js
+optional = extensionname-translate
 ignored = translate-edit-tag-warning, supportedlanguages-localsummary
 
 Translate - Page Translation

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6aefa8f914f9c5f32b91925acf2c9d5423cdc368
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Amire80 

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


[MediaWiki-commits] [Gerrit] Put InfoAction distinct user counts behind miser mode - change (mediawiki/core)

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

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

Change subject: Put InfoAction distinct user counts behind miser mode
..

Put InfoAction distinct user counts behind miser mode

* The random I/O due to secondary lookups causes timeouts on
  larges pages that keep showing up in the logs.

Change-Id: I9bddcd3ba9ad5ff2f26ccec4553906ecc4a8129b
---
M includes/actions/InfoAction.php
1 file changed, 17 insertions(+), 13 deletions(-)


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

diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php
index f3670a8..d9324e7 100644
--- a/includes/actions/InfoAction.php
+++ b/includes/actions/InfoAction.php
@@ -555,9 +555,11 @@
);
 
// Total number of distinct authors
-   $pageInfo['header-edits'][] = array(
-   $this->msg( 'pageinfo-authors' ), $lang->formatNum( 
$pageCounts['authors'] )
-   );
+   if ( $pageCounts['authors'] > 0 ) {
+   $pageInfo['header-edits'][] = array(
+   $this->msg( 'pageinfo-authors' ), 
$lang->formatNum( $pageCounts['authors'] )
+   );
+   }
 
// Recent number of edits (within past 30 days)
$pageInfo['header-edits'][] = array(
@@ -718,20 +720,23 @@
// Total number of edits
$edits = (int)$dbr->selectField(
'revision',
-   'COUNT(rev_page)',
+   'COUNT(*)',
array( 'rev_page' => $id ),
__METHOD__
);
$result['edits'] = $edits;
 
// Total number of distinct authors
-   $authors = (int)$dbr->selectField(
-   'revision',
-   'COUNT(DISTINCT rev_user_text)',
-   array( 'rev_page' => $id ),
-   __METHOD__
-   );
-   $result['authors'] = $authors;
+   if ( $config->get( 'MiserMode' ) ) {
+   $result['authors'] = 0;
+   } else {
+   $result['authors'] = (int)$dbr->selectField(
+   'revision',
+   'COUNT(DISTINCT rev_user_text)',
+   array( 'rev_page' => $id ),
+   __METHOD__
+   );
+   }
 
// "Recent" threshold defined by RCMaxAge setting
$threshold = $dbr->timestamp( time() - $config->get( 'RCMaxAge' 
) );
@@ -749,7 +754,7 @@
$result['recent_edits'] = $edits;
 
// Recent number of distinct authors
-   $authors = (int)$dbr->selectField(
+   $result['recent_authors'] = (int)$dbr->selectField(
'revision',
'COUNT(DISTINCT rev_user_text)',
array(
@@ -758,7 +763,6 @@
),
__METHOD__
);
-   $result['recent_authors'] = $authors;
 
// Subpages (if enabled)
if ( MWNamespace::hasSubpages( $title->getNamespace() ) ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9bddcd3ba9ad5ff2f26ccec4553906ecc4a8129b
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] Adding PLURAL support to mwe-upwiz-multi-file-select message - change (mediawiki...UploadWizard)

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

Change subject: Adding PLURAL support to mwe-upwiz-multi-file-select message
..


Adding PLURAL support to mwe-upwiz-multi-file-select message

Change-Id: I7422701390ad1c8ca3ccead20100c59f0832fa81
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index e2da1d7..472801d 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -45,7 +45,7 @@
"mwe-upwiz-flickr-disclaimer1": "This form will load content hosted by 
flickr.com and subject to the\nFlickr [https://www.flickr.com/help/terms/ terms 
of use] and [https://www.flickr.com/help/privacy-policy/ privacy policy].",
"mwe-upwiz-flickr-disclaimer2": "Please note that by using this tool, 
your IP address and request details will be available to Flickr.",
"mwe-upwiz-error-no-image-retrieved": "We could not retrieve the file 
from $1.",
-   "mwe-upwiz-multi-file-select": "Draw a box with your cursor over the 
files you would like to upload. Hold down the Ctrl/Command key to make multiple 
non-adjacent selections. You can select up to $1 files to upload.",
+   "mwe-upwiz-multi-file-select": "Draw a box with your cursor over the 
files you would like to upload. Hold down the Ctrl/Command key to make multiple 
non-adjacent selections. You can select up to $1 {{PLURAL:$1|file|files}} to 
upload.",
"mwe-upwiz-transport-started": "Starting...",
"mwe-upwiz-encoding": "Encoding...",
"mwe-upwiz-uploading": "Uploading...",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7422701390ad1c8ca3ccead20100c59f0832fa81
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Kaldari 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: MarkTraceur 
Gerrit-Reviewer: Raimond Spekking 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add support for translating extension name - change (mediawiki...TopTenPages)

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

Change subject: Add support for translating extension name
..


Add support for translating extension name

Change-Id: Ifbf63235c129f6477ea1fb10d986d15c69c18f1a
---
M extension.json
M i18n/en.json
M i18n/qqq.json
3 files changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/extension.json b/extension.json
index bbf5cb1..2f559c5 100644
--- a/extension.json
+++ b/extension.json
@@ -1,5 +1,6 @@
 {
"name": "TopTenPages",
+   "namemsg": "toptenpages-extensionname",
"version": "0.4.0",
"author": [
"Timo Tijhof",
diff --git a/i18n/en.json b/i18n/en.json
index 927d997..3e0b812 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -5,5 +5,6 @@
]
},
"toptenpages": "Top Ten pages",
+   "toptenpages-extensionname": "TopTenPages",
"toptenpages-desc": "Shows most viewed pages."
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 75481e2..edb2014 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -6,5 +6,6 @@
]
},
"toptenpages": "{{doc-special|TopTenPages}}",
+   "toptenpages-extensionname": "{{optional}} Name of the extension as 
displayed on Special:Version.",
"toptenpages-desc": 
"{{desc|what=extension|name=TopTenPages|url=https://www.mediawiki.org/wiki/Extension:TopTenPages}}";
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifbf63235c129f6477ea1fb10d986d15c69c18f1a
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/TopTenPages
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] [WIP] Made saveToCache() use the since option with set() - change (mediawiki...CentralAuth)

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

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

Change subject: [WIP] Made saveToCache() use the since option with set()
..

[WIP] Made saveToCache() use the since option with set()

Change-Id: I4a4796f496f208b089ee8a2ae4d6429fcd511760
---
M includes/CentralAuthUser.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index b9c7c91..730ee7f 100644
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -389,7 +389,8 @@
 
$obj = $this->getCacheObject();
wfDebugLog( 'CentralAuthVerbose', "Saving user {$this->mName} 
to cache." );
-   ObjectCache::getMainWANInstance()->set( $this->getCacheKey(), 
$obj, 86400 );
+   $opts = array( 'since' => 
self::getCentralSlaveDB()->trxTimestamp() );
+   ObjectCache::getMainWANInstance()->set( $this->getCacheKey(), 
$obj, 86400, $opts );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4a4796f496f208b089ee8a2ae4d6429fcd511760
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
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] Adding PLURAL support to mwe-upwiz-multi-file-select message - change (mediawiki...UploadWizard)

2015-09-24 Thread Kaldari (Code Review)
Kaldari has uploaded a new change for review.

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

Change subject: Adding PLURAL support to mwe-upwiz-multi-file-select message
..

Adding PLURAL support to mwe-upwiz-multi-file-select message

Change-Id: I7422701390ad1c8ca3ccead20100c59f0832fa81
---
M i18n/en.json
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index e2da1d7..472801d 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -45,7 +45,7 @@
"mwe-upwiz-flickr-disclaimer1": "This form will load content hosted by 
flickr.com and subject to the\nFlickr [https://www.flickr.com/help/terms/ terms 
of use] and [https://www.flickr.com/help/privacy-policy/ privacy policy].",
"mwe-upwiz-flickr-disclaimer2": "Please note that by using this tool, 
your IP address and request details will be available to Flickr.",
"mwe-upwiz-error-no-image-retrieved": "We could not retrieve the file 
from $1.",
-   "mwe-upwiz-multi-file-select": "Draw a box with your cursor over the 
files you would like to upload. Hold down the Ctrl/Command key to make multiple 
non-adjacent selections. You can select up to $1 files to upload.",
+   "mwe-upwiz-multi-file-select": "Draw a box with your cursor over the 
files you would like to upload. Hold down the Ctrl/Command key to make multiple 
non-adjacent selections. You can select up to $1 {{PLURAL:$1|file|files}} to 
upload.",
"mwe-upwiz-transport-started": "Starting...",
"mwe-upwiz-encoding": "Encoding...",
"mwe-upwiz-uploading": "Uploading...",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7422701390ad1c8ca3ccead20100c59f0832fa81
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Kaldari 

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


[MediaWiki-commits] [Gerrit] Avoid CAS errors on double post to ApiOptions - change (mediawiki/core)

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

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

Change subject: Avoid CAS errors on double post to ApiOptions
..

Avoid CAS errors on double post to ApiOptions

Bug: T95839
Change-Id: I62f8eea31164be1ab0eacf31c494f0b296b367f2
---
M includes/User.php
M includes/api/ApiOptions.php
2 files changed, 4 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/68/240968/1

diff --git a/includes/User.php b/includes/User.php
index d57dfaa..31d3a99 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -1203,18 +1203,15 @@
return false;
}
 
-   $db = ( $flags & self::READ_LATEST )
-   ? wfGetDB( DB_MASTER )
-   : wfGetDB( DB_SLAVE );
+   list( $index, $options ) = DBAccessObjectUtils::getDBOptions( 
$flags );
+   $db = wfGetDB( $index );
 
$s = $db->selectRow(
'user',
self::selectFields(),
array( 'user_id' => $this->mId ),
__METHOD__,
-   ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING 
)
-   ? array( 'LOCK IN SHARE MODE' )
-   : array()
+   $options
);
 
$this->queryFlagsUsed = $flags;
diff --git a/includes/api/ApiOptions.php b/includes/api/ApiOptions.php
index a62bcb6..74ce053 100644
--- a/includes/api/ApiOptions.php
+++ b/includes/api/ApiOptions.php
@@ -55,7 +55,7 @@
// Load the user from the master to reduce CAS errors on double 
post (T95839)
if ( wfGetLB()->getServerCount() > 1 ) {
$user = User::newFromId( $user->getId() );
-   if ( !$user->loadFromId( User::READ_LATEST ) ) {
+   if ( !$user->loadFromId( User::READ_EXCLUSIVE ) ) {
$this->dieUsage( 'Anonymous users cannot change 
preferences', 'notloggedin' );
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I62f8eea31164be1ab0eacf31c494f0b296b367f2
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] Convert i18n to JSON - change (mediawiki...DateDiff)

2015-09-24 Thread Siebrand (Code Review)
Siebrand has submitted this change and it was merged.

Change subject: Convert i18n to JSON
..


Convert i18n to JSON

Change-Id: I002f9cbf5fdb9515971601c13ee1bd7f6d3795e5
---
D DateDiff.i18n.php
M DateDiff.php
A i18n/ast.json
A i18n/be-tarask.json
A i18n/bg.json
A i18n/br.json
A i18n/bs.json
A i18n/ca.json
A i18n/cs.json
A i18n/de.json
A i18n/dsb.json
A i18n/en.json
A i18n/es.json
A i18n/fi.json
A i18n/fr.json
A i18n/gl.json
A i18n/gsw.json
A i18n/he.json
A i18n/hsb.json
A i18n/hu.json
A i18n/ia.json
A i18n/id.json
A i18n/it.json
A i18n/ja.json
A i18n/ko.json
A i18n/ksh.json
A i18n/lb.json
A i18n/mg.json
A i18n/mk.json
A i18n/ml.json
A i18n/ms.json
A i18n/mt.json
A i18n/nb.json
A i18n/nl.json
A i18n/pl.json
A i18n/pms.json
A i18n/pt-br.json
A i18n/pt.json
A i18n/roa-tara.json
A i18n/ru.json
A i18n/sk.json
A i18n/sl.json
A i18n/sv.json
A i18n/te.json
A i18n/tet.json
A i18n/tl.json
A i18n/tyv.json
A i18n/uk.json
A i18n/zh-hans.json
A i18n/zh-hant.json
50 files changed, 385 insertions(+), 349 deletions(-)

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



diff --git a/DateDiff.i18n.php b/DateDiff.i18n.php
deleted file mode 100644
index b0525a2..000
--- a/DateDiff.i18n.php
+++ /dev/null
@@ -1,348 +0,0 @@
- 'Takes two dates and returns all intermediate days'
-);
-
-/** Asturian (asturianu)
- * @author Xuacu
- */
-$messages['ast'] = array(
-   'datediff-desc' => 'Toma dos dates y devuelve tolos díes intermedios',
-);
-
-/** Belarusian (Taraškievica orthography) (беларуская (тарашкевіца)‎)
- * @author EugeneZelenko
- */
-$messages['be-tarask'] = array(
-   'datediff-desc' => 'Вяртае ўсе дні паміж двума пададзенымі датамі',
-);
-
-/** Bulgarian (български)
- * @author DCLXVI
- */
-$messages['bg'] = array(
-   'datediff-desc' => 'Взема две дати и връща всички дни между тях',
-);
-
-/** Breton (brezhoneg)
- * @author Gwendal
- */
-$messages['br'] = array(
-   'datediff-desc' => 'Kemer daou deiziad ha reiñ a ra an deizioù etre',
-);
-
-/** Bosnian (bosanski)
- * @author CERminator
- */
-$messages['bs'] = array(
-   'datediff-desc' => 'Uzima dva datuma i vraća sve dane između njih',
-);
-
-/** Catalan (català)
- * @author Aleator
- */
-$messages['ca'] = array(
-   'datediff-desc' => 'Pren dues dates i retorna tots els dies intermedis',
-);
-
-/** Czech (česky)
- * @author Mormegil
- */
-$messages['cs'] = array(
-   'datediff-desc' => 'Na základě dvou dat vrátí všechny mezilehlé dny',
-);
-
-/** German (Deutsch)
- * @author Kghbln
- */
-$messages['de'] = array(
-   'datediff-desc' => 'Ermöglicht die Ausgabe aller Tage, die zwischen 
zwei angegebenen Tagen liegen',
-);
-
-/** Lower Sorbian (dolnoserbski)
- * @author Michawiki
- */
-$messages['dsb'] = array(
-   'datediff-desc' => 'Wudawa wšykne dny, kótarež su mjazy dwěma pódanyma 
dnjoma',
-);
-
-/** Spanish (español)
- * @author Sanbec
- */
-$messages['es'] = array(
-   'datediff-desc' => 'Toma dos fechas y devuelve todos los días 
intermedios',
-);
-
-/** Finnish (suomi)
- * @author Nike
- */
-$messages['fi'] = array(
-   'datediff-desc' => 'Tuottaa kaikki päivät kahden päivämäärän välillä',
-);
-
-/** French (français)
- * @author Sherbrooke
- */
-$messages['fr'] = array(
-   'datediff-desc' => 'Prend deux dates et retourne tous les jours 
intermédiaires',
-);
-
-/** Galician (galego)
- * @author Toliño
- */
-$messages['gl'] = array(
-   'datediff-desc' => 'Toma dúas datas e devolve todos os días 
intermedios',
-);
-
-/** Swiss German (Alemannisch)
- * @author Als-Holder
- */
-$messages['gsw'] = array(
-   'datediff-desc' => 'Git alli Däg zruck, wu zwische zwee bstime Däg 
lige',
-);
-
-/** Hebrew (עברית)
- * @author YaronSh
- */
-$messages['he'] = array(
-   'datediff-desc' => 'קבלת שני תאריכים והחזרת כל הימים שביניהם',
-);
-
-/** Upper Sorbian (hornjoserbsce)
- * @author Michawiki
- */
-$messages['hsb'] = array(
-   'datediff-desc' => 'Bjerje dwaj datumaj a wróća wšě dny mjez nimaj',
-);
-
-/** Hungarian (magyar)
- * @author Dani
- */
-$messages['hu'] = array(
-   'datediff-desc' => 'Visszaadja két dátum közötti összes napot',
-);
-
-/** Interlingua (interlingua)
- * @author McDutchie
- */
-$messages['ia'] = array(
-   'datediff-desc' => 'Prende duo datas e retorna tote le dies inter 
illos',
-);
-
-/** Indonesian (Bahasa Indonesia)
- * @author Farras
- */
-$messages['id'] = array(
-   'datediff-desc' => 'Mengambil dua tanggal dan mengembalikan semua hari 
pertengahan',
-);
-
-/** Italian (italiano)
- * @author Pietrodn
- */
-$messages['it'] = array(
-   'datediff-desc' => 'Prende due date e restituisce tutti i giorni 
intermedi',
-);
-
-/** Japanese (日本語)
- * @author Shirayuki
- * @author Yanajin66
- */
-$messages['ja'] = array(
-   'datediff-desc' => '2 つの日付を受け取って、その間の日数を返す',
-);
-
-/** Korean (한국어)
- * @author 아라
- */
-$messages['ko'] = array(
-   'datediff-desc' => '두 날짜를 받아 이에 대한 중간 날짜를 반

[MediaWiki-commits] [Gerrit] Fix frozen index tests - change (mediawiki...CirrusSearch)

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

Change subject: Fix frozen index tests
..


Fix frozen index tests

Added a delay after "thaw" and replaced "within" search with a single search.

Change-Id: Ifdb209275e77afef324c97270f9c6863e6a5935f
---
M tests/browser/features/frozen_index_api.feature
1 file changed, 9 insertions(+), 4 deletions(-)

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



diff --git a/tests/browser/features/frozen_index_api.feature 
b/tests/browser/features/frozen_index_api.feature
index db5d5dc..cae7e64 100644
--- a/tests/browser/features/frozen_index_api.feature
+++ b/tests/browser/features/frozen_index_api.feature
@@ -10,7 +10,8 @@
  And I api search for superduperfrozen
  And FrozenTest is not in the api search results
 When I globally thaw indexing
-Then within 20 seconds api searching for superduperfrozen yields 
FrozenTest as the first result
+ And I wait 10 seconds
+Then I api search for superduperfrozen yields FrozenTest as the first 
result
 
   Scenario: Deletes to frozen indexes are delayed
Given a page named FrozenDeleteTest exists with contents bazbarfoo
@@ -22,11 +23,14 @@
  And I api search for bazbarfoo
  And FrozenDeleteTest is the first api search result
 When I globally thaw indexing
-Then within 20 seconds api searching for bazbarfoo yields no results
+ And I wait 10 seconds
+Then I api search for bazbarfoo yields no results
 
   @commons
   Scenario: Updates to OtherIndex are delayed
-   Given a file named File:Frozen.svg exists on commons with contents 
Frozen.svg and description File stored on commons and locally for frozen tests
+   Given I delete on commons File:Frozen.svg
+  And I delete File:Frozen.svg
+  And a file named File:Frozen.svg exists on commons with contents 
Frozen.svg and description File stored on commons and locally for frozen tests
   And a file named File:Frozen.svg exists with contents Frozen.svg and 
description Locally stored file also on commons for frozen tests
 
  And within 20 seconds api searching in namespace 6 for frozen yields 
Locally stored file also on commons for *frozen* tests as the highlighted 
snippet of the first api search result
@@ -37,4 +41,5 @@
  And I api search in namespace 6 for frozen
  And Locally stored file also on commons for *frozen* tests is the 
highlighted snippet of the first api search result
 When I globally thaw indexing
-Then within 30 seconds api searching in namespace 6 for frozen yields 
*frozen* reupload of locally stored file as the highlighted snippet of the 
first api search result
+ And I wait 10 seconds
+Then I api search in namespace 6 for frozen yields *frozen* reupload of 
locally stored file as the highlighted snippet of the first api search result

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

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

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


[MediaWiki-commits] [Gerrit] Set $wgWikiEditorFeatures in extension.json - change (mediawiki...WikiEditor)

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

Change subject: Set $wgWikiEditorFeatures in extension.json
..


Set $wgWikiEditorFeatures in extension.json

We can do this now using a merge strategy of "array_plus_2d".

Change-Id: Ib1536633424bad46ff7861bc145025418af0286a
---
M WikiEditor.hooks.php
M extension.json
2 files changed, 19 insertions(+), 39 deletions(-)

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



diff --git a/WikiEditor.hooks.php b/WikiEditor.hooks.php
index ccb5448..3305c3b 100644
--- a/WikiEditor.hooks.php
+++ b/WikiEditor.hooks.php
@@ -91,43 +91,6 @@
/* Static Methods */
 
/**
-* T99257: Extension registration does not properly support 2d arrays 
so set it as a global for now
-*/
-   public static function onRegistration() {
-   // Each module may be configured individually to be globally 
on/off or user preference based
-   $features = array(
-
-   /* Textarea / i-frame compatible (OK to deploy) */
-
-   'toolbar' => array( 'global' => false, 'user' => true ),
-   // Provides interactive tools
-   'dialogs' => array( 'global' => false, 'user' => true ),
-
-   /* Textarea / i-frame compatible, but still 
experimental and unstable (do not deploy!) */
-
-   // Adds a tab for previewing in-line
-   'preview' => array( 'global' => false, 'user' => true ),
-   // Adds a button and dialog for step-by-step publishing
-   'publish' => array( 'global' => false, 'user' => true ),
-   );
-
-   // Eww, do a 2d array merge so we don't wipe out settings
-   global $wgWikiEditorFeatures;
-   if ( $wgWikiEditorFeatures ) {
-   foreach ( $features as $name => $settings ) {
-   if ( isset( $wgWikiEditorFeatures[$name] ) ) {
-   $wgWikiEditorFeatures[$name] += 
$settings;
-   } else {
-   $wgWikiEditorFeatures[$name] = 
$settings;
-   }
-   }
-   } else {
-   $wgWikiEditorFeatures = $features;
-   }
-
-   }
-
-   /**
 * Checks if a certain option is enabled
 *
 * This method is public to allow other extensions that use WikiEditor 
to use the
diff --git a/extension.json b/extension.json
index 1cb026c..b7762b2 100644
--- a/extension.json
+++ b/extension.json
@@ -12,7 +12,6 @@
"descriptionmsg": "wikieditor-desc",
"license-name": "GPL-2.0+",
"type": "other",
-   "callback": "WikiEditorHooks::onRegistration",
"MessagesDirs": {
"WikiEditor": [
"i18n"
@@ -420,7 +419,25 @@
"remoteExtPath": "WikiEditor/modules"
},
"config": {
-   "@doc": "WikiEditorFeatures is set in WikiEditor.hooks.php"
+   "WikiEditorFeatures": {
+   "toolbar": {
+   "global": false,
+   "user": true
+   },
+   "dialogs": {
+   "global": false,
+   "user": true
+   },
+   "preview": {
+   "global": false,
+   "user": true
+   },
+   "publish": {
+   "global": false,
+   "user": true
+   },
+   "_merge_strategy": "array_plus_2d"
+   }
},
"AutoloadClasses": {
"WikiEditorHooks": "WikiEditor.hooks.php"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1536633424bad46ff7861bc145025418af0286a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: TheDJ 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Remove jshint and extension-unittests-generic from TopTenPages - change (integration/config)

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

Change subject: Remove jshint and extension-unittests-generic from TopTenPages
..


Remove jshint and extension-unittests-generic from TopTenPages

Follows-up I8de123feca.

* Extension doesn't have any javascript files. And even if it would,
  don't enable jshint jobs in repos without .jshintrc.
* Extension doesn't have mediawiki unit tests, uses composer instead.

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

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



diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 44e76d4..009a293 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -6613,9 +6613,7 @@
   - name: mediawiki/extensions/TopTenPages
 template:
   - name: composer-test
-  - name: jshint
   - name: jsonlint
-  - name: extension-unittests-generic
 
   - name: mediawiki/extensions/VIKI
 template:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1af237660be387dec13be4786c7454047e8261a2
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Hashar 
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] Remove jshint and extension-unittests-generic from TopTenPages - change (integration/config)

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

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

Change subject: Remove jshint and extension-unittests-generic from TopTenPages
..

Remove jshint and extension-unittests-generic from TopTenPages

Follows-up I8de123feca.

* Extension doesn't have any javascript files. And even if it would,
  don't enable jshint jobs in repos without .jshintrc.
* Extension doesn't have mediawiki unit tests, uses composer instead.

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


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/67/240967/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 44e76d4..009a293 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -6613,9 +6613,7 @@
   - name: mediawiki/extensions/TopTenPages
 template:
   - name: composer-test
-  - name: jshint
   - name: jsonlint
-  - name: extension-unittests-generic
 
   - name: mediawiki/extensions/VIKI
 template:

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

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

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


[MediaWiki-commits] [Gerrit] phpunit: Set $wgMainStash to 'hash' during test execution - change (mediawiki/core)

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

Change subject: phpunit: Set $wgMainStash to 'hash' during test execution
..


phpunit: Set $wgMainStash to 'hash' during test execution

Also clean up the other cache settings to match their order
as defined in DefaultSettings.php.

Don't disable MessageCacheType, ParserCacheType etc. This could
prevent bugs from happening during tests. They are enabled by default
in MediaWiki with CACHE_ANYTHING. At least let them use 'hash'
during tests to resemble a more realistic environment.

Change-Id: Id9edf33c600db3ac4d837e1674a8eb2f5363a4f8
---
M tests/phpunit/MediaWikiTestCase.php
M tests/phpunit/phpunit.php
2 files changed, 16 insertions(+), 6 deletions(-)

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



diff --git a/tests/phpunit/MediaWikiTestCase.php 
b/tests/phpunit/MediaWikiTestCase.php
index 73c4066..bd30397 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -103,8 +103,8 @@
 */
ObjectCache::$instances[CACHE_DB] = new HashBagOStuff;
 
-   // Sandbox APC by replacing with in-process hash cache instead.
-   // Ensures tests are removed between tests.
+   // Sandbox APC by replacing with in-process hash instead.
+   // Ensures values are removed between tests.
ObjectCache::$instances['apc'] =
ObjectCache::$instances['xcache'] =
ObjectCache::$instances['wincache'] = new HashBagOStuff;
diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php
index 587d6d0..af924a0 100755
--- a/tests/phpunit/phpunit.php
+++ b/tests/phpunit/phpunit.php
@@ -66,11 +66,21 @@
// wfWarn should cause tests to fail
$wgDevelopmentWarnings = true;
 
+   // Make sure all caches and stashes are either disabled or use
+   // in-process cache only to prevent tests from using any 
preconfigured
+   // cache meant for the local wiki from outside the test run.
+   // See also MediaWikiTestCase::run() which mocks CACHE_DB and 
APC.
+
+   // Disabled in DefaultSettings, override local settings
+   $wgMainWANCache =
$wgMainCacheType = CACHE_NONE;
-   $wgMainWANCache = CACHE_NONE;
-   $wgMessageCacheType = CACHE_NONE;
-   $wgParserCacheType = CACHE_NONE;
-   $wgLanguageConverterCacheType = CACHE_NONE;
+   // Uses CACHE_ANYTHING in DefaultSettings, use hash instead of 
db
+   $wgMessageCacheType =
+   $wgParserCacheType =
+   $wgSessionCacheType =
+   $wgLanguageConverterCacheType = 'hash';
+   // Uses db-replicated in DefaultSettings
+   $wgMainStash = 'hash';
 
$wgUseDatabaseMessages = false; # Set for future resets
 

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

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

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


[MediaWiki-commits] [Gerrit] Fix media viewer for files with special characters - change (mediawiki...MobileFrontend)

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

Change subject: Fix media viewer for files with special characters
..


Fix media viewer for files with special characters

The file's title is never encoded before it's added to the URL fragment
despite the URL fragment being decoded prior to rendering the media
viewer. When the file's title contains special characters, then the
decode step throws an error in Safari 8 (and possibly others).

Encode the file's title before it's added to the URL fragment.

Bug: T111609
Change-Id: Ib09b791c9a01868a04eb8d079eb4a7704dadeaad
---
M resources/mobile.mediaViewer/ImageOverlay.js
M resources/skins.minerva.scripts/init.js
2 files changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/resources/mobile.mediaViewer/ImageOverlay.js 
b/resources/mobile.mediaViewer/ImageOverlay.js
index 65d8957..adf9904 100644
--- a/resources/mobile.mediaViewer/ImageOverlay.js
+++ b/resources/mobile.mediaViewer/ImageOverlay.js
@@ -78,7 +78,7 @@
 * @param {Thumbnail} thumbnail
 */
setNewImage: function ( thumbnail ) {
-   window.location.hash = '#/media/' + 
thumbnail.getFileName();
+   window.location.hash = '#/media/' + encodeURIComponent( 
thumbnail.getFileName() );
},
/** @inheritdoc */
preRender: function () {
diff --git a/resources/skins.minerva.scripts/init.js 
b/resources/skins.minerva.scripts/init.js
index 1f0cbd4..7f0ea58 100644
--- a/resources/skins.minerva.scripts/init.js
+++ b/resources/skins.minerva.scripts/init.js
@@ -24,7 +24,7 @@
 */
function onClickImage( ev ) {
ev.preventDefault();
-   router.navigate( '#/media/' + $( this ).data( 'thumb' 
).getFileName() );
+   router.navigate( '#/media/' + encodeURIComponent( $( this 
).data( 'thumb' ).getFileName() ) );
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib09b791c9a01868a04eb8d079eb4a7704dadeaad
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx 
Gerrit-Reviewer: Bmansurov 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: Jhobs 
Gerrit-Reviewer: Phuedx 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Made wfIsBadImage() use APC - change (mediawiki/core)

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

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

Change subject: Made wfIsBadImage() use APC
..

Made wfIsBadImage() use APC

* Article 404s spend are large chunk of their time
  there and the method is also hit on page save

Change-Id: I26043f596195a8fe322bc154bf375a6c5d39c968
---
M includes/GlobalFunctions.php
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/66/240966/1

diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index 404d2cf..624e8ff 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -4072,7 +4072,7 @@
  * @return bool
  */
 function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
-   static $badImageCache = null; // based on bad_image_list msg
+   $cache = ObjectCache::newAccelerator( 'hash' );
 
# Handle redirects
$redirectTitle = RepoGroup::singleton()->checkRedirect( 
Title::makeTitle( NS_FILE, $name ) );
@@ -4086,10 +4086,11 @@
return $bad;
}
 
+   $key = wfMemcKey( 'bad-image-list' );
$cacheable = ( $blacklist === null );
-   if ( $cacheable && $badImageCache !== null ) {
-   $badImages = $badImageCache;
-   } else { // cache miss
+   $badImages = $cacheable ? $cache->get( $key ) : false;
+
+   if ( $badImages === false ) { // cache miss
if ( $blacklist === null ) {
$blacklist = wfMessage( 'bad_image_list' 
)->inContentLanguage()->plain(); // site list
}
@@ -4126,12 +4127,13 @@
}
}
if ( $cacheable ) {
-   $badImageCache = $badImages;
+   $cache->set( $key, $badImages, 15 );
}
}
 
$contextKey = $contextTitle ? $contextTitle->getPrefixedDBkey() : false;
$bad = isset( $badImages[$name] ) && !isset( 
$badImages[$name][$contextKey] );
+
return $bad;
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26043f596195a8fe322bc154bf375a6c5d39c968
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] Remove api code that is not used or replicated in core - change (mediawiki...MobileFrontend)

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

Change subject: Remove api code that is not used or replicated in core
..


Remove api code that is not used or replicated in core

We are loading this code when we don't need to. I'm really keen for us
to remove this as it impacts the time for all our users to access features such
as search. Every byte counts.

Bug: T110718
Change-Id: Ibc243a7308c4c2e91c2926fc5c667a774b8404ce
---
M resources/mobile.startup/api.js
D tests/qunit/mobile.startup/test_api.js
2 files changed, 10 insertions(+), 188 deletions(-)

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



diff --git a/resources/mobile.startup/api.js b/resources/mobile.startup/api.js
index 652a396..c6ebbae 100644
--- a/resources/mobile.startup/api.js
+++ b/resources/mobile.startup/api.js
@@ -1,122 +1,27 @@
-( function ( M, $ ) {
+( function ( M ) {
 
var Api, api,
EventEmitter = M.require( 'mobile.oo/eventemitter' );
 
/**
-* JavaScript wrapper for a horrible API. Use to retrieve things.
+* A backwards compatibility layer for existing extensions of the Api
+* class that haven't yet been converted to gateways.
+*
+* The remaining classes that extend the API are:
+*
+* * PageApi
+* * WatchstarApi
+*
 * @class Api
 * @extends EventEmitter
 */
Api = EventEmitter.extend( mw.Api.prototype ).extend( {
-   /**
-* @property {String} apiUrl
-* URL to the api endpoint (api.php)
-*/
-   apiUrl: mw.util.wikiScript( 'api' ),
-
/**
 * @inheritdoc
 */
initialize: function () {
mw.Api.apply( this, arguments );
EventEmitter.prototype.initialize.apply( this, 
arguments );
-   this.requests = [];
-   this.tokenCache = {};
-   },
-
-   /**
-* A wrapper for $.ajax() to be used when calling server APIs.
-* Sets URL to API URL and default data type to JSON.
-* Preprocesses data argument in the following way:
-* - removes boolean values equal to false
-* - concatenates Array values with '|'
-*
-* @example
-* 
-* ajax( { a: false, b: [1, 2, 3] }, { type: 'post' } );
-* // is equal to
-* $.ajax( {
-* type: 'post',
-* data: { b: '1|2|3' }
-* } );
-* 
-*
-* @method
-* @param {Object} data Data to be preprocessed and added to 
options
-* @param {Object} options Parameters passed to $.ajax()
-* @return {jQuery.Deferred} Object returned by $.ajax()
-*/
-   ajax: function ( data, options ) {
-   var key, request, self = this;
-
-   options = options || {};
-
-   if ( typeof data !== 'string' ) {
-   for ( key in data ) {
-   if ( data.hasOwnProperty( key ) ) {
-   if ( data[key] === false ) {
-   delete data[key];
-   } else if ( $.isArray( 
data[key] ) ) {
-   data[key] = 
data[key].join( '|' );
-   }
-   }
-   }
-   }
-
-   /**
-* This setups support for upload progress events.
-* See 
https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#make-upload-progress-notifications
-* FIXME: move to mw.Api (although no EventEmitter in 
core)?
-* @ignore
-* @returns {jqXHR}
-*/
-   options.xhr = function () {
-   var xhr = $.ajaxSettings.xhr();
-   if ( xhr.upload ) {
-   // need to bind this event before we 
open the connection (see note at
-   // 
https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress)
-   xhr.upload.addEventListener( 
'progress', function ( ev ) {
-   if ( ev.lengthComputable ) {
-   

[MediaWiki-commits] [Gerrit] Set "async" for SQL parser cache everywhere else - change (operations/mediawiki-config)

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

Change subject: Set "async" for SQL parser cache everywhere else
..


Set "async" for SQL parser cache everywhere else

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

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 43c5b37..d20e1bf 100755
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -303,7 +303,7 @@
'shards' => 256,
),
),
-   'replication' => ( $wgDBname === 'testwiki' ) ? 'async' : 'sync'
+   'replication' => 'async'
 );
 
 if ( $wmgUseClusterSession ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I252970886b6f1242d1cb8c99fd12cf67612658fd
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Hygiene: SearchApi -> SearchGateway - change (mediawiki...MobileFrontend)

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

Change subject: Hygiene: SearchApi -> SearchGateway
..


Hygiene: SearchApi -> SearchGateway

Changes:
* Deprecate use of abort method on Api given @krinkle's objection to
upstreaming it.
* Create a SearchApi wrapper for backwards compatiblity with FIXME note
to kill as soon as Gather is switched over to use the SearchGateway

Bug: T110718
Change-Id: I4d20f940d54c3ee1cfbaf33237e798f2d0646107
---
M includes/Resources.php
M resources/mobile.categories.overlays/CategoryAddOverlay.js
R resources/mobile.categories.overlays/CategoryGateway.js
M resources/mobile.categories.overlays/CategoryLookupInputWidget.js
M resources/mobile.categories.overlays/CategoryOverlay.js
R resources/mobile.search.api/SearchGateway.js
D resources/mobile.search.beta.api/SearchApi.js
A resources/mobile.search.beta.api/SearchGateway.js
M resources/mobile.search/SearchOverlay.js
M resources/skins.minerva.categories/init.js
M resources/skins.minerva.scripts/search.js
R tests/qunit/mobile.search.api/test_SearchGateway.js
R tests/qunit/mobile.search.beta.api/test_SearchApiGateway.js
13 files changed, 140 insertions(+), 117 deletions(-)

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



diff --git a/includes/Resources.php b/includes/Resources.php
index ebac7c5..f30d95e 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -689,7 +689,7 @@
'mediawiki.Title',
),
'scripts' => array(
-   'resources/mobile.search.api/SearchApi.js',
+   'resources/mobile.search.api/SearchGateway.js',
),
),
 
@@ -707,7 +707,7 @@
'mobile.search.api',
),
'scripts' => array(
-   'resources/mobile.search.beta.api/SearchApi.js',
+   'resources/mobile.search.beta.api/SearchGateway.js',
),
),
 
@@ -832,7 +832,7 @@
'oojs-ui',
),
'scripts' => array(
-   'resources/mobile.categories.overlays/CategoryApi.js',
+   
'resources/mobile.categories.overlays/CategoryGateway.js',

'resources/mobile.categories.overlays/CategoryLookupInputWidget.js',

'resources/mobile.categories.overlays/CategoryOverlay.js',

'resources/mobile.categories.overlays/CategoryAddOverlay.js',
diff --git a/resources/mobile.categories.overlays/CategoryAddOverlay.js 
b/resources/mobile.categories.overlays/CategoryAddOverlay.js
index 282db77..573aff9 100644
--- a/resources/mobile.categories.overlays/CategoryAddOverlay.js
+++ b/resources/mobile.categories.overlays/CategoryAddOverlay.js
@@ -2,7 +2,7 @@
 
var CategoryAddOverlay,
Overlay = M.require( 'mobile.overlays/Overlay' ),
-   CategoryApi = M.require( 
'mobile.categories.overlays/CategoryApi' ),
+   CategoryGateway = M.require( 
'mobile.categories.overlays/CategoryGateway' ),
CategoryLookupInputWidget = M.require( 
'mobile.categories.overlays/CategoryLookupInputWidget' ),
icons = M.require( 'mobile.startup/icons' ),
toast = M.require( 'mobile.toast/toast' );
@@ -11,12 +11,13 @@
 * Displays the list of categories for a page
 * @class CategoryAddOverlay
 * @extends Overlay
-* @uses CategoryApi
+* @uses CategoryGateway
 */
CategoryAddOverlay = Overlay.extend( {
/**
 * @inheritdoc
 * @cfg {Object} defaults Default options hash.
+* @cfg {mw.Api} defaults.api to use to construct gateway
 * @cfg {String} defaults.waitMsg Text that displays while a 
page edit is being saved.
 * @cfg {String} defaults.waitIcon HTML of the icon that 
displays while a page edit
 * is being saved.
@@ -70,9 +71,9 @@
this.wgCategories = this.options.categories;
this.title = this.options.title;
 
-   this.api = new CategoryApi();
+   this.gateway = new CategoryGateway( this.options.api );
input = new CategoryLookupInputWidget( {
-   api: this.api,
+   gateway: this.gateway,
suggestions: this.$suggestions,
categories: this.wgCategories,
saveButton: this.$saveButton
@@ -122,7 +123,7 @@
toast.show( mw.msg( 
'mobile-frontend-categories-nodata' ), 'toast error' );
} else {
// save the new categories
-  

[MediaWiki-commits] [Gerrit] phpunit: Set $wgMainStash with 'hash' during test execution - change (mediawiki/core)

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

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

Change subject: phpunit: Set $wgMainStash with 'hash' during test execution
..

phpunit: Set $wgMainStash with 'hash' during test execution

Also clean up the other cache settings to match their order
as defined in DefaultSettings.php.

Don't disable MessageCacheType, ParserCacheType etc. This could
prevent bugs from happening during tests. They are enabled by default
in MediaWiki with CACHE_ANYTHING. At least let them use 'hash'
during tests to resemble a more realistic environment.

Change-Id: Id9edf33c600db3ac4d837e1674a8eb2f5363a4f8
---
M tests/phpunit/MediaWikiTestCase.php
M tests/phpunit/phpunit.php
2 files changed, 16 insertions(+), 6 deletions(-)


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

diff --git a/tests/phpunit/MediaWikiTestCase.php 
b/tests/phpunit/MediaWikiTestCase.php
index 73c4066..bd30397 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -103,8 +103,8 @@
 */
ObjectCache::$instances[CACHE_DB] = new HashBagOStuff;
 
-   // Sandbox APC by replacing with in-process hash cache instead.
-   // Ensures tests are removed between tests.
+   // Sandbox APC by replacing with in-process hash instead.
+   // Ensures values are removed between tests.
ObjectCache::$instances['apc'] =
ObjectCache::$instances['xcache'] =
ObjectCache::$instances['wincache'] = new HashBagOStuff;
diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php
index 587d6d0..af924a0 100755
--- a/tests/phpunit/phpunit.php
+++ b/tests/phpunit/phpunit.php
@@ -66,11 +66,21 @@
// wfWarn should cause tests to fail
$wgDevelopmentWarnings = true;
 
+   // Make sure all caches and stashes are either disabled or use
+   // in-process cache only to prevent tests from using any 
preconfigured
+   // cache meant for the local wiki from outside the test run.
+   // See also MediaWikiTestCase::run() which mocks CACHE_DB and 
APC.
+
+   // Disabled in DefaultSettings, override local settings
+   $wgMainWANCache =
$wgMainCacheType = CACHE_NONE;
-   $wgMainWANCache = CACHE_NONE;
-   $wgMessageCacheType = CACHE_NONE;
-   $wgParserCacheType = CACHE_NONE;
-   $wgLanguageConverterCacheType = CACHE_NONE;
+   // Uses CACHE_ANYTHING in DefaultSettings, use hash instead of 
db
+   $wgMessageCacheType =
+   $wgParserCacheType =
+   $wgSessionCacheType =
+   $wgLanguageConverterCacheType = 'hash';
+   // Uses db-replicated in DefaultSettings
+   $wgMainStash = 'hash';
 
$wgUseDatabaseMessages = false; # Set for future resets
 

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

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

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


[MediaWiki-commits] [Gerrit] Add messages for multiwiki search - change (mediawiki...WikimediaMessages)

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

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

Change subject: Add messages for multiwiki search
..

Add messages for multiwiki search

Bug: T112349
Change-Id: Ic4bdd9462f844febea2e402e4b89d9dcc4c836b6
---
M i18n/wikimedia/en.json
1 file changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/i18n/wikimedia/en.json b/i18n/wikimedia/en.json
index a184614..ba84933 100644
--- a/i18n/wikimedia/en.json
+++ b/i18n/wikimedia/en.json
@@ -244,5 +244,9 @@
"wikimedia-centralauth-uwbr-registration-nodate": "< 2006",
"right-viewdeletedfile": "View files and pages in the {{ns:file}} and 
{{ns:file_talk}} namespaces that are deleted",
"securepoll-dblist-securepollglobal": "Board Election",
-   "wikimedia-mwoauthserver-invalid-user": "There was a problem with 
logging you in globally. If you just created your account, please log out and 
log back in, then try again to authorize the app. If you did not just create 
your account, please visit another Wikimedia site while logged in — such as 
[https://mediawiki.org/ mediawiki.org] — and then try again to authorize the 
app. (Error code: E008)"
+   "wikimedia-mwoauthserver-invalid-user": "There was a problem with 
logging you in globally. If you just created your account, please log out and 
log back in, then try again to authorize the app. If you did not just create 
your account, please visit another Wikimedia site while logged in — such as 
[https://mediawiki.org/ mediawiki.org] — and then try again to authorize the 
app. (Error code: E008)",
+   "search-interwiki-results-enwiki": "Showing results from 
[[:en:Main_Page|English Wikipedia]].",
+   "search-interwiki-results-ruwiki": "Showing results from 
[[:ru:Main_Page|Russian Wikipedia]].",
+   "search-interwiki-results-dewiki": "Showing results from 
[[:de:Main_Page|German Wikipedia]].",
+   "search-interwiki-results-itwiki": "Showing results from 
[[:it:Main_Page|Italian Wikipedia]]."
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4bdd9462f844febea2e402e4b89d9dcc4c836b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] Set "async" for SQL parser cache everywhere else - change (operations/mediawiki-config)

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

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

Change subject: Set "async" for SQL parser cache everywhere else
..

Set "async" for SQL parser cache everywhere else

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


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 43c5b37..d20e1bf 100755
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -303,7 +303,7 @@
'shards' => 256,
),
),
-   'replication' => ( $wgDBname === 'testwiki' ) ? 'async' : 'sync'
+   'replication' => 'async'
 );
 
 if ( $wmgUseClusterSession ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I252970886b6f1242d1cb8c99fd12cf67612658fd
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] Explain some disablement - change (wikimedia...crm)

2015-09-24 Thread Eileen (Code Review)
Eileen has submitted this change and it was merged.

Change subject: Explain some disablement
..


Explain some disablement

Bug: https://phabricator.wikimedia.org/T99836
Change-Id: I8dfedc9aeda607e5d8bd9c8c50a742aea4c160a1
---
M sites/all/modules/wmf_reports/wmf_reports.module
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/sites/all/modules/wmf_reports/wmf_reports.module 
b/sites/all/modules/wmf_reports/wmf_reports.module
index bc78245..316c3e7 100644
--- a/sites/all/modules/wmf_reports/wmf_reports.module
+++ b/sites/all/modules/wmf_reports/wmf_reports.module
@@ -12,6 +12,13 @@
 }
 
 /*
+ * FIXME: These reports cause performance issues, so they're currently disabled
+ * pending further work.  Original features are outlined here,
+ * 
https://wikimedia.mingle.thoughtworks.com/projects/online_fundraiser/cards/525
+ * 
https://wikimedia.mingle.thoughtworks.com/projects/online_fundraiser/cards/529
+ * 
+ * ==
+ *
  * function wmf_reports_civicrm_advancedSearchModes(&$search_modes)
  * {
  * $search_modes[] = array(

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

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

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


[MediaWiki-commits] [Gerrit] Interlanguage link: Simplify the autonym identification - change (mediawiki...ContentTranslation)

2015-09-24 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

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

Change subject: Interlanguage link: Simplify the autonym identification
..

Interlanguage link: Simplify the autonym identification

It is guaranteed that jquery.uls.data is loaded before
createCXInterlanguageItem is called. So we can safely use
$.uls.data.getAutonym() for getting the autonym.

Change-Id: I89e1ed2f1b642230234b750055f2ca01995b9ea4
---
M modules/entrypoint/ext.cx.interlanguagelink.js
1 file changed, 1 insertion(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/62/240962/1

diff --git a/modules/entrypoint/ext.cx.interlanguagelink.js 
b/modules/entrypoint/ext.cx.interlanguagelink.js
index 166c81f..c585522 100644
--- a/modules/entrypoint/ext.cx.interlanguagelink.js
+++ b/modules/entrypoint/ext.cx.interlanguagelink.js
@@ -75,14 +75,7 @@
function createCXInterlanguageItem( code ) {
var from, $link, $item, autonym;
 
-   // Optimization: if it's just the user language,
-   // get the autonym from an available variable.
-   // Otherwise, get it from uls.data, which should be loaded by 
now.
-   if ( code === mw.config.get( 'wgUserLanguage' ) ) {
-   autonym = mw.config.get( 'wgULSCurrentAutonym' );
-   } else {
-   autonym = $.uls.data.getAutonym( code );
-   }
+   autonym = $.uls.data.getAutonym( code );
// TODO: This should be done more robustly.
// We can't use something like wgContentLanguage because this
// will fail for a wiki like simple.wikipedia.org, where

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89e1ed2f1b642230234b750055f2ca01995b9ea4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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


[MediaWiki-commits] [Gerrit] Set $wgWikiEditorFeatures in extension.json - change (mediawiki...WikiEditor)

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

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

Change subject: Set $wgWikiEditorFeatures in extension.json
..

Set $wgWikiEditorFeatures in extension.json

We can do this now using a merge strategy of "array_plus_2d".

Change-Id: Ib1536633424bad46ff7861bc145025418af0286a
---
M WikiEditor.hooks.php
M extension.json
2 files changed, 19 insertions(+), 39 deletions(-)


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

diff --git a/WikiEditor.hooks.php b/WikiEditor.hooks.php
index ccb5448..3305c3b 100644
--- a/WikiEditor.hooks.php
+++ b/WikiEditor.hooks.php
@@ -91,43 +91,6 @@
/* Static Methods */
 
/**
-* T99257: Extension registration does not properly support 2d arrays 
so set it as a global for now
-*/
-   public static function onRegistration() {
-   // Each module may be configured individually to be globally 
on/off or user preference based
-   $features = array(
-
-   /* Textarea / i-frame compatible (OK to deploy) */
-
-   'toolbar' => array( 'global' => false, 'user' => true ),
-   // Provides interactive tools
-   'dialogs' => array( 'global' => false, 'user' => true ),
-
-   /* Textarea / i-frame compatible, but still 
experimental and unstable (do not deploy!) */
-
-   // Adds a tab for previewing in-line
-   'preview' => array( 'global' => false, 'user' => true ),
-   // Adds a button and dialog for step-by-step publishing
-   'publish' => array( 'global' => false, 'user' => true ),
-   );
-
-   // Eww, do a 2d array merge so we don't wipe out settings
-   global $wgWikiEditorFeatures;
-   if ( $wgWikiEditorFeatures ) {
-   foreach ( $features as $name => $settings ) {
-   if ( isset( $wgWikiEditorFeatures[$name] ) ) {
-   $wgWikiEditorFeatures[$name] += 
$settings;
-   } else {
-   $wgWikiEditorFeatures[$name] = 
$settings;
-   }
-   }
-   } else {
-   $wgWikiEditorFeatures = $features;
-   }
-
-   }
-
-   /**
 * Checks if a certain option is enabled
 *
 * This method is public to allow other extensions that use WikiEditor 
to use the
diff --git a/extension.json b/extension.json
index 1cb026c..b7762b2 100644
--- a/extension.json
+++ b/extension.json
@@ -12,7 +12,6 @@
"descriptionmsg": "wikieditor-desc",
"license-name": "GPL-2.0+",
"type": "other",
-   "callback": "WikiEditorHooks::onRegistration",
"MessagesDirs": {
"WikiEditor": [
"i18n"
@@ -420,7 +419,25 @@
"remoteExtPath": "WikiEditor/modules"
},
"config": {
-   "@doc": "WikiEditorFeatures is set in WikiEditor.hooks.php"
+   "WikiEditorFeatures": {
+   "toolbar": {
+   "global": false,
+   "user": true
+   },
+   "dialogs": {
+   "global": false,
+   "user": true
+   },
+   "preview": {
+   "global": false,
+   "user": true
+   },
+   "publish": {
+   "global": false,
+   "user": true
+   },
+   "_merge_strategy": "array_plus_2d"
+   }
},
"AutoloadClasses": {
"WikiEditorHooks": "WikiEditor.hooks.php"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1536633424bad46ff7861bc145025418af0286a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
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] BannerHistoryLogger: always send log ID, never send twice - change (mediawiki...CentralNotice)

2015-09-24 Thread AndyRussG (Code Review)
AndyRussG has uploaded a new change for review.

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

Change subject: BannerHistoryLogger: always send log ID, never send twice
..

BannerHistoryLogger: always send log ID, never send twice

Bug: T113421
Change-Id: Icf35c4987bd93804b5512f8b5a30e149ee432a5a
---
M resources/subscribing/ext.centralNotice.bannerHistoryLogger.js
1 file changed, 57 insertions(+), 42 deletions(-)


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

diff --git a/resources/subscribing/ext.centralNotice.bannerHistoryLogger.js 
b/resources/subscribing/ext.centralNotice.bannerHistoryLogger.js
index 1e52438..9eaa1e7 100644
--- a/resources/subscribing/ext.centralNotice.bannerHistoryLogger.js
+++ b/resources/subscribing/ext.centralNotice.bannerHistoryLogger.js
@@ -2,16 +2,19 @@
  * Banner history logger mixin. Records an event every time this campaign is
  * selected for the user (even if the banner is hidden). The log is kept in
  * LocalStorage (via CentralNotice's kvStore). A sample of logs are sent to the
- * server via EventLogging. Also allows triggering a call to EventLogging via
- * cn.bannerHistoryLogger.sendLog().
+ * server via EventLogging. Also allows forcing the log to be sent via
+ * cn.bannerHistoryLogger.ensureLogSent().
  */
 ( function ( $, mw ) {
 
var cn = mw.centralNotice, // Guaranteed to exist; we depend on display 
RL module
+   bhLogger,
mixin = new cn.Mixin( 'bannerHistoryLogger' ),
now = Math.round( ( new Date() ).getTime() / 1000 ),
log,
-   readyToLogPromise,
+   readyToLogDeferredObj = $.Deferred(),
+   logSent = false,
+   inSample,
 
BANNER_HISTORY_KV_STORE_KEY = 'banner_history',
BANNER_HISTORY_LOG_ENTRY_VERSION = 1, // Update when log format 
changes
@@ -124,11 +127,9 @@
 * EventLogging payload limit.
 *
 * @param {number} rate The sampling rate used
-* @param {boolean} logId A unique identifier for this log. Note: this
-*should not be persisted anywhere on the client (see below).
 * @returns {Object}
 */
-   function makeEventLoggingData( rate, logId ) {
+   function makeEventLoggingData( rate ) {
 
var elData = {},
kvError = cn.kvStore.getError(),
@@ -139,10 +140,9 @@
elData.r = rate;
}
 
-   // log ID
-   if ( logId ) {
-   elData.i = logId;
-   }
+   // Log ID: should be generated before this is called, and 
should not be
+   // persisted anywhere on the client (see below).
+   elData.i = bhLogger.id;
 
// if applicable, the message from any kv store error
if ( kvError ) {
@@ -212,26 +212,8 @@
// that campaign is chosen or not
mixin.setPostBannerHandler( function( mixinParams ) {
 
-   // Nothing here needs to happen right away. At least, be sure 
we're not
-   // doing anything until the DOM is ready.
-   $( function() {
-
-   // Load needed resources in a leisurely manner, but 
ahead of a
-   // possible sendLog() call (expected to be called when 
the user
-   // navigates away from the page).
-
-   // Note: we don't set the following up as RL 
dependencies because a
-   // lot of campaign filtering happens on the client, so 
many users
-   // see campaigns in choiceData that don't target them. 
If any of
-   // those campaigns were to use this mixin, all those 
users would
-   // needlessly get these dependencies.
-
-   readyToLogPromise = mw.loader.using( [
-   'ext.eventLogging',
-   'mediawiki.util',
-   'mediawiki.user',
-   'schema.' + EVENT_LOGGING_SCHEMA
-   ] );
+   // Do this idly to avoid browser lock-ups
+   cn.doIdleWork( function() {
 
if ( !cn.kvStore.isAvailable() ) {
cn.kvStore.setNotAvailableError();
@@ -247,7 +229,24 @@
storeLog();
}
 
-   readyToLogPromise.done( function() {
+   // Load needed resources
+
+   // Note: we don't set the following up as RL 
dependencies because a
+   // lot of campaign filtering happens on the client, so 
many users
+   // see campaigns in choiceData that don't target them. 
If any of
+ 

[MediaWiki-commits] [Gerrit] T99836 remove trailing spaces - change (wikimedia...crm)

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

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

Change subject: T99836 remove trailing spaces
..

T99836 remove trailing spaces

I kept having to fix white space issues due to saving without these trailing 
spaces
so have made one teeny-tiny change & saved to strip the spaces out.

Committing this to master in order to avoid any conflicts. Spot the teeny-tiny 
change

Change-Id: I3dd254fbddf3141281ae8ae0be599558437b5283
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 33 insertions(+), 33 deletions(-)


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

diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 6a49470..7330420 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -439,7 +439,7 @@
 /**
  * @fixme TODO: make the v3 API calls use the wrapper function
  *
- * @param $type
+ * @param string $type
  * @param $name
  * @return bool
  */
@@ -519,9 +519,9 @@
 }
 
 /**
- * Determines which civi-only payment instrument is appropriate for the 
current 
- * message, and resturns the civi payment instrument's human-readable display 
- * string (if it exists).   
+ * Determines which civi-only payment instrument is appropriate for the current
+ * message, and resturns the civi payment instrument's human-readable display
+ * string (if it exists).
  *
  * TODO lookup table
  *
@@ -543,7 +543,7 @@
 $payment_instrument = 'Bank Transfer';
 break;
 case 'cc':
-$payment_instrument = 'Credit Card';   
+$payment_instrument = 'Credit Card';
 if ( empty( $msg['payment_submethod'] ) ) {
 watchdog( 'wmf_civicrm', 'No credit card submethod given', 
NULL, WATCHDOG_WARNING );
 break;
@@ -650,13 +650,13 @@
break;
 case 'cash':
 $payment_instrument = 'Cash';
-//'cash_boleto' - Only one right now. I assume there might be 
more later? 
+//'cash_boleto' - Only one right now. I assume there might be 
more later?
 switch ( strtolower( $msg['payment_submethod'] ) ){
-case 'cash_boleto': 
+case 'cash_boleto':
 $payment_instrument = 'Boleto';
 break;
 }
-break; 
+break;
 case 'payflowpro':
 if ( strtolower( $msg['gateway'] ) === 'payflowpro' ){
 $payment_instrument = 'Credit Card';
@@ -702,7 +702,7 @@
 
 /**
  * Normalize contribution amounts
- * 
+ *
  * Do exchange rate conversions and set appropriate fields for CiviCRM
  * based on information contained in the message.
  *
@@ -844,10 +844,10 @@
 
 /**
  * Insert the contact record
- * 
+ *
  * Serves as a standard way for message processors to handle contact
  * insertion.  By passing a contact id, a contact can be updated.
- * 
+ *
  * @param array $msg
  * @param int $contact_id
  * @return array
@@ -1097,10 +1097,10 @@
 
 /**
  * Update the contact record
- * 
+ *
  * Serves as a standard way for message processors to handle contact
  * updates.
- * 
+ *
  * @param array $msg
  * @param int $contact_id
  * @return array
@@ -1113,10 +1113,10 @@
 
 /**
  * Insert the location record
- * 
+ *
  * Serves as a standard way for message processors to handle location
  * insertion.
- * 
+ *
  * @param array $msg
  * @param array $contact
  */
@@ -1126,10 +1126,10 @@
 
 /**
  * Update the location record
- * 
+ *
  * Serves as a standard way for message processors to handle location
  * updates.
- * 
+ *
  * @param array $msg
  * @param array $contact
  */
@@ -1229,7 +1229,7 @@
 
 /**
  * Find correct state for insertion
- * 
+ *
  * When passing CiviCRM a state abbreviation, odd things can happen - like 
getting the right abbreviation, but the wrong state
  * So we'll pull back the correct state/province name based off of a user's 
country/state abbreviation
  */
@@ -1276,14 +1276,14 @@
 
 /**
  * Normalize the queued message
- * 
- * Decodes the message and updates some of the message fields in ways 
+ *
+ * Decodes the message and updates some of the message fields in ways
  * that are consistent with how we need to insert data into CiviCRM.
- * This should be useful by other modules processing contribution messages 
+ * This should be useful by other modules processing contribution messages
  * out of the queue.
  *
  * TODO: Split this into a transformation chain.
- * 
+ *
  * @param mixed $msg
  * @return array
  */
@@ -1475,10 +1475,10 @@
 
 /**
  * Insert the tag record
- * 
+ *
  * Serves as a standard way for message processors to handle tag
  * insertion.
- * 
+ *
  * @para

[MediaWiki-commits] [Gerrit] [WIP] Added WANObjectCache::setAcceptableLagMode() method - change (mediawiki/core)

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

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

Change subject: [WIP] Added WANObjectCache::setAcceptableLagMode() method
..

[WIP] Added WANObjectCache::setAcceptableLagMode() method

* This can be used in failure cases where the lag SLA
  is not being met. It will bound the TTL of set() to
  assure that stale writes get corrected in reasonable
  time.

Bug: T113204
Change-Id: I2900e4b9bed2db3104bb13c9c590ac9962024c5a
---
M includes/libs/objectcache/WANObjectCache.php
1 file changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/58/240958/1

diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index 41dc66f..376ce27 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -64,6 +64,9 @@
/** @var EventRelayer */
protected $relayer;
 
+   /** @var bool */
+   protected $acceptableLag = true;
+
/** @var int */
protected $lastRelayError = self::ERR_NONE;
 
@@ -84,6 +87,9 @@
const TTL_UNCACHEABLE = -1;
/** Idiom for getWithSetCallback() callbacks to 'lockTSE' logic */
const TSE_NONE = -1;
+
+   /** Default value to limit TTLs to when the lag SLA is not met */
+   const UNSAFE_LAG_TTL = 30;
 
/** Cache format version number */
const VERSION = 1;
@@ -254,6 +260,10 @@
 * @return bool Success
 */
final public function set( $key, $value, $ttl = 0 ) {
+   if ( !$this->acceptableLag ) {
+   $ttl = $ttl ? min( self::UNSAFE_LAG_TTL, $ttl ) : 
self::UNSAFE_LAG_TTL;
+   }
+
$key = self::VALUE_KEY_PREFIX . $key;
$wrapped = $this->wrap( $value, $ttl );
 
@@ -559,6 +569,17 @@
}
 
/**
+* Declare whether the replication lag SLA (typically << 
MAX_REPLICA_LAG) if met
+*
+* Set this to false to limit the TTL of new cache items to 
UNSAFE_LAG_TTL
+*
+* @param bool $value
+*/
+   final public function setAcceptableLagMode( $value ) {
+   $this->acceptableLag = $value;
+   }
+
+   /**
 * Get the "last error" registered; clearLastError() should be called 
manually
 * @return int ERR_* constant for the "last error" registry
 */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2900e4b9bed2db3104bb13c9c590ac9962024c5a
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] Interlanguage link: Avoid the requirement of jquery.uls.data... - change (mediawiki...ContentTranslation)

2015-09-24 Thread Santhosh (Code Review)
Santhosh has uploaded a new change for review.

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

Change subject: Interlanguage link: Avoid the requirement of jquery.uls.data 
module on page load
..

Interlanguage link: Avoid the requirement of jquery.uls.data module on page load

This is an improved version of Ic1ad144b44 and does not require
jquery.uls.data before we see that we need to show a gray interlanguage link.

Bug: T113650
Change-Id: If8bae978308fbf472371393b0fe9b50bb5679012
---
M modules/entrypoint/ext.cx.interlanguagelink.js
1 file changed, 17 insertions(+), 7 deletions(-)


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

diff --git a/modules/entrypoint/ext.cx.interlanguagelink.js 
b/modules/entrypoint/ext.cx.interlanguagelink.js
index 2fcf858..166c81f 100644
--- a/modules/entrypoint/ext.cx.interlanguagelink.js
+++ b/modules/entrypoint/ext.cx.interlanguagelink.js
@@ -22,15 +22,23 @@
 * @return {string[]} target languages
 */
function getSuggestedTargetLanguages() {
-   var specialCode, specialCodes, specialCodeIndex,
+   var i, specialCode, specialCodes, specialCodeIndex,
uniquePossibleTargetLanguages,
+   acceptLanguages,
possibleTargetLanguages = [],
pageLanguage = mw.config.get( 'wgPageContentLanguage' );
 
possibleTargetLanguages.push( mw.config.get( 'wgUserLanguage' ) 
);
possibleTargetLanguages.push( mw.uls.getBrowserLanguage() );
 
-   $.merge( possibleTargetLanguages, 
mw.uls.getAcceptLanguageList() );
+   acceptLanguages = mw.uls.getAcceptLanguageList();
+   // Accept language codes can have country extensions like en-US.
+   // So remove them so that it is in mediawiki language code 
format.
+   for ( i = 0; i < acceptLanguages.length; i++ ) {
+   acceptLanguages[ i ] = acceptLanguages[ i ].split( '-' 
)[ 0 ];
+   }
+
+   $.merge( possibleTargetLanguages, acceptLanguages );
$.merge( possibleTargetLanguages, mw.uls.getPreviousLanguages() 
);
 
// Replace possibly non-standard, macro and duplicate language 
codes
@@ -51,9 +59,7 @@
uniquePossibleTargetLanguages = mw.cx.unique( 
possibleTargetLanguages );
 
return $.grep( uniquePossibleTargetLanguages, function ( 
language ) {
-   return language !== pageLanguage &&
-   // Known language for ULS
-   language !== $.uls.data.getAutonym( language );
+   return language !== pageLanguage;
} );
}
 
@@ -77,7 +83,6 @@
} else {
autonym = $.uls.data.getAutonym( code );
}
-
// TODO: This should be done more robustly.
// We can't use something like wgContentLanguage because this
// will fail for a wiki like simple.wikipedia.org, where
@@ -119,6 +124,8 @@
 
mw.hook( 'mw.cx.cta.shown' ).fire( campaign );
 
+   // We load the below modules only when required to show gray 
interlanguage links.
+   // It is important since gray interlanguage links appear in 
along with articles.
dependencies = [ 'ext.cx.entrypoint', 'jquery.uls.data' ];
 
mw.loader.using( dependencies, function () {
@@ -133,7 +140,10 @@
 
$pLangList = $( '#p-lang ul' );
$.each( suggestedTargetLanguages, function ( i, code ) {
-   if ( !pageInLanguageExists( code ) ) {
+   if ( !pageInLanguageExists( code ) &&
+   // Known language for ULS
+   code !== $.uls.data.getAutonym( code )
+   ) {
$newItem = createCXInterlanguageItem( 
code );
$pLangList.prepend( $newItem );
$newItem.cxEntryPoint( {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8bae978308fbf472371393b0fe9b50bb5679012
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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


[MediaWiki-commits] [Gerrit] Turn ext.wikimediaEvents into a dynamically declared module - change (mediawiki...WikimediaEvents)

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

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

Change subject: Turn ext.wikimediaEvents into a dynamically declared module
..

Turn ext.wikimediaEvents into a dynamically declared module

Using the hook provides a venue for functional and logical code,
such as array manipulation and conditionals. This makes these
modules more flexible.

With intent to merge "ext.wikimediaEvents.geoFeatures" back into
the "ext.wikimediaEvents" because it has no separate lifecycle
(it's loaded for all users on all pages). However the code uses
a configuration variable to dictate inclusion.

Change-Id: Ia2d0389e64fed2eb1bbc3cd7b5cc86c1640af43c
---
M WikimediaEvents.php
1 file changed, 35 insertions(+), 31 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents 
refs/changes/55/240955/1

diff --git a/WikimediaEvents.php b/WikimediaEvents.php
index 19857ab..ba11feb 100644
--- a/WikimediaEvents.php
+++ b/WikimediaEvents.php
@@ -95,35 +95,6 @@
'schema'   => 'GeoFeatures',
'revision' => 12914994,
),
-   'ext.wikimediaEvents' => array(
-   // Loaded globally for all users (including logged-out)
-   // Don't remove if empty!
-   'scripts'   => array(
-   'ext.wikimediaEvents.resourceloader.js',
-   'ext.wikimediaEvents.searchSuggest.js',
-   'ext.wikimediaEvents.statsd.js',
-   'ext.wikimediaEvents.search.js',
-   ),
-   'dependencies' => array(
-   'mediawiki.user', // needed by searchSuggest.js
-   'mediawiki.Uri', // needed by search.js
-   ),
-   'localBasePath' => __DIR__ . '/modules',
-   'remoteExtPath' => 'WikimediaEvents/modules',
-   'targets' => array( 'desktop', 'mobile' ),
-   ),
-   'ext.wikimediaEvents.loggedin' => array(
-   // Loaded globally for all logged-in users
-   // Don't remove if empty!
-   'scripts'   => array(
-   'ext.wikimediaEvents.deprecate.js',
-   ),
-   'localBasePath' => __DIR__ . '/modules',
-   'remoteExtPath' => 'WikimediaEvents/modules',
-   'targets' => array( 'desktop', 'mobile' ),
-   'dependencies' => array(
-   ),
-   ),
'ext.wikimediaEvents.didyoumean' => array(
'scripts' => array(
'ext.wikimediaEvents.didyoumean.js',
@@ -143,15 +114,48 @@
),
 );
 
-// Autoloader
+// Don't remove these modules even if empty!
+$wgHooks['ResourceLoaderRegisterModules'][] = function ( ResourceLoader $rl ) {
+   // Loaded globally for all users (including logged-out)
+   $allUsersModule = array(
+   'scripts' => array(
+   'ext.wikimediaEvents.resourceloader.js',
+   'ext.wikimediaEvents.searchSuggest.js',
+   'ext.wikimediaEvents.statsd.js',
+   'ext.wikimediaEvents.search.js',
+   ),
+   'dependencies' => array(
+   'mediawiki.user', // needed by searchSuggest.js
+   'mediawiki.Uri', // needed by search.js
+   ),
+   'localBasePath' => __DIR__ . '/modules',
+   'remoteExtPath' => 'WikimediaEvents/modules',
+   'targets' => array( 'desktop', 'mobile' ),
+   );
+   // Loaded globally for all logged-in users
+   $loggedInModule = array(
+   'scripts' => array(
+   'ext.wikimediaEvents.deprecate.js',
+   ),
+   'dependencies' => array(
+   ),
+   'localBasePath' => __DIR__ . '/modules',
+   'remoteExtPath' => 'WikimediaEvents/modules',
+   'targets' => array( 'desktop', 'mobile' ),
+   );
+   $rl->register( array(
+   'ext.wikimediaEvents' => $allUsersModule,
+   'ext.wikimediaEvents.loggedin' => $loggedInModule,
+   ) );
+};
 
+// Autoloader
 $wgAutoloadClasses += array(
'WikimediaEventsHooks' => __DIR__ . '/WikimediaEventsHooks.php',
'AuthManagerStatsdHandler' => __DIR__ . 
'/includes/AuthManagerStatsdHandler.php',
 );
 
 // Hooks
-
 $wgHooks['BeforePageDisplay'][] = 'WikimediaEventsHooks::onBeforePageDisplay';
 $wgHooks['PageContentSaveComplete'][] = 
'WikimediaEventsHooks::onPageContentSaveComplete';
 $wgHooks['UserSaveOptions'][] = 'WikimediaEventsHooks::onUserSaveOptions';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2d0389e64fed2eb1bbc3cd7b5cc86c1640af43c
Gerrit-PatchSet: 1
Gerrit-Project: med

[MediaWiki-commits] [Gerrit] Move geoFeature.js into ext.wikimediaEvents module - change (mediawiki...WikimediaEvents)

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

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

Change subject: Move geoFeature.js into ext.wikimediaEvents module
..

Move geoFeature.js into ext.wikimediaEvents module

Loaded on every page for all users. Matches the same intent, purpose,
and context of the ext.wikimediaEvents module.

Change-Id: I1aecb01d40e1d0162c65642a2591eca3240808e5
---
M WikimediaEvents.php
M WikimediaEventsHooks.php
2 files changed, 9 insertions(+), 17 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents 
refs/changes/56/240956/1

diff --git a/WikimediaEvents.php b/WikimediaEvents.php
index ba11feb..6c1fa4b 100644
--- a/WikimediaEvents.php
+++ b/WikimediaEvents.php
@@ -103,19 +103,12 @@
'remoteExtPath' => 'WikimediaEvents/modules',
'targets' => array( 'desktop' ),
),
-   'ext.wikimediaEvents.geoFeatures' => array(
-   'scripts'   => array(
-   'ext.wikimediaEvents.geoFeatures.js',
-   ),
-   'localBasePath' => __DIR__ . '/modules',
-   'remoteExtPath' => 'WikimediaEvents/modules',
-   'targets'   => array( 'desktop', 'mobile' ),
-   'dependencies'  => array( 'schema.GeoFeatures' ),
-   ),
 );
 
 // Don't remove these modules even if empty!
 $wgHooks['ResourceLoaderRegisterModules'][] = function ( ResourceLoader $rl ) {
+   global $wgWMETrackGeoFeatures;
+
// Loaded globally for all users (including logged-out)
$allUsersModule = array(
'scripts' => array(
@@ -132,6 +125,11 @@
'remoteExtPath' => 'WikimediaEvents/modules',
'targets' => array( 'desktop', 'mobile' ),
);
+   if ( $wgWMETrackGeoFeatures ) {
+   $allUsersModule['scripts'][] = 
'ext.wikimediaEvents.geoFeatures.js';
+   $allUsersModule['dependencies'][] = 'schema.GeoFeatures';
+   }
+
// Loaded globally for all logged-in users
$loggedInModule = array(
'scripts' => array(
@@ -143,6 +141,7 @@
'remoteExtPath' => 'WikimediaEvents/modules',
'targets' => array( 'desktop', 'mobile' ),
);
+
$rl->register( array(
'ext.wikimediaEvents' => $allUsersModule,
'ext.wikimediaEvents.loggedin' => $loggedInModule,
diff --git a/WikimediaEventsHooks.php b/WikimediaEventsHooks.php
index e1174a1..aa93929 100644
--- a/WikimediaEventsHooks.php
+++ b/WikimediaEventsHooks.php
@@ -14,16 +14,9 @@
 * @param Skin &$skin
 */
public static function onBeforePageDisplay( &$out, &$skin ) {
-   global $wgWMETrackGeoFeatures;
-
$out->addModules( 'ext.wikimediaEvents' );
 
-   if ( $wgWMETrackGeoFeatures ) {
-   $out->addModules( 'ext.wikimediaEvents.geoFeatures' );
-   }
-
-   $user = $out->getUser();
-   if ( $user->isLoggedIn() ) {
+   if ( $out->getUser()->isLoggedIn() ) {
$out->addModules( 'ext.wikimediaEvents.loggedin' );
}
}

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

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

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


[MediaWiki-commits] [Gerrit] Move FileContentsHasher into includes/utils/ - change (mediawiki/core)

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

Change subject: Move FileContentsHasher into includes/utils/
..


Move FileContentsHasher into includes/utils/

The class only contains two dependencies upon MediaWiki (ObjectCache &
wfGlobalCacheKey) which are suitable for inclusion in the utils
directory.

Change-Id: I85b4c763be2670c40f26d93e75cedcb68eaa7987
---
M autoload.php
R includes/utils/FileContentsHasher.php
R tests/phpunit/includes/utils/FileContentsHasherTest.php
3 files changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/autoload.php b/autoload.php
index 9cb5b43..f1b0a6c 100644
--- a/autoload.php
+++ b/autoload.php
@@ -430,7 +430,7 @@
'FileBackendStoreShardListIterator' => __DIR__ . 
'/includes/filebackend/FileBackendStore.php',
'FileBasedSiteLookup' => __DIR__ . 
'/includes/site/FileBasedSiteLookup.php',
'FileCacheBase' => __DIR__ . '/includes/cache/FileCacheBase.php',
-   'FileContentsHasher' => __DIR__ . '/includes/FileContentsHasher.php',
+   'FileContentsHasher' => __DIR__ . 
'/includes/utils/FileContentsHasher.php',
'FileDeleteForm' => __DIR__ . '/includes/FileDeleteForm.php',
'FileDependency' => __DIR__ . '/includes/cache/CacheDependency.php',
'FileDuplicateSearchPage' => __DIR__ . 
'/includes/specials/SpecialFileDuplicateSearch.php',
diff --git a/includes/FileContentsHasher.php 
b/includes/utils/FileContentsHasher.php
similarity index 100%
rename from includes/FileContentsHasher.php
rename to includes/utils/FileContentsHasher.php
diff --git a/tests/phpunit/includes/FileContentsHasherTest.php 
b/tests/phpunit/includes/utils/FileContentsHasherTest.php
similarity index 96%
rename from tests/phpunit/includes/FileContentsHasherTest.php
rename to tests/phpunit/includes/utils/FileContentsHasherTest.php
index eb63649..a03e1fc 100644
--- a/tests/phpunit/includes/FileContentsHasherTest.php
+++ b/tests/phpunit/includes/utils/FileContentsHasherTest.php
@@ -8,7 +8,7 @@
public function provideSingleFile() {
return array_map( function ( $file ) {
return array( $file, file_get_contents( $file ) );
-   }, glob( __DIR__ . '/../data/filecontentshasher/*.*' ) );
+   }, glob( __DIR__ . '/../../data/filecontentshasher/*.*' ) );
}
 
public function provideMultipleFiles() {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I85b4c763be2670c40f26d93e75cedcb68eaa7987
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add experimental 'mediawiki-core-phpcs' job - change (integration/config)

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

Change subject: Add experimental 'mediawiki-core-phpcs' job
..


Add experimental 'mediawiki-core-phpcs' job

Change-Id: I899ec84f98e42fba39e68f1ba8d4da40c03a9055
---
M jjb/mediawiki.yaml
M zuul/layout.yaml
2 files changed, 20 insertions(+), 0 deletions(-)

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



diff --git a/jjb/mediawiki.yaml b/jjb/mediawiki.yaml
index f0d1b2b..c2ed909 100644
--- a/jjb/mediawiki.yaml
+++ b/jjb/mediawiki.yaml
@@ -468,3 +468,21 @@
 wrappers:
  - ansicolor
  - timestamps
+
+# Special job to run MW-CS against MediaWiki core.
+# Can't run it through composer because it'll timeout.
+- job:
+name: 'mediawiki-core-phpcs'
+node: contintLabsSlave && UbuntuTrusty
+concurrent: true
+triggers:
+ - zuul
+builders:
+ - zuul-cloner:
+ projects: >
+ mediawiki/core
+ - composer-update:
+dir: '$WORKSPACE/src'
+ - shell: |
+cd $WORKSPACE/src
+vendor/bin/phpcs -p .
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index dfc808e..44e76d4 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2101,6 +2101,8 @@
   #   test_release_mediawiki_non_wmf_version_tags
   #
   #- mediawiki-core-release
+experimental:
+  - mediawiki-core-phpcs
 
   - name: mediawiki/vendor
 template:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I899ec84f98e42fba39e68f1ba8d4da40c03a9055
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Hashar 
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] DonationInterface should track master in the main cluster - change (mediawiki...release)

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

Change subject: DonationInterface should track master in the main cluster
..


DonationInterface should track master in the main cluster

This extension is only loaded so that translated message strings are available
on donatewiki.  We don't need tight control over the deployment branch, in
fact it causes problems for deployers when we leave this branch out of sync.

Change-Id: I6ec1003b26998e3f829d045f5b39daff918e425b
---
M make-wmf-branch/config.json
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/make-wmf-branch/config.json b/make-wmf-branch/config.json
index 998f1db..ec1fc2c 100644
--- a/make-wmf-branch/config.json
+++ b/make-wmf-branch/config.json
@@ -34,6 +34,7 @@
"DisableAccount",
"Disambiguator",
"DismissableSiteNotice",
+   "DonationInterface",
"DoubleWiki",
"DynamicSidebar",
"Echo",
@@ -165,7 +166,6 @@
"@": "Set value to true to copy last branch, or a string for the 
specific commit, branch, or tag",
"special_extensions": {
"CentralNotice": "wmf_deploy",
-   "DonationInterface": "deployment",
"Wikidata": "wmf/1.26wmf22",
"SemanticMediaWiki": "1.8.x",
"SemanticResultFormats": "1.8.x",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ec1003b26998e3f829d045f5b39daff918e425b
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/tools/release
Gerrit-Branch: master
Gerrit-Owner: Awight 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: AndyRussG 
Gerrit-Reviewer: Awight 
Gerrit-Reviewer: Cdentinger 
Gerrit-Reviewer: Eileen 
Gerrit-Reviewer: Ejegg 
Gerrit-Reviewer: Katie Horn 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Pcoombe 
Gerrit-Reviewer: Ssmith 
Gerrit-Reviewer: XenoRyet 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add experimental 'mediawiki-core-phpcs' job - change (integration/config)

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

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

Change subject: Add experimental 'mediawiki-core-phpcs' job
..

Add experimental 'mediawiki-core-phpcs' job

Change-Id: I899ec84f98e42fba39e68f1ba8d4da40c03a9055
---
M jjb/mediawiki.yaml
M zuul/layout.yaml
2 files changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/54/240954/1

diff --git a/jjb/mediawiki.yaml b/jjb/mediawiki.yaml
index f0d1b2b..c2ed909 100644
--- a/jjb/mediawiki.yaml
+++ b/jjb/mediawiki.yaml
@@ -468,3 +468,21 @@
 wrappers:
  - ansicolor
  - timestamps
+
+# Special job to run MW-CS against MediaWiki core.
+# Can't run it through composer because it'll timeout.
+- job:
+name: 'mediawiki-core-phpcs'
+node: contintLabsSlave && UbuntuTrusty
+concurrent: true
+triggers:
+ - zuul
+builders:
+ - zuul-cloner:
+ projects: >
+ mediawiki/core
+ - composer-update:
+dir: '$WORKSPACE/src'
+ - shell: |
+cd $WORKSPACE/src
+vendor/bin/phpcs -p .
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index dfc808e..44e76d4 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2101,6 +2101,8 @@
   #   test_release_mediawiki_non_wmf_version_tags
   #
   #- mediawiki-core-release
+experimental:
+  - mediawiki-core-phpcs
 
   - name: mediawiki/vendor
 template:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I899ec84f98e42fba39e68f1ba8d4da40c03a9055
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
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] Update grunt-jscs to 2.1.0 - change (mediawiki...Blueprint)

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

Change subject: Update grunt-jscs to 2.1.0
..


Update grunt-jscs to 2.1.0

Change-Id: I60a885ee82524c5eaa51b1bfa74749567403cd6b
---
M package.json
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/package.json b/package.json
index 0c6706c..0212f64 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
 "grunt-cli": "0.1.13",
 "grunt-contrib-jshint": "0.11.3",
 "grunt-banana-checker": "0.2.2",
-"grunt-jscs": "2.0.0",
+"grunt-jscs": "2.1.0",
 "grunt-jsonlint": "1.0.4"
   }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I60a885ee82524c5eaa51b1bfa74749567403cd6b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/skins/Blueprint
Gerrit-Branch: master
Gerrit-Owner: Paladox 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Prtksxna 
Gerrit-Reviewer: Spage 
Gerrit-Reviewer: VolkerE 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] CRM-17156 do not log user id in unit test context - change (wikimedia...civicrm)

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

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

Change subject: CRM-17156 do not log user id in unit test context
..

CRM-17156 do not log user id in unit test context

The first attempt to determine the user ID is before the userSystem is 
determined (in dev instances)
It seems that it would be defined for drupal & if not then we can assume it is 
a UnitTest & skip it

Change-Id: I379e2b3cf3473687ff3b71c5ac4c6a9fcd8c728d
---
M packages/DB/common.php
1 file changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/packages/DB/common.php b/packages/DB/common.php
index 32b4c8e..18fab27 100644
--- a/packages/DB/common.php
+++ b/packages/DB/common.php
@@ -1161,7 +1161,12 @@
 }
 else {
 global $user;
-$prefix = "/* https://civicrm.wikimedia.org/user/{$user->uid} */ ";
+if (empty($user)) {
+$prefix = 'phpunit-test';
+}
+else {
+$prefix = "/* https://civicrm.wikimedia.org/user/{$user->uid} 
*/ ";
+}
 }
 $query = $prefix . $query;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I379e2b3cf3473687ff3b71c5ac4c6a9fcd8c728d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: 4.6.9-deploy
Gerrit-Owner: Eileen 

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


[MediaWiki-commits] [Gerrit] Don't run mediawiki-*-hhvm-composer for old release branches... - change (integration/config)

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

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

Change subject: Don't run mediawiki-*-hhvm-composer for old release branches 
either
..

Don't run mediawiki-*-hhvm-composer for old release branches either

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


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/52/240952/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index dfc808e..6cec3db 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -601,7 +601,7 @@
 files:
  - '^.*\.(php|php5|phtml|inc)$'
 
-  - name: ^mediawiki.*-hhvm$
+  - name: ^mediawiki.*-hhvm(-composer)?$
 # Release branches do not support hhvm. Hopefully REL1_25 will.
 branch: (?!REL1_23|REL1_24|fundraising/REL.*)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84385a7aeb07b6757ccebfdf608569e1f505b851
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
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] composer.json: Downgrade PHPUnit to 3.7.37 (temporarily) - change (mediawiki/core)

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

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

Change subject: composer.json: Downgrade PHPUnit to 3.7.37 (temporarily)
..

composer.json: Downgrade PHPUnit to 3.7.37 (temporarily)

In preparation of fetching development dependencies (such as PHPUnit!)
for unit tests via composer in jenkins runs, we should initially use the
same version of PHPUnit to avoid any issues that might come during a
version bump. Once that is stable, we can upgrade PHPUnit again.

Bug: T90303
Change-Id: I907e6d061cab72d1647fcbb2eea35ff144febd7e
(cherry picked from commit a154741a6a33f229ec497de035f9a96115312957)
---
M composer.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/240951/1

diff --git a/composer.json b/composer.json
index 8389f00..b92e8aa4 100644
--- a/composer.json
+++ b/composer.json
@@ -20,7 +20,7 @@
"psr/log": "1.0.0"
},
"require-dev": {
-   "phpunit/phpunit": "*"
+   "phpunit/phpunit": "3.7.37"
},
"suggest": {
"ext-fileinfo": "*",

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

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

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


[MediaWiki-commits] [Gerrit] Move FileContentsHasher into includes/utils/ - change (mediawiki/core)

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

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

Change subject: Move FileContentsHasher into includes/utils/
..

Move FileContentsHasher into includes/utils/

The class only contains two dependencies upon MediaWiki (ObjectCache &
wfGlobalCacheKey) which are suitable for inclusion in the utils
directory.

Change-Id: I85b4c763be2670c40f26d93e75cedcb68eaa7987
---
M autoload.php
R includes/utils/FileContentsHasher.php
R tests/phpunit/includes/utils/FileContentsHasherTest.php
3 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/50/240950/1

diff --git a/autoload.php b/autoload.php
index 9cb5b43..f1b0a6c 100644
--- a/autoload.php
+++ b/autoload.php
@@ -430,7 +430,7 @@
'FileBackendStoreShardListIterator' => __DIR__ . 
'/includes/filebackend/FileBackendStore.php',
'FileBasedSiteLookup' => __DIR__ . 
'/includes/site/FileBasedSiteLookup.php',
'FileCacheBase' => __DIR__ . '/includes/cache/FileCacheBase.php',
-   'FileContentsHasher' => __DIR__ . '/includes/FileContentsHasher.php',
+   'FileContentsHasher' => __DIR__ . 
'/includes/utils/FileContentsHasher.php',
'FileDeleteForm' => __DIR__ . '/includes/FileDeleteForm.php',
'FileDependency' => __DIR__ . '/includes/cache/CacheDependency.php',
'FileDuplicateSearchPage' => __DIR__ . 
'/includes/specials/SpecialFileDuplicateSearch.php',
diff --git a/includes/FileContentsHasher.php 
b/includes/utils/FileContentsHasher.php
similarity index 100%
rename from includes/FileContentsHasher.php
rename to includes/utils/FileContentsHasher.php
diff --git a/tests/phpunit/includes/FileContentsHasherTest.php 
b/tests/phpunit/includes/utils/FileContentsHasherTest.php
similarity index 96%
rename from tests/phpunit/includes/FileContentsHasherTest.php
rename to tests/phpunit/includes/utils/FileContentsHasherTest.php
index eb63649..a03e1fc 100644
--- a/tests/phpunit/includes/FileContentsHasherTest.php
+++ b/tests/phpunit/includes/utils/FileContentsHasherTest.php
@@ -8,7 +8,7 @@
public function provideSingleFile() {
return array_map( function ( $file ) {
return array( $file, file_get_contents( $file ) );
-   }, glob( __DIR__ . '/../data/filecontentshasher/*.*' ) );
+   }, glob( __DIR__ . '/../../data/filecontentshasher/*.*' ) );
}
 
public function provideMultipleFiles() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85b4c763be2670c40f26d93e75cedcb68eaa7987
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] [WIP] LDAP support - change (operations...sentry)

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

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

Change subject: [WIP] LDAP support
..

[WIP] LDAP support

Bug: T97133
Change-Id: Ib4c70986a4a845cd21a0ede507d2174f1ecd67ef
---
M README.md
M bin/activate
M bin/activate.csh
M bin/activate.fish
M lib/python2.7/site-packages/pip-1.5.6.dist-info/RECORD
M lib/python2.7/site-packages/setuptools-5.5.1.dist-info/RECORD
6 files changed, 24 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/sentry 
refs/changes/49/240949/1

diff --git a/README.md b/README.md
index 3e820e7..0d6f14b 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,28 @@
 **This repository** is a venv containing Sentry and its dependencies, minus 
compatible dependencies currently available in Debian Jessie.
 
-### Steps to reproduce/update the contents of this venv ###
+### Steps to recreate the contents of this venv ###
 
 1. Create a new Debian Jessie VM on labs
 2. Install the virtualenv package
 3. Install the dependencies listed under "System dependencies" below with apt
-4. Create the /srv/deployment/sentry/ folder
-5. Go to that folder and run "virtualenv --system-site-packages sentry" to 
create the venv
-6. Run "source sentry/bin/activate" to activate the venv
+4. Create the /srv/sentry folder
+5. Go to that folder and run "virtualenv --system-site-packages ." to create 
the venv
+6. Run "source bin/activate" to activate the venv
 7. Run "pip install sentry[postgres]" to install the latest version of Sentry 
and its dependencies into the venv with postgres support
-8. Run "virtualenv --relocatable sentry" to rewrite the file references to 
relative
+8. Run "virtualenv --relocatable ." to rewrite the file references to relative
 9. Copy the extra files from the repo (TODO: these should probably be in a 
separate project or branch): README.md list-debian-packages.py 
requirements_list.py requirements_map.py
-10. Set up git-review in the /srv/deployment/sentry/sentry folder and commit 
the changes to this repository
+10. Set up git-review in the /srv/sentry folder and commit the changes to this 
repository
+
+### Steps to update the contents of this venv ###
+
+1. Do steps 1-4 from above
+2. Check out the repo
+3. Do step 6 from above
+4. Run pip commands needed to update Sentry, add plugins etc. See [this 
comment][1] for working around the "assert sys.prefix != real_prefix" bug.
+5. Do step 8 from above
+6. Commit
+
+[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=782795#10
 
 ### System dependencies ###
 
@@ -46,6 +57,10 @@
 
 list-debian-packages.py can help with the updating of the dependency list.
 
+Extra packages which are needed for some Sentry plugins:
+* libldap2-dev (for sentry-ldap-auth, for building only)
+* libsasl2-dev (as above)
+
 ### Possible future issues and reasoning ###
 
 It's quite possible that Debian Jessie's packages will be updated and might no 
longer meet Sentry's requirements.
diff --git a/bin/activate b/bin/activate
index 54c0104..b58e8dd 100644
--- a/bin/activate
+++ b/bin/activate
@@ -39,7 +39,7 @@
 # unset irrelevant variables
 deactivate nondestructive
 
-VIRTUAL_ENV="/srv/deployment/sentry/sentry"
+VIRTUAL_ENV="/srv/deployment/sentry/old"
 export VIRTUAL_ENV
 
 _OLD_VIRTUAL_PATH="$PATH"
diff --git a/bin/activate.csh b/bin/activate.csh
index 1b5a53f..7a46287 100644
--- a/bin/activate.csh
+++ b/bin/activate.csh
@@ -7,7 +7,7 @@
 # Unset irrelevant variables.
 deactivate nondestructive
 
-setenv VIRTUAL_ENV "/srv/deployment/sentry/sentry"
+setenv VIRTUAL_ENV "/srv/deployment/sentry/old"
 
 set _OLD_VIRTUAL_PATH="$PATH"
 setenv PATH "$VIRTUAL_ENV/bin:$PATH"
diff --git a/bin/activate.fish b/bin/activate.fish
index d76aac3..6ffe575 100644
--- a/bin/activate.fish
+++ b/bin/activate.fish
@@ -32,7 +32,7 @@
 # unset irrelevant variables
 deactivate nondestructive
 
-set -gx VIRTUAL_ENV "/srv/deployment/sentry/sentry"
+set -gx VIRTUAL_ENV "/srv/deployment/sentry/old"
 
 set -gx _OLD_VIRTUAL_PATH $PATH
 set -gx PATH "$VIRTUAL_ENV/bin" $PATH
diff --git a/lib/python2.7/site-packages/pip-1.5.6.dist-info/RECORD 
b/lib/python2.7/site-packages/pip-1.5.6.dist-info/RECORD
index 22d072c..a7ab9ae 100644
--- a/lib/python2.7/site-packages/pip-1.5.6.dist-info/RECORD
+++ b/lib/python2.7/site-packages/pip-1.5.6.dist-info/RECORD
@@ -40,9 +40,6 @@
 pip/commands/unzip.py,sha256=_PeTWKOd_iRxPt_7njQ8jGFpjX006vobn593tcIyeUc,185
 pip/commands/zip.py,sha256=KECCb3oCHxJqDT3kUEnlf0udp31Ckoe8oyEKdS7EKNQ,14821
 
pip/backwardcompat/__init__.py,sha256=AcP5dr3nL-4AGxSwsFIEUcf9ki0ROUFwfc0IrIeHaJI,3756
-/srv/deployment/sentry/sentry/bin/pip,sha256=6ZFS1nk6E25iRy4CW5zM4GP_CrJdPMK7vIXqxbnIuWE,230
-/srv/deployment/sentry/sentry/bin/pip2,sha256=6ZFS1nk6E25iRy4CW5zM4GP_CrJdPMK7vIXqxbnIuWE,230
-/srv/deployment/sentry/sentry/bin/pip2.7,sha256=6ZFS1nk6E25iRy4CW5zM4GP_CrJdPMK7vIXqxbnIuWE,230
 pip/commands/completion.pyc,,
 pip/vcs/mercurial.pyc,,
 

[MediaWiki-commits] [Gerrit] [WIP] Upgrade composer/semver to 1.0.0 - change (mediawiki/core)

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

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

Change subject: [WIP] Upgrade composer/semver to 1.0.0
..

[WIP] Upgrade composer/semver to 1.0.0

Change-Id: Icf73630e60fe7d586d7ed249abc1d3014b67cbe6
---
M composer.json
M includes/registration/CoreVersionChecker.php
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/48/240948/1

diff --git a/composer.json b/composer.json
index e41b6c7..069d0dc 100644
--- a/composer.json
+++ b/composer.json
@@ -16,7 +16,7 @@
"wiki": "https://www.mediawiki.org/";
},
"require": {
-   "composer/semver": "0.1.0",
+   "composer/semver": "1.0.0",
"cssjanus/cssjanus": "1.1.1",
"ext-iconv": "*",
"liuggio/statsd-php-client": "1.0.16",
diff --git a/includes/registration/CoreVersionChecker.php 
b/includes/registration/CoreVersionChecker.php
index a7a926c..f64d826 100644
--- a/includes/registration/CoreVersionChecker.php
+++ b/includes/registration/CoreVersionChecker.php
@@ -18,7 +18,7 @@
  */
 
 use Composer\Semver\VersionParser;
-use Composer\Semver\Constraint\VersionConstraint;
+use Composer\Semver\Constraint\Constraint;
 
 /**
  * @since 1.26
@@ -26,7 +26,7 @@
 class CoreVersionChecker {
 
/**
-* @var VersionConstraint|bool representing $wgVersion
+* @var Constraint|bool representing $wgVersion
 */
private $coreVersion = false;
 
@@ -41,7 +41,7 @@
public function __construct( $coreVersion ) {
$this->versionParser = new VersionParser();
try {
-   $this->coreVersion = new VersionConstraint(
+   $this->coreVersion = new Constraint(
'==',
$this->versionParser->normalize( $coreVersion )
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf73630e60fe7d586d7ed249abc1d3014b67cbe6
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] registration: Vary the loaded queue cache on $wgVersion - change (mediawiki/core)

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

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

Change subject: registration: Vary the loaded queue cache on $wgVersion
..

registration: Vary the loaded queue cache on $wgVersion

If the version changes, we need to recheck the dependency requirements.

Follows-up cef1f31167177ca05c8981d.

Change-Id: I30e95b5dec7b5a1d9ca391fb2ae55e0b3de0c528
---
M includes/registration/ExtensionRegistry.php
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/240947/1

diff --git a/includes/registration/ExtensionRegistry.php 
b/includes/registration/ExtensionRegistry.php
index 23e29d8..f91aeff 100644
--- a/includes/registration/ExtensionRegistry.php
+++ b/includes/registration/ExtensionRegistry.php
@@ -114,12 +114,22 @@
}
 
public function loadFromQueue() {
+   global $wgVersion;
if ( !$this->queued ) {
return;
}
 
+   // A few more things to vary the cache on
+   $versions = array(
+   'registration' => self::CACHE_VERSION,
+   'mediawiki' => $wgVersion
+   );
+
// See if this queue is in APC
-   $key = wfMemcKey( 'registration', md5( json_encode( 
$this->queued ) ), self::CACHE_VERSION );
+   $key = wfMemcKey(
+   'registration',
+   md5( json_encode( $this->queued + $versions ) )
+   );
$data = $this->cache->get( $key );
if ( $data ) {
$this->exportExtractedData( $data );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I30e95b5dec7b5a1d9ca391fb2ae55e0b3de0c528
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] build: Enforce JSHint and JSCS via npm test - change (mediawiki...WikimediaEvents)

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

Change subject: build: Enforce JSHint and JSCS via npm test
..


build: Enforce JSHint and JSCS via npm test

Most notably, this fixes a syntax error for ES3 engines (trailing comma)
that may've been causing older browsers to not report events.

Change-Id: I5608f8ffd1c640d2fec40eaf9c24ad720944d3e7
(cherry picked from commit 6e69eb80d0f1a825daac5bf596abf0b6c06bd683)
---
A .jscsrc
A .jshintignore
M .jshintrc
M Gruntfile.js
M modules/ext.wikimediaEvents.deprecate.js
M modules/ext.wikimediaEvents.didyoumean.js
M modules/ext.wikimediaEvents.geoFeatures.js
M modules/ext.wikimediaEvents.resourceloader.js
M modules/ext.wikimediaEvents.search.js
M modules/ext.wikimediaEvents.searchSuggest.js
M modules/ext.wikimediaEvents.statsd.js
M package.json
12 files changed, 85 insertions(+), 69 deletions(-)

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



diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 000..8305d61
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,4 @@
+{
+   "preset": "wikimedia",
+   "es3": true
+}
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 000..3c3629e
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/.jshintrc
index c84dc0a..8717bd4 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -1,32 +1,23 @@
 {
+   // Enforcing
+   "bitwise": true,
+   "eqeqeq": true,
+   "freeze": true,
+   "latedef": true,
+   "noarg": true,
+   "nonew": true,
+   "undef": true,
+   "unused": true,
+
+   // Relaxing
+   "laxbreak": true,
+
+   // Environment
+   "browser": true,
+   "es3": true,
+
"predef": [
"mediaWiki",
"jQuery"
-   ],
-
-   "camelcase": true,
-   "curly": true,
-   "eqeqeq": true,
-   "forin": false,
-   "immed": true,
-   "latedef": true,
-   "newcap": true,
-   "noarg": true,
-   "noempty": true,
-   "nonew": true,
-   "quotmark": "single",
-   "regexp": false,
-   "undef": true,
-   "unused": true,
-   "strict": false,
-   "trailing": true,
-
-   "laxbreak": true,
-   "smarttabs": true,
-   "multistr": true,
-
-   "browser": true,
-
-   "nomen": true,
-   "onevar": true
+   ]
 }
diff --git a/Gruntfile.js b/Gruntfile.js
index 9c56558..ce6eda3 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,20 +1,34 @@
 /*jshint node:true */
 module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
+   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-jscs' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
 
grunt.initConfig( {
-   banana: {
-   all: 'i18n/'
+   jshint: {
+   options: {
+   jshintrc: true
+   },
+   all: '.'
+   },
+   jscs: {
+   all: [
+   '*.js',
+   'modules/**/*.js'
+   ]
},
jsonlint: {
all: [
'**/*.json',
'!node_modules/**'
]
+   },
+   banana: {
+   all: 'i18n/'
}
} );
 
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+   grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] 
);
grunt.registerTask( 'default', 'test' );
 };
diff --git a/modules/ext.wikimediaEvents.deprecate.js 
b/modules/ext.wikimediaEvents.deprecate.js
index 164dc3f..f3d7658 100644
--- a/modules/ext.wikimediaEvents.deprecate.js
+++ b/modules/ext.wikimediaEvents.deprecate.js
@@ -1,5 +1,6 @@
-/**
+/*!
  * Track usage of deprecated JavaScript functionality
+ *
  * @see https://meta.wikimedia.org/wiki/Schema:DeprecatedUsage
  */
 ( function ( mw ) {
@@ -20,7 +21,7 @@
pageId: mw.config.get( 'wgArticleId' ),
revId: mw.config.get( 'wgCurRevisionId' ),
version: mw.config.get( 'wgVersion' ),
-   modules: mw.inspect.grep( deprecated ).join(',')
+   modules: mw.inspect.grep( deprecated ).join( 
',' )
} );
} );
} );
diff --git a/modules/ext.wikimediaEvents.didyoumean.js 
b/modules/ext.wikimediaEvents.didyoumean.js
index 14a4cd8..bee6f5b 100644
--- a/modules/ext.wikimediaEvents.didyoumean.js
+++ b/modules/ext.wikimediaEvents.didyoumean.js
@@ -74,7 +74,7 @@
mw.loader.using( [
'mediawiki.user',
  

[MediaWiki-commits] [Gerrit] build: Enforce JSHint and JSCS via npm test - change (mediawiki...WikimediaEvents)

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

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

Change subject: build: Enforce JSHint and JSCS via npm test
..

build: Enforce JSHint and JSCS via npm test

Most notably, this fixes a syntax error for ES3 engines (trailing comma)
that may've been causing older browsers to not report events.

Change-Id: I5608f8ffd1c640d2fec40eaf9c24ad720944d3e7
(cherry picked from commit 6e69eb80d0f1a825daac5bf596abf0b6c06bd683)
---
A .jscsrc
A .jshintignore
M .jshintrc
M Gruntfile.js
M modules/ext.wikimediaEvents.deprecate.js
M modules/ext.wikimediaEvents.didyoumean.js
M modules/ext.wikimediaEvents.geoFeatures.js
M modules/ext.wikimediaEvents.resourceloader.js
M modules/ext.wikimediaEvents.search.js
M modules/ext.wikimediaEvents.searchSuggest.js
M modules/ext.wikimediaEvents.statsd.js
M package.json
12 files changed, 85 insertions(+), 69 deletions(-)


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

diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 000..8305d61
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,4 @@
+{
+   "preset": "wikimedia",
+   "es3": true
+}
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 000..3c3629e
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/.jshintrc
index c84dc0a..8717bd4 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -1,32 +1,23 @@
 {
+   // Enforcing
+   "bitwise": true,
+   "eqeqeq": true,
+   "freeze": true,
+   "latedef": true,
+   "noarg": true,
+   "nonew": true,
+   "undef": true,
+   "unused": true,
+
+   // Relaxing
+   "laxbreak": true,
+
+   // Environment
+   "browser": true,
+   "es3": true,
+
"predef": [
"mediaWiki",
"jQuery"
-   ],
-
-   "camelcase": true,
-   "curly": true,
-   "eqeqeq": true,
-   "forin": false,
-   "immed": true,
-   "latedef": true,
-   "newcap": true,
-   "noarg": true,
-   "noempty": true,
-   "nonew": true,
-   "quotmark": "single",
-   "regexp": false,
-   "undef": true,
-   "unused": true,
-   "strict": false,
-   "trailing": true,
-
-   "laxbreak": true,
-   "smarttabs": true,
-   "multistr": true,
-
-   "browser": true,
-
-   "nomen": true,
-   "onevar": true
+   ]
 }
diff --git a/Gruntfile.js b/Gruntfile.js
index 9c56558..ce6eda3 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,20 +1,34 @@
 /*jshint node:true */
 module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
+   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-jscs' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
 
grunt.initConfig( {
-   banana: {
-   all: 'i18n/'
+   jshint: {
+   options: {
+   jshintrc: true
+   },
+   all: '.'
+   },
+   jscs: {
+   all: [
+   '*.js',
+   'modules/**/*.js'
+   ]
},
jsonlint: {
all: [
'**/*.json',
'!node_modules/**'
]
+   },
+   banana: {
+   all: 'i18n/'
}
} );
 
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+   grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] 
);
grunt.registerTask( 'default', 'test' );
 };
diff --git a/modules/ext.wikimediaEvents.deprecate.js 
b/modules/ext.wikimediaEvents.deprecate.js
index 164dc3f..f3d7658 100644
--- a/modules/ext.wikimediaEvents.deprecate.js
+++ b/modules/ext.wikimediaEvents.deprecate.js
@@ -1,5 +1,6 @@
-/**
+/*!
  * Track usage of deprecated JavaScript functionality
+ *
  * @see https://meta.wikimedia.org/wiki/Schema:DeprecatedUsage
  */
 ( function ( mw ) {
@@ -20,7 +21,7 @@
pageId: mw.config.get( 'wgArticleId' ),
revId: mw.config.get( 'wgCurRevisionId' ),
version: mw.config.get( 'wgVersion' ),
-   modules: mw.inspect.grep( deprecated ).join(',')
+   modules: mw.inspect.grep( deprecated ).join( 
',' )
} );
} );
} );
diff --git a/modules/ext.wikimediaEvents.didyoumean.js 
b/modules/ext.wikimediaEvents.didyoumean.js
index 14a4cd8..bee6f5b 100644
--- a/modules/ext.wikimediaEvents.didyoumean.js
+++ b/modules/ext.wikimediaEvents.didyoumean.js
@@ -74,7 +74,7 @@
mw.loader.using( [
 

[MediaWiki-commits] [Gerrit] build: Enforce JSHint and JSCS via npm test - change (mediawiki...WikimediaEvents)

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

Change subject: build: Enforce JSHint and JSCS via npm test
..


build: Enforce JSHint and JSCS via npm test

Most notably, this fixes a syntax error for ES3 engines (trailing comma)
that may've been causing older browsers to not report events.

Change-Id: I5608f8ffd1c640d2fec40eaf9c24ad720944d3e7
---
A .jscsrc
A .jshintignore
M .jshintrc
M Gruntfile.js
M modules/ext.wikimediaEvents.deprecate.js
M modules/ext.wikimediaEvents.didyoumean.js
M modules/ext.wikimediaEvents.geoFeatures.js
M modules/ext.wikimediaEvents.resourceloader.js
M modules/ext.wikimediaEvents.search.js
M modules/ext.wikimediaEvents.searchSuggest.js
M modules/ext.wikimediaEvents.statsd.js
M package.json
12 files changed, 85 insertions(+), 69 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 000..8305d61
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,4 @@
+{
+   "preset": "wikimedia",
+   "es3": true
+}
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 000..3c3629e
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/.jshintrc
index c84dc0a..8717bd4 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -1,32 +1,23 @@
 {
+   // Enforcing
+   "bitwise": true,
+   "eqeqeq": true,
+   "freeze": true,
+   "latedef": true,
+   "noarg": true,
+   "nonew": true,
+   "undef": true,
+   "unused": true,
+
+   // Relaxing
+   "laxbreak": true,
+
+   // Environment
+   "browser": true,
+   "es3": true,
+
"predef": [
"mediaWiki",
"jQuery"
-   ],
-
-   "camelcase": true,
-   "curly": true,
-   "eqeqeq": true,
-   "forin": false,
-   "immed": true,
-   "latedef": true,
-   "newcap": true,
-   "noarg": true,
-   "noempty": true,
-   "nonew": true,
-   "quotmark": "single",
-   "regexp": false,
-   "undef": true,
-   "unused": true,
-   "strict": false,
-   "trailing": true,
-
-   "laxbreak": true,
-   "smarttabs": true,
-   "multistr": true,
-
-   "browser": true,
-
-   "nomen": true,
-   "onevar": true
+   ]
 }
diff --git a/Gruntfile.js b/Gruntfile.js
index 9c56558..ce6eda3 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,20 +1,34 @@
 /*jshint node:true */
 module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
+   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-jscs' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
 
grunt.initConfig( {
-   banana: {
-   all: 'i18n/'
+   jshint: {
+   options: {
+   jshintrc: true
+   },
+   all: '.'
+   },
+   jscs: {
+   all: [
+   '*.js',
+   'modules/**/*.js'
+   ]
},
jsonlint: {
all: [
'**/*.json',
'!node_modules/**'
]
+   },
+   banana: {
+   all: 'i18n/'
}
} );
 
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+   grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] 
);
grunt.registerTask( 'default', 'test' );
 };
diff --git a/modules/ext.wikimediaEvents.deprecate.js 
b/modules/ext.wikimediaEvents.deprecate.js
index 164dc3f..f3d7658 100644
--- a/modules/ext.wikimediaEvents.deprecate.js
+++ b/modules/ext.wikimediaEvents.deprecate.js
@@ -1,5 +1,6 @@
-/**
+/*!
  * Track usage of deprecated JavaScript functionality
+ *
  * @see https://meta.wikimedia.org/wiki/Schema:DeprecatedUsage
  */
 ( function ( mw ) {
@@ -20,7 +21,7 @@
pageId: mw.config.get( 'wgArticleId' ),
revId: mw.config.get( 'wgCurRevisionId' ),
version: mw.config.get( 'wgVersion' ),
-   modules: mw.inspect.grep( deprecated ).join(',')
+   modules: mw.inspect.grep( deprecated ).join( 
',' )
} );
} );
} );
diff --git a/modules/ext.wikimediaEvents.didyoumean.js 
b/modules/ext.wikimediaEvents.didyoumean.js
index 14a4cd8..bee6f5b 100644
--- a/modules/ext.wikimediaEvents.didyoumean.js
+++ b/modules/ext.wikimediaEvents.didyoumean.js
@@ -74,7 +74,7 @@
mw.loader.using( [
'mediawiki.user',
'ext.eventLogging',
-   

[MediaWiki-commits] [Gerrit] [WIP] Move from ircecho to tcpircbot - change (operations/puppet)

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

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

Change subject: [WIP] Move from ircecho to tcpircbot
..

[WIP] Move from ircecho to tcpircbot

Wondering about where to test this at the moment.

Change-Id: I9ab30ceaa82c86d527982344bba5305d7ab96480
---
M manifests/role/icinga.pp
D modules/icinga/manifests/ircbot.pp
D modules/ircecho/files/ircecho
D modules/ircecho/files/ircecho.init
D modules/ircecho/manifests/init.pp
D modules/ircecho/templates/default.erb
M modules/shinken/manifests/init.pp
M modules/shinken/manifests/ircbot.pp
8 files changed, 22 insertions(+), 465 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/45/240945/1

diff --git a/manifests/role/icinga.pp b/manifests/role/icinga.pp
index b7de3f5..36b1f83 100644
--- a/manifests/role/icinga.pp
+++ b/manifests/role/icinga.pp
@@ -28,7 +28,16 @@
 include nrpe
 
 if $ircbot {
-include icinga::ircbot
+tcpircbot::instance { 'icinga-wm':
+server_host => 'chat.freenode.net',
+infiles => {
+'/var/log/icinga/irc.log'   => '#wikimedia-operations',
+'/var/log/icinga/irc-wikidata.log'  => '#wikidata',
+'/var/log/icinga/irc-releng.log'=> '#wikimedia-releng',
+'/var/log/icinga/irc-labs.log'  => '#wikimedia-labs',
+'/var/log/icinga/irc-analytics.log' => '#wikimedia-analytics',
+}
+}
 }
 
 $ssl_settings = ssl_ciphersuite('apache-2.2', 'compat', '365')
diff --git a/modules/icinga/manifests/ircbot.pp 
b/modules/icinga/manifests/ircbot.pp
deleted file mode 100644
index 6315e2d..000
--- a/modules/icinga/manifests/ircbot.pp
+++ /dev/null
@@ -1,28 +0,0 @@
-# = Class: icinga::ircbot
-#
-# Sets up an ircecho instance that sends icinga alerts to IRC
-class icinga::ircbot {
-
-$ircecho_logs   = {
-'/var/log/icinga/irc.log'   => '#wikimedia-operations',
-'/var/log/icinga/irc-wikidata.log'  => '#wikidata',
-'/var/log/icinga/irc-releng.log'=> '#wikimedia-releng',
-'/var/log/icinga/irc-labs.log'  => '#wikimedia-labs',
-'/var/log/icinga/irc-analytics.log' => '#wikimedia-analytics',
-}
-$ircecho_nick   = 'icinga-wm'
-$ircecho_server = 'chat.freenode.net'
-
-class { '::ircecho':
-ircecho_logs   => $ircecho_logs,
-ircecho_nick   => $ircecho_nick,
-ircecho_server => $ircecho_server,
-}
-
-# T28784 - IRC bots process need nagios monitoring
-nrpe::monitor_service { 'ircecho':
-description  => 'ircecho_service_running',
-nrpe_command => '/usr/lib/nagios/plugins/check_procs -w 1:4 -c 1:20 -a 
ircecho',
-}
-
-}
diff --git a/modules/ircecho/files/ircecho b/modules/ircecho/files/ircecho
deleted file mode 100755
index 3b39fe6..000
--- a/modules/ircecho/files/ircecho
+++ /dev/null
@@ -1,173 +0,0 @@
-#! /usr/bin/env python
-#
-# stdin -> IRC echo bot, with optional file input support.
-#
-# Written by Kate Turner , source is in the public
-# domain.
-# Modified by Ryan Lane  for watching and taking input
-# for files.  Changes are also public domain.
-# Modified by Ryan Anderson  to handle disconnections more
-# gracefully. Changes in the public domain.
-
-import pyinotify
-import threading
-import random
-import string
-import re
-import irclib  # for exceptions.
-from optparse import OptionParser
-from ircbot import SingleServerIRCBot
-
-
-def beautify_message(m):
-"""Clean up formatting of alert messages."""
-m = m.strip() # Strip trailing whitespace
-m = re.sub(r'(\w+): \1:\b', r'\1', m) # Dedupe severity
-m = re.sub(r' {2,}', ' ', m)  # Collapse whitespace
-m = m.replace(': -', ':') # Combine separators
-m = m.strip(':-') # Strip trailing separators
-return m
-
-
-class EchoNotifier(threading.Thread):
-   def __init__(self, notifier):
-   threading.Thread.__init__(self)
-   self.notifier = notifier
-
-   def run(self):
-   self.notifier.loop()
-
-
-class EchoReader(threading.Thread):
-   def __init__(self, infile='', associatedchannel=''):
-   threading.Thread.__init__(self)
-   self.infile = infile
-   self.associatedchannel = associatedchannel
-   self.uniques = {';': "UNIQ_" + self.get_unique_string() + 
"_QINU",
-   ':': "UNIQ_" + self.get_unique_string() + 
"_QINU",
-   ',': "UNIQ_" + self.get_unique_string() + 
"_QINU"}
-
-   def get_unique_string(self):
-   unique = ''
-   for i in range(15):
-   unique = unique + random.choice(string.letters)
-   return unique
-
-   def escape(self, string):
-   escaped_string = 

[MediaWiki-commits] [Gerrit] Add inputbox role - change (mediawiki/vagrant)

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

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

Change subject: Add inputbox role
..

Add inputbox role

Change-Id: I30807592790c4331fed6add121bc5aef740072b1
---
A puppet/modules/role/manifests/inputbox.pp
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/44/240944/1

diff --git a/puppet/modules/role/manifests/inputbox.pp 
b/puppet/modules/role/manifests/inputbox.pp
new file mode 100644
index 000..e5f5941
--- /dev/null
+++ b/puppet/modules/role/manifests/inputbox.pp
@@ -0,0 +1,8 @@
+# == Class: role::inputbox
+# The InputBox[1] extension extension adds support for embedding
+# simple navigational forms in wikitext.
+#
+# [1] https://www.mediawiki.org/wiki/Extension:InputBox
+class role::inputbox {
+mediawiki::extension { 'InputBox': }
+}

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

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

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


[MediaWiki-commits] [Gerrit] Remove 'jshint' job from WikimediaEvents (already has 'npm') - change (integration/config)

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

Change subject: Remove 'jshint' job from WikimediaEvents (already has 'npm')
..


Remove 'jshint' job from WikimediaEvents (already has 'npm')

Change-Id: Ie0da4a7d1b28c013470e7ba63d79f67d8e91fad1
---
M zuul/layout.yaml
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index c61486f..dfc808e 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -7641,7 +7641,6 @@
 
   - name: mediawiki/extensions/WikimediaEvents
 template:
-  - name: jshint
   - name: extension-unittests
   - name: npm
 check:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie0da4a7d1b28c013470e7ba63d79f67d8e91fad1
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add unit tests for FileContentsHasher - change (mediawiki/core)

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

Change subject: Add unit tests for FileContentsHasher
..


Add unit tests for FileContentsHasher

Adds two unit tests for the FileContentsHasher class introduced in I1ff61153.

Change-Id: I711db6bb25c018d36fd89c8ab2dbe8d11ed94537
---
A tests/phpunit/data/filecontentshasher/hash.svg
A tests/phpunit/data/filecontentshasher/primes.txt
A tests/phpunit/includes/FileContentsHasherTest.php
3 files changed, 270 insertions(+), 0 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  Ori.livneh: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/tests/phpunit/data/filecontentshasher/hash.svg 
b/tests/phpunit/data/filecontentshasher/hash.svg
new file mode 100644
index 000..44068ba
--- /dev/null
+++ b/tests/phpunit/data/filecontentshasher/hash.svg
@@ -0,0 +1,110 @@
+
+
+
+http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="200"
+   height="200"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.2 r9819"
+   sodipodi:docname="New document 1">
+  
+  
+  
+
+  
+image/svg+xml
+http://purl.org/dc/dcmitype/StillImage"; />
+
+  
+
+  
+  
+
+  
+
+
+
+
+  
+  
+
+  
+
diff --git a/tests/phpunit/data/filecontentshasher/primes.txt 
b/tests/phpunit/data/filecontentshasher/primes.txt
new file mode 100644
index 000..a2fe1fb
--- /dev/null
+++ b/tests/phpunit/data/filecontentshasher/primes.txt
@@ -0,0 +1,105 @@
+ The First 1,000 Primes
+  (the 1,000th is 7919)
+ For more information on primes see http://primes.utm.edu/
+
+  2  3  5  7 11 13 17 19 23 29
+ 31 37 41 43 47 53 59 61 67 71
+ 73 79 83 89 97101103107109113
+127131137139149151157163167173
+179181191193197199211223227229
+233239241251257263269271277281
+283293307311313317331337347349
+353359367373379383389397401409
+419421431433439443449457461463
+467479487491499503509521523541
+547557563569571577587593599601
+607613617619631641643647653659
+661673677683691701709719727733
+739743751757761769773787797809
+811821823827829839853857859863
+877881883887907911919929937941
+947953967971977983991997   1009   1013
+   1019   1021   1031   1033   1039   1049   1051   1061   1063   1069
+   1087   1091   1093   1097   1103   1109   1117   1123   1129   1151
+   1153   1163   1171   1181   1187   1193   1201   1213   1217   1223
+   1229   1231   1237   1249   1259   1277   1279   1283   1289   1291
+   1297   1301   1303   1307   1319   1321   1327   1361   1367   1373
+   1381   1399   1409   1423   1427   1429   1433   1439   1447   1451
+   1453   1459   1471   1481   1483   1487   1489   1493   1499   1511
+   1523   1531   1543   1549   1553   1559   1567   1571   1579   1583
+   1597   1601   1607   1609   1613   1619   1621   1627   1637   1657
+   1663   1667   1669   1693   1697   1699   1709   1721   1723   1733
+   1741   1747   1753   1759   1777   1783   1787   1789   1801   1811
+   1823   1831   1847   1861   1867   1871   1873   1877   1879   1889
+   1901   1907   1913   1931   1933   1949   1951   1973   1979   1987
+   1993   1997   1999   2003   2011   2017   2027   2029   2039   2053
+   2063   2069   2081   2083   2087   2089   2099   2111   2113   2129
+   2131   2137   2141   2143   2153   2161   2179   2203   2207   2213
+   2221   2237   2239   2243   2251   2267   2269   2273   2281   2287
+   2293   2297   2309   2311   2333   2339   2341   2347   2351   2357
+   2371   2377   2381   2383   2389   2393   2399   2411   2417   2423
+   2437   2441   2447   2459   2467   2473   2477   2503   2521   2531
+   2539   2543   2549   2551   2557   2579   2591   2593   2609   2617
+   2621   2633   2647   2657   2659   2663   2671   2677   2683   2687
+   2689   2693   2699   2707   2711   2713   2719   2729   2731   2741
+   2749   2753   2767   2777   2789

[MediaWiki-commits] [Gerrit] Refactor extractWikilink - change (labs...heritage)

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

Change subject: Refactor extractWikilink
..


Refactor extractWikilink

- Add unit tests
- Use Verbose regex and named group for clarity

Change-Id: I3197ba0187c9d5284d4b36cabec9d15eabce3a67
---
M erfgoedbot/converters.py
M tests/test_converters.py
2 files changed, 21 insertions(+), 4 deletions(-)

Approvals:
  Jean-Frédéric: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/erfgoedbot/converters.py b/erfgoedbot/converters.py
index 80d8f8d..95d1a3d 100644
--- a/erfgoedbot/converters.py
+++ b/erfgoedbot/converters.py
@@ -44,12 +44,17 @@
 
 def extractWikilink(text):
 articleName = u''
-result = re.search("\[\[(.+?)(\||\]\])", text)
-if (result and result.group(1)):
-articleName = result.group(1)
+# result = re.search("\[\[(.+?)(\||\]\])", text)
+regex = re.compile(r"""
+  \[\[  # Opening brackets
+  (?P.+?)   # Link target
+  (\||\]\]) # Either a pipe or closing brackets
+""", re.VERBOSE)
+match = re.search(regex, text)
+if match:
+articleName = match.group('target')
 articleName = articleName.replace(u' ', u'_')
 articleName = ucfirst(articleName)
-
 return articleName
 
 
diff --git a/tests/test_converters.py b/tests/test_converters.py
index 7f8e814..9e6a121 100644
--- a/tests/test_converters.py
+++ b/tests/test_converters.py
@@ -20,6 +20,18 @@
 article = "[[article]]"
 self.assertEquals(extractWikilink(article), "Article")
 
+def test_extractWikilink_link_pipe_only(self):
+article = "[[Article|]]"
+self.assertEquals(extractWikilink(article), "Article")
+
+def test_extractWikilink_link_spaces_are_replaced_with_underscores(self):
+article = "[[Some article|]]"
+self.assertEquals(extractWikilink(article), "Some_article")
+
+def test_extractWikilink_link_no_link(self):
+article = "article"
+self.assertEquals(extractWikilink(article), "")
+
 
 class TestRemoveCommonsCategoryPrefix(unittest.TestCase):
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3197ba0187c9d5284d4b36cabec9d15eabce3a67
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Jean-Frédéric 
Gerrit-Reviewer: Jean-Frédéric 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fix directory name for https role nginx config - change (mediawiki/vagrant)

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

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

Change subject: Fix directory name for https role nginx config
..

Fix directory name for https role nginx config

Change-Id: Ie35876dd96adbe737bd9e06c2193b9fb8b14def2
---
R puppet/modules/role/files/https/nginx.conf
M puppet/modules/role/manifests/https.pp
2 files changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/43/240943/1

diff --git a/puppet/modules/role/files/nginx/nginx.conf 
b/puppet/modules/role/files/https/nginx.conf
similarity index 100%
rename from puppet/modules/role/files/nginx/nginx.conf
rename to puppet/modules/role/files/https/nginx.conf
diff --git a/puppet/modules/role/manifests/https.pp 
b/puppet/modules/role/manifests/https.pp
index f2ee0e2..0e5db98 100644
--- a/puppet/modules/role/manifests/https.pp
+++ b/puppet/modules/role/manifests/https.pp
@@ -11,7 +11,7 @@
 }
 
 nginx::site { 'devwiki':
-source => 'puppet:///modules/role/nginx/nginx.conf',
+source => 'puppet:///modules/role/https/nginx.conf',
 notify => Service['nginx'],
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] graphite: make compatible with Apache 2.4 - change (operations/puppet)

2015-09-24 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: graphite: make compatible with Apache 2.4
..

graphite: make compatible with Apache 2.4

The syntax for this changed between Apache 2.2 and 2.4.

It still works on 2.4 when mod_access_compat is loaded,
which is likely the case by default. But if it isn't
it would break.

Make it compatible with both.

Taken out of I4c8e0aa365fbcc6.

Change-Id: I7ade2bb10f2266392661ceb72bbbc8512a322f83
---
M templates/graphite/graphite.apache.erb
1 file changed, 14 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/42/240942/1

diff --git a/templates/graphite/graphite.apache.erb 
b/templates/graphite/graphite.apache.erb
index 966a56c..b4821f6 100644
--- a/templates/graphite/graphite.apache.erb
+++ b/templates/graphite/graphite.apache.erb
@@ -4,8 +4,13 @@
 ServerName <%= @hostname %>
 
 
-Order allow,deny
-Allow from all
+= 2.4>
+Require all granted
+
+
+Order allow,deny
+Allow from all
+
 
 <%= @apache_auth -%>
 
@@ -16,8 +21,13 @@
 
 
 
-Satisfy Any
-Allow from all
+= 2.4>
+Require all granted
+
+
+Satisfy Any
+Allow from all
+
 
 
 

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

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

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


[MediaWiki-commits] [Gerrit] phpunit: Replace APC with HashBagOStuff during a test - change (mediawiki/core)

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

Change subject: phpunit: Replace APC with HashBagOStuff during a test
..


phpunit: Replace APC with HashBagOStuff during a test

* Ensures values don't survive the unit test run.
* Ensures a clean state for each test.

Change-Id: I94e1ac14096fb4c4071fe9960d9465e60f27a89d
---
M tests/phpunit/MediaWikiTestCase.php
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/MediaWikiTestCase.php 
b/tests/phpunit/MediaWikiTestCase.php
index 7dc7027..49c7ad3 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -103,6 +103,12 @@
 */
ObjectCache::$instances[CACHE_DB] = new HashBagOStuff;
 
+   // Sandbox APC by replacing with in-process hash cache instead.
+   // Ensures tests are removed between tests.
+   ObjectCache::$instances['apc'] =
+   ObjectCache::$instances['xcache'] =
+   ObjectCache::$instances['wincache'] = new HashBagOStuff;
+
$needsResetDB = false;
 
if ( $this->needsDB() ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I94e1ac14096fb4c4071fe9960d9465e60f27a89d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] limn: make compatible with Apache 2.4 syntax - change (operations/puppet)

2015-09-24 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: limn: make compatible with Apache 2.4 syntax
..

limn: make compatible with Apache 2.4 syntax

The syntax for this changed between Apache 2.2 and 2.4.

It still works on 2.4 when mod_access_compat is loaded,
which is likely the case by default. But if it isn't
it would break.

Make it compatible with both.

Taken out of I4c8e0aa365fbcc6.

Change-Id: Iccf241d7b03f8eb8fcec5a472f35cd66768ea384
---
M modules/limn/templates/vhost-limn-proxy-wp-zero-gone.conf.erb
M modules/limn/templates/vhost-limn-proxy.conf.erb
2 files changed, 14 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/41/240941/1

diff --git a/modules/limn/templates/vhost-limn-proxy-wp-zero-gone.conf.erb 
b/modules/limn/templates/vhost-limn-proxy-wp-zero-gone.conf.erb
index 9945ec2..b26ccc2 100644
--- a/modules/limn/templates/vhost-limn-proxy-wp-zero-gone.conf.erb
+++ b/modules/limn/templates/vhost-limn-proxy-wp-zero-gone.conf.erb
@@ -15,8 +15,13 @@
 
   ProxyRequests Off
   
-Order allow,deny
-Allow from all
+= 2.4>
+  Require all granted
+
+
+  Order allow,deny
+  Allow from all
+
   
 
   # 410 - Gone for Wikipedia Zero
diff --git a/modules/limn/templates/vhost-limn-proxy.conf.erb 
b/modules/limn/templates/vhost-limn-proxy.conf.erb
index 7bf4d74..961e390 100644
--- a/modules/limn/templates/vhost-limn-proxy.conf.erb
+++ b/modules/limn/templates/vhost-limn-proxy.conf.erb
@@ -15,8 +15,13 @@
 
   ProxyRequests Off
   
-Order allow,deny
-Allow from all
+= 2.4>
+  Require all granted
+
+
+  Order allow,deny
+  Allow from all
+
   
 
   # If the file does not exist, assume this is a dynamic

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

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

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


[MediaWiki-commits] [Gerrit] build: Enforce JSHint and JSCS via npm test - change (mediawiki...WikimediaEvents)

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

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

Change subject: build: Enforce JSHint and JSCS via npm test
..

build: Enforce JSHint and JSCS via npm test

Most notably, this fixes a syntax error for ES3 engines (trailing comma)
that may've been causing older browsers to not report events.

Change-Id: I5608f8ffd1c640d2fec40eaf9c24ad720944d3e7
---
A .jscsrc
A .jshintignore
M .jshintrc
M Gruntfile.js
M modules/ext.wikimediaEvents.deprecate.js
M modules/ext.wikimediaEvents.didyoumean.js
M modules/ext.wikimediaEvents.geoFeatures.js
M modules/ext.wikimediaEvents.resourceloader.js
M modules/ext.wikimediaEvents.search.js
M modules/ext.wikimediaEvents.searchSuggest.js
M modules/ext.wikimediaEvents.statsd.js
M package.json
12 files changed, 85 insertions(+), 69 deletions(-)


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

diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 000..8305d61
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,4 @@
+{
+   "preset": "wikimedia",
+   "es3": true
+}
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 000..3c3629e
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1 @@
+node_modules
diff --git a/.jshintrc b/.jshintrc
index c84dc0a..8717bd4 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -1,32 +1,23 @@
 {
+   // Enforcing
+   "bitwise": true,
+   "eqeqeq": true,
+   "freeze": true,
+   "latedef": true,
+   "noarg": true,
+   "nonew": true,
+   "undef": true,
+   "unused": true,
+
+   // Relaxing
+   "laxbreak": true,
+
+   // Environment
+   "browser": true,
+   "es3": true,
+
"predef": [
"mediaWiki",
"jQuery"
-   ],
-
-   "camelcase": true,
-   "curly": true,
-   "eqeqeq": true,
-   "forin": false,
-   "immed": true,
-   "latedef": true,
-   "newcap": true,
-   "noarg": true,
-   "noempty": true,
-   "nonew": true,
-   "quotmark": "single",
-   "regexp": false,
-   "undef": true,
-   "unused": true,
-   "strict": false,
-   "trailing": true,
-
-   "laxbreak": true,
-   "smarttabs": true,
-   "multistr": true,
-
-   "browser": true,
-
-   "nomen": true,
-   "onevar": true
+   ]
 }
diff --git a/Gruntfile.js b/Gruntfile.js
index 9c56558..ce6eda3 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,20 +1,34 @@
 /*jshint node:true */
 module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
+   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-jscs' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
 
grunt.initConfig( {
-   banana: {
-   all: 'i18n/'
+   jshint: {
+   options: {
+   jshintrc: true
+   },
+   all: '.'
+   },
+   jscs: {
+   all: [
+   '*.js',
+   'modules/**/*.js'
+   ]
},
jsonlint: {
all: [
'**/*.json',
'!node_modules/**'
]
+   },
+   banana: {
+   all: 'i18n/'
}
} );
 
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+   grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] 
);
grunt.registerTask( 'default', 'test' );
 };
diff --git a/modules/ext.wikimediaEvents.deprecate.js 
b/modules/ext.wikimediaEvents.deprecate.js
index 164dc3f..f3d7658 100644
--- a/modules/ext.wikimediaEvents.deprecate.js
+++ b/modules/ext.wikimediaEvents.deprecate.js
@@ -1,5 +1,6 @@
-/**
+/*!
  * Track usage of deprecated JavaScript functionality
+ *
  * @see https://meta.wikimedia.org/wiki/Schema:DeprecatedUsage
  */
 ( function ( mw ) {
@@ -20,7 +21,7 @@
pageId: mw.config.get( 'wgArticleId' ),
revId: mw.config.get( 'wgCurRevisionId' ),
version: mw.config.get( 'wgVersion' ),
-   modules: mw.inspect.grep( deprecated ).join(',')
+   modules: mw.inspect.grep( deprecated ).join( 
',' )
} );
} );
} );
diff --git a/modules/ext.wikimediaEvents.didyoumean.js 
b/modules/ext.wikimediaEvents.didyoumean.js
index 14a4cd8..bee6f5b 100644
--- a/modules/ext.wikimediaEvents.didyoumean.js
+++ b/modules/ext.wikimediaEvents.didyoumean.js
@@ -74,7 +74,7 @@
mw.loader.using( [
'mediawiki.user',

[MediaWiki-commits] [Gerrit] tcpircbot: Allow per-infile channel lists - change (operations/puppet)

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

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

Change subject: tcpircbot: Allow per-infile channel lists
..

tcpircbot: Allow per-infile channel lists

Change-Id: If56a29a972f125f2886ed1669e2701746a08b99d
---
M modules/tcpircbot/files/tcpircbot.py
M modules/tcpircbot/manifests/instance.pp
M modules/tcpircbot/templates/tcpircbot.json.erb
3 files changed, 18 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/39/240939/1

diff --git a/modules/tcpircbot/files/tcpircbot.py 
b/modules/tcpircbot/files/tcpircbot.py
index 0525b7f..b2a94c9 100755
--- a/modules/tcpircbot/files/tcpircbot.py
+++ b/modules/tcpircbot/files/tcpircbot.py
@@ -21,7 +21,7 @@
   "cidr": "::/0",
   "port": 9125
   },
-  "infiles": []
+  "infiles": {"filename": ["#channel1", "#channel2"]}
   }
 
 Requirements:
@@ -60,7 +60,7 @@
 logging.basicConfig(level=logging.INFO, stream=sys.stderr,
 format='%(asctime)-15s %(message)s')
 
-files = []
+files = {}
 
 
 class ForwarderBot(ircbot.SingleServerIRCBot):
@@ -93,10 +93,13 @@
 
 if 'infiles' in config:
 global files
-for infile in config['infiles']:
-f = open(infile, 'r')
+for filename, channels in config['infiles'].items():
+f = open(filename, 'r')
 f.seek(0, 2)
-files.append(f)
+if isinstance(channels, list):
+files[f] = channels
+else:
+files[f] = [channels]
 
 
 if len(sys.argv) < 2 or sys.argv[1] in ('-h', '--help'):
@@ -121,10 +124,10 @@
 server.bind((config['tcp'].get('iface', ''), config['tcp']['port']))
 server.listen(config['tcp']['max_clients'])
 
-files.append(server)
+files[server] = None
 
 def close_sockets():
-for f in files:
+for f in files.keys():
 try:
 f.close()
 except socket.error:
@@ -147,7 +150,7 @@
 return ip.is_private() or ip.is_loopback()
 
 while 1:
-readable, _, _ = select.select([bot.connection.socket] + files, [], [])
+readable, _, _ = select.select([bot.connection.socket] + files.keys(), [], 
[])
 for f in readable:
 if f is server:
 conn, addr = server.accept()
@@ -156,14 +159,14 @@
 continue
 conn.setblocking(0)
 logging.info('Connection from %s', addr)
-files.append(conn)
+files[conn] = None
 elif f is bot.connection.socket:
 bot.connection.process_data()
 elif isinstance(f, file):
 data = f.readline().rstrip()
 if data:
-logging.info('infile: %s', data)
-for channel in bot.target_channels:
+logging.info('infile for %s: %s', ', '.join(files[f]), data)
+for channel in files[f]:
 bot.connection.privmsg(channel, data)
 else:
 data = f.recv(BUFSIZE)
@@ -174,4 +177,4 @@
 bot.connection.privmsg(channel, data)
 else:
 f.close()
-files.remove(f)
+del files[f]
diff --git a/modules/tcpircbot/manifests/instance.pp 
b/modules/tcpircbot/manifests/instance.pp
index dfe934b..ad04268 100644
--- a/modules/tcpircbot/manifests/instance.pp
+++ b/modules/tcpircbot/manifests/instance.pp
@@ -31,7 +31,8 @@
 #   Example: ['192.0.2.0/24', '2001:db8::/32']
 #
 # [*infiles*]
-#   Read these files as extra inputs. Optional.
+#   Read these files as extra inputs. Keys are filenames and values are
+#   either channel names or arrays of channel names. Optional.
 #
 # [*ssl*]
 #   Whether to use SSL to connect to IRC server (default: true).
diff --git a/modules/tcpircbot/templates/tcpircbot.json.erb 
b/modules/tcpircbot/templates/tcpircbot.json.erb
index 003ce8c..d14fc67 100755
--- a/modules/tcpircbot/templates/tcpircbot.json.erb
+++ b/modules/tcpircbot/templates/tcpircbot.json.erb
@@ -5,7 +5,7 @@
 <% if @ssl %>"ssl": true,<% end %>
 "nickname": "<%= @nickname %>"
 },
-<% if @infiles %>"infiles": <%= Array(@infiles).to_pson %>,<% end %>
+<% if @infiles %>"infiles": <%= Hash(@infiles).to_pson %>,<% end %>
 "tcp": {
 "max_clients": <%= @max_clients %>,
 <% if @cidr %>"cidr": <%= Array(@cidr).to_pson %>,<% end %>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If56a29a972f125f2886ed1669e2701746a08b99d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alex Monk 

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

[MediaWiki-commits] [Gerrit] Remove 'jshint' job from WikimediaEvents (already has 'npm') - change (integration/config)

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

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

Change subject: Remove 'jshint' job from WikimediaEvents (already has 'npm')
..

Remove 'jshint' job from WikimediaEvents (already has 'npm')

Change-Id: Ie0da4a7d1b28c013470e7ba63d79f67d8e91fad1
---
M zuul/layout.yaml
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/38/240938/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index c61486f..dfc808e 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -7641,7 +7641,6 @@
 
   - name: mediawiki/extensions/WikimediaEvents
 template:
-  - name: jshint
   - name: extension-unittests
   - name: npm
 check:

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

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

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


[MediaWiki-commits] [Gerrit] Refactor extractWikilink - change (labs...heritage)

2015-09-24 Thread Code Review
Jean-Frédéric has uploaded a new change for review.

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

Change subject: Refactor extractWikilink
..

Refactor extractWikilink

- Add unit tests
- Use Verbose regex and named group for clarity

Change-Id: I3197ba0187c9d5284d4b36cabec9d15eabce3a67
---
M erfgoedbot/converters.py
M tests/test_converters.py
2 files changed, 21 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage 
refs/changes/37/240937/1

diff --git a/erfgoedbot/converters.py b/erfgoedbot/converters.py
index 80d8f8d..95d1a3d 100644
--- a/erfgoedbot/converters.py
+++ b/erfgoedbot/converters.py
@@ -44,12 +44,17 @@
 
 def extractWikilink(text):
 articleName = u''
-result = re.search("\[\[(.+?)(\||\]\])", text)
-if (result and result.group(1)):
-articleName = result.group(1)
+# result = re.search("\[\[(.+?)(\||\]\])", text)
+regex = re.compile(r"""
+  \[\[  # Opening brackets
+  (?P.+?)   # Link target
+  (\||\]\]) # Either a pipe or closing brackets
+""", re.VERBOSE)
+match = re.search(regex, text)
+if match:
+articleName = match.group('target')
 articleName = articleName.replace(u' ', u'_')
 articleName = ucfirst(articleName)
-
 return articleName
 
 
diff --git a/tests/test_converters.py b/tests/test_converters.py
index 7f8e814..9e6a121 100644
--- a/tests/test_converters.py
+++ b/tests/test_converters.py
@@ -20,6 +20,18 @@
 article = "[[article]]"
 self.assertEquals(extractWikilink(article), "Article")
 
+def test_extractWikilink_link_pipe_only(self):
+article = "[[Article|]]"
+self.assertEquals(extractWikilink(article), "Article")
+
+def test_extractWikilink_link_spaces_are_replaced_with_underscores(self):
+article = "[[Some article|]]"
+self.assertEquals(extractWikilink(article), "Some_article")
+
+def test_extractWikilink_link_no_link(self):
+article = "article"
+self.assertEquals(extractWikilink(article), "")
+
 
 class TestRemoveCommonsCategoryPrefix(unittest.TestCase):
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3197ba0187c9d5284d4b36cabec9d15eabce3a67
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Jean-Frédéric 

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


[MediaWiki-commits] [Gerrit] contint: update Apache config for 2.4 syntax - change (operations/puppet)

2015-09-24 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review.

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

Change subject: contint: update Apache config for 2.4 syntax
..

contint: update Apache config for 2.4 syntax

Change-Id: I6e25ea00203f6256393077e2108ab37851d65021
---
M modules/contint/files/apache/proxy_gerrit
M modules/contint/files/apache/proxy_zuul
2 files changed, 14 insertions(+), 4 deletions(-)


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

diff --git a/modules/contint/files/apache/proxy_gerrit 
b/modules/contint/files/apache/proxy_gerrit
index 7005b29..a215ed0 100644
--- a/modules/contint/files/apache/proxy_gerrit
+++ b/modules/contint/files/apache/proxy_gerrit
@@ -12,6 +12,11 @@
 AllowEncodedSlashes  On
 
 http://localhost:8082/*>
-Order deny,allow
-Allow from all
+= 2.4>
+Require all granted
+
+
+Order deny,allow
+Allow from all
+
 
diff --git a/modules/contint/files/apache/proxy_zuul 
b/modules/contint/files/apache/proxy_zuul
index 5bc7eda..5c193db 100644
--- a/modules/contint/files/apache/proxy_zuul
+++ b/modules/contint/files/apache/proxy_zuul
@@ -15,6 +15,11 @@
 # Most unix distribution deny proxy by default (ie 
/etc/apache2/mods-enabled/proxy.conf in Ubuntu)
 
 http://localhost:8001/*>
-Order deny,allow
-Allow from all
+= 2.4>
+Require all granted
+
+
+Order deny,allow
+Allow from all
+
 

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

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

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


[MediaWiki-commits] [Gerrit] build: Add jshint to npm-test - change (mediawiki...EventLogging)

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

Change subject: build: Add jshint to npm-test
..


build: Add jshint to npm-test

Currently the repository is using a legacy jshint job in Jenkins
with an outdated version of JSHint. Use the npm-test entry point
for this instead.

* Enforce compliance with ES3 engines (which means JSON is not defined
  by default, but this extension loads conditional 'json' module,
  so it's fine).

* Remove deprecated coding style options from JSHint. Use JSCS instead.

* Use jscs --fix to automatically correct style violations.

Change-Id: I9a6282b1d89c327c3a052e302ce66b39a0812019
---
A .jscsrc
M .jshintignore
M .jshintrc
M Gruntfile.js
M modules/ext.eventLogging.core.js
M modules/ext.eventLogging.jsonSchema.js
M modules/ext.eventLogging.subscriber.js
M package.json
M tests/ext.eventLogging.tests.js
9 files changed, 62 insertions(+), 62 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 000..8305d61
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,4 @@
+{
+   "preset": "wikimedia",
+   "es3": true
+}
diff --git a/.jshintignore b/.jshintignore
index 0adcbcb..07823c2 100644
--- a/.jshintignore
+++ b/.jshintignore
@@ -1,2 +1,3 @@
 server/.tox
 modules/out
+node_modules
diff --git a/.jshintrc b/.jshintrc
index 7fa138d..d3ba265 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -1,34 +1,25 @@
 {
+   // Enforcing
+   "bitwise": true,
+   "eqeqeq": true,
+   "freeze": true,
+   "latedef": true,
+   "noarg": true,
+   "nonew": true,
+   "undef": true,
+   "unused": true,
+
+   // Relaxing
+   "laxbreak": true,
+
+   // Environment
+   "browser": true,
+   "es3": true,
+
"predef": [
"mediaWiki",
"jQuery",
-   "QUnit"
-   ],
-
-   "bitwise": true,
-   "camelcase": true,
-   "curly": true,
-   "eqeqeq": true,
-   "forin": false,
-   "immed": true,
-   "latedef": true,
-   "newcap": true,
-   "noarg": true,
-   "noempty": true,
-   "nonew": true,
-   "quotmark": "single",
-   "regexp": false,
-   "undef": true,
-   "unused": true,
-   "strict": false,
-   "trailing": true,
-
-   "laxbreak": true,
-   "smarttabs": true,
-   "multistr": true,
-
-   "browser": true,
-
-   "nomen": true,
-   "onevar": true
+   "QUnit",
+   "JSON"
+   ]
 }
diff --git a/Gruntfile.js b/Gruntfile.js
index d5c1814..16d58f0 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,21 +1,35 @@
 /*jshint node:true */
 module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
+   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-jscs' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
 
grunt.initConfig( {
-   banana: {
-   core: 'i18n/core/',
-   jsonschema: 'i18n/jsonschema/'
+   jshint: {
+   options: {
+   jshintrc: true
+   },
+   all: '.'
+   },
+   jscs: {
+   all: [
+   '*.js',
+   '{modules,tests}/**/*.js'
+   ]
},
jsonlint: {
all: [
'**/*.json',
'!node_modules/**'
]
+   },
+   banana: {
+   core: 'i18n/core/',
+   jsonschema: 'i18n/jsonschema/'
}
} );
 
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+   grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] 
);
grunt.registerTask( 'default', 'test' );
 };
diff --git a/modules/ext.eventLogging.core.js b/modules/ext.eventLogging.core.js
index 11abf30..f08845c 100644
--- a/modules/ext.eventLogging.core.js
+++ b/modules/ext.eventLogging.core.js
@@ -1,4 +1,4 @@
-/**
+/*!
  * This module implements EventLogging's API for logging events from
  * client-side JavaScript code. Instances of `ResourceLoaderSchemaModule`
  * indicate a dependency on this module and declare themselves via its
@@ -13,7 +13,6 @@
  */
 ( function ( mw, $ ) {
'use strict';
-
 
var self,
 
@@ -76,14 +75,13 @@
 *
 * @param {string} schemaName Name of schema.
 * @param {Object} meta An object describing a schema:
-* @param {Number} meta.revision Revision ID.
+* @param {number} meta.revision Revision ID.
 * @param {Object} meta.schema The schema itself.
 * @return {

[MediaWiki-commits] [Gerrit] Simplify SitesModuleWorker::getModifiedHash() - change (mediawiki...Wikibase)

2015-09-24 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Simplify SitesModuleWorker::getModifiedHash()
..

Simplify SitesModuleWorker::getModifiedHash()

There is nothing inherently unreasonable about using a hash of the serialized
site list as a version hash for the module, but the way the code is written
means that a task that should be a simple operation on an associative array is
instead an opera involving some half-dozen classes and interfaces.

Someone really ought to take the time to carefully unwind this code and
eliminate the bulk of it. But because this has been a performance pain-point
for nearly three years, I am not holding my breath.

So: because the site list changes so infrequently, I am proposing to fix this
in a crude but direct way: namely, having SitesModuleWorker::getModifiedHash()
return a constant string, which would have to be manually updated whenever
the site list changes.

Task: T113665
Change-Id: Ie38527e56a0ceb7a1f862a9126b81a2f581b8354
---
M lib/includes/modules/SitesModuleWorker.php
1 file changed, 5 insertions(+), 7 deletions(-)


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

diff --git a/lib/includes/modules/SitesModuleWorker.php 
b/lib/includes/modules/SitesModuleWorker.php
index 1d747b0..3d3612f 100644
--- a/lib/includes/modules/SitesModuleWorker.php
+++ b/lib/includes/modules/SitesModuleWorker.php
@@ -175,13 +175,11 @@
 * @return string
 */
public function getModifiedHash() {
-   $data = array(
-   $this->getSiteLinkGroups(),
-   $this->getSpecialSiteLinkGroups(),
-   $this->getSitesHash()
-   );
-
-   return sha1( json_encode( $data ) );
+   // Increment me whenever the roster of sites is changed.
+   // Or, alternately, make automatic cache invalidation less 
expensive
+   // by having fewer abstractions involved in hashing the site 
lists.
+   // See T113665 and Ie38527e56.
+   return '2015-09-24';
}
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie38527e56a0ceb7a1f862a9126b81a2f581b8354
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Fix code errors thrown by jscs - change (mediawiki...Blueprint)

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

Change subject: Fix code errors thrown by jscs
..


Fix code errors thrown by jscs

Align to jscs `disallowQuotedKeysInObjects` coding rules by changing
jQuery `.css()` notation to DOM formatting of multiple-word properties.

Bug: T113684
Change-Id: I2691ee91633c169fd59945a5d090029bb26953a5
---
M resources/menu.js
1 file changed, 5 insertions(+), 7 deletions(-)

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



diff --git a/resources/menu.js b/resources/menu.js
index d2d1c40..9a25576 100644
--- a/resources/menu.js
+++ b/resources/menu.js
@@ -14,15 +14,13 @@
 
$extraSpace.css( 'width', sidebarWidth - navBrandWidth - 10 );
 
-   $sideMenu.show().css( {
-   'z-index': 200
-   } );
+   $sideMenu.show().css( 'z-index', 200 );
 
$tocToggle.addClass( 'close' );
 
$content.css( {
-   'margin-left': sidebarWidth,
-   'width': contentWidth - marginDifference
+   marginLeft: sidebarWidth,
+   width: contentWidth - marginDifference
} );
};
 
@@ -31,8 +29,8 @@
$extraSpace.css( 'width', 0 );
$tocToggle.removeClass( 'close' );
$content.css( {
-   'margin-left': '',
-   'width': ''
+   marginLeft: '',
+   width: ''
} );
};
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2691ee91633c169fd59945a5d090029bb26953a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Blueprint
Gerrit-Branch: master
Gerrit-Owner: VolkerE 
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] Remove 'jshint' job from EventLogging (alreayd has 'npm') - change (integration/config)

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

Change subject: Remove 'jshint' job from EventLogging (alreayd has 'npm')
..


Remove 'jshint' job from EventLogging (alreayd has 'npm')

Change-Id: I88765a2803f247d1df621c4f4d0aabb75b44ea46
---
M zuul/layout.yaml
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 01fcf49..c61486f 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -3690,7 +3690,6 @@
   - name: mediawiki/extensions/EventLogging
 template:
   - name: extension-gate
-  - name: jshint
   - name: extension-unittests
   - name: extension-qunit-generic
   - name: npm

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I88765a2803f247d1df621c4f4d0aabb75b44ea46
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
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] Remove 'jshint' job from EventLogging (alreayd has 'npm') - change (integration/config)

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

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

Change subject: Remove 'jshint' job from EventLogging (alreayd has 'npm')
..

Remove 'jshint' job from EventLogging (alreayd has 'npm')

Change-Id: I88765a2803f247d1df621c4f4d0aabb75b44ea46
---
M zuul/layout.yaml
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/34/240934/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 01fcf49..c61486f 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -3690,7 +3690,6 @@
   - name: mediawiki/extensions/EventLogging
 template:
   - name: extension-gate
-  - name: jshint
   - name: extension-unittests
   - name: extension-qunit-generic
   - name: npm

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

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

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


[MediaWiki-commits] [Gerrit] build: Add jshint to npm-test - change (mediawiki...EventLogging)

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

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

Change subject: build: Add jshint to npm-test
..

build: Add jshint to npm-test

Currently the repository is using a legacy jshint job in Jenkins
with an outdated version of JSHint. Use the npm-test entry point
for this instead.

* Enforce compliance with ES3 engines (which means JSON is not defined
  by default, but this extension loads conditional 'json' module,
  so it's fine).

* Remove deprecated coding style options from JSHint. Use JSCS instead.

* Use jscs --fix to automatically correct style violations.

Change-Id: I9a6282b1d89c327c3a052e302ce66b39a0812019
---
A .jscsrc
M .jshintignore
M .jshintrc
M Gruntfile.js
M modules/ext.eventLogging.core.js
M package.json
M tests/ext.eventLogging.tests.js
7 files changed, 51 insertions(+), 45 deletions(-)


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

diff --git a/.jscsrc b/.jscsrc
new file mode 100644
index 000..8305d61
--- /dev/null
+++ b/.jscsrc
@@ -0,0 +1,4 @@
+{
+   "preset": "wikimedia",
+   "es3": true
+}
diff --git a/.jshintignore b/.jshintignore
index 0adcbcb..07823c2 100644
--- a/.jshintignore
+++ b/.jshintignore
@@ -1,2 +1,3 @@
 server/.tox
 modules/out
+node_modules
diff --git a/.jshintrc b/.jshintrc
index 7fa138d..d3ba265 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -1,34 +1,25 @@
 {
+   // Enforcing
+   "bitwise": true,
+   "eqeqeq": true,
+   "freeze": true,
+   "latedef": true,
+   "noarg": true,
+   "nonew": true,
+   "undef": true,
+   "unused": true,
+
+   // Relaxing
+   "laxbreak": true,
+
+   // Environment
+   "browser": true,
+   "es3": true,
+
"predef": [
"mediaWiki",
"jQuery",
-   "QUnit"
-   ],
-
-   "bitwise": true,
-   "camelcase": true,
-   "curly": true,
-   "eqeqeq": true,
-   "forin": false,
-   "immed": true,
-   "latedef": true,
-   "newcap": true,
-   "noarg": true,
-   "noempty": true,
-   "nonew": true,
-   "quotmark": "single",
-   "regexp": false,
-   "undef": true,
-   "unused": true,
-   "strict": false,
-   "trailing": true,
-
-   "laxbreak": true,
-   "smarttabs": true,
-   "multistr": true,
-
-   "browser": true,
-
-   "nomen": true,
-   "onevar": true
+   "QUnit",
+   "JSON"
+   ]
 }
diff --git a/Gruntfile.js b/Gruntfile.js
index d5c1814..16d58f0 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,21 +1,35 @@
 /*jshint node:true */
 module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
+   grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+   grunt.loadNpmTasks( 'grunt-jscs' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
 
grunt.initConfig( {
-   banana: {
-   core: 'i18n/core/',
-   jsonschema: 'i18n/jsonschema/'
+   jshint: {
+   options: {
+   jshintrc: true
+   },
+   all: '.'
+   },
+   jscs: {
+   all: [
+   '*.js',
+   '{modules,tests}/**/*.js'
+   ]
},
jsonlint: {
all: [
'**/*.json',
'!node_modules/**'
]
+   },
+   banana: {
+   core: 'i18n/core/',
+   jsonschema: 'i18n/jsonschema/'
}
} );
 
-   grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+   grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] 
);
grunt.registerTask( 'default', 'test' );
 };
diff --git a/modules/ext.eventLogging.core.js b/modules/ext.eventLogging.core.js
index 11abf30..e0c2549 100644
--- a/modules/ext.eventLogging.core.js
+++ b/modules/ext.eventLogging.core.js
@@ -242,7 +242,7 @@
 * @param {string} url URL to request from the server.
 * @return undefined
 */
-   sendBeacon: /1|yes/.test( navigator.doNotTrack ) || !baseUrl
+   sendBeacon: ( /1|yes/.test( navigator.doNotTrack ) || !baseUrl )
? $.noop
: navigator.sendBeacon
? function ( url ) { try { 
navigator.sendBeacon( url ); } catch ( e ) {} }
diff --git a/package.json b/package.json
index 76e8a82..1f7e9f3 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,8 @@
 "grunt": "0.4.5",
 "grunt-cli": "0.1.13",
 "grunt-banana-checker": "0.2.2",
+"grunt-contrib-jshint": "0.11.2",
+

[MediaWiki-commits] [Gerrit] Fix code errors thrown by jscs - change (mediawiki...Blueprint)

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

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

Change subject: Fix code errors thrown by jscs
..

Fix code errors thrown by jscs

Align to jscs `disallowQuotedKeysInObjects` coding rules by changing
jQuery `.css()` notation to DOM formatting of multiple-word properties.

Bug: T113684
Change-Id: I2691ee91633c169fd59945a5d090029bb26953a5
---
M resources/menu.js
1 file changed, 5 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Blueprint 
refs/changes/31/240931/1

diff --git a/resources/menu.js b/resources/menu.js
index d2d1c40..9a25576 100644
--- a/resources/menu.js
+++ b/resources/menu.js
@@ -14,15 +14,13 @@
 
$extraSpace.css( 'width', sidebarWidth - navBrandWidth - 10 );
 
-   $sideMenu.show().css( {
-   'z-index': 200
-   } );
+   $sideMenu.show().css( 'z-index', 200 );
 
$tocToggle.addClass( 'close' );
 
$content.css( {
-   'margin-left': sidebarWidth,
-   'width': contentWidth - marginDifference
+   marginLeft: sidebarWidth,
+   width: contentWidth - marginDifference
} );
};
 
@@ -31,8 +29,8 @@
$extraSpace.css( 'width', 0 );
$tocToggle.removeClass( 'close' );
$content.css( {
-   'margin-left': '',
-   'width': ''
+   marginLeft: '',
+   width: ''
} );
};
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2691ee91633c169fd59945a5d090029bb26953a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Blueprint
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] Kill the tag experiment - change (mediawiki...MobileFrontend)

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

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

Change subject: Kill the tag experiment
..

Kill the tag experiment

Bug: T113686
Change-Id: Icfc65fc0795fb7a287a8d0a9afad9fb093e1a654
---
M MobileFrontend.php
D includes/browse/NullTagService.php
D includes/browse/TagService.php
M includes/skins/SkinMinerva.php
D includes/specials/browse/SpecialTopicTag.php
D tests/phpunit/browse/TagServiceTest.php
6 files changed, 0 insertions(+), 338 deletions(-)


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

diff --git a/MobileFrontend.php b/MobileFrontend.php
index 82b863a..b73cfdf 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -94,9 +94,6 @@
 
'SkinMinerva' => 'skins/SkinMinerva',
'SkinMinervaBeta' => 'skins/SkinMinervaBeta',
-
-   'MobileFrontend\Browse\TagService' => 'browse/TagService',
-   'MobileFrontend\Browse\NullTagService' => 'browse/NullTagService',
 );
 
 foreach ( $autoloadClasses as $className => $classFilename ) {
@@ -157,7 +154,6 @@
'MobileLanguages' => 'SpecialMobileLanguages',
'Uploads' => 'SpecialUploads',
'UserProfile' => 'SpecialUserProfile',
-   'TopicTag' => 'SpecialTopicTag',
 );
 
 // Register Minerva as a valid skin
diff --git a/includes/browse/NullTagService.php 
b/includes/browse/NullTagService.php
deleted file mode 100644
index 60fbd94..000
--- a/includes/browse/NullTagService.php
+++ /dev/null
@@ -1,16 +0,0 @@
-tags = $tags;
-   }
-
-   /**
-* Gets the tags associated with the page.
-*
-* Only articles in the main namespace can have tags.
-*
-* @param Title $title
-* @return array
-*/
-   public function getTags( Title $title ) {
-   if ( !$title->inNamespace( NS_MAIN ) ) {
-   return array();
-   }
-
-   $result = array();
-
-   // FIXME: This is only good enough when `$this->tags`
-   // `wgMFBrowseTags` is small.
-   foreach ( $this->tags as $tag => $titles ) {
-   if ( is_array( $titles ) && in_array( 
$title->getText(), $titles ) ) {
-   $result[] = $tag;
-   }
-   }
-
-   return $result;
-   }
-
-   /**
-* Gets the titles associated with the tag.
-*
-* @param string $tag Name of a tag
-* @return Title[]|boolean False if the tag doesn't exist or isn't set 
to an array
-*/
-   public function getTitlesForTag( $tag ) {
-   if ( !isset( $this->tags[$tag] ) || !is_array( 
$this->tags[$tag] ) ) {
-   return false;
-   }
-
-   return array_map( array( 'Title', 'newFromText' ), 
$this->tags[$tag] );
-   }
-}
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 901c498..fa15c93 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -3,9 +3,6 @@
  * SkinMinerva.php
  */
 
-use MobileFrontend\Browse\TagService;
-use MobileFrontend\Browse\NullTagService;
-
 /**
  * Minerva: Born from the godhead of Jupiter with weapons!
  * A skin that works on both desktop and mobile
@@ -1357,33 +1354,5 @@
return $url;
},
$urls );
-   }
-
-   /**
-* Gets the tags assigned to the page.
-*
-* @param Title $title
-* @return array
-*/
-   private function getBrowseTags( Title $title ) {
-   return $this->getBrowseTagService()
-   ->getTags( $title );
-   }
-
-   // FIXME: This could be moved to the 
MobileFrontend\Browse\TagServiceFactory class.
-   /**
-* Gets the service that gets tags assigned to the page.
-*
-* @return MobileFrontend\Browse\TagService
-*/
-   private function getBrowseTagService() {
-   $mfConfig = $this->getMFConfig();
-   $tags = $mfConfig->get( 'MFBrowseTags' );
-
-   if ( !$mfConfig->get( 'MFIsBrowseEnabled' ) ) {
-   return new NullTagService( $tags );
-   }
-
-   return new TagService( $tags );
}
 }
diff --git a/includes/specials/browse/SpecialTopicTag.php 
b/includes/specials/browse/SpecialTopicTag.php
deleted file mode 100644
index b1df47c..000
--- a/includes/specials/browse/SpecialTopicTag.php
+++ /dev/null
@@ -1,165 +0,0 @@
-tagName = '';
-   }
-
-   /**
-* Render the special page
-*
-* @param string $subPage Tag name with underscores instead of spaces
-*/
-   public function executeWhenAvailable( $subPage ) {
-   $mfConfig = $this->getMFConfig();
-
-   if ( !$mfConfig->get( 'MFIsBrowseEnabled'

[MediaWiki-commits] [Gerrit] Hygiene: Remove unused global variables - change (mediawiki...MobileFrontend)

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

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

Change subject: Hygiene: Remove unused global variables
..

Hygiene: Remove unused global variables

Change-Id: I2bc397ad14b9f9925d1ad99ca55a8d9a96df79ce
---
M includes/config/Uploads.php
M includes/skins/SkinMinerva.php
2 files changed, 0 insertions(+), 14 deletions(-)


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

diff --git a/includes/config/Uploads.php b/includes/config/Uploads.php
index f09299f..4a43f4b 100644
--- a/includes/config/Uploads.php
+++ b/includes/config/Uploads.php
@@ -4,13 +4,6 @@
 }
 
 /**
- * A css selector which is used by mf-photo.js to test whether to prompt the 
user photo uploads on
- * the current page. When the selector matches no elements the photo uploader 
will show.
- * This is an advanced config variable so use caution in editing.
- */
-$wgMFLeadPhotoUploadCssSelector = 'img, .navbox';
-
-/**
  * The wiki id/dbname for where photos are uploaded, if photos are uploaded to
  * a wiki other than the local wiki (eg commonswiki).
  * @var string
@@ -23,11 +16,6 @@
  * Defaults to the current wiki
  */
 $wgMFPhotoUploadEndpoint = '';
-
-/**
- * (wiki)text to append to photo description during photo upload.
- */
-$wgMFPhotoUploadAppendToDesc = '';
 
 /**
  * Set the minimum edits the user needs before they can upload images in 
mobile mode
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 8939d31..901c498 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -935,8 +935,6 @@
'wgMFMenuData' => $this->getMenuData(),
'wgMFEnableJSConsoleRecruitment' => $config->get( 
'MFEnableJSConsoleRecruitment' ),
'wgMFUseCentralAuthToken' => $config->get( 
'MFUseCentralAuthToken' ),
-   'wgMFPhotoUploadAppendToDesc' => $config->get( 
'MFPhotoUploadAppendToDesc' ),
-   'wgMFLeadPhotoUploadCssSelector' => $config->get( 
'MFLeadPhotoUploadCssSelector' ),
'wgMFPhotoUploadEndpoint' =>
$config->get( 'MFPhotoUploadEndpoint' ) ? 
$config->get( 'MFPhotoUploadEndpoint' ) : '',
'wgPreferredVariant' => 
$title->getPageLanguage()->getPreferredVariant(),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2bc397ad14b9f9925d1ad99ca55a8d9a96df79ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
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] Hygiene: remove unused function - change (apps...wikipedia)

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

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

Change subject: Hygiene: remove unused function
..

Hygiene: remove unused function

Change-Id: Iaee29780b21dacf9161b25b55a033135029f3b16
---
M app/src/main/java/org/wikipedia/Utils.java
1 file changed, 0 insertions(+), 4 deletions(-)


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

diff --git a/app/src/main/java/org/wikipedia/Utils.java 
b/app/src/main/java/org/wikipedia/Utils.java
index 118f588..6ab19cc 100644
--- a/app/src/main/java/org/wikipedia/Utils.java
+++ b/app/src/main/java/org/wikipedia/Utils.java
@@ -555,10 +555,6 @@
 return isStatusBarTranslucent() ? getStatusBarHeight(context) : 0;
 }
 
-private static int getStatusBarHeightPx(Context context) {
-return DimenUtil.roundedDpToPx(getStatusBarHeight(context));
-}
-
 private static float getStatusBarHeight(Context context) {
 int id = getStatusBarId(context);
 return id > 0 ? DimenUtil.getDimension(id) : 0;

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

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

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


[MediaWiki-commits] [Gerrit] Initialize status bar color to match toolbar - change (apps...wikipedia)

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

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

Change subject: Initialize status bar color to match toolbar
..

Initialize status bar color to match toolbar

On app launch the status bar was transparent but the toolbar was not.
This patch initializes the status bar color to be consistent with the
toolbar.

Change-Id: I9d1e3221d0fae12fe6373d9f5ca656a2b138a185
---
M app/src/main/res/layout/activity_page.xml
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/app/src/main/res/layout/activity_page.xml 
b/app/src/main/res/layout/activity_page.xml
index 93b854a..1bdcb0e 100644
--- a/app/src/main/res/layout/activity_page.xml
+++ b/app/src/main/res/layout/activity_page.xml
@@ -52,7 +52,8 @@
 
+android:layout_height="wrap_content"
+android:background="@color/main_toolbar_background" />
 

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

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

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


[MediaWiki-commits] [Gerrit] Increase maxUrlSize to 2000 - change (mediawiki...EventLogging)

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

Change subject: Increase maxUrlSize to 2000
..


Increase maxUrlSize to 2000

The Schema:NavigationTiming is consistently creating messages
of around 950 characters. And averaging around 1000–1150 for
post-save request timing (which contain larger numbers).

Increase this limit to avoid data loss.

Bug: T112002
Change-Id: I4ae8bb5a45b58a836e4e72485264001566ed9e58
(cherry picked from commit 62ecf20edaad0b68b246d4a15be41b2ab151b0c0)
---
M modules/ext.eventLogging.core.js
1 file changed, 8 insertions(+), 4 deletions(-)

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



diff --git a/modules/ext.eventLogging.core.js b/modules/ext.eventLogging.core.js
index 11abf30..c9ce2c5 100644
--- a/modules/ext.eventLogging.core.js
+++ b/modules/ext.eventLogging.core.js
@@ -46,14 +46,18 @@
schemas: {},
 
/**
-* Maximum length in chars that a beacon url can have.
-* If a url is longer than that, the log may be truncated
-* by varnishncsa and result in validation problems.
+* Maximum length in chars that a beacon URL can have.
+* Relevant:
+*
+* - Length that browsers support 
(http://stackoverflow.com/a/417184/319266)
+* - Length that proxies support (e.g. Varnish)
+* - varnishlog (shm_reclen)
+* - varnishkafka
 *
 * @property maxUrlSize
 * @type Number
 */
-   maxUrlSize: 1000,
+   maxUrlSize: 2000,
 
/**
 * Load a schema from the schema registry.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4ae8bb5a45b58a836e4e72485264001566ed9e58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: wmf/1.26wmf24
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mw.storage: Fix broken test (incompatible with Chrome 45) - change (mediawiki/core)

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

Change subject: mw.storage: Fix broken test (incompatible with Chrome 45)
..


mw.storage: Fix broken test (incompatible with Chrome 45)

The localStorage global is read-only which Chrome 45 enforces.

Simplify things by dropping mediaWiki.storage.isStorageEnabled, and
by wrapping each operation with a try / catch.

Bug: T113413
Change-Id: Iecbdeb050b9a69febd3388898d98293a84588a94
(cherry picked from commit 430a0d3984fe188531175a295a24906d472abe42)
---
M resources/src/mediawiki/mediawiki.storage.js
M tests/qunit/suites/resources/mediawiki/mediawiki.storage.test.js
2 files changed, 51 insertions(+), 79 deletions(-)

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



diff --git a/resources/src/mediawiki/mediawiki.storage.js 
b/resources/src/mediawiki/mediawiki.storage.js
index e10b561..3958392 100644
--- a/resources/src/mediawiki/mediawiki.storage.js
+++ b/resources/src/mediawiki/mediawiki.storage.js
@@ -1,69 +1,58 @@
 ( function ( mw ) {
'use strict';
-   var storage;
 
/**
 * Library for storing device specific information. It should be used 
for storing simple
 * strings and is not suitable for storing large chunks of data.
+*
 * @class mw.storage
 * @singleton
 */
-   storage = {
-   isLocalStorageSupported: false,
+   mw.storage = {
+
+   localStorage: window.localStorage,
+
/**
 * Retrieve value from device storage.
 *
-* @param {String} key of item to retrieve
-* @returns {String|Boolean} false when localStorage not 
available, otherwise string
+* @param {string} key Key of item to retrieve
+* @return {string|boolean} False when localStorage not 
available, otherwise string
 */
get: function ( key ) {
-   if ( this.isLocalStorageSupported ) {
-   return localStorage.getItem( key );
-   } else {
-   return false;
-   }
+   try {
+   return mw.storage.localStorage.getItem( key );
+   } catch ( e ) {}
+   return false;
},
 
/**
-* Set a value in device storage.
-*
-* @param {String} key key name to store under.
-* @param {String} value to be stored.
-* @returns {Boolean} whether the save succeeded or not.
-*/
+ * Set a value in device storage.
+ *
+ * @param {string} key Key name to store under
+ * @param {string} value Value to be stored
+ * @returns {boolean} Whether the save succeeded or not
+ */
set: function ( key, value ) {
try {
-   localStorage.setItem( key, value );
+   mw.storage.localStorage.setItem( key, value );
return true;
-   } catch ( e ) {
-   return false;
-   }
+   } catch ( e ) {}
+   return false;
},
 
/**
-* Remove a value from device storage.
-*
-* @param {String} key of item to remove.
-* @returns {Boolean} whether the save succeeded or not.
-*/
+ * Remove a value from device storage.
+ *
+ * @param {string} key Key of item to remove
+ * @returns {boolean} Whether the save succeeded or not
+ */
remove: function ( key ) {
-   if ( this.isLocalStorageSupported ) {
-   localStorage.removeItem( key );
+   try {
+   mw.storage.localStorage.removeItem( key );
return true;
-   } else {
-   return false;
-   }
+   } catch ( e ) {}
+   return false;
}
};
-
-   mw.storage = storage;
-   // See if local storage is supported
-   try {
-   localStorage.setItem( 'localStorageTest', 'localStorageTest' );
-   localStorage.removeItem( 'localStorageTest' );
-   storage.isLocalStorageSupported = true;
-   } catch ( e ) {
-   // Already set. No body needed.
-   }
 
 }( mediaWiki ) );
diff --git a/tests/qunit/suites/resources/mediawiki/

[MediaWiki-commits] [Gerrit] T99836 Civi46: adapt to pre-hook standardisation - change (wikimedia...crm)

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

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

Change subject: T99836 Civi46: adapt to pre-hook standardisation
..

T99836 Civi46: adapt to pre-hook standardisation

The pre hook is supposed to pass an array but in 4.2 it passed an object when 
called for email.
In 4.6 we need to expect an array

Change-Id: I7199bfd8ad37816a72e4580ae43d5658c2195c3d
---
M sites/all/modules/wmf_communication/wmf_communication.module
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/26/240926/1

diff --git a/sites/all/modules/wmf_communication/wmf_communication.module 
b/sites/all/modules/wmf_communication/wmf_communication.module
index 2fb4e07..58afd87 100644
--- a/sites/all/modules/wmf_communication/wmf_communication.module
+++ b/sites/all/modules/wmf_communication/wmf_communication.module
@@ -123,8 +123,8 @@
if ( $type !== 'Email' || $email === null ) {
return;
}
-   // ignore on_hold status changes 
-   if ( $email->on_hold && $email->on_hold !== 'null' ) {
+   // ignore on_hold status changes
+   if ( isset($email['on_hold']) && $email['on_hold'] !== 'null' ) {
return;
}
if ( $op !== 'edit' && $op !== 'delete' ) {
@@ -139,12 +139,12 @@
)
);
// bail out if we can't find the old values
-   if ( !array_key_exists( $email->id, $old_email_result['values'] ) ) {
+   if ( !array_key_exists( $email['id'], $old_email_result['values'] ) ) {
return;
}
-   $old_email = $old_email_result['values'][$email->id];
+   $old_email = $old_email_result['values'][$email['id']];
// if we're editing, but not the address, bail out
-   if ( $op === 'edit' && $old_email['email'] === $email->email ) {
+   if ( $op === 'edit' && $old_email['email'] === $email['email'] ) {
return;
}
// if we're deleting an email that's already on hold, stop here
@@ -156,7 +156,7 @@
'email' => $old_email['email'],
'on_hold' => TRUE,
'hold_date' => date('YmdHis'),
-   'contact_id' => $email->contact_id
+   'contact_id' => $email['contact_id'],
);
$new_email_result = civicrm_api( "Email", "create", $params );
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7199bfd8ad37816a72e4580ae43d5658c2195c3d
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] T99836 Civi46 update refund test for changed parameter - change (wikimedia...crm)

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

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

Change subject: T99836 Civi46 update refund test for changed parameter
..

T99836 Civi46 update refund test for changed parameter

The name of the parameter to check has changed from contribution_type to 
financial_type

Change-Id: I119c8be9fa32ff589a714ef829d0c6d06673e58a
---
M sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/27/240927/1

diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
index ec79e91..2fb0d13 100644
--- a/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/RefundTest.php
@@ -104,7 +104,7 @@
 ) );
 $contribution = array_pop( $results['values'] );
 
-$this->assertEquals( 'Chargeback', $contribution['contribution_type'],
+$this->assertEquals( 'Chargeback', $contribution['financial_type'],
 'Refund contribution has correct type' );
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I119c8be9fa32ff589a714ef829d0c6d06673e58a
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] T99836 remove apiv2 Entity Tag call - change (wikimedia...crm)

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

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

Change subject: T99836 remove apiv2 Entity Tag call
..

T99836 remove apiv2 Entity Tag call

The return value of this function is changed, but on grepping there were no 
functions
that used the return value so I removed the unused assignments & let the value 
change

Change-Id: If548d5108342bc4ff5adb5ac2e0f270ea7ceeca0

T99836 entity-tag patch

Change-Id: I90e56c5933145b701ef6f17367c9e1f1ca1af912
---
M sites/all/modules/queue2civicrm/recurring/recurring.module
A sites/all/modules/wmf_civicrm/tests/phpunit/HelperFunctionsTest.php
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
3 files changed, 53 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/25/240925/1

diff --git a/sites/all/modules/queue2civicrm/recurring/recurring.module 
b/sites/all/modules/queue2civicrm/recurring/recurring.module
index 5704bad..60ad213 100644
--- a/sites/all/modules/queue2civicrm/recurring/recurring.module
+++ b/sites/all/modules/queue2civicrm/recurring/recurring.module
@@ -412,7 +412,7 @@
   $location = wmf_civicrm_message_location_update( $msg, $contact );
   
   // Tag contact for review
-  $tag = wmf_civicrm_tag_contact_for_review( $contact );
+  wmf_civicrm_tag_contact_for_review( $contact );
 
   watchdog( 'recurring', 'Subscription succesfully modified for subscription 
id: %subscr_id', array( '%subscr_id' => print_r( $msg['subscr_id'], true )), 
WATCHDOG_NOTICE );
 }
diff --git 
a/sites/all/modules/wmf_civicrm/tests/phpunit/HelperFunctionsTest.php 
b/sites/all/modules/wmf_civicrm/tests/phpunit/HelperFunctionsTest.php
new file mode 100644
index 000..f26da85
--- /dev/null
+++ b/sites/all/modules/wmf_civicrm/tests/phpunit/HelperFunctionsTest.php
@@ -0,0 +1,48 @@
+ 'WmfCivicrm help functions',
+'group' => 'WmfCivicrm',
+'description' => 'Tests for helper functions in .module file',
+);
+}
+
+/**
+ * Prepare for test.
+ *
+ * @throws \Exception
+ */
+public function setUp() {
+// @todo not sure why I needed to do this to be enotice free.
+global $user;
+$user->timezone = '+13';
+civicrm_initialize();
+parent::setUp();
+}
+
+/**
+ * Test wmf_civicrm_tag_contact_for_review.
+ *
+ * Maintenance note: the civicrm entity_tag get api returns an odd syntax.
+ *
+ * If that ever gets fixed it may break this test - but only the test would
+ * need to be altered to adapt.
+ *
+ * @throws \CiviCRM_API3_Exception
+ */
+public function testTagContactForReview() {
+$contact = civicrm_api3('Contact', 'create', array(
+'contact_type' => 'Organization',
+'organization_name' => 'The Evil Empire',
+));
+wmf_civicrm_tag_contact_for_review($contact);
+$entityTags = civicrm_api3('EntityTag', 'get', array('entity_id' => 
$contact['id']));
+$this->assertArrayHasKey(civicrm_api3('Tag', 'getvalue', array('name' 
=> 'Review', 'return' => 'id')), $entityTags['values']);
+}
+
+}
diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 9d2ad15..dd58d82 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -223,7 +223,7 @@
 // TODO: Add to contact_tags instead.
 // Tag contact for review
 try {
-$tag = wmf_civicrm_tag_contact_for_review( $contact );
+wmf_civicrm_tag_contact_for_review( $contact );
 } catch ( WmfException $ex ) {
 watchdog( 'queue2civicrm_import', 'Failed to tag contact for 
review.', NULL, WATCHDOG_ERROR );
 }
@@ -1475,16 +1475,15 @@
 
 /**
  * Insert the tag record
- * 
+ *
  * Serves as a standard way for message processors to handle tag
  * insertion.
- * 
+ *
  * @param array $contact
  * @return array
  */
 function wmf_civicrm_tag_contact_for_review( $contact )
 {
-require_once 'api/v2/EntityTag.php';
 
 $review_tag_id = wmf_civicrm_get_civi_id('tag_id', 'Review');
 
@@ -1492,8 +1491,7 @@
 'tag_id' => $review_tag_id,
 'contact_id' => $contact[ 'id' ]
 );
-$tag_result = civicrm_entity_tag_add( $tag );
-return $tag_result;
+return civicrm_api3('EntityTag', 'create', $tag);
 }
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90e56c5933145b701ef6f17367c9e1f1ca1af912
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

[MediaWiki-commits] [Gerrit] Add new fields to TestSearchSatisfaction - change (mediawiki...WikimediaEvents)

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

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

Change subject: Add new fields to TestSearchSatisfaction
..

Add new fields to TestSearchSatisfaction

Depends on Ia0e8a95 in mediawiki/core for some functionality.

Bug: T113291
Change-Id: Ia32fe99d7557580b6ffcf08da6b8617cd7754b15
---
M WikimediaEvents.php
M modules/ext.wikimediaEvents.search.js
2 files changed, 57 insertions(+), 9 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents 
refs/changes/24/240924/1

diff --git a/WikimediaEvents.php b/WikimediaEvents.php
index 19857ab..85ff220 100644
--- a/WikimediaEvents.php
+++ b/WikimediaEvents.php
@@ -88,7 +88,7 @@
'schema.TestSearchSatisfaction2' => array(
'class'=> 'ResourceLoaderSchemaModule',
'schema'   => 'TestSearchSatisfaction2',
-   'revision' => 13223897,
+   'revision' => 1377,
),
'schema.GeoFeatures' => array(
'class'=> 'ResourceLoaderSchemaModule',
diff --git a/modules/ext.wikimediaEvents.search.js 
b/modules/ext.wikimediaEvents.search.js
index 2495ed7..cee603c 100644
--- a/modules/ext.wikimediaEvents.search.js
+++ b/modules/ext.wikimediaEvents.search.js
@@ -1,5 +1,19 @@
 /*!
  * Javacsript module for measuring internal search bounce rate and dwell time.
+ * Utilizes two wprov query string formats:
+ * - serp:N - This indicates the link was visited directly from a SERP. N is
+ *   a positive integer indicating the position of this page within the 
results.
+ * - cirrus - This indicates the link was visited as part of a search session
+ *   but not directly from the search page.
+ *
+ * Example:
+ * - User performs search, is shown Special:Search. This has no wprov query 
string parameter
+ * - User clicks the 2nd result in the page which is `Jimmy Wales`, the user 
is sent to
+ *   /wiki/Jimmy_Wales?wprov=serp:2
+ * - User clicks a link in the content area of `Jimmy Wales` to `Wikipedia`, 
the user is sent to
+ *   /wiki/Wikipedia?wprov=cirrus.
+ * - Visiting any page without having a direct click stream through article 
pages back
+ *   to a SERP does not log events.
  *
  * @license GNU GPL v2 or later
  * @author Erik Bernhardson 
@@ -7,16 +21,22 @@
 ( function ( mw, $, undefined ) {
var isSearchResultPage = mw.config.get( 'wgIsSearchResultPage' ),
uri = new mw.Uri( location.href ),
-   cameFromSearchResult = uri.query.wprov === 'cirrus';
+   cameFromSearchResult = (uri.query.wprov && 
uri.query.wprov.substr(0,5) === 'serp:'),
+   searchResultPosition = parseInt( cameFromSearchResult && 
uri.query.wprov.substr(5) ),
+   isDeepSearchResult = uri.query.wprov === 'cirrus',
+   lastScrollTop = $( window ).scrollTop();
 
function oneIn( populationSize ) {
+   return false;
+
return Math.floor( Math.random() * populationSize ) === 0;
}
 
-   if ( cameFromSearchResult ) {
+   if ( cameFromSearchResult || isDeepSearchResult ) {
// cleanup the location bar in supported browsers
if ( window.history.replaceState ) {
delete uri.query.wprov;
+   delete uri.query.srpos;
window.history.replaceState( {}, '', uri.toString() );
}
} else if ( !isSearchResultPage ) {
@@ -30,35 +50,54 @@
'schema.TestSearchSatisfaction2'
] ).then( function () {
var searchSessionId = $.jStorage.get( 'searchSessionId' ),
+   searchToken = $.jStorage.get( 'searchToken' ),
sessionLifetimeMs = 10 * 60 * 1000,
+   articleId = mw.config.get( 'wgArticleId' ),
checkinTimes = 
[10,20,30,40,50,60,90,120,150,180,210,240,300,360,420],
pageId = mw.user.generateRandomSessionId(),
logEvent = function ( action, checkinTime ) {
-   var evt = {
+   var scrollTop = $( window ).scrollTop(),
+   evt = {
// searchResultPage, visitPage 
or checkin
action: action,
// identifies a single user 
performing searches within
// a limited time span.
searchSessionId: 
searchSessionId,
+   // identifies a single user 
over a 24 hour timespan,
+   // allowing to tie together 
multiple search sessions
+   searchToken: searchTok

[MediaWiki-commits] [Gerrit] mw.storage: Fix broken test (incompatible with Chrome 45) - change (mediawiki/core)

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

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

Change subject: mw.storage: Fix broken test (incompatible with Chrome 45)
..

mw.storage: Fix broken test (incompatible with Chrome 45)

The localStorage global is read-only which Chrome 45 enforces.

Simplify things by dropping mediaWiki.storage.isStorageEnabled, and
by wrapping each operation with a try / catch.

Bug: T113413
Change-Id: Iecbdeb050b9a69febd3388898d98293a84588a94
(cherry picked from commit 430a0d3984fe188531175a295a24906d472abe42)
---
M resources/src/mediawiki/mediawiki.storage.js
M tests/qunit/suites/resources/mediawiki/mediawiki.storage.test.js
2 files changed, 51 insertions(+), 79 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/240923/1

diff --git a/resources/src/mediawiki/mediawiki.storage.js 
b/resources/src/mediawiki/mediawiki.storage.js
index e10b561..3958392 100644
--- a/resources/src/mediawiki/mediawiki.storage.js
+++ b/resources/src/mediawiki/mediawiki.storage.js
@@ -1,69 +1,58 @@
 ( function ( mw ) {
'use strict';
-   var storage;
 
/**
 * Library for storing device specific information. It should be used 
for storing simple
 * strings and is not suitable for storing large chunks of data.
+*
 * @class mw.storage
 * @singleton
 */
-   storage = {
-   isLocalStorageSupported: false,
+   mw.storage = {
+
+   localStorage: window.localStorage,
+
/**
 * Retrieve value from device storage.
 *
-* @param {String} key of item to retrieve
-* @returns {String|Boolean} false when localStorage not 
available, otherwise string
+* @param {string} key Key of item to retrieve
+* @return {string|boolean} False when localStorage not 
available, otherwise string
 */
get: function ( key ) {
-   if ( this.isLocalStorageSupported ) {
-   return localStorage.getItem( key );
-   } else {
-   return false;
-   }
+   try {
+   return mw.storage.localStorage.getItem( key );
+   } catch ( e ) {}
+   return false;
},
 
/**
-* Set a value in device storage.
-*
-* @param {String} key key name to store under.
-* @param {String} value to be stored.
-* @returns {Boolean} whether the save succeeded or not.
-*/
+ * Set a value in device storage.
+ *
+ * @param {string} key Key name to store under
+ * @param {string} value Value to be stored
+ * @returns {boolean} Whether the save succeeded or not
+ */
set: function ( key, value ) {
try {
-   localStorage.setItem( key, value );
+   mw.storage.localStorage.setItem( key, value );
return true;
-   } catch ( e ) {
-   return false;
-   }
+   } catch ( e ) {}
+   return false;
},
 
/**
-* Remove a value from device storage.
-*
-* @param {String} key of item to remove.
-* @returns {Boolean} whether the save succeeded or not.
-*/
+ * Remove a value from device storage.
+ *
+ * @param {string} key Key of item to remove
+ * @returns {boolean} Whether the save succeeded or not
+ */
remove: function ( key ) {
-   if ( this.isLocalStorageSupported ) {
-   localStorage.removeItem( key );
+   try {
+   mw.storage.localStorage.removeItem( key );
return true;
-   } else {
-   return false;
-   }
+   } catch ( e ) {}
+   return false;
}
};
-
-   mw.storage = storage;
-   // See if local storage is supported
-   try {
-   localStorage.setItem( 'localStorageTest', 'localStorageTest' );
-   localStorage.removeItem( 'localStorageTest' );
-   storage.isLocalStorageSupported = true;
-   } catch ( e ) {
-   // Already set. No body needed.
-   }
 
 }( mediaWiki ) );
diff --git a

[MediaWiki-commits] [Gerrit] Increase maxUrlSize to 2000 - change (mediawiki...EventLogging)

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

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

Change subject: Increase maxUrlSize to 2000
..

Increase maxUrlSize to 2000

The Schema:NavigationTiming is consistently creating messages
of around 950 characters. And averaging around 1000–1150 for
post-save request timing (which contain larger numbers).

Increase this limit to avoid data loss.

Bug: T112002
Change-Id: I4ae8bb5a45b58a836e4e72485264001566ed9e58
(cherry picked from commit 62ecf20edaad0b68b246d4a15be41b2ab151b0c0)
---
M modules/ext.eventLogging.core.js
1 file changed, 8 insertions(+), 4 deletions(-)


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

diff --git a/modules/ext.eventLogging.core.js b/modules/ext.eventLogging.core.js
index 11abf30..c9ce2c5 100644
--- a/modules/ext.eventLogging.core.js
+++ b/modules/ext.eventLogging.core.js
@@ -46,14 +46,18 @@
schemas: {},
 
/**
-* Maximum length in chars that a beacon url can have.
-* If a url is longer than that, the log may be truncated
-* by varnishncsa and result in validation problems.
+* Maximum length in chars that a beacon URL can have.
+* Relevant:
+*
+* - Length that browsers support 
(http://stackoverflow.com/a/417184/319266)
+* - Length that proxies support (e.g. Varnish)
+* - varnishlog (shm_reclen)
+* - varnishkafka
 *
 * @property maxUrlSize
 * @type Number
 */
-   maxUrlSize: 1000,
+   maxUrlSize: 2000,
 
/**
 * Load a schema from the schema registry.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ae8bb5a45b58a836e4e72485264001566ed9e58
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: wmf/1.26wmf24
Gerrit-Owner: Krinkle 

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


[MediaWiki-commits] [Gerrit] Final tweaks to QuickSurvey panel placement. - change (mediawiki...QuickSurveys)

2015-09-24 Thread Robmoen (Code Review)
Robmoen has uploaded a new change for review.

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

Change subject: Final tweaks to QuickSurvey panel placement.
..

Final tweaks to QuickSurvey panel placement.

* On mobile, places panel after the first p element with content
* On desktop, places panel before first infobox, thumb, or heading
* Otherwise, places panel at the end of the article

Bug: T113651
Change-Id: Iad47e72ff5eaae82ec51546255d8c6ba274fad8e
---
M resources/ext.quicksurveys.init/init.js
1 file changed, 19 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuickSurveys 
refs/changes/21/240921/1

diff --git a/resources/ext.quicksurveys.init/init.js 
b/resources/ext.quicksurveys.init/init.js
index 08d2bc8..cf1adbc 100644
--- a/resources/ext.quicksurveys.init/init.js
+++ b/resources/ext.quicksurveys.init/init.js
@@ -26,20 +26,31 @@
 
/**
 * Insert the quick survey panel into the article either (in priority 
order)
-* before the first instance of a thumbnail,
-* before the first instance of a heading
-* or at the end of the article when no headings nor thumbnails exist
+* On mobile: after the first p element with content
+* On desktop: before the first instance of a infobox, thumb, or heading
+* Or after the article when no infobox, thumbnails or headings exist
+*
 * @param {jQuery.Object} $panel
 */
function insertPanel( $panel ) {
var $bodyContent = $( '.mw-content-ltr, .mw-content-rtl' ),
-   $place = $bodyContent
-   .find( '.infobox, > .thumb, > h1, > h2, > h3, > 
h4, > h5, > h6' )
-   .eq( 0 );
+   $place;
 
-   if ( $place.length ) {
-   $panel.insertBefore( $place );
+   if ( window.innerWidth <= 768 ) {
+   $bodyContent.find( '> div > p' ).each( function() {
+   if ( $.trim( $( this ).text() ).length > 0 ) {
+   $panel.insertAfter( $( this ) );
+   return false;
+   }
+   } );
} else {
+   $panel.insertBefore( $bodyContent
+   .find( '.infobox, .thumb, > h1, > h2, > h3, > 
h4, > h5, > h6' )
+   .eq( 0 )
+   );
+   }
+
+   if ( $panel.length === 0 ) {
$panel.appendTo( $bodyContent );
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad47e72ff5eaae82ec51546255d8c6ba274fad8e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/QuickSurveys
Gerrit-Branch: dev
Gerrit-Owner: Robmoen 

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


[MediaWiki-commits] [Gerrit] beta: Remove commented out rules for www2.knams.wikimedia.or... - change (operations/puppet)

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

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

Change subject: beta: Remove commented out rules for 
www2.knams.wikimedia.org/stats
..

beta: Remove commented out rules for www2.knams.wikimedia.org/stats

This doesn't apply to beta, but also just in general doesn't exist anymore.

Change-Id: Idb339553de2362917d0377788c236b5933d9e99f
---
M modules/mediawiki/files/apache/beta/sites/testwiki.conf
M modules/mediawiki/files/apache/beta/sites/wikibooks.conf
M modules/mediawiki/files/apache/beta/sites/wikinews.conf
M modules/mediawiki/files/apache/beta/sites/wikipedia.conf
M modules/mediawiki/files/apache/beta/sites/wikiquote.conf
M modules/mediawiki/files/apache/beta/sites/wikisource.conf
M modules/mediawiki/files/apache/beta/sites/wikiversity.conf
M modules/mediawiki/files/apache/beta/sites/wiktionary.conf
8 files changed, 0 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/19/240919/1

diff --git a/modules/mediawiki/files/apache/beta/sites/testwiki.conf 
b/modules/mediawiki/files/apache/beta/sites/testwiki.conf
index 2140ba3..3d6518c 100644
--- a/modules/mediawiki/files/apache/beta/sites/testwiki.conf
+++ b/modules/mediawiki/files/apache/beta/sites/testwiki.conf
@@ -47,7 +47,4 @@
 
 
 
-# Stats
-#RewriteRule ^/stats(/(.*$)|$) 
http://www2.knams.wikimedia.org/stats/%{HTTP_HOST}/$1 [R=301,L]
-
 
diff --git a/modules/mediawiki/files/apache/beta/sites/wikibooks.conf 
b/modules/mediawiki/files/apache/beta/sites/wikibooks.conf
index 7e570e1..3f99e22 100644
--- a/modules/mediawiki/files/apache/beta/sites/wikibooks.conf
+++ b/modules/mediawiki/files/apache/beta/sites/wikibooks.conf
@@ -66,9 +66,6 @@
 
 
 
-# Stats
-#RewriteRule ^/stats(/(.*$)|$) 
http://www2.knams.wikimedia.org/stats/%{HTTP_HOST}/$1 [R=301,L]
-
 # Variant aliases
 Alias /sr /srv/mediawiki/docroot/wikibooks.org/w/index.php
 Alias /sr-ec /srv/mediawiki/docroot/wikibooks.org/w/index.php
diff --git a/modules/mediawiki/files/apache/beta/sites/wikinews.conf 
b/modules/mediawiki/files/apache/beta/sites/wikinews.conf
index 82af1ac..90f84de 100644
--- a/modules/mediawiki/files/apache/beta/sites/wikinews.conf
+++ b/modules/mediawiki/files/apache/beta/sites/wikinews.conf
@@ -57,9 +57,6 @@
 
 
 
-# Stats
-#RewriteRule ^/stats(/(.*$)|$) 
http://www2.knams.wikimedia.org/stats/%{HTTP_HOST}/$1 [R=301,L]
-
 # Variant aliases
 Alias /sr /srv/mediawiki/docroot/wikinews.org/w/index.php
 Alias /sr-ec /srv/mediawiki/docroot/wikinews.org/w/index.php
diff --git a/modules/mediawiki/files/apache/beta/sites/wikipedia.conf 
b/modules/mediawiki/files/apache/beta/sites/wikipedia.conf
index 3b86069..8bfddf6 100644
--- a/modules/mediawiki/files/apache/beta/sites/wikipedia.conf
+++ b/modules/mediawiki/files/apache/beta/sites/wikipedia.conf
@@ -86,9 +86,6 @@
 
 
 
-# Stats
-#RewriteRule ^/stats(/(.*$)|$) 
http://www2.knams.wikimedia.org/stats/%{HTTP_HOST}/$1 [R=301,L]
-
 # Variant aliases
 Alias /sr /srv/mediawiki/docroot/wikipedia.org/w/index.php
 Alias /sr-ec /srv/mediawiki/docroot/wikipedia.org/w/index.php
diff --git a/modules/mediawiki/files/apache/beta/sites/wikiquote.conf 
b/modules/mediawiki/files/apache/beta/sites/wikiquote.conf
index 7566df0..3607844 100644
--- a/modules/mediawiki/files/apache/beta/sites/wikiquote.conf
+++ b/modules/mediawiki/files/apache/beta/sites/wikiquote.conf
@@ -57,9 +57,6 @@
 
 
 
-# Stats
-#RewriteRule ^/stats(/(.*$)|$) 
http://www2.knams.wikimedia.org/stats/%{HTTP_HOST}/$1 [R=301,L]
-
 # Variant aliases
 Alias /sr /srv/mediawiki/docroot/wikiquote.org/w/index.php
 Alias /sr-ec /srv/mediawiki/docroot/wikiquote.org/w/index.php
diff --git a/modules/mediawiki/files/apache/beta/sites/wikisource.conf 
b/modules/mediawiki/files/apache/beta/sites/wikisource.conf
index 9d72d45..a93efe6 100644
--- a/modules/mediawiki/files/apache/beta/sites/wikisource.conf
+++ b/modules/mediawiki/files/apache/beta/sites/wikisource.conf
@@ -57,9 +57,6 @@
 
 
 
-# Stats
-#RewriteRule ^/stats(/(.*$)|$) 
http://www2.knams.wikimedia.org/stats/%{HTTP_HOST}/$1 [R=301,L]
-
 # Variant aliases
 Alias /sr /srv/mediawiki/docroot/wikisource.org/w/index.php
 Alias /sr-ec /srv/mediawiki/docroot/wikisource.org/w/index.php
diff --git a/modules/mediawiki/files/apache/beta/sites/wikiversity.conf 
b/modules/mediawiki/files/apache/beta/sites/wikiversity.conf
index cd1b8b8..4f962bd 100644
--- a/modules/mediawiki/files/apache/beta/sites/wikiversity.conf
+++ b/modules/mediawiki/files/apache/beta/sites/wikiversity.conf
@@ -57,9 +57,6 @@
 
 
 
-# Stats
-#RewriteRule ^/stats(/(.*$)|$) 
http://www2.knams.wikimedia.org/stats/%{HTTP_HOST}/$1 [R=301,L]
-
 # Variant aliases
 Alias /sr /srv/mediawiki/docroot/wikiversity.org/w/index.php
 

[MediaWiki-commits] [Gerrit] CurlHttpRequest: Follow redirects even under open_basedir - change (mediawiki/core)

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

Change subject: CurlHttpRequest: Follow redirects even under open_basedir
..


CurlHttpRequest: Follow redirects even under open_basedir

As of PHP 5.6.0, this is now allowed provided that libcurl is version
7.19.4 or newer (to not follow redirects to file:// URLs, which would
circumvent the open_basedir restriction).

https://bugs.php.net/bug.php?id=65646
https://github.com/php/php-src/commit/fba290c061027c24e4c8effdba37addd3430c3d4

Change-Id: I1233dca563a185d12923736d8d397a3acf87a71e
---
M includes/HttpFunctions.php
1 file changed, 7 insertions(+), 5 deletions(-)

Approvals:
  Parent5446: Looks good to me, but someone else must approve
  Dpatrick: Looks good to me, but someone else must approve
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php
index d066df8..621692a 100644
--- a/includes/HttpFunctions.php
+++ b/includes/HttpFunctions.php
@@ -793,17 +793,19 @@
 * @return bool
 */
public function canFollowRedirects() {
-   if ( strval( ini_get( 'open_basedir' ) ) !== '' || 
wfIniGetBool( 'safe_mode' ) ) {
-   wfDebug( "Cannot follow redirects in safe mode\n" );
-   return false;
-   }
-
$curlVersionInfo = curl_version();
if ( $curlVersionInfo['version_number'] < 0x071304 ) {
wfDebug( "Cannot follow redirects with libcurl < 7.19.4 
due to CVE-2009-0037\n" );
return false;
}
 
+   if ( version_compare( PHP_VERSION, '5.6.0', '<' ) ) {
+   if ( strval( ini_get( 'open_basedir' ) ) !== '' || 
wfIniGetBool( 'safe_mode' ) ) {
+   wfDebug( "Cannot follow redirects in safe 
mode\n" );
+   return false;
+   }
+   }
+
return true;
}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1233dca563a185d12923736d8d397a3acf87a71e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand 
Gerrit-Reviewer: Dpatrick 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: PleaseStand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use wikimedia/cldr-plural-rule-parser - change (mediawiki/core)

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

Change subject: Use wikimedia/cldr-plural-rule-parser
..


Use wikimedia/cldr-plural-rule-parser

Replaces the parser included in MediaWiki with same code in
a library.

Change-Id: I1d2675466a543269e17faf213aa68d2b7afaf78e
---
M RELEASE-NOTES-1.26
M autoload.php
M composer.json
M includes/cache/LocalisationCache.php
M languages/Language.php
D languages/utils/CLDRPluralRuleConverter.php
D languages/utils/CLDRPluralRuleConverterExpression.php
D languages/utils/CLDRPluralRuleConverterFragment.php
D languages/utils/CLDRPluralRuleConverterOperator.php
D languages/utils/CLDRPluralRuleError.php
D languages/utils/CLDRPluralRuleEvaluator.php
D languages/utils/CLDRPluralRuleEvaluatorRange.php
D tests/phpunit/languages/utils/CLDRPluralRuleEvaluatorTest.php
13 files changed, 8 insertions(+), 988 deletions(-)

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



diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26
index 99fc2eb..1df0d03 100644
--- a/RELEASE-NOTES-1.26
+++ b/RELEASE-NOTES-1.26
@@ -44,6 +44,7 @@
 * $wgBlockAllowsUTEdit is now set to true by default. This allows
   blocked users to edit their talk pages unless explicitly disabled
   when they are being blocked.
+* CLDRPluralRule* classes have been replaced with 
wikimedia/cldr-plural-rule-parser.
 
 === New features in 1.26 ===
 * (T51506) Now action=info gives estimates of actual watchers for a page.
@@ -98,6 +99,7 @@
 * Upgrade jQuery Client from v1.0.0 to v2.0.0.
 * Added mediawiki/at-ease 1.0.0.
 * Update QUnit from v1.17.1 to v1.18.0.
+* Added wikimedia/cldr-plural-rule-parser 1.0.0
 
 === Bug fixes in 1.26 ===
 * (T53283) load.php sometimes sends 304 response without full headers
diff --git a/autoload.php b/autoload.php
index e5e7cda..1c25a81 100644
--- a/autoload.php
+++ b/autoload.php
@@ -184,13 +184,6 @@
'BmpHandler' => __DIR__ . '/includes/media/BMP.php',
'BrokenRedirectsPage' => __DIR__ . 
'/includes/specials/SpecialBrokenRedirects.php',
'BufferingStatsdDataFactory' => __DIR__ . 
'/includes/libs/BufferingStatsdDataFactory.php',
-   'CLDRPluralRuleConverter' => __DIR__ . 
'/languages/utils/CLDRPluralRuleConverter.php',
-   'CLDRPluralRuleConverterExpression' => __DIR__ . 
'/languages/utils/CLDRPluralRuleConverterExpression.php',
-   'CLDRPluralRuleConverterFragment' => __DIR__ . 
'/languages/utils/CLDRPluralRuleConverterFragment.php',
-   'CLDRPluralRuleConverterOperator' => __DIR__ . 
'/languages/utils/CLDRPluralRuleConverterOperator.php',
-   'CLDRPluralRuleError' => __DIR__ . 
'/languages/utils/CLDRPluralRuleError.php',
-   'CLDRPluralRuleEvaluator' => __DIR__ . 
'/languages/utils/CLDRPluralRuleEvaluator.php',
-   'CLDRPluralRuleEvaluatorRange' => __DIR__ . 
'/languages/utils/CLDRPluralRuleEvaluatorRange.php',
'CLIParser' => __DIR__ . '/maintenance/parse.php',
'CSSMin' => __DIR__ . '/includes/libs/CSSMin.php',
'CacheDependency' => __DIR__ . '/includes/cache/CacheDependency.php',
diff --git a/composer.json b/composer.json
index e41b6c7..ba9a892 100644
--- a/composer.json
+++ b/composer.json
@@ -27,6 +27,7 @@
"psr/log": "1.0.0",
"wikimedia/assert": "0.2.2",
"wikimedia/cdb": "1.3.0",
+   "wikimedia/cldr-plural-rule-parser": "1.0.0",
"wikimedia/composer-merge-plugin": "1.2.1",
"wikimedia/ip-set": "1.0.1",
"wikimedia/utfnormal": "1.0.3",
diff --git a/includes/cache/LocalisationCache.php 
b/includes/cache/LocalisationCache.php
index 276e84a..f5b2350 100644
--- a/includes/cache/LocalisationCache.php
+++ b/includes/cache/LocalisationCache.php
@@ -23,6 +23,7 @@
 use Cdb\Exception as CdbException;
 use Cdb\Reader as CdbReader;
 use Cdb\Writer as CdbWriter;
+use CLDRPluralRuleParser\Evaluator;
 
 /**
  * Class for caching the contents of localisation files, Messages*.php
@@ -576,7 +577,7 @@
return null;
}
try {
-   $compiledRules = CLDRPluralRuleEvaluator::compile( 
$rules );
+   $compiledRules = Evaluator::compile( $rules );
} catch ( CLDRPluralRuleError $e ) {
wfDebugLog( 'l10n', $e->getMessage() );
 
diff --git a/languages/Language.php b/languages/Language.php
index 1613536..e6baac0 100644
--- a/languages/Language.php
+++ b/languages/Language.php
@@ -34,6 +34,8 @@
mb_internal_encoding( 'UTF-8' );
 }
 
+use CLDRPluralRuleParser\Evaluator;
+
 /**
  * Internationalisation code
  * @ingroup Language
@@ -4968,7 +4970,7 @@
 */
public function getPluralRuleIndexNumber( $number ) {
$pluralRules = $this->getCompiledPluralRules();
-   $form = CLDRPluralRuleEvaluator::evaluateCompiled( $number, 
$pluralRules );
+   $form = Evaluator::eval

[MediaWiki-commits] [Gerrit] Make middle-clicking badge work - change (mediawiki...Echo)

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

Change subject: Make middle-clicking badge work
..


Make middle-clicking badge work

* Ignore non-left-button click events on initial badge
* Pass href into OOUI badge widget

Bug: T113555
Change-Id: I963aa5193435c46075df6d7204de335b51ecffd4
---
M modules/ext.echo.init.js
M modules/ooui/mw.echo.ui.BadgeLinkWidget.js
M modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
3 files changed, 18 insertions(+), 4 deletions(-)

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



diff --git a/modules/ext.echo.init.js b/modules/ext.echo.init.js
index db77e27..d1ddba9 100644
--- a/modules/ext.echo.init.js
+++ b/modules/ext.echo.init.js
@@ -33,9 +33,14 @@
};
 
// Respond to click on the notification button and load the UI 
on demand
-   $( '.mw-echo-notification-badge-nojs' ).click( function () {
+   $( '.mw-echo-notification-badge-nojs' ).click( function ( e ) {
var myType = $( this ).parent().prop( 'id' ) === 
'pt-notifications-alert' ? 'alert' : 'message',
time = mw.now();
+
+   if ( e.which !== 1 ) {
+   return;
+   }
+
// Dim the button while we load
$( this ).addClass( 
'mw-echo-notifications-badge-dimmed' );
 
@@ -52,7 +57,8 @@
numItems: numMessages,
hasUnseen: hasUnseenMessages,
badgeIcon: 'speechBubble',
-   links: links
+   links: links,
+   href: 
$existingMessageLink.attr( 'href' )
} );
// HACK: avoid late 
debouncedUpdateThemeClasses

mw.echo.ui.messageWidget.badgeButton.debouncedUpdateThemeClasses();
@@ -77,7 +83,8 @@
seen: 'bell',
unseen: 'bellOn'
},
-   links: links
+   links: links,
+   href: $existingAlertLink.attr( 'href' )
} );
// HACK: avoid late debouncedUpdateThemeClasses

mw.echo.ui.alertWidget.badgeButton.debouncedUpdateThemeClasses();
diff --git a/modules/ooui/mw.echo.ui.BadgeLinkWidget.js 
b/modules/ooui/mw.echo.ui.BadgeLinkWidget.js
index 2a7ae68..61b7039 100644
--- a/modules/ooui/mw.echo.ui.BadgeLinkWidget.js
+++ b/modules/ooui/mw.echo.ui.BadgeLinkWidget.js
@@ -15,6 +15,7 @@
 *unseen: 'bellOn',
 *seen: 'bell'
 *  } }
+* @cfg {string} [href] URL the badge links to
 */
mw.echo.ui.BadgeLinkWidget = function MwEchoUiBadgeLinkWidget( config ) 
{
config = config || {};
@@ -30,6 +31,10 @@
OO.ui.mixin.FlaggedElement.call( this, $.extend( {}, config, { 
$flagged: this.$element } ) );
 
this.$element.addClass( 'mw-echo-notifications-badge' );
+
+   if ( config.href !== undefined && OO.ui.isSafeUrl( config.href 
) ) {
+   this.$element.attr( 'href', config.href );
+   }
};
 
OO.inheritClass( mw.echo.ui.BadgeLinkWidget, OO.ui.Widget );
diff --git a/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js 
b/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
index 6418db9..5f6f0ae 100644
--- a/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
+++ b/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
@@ -20,6 +20,7 @@
 *unseen: 'bellOn',
 *seen: 'bell'
 *  } }
+* @cfg {string} [href] URL the badge links to
 */
mw.echo.ui.NotificationBadgeWidget = function 
MwEchoUiNotificationBadgeButtonPopupWidget( config ) {
var buttonFlags, allNotificationsButton, preferencesButton, 
footerButtonGroupWidget, $footer;
@@ -52,7 +53,8 @@
// The following messages can be used here:
// tooltip-pt-notifications-alert
// tooltip-pt-notifications-message
-   title: mw.msg( 'tooltip-pt-notifications-' + this.type )
+   title: mw.msg( 'tooltip-pt-notifications-' + this.type 
),
+   href: config.href
} );
 
// View model

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

G

[MediaWiki-commits] [Gerrit] added Cargo support - change (mediawiki...SafeDelete)

2015-09-24 Thread Cicalese (Code Review)
Cicalese has uploaded a new change for review.

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

Change subject: added Cargo support
..

added Cargo support

Change-Id: I855d1d0635a9b1db01554b89cf4c6b3c1a076e5e
---
M SafeDelete.class.php
M SafeDelete.php
2 files changed, 53 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SafeDelete 
refs/changes/17/240917/1

diff --git a/SafeDelete.class.php b/SafeDelete.class.php
index 8c15faf..80c7eb0 100644
--- a/SafeDelete.class.php
+++ b/SafeDelete.class.php
@@ -53,7 +53,7 @@
$title = Title::newFromURL( $par );
$this->getSkin()->setRelevantTitle( $title );
 
-   if ( class_exists ("SemanticTitle" ) ) {
+   if ( class_exists( "SemanticTitle" ) ) {
$displaytitle = SemanticTitle::getText( $title );
} else {
$displaytitle = $title->getPrefixedText();
@@ -63,12 +63,27 @@
 
$this->getOutput()->addBacklinkSubtitle( $title );
 
-   if ( isset($GLOBALS['SafeDeleteSemantic']) &&
-   $GLOBALS['SafeDeleteSemantic'] === true ) {
+   $done = false;
+
+   $result = array();
+
+   if ( isset( $GLOBALS['SafeDeleteSemantic'] ) &&
+   $GLOBALS['SafeDeleteSemantic'] ) {
 
$result = $this->querySemantic( $title );
+   $done = true;
+   }
 
-   } else {
+   if ( isset( $GLOBALS['SafeDeleteCargo'] ) &&
+   is_array( $GLOBALS['SafeDeleteCargo'] ) &&
+   count( $GLOBALS['SafeDeleteCargo'] ) > 0 ) {
+
+   $result = array_merge( $result,
+   $this->queryCargo( $title, 
$GLOBALS['SafeDeleteCargo'] ) );
+   $done = true;
+   }
+
+   if ( !$done ) {
 
$result = $this->queryNonSemantic( $title );
 
@@ -129,6 +144,39 @@
return $result;
}
 
+   private function queryCargo( $title, $cargo_fields ) {
+
+   $targetpage = $title->getPrefixedText();
+
+   $result = array();
+
+   foreach ( $cargo_fields as $field ) {
+
+   if ( isset( $field[2] ) && $field[2] == true ) {
+   $operator = ' HOLDS ';
+   } else {
+   $operator = ' = ';
+   }
+
+   $query = CargoSQLQuery::newFromValues( $field[0], 
'_pageName',
+   $field[1] . $operator .'"' . $targetpage . '"', 
null,
+   '_pageName', null, null, '' );
+   $rows = $query->run();
+
+   foreach ( $rows as $row ) {
+
+   $sourcepage = $row['_pageName'];
+
+   if ( ( $sourcepage != $targetpage ) &&
+   ! array_key_exists( $targetpage, 
$result ) ) {
+   $result[$sourcepage] = 
Title::newFromText( $sourcepage );
+   }
+   }
+   }
+
+   return $result;
+   }
+
public function queryNonSemantic ( $title ) {
 
$dbr = wfGetDB( DB_SLAVE );
diff --git a/SafeDelete.php b/SafeDelete.php
index 78ec089..7118040 100644
--- a/SafeDelete.php
+++ b/SafeDelete.php
@@ -27,7 +27,7 @@
 
 $wgExtensionCredits['special'][] = array (
'name' => 'Safe Delete',
-   'version' => '1.1',
+   'version' => '1.2',
'author' => '[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]',
'descriptionmsg' => 'safedelete-desc',
'path' => __FILE__,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I855d1d0635a9b1db01554b89cf4c6b3c1a076e5e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SafeDelete
Gerrit-Branch: master
Gerrit-Owner: Cicalese 

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


[MediaWiki-commits] [Gerrit] Use a pre-commit hook for quickInvalidateCache() purges - change (mediawiki...CentralAuth)

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

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

Change subject: Use a pre-commit hook for quickInvalidateCache() purges
..

Use a pre-commit hook for quickInvalidateCache() purges

* This avoids letting the tombstone TTL wither down before anything
  was even committing (for long-running transactions)

Change-Id: I2fd8e5723e18870a6d534be6353e5e4e432d4f8f
---
M includes/CentralAuthUser.php
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/18/240918/1

diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php
index 6753bff..d9bb6ea 100644
--- a/includes/CentralAuthUser.php
+++ b/includes/CentralAuthUser.php
@@ -2682,7 +2682,10 @@
public function quickInvalidateCache() {
wfDebugLog( 'CentralAuthVerbose', "Quick cache invalidation for 
global user {$this->mName}" );
 
-   ObjectCache::getMainWANInstance()->delete( $this->getCacheKey() 
);
+   $key = $this->getCacheKey();
+   self::getCentralDB()->onTransactionPreCommitOrIdle( function() 
use ( $key ) {
+   ObjectCache::getMainWANInstance()->delete( $key );
+   } );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fd8e5723e18870a6d534be6353e5e4e432d4f8f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
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] Puppetize etcd use for eventlogging processor - change (operations/puppet)

2015-09-24 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review.

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

Change subject: Puppetize etcd use for eventlogging processor
..

Puppetize etcd use for eventlogging processor

This will allow eventlogging to consistently hash client IPs even
when parallelized.

Requires that https://gerrit.wikimedia.org/r/#/c/238854/ is deployed.

Bug: T112688
Change-Id: I8ba49df87b4edb080d3e4786b4f884a61ef003e6
---
M manifests/role/eventlogging.pp
M modules/eventlogging/manifests/service/processor.pp
M modules/eventlogging/templates/processor.erb
3 files changed, 19 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/16/240916/1

diff --git a/manifests/role/eventlogging.pp b/manifests/role/eventlogging.pp
index ed25784..203dd6e 100644
--- a/manifests/role/eventlogging.pp
+++ b/manifests/role/eventlogging.pp
@@ -140,9 +140,17 @@
 'eventlogging-00'
 )
 
+# TODO: Not sure of the proper way to get an etcd host/port list out of
+# hiera for use with clients.
+# TODO: etcd cert to use?
+
+$etcd_hosts = hiera('etcd::host')
+$etcd_uri = "http://${etcd_host}:2379";
+
 eventlogging::service::processor { 'server-side-0':
 format => '%{seqId}d EventLogging %j',
 sid=> $kafka_consumer_group,
+etcd_uri   => $etcd_uri,
 input  => 
"${kafka_server_side_raw_uri}&zookeeper_connect=${kafka_zookeeper_url}&${kafka_consumer_args}",
 outputs=> [
 # Write valid events to schema based topics, and
@@ -163,6 +171,7 @@
 eventlogging::service::processor { $client_side_processors:
 format => '%q %{recvFrom}s %{seqId}d %t %h %{userAgent}i',
 input  => 
"${kafka_client_side_raw_uri}&zookeeper_connect=${kafka_zookeeper_url}&${kafka_consumer_args}",
+etcd_uri   => $etcd_uri,
 sid=> $kafka_consumer_group,
 outputs=> [
 $kafka_schema_uri,
diff --git a/modules/eventlogging/manifests/service/processor.pp 
b/modules/eventlogging/manifests/service/processor.pp
index 4c018b4..f460cef 100644
--- a/modules/eventlogging/manifests/service/processor.pp
+++ b/modules/eventlogging/manifests/service/processor.pp
@@ -44,6 +44,11 @@
 #   Specifies the socket ID the processor will use to identify itself
 #   when subscribing to input streams. Defaults to the resource title.
 #
+#
+# [*etcd_uri*]
+#   If given, a shared token in etcd will be used to hash client IPs
+#   for anonymization.
+#
 # [*ensure*]
 #   If 'present' (the default), sets up the processor. If 'absent',
 #   destroys it.
@@ -62,6 +67,7 @@
 $outputs,
 $output_invalid = undef,
 $sid= $title,
+$etcd_uri   = undef,
 $ensure = present,
 ) {
 include ::eventlogging
diff --git a/modules/eventlogging/templates/processor.erb 
b/modules/eventlogging/templates/processor.erb
index ab245db..b1f44a3 100644
--- a/modules/eventlogging/templates/processor.erb
+++ b/modules/eventlogging/templates/processor.erb
@@ -2,6 +2,10 @@
 --sid
 <%= @sid %>
 <% end -%>
+<% if @etcd_uri -%>
+--etcd-uri
+<%= @etcd_uri %>
+<% end -%>
 <%= @format %>
 <%= @input %>
 <%= @outputs.join("\n") %>

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

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

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


[MediaWiki-commits] [Gerrit] Add intermediate metrics for API and ext.echo.ui loading res... - change (mediawiki...Echo)

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

Change subject: Add intermediate metrics for API and ext.echo.ui loading 
response times
..


Add intermediate metrics for API and ext.echo.ui loading response times

And add a FIXME for our existing metric possibly being wrong if the API
request finishes before the ext.echo.ui module is loaded.

Change-Id: I918187dd276193b7602f60527b423ca06cb7e2d0
---
M modules/ext.echo.init.js
1 file changed, 9 insertions(+), 1 deletion(-)

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



diff --git a/modules/ext.echo.init.js b/modules/ext.echo.init.js
index db77e27..e044818 100644
--- a/modules/ext.echo.init.js
+++ b/modules/ext.echo.init.js
@@ -40,7 +40,11 @@
$( this ).addClass( 
'mw-echo-notifications-badge-dimmed' );
 
// Fire the notification API requests
-   apiRequest = new mw.Api( { ajax: { cache: false } } 
).get( $.extend( { notsections: myType }, mw.echo.apiCallParams ) );
+   apiRequest = new mw.Api( { ajax: { cache: false } } 
).get( $.extend( { notsections: myType }, mw.echo.apiCallParams ) )
+   .then( function ( data ) {
+   mw.track( 
'timing.MediaWiki.echo.overlay.api', mw.now() - time );
+   return data;
+   } );
 
// Load the ui
mw.loader.using( 'ext.echo.ui', function () {
@@ -88,9 +92,13 @@
myWidget = myType === 'alert' ? 
mw.echo.ui.alertWidget : mw.echo.ui.messageWidget;
myWidget.populateNotifications( apiRequest 
).then( function () {
// Log timing after notifications are 
shown
+   // FIXME: The notifications might not 
be shown yet if the API
+   // request finished before the UI 
loads, in which case it will
+   // only be shown after the toggle( true 
) call below.
mw.track( 
'timing.MediaWiki.echo.overlay', mw.now() - time );
} );
myWidget.popup.toggle( true );
+   mw.track( 'timing.MediaWiki.echo.overlay.ooui', 
mw.now() - time );
} );
 
if ( hasUnseenAlerts || hasUnseenMessages ) {

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

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

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


[MediaWiki-commits] [Gerrit] Moved all load balancer classes to /loadbalancer - change (mediawiki/core)

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

Change subject: Moved all load balancer classes to /loadbalancer
..


Moved all load balancer classes to /loadbalancer

* Also split out LBFactory classes to their own files

Change-Id: I9e649878afcffdb736c09c0574e5f99b1e72382f
---
M autoload.php
R includes/db/loadbalancer/LBFactory.php
A includes/db/loadbalancer/LBFactoryFake.php
R includes/db/loadbalancer/LBFactoryMulti.php
A includes/db/loadbalancer/LBFactorySimple.php
R includes/db/loadbalancer/LBFactorySingle.php
R includes/db/loadbalancer/LoadBalancer.php
R includes/db/loadbalancer/LoadMonitor.php
R includes/db/loadbalancer/LoadMonitorMySQL.php
9 files changed, 216 insertions(+), 172 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/autoload.php b/autoload.php
index e5e7cda..a2e5104 100644
--- a/autoload.php
+++ b/autoload.php
@@ -283,7 +283,7 @@
'CsvStatsOutput' => __DIR__ . '/maintenance/language/StatOutputs.php',
'CurlHttpRequest' => __DIR__ . '/includes/HttpFunctions.php',
'DBAccessBase' => __DIR__ . '/includes/dao/DBAccessBase.php',
-   'DBAccessError' => __DIR__ . '/includes/db/LBFactory.php',
+   'DBAccessError' => __DIR__ . '/includes/db/loadbalancer/LBFactory.php',
'DBAccessObjectUtils' => __DIR__ . 
'/includes/dao/DBAccessObjectUtils.php',
'DBConnRef' => __DIR__ . '/includes/db/DBConnRef.php',
'DBConnectionError' => __DIR__ . '/includes/db/DatabaseError.php',
@@ -611,11 +611,11 @@
'JsonContentHandler' => __DIR__ . 
'/includes/content/JsonContentHandler.php',
'KkConverter' => __DIR__ . '/languages/classes/LanguageKk.php',
'KuConverter' => __DIR__ . '/languages/classes/LanguageKu.php',
-   'LBFactory' => __DIR__ . '/includes/db/LBFactory.php',
-   'LBFactoryFake' => __DIR__ . '/includes/db/LBFactory.php',
-   'LBFactoryMulti' => __DIR__ . '/includes/db/LBFactoryMulti.php',
-   'LBFactorySimple' => __DIR__ . '/includes/db/LBFactory.php',
-   'LBFactorySingle' => __DIR__ . '/includes/db/LBFactorySingle.php',
+   'LBFactory' => __DIR__ . '/includes/db/loadbalancer/LBFactory.php',
+   'LBFactoryFake' => __DIR__ . 
'/includes/db/loadbalancer/LBFactoryFake.php',
+   'LBFactoryMulti' => __DIR__ . 
'/includes/db/loadbalancer/LBFactoryMulti.php',
+   'LBFactorySimple' => __DIR__ . 
'/includes/db/loadbalancer/LBFactorySimple.php',
+   'LBFactorySingle' => __DIR__ . 
'/includes/db/loadbalancer/LBFactorySingle.php',
'LCStore' => __DIR__ . '/includes/cache/LocalisationCache.php',
'LCStoreCDB' => __DIR__ . '/includes/cache/LocalisationCache.php',
'LCStoreDB' => __DIR__ . '/includes/cache/LocalisationCache.php',
@@ -686,11 +686,11 @@
'ListDuplicatedFilesPage' => __DIR__ . 
'/includes/specials/SpecialListDuplicatedFiles.php',
'ListVariants' => __DIR__ . '/maintenance/language/listVariants.php',
'ListredirectsPage' => __DIR__ . 
'/includes/specials/SpecialListredirects.php',
-   'LoadBalancer' => __DIR__ . '/includes/db/LoadBalancer.php',
-   'LoadBalancerSingle' => __DIR__ . '/includes/db/LBFactorySingle.php',
-   'LoadMonitor' => __DIR__ . '/includes/db/LoadMonitor.php',
-   'LoadMonitorMySQL' => __DIR__ . '/includes/db/LoadMonitorMySQL.php',
-   'LoadMonitorNull' => __DIR__ . '/includes/db/LoadMonitor.php',
+   'LoadBalancer' => __DIR__ . 
'/includes/db/loadbalancer/LoadBalancer.php',
+   'LoadBalancerSingle' => __DIR__ . 
'/includes/db/loadbalancer/LBFactorySingle.php',
+   'LoadMonitor' => __DIR__ . '/includes/db/loadbalancer/LoadMonitor.php',
+   'LoadMonitorMySQL' => __DIR__ . 
'/includes/db/loadbalancer/LoadMonitorMySQL.php',
+   'LoadMonitorNull' => __DIR__ . 
'/includes/db/loadbalancer/LoadMonitor.php',
'LocalFile' => __DIR__ . '/includes/filerepo/file/LocalFile.php',
'LocalFileDeleteBatch' => __DIR__ . 
'/includes/filerepo/file/LocalFile.php',
'LocalFileMoveBatch' => __DIR__ . 
'/includes/filerepo/file/LocalFile.php',
diff --git a/includes/db/LBFactory.php b/includes/db/loadbalancer/LBFactory.php
similarity index 61%
rename from includes/db/LBFactory.php
rename to includes/db/loadbalancer/LBFactory.php
index cf522b2..da0fe44 100644
--- a/includes/db/LBFactory.php
+++ b/includes/db/loadbalancer/LBFactory.php
@@ -216,167 +216,6 @@
 }
 
 /**
- * A simple single-master LBFactory that gets its configuration from the b/c 
globals
- */
-class LBFactorySimple extends LBFactory {
-   /** @var LoadBalancer */
-   private $mainLB;
-
-   /** @var LoadBalancer[] */
-   private $extLBs = array();
-
-   /** @var ChronologyProtector */
-   private $chronProt;
-
-   public function __construct( array $conf ) {
-   $this->chronProt = new ChronologyProtector;
-   }
-
-   /**
-* @param bool|string $wiki
-  

[MediaWiki-commits] [Gerrit] Raise account creation throttle for editathon at UC Berkeley - change (operations/mediawiki-config)

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

Change subject: Raise account creation throttle for editathon at UC Berkeley
..


Raise account creation throttle for editathon at UC Berkeley

NetName:UCC-PRO-UCB
Organization:   University of California at Berkeley (UCAB)

This is *.CalVisitor.Berkeley.EDU 

Bug: T113654
Change-Id: I7e9068f3255738717634bb57083f3bdc0bf1221a
---
M wmf-config/throttle.php
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php
index e7d05e5..9dc3a5d 100644
--- a/wmf-config/throttle.php
+++ b/wmf-config/throttle.php
@@ -41,6 +41,13 @@
'value'  => 200
 );
 
+$wmgThrottlingExceptions[] = array( // T113654
+   'from'   => '2015-09-26T11:00 -7:00',
+   'to' => '2015-09-26T14:00 -7:00',
+   'range'  => '192.31.105.0/24',
+   'value'  => 50
+);
+
 ## Add throttling definitions above.
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e9068f3255738717634bb57083f3bdc0bf1221a
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Alex Monk 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Double or triple quotes terminate autolinks - change (mediawiki...parsoid)

2015-09-24 Thread Cscott (Code Review)
Cscott has uploaded a new change for review.

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

Change subject: Double or triple quotes terminate autolinks
..

Double or triple quotes terminate autolinks

Bug: T113666
Change-Id: I3109754fd8daca7395930db68e693ff8a1fc7de9
---
M lib/pegTokenizer.pegjs.txt
M tests/parserTests.txt
2 files changed, 17 insertions(+), 1 deletion(-)


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

diff --git a/lib/pegTokenizer.pegjs.txt b/lib/pegTokenizer.pegjs.txt
index fbe20c6..52fbd5e 100644
--- a/lib/pegTokenizer.pegjs.txt
+++ b/lib/pegTokenizer.pegjs.txt
@@ -546,7 +546,8 @@
   { return c; }
 )
 / "(" { stops.onStack('autourl').sawLParen = true; return "("; }
-/ s:[.:,']  { return s; }
+/ [.:,]
+/ $(['] ![']) // single quotes are ok, double quotes are bad
 / comment
 / tplarg_or_template
 / ! ( "&" ( [lL][tT] / [gG][tT] ) ";" )
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 4abcfc3..9b191f9 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -4679,6 +4679,21 @@
 !! end
 
 !! test
+External links: Free with trailing quotes (T113666)
+!! wikitext
+'''News:''' Stuff here
+
+news:'a'b''c''d e
+!! html/php
+News: Stuff here
+news:'a'bcd e
+
+!! html/parsoid
+News: Stuff here
+news:'a'bcd e
+!! end
+
+!! test
 External links: Lone protocols are never linked (T105697)
 !! wikitext
 http://

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3109754fd8daca7395930db68e693ff8a1fc7de9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott 

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


[MediaWiki-commits] [Gerrit] Refactored global state out of EnqueueableDataUpdate - change (mediawiki/core)

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

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

Change subject: Refactored global state out of EnqueueableDataUpdate
..

Refactored global state out of EnqueueableDataUpdate

* Follow-up 25a44aa3e4fa
* The static DataUpdate::enqueueUpdates() method will
  deal with JobQueueGroup construction instead

Change-Id: Id7741a770cee81fdc3f61804b7574ccf737bc338
---
M includes/deferred/DataUpdate.php
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/14/240914/1

diff --git a/includes/deferred/DataUpdate.php b/includes/deferred/DataUpdate.php
index f5d6845..a40644e 100644
--- a/includes/deferred/DataUpdate.php
+++ b/includes/deferred/DataUpdate.php
@@ -134,7 +134,8 @@
 
foreach ( $updates as $update ) {
if ( $update instanceof EnqueueableDataUpdate ) {
-   $update->enqueueUpdate();
+   $spec = $update->getAsJobSpecification();
+   JobQueueGroup::singleton( $spec['wiki'] 
)->push( $spec['job'] );
} else {
$remaining[] = $update;
}
@@ -145,11 +146,16 @@
 }
 
 /**
+ * Interface that marks a DataUpdate as enqueuable via the JobQueue
+ *
+ * Such updates must be representable using IJobSpecification, so that
+ * they can be serialized into jobs and enqueued for later execution
+ *
  * @since 1.26
  */
 interface EnqueueableDataUpdate {
/**
-* Push the update into the job queue
+* @return array (wiki => wiki ID, job => IJobSpecification)
 */
-   public function enqueueUpdate();
+   public function getAsJobSpecification();
 }
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7741a770cee81fdc3f61804b7574ccf737bc338
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] Updated key WANObjectCache::delete() callers to avoid races - change (mediawiki/core)

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

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

Change subject: Updated key WANObjectCache::delete() callers to avoid races
..

Updated key WANObjectCache::delete() callers to avoid races

* They now issue the delete() write before COMMIT of
  the relevant DB (or immediately if no trx is active)
* This can avoid some stale write race conditions
* Updated the WAN cache delete() docs

Change-Id: Id54887976051120b76528070d5f2ceb357d57897
---
M includes/User.php
M includes/UserRightsProxy.php
M includes/filerepo/LocalRepo.php
M includes/filerepo/file/LocalFile.php
M includes/libs/objectcache/WANObjectCache.php
5 files changed, 43 insertions(+), 15 deletions(-)


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

diff --git a/includes/User.php b/includes/User.php
index d57dfaa..753061d 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -2290,10 +2290,14 @@
 */
public function clearSharedCache() {
$id = $this->getId();
-   if ( $id ) {
-   $key = wfMemcKey( 'user', 'id', $id );
-   ObjectCache::getMainWANInstance()->delete( $key );
+   if ( !$id ) {
+   return;
}
+
+   $key = wfMemcKey( 'user', 'id', $id );
+   wfGetDB( DB_MASTER )->onTransactionPreCommitOrIdle( function() 
use ( $key ) {
+   ObjectCache::getMainWANInstance()->delete( $key );
+   } );
}
 
/**
diff --git a/includes/UserRightsProxy.php b/includes/UserRightsProxy.php
index a19f698..2c7032f 100644
--- a/includes/UserRightsProxy.php
+++ b/includes/UserRightsProxy.php
@@ -278,8 +278,9 @@
array( 'user_id' => $this->id ),
__METHOD__ );
 
-   $cache = ObjectCache::getMainWANInstance();
$key = wfForeignMemcKey( $this->database, false, 'user', 'id', 
$this->id );
-   $cache->delete( $key );
+   $this->db->onTransactionPreCommitOrIdle( function() use ( $key 
) {
+   ObjectCache::getMainWANInstance()->delete( $key );
+   } );
}
 }
diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php
index 6a2c064..b209bd6 100644
--- a/includes/filerepo/LocalRepo.php
+++ b/includes/filerepo/LocalRepo.php
@@ -521,15 +521,11 @@
 * @return void
 */
function invalidateImageRedirect( Title $title ) {
-   $cache = ObjectCache::getMainWANInstance();
-
-   $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( 
$title->getDBkey() ) );
-   if ( $memcKey ) {
-   // Set a temporary value for the cache key, to ensure
-   // that this value stays purged long enough so that
-   // it isn't refreshed with a stale value due to a
-   // lagged slave.
-   $cache->delete( $memcKey, 12 );
+   $key = $this->getSharedCacheKey( 'image_redirect', md5( 
$title->getDBkey() ) );
+   if ( $key ) {
+   $this->getMasterDB()->onTransactionPreCommitOrIdle( 
function() use ( $key ) {
+   ObjectCache::getMainWANInstance()->delete( $key 
);
+   } );
}
}
 
diff --git a/includes/filerepo/file/LocalFile.php 
b/includes/filerepo/file/LocalFile.php
index 4c9c2aa..3225d78 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -321,7 +321,9 @@
return;
}
 
-   ObjectCache::getMainWANInstance()->delete( $key );
+   $this->repo->getMasterDB()->onTransactionPreCommitOrIdle( 
function() use ( $key ) {
+   ObjectCache::getMainWANInstance()->delete( $key );
+   } );
}
 
/**
diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index 41dc66f..6134ed6 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -284,6 +284,31 @@
 *   - a) Replication lag is bounded to being less than HOLDOFF_TTL; or
 *   - b) If lag is higher, the DB will have gone into read-only mode 
already
 *
+* When using potentially long-running ACID transactions, a good 
pattern is
+* to use a pre-commit hook to issue the delete. This means that 
immediately
+* after commit, callers will see the tombstone in cache in the local 
datacenter
+* and in the others upon relay. It also avoids the following race 
condition:
+*   - a) T1 begins, changes a row, and calls delete()
+*   - b) The HOLDOFF_TTL passes, expiring the delete() tombstone
+

[MediaWiki-commits] [Gerrit] De-decorate inside_git_dir - change (mediawiki...scap)

2015-09-24 Thread Thcipriani (Code Review)
Thcipriani has uploaded a new change for review.

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

Change subject: De-decorate inside_git_dir
..

De-decorate inside_git_dir

Moves inside_git_dir from fragile decorator to `ensure_git_dir` utility
function. Saves an import, saves SLOC, saves brainpower.

Change-Id: Ic85b0534869f656008db6279294634ae68150acc
---
M scap/tasks.py
M scap/utils.py
2 files changed, 11 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/scap 
refs/changes/12/240912/1

diff --git a/scap/tasks.py b/scap/tasks.py
index 111..122a48f 100644
--- a/scap/tasks.py
+++ b/scap/tasks.py
@@ -574,17 +574,17 @@
 return restart.progress('restart_hhvm').run(batch_size=batch_size)
 
 
-@utils.inside_git_dir
 def git_remote_exists(location, remote):
 """Check if remote exists in location"""
+utils.ensure_git_dir(location)
 with utils.cd(location):
 cmd = '/usr/bin/git config --local --get remote.{}.url'.format(remote)
 return subprocess.call(cmd, shell=True) == 0
 
 
-@utils.inside_git_dir
 def git_remote_set(location, repo, remote='origin', user='mwdeploy'):
 """set the remote at location to repo"""
+utils.ensure_git_dir(location)
 with utils.cd(location):
 if git_remote_exists(location, remote):
 cmd = '/usr/bin/git remote rm {}'.format(remote)
@@ -607,10 +607,11 @@
 utils.sudo_check_call(user, cmd)
 
 
-@utils.inside_git_dir
 def git_checkout(location, rev, submodules=False, user="mwdeploy"):
 """Checkout a git repo sha at a location as a user
 """
+utils.ensure_git_dir(location)
+
 logger = logging.getLogger('git_checkout')
 with utils.cd(location):
 logger.debug(
@@ -638,13 +639,13 @@
 subprocess.check_call(cmd, shell=True)
 
 
-@utils.inside_git_dir
 def git_update_deploy_head(deploy_info, location):
 """updates .git/DEPLOY_HEAD file
 
 :param deploy_info: current deploy info to write to file as JSON
 :param (optional) location: git directory location (default cwd)
 """
+utils.ensure_git_dir(location)
 logger = logging.getLogger('git_deploy_file')
 
 with utils.cd(location):
@@ -655,10 +656,10 @@
 f.close()
 
 
-@utils.inside_git_dir
 def git_tag_repo(deploy_info, location=os.getcwd()):
 """creates new tag in deploy repo"""
 
+utils.ensure_git_dir(location)
 with utils.cd(location):
 cmd = """
 /usr/bin/git tag -fa \\
diff --git a/scap/utils.py b/scap/utils.py
index 77eccd2..b356406 100644
--- a/scap/utils.py
+++ b/scap/utils.py
@@ -9,7 +9,6 @@
 import errno
 import fcntl
 import hashlib
-import inspect
 import json
 import logging
 import os
@@ -550,32 +549,9 @@
 raise IOError(e.errno, e.strerror, path)
 
 
-def inside_git_dir(func):
-"""Decorator to determine if the "location" argument is a git directory"""
-def wrapper(*args, **kwargs):
-argspec = inspect.getargspec(func)
-try:
-l = args[argspec.args.index('location')]
-except IndexError:
-l = None
-
-if l is None:
-d = None
-
-if argspec.defaults is not None:
-defaults = dict(zip(
-argspec.args[-len(argspec.defaults):],
-argspec.defaults
-))
-d = defaults.get('location')
-
-l = kwargs.get('location', d)
-
-if l is None or not is_git_dir(l):
-raise IOError(errno.ENOENT, 'Location is not a git repo', l)
-
-return func(*args, **kwargs)
-return wrapper
+def ensure_git_dir(location):
+if location is None or not is_git_dir(location):
+raise IOError(errno.ENOENT, 'Location is not a git repo', location)
 
 
 def is_git_dir(path):
@@ -594,17 +570,17 @@
 sudo_check_call(user, "mkdir -p '{}'".format(path), logger=logger)
 
 
-@inside_git_dir
 def git_sha(location, rev):
 """Returns SHA1 for things like HEAD or HEAD~~"""
+ensure_git_dir(location)
 with cd(location):
 cmd = '/usr/bin/git rev-parse --verify {}'.format(rev)
 return subprocess.check_output(cmd, shell=True).strip()
 
 
-@inside_git_dir
 def git_next_deploy_tag(location, user=get_real_username()):
 """Calculates the scap/sync/{date}/{n} tag to use for this deployment"""
+ensure_git_dir(location)
 with cd(location):
 timestamp = datetime.utcnow()
 date = timestamp.strftime('%F')

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic85b0534869f656008db6279294634ae68150acc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/scap
Gerrit-Branch: master
Gerrit-Owner: Thcipriani 

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

[MediaWiki-commits] [Gerrit] Allow autolinking ISBN/PMID/RFC inside list items - change (mediawiki...VisualEditor)

2015-09-24 Thread Cscott (Code Review)
Cscott has uploaded a new change for review.

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

Change subject: Allow autolinking ISBN/PMID/RFC inside list items
..

Allow autolinking ISBN/PMID/RFC inside list items

Depends on I18b73514e5a3d967cce02d9706a11e30ede71d9a in ve core.

Bug: T113535
Change-Id: Ifc749951a6e92e19a7eb27ed631f8ba11d88a5cf
---
M modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js 
b/modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js
index 9b4a363..e8f7bb5 100644
--- a/modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js
+++ b/modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js
@@ -137,5 +137,5 @@
// link in #autolinkMagicLink above.
// The trailing \S* covers any trailing punctuation, which will be
// stripped before validating the link.
-   new ve.ui.Sequence( 'autolinkMagicLink', 'autolinkMagicLink', 
/\b(RFC|PMID|ISBN)\s+[0-9]([- 0-9]*[0-9Xx])?\S*(\s|\n\n)$/, 0, true )
+   new ve.ui.Sequence( 'autolinkMagicLink', 'autolinkMagicLink', 
/\b(RFC|PMID|ISBN)\s+[0-9]([- 0-9]*[0-9Xx])?\S*(\s|\n+)$/, 0, true )
 );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc749951a6e92e19a7eb27ed631f8ba11d88a5cf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cscott 

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


[MediaWiki-commits] [Gerrit] Allow autolinking inside list items - change (VisualEditor/VisualEditor)

2015-09-24 Thread Cscott (Code Review)
Cscott has uploaded a new change for review.

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

Change subject: Allow autolinking inside list items
..

Allow autolinking inside list items

Bug: T113535
Change-Id: I18b73514e5a3d967cce02d9706a11e30ede71d9a
---
M src/ui/actions/ve.ui.LinkAction.js
M src/ui/ve.ui.SequenceRegistry.js
2 files changed, 16 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/10/240910/1

diff --git a/src/ui/actions/ve.ui.LinkAction.js 
b/src/ui/actions/ve.ui.LinkAction.js
index 13a8c92..e10bcd0 100644
--- a/src/ui/actions/ve.ui.LinkAction.js
+++ b/src/ui/actions/ve.ui.LinkAction.js
@@ -187,7 +187,7 @@
 
ve.ui.LinkAction.static.autolinkRegExp =
new RegExp(
-   '\\b' + 
ve.init.platform.getUnanchoredExternalLinkUrlProtocolsRegExp().source + 
'\\S+(\\s|\\n\\n)$',
+   '\\b' + 
ve.init.platform.getUnanchoredExternalLinkUrlProtocolsRegExp().source + 
'\\S+(\\s|\\n+)$',
'i'
);
 
diff --git a/src/ui/ve.ui.SequenceRegistry.js b/src/ui/ve.ui.SequenceRegistry.js
index edd7085..6493a0e 100644
--- a/src/ui/ve.ui.SequenceRegistry.js
+++ b/src/ui/ve.ui.SequenceRegistry.js
@@ -48,17 +48,27 @@
  *   for each.
  */
 ve.ui.SequenceRegistry.prototype.findMatching = function ( data, offset ) {
-   var textStart, plaintext, name, range, sequences = [];
+   var textStart, plaintext, name, range, mode = 0, sequences = [];
// To avoid blowup when matching RegExp sequences, we're going to grab
// all the plaintext to the left (until the nearest node) *once* and 
pass
// it to each sequence matcher.  We're also going to hard-limit that
// plaintext to 256 characters to ensure we don't run into O(N^2)
// slowdown when inserting N characters of plain text.
+
+   // First skip over open elements, then close elements, to ensure that
+   // pressing enter after a (possibly nested) list item or inside a
+   // paragraph works properly.  Typing "foo\n" inside a paragraph creates
+   // "foo" in the content model, and typing "foo\n" inside a list
+   // creates "foo" -- we want to give the matcher a
+   // chance to match "foo\n+" in these cases.
for ( textStart = offset - 1; textStart >= 0 && ( offset - textStart ) 
<= 256; textStart-- ) {
-   // Ignore an element if it occurs in the last two context 
characters.
-   // Typing "foo\n" creates "foo" in the data model, and 
we want
-   // to give the matcher a chance against it.
-   if ( data.isElementData( textStart ) && ( offset - textStart ) 
> 2 ) {
+   if ( mode === 0 && !data.isOpenElementData( textStart ) ) {
+   mode++;
+   }
+   if ( mode === 1 && !data.isCloseElementData( textStart ) ) {
+   mode++;
+   }
+   if ( mode === 2 && data.isElementData( textStart ) ) {
break;
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I18b73514e5a3d967cce02d9706a11e30ede71d9a
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cscott 

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


[MediaWiki-commits] [Gerrit] Update seen time only if the popup is actually open - change (mediawiki...Echo)

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

Change subject: Update seen time only if the popup is actually open
..


Update seen time only if the popup is actually open

The notifications can be populated from the popup and outside of it.
We should update the seen time only if the request came from the popup
itself, and only if it is still open by the time the api request
has finished.

Bug: T113645
Change-Id: Id91ddabb85fd582be1890ea420d0559e0cdca167
---
M modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
1 file changed, 9 insertions(+), 7 deletions(-)

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



diff --git a/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js 
b/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
index 6418db9..ef4633c 100644
--- a/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
+++ b/modules/ooui/mw.echo.ui.NotificationBadgeWidget.js
@@ -263,12 +263,6 @@
return 
widget.notificationsModel.markAllRead();
}
} )
-   .then( function () {
-   if ( widget.popup.isVisible() ) {
-   // Update seen time
-   
widget.notificationsModel.updateSeenTime();
-   }
-   } )
.then(
// Success
function () {
@@ -300,6 +294,8 @@
 * Extend the response to button click so we can also update the 
notification list.
 */
mw.echo.ui.NotificationBadgeWidget.prototype.onPopupToggle = function ( 
isVisible ) {
+   var widget = this;
+
if ( !isVisible ) {
// If the popup is closing, remove "initiallyUnseen" 
and leave
this.notificationsWidget.resetNotificationItems();
@@ -325,7 +321,13 @@
}
// Always populate on popup open. The model and widget should 
handle
// the case where the promise is already underway.
-   this.populateNotifications();
+   this.populateNotifications()
+   .then( function () {
+   if ( widget.popup.isVisible() ) {
+   // Update seen time
+   
widget.notificationsModel.updateSeenTime();
+   }
+   } );
this.hasRunFirstTime = true;
};
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id91ddabb85fd582be1890ea420d0559e0cdca167
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 
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] Family defined Site interface - change (pywikibot/core)

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

Change subject: Family defined Site interface
..


Family defined Site interface

Allow Family class to determine the appropriate Site class
to be used.

It is usable for supporting extensions, using
Site classes composed of several APISite subclasses.

It can also be used for the special case of Sites
which are for a code that is no longer online.

The Family.from_url cache now stores the Family object
instead of the family name, to reduce the number of
Family.load calls.

Change-Id: Ia9f141b9e9f493aa2b1c42afcf4daa8049656c10
---
M pywikibot/__init__.py
M pywikibot/families/wikidata_family.py
M pywikibot/family.py
M pywikibot/site.py
M tests/aspects.py
M tests/site_tests.py
M tests/utils.py
7 files changed, 57 insertions(+), 17 deletions(-)

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



diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 290a925..b75fa13 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -567,7 +567,7 @@
 family = pywikibot.family.Family.load(fam)
 code = family.from_url(url)
 if code is not None:
-matched_sites += [(code, fam)]
+matched_sites += [(code, family)]
 
 if matched_sites:
 if len(matched_sites) > 1:
@@ -590,7 +590,11 @@
 # Fallback to config defaults
 code = code or config.mylang
 fam = fam or config.family
-interface = interface or config.site_interface
+
+if not isinstance(fam, pywikibot.family.Family):
+fam = pywikibot.family.Family.load(fam)
+
+interface = interface or fam.interface(code)
 
 # config.usernames is initialised with a dict for each family name
 family_name = str(fam)
diff --git a/pywikibot/families/wikidata_family.py 
b/pywikibot/families/wikidata_family.py
index b7a2786..2177b90 100644
--- a/pywikibot/families/wikidata_family.py
+++ b/pywikibot/families/wikidata_family.py
@@ -37,6 +37,10 @@
 'wikidata': ('wikidata', 'test')
 })
 
+def interface(self, code):
+"""Return 'DataSite'."""
+return 'DataSite'
+
 def shared_data_repository(self, code, transcluded=False):
 """
 Indicate Wikidata is both a repository and its own client.
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 72753f0..921b7a6 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -1098,6 +1098,20 @@
 def nice_get_address(self, code, title):
 return '%s%s' % (self.nicepath(code), title)
 
+def interface(self, code):
+"""
+Return interface to use for code.
+
+@rtype: str or subclass of BaseSite
+"""
+if code in self.interwiki_removals:
+if code in self.codes:
+pywikibot.warn('Interwiki removal %s is in %s codes'
+   % (code, self))
+return 'RemovedSite'
+
+return config.site_interface
+
 # List of codes which aren't returned by from_url; True returns None always
 _ignore_from_url = []
 
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 98de171..2d5bfc0 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -900,7 +900,8 @@
 
 def __repr__(self):
 """Return internal representation."""
-return 'Site("%s", "%s")' % (self.code, self.family.name)
+return '{0}("{1}", "{2}")'.format(
+self.__class__.__name__, self.code, self.family)
 
 def __hash__(self):
 """Return hashable key."""
@@ -1729,6 +1730,15 @@
 def __repr__(self):
 """Return a representation of the internal tokens dictionary."""
 return self._tokens.__repr__()
+
+
+class RemovedSite(BaseSite):
+
+"""Site removed from a family."""
+
+def __init__(self, code, fam, user=None, sysop=None):
+"""Constructor."""
+super(RemovedSite, self).__init__(code, fam, user, sysop)
 
 
 class NonMWAPISite(BaseSite):
@@ -6450,10 +6460,6 @@
 f.__doc__ = method.__doc__
 return f
 return super(APISite, self).__getattr__(attr)
-
-def __repr__(self):
-"""Return internal representation."""
-return 'DataSite("%s", "%s")' % (self.code, self.family.name)
 
 @deprecated("pywikibot.PropertyPage")
 def _get_propertyitem(self, props, source, **params):
diff --git a/tests/aspects.py b/tests/aspects.py
index fa0e486..0503077 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -49,7 +49,7 @@
 from pywikibot.exceptions import ServerError, NoUsername
 from pywikibot.family import WikimediaFamily
 from pywikibot.site import BaseSite
-from pywikibot.tools import PY2
+from pywikibot.tools import PY2, StringTypes
 
 import tests
 
@@ -106,6 +106,21 @@
 sys.stdout.flush()
 result.addSuccess(self)
 
+def assertMethod(sel

[MediaWiki-commits] [Gerrit] jquery.tablesorter: Improve detection and handling of isoDate - change (mediawiki/core)

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

Change subject: jquery.tablesorter: Improve detection and handling of isoDate
..


jquery.tablesorter: Improve detection and handling of isoDate

Bug: T54842
Change-Id: I193870dcc97477a4fd52a75d3beb9db21e64f171
---
M resources/src/jquery/jquery.tablesorter.js
M tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
M tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
3 files changed, 83 insertions(+), 4 deletions(-)

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



diff --git a/resources/src/jquery/jquery.tablesorter.js 
b/resources/src/jquery/jquery.tablesorter.js
index eaa138b..f6857e8 100644
--- a/resources/src/jquery/jquery.tablesorter.js
+++ b/resources/src/jquery/jquery.tablesorter.js
@@ -740,7 +740,8 @@
new RegExp( /(https?|ftp|file):\/\// )
],
isoDate: [
-   new RegExp( /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/ 
)
+   new RegExp( 
/^([-+]?\d{1,4})-([01]\d)-([0-3]\d)([T\s]((([01]\d|2[0-3])(:?[0-5]\d)?|24:?00)?(:?([0-5]\d))?([.,]\d+)?)([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?/
 ),
+   new RegExp( 
/^([-+]?\d{1,4})-([01]\d)-([0-3]\d)/ )
],
usLongDate: [
new RegExp( /^[A-Za-z]{3,10}\.? [0-9]{1,2}, 
([0-9]{4}|'?[0-9]{2}) 
(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/ )
@@ -1153,8 +1154,20 @@
return ts.rgx.isoDate[ 0 ].test( s );
},
format: function ( s ) {
-   return $.tablesorter.formatFloat( ( s !== '' ) ? new 
Date( s.replace(
-   new RegExp( /-/g ), '/' ) ).getTime() : '0' );
+   var isodate,
+   matches;
+   if ( !Date.prototype.toISOString ) {
+   // Old browsers don't understand iso, Fallback 
to US date parsing and ignore the time part.
+   matches = $.trim( s ).match( ts.rgx.isoDate[ 1 
] );
+   if ( matches ) {
+   isodate = new Date( matches[ 2 ]  + '/' 
+ matches[ 3 ] + '/' + matches[ 1 ] );
+   } else {
+   return $.tablesorter.formatFloat( 0 );
+   }
+   } else {
+   isodate = new Date( $.trim( s ) );
+   }
+   return $.tablesorter.formatFloat( ( isodate !== 
undefined ) ? isodate.getTime() : 0 );
},
type: 'numeric'
} );
diff --git 
a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js 
b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
index 032551d..1726a48 100644
--- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
+++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
@@ -5,7 +5,7 @@
 */
 
var text, ipv4,
-   simpleMDYDatesInMDY, simpleMDYDatesInDMY, oldMDYDates, 
complexMDYDates, clobberedDates, MYDates, YDates,
+   simpleMDYDatesInMDY, simpleMDYDatesInDMY, oldMDYDates, 
complexMDYDates, clobberedDates, MYDates, YDates, ISODates,
currencyData, transformedCurrencyData;
 
QUnit.module( 'jquery.tablesorter.parsers', QUnit.newMwEnvironment( {
@@ -173,6 +173,41 @@
];
parserTest( 'Y Dates', 'date', YDates );
 
+   ISODates = [
+   [ '2000',   false, 94668480, 'Plain 4-digit 
year' ],
+   [ '2000-01',false, 94668480, 'Year with month' 
],
+   [ '2000-01-01', true, 94668480, 'Year with month and day' ],
+   [ '2000-13-01', true, 0, 'Non existant month' ],
+   [ '2000-01-32', true, 0, 'Non existant day' ],
+   [ '2000-01-01T12:30:30',true, 94672983, 
'Date with a time' ],
+   [ '2000-01-01T12:30:30Z',   true, 94672983, 'Date with 
a UTC+0 time' ],
+   [ '2000-01-01T24:30:30Z',   true, 0, 'Date with invalid 
hours' ],
+   [ '2000-01-01T12:60:30Z',   true, 0, 'Date with invalid 
minutes' ],
+   [ '2000-01-01T12:30:61Z',   true, 0, 'Date with invalid 
amount of seconds' ],
+   [ '2000-01-01T23:59:59Z',   true, 946771199000, 'Edges of 
time' ],
+   [ '2000-01-01T12:30:30.111Z',   true, 946729830111, 'Date with 
milliseconds' ],
+   [ '2000-01-01T12:30:30.1Z', true, 946729830111, 'Date with 
too high precision' ],
+   [ '2000-01-01T12:30:30,111Z',   true,

[MediaWiki-commits] [Gerrit] Don't close Amazon order reference in DI - change (mediawiki...DonationInterface)

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

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

Change subject: Don't close Amazon order reference in DI
..

Don't close Amazon order reference in DI

We're keeping donors waiting an extra 3.3 seconds before thanking
them.  Let's do this async.  Maybe another action for the IPN
listener?

Change-Id: I0609ac0b6e9245d00f79b39a3b9d87ff24c45520
---
M amazon_gateway/amazon.adapter.php
1 file changed, 0 insertions(+), 12 deletions(-)


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

diff --git a/amazon_gateway/amazon.adapter.php 
b/amazon_gateway/amazon.adapter.php
index 88a5393..f05d494 100644
--- a/amazon_gateway/amazon.adapter.php
+++ b/amazon_gateway/amazon.adapter.php
@@ -331,21 +331,9 @@
$captureState = $captureDetails['CaptureStatus']['State'];
$this->transaction_response->setTxnMessage( $captureState );
 
-   // TODO: verify that this does not prevent us from refunding.
-   $this->closeOrderReference();
-
$this->finalizeInternalStatus( 
$this->capture_status_map[$captureState] );
$this->runPostProcessHooks();
$this->deleteLimboMessage( 'pending' );
-   }
-
-   protected function closeOrderReference() {
-   $orderReferenceId = $this->getData_Staged( 'order_reference_id' 
);
-
-   $this->logger->info( "Closing order $orderReferenceId" );
-   $this->callPwaClient( 'closeOrderReference', array(
-   'amazon_order_reference_id' => $orderReferenceId,
-   ) );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0609ac0b6e9245d00f79b39a3b9d87ff24c45520
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
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] Don't error when trying to re-use a reference as itself. - change (mediawiki...VisualEditor)

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

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

Change subject: Don't error when trying to re-use a reference as itself.
..

Don't error when trying to re-use a reference as itself.

Bug: T90476
Change-Id: I0e2cafa885f5606c4f6611529f11de4fa6f7aedf
---
M modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
index 2dfad31..91c44e3 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
@@ -273,7 +273,7 @@
 
group = this.getFragment().getDocument().getInternalList()
.getNodeGroup( this.referenceModel.getListGroup() );
-   if ( group && group.keyedNodes[ this.referenceModel.getListKey() 
].length > 1 ) {
+   if ( ve.getProp( group, 'keyedNodes', this.referenceModel.getListKey(), 
'length' ) > 1 ) {
this.$reuseWarning.removeClass( 'oo-ui-element-hidden' );
this.$reuseWarningText.text( mw.msg(
'visualeditor-dialog-reference-editing-reused',

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

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

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


  1   2   3   4   5   >