[MediaWiki-commits] [Gerrit] search/extra[master]: [WIP] degrade queries based on latency percentiles

2017-08-09 Thread EBernhardson (Code Review)
EBernhardson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370986 )

Change subject: [WIP] degrade queries based on latency percentiles
..

[WIP] degrade queries based on latency percentiles

TODO:
* Latency buckets based on query stat groups
* Background update thread for load stats, like histogram rotation
* Expose latency in parsing of DegradedCondition
* Tests
* Docs

Change-Id: I70ae1b148e1f15ea77f2fec5315c47f7b3dc
---
M src/main/java/org/wikimedia/search/extra/ExtraPlugin.java
M 
src/main/java/org/wikimedia/search/extra/router/DegradedRouterQueryBuilder.java
A src/main/java/org/wikimedia/search/extra/router/monitor/LoadService.java
A src/main/java/org/wikimedia/search/extra/router/monitor/LoadStats.java
A 
src/main/java/org/wikimedia/search/extra/router/monitor/SearchLatencyListener.java
M 
src/test/java/org/wikimedia/search/extra/router/DegradedRouterBuilderESTest.java
M 
src/test/java/org/wikimedia/search/extra/router/DegradedRouterQueryBuilderParserTest.java
M 
src/test/java/org/wikimedia/search/extra/router/TokenCountRouterParserTest.java
8 files changed, 357 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/search/extra 
refs/changes/86/370986/1

diff --git a/src/main/java/org/wikimedia/search/extra/ExtraPlugin.java 
b/src/main/java/org/wikimedia/search/extra/ExtraPlugin.java
index 5eeaf3a..062c00e 100644
--- a/src/main/java/org/wikimedia/search/extra/ExtraPlugin.java
+++ b/src/main/java/org/wikimedia/search/extra/ExtraPlugin.java
@@ -1,19 +1,29 @@
 package org.wikimedia.search.extra;
 
+import org.elasticsearch.client.Client;
+import org.elasticsearch.cluster.service.ClusterService;
+import org.elasticsearch.common.component.LifecycleComponent;
+import org.elasticsearch.common.settings.Setting;
 import org.elasticsearch.common.settings.Settings;
+import org.elasticsearch.common.xcontent.NamedXContentRegistry;
 import org.elasticsearch.index.IndexModule;
 import org.elasticsearch.index.analysis.TokenFilterFactory;
 import org.elasticsearch.indices.analysis.AnalysisModule.AnalysisProvider;
-import org.elasticsearch.monitor.os.OsService;
+import org.elasticsearch.monitor.os.OsProbe;
 import org.elasticsearch.plugins.AnalysisPlugin;
 import org.elasticsearch.plugins.Plugin;
 import org.elasticsearch.plugins.ScriptPlugin;
 import org.elasticsearch.plugins.SearchPlugin;
 import org.elasticsearch.script.NativeScriptFactory;
+import org.elasticsearch.script.ScriptService;
+import org.elasticsearch.threadpool.ThreadPool;
+import org.elasticsearch.watcher.ResourceWatcherService;
 import 
org.wikimedia.search.extra.analysis.filters.PreserveOriginalFilterFactory;
 import org.wikimedia.search.extra.fuzzylike.FuzzyLikeThisQueryBuilder;
 import org.wikimedia.search.extra.levenshtein.LevenshteinDistanceScoreBuilder;
 import org.wikimedia.search.extra.regex.SourceRegexQueryBuilder;
+import org.wikimedia.search.extra.router.monitor.LoadService;
+import org.wikimedia.search.extra.router.monitor.SearchLatencyListener;
 import org.wikimedia.search.extra.superdetectnoop.ChangeHandler;
 import org.wikimedia.search.extra.superdetectnoop.SetHandler;
 import org.wikimedia.search.extra.superdetectnoop.SuperDetectNoopScript;
@@ -23,24 +33,34 @@
 import org.wikimedia.search.extra.router.DegradedRouterQueryBuilder;
 import org.wikimedia.search.extra.router.TokenCountRouterQueryBuilder;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 /**
  * Setup the Elasticsearch plugin.
  */
 public class ExtraPlugin extends Plugin implements SearchPlugin, 
AnalysisPlugin, ScriptPlugin {
 
-private OsService osService;
+private final SearchLatencyListener latencyListener;
+private final LoadService loadService;
 
 public ExtraPlugin(Settings settings) {
-// TODO: This collects way more info than we care about
-osService = new OsService(settings);
+latencyListener = new SearchLatencyListener(settings, 5);
+loadService = new LoadService(settings, latencyListener, 
OsProbe.getInstance());
+}
+
+@Override
+public List getSettings() {
+return Arrays.asList(
+LoadService.REFRESH_INTERVAL_SETTING,
+SearchLatencyListener.NUM_LATENCY_BUCKETS,
+SearchLatencyListener.ROTATION_DELAY);
+}
+
+@Override
+public Collection createComponents(Client client, ClusterService 
clusterService, ThreadPool threadPool,
+   ResourceWatcherService 
resourceWatcherService, ScriptService scriptService,
+   NamedXContentRegistry 
xContentRegistry) {
+return Collections.singletonList(loadService);
 }
 
 /**
@@ -53,7 +73,7 @@
 new 

[MediaWiki-commits] [Gerrit] mediawiki...OpenStackManager[master]: Fix apihelp for param id in api action novaaddress

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

Change subject: Fix apihelp for param id in api action novaaddress
..


Fix apihelp for param id in api action novaaddress

The 'id' was not documented, but the documented 'address' was not used,
so changed the parameter name

Change-Id: I17635f2308c3920dee332a3b2d7e95a8677f109b
---
M api/ApiNovaAddress.php
M i18n/en.json
2 files changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/api/ApiNovaAddress.php b/api/ApiNovaAddress.php
index 2b616a0..5317f06 100644
--- a/api/ApiNovaAddress.php
+++ b/api/ApiNovaAddress.php
@@ -130,7 +130,7 @@
public function getParamDescription() {
return array_merge( parent::getParamDescription(), [
'subaction' => 'The subaction to perform.',
-   'address' => 'The ID of the Nova IP address on which we 
will perform the action.',
+   'id' => 'The ID of the Nova IP address on which we will 
perform the action.',
'project' => 'The project in which the address exists.',
'region' => 'The region of the currently-associated 
instance.',
] );
@@ -149,7 +149,7 @@
public function getExamples() {
return [
'api.php?action=novaaddress=disassociate' .
-   '=7=testing=mars'
+   '=7=testing=mars'
=> 'Disassociate IP 208.80.153.198 in project testing',
];
}
@@ -159,7 +159,7 @@
 */
protected function getExamplesMessages() {
return [
-   
'action=novaaddress=disassociate=7=testing=mars'
+   
'action=novaaddress=disassociate=7=testing=mars'
=> 'apihelp-novaaddress-example-1',
];
}
diff --git a/i18n/en.json b/i18n/en.json
index 2e3d5cc..c731fbb 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -363,7 +363,7 @@
"apihelp-novaaddress-description": "Perform actions on Nova IP 
addresses.",
"apihelp-novaaddress-summary": "Perform actions on Nova IP addresses.",
"apihelp-novaaddress-param-subaction": "The subaction to perform.",
-   "apihelp-novaaddress-param-id": "",
+   "apihelp-novaaddress-param-id": "The ID of the Nova IP address on which 
we will perform the action.",
"apihelp-novaaddress-param-project": "The project in which the address 
exists.",
"apihelp-novaaddress-param-region": "The region of the 
currently-associated instance.",
"apihelp-novaaddress-example-1": "Disassociate the address with ID 7 in 
project testing in region mars",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I17635f2308c3920dee332a3b2d7e95a8677f109b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/OpenStackManager
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Nikerabbit 
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] mediawiki...UrlShortener[master]: Don't urldecode user input, and document problems with test ...

2017-08-09 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370982 )

Change subject: Don't urldecode user input, and document problems with test 
cases
..

Don't urldecode user input, and document problems with test cases

As demonstrated by the wm-bot URLs, blindly decoding user input doesn't
work. Leave a TODO and add lots of test cases that demonstrate URLs we
need to worry about in the future when trying to smartly decode/encode
URLs.

Change-Id: Icbe96ea53f937b902dc9b7999a673cd8b70ed824
Co-Authored-By: Derk-Jan Hartman 
---
M UrlShortener.utils.php
M tests/phpunit/UrlShortenerUtilsTest.php
2 files changed, 43 insertions(+), 8 deletions(-)


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

diff --git a/UrlShortener.utils.php b/UrlShortener.utils.php
index fa302ba..d13af55 100755
--- a/UrlShortener.utils.php
+++ b/UrlShortener.utils.php
@@ -81,11 +81,12 @@
}
 
/**
-* Normalizes URL from its `/w/index.php?title=$1` form to
-* `/wiki/$1`.
+* Normalizes URL into a somewhat canonical form, including:
+* * protocol to HTTP
+* * from its `/w/index.php?title=$1` form to `/wiki/$1`.
 *
-* @param string $url
-* @return string
+* @param string $url might be encoded or decoded (raw user input)
+* @return string URL that is saved in DB and used in Location header
 */
public static function normalizeUrl( $url ) {
global $wgArticlePath;
@@ -93,8 +94,9 @@
// it to a different one when redirecting
$url = self::convertToProtocol( $url, PROTO_HTTP );
 
-   // Decode it...
-   $url = urldecode( $url );
+   // TODO: We should ideally decode/encode the URL for 
normalization,
+   // but we don't want to double-encode, nor unencode the URL that
+   // is directly provided by users (see test cases)
 
// If the wiki is using an article path (e.g. /wiki/$1) try
// and convert plain index.php?title=$1 URLs to the canonical 
form
diff --git a/tests/phpunit/UrlShortenerUtilsTest.php 
b/tests/phpunit/UrlShortenerUtilsTest.php
index 20a09c6..08afb75 100644
--- a/tests/phpunit/UrlShortenerUtilsTest.php
+++ b/tests/phpunit/UrlShortenerUtilsTest.php
@@ -95,15 +95,48 @@

'http://example.com/w/index.php?title=Special:Version=bar',

'http://example.com/w/index.php?title=Special:Version=bar'
],
-   // urldecoded
+   // urlencoded
[

'http://example.org/wiki/Scott_Morrison_%28politician%29',
-   
'http://example.org/wiki/Scott_Morrison_(politician)'
+   
'http://example.org/wiki/Scott_Morrison_%28politician%29'
],
+   // urldecoded
[

'http://example.org/wiki/Scott_Morrison_(politician)',

'http://example.org/wiki/Scott_Morrison_(politician)'
],
+   // Ideally spaces should be replaced with underscores
+   [
+   'http://example.org/wiki/Scott Morrison 
(politician)',
+   'http://example.org/wiki/Scott Morrison 
(politician)'
+   ],
+   // encoded # in URL that is not an anchor
+   [
+   'http://bots.wmflabs.org/logs/%23mediawiki/',
+   'http://bots.wmflabs.org/logs/%23mediawiki/',
+   ],
+   // encoded + in URL that is not a space
+   [
+   
'http://en.wikipedia.org/wiki/%2B_(disambiguation)',
+   
'http://en.wikipedia.org/wiki/%2B_(disambiguation)'
+   ],
+   // encoded + but not encoded / in URL
+   [
+   
'http://en.wikipedia.org/wiki/Talk:C%2B%2B/Archive_1',
+   
'http://en.wikipedia.org/wiki/Talk:C%2B%2B/Archive_1',
+   ],
+   // Bad characters sourced from
+   // 
https://perishablepress.com/stop-using-unsafe-characters-in-urls/
+   // These should ideally be escaped after the first ?
+   [
+   'http://example.org/?;/?:@=&;<>#%{}|\^~[]`',
+   'http://example.org/?;/?:@=&;<>#%{}|\^~[]`',
+   ],
+   // a 

[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Improve some parameter docs

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

Change subject: Improve some parameter docs
..


Improve some parameter docs

Change-Id: Id0862750b6e892e047807bcc3145ffab635f6116
---
M composer.json
M includes/Cache.php
M includes/Hooks.php
M includes/Hooks/PreferencesHookHandler.php
M maintenance/CheckModelVersions.php
M maintenance/DumpThresholds.php
M phpcs.xml
7 files changed, 21 insertions(+), 21 deletions(-)

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



diff --git a/composer.json b/composer.json
index 3a00ee9..9800bda 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
"scripts": {
"fix": "phpcbf",
"test": [
-   "parallel-lint . --exclude vendor",
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
"phpcs -s -p"
]
}
diff --git a/includes/Cache.php b/includes/Cache.php
index 5306a6c..9b06564 100644
--- a/includes/Cache.php
+++ b/includes/Cache.php
@@ -61,7 +61,7 @@
 * @param bool $isEverything When true, delete scores with the 
up-to-date
 *   model version as well.  This can be used in cases where the old 
data is
 *   bad, but no new model has been released yet.
-* @param integer $batchSize Maximum number of records to delete per 
loop.
+* @param int $batchSize Maximum number of records to delete per loop.
 *   Note that this function runs multiple batches, until all records 
are deleted.
 * @return int The number of deleted rows
 */
@@ -83,7 +83,7 @@
 * Delete old cached scores.
 * A score is old of the corresponding revision is not in the 
recentchanges table.
 * @param string $model Model name.
-* @param integer $batchSize Maximum number of records to delete per 
loop.
+* @param int $batchSize Maximum number of records to delete per loop.
 *   Note that this function runs multiple batches, until all records 
are deleted.
 * @return int The number of deleted rows
 */
@@ -106,7 +106,7 @@
 * @param array $tables
 * @param array $conditions
 * @param array $join_conds
-* @param integer $batchSize Maximum number of records to delete per 
loop.
+* @param int $batchSize Maximum number of records to delete per loop.
 *   Note that this function runs multiple batches, until all records 
are deleted.
 * @return int The number of deleted rows
 * @see Database::select
diff --git a/includes/Hooks.php b/includes/Hooks.php
index bd4c4ed..eb8b3c0 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -411,10 +411,10 @@
 * Label recent changes with ORES scores (for each change in an 
expanded group)
 *
 * @param EnhancedChangesList $ecl
-* @param array $data
+* @param array &$data
 * @param RCCacheEntry[] $block
 * @param RCCacheEntry $rcObj
-* @param string[] $classes
+* @param string[] &$classes
 */
public static function onEnhancedChangesListModifyLineData(
EnhancedChangesList $ecl,
@@ -434,7 +434,7 @@
 * Label recent changes with ORES scores (for top-level ungrouped lines)
 *
 * @param EnhancedChangesList $ecl
-* @param array $data
+* @param array &$data
 * @param RCCacheEntry $rcObj
 */
public static function onEnhancedChangesListModifyBlockLineData(
@@ -455,10 +455,11 @@
 * Hook for formatting recent changes links
 * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/OldChangesListRecentChangesLine
 *
-* @param ChangesList $changesList
-* @param string $s
+* @param ChangesList &$changesList
+* @param string &$s
 * @param RecentChange $rc
 * @param string[] &$classes
+* @return bool|void
 */
public static function onOldChangesListRecentChangesLine(
ChangesList &$changesList,
@@ -499,7 +500,7 @@
 * Filter out non-damaging changes from Special:Contributions
 *
 * @param ContribsPager $pager
-* @param array $query
+* @param array &$query
 */
public static function onContribsGetQueryInfo(
ContribsPager $pager,
@@ -685,8 +686,8 @@
/**
 * Add CSS styles to output page
 *
-* @param OutputPage $out
-* @param Skin $skin
+* @param OutputPage &$out
+* @param Skin &$skin
 */
public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
if ( !self::oresUiEnabled( $out->getUser() ) ) {
@@ -774,7 +775,7 @@
 
/**
 * @param IContextSource $context
-* @return 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Revoke dzahn ssh keys

2017-08-09 Thread BBlack (Code Review)
BBlack has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370981 )

Change subject: Revoke dzahn ssh keys
..

Revoke dzahn ssh keys

Change-Id: Ia579fa57a24647dc0a4ebc449dc16badce42f213
---
M modules/admin/data/data.yaml
1 file changed, 1 insertion(+), 4 deletions(-)


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

diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 365fd71..633c87c 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -627,10 +627,7 @@
 gid: 500
 name: dzahn
 realname: Daniel Zahn
-ssh_keys:
-  - ssh-rsa 
B3NzaC1yc2EDAQABAAACAQDY3GzbCE2eOM7IxQClHag9FRVg0eryA6PVa7p80Yp4suPzW73KVv9BgbSDvkdGNv9NOsVqkZkp01oZe7+XVxh1jaxM60nkF02DGKI0jn2lbzzWR5YS6gabjjn9SaOnh0MAwC8Jpvdz/YKOyE9/PAIFXajNwTuE6alHU/nWnLHaR1FJQRlfZLDlP9deNRAPaXOyn/jbO+ODNQIFeKSV0TmvZAh994wUlLoDYa1UcuqTRc9tJBmpLALVPZs1U2FZvLr7fkuOnUhcOC/uqE/pDdalSy0k6bAh/pkILOMFzhCHtrsbUV0AT7cVBogE7qYRuTo3eBrpzj9Bbsi41Q4y29lridBoyBgEMH/fnEIMDivNLzec5nYLPJ/XIDSc0G2iFoWY/u7SaVT7A6rjlSuzS7owunNXEj1mhmNW7v/FIOqG2Zl3K7INBj8Y0rFL9GuwP5LIkZxlNZT7NEdUOA3i8L4sT3YJJgiaup4Ss66TpWCDQ/znZoz5Vi5ODhXjqMVVFbrHI/7eIYMChoR5HkcRdjaIShvFgSfWcKXlwHouIVUiXprnoZZGmAa9CTAx9GFrjgC7DixK654yx4Gb47q4dttSE2nZKY1njfDRHcbLRuZ1ESEpAcoxkos1agvShw5B4ysSYRcMHkF2yqi2srq7Us19JWCmLm2RW5z+4xPBAfEMcw==
 dz@ubuntu
-  - ssh-rsa 
B3NzaC1yc2EDAQABAAABAQCF9INYx9SZy7Gunoh6/Qg7s7l7WjH2Tx3+JzWT8r6k5y+WFufi2sSPTtyOIwnsnQU/6pGB9nb9vnVDoN4Mvhjv454dislPn3JoadxvQRR35n9U/br7DUa3nbNB8ivzCadmlt3jLLj4z2/8rYxcriFgF88AYK9bQiz4BZN5o5nox8LbX7Iq4JiTeyPX41K+xzWtxKzovXu+IcANLyGe+B4Ic1MeDm3gQhaqHR0BJ/CyAPI3SVbGx79U4pivU/i8rLAcXAi4RymQR19jDXogPg0HqWQpg24ZP/3CqVujWYuVGZNUDQ5QmuEUlkRO2cB2OcssEiN6gMgT8Fa3Fra+BU+p
 dzahn@yubikey
-  - ssh-ed25519 
C3NzaC1lZDI1NTE5IEf2Eljrd5s1w2eYtOS+G75tFnZIplfoeNFBBHr/yKgH 
dzahn@elgato
+ssh_keys: []
 uid: 2075
 email: dz...@wikimedia.org
   jzerebecki:

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Revoke dzahn ssh keys

2017-08-09 Thread BBlack (Code Review)
BBlack has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370981 )

Change subject: Revoke dzahn ssh keys
..


Revoke dzahn ssh keys

Change-Id: Ia579fa57a24647dc0a4ebc449dc16badce42f213
---
M modules/admin/data/data.yaml
1 file changed, 1 insertion(+), 4 deletions(-)

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



diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 365fd71..633c87c 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -627,10 +627,7 @@
 gid: 500
 name: dzahn
 realname: Daniel Zahn
-ssh_keys:
-  - ssh-rsa 
B3NzaC1yc2EDAQABAAACAQDY3GzbCE2eOM7IxQClHag9FRVg0eryA6PVa7p80Yp4suPzW73KVv9BgbSDvkdGNv9NOsVqkZkp01oZe7+XVxh1jaxM60nkF02DGKI0jn2lbzzWR5YS6gabjjn9SaOnh0MAwC8Jpvdz/YKOyE9/PAIFXajNwTuE6alHU/nWnLHaR1FJQRlfZLDlP9deNRAPaXOyn/jbO+ODNQIFeKSV0TmvZAh994wUlLoDYa1UcuqTRc9tJBmpLALVPZs1U2FZvLr7fkuOnUhcOC/uqE/pDdalSy0k6bAh/pkILOMFzhCHtrsbUV0AT7cVBogE7qYRuTo3eBrpzj9Bbsi41Q4y29lridBoyBgEMH/fnEIMDivNLzec5nYLPJ/XIDSc0G2iFoWY/u7SaVT7A6rjlSuzS7owunNXEj1mhmNW7v/FIOqG2Zl3K7INBj8Y0rFL9GuwP5LIkZxlNZT7NEdUOA3i8L4sT3YJJgiaup4Ss66TpWCDQ/znZoz5Vi5ODhXjqMVVFbrHI/7eIYMChoR5HkcRdjaIShvFgSfWcKXlwHouIVUiXprnoZZGmAa9CTAx9GFrjgC7DixK654yx4Gb47q4dttSE2nZKY1njfDRHcbLRuZ1ESEpAcoxkos1agvShw5B4ysSYRcMHkF2yqi2srq7Us19JWCmLm2RW5z+4xPBAfEMcw==
 dz@ubuntu
-  - ssh-rsa 
B3NzaC1yc2EDAQABAAABAQCF9INYx9SZy7Gunoh6/Qg7s7l7WjH2Tx3+JzWT8r6k5y+WFufi2sSPTtyOIwnsnQU/6pGB9nb9vnVDoN4Mvhjv454dislPn3JoadxvQRR35n9U/br7DUa3nbNB8ivzCadmlt3jLLj4z2/8rYxcriFgF88AYK9bQiz4BZN5o5nox8LbX7Iq4JiTeyPX41K+xzWtxKzovXu+IcANLyGe+B4Ic1MeDm3gQhaqHR0BJ/CyAPI3SVbGx79U4pivU/i8rLAcXAi4RymQR19jDXogPg0HqWQpg24ZP/3CqVujWYuVGZNUDQ5QmuEUlkRO2cB2OcssEiN6gMgT8Fa3Fra+BU+p
 dzahn@yubikey
-  - ssh-ed25519 
C3NzaC1lZDI1NTE5IEf2Eljrd5s1w2eYtOS+G75tFnZIplfoeNFBBHr/yKgH 
dzahn@elgato
+ssh_keys: []
 uid: 2075
 email: dz...@wikimedia.org
   jzerebecki:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia579fa57a24647dc0a4ebc449dc16badce42f213
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 
Gerrit-Reviewer: Faidon Liambotis 
Gerrit-Reviewer: Mark Bergsma 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/vendor[master]: Wikibase: "data-values/geo": "2.1.1"

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

Change subject: Wikibase: "data-values/geo": "2.1.1"
..


Wikibase: "data-values/geo": "2.1.1"

Change-Id: I6540ba028a2cefb281e384089a0cda55e89d5700
---
M composer.json
M composer.lock
M composer/autoload_classmap.php
M composer/autoload_files.php
M composer/autoload_psr4.php
M composer/autoload_static.php
M composer/installed.json
A data-values/geo/Aliases.php
A data-values/geo/COPYING
A data-values/geo/Geo.php
A data-values/geo/README.md
A data-values/geo/src/Formatters/GlobeCoordinateFormatter.php
A data-values/geo/src/Formatters/LatLongFormatter.php
A data-values/geo/src/GlobeMath.php
A data-values/geo/src/Parsers/DdCoordinateParser.php
A data-values/geo/src/Parsers/DmCoordinateParser.php
A data-values/geo/src/Parsers/DmsCoordinateParser.php
A data-values/geo/src/Parsers/FloatCoordinateParser.php
A data-values/geo/src/Parsers/GlobeCoordinateParser.php
A data-values/geo/src/Parsers/LatLongParser.php
A data-values/geo/src/Parsers/LatLongParserBase.php
A data-values/geo/src/Values/GlobeCoordinateValue.php
A data-values/geo/src/Values/LatLongValue.php
23 files changed, 3,024 insertions(+), 5 deletions(-)

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



diff --git a/composer.json b/composer.json
index 54ef086..a136d88 100644
--- a/composer.json
+++ b/composer.json
@@ -41,6 +41,7 @@
"data-values/data-values": "1.1.0",
"data-values/interfaces": "0.2.5",
"data-values/number": "0.9.1",
+   "data-values/geo": "2.1.1",
"data-values/serialization": "1.2.1",
"diff/diff": "2.2.0",
"firebase/php-jwt": "4.0.0",
diff --git a/composer.lock b/composer.lock
index 0702c1a..2b216b9 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
 "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file;,
 "This file is @generated automatically"
 ],
-"content-hash": "28c433941e7f201a5fa18304960e2a63",
+"content-hash": "1432d5bc5c17c43f6945b8babd4fa423",
 "packages": [
 {
 "name": "composer/semver",
@@ -224,6 +224,73 @@
 "time": "2017-08-09T15:56:46+00:00"
 },
 {
+"name": "data-values/geo",
+"version": "2.1.1",
+"source": {
+"type": "git",
+"url": "https://github.com/DataValues/Geo.git;,
+"reference": "8fd88298e30403dc9ef2756695bc183542fa36f2"
+},
+"dist": {
+"type": "zip",
+"url": 
"https://api.github.com/repos/DataValues/Geo/zipball/8fd88298e30403dc9ef2756695bc183542fa36f2;,
+"reference": "8fd88298e30403dc9ef2756695bc183542fa36f2",
+"shasum": ""
+},
+"require": {
+"data-values/common": "~0.4.0|~0.3.0|~0.2.0",
+"data-values/data-values": "~1.0|~0.1",
+"data-values/interfaces": "~0.2.0|~0.1.5",
+"php": ">=5.5.9"
+},
+"require-dev": {
+"phpunit/phpunit": "~4.8",
+"wikibase/wikibase-codesniffer": "^0.1.0"
+},
+"type": "library",
+"extra": {
+"branch-alias": {
+"dev-master": "2.0.x-dev"
+}
+},
+"autoload": {
+"files": [
+"Geo.php"
+],
+"psr-4": {
+"DataValues\\Geo\\": "src"
+}
+},
+"notification-url": "https://packagist.org/downloads/;,
+"license": [
+"GPL-2.0+"
+],
+"authors": [
+{
+"name": "Jeroen De Dauw",
+"email": "jeroended...@gmail.com",
+"homepage": "http://jeroendedauw.com;,
+"role": "Developer"
+},
+{
+"name": "The Wikidata team",
+"role": "Developer"
+}
+],
+"description": "Geographical value objects, parsers and 
formatters",
+"homepage": "https://github.com/DataValues/Geo;,
+"keywords": [
+"datavalues",
+"formatters",
+"geo",
+"geographical",
+"latlong",
+"parsers",
+"wikidata"
+],
+"time": "2017-08-09T19:37:51+00:00"
+},
+{
 "name": "data-values/interfaces",
 "version": "0.2.5",
 "source": {
diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php
index 7f39982..c899a56 

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Initialize SmashPig context when submitting import

2017-08-09 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370980 )

Change subject: Initialize SmashPig context when submitting import
..

Initialize SmashPig context when submitting import

FIXME: figure out a better way to make sure it's initialized
whenever we need it, but doesn't litter the log files (and touch
all the files) for every single request.

Bug: T172918
Change-Id: I68bb18df1073cf425dddfe8f57e8412bc0b16c4a
---
M sites/all/modules/offline2civicrm/offline2civicrm.module
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/80/370980/1

diff --git a/sites/all/modules/offline2civicrm/offline2civicrm.module 
b/sites/all/modules/offline2civicrm/offline2civicrm.module
index 2a563e5..18ff9fa 100644
--- a/sites/all/modules/offline2civicrm/offline2civicrm.module
+++ b/sites/all/modules/offline2civicrm/offline2civicrm.module
@@ -150,6 +150,7 @@
 }
 
 function offline2civicrm_import_checks_form_submit( $form, $form_state ) {
+  wmf_common_create_smashpig_context( 'offline2civicrm' );
   if ( !empty( $form_state['values']['import_upload_submit'] ) ) {
 try {
   $validators = array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68bb18df1073cf425dddfe8f57e8412bc0b16c4a
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
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] wikimedia...crm[master]: Update list of processors in Gateway Reconciliation report

2017-08-09 Thread Ejegg (Code Review)
Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370979 )

Change subject: Update list of processors in Gateway Reconciliation report
..

Update list of processors in Gateway Reconciliation report

Change-Id: I0cde595583b08b63de967c184467dfce40a3
---
M 
sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/GatewayReconciliation.php
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/79/370979/1

diff --git 
a/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/GatewayReconciliation.php
 
b/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/GatewayReconciliation.php
index b2402f8..a7ad0d2 100644
--- 
a/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/GatewayReconciliation.php
+++ 
b/sites/all/modules/wmf_reports/CRM/Report/Form/Contribute/GatewayReconciliation.php
@@ -14,12 +14,13 @@
 'COINBASE' => 'Coinbase',
 'ENGAGE' => 'Engage',
 'GENERIC_IMPORT' => 'Generic Import',
-'GLOBALCOLLECT' => 'GlobalCollect',
+'GLOBALCOLLECT' => 'GlobalCollect (legacy integration)',
+   'INGENICO' => 'Ingenico (Connect)',
 'JPMORGAN' => 'JP Morgan',
-'PAYPAL' => 'PayPal',
+'PAYPAL' => 'PayPal (legacy integration)',
+   'PAYPAL_EC' => 'PayPal Express Checkout',
 'SQUARE' => 'Square',
 'TRILOGY' => 'Trilogy',
-'WORLDPAY' => 'Worldpay',
 );
 
 $this->_columns = array(

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Disallow job pushes from JobQueueGroup to bogus wikis

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

Change subject: Disallow job pushes from JobQueueGroup to bogus wikis
..

Disallow job pushes from JobQueueGroup to bogus wikis

Bug: T171371
Change-Id: I03a5dbd18cf6b5bcacb3ec07cef9e0b051bc147c
---
M includes/jobqueue/JobQueueGroup.php
1 file changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/78/370978/1

diff --git a/includes/jobqueue/JobQueueGroup.php 
b/includes/jobqueue/JobQueueGroup.php
index ef0ecb3..987c123 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -37,6 +37,8 @@
protected $wiki;
/** @var string|bool Read only rationale (or false if r/w) */
protected $readOnlyReason;
+   /** @var bool Whether the wiki is not recognized in configuration */
+   protected $invalidWiki = false;
 
/** @var array Map of (bucket => (queue => JobQueue, types => list of 
types) */
protected $coalescedQueues;
@@ -68,9 +70,17 @@
 * @return JobQueueGroup
 */
public static function singleton( $wiki = false ) {
+   global $wgLocalDatabases;
+
$wiki = ( $wiki === false ) ? wfWikiID() : $wiki;
+
if ( !isset( self::$instances[$wiki] ) ) {
self::$instances[$wiki] = new self( $wiki, 
wfConfiguredReadOnlyReason() );
+   // Make sure jobs are not getting pushed to bogus 
wikis. This can confuse
+   // the job runner system into spawning endless RPC 
requests that fail (T171371).
+   if ( $wiki !== wfWikiID() && !in_array( $wiki, 
$wgLocalDatabases ) ) {
+   self::$instances[$wiki]->invalidWiki = true;
+   }
}
 
return self::$instances[$wiki];
@@ -120,6 +130,11 @@
 */
public function push( $jobs ) {
global $wgJobTypesExcludedFromDefaultQueue;
+
+   if ( $this->invalidWiki ) {
+   // Do not enqueue job that cannot be run (T171371)
+   throw new LogicException( "Domain '{$this->wiki}' is 
not recognized." );
+   }
 
$jobs = is_array( $jobs ) ? $jobs : [ $jobs ];
if ( !count( $jobs ) ) {
@@ -171,6 +186,11 @@
 * @since 1.26
 */
public function lazyPush( $jobs ) {
+   if ( $this->invalidWiki ) {
+   // Do not enqueue job that cannot be run (T171371)
+   throw new LogicException( "Domain '{$this->wiki}' is 
not recognized." );
+   }
+
if ( PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg' ) {
$this->push( $jobs );
return;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I03a5dbd18cf6b5bcacb3ec07cef9e0b051bc147c
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] wikimedia...golden[master]: Remove duplicated clicks on the same position for each query...

2017-08-09 Thread Chelsyx (Code Review)
Chelsyx has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370977 )

Change subject: Remove duplicated clicks on the same position for each query 
when computing paulscore
..

Remove duplicated clicks on the same position for each query when computing 
paulscore

Bug: T172960
Change-Id: I972500c6150408a119f2c80dad9fe8a49f00845e
---
M modules/metrics/search/paulscore_approximations.R
1 file changed, 8 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/golden 
refs/changes/77/370977/1

diff --git a/modules/metrics/search/paulscore_approximations.R 
b/modules/metrics/search/paulscore_approximations.R
index 1f7fe9f..1a1ede0 100644
--- a/modules/metrics/search/paulscore_approximations.R
+++ b/modules/metrics/search/paulscore_approximations.R
@@ -35,11 +35,14 @@
   SUM(IF(event_action = 'click', POW(0.7, event_position), 0)) / 
SUM(IF(event_action = 'searchResultPage', 1, 0)) AS pow_7,
   SUM(IF(event_action = 'click', POW(0.8, event_position), 0)) / 
SUM(IF(event_action = 'searchResultPage', 1, 0)) AS pow_8,
   SUM(IF(event_action = 'click', POW(0.9, event_position), 0)) / 
SUM(IF(event_action = 'searchResultPage', 1, 0)) AS pow_9
-FROM TestSearchSatisfaction2_", dplyr::if_else(as.Date(opt$date) < 
"2017-02-10", "15922352", dplyr::if_else(as.Date(opt$date) < "2017-06-29", 
"16270835", "16909631")), "
-WHERE ", date_clause, "
-  AND event_action IN ('searchResultPage', 'click')
-  AND IF(event_source = 'autocomplete', event_inputLocation = 'header', TRUE)
-  AND IF(event_source = 'autocomplete' AND event_action = 'click', 
event_position >= 0, TRUE)
+FROM
+  (SELECT event_searchSessionId, event_source, wiki, event_action, 
event_position, event_pageViewId, event_query
+   FROM TestSearchSatisfaction2_", dplyr::if_else(as.Date(opt$date) < 
"2017-02-10", "15922352", dplyr::if_else(as.Date(opt$date) < "2017-06-29", 
"16270835", "16909631")), "
+  WHERE ", date_clause, "
+AND event_action IN ('searchResultPage', 'click')
+AND IF(event_source = 'autocomplete', event_inputLocation = 'header', TRUE)
+AND IF(event_source = 'autocomplete' AND event_action = 'click', 
event_position >= 0, TRUE)
+  GROUP BY event_searchSessionId, event_source, wiki, event_action, 
event_position, event_pageViewId, event_query) AS deduplicate
 GROUP BY date, event_searchSessionId, event_source, wiki;")
 
 # Fetch data from MySQL database:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I972500c6150408a119f2c80dad9fe8a49f00845e
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/golden
Gerrit-Branch: master
Gerrit-Owner: Chelsyx 

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


[MediaWiki-commits] [Gerrit] marvin[master]: Doc: add license

2017-08-09 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370976 )

Change subject: Doc: add license
..

Doc: add license

License copied from https://www.gnu.org/licenses/gpl-2.0.txt.

Bug: T172682
Change-Id: Ib3e97bf77dd759fb5e76550ddaaa2ce7d82b9e42
---
A docs/license.txt
M package.json
M readme.md
3 files changed, 357 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/76/370976/1

diff --git a/docs/license.txt b/docs/license.txt
new file mode 100644
index 000..d159169
--- /dev/null
+++ b/docs/license.txt
@@ -0,0 +1,339 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: JobQueueEventBus: Enable group1 - wikidata.

2017-08-09 Thread Ppchelko (Code Review)
Ppchelko has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370975 )

Change subject: JobQueueEventBus: Enable group1 - wikidata.
..

JobQueueEventBus: Enable group1 - wikidata.

Attempt 2 for Id6648c81c63f1ad8eecee3384a5cf6043837e1c8

Continue the gradual rollout of job posting to EventBus.
Wikidatawiki is still on wmf.11 that doesn;t have some of
code required for this, so enable on all the group1 wikis
except wikidatawiki.

Bug: T163380
Change-Id: I9630b32041e642f80d51a0f67f834b62026c1dc4
---
A dblists/jobqueue_group1.dblist
M wmf-config/InitialiseSettings.php
2 files changed, 605 insertions(+), 3 deletions(-)


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

diff --git a/dblists/jobqueue_group1.dblist b/dblists/jobqueue_group1.dblist
new file mode 100644
index 000..3a940de
--- /dev/null
+++ b/dblists/jobqueue_group1.dblist
@@ -0,0 +1,601 @@
+aawikibooks
+aawiktionary
+abwiktionary
+advisorywiki
+afwikibooks
+afwikiquote
+afwiktionary
+akwikibooks
+akwiktionary
+alswikibooks
+alswikiquote
+alswiktionary
+amwikiquote
+amwiktionary
+angwikibooks
+angwikiquote
+angwikisource
+angwiktionary
+anwiktionary
+arwikibooks
+arwikimedia
+arwikinews
+arwikiquote
+arwikisource
+arwikiversity
+arwiktionary
+astwikibooks
+astwikiquote
+astwiktionary
+aswikibooks
+aswikisource
+aswiktionary
+auditcomwiki
+avwiktionary
+aywikibooks
+aywiktionary
+azwikibooks
+azwikiquote
+azwikisource
+azwiktionary
+bawikibooks
+bdwikimedia
+betawikiversity
+bewikibooks
+bewikimedia
+bewikiquote
+bewikisource
+bewiktionary
+bgwikibooks
+bgwikinews
+bgwikiquote
+bgwikisource
+bgwiktionary
+bhwiktionary
+biwikibooks
+biwiktionary
+bmwikibooks
+bmwikiquote
+bmwiktionary
+bnwikibooks
+bnwikisource
+bnwiktionary
+boardgovcomwiki
+boardwiki
+bowikibooks
+bowiktionary
+brwikimedia
+brwikiquote
+brwikisource
+brwiktionary
+bswikibooks
+bswikinews
+bswikiquote
+bswikisource
+bswiktionary
+cawiki
+cawikibooks
+cawikimedia
+cawikinews
+cawikiquote
+cawikisource
+cawiktionary
+chairwiki
+chapcomwiki
+checkuserwiki
+chrwiktionary
+chwikibooks
+chwiktionary
+cnwikimedia
+collabwiki
+commonswiki
+cowikibooks
+cowikimedia
+cowikiquote
+cowiktionary
+crwikiquote
+crwiktionary
+csbwiktionary
+cswikibooks
+cswikinews
+cswikiquote
+cswikisource
+cswikiversity
+cswiktionary
+cvwikibooks
+cywikibooks
+cywikiquote
+cywikisource
+cywiktionary
+dawikibooks
+dawikiquote
+dawikisource
+dawiktionary
+dewikibooks
+dewikinews
+dewikiquote
+dewikisource
+dewikiversity
+dewikivoyage
+dewiktionary
+dkwikimedia
+donatewiki
+dvwiktionary
+dzwiktionary
+ecwikimedia
+elwikibooks
+elwikinews
+elwikiquote
+elwikisource
+elwikiversity
+elwikivoyage
+elwiktionary
+enwikibooks
+enwikinews
+enwikiquote
+enwikisource
+enwikiversity
+enwikivoyage
+enwiktionary
+eowikibooks
+eowikinews
+eowikiquote
+eowikisource
+eowiktionary
+eswikibooks
+eswikinews
+eswikiquote
+eswikisource
+eswikiversity
+eswikivoyage
+eswiktionary
+etwikibooks
+etwikimedia
+etwikiquote
+etwikisource
+etwiktionary
+euwikibooks
+euwikiquote
+euwiktionary
+execwiki
+fawikibooks
+fawikinews
+fawikiquote
+fawikisource
+fawikivoyage
+fawiktionary
+fdcwiki
+fiwikibooks
+fiwikimedia
+fiwikinews
+fiwikiquote
+fiwikisource
+fiwikiversity
+fiwikivoyage
+fiwiktionary
+fjwiktionary
+foundationwiki
+fowikisource
+fowiktionary
+frwikibooks
+frwikinews
+frwikiquote
+frwikisource
+frwikiversity
+frwikivoyage
+frwiktionary
+fywikibooks
+fywiktionary
+gawikibooks
+gawikiquote
+gawiktionary
+gdwiktionary
+glwikibooks
+glwikiquote
+glwikisource
+glwiktionary
+gnwikibooks
+gnwiktionary
+gotwikibooks
+grantswiki
+guwikibooks
+guwikiquote
+guwikisource
+guwiktionary
+gvwiktionary
+hawiktionary
+hewiki
+hewikibooks
+hewikinews
+hewikiquote
+hewikisource
+hewikivoyage
+hewiktionary
+hiwikibooks
+hiwikiquote
+hiwikiversity
+hiwiktionary
+hrwikibooks
+hrwikiquote
+hrwikisource
+hrwiktionary
+hsbwiktionary
+htwikisource
+huwikibooks
+huwikinews
+huwikiquote
+huwikisource
+huwiktionary
+hywikibooks
+hywikiquote
+hywikisource
+hywiktionary
+iawikibooks
+iawiktionary
+idwikibooks
+idwikiquote
+idwikisource
+idwiktionary
+iegcomwiki
+iewikibooks
+iewiktionary
+ikwiktionary
+ilwikimedia
+incubatorwiki
+internalwiki
+iowiktionary
+iswikibooks
+iswikiquote
+iswikisource
+iswiktionary
+itwikibooks
+itwikinews
+itwikiquote
+itwikisource
+itwikiversity
+itwikivoyage
+itwiktionary
+iuwiktionary
+jawikibooks
+jawikinews
+jawikiquote
+jawikisource
+jawikiversity
+jawiktionary
+jbowiktionary
+jvwiktionary
+kawikibooks
+kawikiquote
+kawiktionary
+kkwikibooks
+kkwikiquote
+kkwiktionary
+klwiktionary
+kmwikibooks
+kmwiktionary
+knwikibooks
+knwikiquote
+knwikisource
+knwiktionary
+kowikibooks
+kowikinews
+kowikiquote
+kowikisource
+kowikiversity
+kowiktionary
+krwikiquote
+kswikibooks
+kswikiquote
+kswiktionary
+kuwikibooks
+kuwikiquote
+kuwiktionary
+kwwikiquote
+kwwiktionary
+kywikibooks
+kywikiquote

[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: Harvest monument_article via sparql

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

Change subject: Harvest monument_article via sparql
..


Harvest monument_article via sparql

Bug: T172842
Change-Id: I43b33b24e94e4ba40ed16add53c72a6fd6e967a5
---
M erfgoedbot/common.py
M erfgoedbot/template/wikidata_query.sparql
M erfgoedbot/update_database.py
M tests/test_common.py
4 files changed, 45 insertions(+), 4 deletions(-)

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



diff --git a/erfgoedbot/common.py b/erfgoedbot/common.py
index a6f0369..333409c 100644
--- a/erfgoedbot/common.py
+++ b/erfgoedbot/common.py
@@ -29,6 +29,19 @@
 return '[[{0}]]'.format(page_title)
 
 
+def get_page_from_url(url):
+"""
+Retrieve the wikipage and site from a page or entity url.
+"""
+supported_sites = ['wikipedia', 'wikivoyage', 'wikidata', 'wikimedia']
+pattern = '\/\/(.+?)\.({0})\.org\/(wiki|entity)\/(.+?)$'.format(
+'|'.join(supported_sites))
+m = re.search(pattern, url)
+site = (m.group(2), m.group(1))
+page_name = m.group(4)
+return (page_name, site)
+
+
 def get_source_page(source, harvest_type=None):
 """
 Retrieve the wikipage and site from the source field.
@@ -43,8 +56,11 @@
 site = None
 page_name = None
 if harvest_type == 'sparql':
-site = ('wikidata', 'www')
-page_name = source.split('/')[-1]
+try:
+return get_page_from_url(source)
+except AttributeError:
+raise ValueError(
+u'Could not find source list ({0})'.format(source))
 else:
 supported_sites = ['wikipedia', 'wikivoyage', 'wikidata', 'wikimedia']
 pattern = '\/\/(.+?)\.({0})\.org\/w\/index\.php\?title=(.+?)&'.format(
diff --git a/erfgoedbot/template/wikidata_query.sparql 
b/erfgoedbot/template/wikidata_query.sparql
index 6a3878d..266e6ea 100644
--- a/erfgoedbot/template/wikidata_query.sparql
+++ b/erfgoedbot/template/wikidata_query.sparql
@@ -1,9 +1,11 @@
 # MonumentsDB harvest
-SELECT DISTINCT ?item ?itemLabel ?id ?admin ?adminLabel ?image ?commonscat 
?address ?coordinate WHERE {
+SELECT DISTINCT ?item ?itemLabel ?id ?monument_article ?admin ?adminLabel 
?image ?commonscat ?address ?coordinate WHERE {
   # Make it properties and filter out end time
 
   %(select_statement)s .
 
+  OPTIONAL { ?monument_article schema:about ?item;
+   schema:isPartOf 
; } .
   OPTIONAL { ?item wdt:P131 ?admin } .
   OPTIONAL { ?item wdt:P18  ?image } .
   OPTIONAL { ?item wdt:P373 ?commonscat } .
diff --git a/erfgoedbot/update_database.py b/erfgoedbot/update_database.py
index 23e4670..7d86e93 100755
--- a/erfgoedbot/update_database.py
+++ b/erfgoedbot/update_database.py
@@ -21,6 +21,7 @@
 from pywikibot import pagegenerators
 
 import monuments_config as mconfig
+import common as common
 from converters import (
 extractWikilink,
 extract_elements_from_template_param,
@@ -257,6 +258,9 @@
 if params['adminLabel']:
 params['admin'] = params['adminLabel'].value
 
+if params['monument_article']:
+params['monument_article'], _site = 
common.get_page_from_url(params['monument_article'].value)
+
 params['source'] = params['item'].value
 params['wd_item'] = params['item'].getID()
 
@@ -473,7 +477,8 @@
 
 sparql_query = sparql_template % dict(
 select_statement=sparql_select,
-lang=countryconfig.get('lang')
+lang=countryconfig.get('lang'),
+project=countryconfig.get('project')
 )
 # print sparql_query
 sq = pywikibot.data.sparql.SparqlQuery()
diff --git a/tests/test_common.py b/tests/test_common.py
index 126eeb7..2f016c0 100644
--- a/tests/test_common.py
+++ b/tests/test_common.py
@@ -29,6 +29,24 @@
 self.assertEquals(result, ('Q123', ('wikidata', 'www')))
 
 
+class TestGetPageFromUrl(unittest.TestCase):
+
+def test_get_page_from_url_entity(self):
+source = 'http://www.wikidata.org/entity/Q123'
+result = common.get_page_from_url(source)
+self.assertEquals(result, ('Q123', ('wikidata', 'www')))
+
+def test_get_page_from_url_page(self):
+source = 'http://www.wikidata.org/wiki/Q123'
+result = common.get_page_from_url(source)
+self.assertEquals(result, ('Q123', ('wikidata', 'www')))
+
+def test_get_page_from_url_wikipedia(self):
+source = 'http://en.wikipedia.org/entity/foo'
+result = common.get_page_from_url(source)
+self.assertEquals(result, ('foo', ('wikipedia', 'en')))
+
+
 class TestGetSourceLink(unittest.TestCase):
 
 def setUp(self):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I43b33b24e94e4ba40ed16add53c72a6fd6e967a5
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage

[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: Make scripts dealing with the sparql source field deal with ...

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

Change subject: Make scripts dealing with the sparql source field deal with 
sparql harvested data
..


Make scripts dealing with the sparql source field deal with sparql harvested 
data

Affected scripts:
* Reporting unused monuments
* Categorizing images (Option three, see if the list contains Commonscat)
* Add coordinates to article (used in edit summary)

Bug: T171300
Change-Id: I6197f30c318e11611d24c29a8ca9c45dc1134a80
---
M erfgoedbot/add_coord_to_articles.py
M erfgoedbot/categorize_images.py
A erfgoedbot/common.py
M erfgoedbot/unused_monument_images.py
A tests/test_common.py
5 files changed, 152 insertions(+), 31 deletions(-)

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



diff --git a/erfgoedbot/add_coord_to_articles.py 
b/erfgoedbot/add_coord_to_articles.py
index 297729b..5a9950e 100644
--- a/erfgoedbot/add_coord_to_articles.py
+++ b/erfgoedbot/add_coord_to_articles.py
@@ -20,6 +20,7 @@
 import pywikibot
 
 import monuments_config as mconfig
+import common as common
 from database_connection import (
 close_database_connection,
 connect_to_monuments_database,
@@ -122,7 +123,7 @@
 aMonument.article = redirTitle
 if (pageId):
 if not hasCoordinates(pageId, lang, cursorWiki):
-addCoords(countrycode, lang, aMonument, coordconfig)
+addCoords(countrycode, lang, aMonument, coordconfig, 
countryconfig)
 
 
 def getMonumentsWithCoordinates(countrycode, lang, cursor):
@@ -230,7 +231,7 @@
 return (pageNs, pageTitle)
 
 
-def addCoords(countrycode, lang, monument, coordconfig):
+def addCoords(countrycode, lang, monument, coordconfig, countryconfig):
 '''
 Add the coordinates to article.
 '''
@@ -269,11 +270,13 @@
 newtext = re.sub(catStart, replacementText, newtext, replCount, 
flags=re.IGNORECASE)
 
 if text != newtext:
-wikilist = u''
-matchWikipage = re.search("title=(.+?)&", monument.source)
-if (matchWikipage and matchWikipage.group(1)):
-wikilist = matchWikipage.group(1)
-comment = u'Adding template %s based on [[%s]], # %s' % 
(coordTemplate, wikilist, monument.id)
+try:
+source_link = common.get_source_link(
+monument.source,
+countryconfig.get('type'))
+except ValueError:
+source_link = ''
+comment = u'Adding template %s based on %s, # %s' % 
(coordTemplate, source_link, monument.id)
 pywikibot.showDiff(text, newtext)
 modPage = pywikibot.input(u'Modify page: %s ([y]/n) ?' % 
(monument.article))
 if (modPage.lower == 'y' or modPage == ''):
diff --git a/erfgoedbot/categorize_images.py b/erfgoedbot/categorize_images.py
index e6e7fef..2566416 100644
--- a/erfgoedbot/categorize_images.py
+++ b/erfgoedbot/categorize_images.py
@@ -18,13 +18,13 @@
 '''
 import json
 import os
-import re
 
 import pywikibot
 from pywikibot import pagegenerators
 from pywikibot import textlib
 
 import monuments_config as mconfig
+import common as common
 from database_connection import (
 close_database_connection,
 connect_to_monuments_database
@@ -53,7 +53,9 @@
 return json.load(open(json_file, 'r'))
 
 
-def categorizeImage(countrycode, lang, commonsTemplateName, 
commonsCategoryBase, commonsCatTemplates, page, conn, cursor):
+def categorizeImage(
+countrycode, lang, commonsTemplateName, commonsCategoryBase,
+commonsCatTemplates, page, conn, cursor, harvest_type):
 pywikibot.log(u'Working on: %s' % page.title())
 site = pywikibot.Site(u'commons', u'commons')
 commonsTemplate = pywikibot.Page(site, 'Template:%s' % commonsTemplateName)
@@ -96,7 +98,7 @@
 u'Monument with id %s not in monuments database' % (monumentId, ))
 return False
 
-(newcats, categorisation_method) = get_new_categories(monumentId, monData, 
lang, commonsCatTemplates)
+(newcats, categorisation_method) = get_new_categories(monumentId, monData, 
lang, commonsCatTemplates, harvest_type)
 
 # See if one of the three options worked
 if newcats:
@@ -124,7 +126,7 @@
 return monumentId
 
 
-def get_new_categories(monumentId, monData, lang, commonsCatTemplates):
+def get_new_categories(monumentId, monData, lang, commonsCatTemplates, 
harvest_type):
 (monumentName, monumentCommonscat,
  monumentArticleTitle, monumentSource, project) = monData
 commons_site = pywikibot.Site(u'commons', u'commons')
@@ -174,7 +176,7 @@
 monumentId, str(e)))
 
 # Option three is to see if the list contains Commonscat links (whole list)
-if not newcats:
+if not newcats and harvest_type != 'sparql':
 monumentList = getList(lang, project, 

[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: Make api handle sparql harvested source fields

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

Change subject: Make api handle sparql harvested source fields
..


Make api handle sparql harvested source fields

Uppdated url handlers for:
* Wikitable
* HTML
* HTMLlist

Bug: T172841
Change-Id: I20e25de8c391ba9e06cc6a4374d094af401bdf44
---
M api/includes/ApiMonuments.php
M api/includes/CommonFunctions.php
M api/includes/FormatHtml.php
M api/includes/FormatHtmllist.php
M api/includes/FormatJson.php
M api/includes/FormatWikitable.php
M api/tests/CommonFunctionsTest.php
7 files changed, 128 insertions(+), 25 deletions(-)

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



diff --git a/api/includes/ApiMonuments.php b/api/includes/ApiMonuments.php
index a4a3713..5efa5f4 100644
--- a/api/includes/ApiMonuments.php
+++ b/api/includes/ApiMonuments.php
@@ -121,7 +121,7 @@
$fulltextColumns = [ 'name' => 1 ];
 
if ( $this->getParam( 'format' ) == 'dynamickml' ) {
-   # don't search just pass along the search parameters to 
kml network link file
+   // don't search just pass along the search parameters 
to kml network link file
$DynKml = new DynamicKml;
$reqUrl = 'http://' . $_SERVER['SERVER_NAME'] . 
$_SERVER['REQUEST_URI'];
$DynKml->output( $reqUrl );
diff --git a/api/includes/CommonFunctions.php b/api/includes/CommonFunctions.php
index 485b5c8..ad60814 100644
--- a/api/includes/CommonFunctions.php
+++ b/api/includes/CommonFunctions.php
@@ -53,7 +53,8 @@
$projects = array("wikipedia", "wikivoyage", "wikidata", "wikimedia");
$projectRegex = "(" . join("|", $projects) . ")";
$var = NULL;
-   if (!preg_match( '/(https?:)?\/\/(([a-z\-]+)\.' . $projectRegex . 
'\.org\/w\/index\.php\?title=(.*)=(.*))/', $text, $var )) {
+   $pattern = '/(https?:)?\/\/(([a-z\-]+)\.' . $projectRegex . 
'\.org\/w\/index\.php\?title=(.*)=(.*))/';
+   if ( !preg_match( $pattern, $text, $var )) {
throw new Exception('No project link in text.');
}
return $var;
@@ -63,6 +64,16 @@
return str_replace(' ', '_', $in_string);
 }
 
+function matchWikidataQid($url) {
+   /* Extract the Qid from a Wikidata page or entity link */
+   $var = NULL;
+   $pattern = '/(https?:)?\/\/(www\.wikidata\.org\/(wiki|entity)\/(.*))/';
+   if ( !preg_match( $pattern, $url, $var )) {
+   throw new Exception('The provided url was not a wikidata 
link.');
+   }
+   return $var;
+}
+
 function makeWikidataUrl($qid) {
/* Creates a URL to Wikidata from a Qid */
if ( $qid ) {
diff --git a/api/includes/FormatHtml.php b/api/includes/FormatHtml.php
index 7042dff..61a0fb4 100644
--- a/api/includes/FormatHtml.php
+++ b/api/includes/FormatHtml.php
@@ -4,7 +4,7 @@
  * HTML output type, based on XML. This output is for users (and not automated 
tools) so internationalization will be used.
  * @author Joancreus (jcreus), based on Platonides work
  */
-// functions: processWikitext, matchWikiprojectLink, getImageFromCommons, 
makeWikidataUrl
+// functions: processWikitext, matchWikiprojectLink, getImageFromCommons, 
makeWikidataUrl, matchWikidataQid
 require_once ( 'CommonFunctions.php' );
 
 class FormatHtml extends FormatBase {
@@ -29,13 +29,13 @@
 
function outputBegin( $selectedItems ) {
echo '';
-$this->linebreak();
+   $this->linebreak();
echo '';
-$this->linebreak();
+   $this->linebreak();
echo '';
-$this->linebreak();
+   $this->linebreak();
echo '';
-$this->linebreak();
+   $this->linebreak();
echo '';
echo "\n\n\n";
 
@@ -64,7 +64,7 @@
if ( in_array( $name, $selectedItems ) ) {
// $label = $name.'http://commons.wikimedia.org/skins-1.17/common/images/sort_none.gif; 
alt="↑">';
echo '' . _i18n( 
'db-field-' . $name ) . '';
-$this->linebreak();
+   $this->linebreak();
}
}
echo '';
@@ -109,11 +109,11 @@
}
 
echo '' . $cellData . '';
-$this->linebreak();
+   $this->linebreak();
}
}
echo '';
-$this->linebreak();
+   $this->linebreak();
}
 
function outputEnd() {
@@ -134,8 +134,14 @@
$linkText = urldecode( $encodedLinkText );
return self::makeHTMLlink( 'https://' . $m[2], 
$linkText );
} 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Added a separate error message for mkdir failures

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

Change subject: Added a separate error message for mkdir failures
..


Added a separate error message for mkdir failures

Bug: T125595
Change-Id: Id2daaad45c594d6f6265120039ca30742472987e
---
M includes/media/SVG.php
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified
  Thiemo Mättig (WMDE): Looks good to me, but someone else must approve



diff --git a/includes/media/SVG.php b/includes/media/SVG.php
index 1118598..457137b 100644
--- a/includes/media/SVG.php
+++ b/includes/media/SVG.php
@@ -204,7 +204,17 @@
// 
https://git.gnome.org/browse/librsvg/commit/?id=f01aded72c38f0e18bc7ff67dee800e380251c8e
$tmpDir = wfTempDir() . '/svg_' . wfRandomString( 24 );
$lnPath = "$tmpDir/" . basename( $srcPath );
-   $ok = mkdir( $tmpDir, 0771 ) && symlink( $srcPath, $lnPath );
+   $ok = mkdir( $tmpDir, 0771 );
+   if ( !$ok ) {
+   wfDebugLog( 'thumbnail',
+   sprintf( 'Thumbnail failed on %s: could not 
create temporary directory %s',
+   wfHostname(), $tmpDir ) );
+   return new MediaTransformError( 'thumbnail_error',
+   $params['width'], $params['height'],
+   wfMessage( 'thumbnail-temp-create' )->text()
+   );
+   }
+   $ok = symlink( $srcPath, $lnPath );
/** @noinspection PhpUnusedLocalVariableInspection */
$cleaner = new ScopedCallback( function () use ( $tmpDir, 
$lnPath ) {
MediaWiki\suppressWarnings();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2daaad45c594d6f6265120039ca30742472987e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PlasmaPower 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Nemo bis 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Docs: use modern extension loading and array syntax

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

Change subject: Docs: use modern extension loading and array syntax
..


Docs: use modern extension loading and array syntax

Change-Id: I189b15114057aa46407353180241506ec85d8d6b
---
M README
1 file changed, 19 insertions(+), 19 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/README b/README
index 3162216..535b455 100644
--- a/README
+++ b/README
@@ -18,12 +18,12 @@
 Make sure you have the curl php library installed (sudo apt-get install 
php5-curl in Debian.)
 You also need to install the Elastica MediaWiki extension.
 Add this to LocalSettings.php:
- require_once( "$IP/extensions/Elastica/Elastica.php" );
+ wfLoadExtension( 'Elastica' );
  require_once( "$IP/extensions/CirrusSearch/CirrusSearch.php" );
  $wgDisableSearchUpdate = true;
 
 Configure your search servers in LocalSettings.php if you aren't running 
Elasticsearch on localhost:
- $wgCirrusSearchServers = array( 'elasticsearch0', 'elasticsearch1', 
'elasticsearch2', 'elasticsearch3' );
+ $wgCirrusSearchServers = [ 'elasticsearch0', 'elasticsearch1', 
'elasticsearch2', 'elasticsearch3' ];
 There are other $wgCirrusSearch variables that you might want to change from 
their defaults.
 
 Now run this script to generate your elasticsearch index:
@@ -110,39 +110,39 @@
 CirrusSearch can leverage the PoolCounter extension to limit the number of 
concurrent searches to
 elasticsearch.  You can do this by installing the PoolCounter extension and 
then configuring it in
 LocalSettings.php like so:
- require_once( "$IP/extensions/PoolCounter/PoolCounterClient.php");
+ wfLoadExtension( 'PoolCounter');
  // Configuration for standard searches.
- $wgPoolCounterConf[ 'CirrusSearch-Search' ] = array(
+ $wgPoolCounterConf[ 'CirrusSearch-Search' ] = [
'class' => 'PoolCounter_Client',
'timeout' => 30,
'workers' => 25,
'maxqueue' => 50,
- );
+ ];
  // Configuration for prefix searches.  These are usually quite quick and
  // plentiful.
- $wgPoolCounterConf[ 'CirrusSearch-Prefix' ] = array(
+ $wgPoolCounterConf[ 'CirrusSearch-Prefix' ] = [
'class' => 'PoolCounter_Client',
'timeout' => 10,
'workers' => 50,
'maxqueue' => 100,
- );
+ ];
  // Configuration for regex searches.  These are slow and use lots of resources
  // so we only allow a few at a time.
- $wgPoolCounterConf[ 'CirrusSearch-Regex' ] = array(
+ $wgPoolCounterConf[ 'CirrusSearch-Regex' ] = [
'class' => 'PoolCounter_Client',
'timeout' => 30,
'workers' => 10,
'maxqueue' => 10,
- );
+ ];
  // Configuration for funky namespace lookups.  These should be reasonably fast
  // and reasonably rare.
- $wgPoolCounterConf[ 'CirrusSearch-NamespaceLookup' ] = array(
+ $wgPoolCounterConf[ 'CirrusSearch-NamespaceLookup' ] = [
'class' => 'PoolCounter_Client',
'timeout' => 10,
'workers' => 20,
'maxqueue' => 20,
),
- );
+ ];
 
 Upgrading
 -
@@ -232,22 +232,22 @@
 correct.  The reason for this is that this configuration allows Cirrus to 
delay link counts
 until Elasticsearch has appropriately refreshed.  This is an example of 
configuring it:
  $redisPassword = '';
- $wgJobTypeConf['default'] = array(
+ $wgJobTypeConf['default'] = [
'class' => 'JobQueueRedis',
'order' => 'fifo',
'redisServer' => 'localhost',
'checkDelay' => true,
-   'redisConfig' => array(
+   'redisConfig' => [
'password' => $redisPassword,
-   ),
- );
- $wgJobQueueAggregator = array(
+   ],
+ ];
+ $wgJobQueueAggregator = [
'class'   => 'JobQueueAggregatorRedis',
'redisServer' => 'localhost',
-   'redisConfig' => array(
+   'redisConfig' => [
'password' => $redisPassword,
-   ),
- );
+   ],
+ ];
 
 Note: some MediaWiki setups have trouble running the job queue.  It can be 
finicky. The most
 sure fire way to get it to work is also the slowest.  Add this to your 
LocalSettings.php:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I189b15114057aa46407353180241506ec85d8d6b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Cindy-the-browser-test-bot 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: Tjones 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove pointless showExternalRecentChanges option.

2017-08-09 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370974 )

Change subject: Remove pointless showExternalRecentChanges option.
..

Remove pointless showExternalRecentChanges option.

Change-Id: I67de8daf7fcdc3c27a2e6470ac25cc6b600c3802
---
M client/WikibaseClient.hooks.php
M client/config/WikibaseClient.default.php
M client/config/WikibaseClient.example.php
M client/includes/Hooks/ChangesListSpecialPageHookHandlers.php
M docs/options.wiki
5 files changed, 3 insertions(+), 58 deletions(-)


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

diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 4853c6d..f0d6458 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -252,10 +252,6 @@
public static function onGetPreferences( User $user, array &$prefs ) {
$settings = WikibaseClient::getDefaultInstance()->getSettings();
 
-   if ( !$settings->getSetting( 'showExternalRecentChanges' ) ) {
-   return true;
-   }
-
$prefs['rcshowwikidata'] = [
'type' => 'toggle',
'label-message' => 'wikibase-rc-show-wikidata-pref',
diff --git a/client/config/WikibaseClient.default.php 
b/client/config/WikibaseClient.default.php
index 29b8098..023acfe 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -24,7 +24,6 @@
// but we will need to make sure the caching works good enough
'siteLocalID' => $wgLanguageCode,
'languageLinkSiteGroup' => null,
-   'showExternalRecentChanges' => true,
'sendEchoNotification' => false,
'echoIcon' => false,
'allowDataTransclusion' => true,
diff --git a/client/config/WikibaseClient.example.php 
b/client/config/WikibaseClient.example.php
index 07d4489..03f2cfe 100644
--- a/client/config/WikibaseClient.example.php
+++ b/client/config/WikibaseClient.example.php
@@ -20,8 +20,6 @@
 // Defaults to $wgDBname.
 // $wgWBClientSettings['siteGlobalID'] = "mywiki";
 
-$wgWBClientSettings['showExternalRecentChanges'] = true;
-
 // If this wiki also runs the Wikibase repo extension,
 // use the automatic defaults for repo-related settings.
 // If this wiki isn't running the repo extension,
diff --git a/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php 
b/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php
index 26ea3b9..ecfb0c4 100644
--- a/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php
+++ b/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php
@@ -44,11 +44,6 @@
private $pageName;
 
/**
-* @var bool
-*/
-   private $showExternalChanges;
-
-   /**
 * @var self
 */
private static $instance = null;
@@ -58,20 +53,17 @@
 * @param User $user
 * @param LoadBalancer $loadBalancer
 * @param string $pageName
-* @param bool $showExternalChanges
 */
public function __construct(
WebRequest $request,
User $user,
LoadBalancer $loadBalancer,
-   $pageName,
-   $showExternalChanges
+   $pageName
) {
$this->request = $request;
$this->user = $user;
$this->loadBalancer = $loadBalancer;
$this->pageName = $pageName;
-   $this->showExternalChanges = $showExternalChanges;
}
 
/**
@@ -92,8 +84,7 @@
$context->getRequest(),
$context->getUser(),
MediaWikiServices::getInstance()->getDBLoadBalancer(),
-   $specialPageName,
-   $settings->getSetting( 'showExternalRecentChanges' )
+   $specialPageName
);
}
 
@@ -162,40 +153,9 @@
$specialPageName
);
 
-   $hookHandler->addWikibaseConditionsIfFilterUnavailable( $conds 
);
+   // FIXME: now the hook hander is unused - can this entire 
method go away?
 
return true;
-   }
-
-   // This is separate so hasWikibaseChangesEnabled can be mocked
-
-   /**
-* This is used to force-hide Wikibase changes if 
hasWikibaseChangesEnabled returns
-* false.  The user will not even see the option in that case.
-*
-* @param array &$conds
-*/
-   protected function addWikibaseConditionsIfFilterUnavailable( array 
&$conds ) {
-   if ( !$this->hasWikibaseChangesEnabled() ) {
-   // Force-hide if hasWikibaseChangesEnabled is false
-   // The user-facing 

[MediaWiki-commits] [Gerrit] mediawiki...NewUserNotif[master]: Replacing deprecated AddNewAccount Hook

2017-08-09 Thread Louperivois (Code Review)
Louperivois has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370973 )

Change subject: Replacing deprecated AddNewAccount Hook
..

Replacing deprecated AddNewAccount Hook

Bug: T135274
Change-Id: I283185bb4acf6fdf41ef71413c392e8cc0d67f84
---
M NewUserNotif.class.php
M NewUserNotif.php
2 files changed, 5 insertions(+), 14 deletions(-)


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

diff --git a/NewUserNotif.class.php b/NewUserNotif.class.php
index 975af8c..ada88b0 100644
--- a/NewUserNotif.class.php
+++ b/NewUserNotif.class.php
@@ -16,7 +16,7 @@
/**
 * Constructor
 */
-   public function NewUserNotifier() {
+   public function __construct() {
global $wgNewUserNotifSender;
$this->sender = $wgNewUserNotifSender;
}
@@ -120,9 +120,10 @@
 * Hook account creation
 *
 * @param User $user User that was created
+* @param Boolean $autocreated, whether this was an auto-creation
 * @return bool
 */
-   public static function hook( $user ) {
+   public static function hook( $user, $autocreated ) {
$notifier = new self();
$notifier->execute( $user );
return true;
diff --git a/NewUserNotif.php b/NewUserNotif.php
index f80dd9e..9d55ae8 100644
--- a/NewUserNotif.php
+++ b/NewUserNotif.php
@@ -15,7 +15,7 @@
 $wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name'   => 'New User Email Notification',
-   'version'=> '1.6.0',
+   'version'=> '1.7.0',
'author' => 'Rob Church',
'url'=> 
'https://www.mediawiki.org/wiki/Extension:New_User_Email_Notification',
'descriptionmsg' => 'newusernotif-desc',
@@ -47,15 +47,5 @@
  */
 function efNewUserNotifSetup() {
global $wgHooks;
-   $wgHooks['AddNewAccount'][] = 'efNewUserNotif';
-}
-
-/**
- * Hook account creation
- *
- * @param User $user User account that was created
- * @return bool
- */
-function efNewUserNotif( $user ) {
-   return NewUserNotifier::hook( $user );
+   $wgHooks['LocalUserCreated'][] = 'NewUserNotifier::hook';
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I283185bb4acf6fdf41ef71413c392e8cc0d67f84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/NewUserNotif
Gerrit-Branch: master
Gerrit-Owner: Louperivois 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: remove unused injectrecentChanges option

2017-08-09 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370972 )

Change subject: remove unused injectrecentChanges option
..

remove unused injectrecentChanges option

This setting has been ineffective since I19f29d7784fae

Change-Id: I3d38a459460f19744fbfdb8ff31c0a9ededb8499
---
M client/config/WikibaseClient.default.php
M client/config/WikibaseClient.example.php
M client/includes/Changes/ChangeHandler.php
M client/includes/WikibaseClient.php
M client/tests/phpunit/includes/Changes/ChangeHandlerTest.php
M docs/options.wiki
6 files changed, 4 insertions(+), 30 deletions(-)


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

diff --git a/client/config/WikibaseClient.default.php 
b/client/config/WikibaseClient.default.php
index 0f233c3..29b8098 100644
--- a/client/config/WikibaseClient.default.php
+++ b/client/config/WikibaseClient.default.php
@@ -24,7 +24,6 @@
// but we will need to make sure the caching works good enough
'siteLocalID' => $wgLanguageCode,
'languageLinkSiteGroup' => null,
-   'injectRecentChanges' => true,
'showExternalRecentChanges' => true,
'sendEchoNotification' => false,
'echoIcon' => false,
diff --git a/client/config/WikibaseClient.example.php 
b/client/config/WikibaseClient.example.php
index 27469f0..07d4489 100644
--- a/client/config/WikibaseClient.example.php
+++ b/client/config/WikibaseClient.example.php
@@ -20,7 +20,6 @@
 // Defaults to $wgDBname.
 // $wgWBClientSettings['siteGlobalID'] = "mywiki";
 
-$wgWBClientSettings['injectRecentChanges'] = true;
 $wgWBClientSettings['showExternalRecentChanges'] = true;
 
 // If this wiki also runs the Wikibase repo extension,
diff --git a/client/includes/Changes/ChangeHandler.php 
b/client/includes/Changes/ChangeHandler.php
index 58dc2ec..3c65800 100644
--- a/client/includes/Changes/ChangeHandler.php
+++ b/client/includes/Changes/ChangeHandler.php
@@ -50,23 +50,11 @@
private $siteLookup;
 
/**
-* @var string
-*/
-   private $repoId;
-
-   /**
-* @var bool
-*/
-   private $injectRecentChanges;
-
-   /**
 * @param AffectedPagesFinder $affectedPagesFinder
 * @param TitleFactory $titleFactory
 * @param PageUpdater $updater
 * @param ChangeRunCoalescer $changeRunCoalescer
 * @param SiteLookup $siteLookup
-* @param string $repoId
-* @param bool $injectRecentChanges
 *
 * @throws InvalidArgumentException
 */
@@ -75,21 +63,13 @@
TitleFactory $titleFactory,
PageUpdater $updater,
ChangeRunCoalescer $changeRunCoalescer,
-   SiteLookup $siteLookup,
-   $repoId,
-   $injectRecentChanges = true
+   SiteLookup $siteLookup
) {
-   if ( !is_bool( $injectRecentChanges ) ) {
-   throw new InvalidArgumentException( 
'$injectRecentChanges must be a bool' );
-   }
-
$this->affectedPagesFinder = $affectedPagesFinder;
$this->titleFactory = $titleFactory;
$this->updater = $updater;
$this->changeRunCoalescer = $changeRunCoalescer;
$this->siteLookup = $siteLookup;
-   $this->repoId = $repoId;
-   $this->injectRecentChanges = $injectRecentChanges;
}
 
/**
diff --git a/client/includes/WikibaseClient.php 
b/client/includes/WikibaseClient.php
index 164f09f..8a250dc 100644
--- a/client/includes/WikibaseClient.php
+++ b/client/includes/WikibaseClient.php
@@ -1199,8 +1199,7 @@
new TitleFactory(),
$pageUpdater,
$changeListTransformer,
-   $this->siteLookup,
-   $this->settings->getSetting( 'injectRecentChanges' )
+   $this->siteLookup
);
}
 
diff --git a/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php 
b/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php
index a3dc146..5857711 100644
--- a/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php
+++ b/client/tests/phpunit/includes/Changes/ChangeHandlerTest.php
@@ -78,9 +78,7 @@
$titleFactory,
$updater ?: new MockPageUpdater(),
$this->getChangeRunCoalescer(),
-   $this->getMock( SiteLookup::class ),
-   'repowiki',
-   true
+   $this->getMock( SiteLookup::class )
);
 
return $handler;
diff --git a/docs/options.wiki b/docs/options.wiki
index f1905ca..3e8a570 100644
--- a/docs/options.wiki
+++ b/docs/options.wiki

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Temporarily add class alias for EntityRevision

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

Change subject: Temporarily add class alias for EntityRevision
..


Temporarily add class alias for EntityRevision

Apparently there are serialized instances of EntityRevision
using the old FQN in cache.

The alias could be removed after all caches are only using
new namespace.

Bug: T172616
Change-Id: I3839fff8d8bf21391e50a3f6dfd964ab5e4a4edd
---
M 
client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
M data-access/src/DispatchingServiceFactory.php
M data-access/src/RepositoryServiceContainer.php
M data-access/tests/phpunit/DispatchingServiceFactoryTest.php
M data-access/tests/phpunit/RepositoryServiceContainerTest.php
M lib/WikibaseLib.php
M lib/includes/Store/Sql/PrefetchingWikiPageEntityMetaDataAccessor.php
M lib/includes/Store/Sql/WikiPageEntityRevisionLookup.php
M lib/tests/phpunit/EntityRevisionLookupTest.php
M lib/tests/phpunit/MockRepository.php
M lib/tests/phpunit/MockRepositoryTest.php
M lib/tests/phpunit/Store/CachingEntityRevisionLookupTest.php
M lib/tests/phpunit/Store/DispatchingEntityRevisionLookupTest.php
M lib/tests/phpunit/Store/EntityRevisionTest.php
M lib/tests/phpunit/Store/PrefetchingWikiPageEntityMetaDataAccessorTest.php
M repo/Wikibase.hooks.php
M repo/includes/Api/EntityLoadingHelper.php
M repo/includes/Api/GetEntities.php
M repo/includes/Api/MergeItems.php
M repo/includes/Api/ResultBuilder.php
M repo/includes/Content/EntityContent.php
M repo/includes/EditEntity.php
M repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.php
M repo/includes/LinkedData/EntityDataRequestHandler.php
M repo/includes/LinkedData/EntityDataSerializationService.php
M repo/includes/Specials/SpecialMergeItems.php
M repo/includes/Specials/SpecialModifyEntity.php
M repo/includes/Store/DispatchingEntityStoreWatcher.php
M repo/includes/Store/Sql/WikiPageEntityStore.php
M repo/tests/phpunit/includes/Actions/ActionTestCase.php
M repo/tests/phpunit/includes/Api/ApiFormatTestCase.php
M repo/tests/phpunit/includes/Api/EntityLoadingHelperTest.php
M repo/tests/phpunit/includes/Api/ResultBuilderTest.php
M repo/tests/phpunit/includes/Dumpers/RdfDumpGeneratorTest.php
M repo/tests/phpunit/includes/Hooks/OutputPageBeforeHTMLHookHandlerTest.php
M repo/tests/phpunit/includes/ItemMoveTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataSerializationServiceTest.php
M repo/tests/phpunit/includes/LinkedData/EntityDataTestProvider.php
M repo/tests/phpunit/includes/PropertyDataTypeChangerTest.php
M repo/tests/phpunit/includes/Store/Sql/WikiPageEntityMetaDataLookupTest.php
M repo/tests/phpunit/includes/Store/WikiPageEntityRevisionLookupTest.php
41 files changed, 139 insertions(+), 134 deletions(-)

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



diff --git 
a/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
 
b/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
index 8b1349d..dc5b87a 100644
--- 
a/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
+++ 
b/client/tests/phpunit/includes/DataAccess/StatementTransclusionInteractorTest.php
@@ -17,7 +17,7 @@
 use Wikibase\DataModel\Entity\PropertyId;
 use Wikibase\DataModel\Snak\PropertyValueSnak;
 use Wikibase\DataModel\Snak\Snak;
-use Wikibase\Lib\Store\EntityRevision;
+use Wikibase\Lib\Store\EntityRevision as TheEntityRevision;
 use Wikibase\Lib\SnakFormatter;
 use Wikibase\Lib\Store\EntityRevisionLookup;
 use Wikibase\Lib\Store\RevisionBasedEntityLookup;
@@ -231,7 +231,7 @@
->will( $this->returnCallback( function( EntityId 
$entityId ) {
switch ( $entityId->getSerialization() ) {
case 'Q42':
-   return new EntityRevision( new 
Item( new ItemId( 'Q42' ) ) );
+   return new TheEntityRevision( 
new Item( new ItemId( 'Q42' ) ) );
case 'Q43':
throw new 
RevisionedUnresolvedRedirectException(
$entityId,
diff --git a/data-access/src/DispatchingServiceFactory.php 
b/data-access/src/DispatchingServiceFactory.php
index c3ef487..825ac17 100644
--- a/data-access/src/DispatchingServiceFactory.php
+++ b/data-access/src/DispatchingServiceFactory.php
@@ -8,7 +8,7 @@
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\EntityRedirect;
 use Wikibase\DataModel\Services\Term\TermBuffer;
-use Wikibase\Lib\Store\EntityRevision;
+use Wikibase\Lib\Store\EntityRevision as TheEntityRevision;
 use Wikibase\Lib\Interactors\TermSearchInteractorFactory;
 use Wikibase\Lib\RepositoryDefinitions;
 use Wikibase\Lib\Store\EntityInfoBuilderFactory;
@@ -88,9 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Remove incorrect RESTBase error handling & preserve error bo...

2017-08-09 Thread Mholloway (Code Review)
Mholloway has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370971 )

Change subject: Remove incorrect RESTBase error handling & preserve error bodies
..

Remove incorrect RESTBase error handling & preserve error bodies

Several RESTBase response model classes currently expect an error response
object to be contained in an "error" field similar to the MediaWiki API's
error response structure, but RESTBase doesn't return errors this way; it
simply sends the error object.  Hence it will never be picked up in the
way it's currently expected.

This removes the code described above and updates the HttpStatusException
constructor to preserve the error response body (rather than discarding it
as it does now) so that the additional error information from RESTBase is
available if needed.

Bug: T150859
Change-Id: I154fa0df9f7cc4b9dca307b6bf5497993babc50c
---
M app/src/main/java/org/wikipedia/dataclient/mwapi/MwServiceError.java
M app/src/main/java/org/wikipedia/dataclient/okhttp/HttpStatusException.java
M app/src/main/java/org/wikipedia/dataclient/restbase/RbDefinition.java
M app/src/main/java/org/wikipedia/dataclient/restbase/RbServiceError.java
M app/src/main/java/org/wikipedia/dataclient/restbase/page/RbPageLead.java
M app/src/main/java/org/wikipedia/dataclient/restbase/page/RbPageSummary.java
6 files changed, 32 insertions(+), 49 deletions(-)


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

diff --git 
a/app/src/main/java/org/wikipedia/dataclient/mwapi/MwServiceError.java 
b/app/src/main/java/org/wikipedia/dataclient/mwapi/MwServiceError.java
index 4326622..24ce4a0 100644
--- a/app/src/main/java/org/wikipedia/dataclient/mwapi/MwServiceError.java
+++ b/app/src/main/java/org/wikipedia/dataclient/mwapi/MwServiceError.java
@@ -5,6 +5,7 @@
 
 import org.apache.commons.lang3.StringUtils;
 import org.wikipedia.dataclient.ServiceError;
+import org.wikipedia.model.BaseModel;
 
 import java.util.Collections;
 import java.util.List;
@@ -12,7 +13,7 @@
 /**
  * Gson POJO for a MediaWiki API error.
  */
-public class MwServiceError implements ServiceError {
+public class MwServiceError extends BaseModel implements ServiceError {
 @SuppressWarnings("unused") @Nullable private String code;
 @SuppressWarnings("unused") @Nullable private String info;
 @SuppressWarnings("unused") @Nullable private String docref;
@@ -50,14 +51,6 @@
 }
 }
 return null;
-}
-
-@Override public String toString() {
-return "MwServiceError{"
-+ "code='" + code + '\''
-+ ", info='" + info + '\''
-+ ", docref='" + docref + '\''
-+ '}';
 }
 
 private static final class Message {
diff --git 
a/app/src/main/java/org/wikipedia/dataclient/okhttp/HttpStatusException.java 
b/app/src/main/java/org/wikipedia/dataclient/okhttp/HttpStatusException.java
index 36c5ee0..b3e2305 100644
--- a/app/src/main/java/org/wikipedia/dataclient/okhttp/HttpStatusException.java
+++ b/app/src/main/java/org/wikipedia/dataclient/okhttp/HttpStatusException.java
@@ -8,12 +8,24 @@
 
 public class HttpStatusException extends IOException {
 private final int code;
+@NonNull private String string = "";
 
 public HttpStatusException(@NonNull Response rsp) {
 this.code = rsp.code();
+try {
+this.string = rsp.body().string();
+} catch (NullPointerException|IOException e) {
+// let it go
+}
 }
 
 public int code() {
 return code;
 }
+
+// Can be used to obtain the body of the RESTBase error response, in the 
event this is a
+// RESTBase error
+@NonNull public String string() {
+return string;
+}
 }
diff --git 
a/app/src/main/java/org/wikipedia/dataclient/restbase/RbDefinition.java 
b/app/src/main/java/org/wikipedia/dataclient/restbase/RbDefinition.java
index cbedbc3..b68a06e 100644
--- a/app/src/main/java/org/wikipedia/dataclient/restbase/RbDefinition.java
+++ b/app/src/main/java/org/wikipedia/dataclient/restbase/RbDefinition.java
@@ -4,13 +4,11 @@
 import android.support.annotation.Nullable;
 
 import org.wikipedia.json.annotations.Required;
-import org.wikipedia.util.log.L;
 
 import java.util.Map;
 
 public class RbDefinition {
 @Required @NonNull private Map usagesByLang;
-@SuppressWarnings("unused") @Nullable private RbServiceError error;
 
 public RbDefinition(@NonNull Map usages) {
 usagesByLang = usages;
@@ -18,17 +16,6 @@
 
 @Nullable public Usage[] getUsagesForLang(String langCode) {
 return usagesByLang.get(langCode);
-}
-
-public boolean hasError() {
-return error != null;
-}
-
-public void logError(String message) {
-if (error != null) {
-message += ": " + error.toString();
-}
-   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix T172959 by adding a simple .editorconfig

2017-08-09 Thread Dbarratt (Code Review)
Dbarratt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370970 )

Change subject: Fix T172959 by adding a simple .editorconfig
..

Fix T172959 by adding a simple .editorconfig

Add a simple .editorconfig file that is consistant with MediaWiki coding 
standards.

Bug: T172959
Change-Id: I8e776665dca255ff5dead1a9874bcd73344e4d20
---
A .editorconfig
1 file changed, 11 insertions(+), 0 deletions(-)


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

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000..9231818
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,11 @@
+root = true
+
+[*]
+indent_style = tab
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: mediawiki: switch gothic/mincho fonts to new package names

2017-08-09 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370969 )

Change subject: mediawiki: switch gothic/mincho fonts to new package names
..

mediawiki: switch gothic/mincho fonts to new package names

The legacy packages have been removed from stretch.

Bug: T170817
Change-Id: Ie67173f4fcf2b92d89a3c7fd02aa0cc94b8bcfbe
---
M modules/mediawiki/manifests/packages/fonts.pp
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/69/370969/1

diff --git a/modules/mediawiki/manifests/packages/fonts.pp 
b/modules/mediawiki/manifests/packages/fonts.pp
index 8c7cef6..19afa4d 100644
--- a/modules/mediawiki/manifests/packages/fonts.pp
+++ b/modules/mediawiki/manifests/packages/fonts.pp
@@ -42,8 +42,6 @@
 'fonts-vlgothic',# T66002
 'fonts-dejavu-core', # T65206
 'fonts-dejavu-extra',# T65206
-'ttf-kochi-gothic',  # T66002
-'ttf-kochi-mincho',  # T66002
 'fonts-lyx', # T40299
 'fonts-crosextra-carlito',   # T84842
 'fonts-crosextra-caladea',   # T84842
@@ -55,11 +53,11 @@
 }
 
 if os_version('ubuntu >= trusty') {
-require_package('ttf-bengali-fonts', 'ttf-devanagari-fonts', 
'ttf-gujarati-fonts', 'ttf-kannada-fonts', 'ttf-oriya-fonts', 
'ttf-punjabi-fonts', 'ttf-tamil-fonts', 'ttf-telugu-fonts')
+require_package('ttf-bengali-fonts', 'ttf-devanagari-fonts', 
'ttf-gujarati-fonts', 'ttf-kannada-fonts', 'ttf-oriya-fonts', 
'ttf-punjabi-fonts', 'ttf-tamil-fonts', 'ttf-telugu-fonts', 'ttf-kochi-gothic', 
'ttf-kochi-mincho')
 }
 
 if os_version('debian >= jessie') {
-require_package('fonts-beng', 'fonts-deva', 'fonts-gujr', 
'fonts-knda', 'fonts-mlym', 'fonts-orya', 'fonts-guru', 'fonts-taml', 
'fonts-telu', 'fonts-gujr-extra', 'fonts-noto-cjk', 'fonts-sil-lateef')
+require_package('fonts-beng', 'fonts-deva', 'fonts-gujr', 
'fonts-knda', 'fonts-mlym', 'fonts-orya', 'fonts-guru', 'fonts-taml', 
'fonts-telu', 'fonts-gujr-extra', 'fonts-noto-cjk', 'fonts-sil-lateef', 
'fonts-ipafont-gothic', 'fonts-ipafont-mincho')
 }
 
 # In older releases (up to the version present in trusty), 
fontconfig-config provided

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie67173f4fcf2b92d89a3c7fd02aa0cc94b8bcfbe
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Docs: use modern extension loading and array syntax

2017-08-09 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370967 )

Change subject: Docs: use modern extension loading and array syntax
..

Docs: use modern extension loading and array syntax

Change-Id: I189b15114057aa46407353180241506ec85d8d6b
---
M README
1 file changed, 20 insertions(+), 20 deletions(-)


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

diff --git a/README b/README
index 3162216..169c5f8 100644
--- a/README
+++ b/README
@@ -18,12 +18,12 @@
 Make sure you have the curl php library installed (sudo apt-get install 
php5-curl in Debian.)
 You also need to install the Elastica MediaWiki extension.
 Add this to LocalSettings.php:
- require_once( "$IP/extensions/Elastica/Elastica.php" );
- require_once( "$IP/extensions/CirrusSearch/CirrusSearch.php" );
+ wfLoadExtension( 'Elastica' );
+ wfLoadExtension( 'CirrusSearch' );
  $wgDisableSearchUpdate = true;
 
 Configure your search servers in LocalSettings.php if you aren't running 
Elasticsearch on localhost:
- $wgCirrusSearchServers = array( 'elasticsearch0', 'elasticsearch1', 
'elasticsearch2', 'elasticsearch3' );
+ $wgCirrusSearchServers = [ 'elasticsearch0', 'elasticsearch1', 
'elasticsearch2', 'elasticsearch3' ];
 There are other $wgCirrusSearch variables that you might want to change from 
their defaults.
 
 Now run this script to generate your elasticsearch index:
@@ -110,39 +110,39 @@
 CirrusSearch can leverage the PoolCounter extension to limit the number of 
concurrent searches to
 elasticsearch.  You can do this by installing the PoolCounter extension and 
then configuring it in
 LocalSettings.php like so:
- require_once( "$IP/extensions/PoolCounter/PoolCounterClient.php");
+ wfLoadExtension( 'PoolCounter');
  // Configuration for standard searches.
- $wgPoolCounterConf[ 'CirrusSearch-Search' ] = array(
+ $wgPoolCounterConf[ 'CirrusSearch-Search' ] = [
'class' => 'PoolCounter_Client',
'timeout' => 30,
'workers' => 25,
'maxqueue' => 50,
- );
+ ];
  // Configuration for prefix searches.  These are usually quite quick and
  // plentiful.
- $wgPoolCounterConf[ 'CirrusSearch-Prefix' ] = array(
+ $wgPoolCounterConf[ 'CirrusSearch-Prefix' ] = [
'class' => 'PoolCounter_Client',
'timeout' => 10,
'workers' => 50,
'maxqueue' => 100,
- );
+ ];
  // Configuration for regex searches.  These are slow and use lots of resources
  // so we only allow a few at a time.
- $wgPoolCounterConf[ 'CirrusSearch-Regex' ] = array(
+ $wgPoolCounterConf[ 'CirrusSearch-Regex' ] = [
'class' => 'PoolCounter_Client',
'timeout' => 30,
'workers' => 10,
'maxqueue' => 10,
- );
+ ];
  // Configuration for funky namespace lookups.  These should be reasonably fast
  // and reasonably rare.
- $wgPoolCounterConf[ 'CirrusSearch-NamespaceLookup' ] = array(
+ $wgPoolCounterConf[ 'CirrusSearch-NamespaceLookup' ] = [
'class' => 'PoolCounter_Client',
'timeout' => 10,
'workers' => 20,
'maxqueue' => 20,
),
- );
+ ];
 
 Upgrading
 -
@@ -232,22 +232,22 @@
 correct.  The reason for this is that this configuration allows Cirrus to 
delay link counts
 until Elasticsearch has appropriately refreshed.  This is an example of 
configuring it:
  $redisPassword = '';
- $wgJobTypeConf['default'] = array(
+ $wgJobTypeConf['default'] = [
'class' => 'JobQueueRedis',
'order' => 'fifo',
'redisServer' => 'localhost',
'checkDelay' => true,
-   'redisConfig' => array(
+   'redisConfig' => [
'password' => $redisPassword,
-   ),
- );
- $wgJobQueueAggregator = array(
+   ],
+ ];
+ $wgJobQueueAggregator = [
'class'   => 'JobQueueAggregatorRedis',
'redisServer' => 'localhost',
-   'redisConfig' => array(
+   'redisConfig' => [
'password' => $redisPassword,
-   ),
- );
+   ],
+ ];
 
 Note: some MediaWiki setups have trouble running the job queue.  It can be 
finicky. The most
 sure fire way to get it to work is also the slowest.  Add this to your 
LocalSettings.php:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I189b15114057aa46407353180241506ec85d8d6b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable injection of RC records on wikidata org.

2017-08-09 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370966 )

Change subject: Enable injection of RC records on wikidata org.
..

Enable injection of RC records on wikidata org.

This will cause RecentChanges to show changes to Items
as changes on pages that use the item.

This functionality is enabled on all client wikis.
On Wikidata itself, very few pages use items, so the impact
should be minimal. There is no reason to make wikidata a special
case.

Change-Id: I605f83faa54def1bbfd1b20216fe8ae8f3cd8a0b
---
M wmf-config/Wikibase.php
1 file changed, 0 insertions(+), 2 deletions(-)


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

diff --git a/wmf-config/Wikibase.php b/wmf-config/Wikibase.php
index 7ef0e97..a13e3f6 100644
--- a/wmf-config/Wikibase.php
+++ b/wmf-config/Wikibase.php
@@ -216,8 +216,6 @@
];
 
$wgWBClientSettings['languageLinkSiteGroup'] = 'wikipedia';
-   $wgWBClientSettings['injectRecentChanges'] = false;
-   $wgWBClientSettings['showExternalRecentChanges'] = false;
}
 
foreach ( $wmgWikibaseClientSettings as $setting => $value ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I605f83faa54def1bbfd1b20216fe8ae8f3cd8a0b
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: admin: set devscripts variables for filippo

2017-08-09 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370964 )

Change subject: admin: set devscripts variables for filippo
..


admin: set devscripts variables for filippo

Change-Id: I57c386a6d41b559d54072115615e1bbe11c084db
---
M modules/admin/files/home/filippo/.bashrc
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/modules/admin/files/home/filippo/.bashrc 
b/modules/admin/files/home/filippo/.bashrc
index 1665d21..e2b175a 100644
--- a/modules/admin/files/home/filippo/.bashrc
+++ b/modules/admin/files/home/filippo/.bashrc
@@ -10,6 +10,10 @@
 HISTTIMEFORMAT="%FT%TZ "
 shopt -s histappend
 
+# devscripts
+export DEBEMAIL=fili...@wikimedia.org
+export DEBFULLNAME="Filippo Giunchedi"
+
 # make less more friendly for non-text input files, see lesspipe(1)
 [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
 

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

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

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: DraggableElement: Make toggling draggability consistent

2017-08-09 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370965 )

Change subject: DraggableElement: Make toggling draggability consistent
..

DraggableElement: Make toggling draggability consistent

* Move some setup code from constructor to #toggleDraggable
* Make the constructor call #toggleDraggable

Bug: T172781
Change-Id: I569bb9b5c072c6928a4379cd5ff64b784d775e12
---
M src/mixins/DraggableElement.js
1 file changed, 8 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/65/370965/1

diff --git a/src/mixins/DraggableElement.js b/src/mixins/DraggableElement.js
index 9e4b92f..47cda32 100644
--- a/src/mixins/DraggableElement.js
+++ b/src/mixins/DraggableElement.js
@@ -21,14 +21,10 @@
this.index = null;
this.$handle = config.$handle || this.$element;
this.wasHandleUsed = null;
-   this.draggable = config.draggable === undefined ? true : 
!!config.draggable;
 
// Initialize and events
-   this.$element.addClass( 'oo-ui-draggableElement' )
-   // We make the entire element draggable, not just the handle, 
so that
-   // the whole element appears to move. wasHandleUsed prevents 
drags from
-   // starting outside the handle
-   .attr( 'draggable', true )
+   this.$element
+   .addClass( 'oo-ui-draggableElement' )
.on( {
mousedown: this.onDragMouseDown.bind( this ),
dragstart: this.onDragStart.bind( this ),
@@ -37,6 +33,7 @@
drop: this.onDrop.bind( this )
} );
this.$handle.addClass( 'oo-ui-draggableElement-handle' );
+   this.toggleDraggable( config.draggable === undefined ? true : 
!!config.draggable );
 };
 
 OO.initClass( OO.ui.mixin.DraggableElement );
@@ -85,6 +82,11 @@
this.draggable = isDraggable;
 
this.$handle.toggleClass( 'oo-ui-draggableElement-undraggable', 
!this.draggable );
+
+   // We make the entire element draggable, not just the handle, 
so that
+   // the whole element appears to move. wasHandleUsed prevents 
drags from
+   // starting outside the handle
+   this.$element.prop( 'draggable', this.draggable );
}
 };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I569bb9b5c072c6928a4379cd5ff64b784d775e12
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: admin: set devscripts variables for filippo

2017-08-09 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370964 )

Change subject: admin: set devscripts variables for filippo
..

admin: set devscripts variables for filippo

Change-Id: I57c386a6d41b559d54072115615e1bbe11c084db
---
M modules/admin/files/home/filippo/.bashrc
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/64/370964/1

diff --git a/modules/admin/files/home/filippo/.bashrc 
b/modules/admin/files/home/filippo/.bashrc
index 1665d21..e2b175a 100644
--- a/modules/admin/files/home/filippo/.bashrc
+++ b/modules/admin/files/home/filippo/.bashrc
@@ -10,6 +10,10 @@
 HISTTIMEFORMAT="%FT%TZ "
 shopt -s histappend
 
+# devscripts
+export DEBEMAIL=fili...@wikimedia.org
+export DEBFULLNAME="Filippo Giunchedi"
+
 # make less more friendly for non-text input files, see lesspipe(1)
 [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I57c386a6d41b559d54072115615e1bbe11c084db
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: Update GUI

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

Change subject: Update GUI
..


Update GUI

Change-Id: I69a49f70a9810f01afea64287b5bd9bb6ed2a058
---
M gui
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/gui b/gui
index 2009b22..6ff5249 16
--- a/gui
+++ b/gui
@@ -1 +1 @@
-Subproject commit 2009b2255840495773d9a2a8ae0042e97219c244
+Subproject commit 6ff5249a3db68e5ef74ca23006fe1d80804c577d

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I69a49f70a9810f01afea64287b5bd9bb6ed2a058
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Improve some parameter docs

2017-08-09 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370963 )

Change subject: Improve some parameter docs
..

Improve some parameter docs

Change-Id: Id0862750b6e892e047807bcc3145ffab635f6116
---
M composer.json
M includes/Cache.php
M includes/Hooks.php
M includes/Hooks/PreferencesHookHandler.php
M includes/Scoring.php
M maintenance/CheckModelVersions.php
M maintenance/DumpThresholds.php
M phpcs.xml
8 files changed, 22 insertions(+), 22 deletions(-)


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

diff --git a/composer.json b/composer.json
index 3a00ee9..9800bda 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
"scripts": {
"fix": "phpcbf",
"test": [
-   "parallel-lint . --exclude vendor",
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
"phpcs -s -p"
]
}
diff --git a/includes/Cache.php b/includes/Cache.php
index 5306a6c..9b06564 100644
--- a/includes/Cache.php
+++ b/includes/Cache.php
@@ -61,7 +61,7 @@
 * @param bool $isEverything When true, delete scores with the 
up-to-date
 *   model version as well.  This can be used in cases where the old 
data is
 *   bad, but no new model has been released yet.
-* @param integer $batchSize Maximum number of records to delete per 
loop.
+* @param int $batchSize Maximum number of records to delete per loop.
 *   Note that this function runs multiple batches, until all records 
are deleted.
 * @return int The number of deleted rows
 */
@@ -83,7 +83,7 @@
 * Delete old cached scores.
 * A score is old of the corresponding revision is not in the 
recentchanges table.
 * @param string $model Model name.
-* @param integer $batchSize Maximum number of records to delete per 
loop.
+* @param int $batchSize Maximum number of records to delete per loop.
 *   Note that this function runs multiple batches, until all records 
are deleted.
 * @return int The number of deleted rows
 */
@@ -106,7 +106,7 @@
 * @param array $tables
 * @param array $conditions
 * @param array $join_conds
-* @param integer $batchSize Maximum number of records to delete per 
loop.
+* @param int $batchSize Maximum number of records to delete per loop.
 *   Note that this function runs multiple batches, until all records 
are deleted.
 * @return int The number of deleted rows
 * @see Database::select
diff --git a/includes/Hooks.php b/includes/Hooks.php
index bd4c4ed..eb8b3c0 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -411,10 +411,10 @@
 * Label recent changes with ORES scores (for each change in an 
expanded group)
 *
 * @param EnhancedChangesList $ecl
-* @param array $data
+* @param array &$data
 * @param RCCacheEntry[] $block
 * @param RCCacheEntry $rcObj
-* @param string[] $classes
+* @param string[] &$classes
 */
public static function onEnhancedChangesListModifyLineData(
EnhancedChangesList $ecl,
@@ -434,7 +434,7 @@
 * Label recent changes with ORES scores (for top-level ungrouped lines)
 *
 * @param EnhancedChangesList $ecl
-* @param array $data
+* @param array &$data
 * @param RCCacheEntry $rcObj
 */
public static function onEnhancedChangesListModifyBlockLineData(
@@ -455,10 +455,11 @@
 * Hook for formatting recent changes links
 * @see 
https://www.mediawiki.org/wiki/Manual:Hooks/OldChangesListRecentChangesLine
 *
-* @param ChangesList $changesList
-* @param string $s
+* @param ChangesList &$changesList
+* @param string &$s
 * @param RecentChange $rc
 * @param string[] &$classes
+* @return bool|void
 */
public static function onOldChangesListRecentChangesLine(
ChangesList &$changesList,
@@ -499,7 +500,7 @@
 * Filter out non-damaging changes from Special:Contributions
 *
 * @param ContribsPager $pager
-* @param array $query
+* @param array &$query
 */
public static function onContribsGetQueryInfo(
ContribsPager $pager,
@@ -685,8 +686,8 @@
/**
 * Add CSS styles to output page
 *
-* @param OutputPage $out
-* @param Skin $skin
+* @param OutputPage &$out
+* @param Skin &$skin
 */
public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
if ( !self::oresUiEnabled( $out->getUser() ) ) {
@@ -774,7 +775,7 @@
 
/**
 * @param 

[MediaWiki-commits] [Gerrit] operations/software[master]: s6.host: Add db2076 to s6

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

Change subject: s6.host: Add db2076 to s6
..


s6.host: Add db2076 to s6

db2076 is going to be a new slave on s6

Bug: T170662
Change-Id: I30a21b17469050e504915d1b2eb514ccd7c28cab
---
M dbtools/s6.hosts
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/dbtools/s6.hosts b/dbtools/s6.hosts
index 6c398e5..3e862cc 100644
--- a/dbtools/s6.hosts
+++ b/dbtools/s6.hosts
@@ -1,4 +1,5 @@
 dbstore2001.codfw.wmnet3306
+db2076.codfw.wmnet 3306
 db2039.codfw.wmnet 3306
 db2046.codfw.wmnet 3306
 db2053.codfw.wmnet 3306

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...OAuth[master]: Improve some parameter docs

2017-08-09 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370961 )

Change subject: Improve some parameter docs
..

Improve some parameter docs

Change-Id: I4533c509b893790b05420d1b9132f3de7297c3e9
---
M backend/MWOAuth.hooks.php
M backend/MWOAuthConsumer.php
M backend/MWOAuthConsumerAcceptance.php
M backend/MWOAuthDAO.php
M backend/MWOAuthServer.php
M backend/MWOAuthSignatureMethod.php
M backend/MWOAuthUtils.php
M control/MWOAuthSubmitControl.php
M phpcs.xml
9 files changed, 32 insertions(+), 28 deletions(-)


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

diff --git a/backend/MWOAuth.hooks.php b/backend/MWOAuth.hooks.php
index fb23e61..e558571 100644
--- a/backend/MWOAuth.hooks.php
+++ b/backend/MWOAuth.hooks.php
@@ -93,7 +93,7 @@
 * flooding Special:Tags with tags for consumers that will never be 
making
 * logged actions.
 *
-* @param boolean $activeOnly true for ChangeTagsListActive, false for 
ListDefinedTags
+* @param bool $activeOnly true for ChangeTagsListActive, false for 
ListDefinedTags
 * @param array &$tags
 * @return bool
 */
diff --git a/backend/MWOAuthConsumer.php b/backend/MWOAuthConsumer.php
index afc3e0d..98ae243 100644
--- a/backend/MWOAuthConsumer.php
+++ b/backend/MWOAuthConsumer.php
@@ -32,13 +32,13 @@
'authonlyprivate' => 'mwoauth-authonlyprivate',
];
 
-   /** @var integer Unique ID */
+   /** @var int Unique ID */
protected $id;
/** @var string Hex token */
protected $consumerKey;
/** @var string Name of connected application */
protected $name;
-   /** @var integer Publisher's central user ID. $wgMWOAuthSharedUserIDs 
defines which central ID
+   /** @var int Publisher's central user ID. $wgMWOAuthSharedUserIDs 
defines which central ID
 *provider to use. */
protected $userId;
/** @var string Version used for handshake breaking changes */
@@ -72,11 +72,11 @@
protected $grants;
/** @var \\MWRestrictions IP restrictions */
protected $restrictions;
-   /** @var integer MWOAuthConsumer::STAGE_* constant */
+   /** @var int MWOAuthConsumer::STAGE_* constant */
protected $stage;
/** @var string TS_MW timestamp of last stage change */
protected $stageTimestamp;
-   /** @var integer Indicates (if non-zero) this consumer's information is 
suppressed */
+   /** @var int Indicates (if non-zero) this consumer's information is 
suppressed */
protected $deleted;
 
/* Stages that registered consumer takes (stored in DB) */
@@ -160,7 +160,7 @@
/**
 * @param \DBConnRef $db
 * @param string $key
-* @param integer $flags MWOAuthConsumer::READ_* bitfield
+* @param int $flags MWOAuthConsumer::READ_* bitfield
 * @return MWOAuthConsumer|bool
 */
public static function newFromKey( \DBConnRef $db, $key, $flags = 0 ) {
@@ -184,8 +184,8 @@
 * @param \DBConnRef $db
 * @param string $name
 * @param string $version
-* @param integer $userId Central user ID
-* @param integer $flags MWOAuthConsumer::READ_* bitfield
+* @param int $userId Central user ID
+* @param int $flags MWOAuthConsumer::READ_* bitfield
 * @return MWOAuthConsumer|bool
 */
public static function newFromNameVersionUser(
@@ -322,6 +322,8 @@
 * Magic method so that $consumer->secret and $consumer->key work.
 * This allows MWOAuthConsumer to be a replacement for OAuthConsumer
 * in lib/OAuth.php without inheriting.
+* @param mixed $prop
+* @return mixed
 */
public function __get( $prop ) {
if ( $prop === 'key' ) {
diff --git a/backend/MWOAuthConsumerAcceptance.php 
b/backend/MWOAuthConsumerAcceptance.php
index b5c71fa..27969ec 100644
--- a/backend/MWOAuthConsumerAcceptance.php
+++ b/backend/MWOAuthConsumerAcceptance.php
@@ -25,13 +25,13 @@
  * Representation of an OAuth consumer acceptance
  */
 class MWOAuthConsumerAcceptance extends MWOAuthDAO {
-   /** @var integer Unique ID */
+   /** @var int Unique ID */
protected $id;
/** @var string Wiki ID the application can be used on (or "*" for all) 
*/
protected $wiki;
-   /** @var integer Publisher user ID (on central wiki) */
+   /** @var int Publisher user ID (on central wiki) */
protected $userId;
-   /** @var integer */
+   /** @var int */
protected $consumerId;
/** @var string Hex token */
protected $accessToken;
@@ -75,7 +75,7 @@
/**
 * @param \DBConnRef $db
 * @param string $token Access token
-* @param integer $flags MWOAuthConsumerAcceptance::READ_* bitfield
+* @param 

[MediaWiki-commits] [Gerrit] operations...pybal[master]: WIP: add prometheus metrics

2017-08-09 Thread Ema (Code Review)
Ema has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370962 )

Change subject: WIP: add prometheus metrics
..

WIP: add prometheus metrics

Bug: T171710
Change-Id: I3fb22fce93d0f9fed814af3a6e8c7b7d07c9b135
---
M pybal/instrumentation.py
M pybal/monitor.py
M requirements.txt
M tox.ini
4 files changed, 26 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal 
refs/changes/62/370962/1

diff --git a/pybal/instrumentation.py b/pybal/instrumentation.py
index da04b11..e807f1a 100644
--- a/pybal/instrumentation.py
+++ b/pybal/instrumentation.py
@@ -16,6 +16,8 @@
 """
 
 from twisted.web.resource import Resource
+from prometheus_client.twisted import MetricsResource
+
 import json
 
 
@@ -50,6 +52,8 @@
 return PoolsRoot()
 if path == 'alerts':
 return Alerts()
+if path == 'metrics':
+return MetricsResource()
 else:
 return Resp404()
 
diff --git a/pybal/monitor.py b/pybal/monitor.py
index dd62b5a..686c8d9 100644
--- a/pybal/monitor.py
+++ b/pybal/monitor.py
@@ -8,6 +8,8 @@
 from . import util
 import logging
 
+from prometheus_client import Counter
+
 _log = util._log
 
 
@@ -16,6 +18,13 @@
 Base class for all monitoring protocols. Declares a few obligatory
 abstract methods, and some commonly useful functions.
 """
+
+metric_labels = [ 'service', 'host', 'monitor' ]
+
+metric_counters = {
+'ups_total': Counter('ups_total', 'Monitor up event count', 
metric_labels),
+'downs_total': Counter('downs_total', 'Monitor down event count', 
metric_labels),
+}
 
 def __init__(self, coordinator, server, configuration={}, reactor=reactor):
 """Constructor"""
@@ -31,6 +40,12 @@
 
 # Install cleanup handler
 self.reactor.addSystemEventTrigger('before', 'shutdown', self.stop)
+
+self.metric_labels = {
+'service': self.server.lvsservice.name,
+'host': self.server.host,
+'monitor': self.name()
+}
 
 def run(self):
 """Start the monitoring"""
@@ -55,6 +70,9 @@
 if self.coordinator:
 self.coordinator.resultUp(self)
 
+
self.metric_counters['ups_total'].labels(**self.metric_labels).inc()
+
+
 def _resultDown(self, reason=None):
 """Sets own monitoring state to Down and notifies the
 coordinator if this implies a state change."""
@@ -64,6 +82,8 @@
 if self.coordinator:
 self.coordinator.resultDown(self, reason)
 
+
self.metric_counters['downs_total'].labels(**self.metric_labels).inc()
+
 def report(self, text, level=logging.DEBUG):
 """Common method for reporting/logging check results."""
 msg = "%s (%s): %s" % (
diff --git a/requirements.txt b/requirements.txt
index 67d9e47..13e5974 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,3 @@
 twisted
 PyOpenSSL
+prometheus_client
diff --git a/tox.ini b/tox.ini
index 3de1bc3..a0a04fe 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,6 +10,7 @@
   twisted
   mock
   PyOpenSSL
+  prometheus_client
 
 [testenv:cover]
 commands =

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fb22fce93d0f9fed814af3a6e8c7b7d07c9b135
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: master
Gerrit-Owner: Ema 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix 'logName' parameter (5th) in many uses of mw.log.deprecate

2017-08-09 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370960 )

Change subject: Fix 'logName' parameter (5th) in many uses of mw.log.deprecate
..

Fix 'logName' parameter (5th) in many uses of mw.log.deprecate

It's apparently supposed to contains the full name of the deprecated
property/function and apparently almost no one ever remembers it.

This fixes error messages like "Use of "wikiGetlink" is deprecated"
to instead read "Use of "mw.util.wikiGetlink" is deprecated", and
apparently improves some error logging detais.

Change-Id: I9b0d6761754e5844d51b71535e0547205eb20781
---
M resources/src/jquery/jquery.mwExtension.js
M resources/src/mediawiki.legacy/wikibits.js
M resources/src/mediawiki.toolbar/toolbar.js
M resources/src/mediawiki/mediawiki.util.js
4 files changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/60/370960/1

diff --git a/resources/src/jquery/jquery.mwExtension.js 
b/resources/src/jquery/jquery.mwExtension.js
index 4bcccdd..9d970ed 100644
--- a/resources/src/jquery/jquery.mwExtension.js
+++ b/resources/src/jquery/jquery.mwExtension.js
@@ -118,11 +118,11 @@
return true;
}
}, function ( key, value ) {
-   mw.log.deprecate( $, key, value );
+   mw.log.deprecate( $, key, value, null, '$.' + key );
} );
 
mw.log.deprecate( $, 'escapeRE', function ( str ) {
return str.replace( /([\\{}()|.?*+\-^$\[\]])/g, '\\$1' ); // 
eslint-disable-line no-useless-escape
-   }, 'Use mediawiki.RegExp instead.' );
+   }, 'Use mediawiki.RegExp instead.', '$.escapeRE' );
 
 }( jQuery, mediaWiki ) );
diff --git a/resources/src/mediawiki.legacy/wikibits.js 
b/resources/src/mediawiki.legacy/wikibits.js
index 6eccc05..bd1b918 100644
--- a/resources/src/mediawiki.legacy/wikibits.js
+++ b/resources/src/mediawiki.legacy/wikibits.js
@@ -99,7 +99,7 @@
$.each( [ 'write', 'writeln' ], function ( idx, method ) {
mw.log.deprecate( document, method, function () {
$( 'body' ).append( $.parseHTML( 
Array.prototype.join.call( arguments, '' ) ) );
-   }, 'Use jQuery or mw.loader.load instead.' );
+   }, 'Use jQuery or mw.loader.load instead.', 'document.' + 
method );
} );
 
 }( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.toolbar/toolbar.js 
b/resources/src/mediawiki.toolbar/toolbar.js
index 9ee499c..d55ed80 100644
--- a/resources/src/mediawiki.toolbar/toolbar.js
+++ b/resources/src/mediawiki.toolbar/toolbar.js
@@ -168,7 +168,7 @@
 
// Expose API publicly
// @deprecated since MW 1.29
-   mw.log.deprecate( mw, 'toolbar', toolbar );
+   mw.log.deprecate( mw, 'toolbar', toolbar, null, 'mw.toolbar' );
 
$( function () {
var i, button;
diff --git a/resources/src/mediawiki/mediawiki.util.js 
b/resources/src/mediawiki/mediawiki.util.js
index 0e423be..34f7eba 100644
--- a/resources/src/mediawiki/mediawiki.util.js
+++ b/resources/src/mediawiki/mediawiki.util.js
@@ -550,7 +550,7 @@
 * @inheritdoc #getUrl
 * @deprecated since 1.23 Use #getUrl instead.
 */
-   mw.log.deprecate( util, 'wikiGetlink', util.getUrl, 'Use mw.util.getUrl 
instead.' );
+   mw.log.deprecate( util, 'wikiGetlink', util.getUrl, 'Use mw.util.getUrl 
instead.', 'mw.util.wikiGetlink' );
 
/**
 * Add the appropriate prefix to the accesskey shown in the tooltip.
@@ -570,7 +570,7 @@
}
 
$nodes.updateTooltipAccessKeys();
-   }, 'Use jquery.accessKeyLabel instead.' );
+   }, 'Use jquery.accessKeyLabel instead.', 
'mw.util.updateTooltipAccessKeys' );
 
/**
 * Add a little box at the top of the screen to inform the user of
@@ -591,7 +591,7 @@
}
mw.notify( message, { autoHide: true, tag: 'legacy' } );
return true;
-   }, 'Use mw.notify instead.' );
+   }, 'Use mw.notify instead.', 'mw.util.jsMessage' );
 
/**
 * Encode the string like Sanitizer::escapeId() in PHP
@@ -603,7 +603,7 @@
 */
mw.log.deprecate( util, 'escapeId', function ( str ) {
return escapeIdInternal( str, 'legacy' );
-   }, 'Use mw.util.escapeIdForAttribute or mw.util.escapeIdForLink 
instead.' );
+   }, 'Use mw.util.escapeIdForAttribute or mw.util.escapeIdForLink 
instead.', 'mw.util.escapeId' );
 
/**
 * Initialisation of mw.util.$content

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b0d6761754e5844d51b71535e0547205eb20781
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 


[MediaWiki-commits] [Gerrit] operations/software[master]: s6.host: Add db2076 to s6

2017-08-09 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370959 )

Change subject: s6.host: Add db2076 to s6
..

s6.host: Add db2076 to s6

db2076 is going to be a new slave on s6

Bug: T170662
Change-Id: I30a21b17469050e504915d1b2eb514ccd7c28cab
---
M dbtools/s6.hosts
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software 
refs/changes/59/370959/1

diff --git a/dbtools/s6.hosts b/dbtools/s6.hosts
index 6c398e5..3e862cc 100644
--- a/dbtools/s6.hosts
+++ b/dbtools/s6.hosts
@@ -1,4 +1,5 @@
 dbstore2001.codfw.wmnet3306
+db2076.codfw.wmnet 3306
 db2039.codfw.wmnet 3306
 db2046.codfw.wmnet 3306
 db2053.codfw.wmnet 3306

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Replace abandoned colors with current WikimediaUI ones

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

Change subject: Replace abandoned colors with current WikimediaUI ones
..


Replace abandoned colors with current WikimediaUI ones

Replacing abandoned `@colorGray8` (`#888`) & `@colorGray9` (`#999`)
with slightly increased contrast, WCAG 2.0 level AA conformant,
`@colorGray7` from WikimediaUI color palette.

Bug: T146799
Bug: T172850

Change-Id: I85fedd4b15783859f7de9d99b0442fe4778315d6
---
M resources/mobile.languages.structured/LanguageOverlay.less
M resources/mobile.references/references.less
M resources/mobile.special.mobilediff.styles/mobilediff.less
3 files changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/resources/mobile.languages.structured/LanguageOverlay.less 
b/resources/mobile.languages.structured/LanguageOverlay.less
index 1625cb1..8f4825e 100644
--- a/resources/mobile.languages.structured/LanguageOverlay.less
+++ b/resources/mobile.languages.structured/LanguageOverlay.less
@@ -61,8 +61,9 @@
color: #000;
font-weight: bold;
}
+
.title {
-   color: @colorGray9;
+   color: @colorGray7;
padding-top: 0.5em;
}
}
diff --git a/resources/mobile.references/references.less 
b/resources/mobile.references/references.less
index d398784..e7c68a3 100644
--- a/resources/mobile.references/references.less
+++ b/resources/mobile.references/references.less
@@ -33,7 +33,7 @@
}
 
.text {
-   color: @colorGray8;
+   color: @colorGray7;
cursor: default;
letter-spacing: 0.2em;
float: left;
diff --git a/resources/mobile.special.mobilediff.styles/mobilediff.less 
b/resources/mobile.special.mobilediff.styles/mobilediff.less
index 60ebdf2..3666d61 100644
--- a/resources/mobile.special.mobilediff.styles/mobilediff.less
+++ b/resources/mobile.special.mobilediff.styles/mobilediff.less
@@ -26,14 +26,13 @@
 }
 
 #mw-mf-diffview {
-
.meta {
font-size: 0.7em;
text-transform: uppercase;
}
 
.mw-mf-diff-date {
-   color: @colorGray9;
+   color: @colorGray7;
}
 
// FIXME: Overly specific selector
@@ -107,7 +106,7 @@
div {
text-align: center;
font-size: 1.85em;
-   color: @colorGray8;
+   color: @colorGray7;
}
}
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...RelatedArticles[master]: Replace abandoned colors with current WikimediaUI ones

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

Change subject: Replace abandoned colors with current WikimediaUI ones
..


Replace abandoned colors with current WikimediaUI ones

Replacing abandoned `@colorGray8` (`#888`) & `@colorGray9` (`#999`)
with slightly increased contrast, WCAG 2.0 level AA conformant,
`@colorGray7` from WikimediaUI color palette.

Bug: T172850
Change-Id: I750261b83cc79c32e9ccdb2d69bb5e396b20ed35
---
M resources/ext.relatedArticles.cards/styles.less
M resources/ext.relatedArticles.readMore/readMore.less
2 files changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/resources/ext.relatedArticles.cards/styles.less 
b/resources/ext.relatedArticles.cards/styles.less
index 6164eeb..ecb67e4 100644
--- a/resources/ext.relatedArticles.cards/styles.less
+++ b/resources/ext.relatedArticles.cards/styles.less
@@ -102,7 +102,7 @@
}
 
.ext-related-articles-card-extract {
-   color: @colorGray8;
+   color: @colorGray7;
font-size: 0.8em;
white-space: nowrap;
overflow: hidden;
diff --git a/resources/ext.relatedArticles.readMore/readMore.less 
b/resources/ext.relatedArticles.readMore/readMore.less
index 18057a2..107f3c4 100644
--- a/resources/ext.relatedArticles.readMore/readMore.less
+++ b/resources/ext.relatedArticles.readMore/readMore.less
@@ -5,7 +5,7 @@
border-bottom: 0;
font-size: 0.8em;
font-weight: normal;
-   color: @colorGray9;
+   color: @colorGray7;
padding-bottom: 0.5em;
text-transform: uppercase;
letter-spacing: 1px;

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: db2045.yaml: Update socket location

2017-08-09 Thread Marostegui (Code Review)
Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370958 )

Change subject: db2045.yaml: Update socket location
..

db2045.yaml: Update socket location

Given that db2045 is depooled, taking the opportunity to update its
socket location

Bug: T148507
Change-Id: Ib652c1546970bc2f41a54d3a3bb0af2c0eccf6d3
---
M hieradata/hosts/db2045.yaml
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/58/370958/1

diff --git a/hieradata/hosts/db2045.yaml b/hieradata/hosts/db2045.yaml
index 987af0e..0d8bce2 100644
--- a/hieradata/hosts/db2045.yaml
+++ b/hieradata/hosts/db2045.yaml
@@ -1,2 +1 @@
 mariadb::shard: 's5'
-mariadb::socket: '/tmp/mysql.sock'

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Revert "Redo "Enable CodeMirror everywhere but RTL wikis and...

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

Change subject: Revert "Redo "Enable CodeMirror everywhere but RTL wikis and 
wikidata""
..


Revert "Redo "Enable CodeMirror everywhere but RTL wikis and wikidata""

This reverts commit e95f650b4702ccbb3e1ab3808fcbfa7e106e7aab.

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

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 2d9d8e2..fab2d9d 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19334,10 +19334,9 @@
 ],
 
 'wmgUseCodeMirror' => [
-   'default' => true,
-   'rtl' => false,
-   'wikidatawiki' => false, // Didn't feel well when this was deployed
-   'testwikidatawiki' => false,
+   'default' => false,
+   'simplewiki' => true,
+   'testwiki' => true, // T169284
 ],
 
 'wmgUseParserMigration' => [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5ef95954511d8f6871d656cd38fd075a7234303c
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: QA: Simplify toast notification step some more

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

Change subject: QA: Simplify toast notification step some more
..


QA: Simplify toast notification step some more

If mediawiki.notification has loaded that should be enough to assume
the toast is ready to have its text checked.

Change-Id: Ic546877eae0ea6dd59dbf88bf9267bcd1957f779
---
M tests/browser/features/step_definitions/common_article_steps.rb
1 file changed, 0 insertions(+), 3 deletions(-)

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



diff --git a/tests/browser/features/step_definitions/common_article_steps.rb 
b/tests/browser/features/step_definitions/common_article_steps.rb
index c08ee3a..d2296a2 100644
--- a/tests/browser/features/step_definitions/common_article_steps.rb
+++ b/tests/browser/features/step_definitions/common_article_steps.rb
@@ -39,9 +39,6 @@
 Then(/^I should see a toast with message "(.+)"$/) do |msg|
   on(ArticlePage) do |page|
 page.wait_until_rl_module_ready('mediawiki.notification')
-page.wait_until do
-  page.toast_element.when_present.text.include? msg
-end
 expect(page.toast_element.when_present.text).to match msg
   end
 end

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Revert "Redo "Enable CodeMirror everywhere but RTL wikis and...

2017-08-09 Thread MaxSem (Code Review)
Hello Florianschmidtwelzow, jenkins-bot, Kaldari,

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

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

to review the following change.


Change subject: Revert "Redo "Enable CodeMirror everywhere but RTL wikis and 
wikidata""
..

Revert "Redo "Enable CodeMirror everywhere but RTL wikis and wikidata""

This reverts commit e95f650b4702ccbb3e1ab3808fcbfa7e106e7aab.

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 2d9d8e2..fab2d9d 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19334,10 +19334,9 @@
 ],
 
 'wmgUseCodeMirror' => [
-   'default' => true,
-   'rtl' => false,
-   'wikidatawiki' => false, // Didn't feel well when this was deployed
-   'testwikidatawiki' => false,
+   'default' => false,
+   'simplewiki' => true,
+   'testwiki' => true, // T169284
 ],
 
 'wmgUseParserMigration' => [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ef95954511d8f6871d656cd38fd075a7234303c
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Adding a new mw.wikibase.getStatements

2017-08-09 Thread Eranroz (Code Review)
Eranroz has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370956 )

Change subject: Adding a new mw.wikibase.getStatements
..

Adding a new mw.wikibase.getStatements

A new Lua interface to directly access entity statements,
with equivalent output to existing:
* mw.wikibase.getEntity( 'Q3'):getBestStatements('P2') - existing
* mw.wikibase.getStatements( 'Q3', 'P2') - new one

the php code filters the claims hence allowing less serialization
(other claims aren't serialized), and may later on provide better
tracking on the actually used claims.

Bug: T172905
Change-Id: I38a160d4acd6b2e1ab61d3e25b229e2cd0bd7f96
---
M client/includes/DataAccess/Scribunto/EntityAccessor.php
M client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.php
M client/includes/DataAccess/Scribunto/mw.wikibase.lua
M client/includes/Serializer/ClientEntitySerializer.php
M client/includes/WikibaseClient.php
M client/tests/phpunit/includes/DataAccess/Scribunto/EntityAccessorTest.php
6 files changed, 257 insertions(+), 1 deletion(-)


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

diff --git a/client/includes/DataAccess/Scribunto/EntityAccessor.php 
b/client/includes/DataAccess/Scribunto/EntityAccessor.php
index b192598..01d3a31 100644
--- a/client/includes/DataAccess/Scribunto/EntityAccessor.php
+++ b/client/includes/DataAccess/Scribunto/EntityAccessor.php
@@ -9,6 +9,8 @@
 use Wikibase\DataModel\Entity\EntityIdParser;
 use Wikibase\DataModel\Services\Lookup\EntityLookup;
 use Wikibase\DataModel\Services\Lookup\PropertyDataTypeLookup;
+use Wikibase\DataModel\Statement\StatementListProvider;
+use Wikibase\DataModel\Entity\PropertyId;
 use Wikibase\LanguageFallbackChain;
 use Wikibase\Lib\ContentLanguages;
 use Wikibase\Lib\Store\RevisionedUnresolvedRedirectException;
@@ -65,6 +67,7 @@
EntityLookup $entityLookup,
UsageAccumulator $usageAccumulator,
Serializer $entitySerializer,
+   Serializer $statementSerializer,
PropertyDataTypeLookup $dataTypeLookup,
LanguageFallbackChain $fallbackChain,
Language $language,
@@ -74,6 +77,7 @@
$this->entityLookup = $entityLookup;
$this->usageAccumulator = $usageAccumulator;
$this->entitySerializer = $entitySerializer;
+   $this->statementSerializer = $statementSerializer;
$this->dataTypeLookup = $dataTypeLookup;
$this->fallbackChain = $fallbackChain;
$this->language = $language;
@@ -136,6 +140,46 @@
return $entityArr;
}
 
+   /**
+* Get statement list from prefixed ID (e.g. "Q23") and property (e.g 
"P123") and return it as serialized array.
+*
+* @param string $prefixedEntityId
+* @param string $propertyId
+*
+* @return array|null
+*/
+   public function getEntityStatement( $prefixedEntityId, $propertyId ) {
+   $prefixedEntityId = trim( $prefixedEntityId );
+   $entityId = $this->entityIdParser->parse( $prefixedEntityId );
+
+   # FIXME: usage only for the specific property not the whole 
entity
+   $this->usageAccumulator->addAllUsage( $entityId );
+
+   try {
+   $entityObject = $this->entityLookup->getEntity( 
$entityId );
+   } catch ( RevisionedUnresolvedRedirectException $ex ) {
+   // We probably hit a double redirect
+   wfLogWarning(
+   'Encountered a UnresolvedRedirectException when 
trying to load ' . $prefixedEntityId
+   );
+
+   return null;
+   }
+
+   if ( $entityObject === null ) {
+   return null;
+   }
+
+   $statements = $entityObject->getStatements();
+   $propertyIdObj = new PropertyId( $propertyId );
+   $statementsProp = $statements->getByPropertyId( $propertyIdObj 
);
+   $statementsRanked = $statementsProp->getBestStatements();
+   $statementArr = 
$this->newClientStatemnetListSerializer()->serializeStatementList( 
$statementsRanked );
+   $this->renumber( $statementArr );
+
+   return $statementArr;
+   }
+
private function newClientEntitySerializer() {
return new ClientEntitySerializer(
$this->entitySerializer,
@@ -149,4 +193,16 @@
);
}
 
+   private function newClientStatemnetListSerializer() {
+   return new ClientEntitySerializer(
+   $this->statementSerializer,
+   $this->dataTypeLookup,
+   array_unique( array_merge(
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add page id to the API representation of pages in search res...

2017-08-09 Thread ShapeOfMatter (Code Review)
ShapeOfMatter has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370955 )

Change subject: Add page id to the API representation of pages in search results
..

Add page id to the API representation of pages in search results

'pageid' is now an always-on property returned by API:Search.
Change made in ApiQuerySearch.php::getSearchResultData().

Bug: T172700
Change-Id: I9d856efdd1d72c70bf9fb72c82b1f276abef8b16
---
M includes/api/ApiQuerySearch.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/55/370955/1

diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php
index 0dd8922..f0c4180 100644
--- a/includes/api/ApiQuerySearch.php
+++ b/includes/api/ApiQuerySearch.php
@@ -233,6 +233,7 @@
 
$title = $result->getTitle();
ApiQueryBase::addTitleInfo( $vals, $title );
+   $vals['pageid'] = $title->getArticleID();
 
if ( isset( $prop['size'] ) ) {
$vals['size'] = $result->getByteSize();

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Make ext.CodeMirror.mode.mediawiki depend on ext.CodeMirror

2017-08-09 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370954 )

Change subject: Make ext.CodeMirror.mode.mediawiki depend on ext.CodeMirror
..

Make ext.CodeMirror.mode.mediawiki depend on ext.CodeMirror

Change-Id: I93bc6eae832baba1e015b680774dee0466e610a9
---
M extension.json
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/extension.json b/extension.json
index 70033f3..a04c50a 100644
--- a/extension.json
+++ b/extension.json
@@ -62,6 +62,7 @@
"scripts": "mode/mediawiki/mediawiki.js",
"styles": "mode/mediawiki/mediawiki.css",
"dependencies": [
+   "ext.CodeMirror",
"ext.CodeMirror.lib"
]
},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I93bc6eae832baba1e015b680774dee0466e610a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...RelatedArticles[master]: Replace abandoned colors with current WikimediaUI ones

2017-08-09 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370953 )

Change subject: Replace abandoned colors with current WikimediaUI ones
..

Replace abandoned colors with current WikimediaUI ones

Replacing abandoned `@colorGray8` (`#888`) & `@colorGray9` (`#999`)
with slightly increased contrast, WCAG 2.0 level AA conformant,
`@colorGray7` from WikimediaUI color palette.

Bug: T172850
Change-Id: I750261b83cc79c32e9ccdb2d69bb5e396b20ed35
---
M resources/ext.relatedArticles.cards/styles.less
M resources/ext.relatedArticles.readMore/readMore.less
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RelatedArticles 
refs/changes/53/370953/1

diff --git a/resources/ext.relatedArticles.cards/styles.less 
b/resources/ext.relatedArticles.cards/styles.less
index 6164eeb..ecb67e4 100644
--- a/resources/ext.relatedArticles.cards/styles.less
+++ b/resources/ext.relatedArticles.cards/styles.less
@@ -102,7 +102,7 @@
}
 
.ext-related-articles-card-extract {
-   color: @colorGray8;
+   color: @colorGray7;
font-size: 0.8em;
white-space: nowrap;
overflow: hidden;
diff --git a/resources/ext.relatedArticles.readMore/readMore.less 
b/resources/ext.relatedArticles.readMore/readMore.less
index 18057a2..107f3c4 100644
--- a/resources/ext.relatedArticles.readMore/readMore.less
+++ b/resources/ext.relatedArticles.readMore/readMore.less
@@ -5,7 +5,7 @@
border-bottom: 0;
font-size: 0.8em;
font-weight: normal;
-   color: @colorGray9;
+   color: @colorGray7;
padding-bottom: 0.5em;
text-transform: uppercase;
letter-spacing: 1px;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Replace abandoned colors with current WikimediaUI ones

2017-08-09 Thread VolkerE (Code Review)
VolkerE has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370952 )

Change subject: Replace abandoned colors with current WikimediaUI ones
..

Replace abandoned colors with current WikimediaUI ones

Replacing abandoned `@colorGray8` (`#888`) & `@colorGray9` (`#999`)
with slightly increased contrast, WCAG 2.0 level AA conformant,
`@colorGray7` from WikimediaUI color palette.

Bug: T146799
Bug: T172850

Change-Id: I85fedd4b15783859f7de9d99b0442fe4778315d6
---
M resources/mobile.languages.structured/LanguageOverlay.less
M resources/mobile.references/references.less
M resources/mobile.special.mobilediff.styles/mobilediff.less
3 files changed, 5 insertions(+), 5 deletions(-)


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

diff --git a/resources/mobile.languages.structured/LanguageOverlay.less 
b/resources/mobile.languages.structured/LanguageOverlay.less
index 1625cb1..8f4825e 100644
--- a/resources/mobile.languages.structured/LanguageOverlay.less
+++ b/resources/mobile.languages.structured/LanguageOverlay.less
@@ -61,8 +61,9 @@
color: #000;
font-weight: bold;
}
+
.title {
-   color: @colorGray9;
+   color: @colorGray7;
padding-top: 0.5em;
}
}
diff --git a/resources/mobile.references/references.less 
b/resources/mobile.references/references.less
index d398784..e7c68a3 100644
--- a/resources/mobile.references/references.less
+++ b/resources/mobile.references/references.less
@@ -33,7 +33,7 @@
}
 
.text {
-   color: @colorGray8;
+   color: @colorGray7;
cursor: default;
letter-spacing: 0.2em;
float: left;
diff --git a/resources/mobile.special.mobilediff.styles/mobilediff.less 
b/resources/mobile.special.mobilediff.styles/mobilediff.less
index 60ebdf2..3666d61 100644
--- a/resources/mobile.special.mobilediff.styles/mobilediff.less
+++ b/resources/mobile.special.mobilediff.styles/mobilediff.less
@@ -26,14 +26,13 @@
 }
 
 #mw-mf-diffview {
-
.meta {
font-size: 0.7em;
text-transform: uppercase;
}
 
.mw-mf-diff-date {
-   color: @colorGray9;
+   color: @colorGray7;
}
 
// FIXME: Overly specific selector
@@ -107,7 +106,7 @@
div {
text-align: center;
font-size: 1.85em;
-   color: @colorGray8;
+   color: @colorGray7;
}
}
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Nuke[master]: Improve some parameter docs

2017-08-09 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370951 )

Change subject: Improve some parameter docs
..

Improve some parameter docs

Change-Id: Ic9e8c1f4a9fc9a283def144cbba742e3fecb62f0
---
M Nuke.hooks.php
M Nuke_body.php
M composer.json
M phpcs.xml
4 files changed, 9 insertions(+), 13 deletions(-)


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

diff --git a/Nuke.hooks.php b/Nuke.hooks.php
index d2cc607..374d2e8 100644
--- a/Nuke.hooks.php
+++ b/Nuke.hooks.php
@@ -7,7 +7,7 @@
 *
 * @param int $userId
 * @param Title $userPageTitle
-* @param string[] $toolLinks
+* @param string[] &$toolLinks
 * @param SpecialPage $sp
 */
public static function nukeContributionsLinks( $userId, $userPageTitle, 
&$toolLinks,
diff --git a/Nuke_body.php b/Nuke_body.php
index cd5dadf..fad9458 100644
--- a/Nuke_body.php
+++ b/Nuke_body.php
@@ -69,7 +69,7 @@
/**
 * Prompt for a username or IP address.
 *
-* @param $userName string
+* @param string $userName
 */
protected function promptForm( $userName = '' ) {
$out = $this->getOutput();
@@ -126,8 +126,8 @@
 *
 * @param string $username
 * @param string $reason
-* @param integer $limit
-* @param integer|null $namespace
+* @param int $limit
+* @param int|null $namespace
 */
protected function listForm( $username, $reason, $limit, $namespace = 
null ) {
$out = $this->getOutput();
@@ -244,8 +244,8 @@
 * Gets a list of new pages by the specified user or everyone when none 
is specified.
 *
 * @param string $username
-* @param integer $limit
-* @param integer|null $namespace
+* @param int $limit
+* @param int|null $namespace
 *
 * @return array
 */
diff --git a/composer.json b/composer.json
index d368985..c0f3175 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
"scripts": {
"fix": "phpcbf",
"test": [
-   "parallel-lint . --exclude vendor",
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
"phpcs -p -s"
]
}
diff --git a/phpcs.xml b/phpcs.xml
index 61142db..2f17eb4 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,18 +2,14 @@
 


-   
-   
-   





-   Nuke.alias.php
+   Nuke\.alias\.php

.

-   
-   vendor
+   
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Quick fix for NWE incompatibility

2017-08-09 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370950 )

Change subject: Quick fix for NWE incompatibility
..

Quick fix for NWE incompatibility

Change-Id: Id35b8581362a91b1f136f5365094661a58026e2b
---
M resources/mode/mediawiki/mediawiki.js
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/resources/mode/mediawiki/mediawiki.js 
b/resources/mode/mediawiki/mediawiki.js
index bc044df..7d8ee84 100644
--- a/resources/mode/mediawiki/mediawiki.js
+++ b/resources/mode/mediawiki/mediawiki.js
@@ -1,5 +1,5 @@
 /* eslint-disable no-use-before-define */
-( function ( CodeMirror ) {
+( function ( mw, CodeMirror ) {
'use strict';
 
function eatMnemonic( stream, style, mnemonicStyle ) {
@@ -22,7 +22,7 @@
 
CodeMirror.defineMode( 'mediawiki', function ( config /* , parserConfig 
*/ ) {
 
-   var mwConfig = config.mwConfig,
+   var mwConfig = mw.config.get( 'extCodeMirrorConfig' ),
urlProtocols = new RegExp( mwConfig.urlProtocols, 'i' ),
permittedHtmlTags = { b: true, bdi: true, del: true, i: 
true, ins: true,
u: true, font: true, big: true, small: true, 
sub: true, sup: true,
@@ -989,4 +989,4 @@
};
} );
 
-}( CodeMirror ) );
+}( mediaWiki, CodeMirror ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id35b8581362a91b1f136f5365094661a58026e2b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Temporarily add class alias for EntityRevision

2017-08-09 Thread WMDE-leszek (Code Review)
WMDE-leszek has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370949 )

Change subject: Temporarily add class alias for EntityRevision
..

Temporarily add class alias for EntityRevision

Apparently there are serialized instances of EntityRevision
using the old FQN in cache.

The alias could be removed after all caches are only using
new namespace.

Bug: T172616
Change-Id: I3839fff8d8bf21391e50a3f6dfd964ab5e4a4edd
---
M lib/includes/Store/EntityRevision.php
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/lib/includes/Store/EntityRevision.php 
b/lib/includes/Store/EntityRevision.php
index fdc3950..3835421 100644
--- a/lib/includes/Store/EntityRevision.php
+++ b/lib/includes/Store/EntityRevision.php
@@ -75,3 +75,5 @@
}
 
 }
+
+class_alias( 'Wikibase\EntityRevision', EntityRevision::class );
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3839fff8d8bf21391e50a3f6dfd964ab5e4a4edd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: WMDE-leszek 

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


[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Improve some parameter docs

2017-08-09 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370948 )

Change subject: Improve some parameter docs
..

Improve some parameter docs

Change-Id: If8cf19ec0fbf3e14389fec4856f51bd93fff4772
---
M Newsletter.hooks.php
M composer.json
M includes/Newsletter.php
M includes/NewsletterDb.php
M includes/NewsletterEditPage.php
M includes/NewsletterStore.php
M includes/NewsletterValidator.php
M includes/api/ApiNewsletterManage.php
M includes/api/ApiNewsletterSubscribe.php
M includes/content/NewsletterContent.php
M includes/logging/NewsletterLogFormatter.php
M includes/specials/SpecialNewsletter.php
M includes/specials/pagers/NewsletterTablePager.php
M phpcs.xml
14 files changed, 43 insertions(+), 34 deletions(-)


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

diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php
index 348f810..927a5a4 100755
--- a/Newsletter.hooks.php
+++ b/Newsletter.hooks.php
@@ -8,8 +8,8 @@
/**
 * Function to be called before EchoEvent
 *
-* @param array $notifications Echo notifications
-* @param array $notificationCategories Echo notification categories
+* @param array &$notifications Echo notifications
+* @param array &$notificationCategories Echo notification categories
 * @return bool
 */
public static function onBeforeCreateEchoEvent( &$notifications, 
&$notificationCategories ) {
@@ -92,7 +92,7 @@
/**
 * Allows to add our own error message to LoginForm
 *
-* @param array $messages
+* @param array &$messages
 */
public static function onLoginFormValidErrorMessages( &$messages ) {
$messages[] = 'newsletter-subscribe-loginrequired'; // on 
Special:Newsletter/id/subscribe
@@ -128,7 +128,7 @@
/**
 * Handler for UnitTestsList hook.
 * @see http://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList
-* @param &$files Array of unit test files
+* @param array &$files Array of unit test files
 * @return bool true in all cases
 */
public static function onUnitTestsList( &$files ) {
@@ -154,7 +154,7 @@
/**
 * Tables that Extension:UserMerge needs to update
 *
-* @param array $updateFields
+* @param array &$updateFields
 * @return bool
 */
public static function onUserMergeAccountFields( array &$updateFields ) 
{
@@ -210,12 +210,12 @@
}
 
/**
-* @param WikiPage $wikiPage
-* @param User $user
-* @param string $reason
-* @param string $error
-* @param Status $status
-* @param $suppress
+* @param WikiPage &$wikiPage
+* @param User &$user
+* @param string &$reason
+* @param string &$error
+* @param Status &$status
+* @param bool $suppress
 * @return bool
 * @throws PermissionsError
 */
@@ -250,7 +250,7 @@
}
 
/**
-* @param PageArchive $archive
+* @param PageArchive &$archive
 * @param Title $title
 * @return bool
 */
@@ -308,7 +308,7 @@
/**
 * @param string $contentModel ID of the content model in question
 * @param Title $title the Title in question.
-* @param $ok Output parameter, whether it is OK to use $contentModel 
on $title.
+* @param bool &$ok Output parameter, whether it is OK to use 
$contentModel on $title.
 * @return bool
 */
public static function onContentModelCanBeUsedOn( $contentModel, Title 
$title, &$ok ) {
@@ -324,9 +324,9 @@
 * @param RequestContext $context object implementing the 
IContextSource interface.
 * @param Content $content content of the edit box, as a Content object.
 * @param Status $status Status object to represent errors, etc.
-* @param $summary string Edit summary for page
+* @param string $summary Edit summary for page
 * @param User $user the User object representing the user whois 
performing the edit.
-* @param $minoredit bool whether the edit was marked as minor by the 
user.
+* @param bool $minoredit whether the edit was marked as minor by the 
user.
 * @return bool
 * @throws ThrottledError
 */
diff --git a/composer.json b/composer.json
index b81bc08..c155170 100644
--- a/composer.json
+++ b/composer.json
@@ -11,7 +11,7 @@
},
"scripts": {
"test": [
-   "parallel-lint . --exclude vendor",
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
"phpcs -p -s"
],
"fix": "phpcbf"
diff --git a/includes/Newsletter.php b/includes/Newsletter.php
index 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fixed localization for time according to Turkish language us...

2017-08-09 Thread HakanIST (Code Review)
HakanIST has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370947 )

Change subject: Fixed localization for time according to Turkish language usage.
..

Fixed localization for time according to Turkish language usage.

Bug: T161961
Change-Id: I344cc500a780ff81f69e217c970a4a6aff288720
---
M languages/messages/MessagesTr.php
1 file changed, 32 insertions(+), 0 deletions(-)


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

diff --git a/languages/messages/MessagesTr.php 
b/languages/messages/MessagesTr.php
index 564da6c..e2ad61a 100644
--- a/languages/messages/MessagesTr.php
+++ b/languages/messages/MessagesTr.php
@@ -352,5 +352,37 @@
'pagesincategory_files' => [ '0', 'dosyalar', 'files' ],
 ];
 
+$datePreferences = [
+   'default',
+   'mdy',
+   'dmy',
+   'ymd',
+   'turkish',
+   'ISO 8601',
+];
+
+$dateFormats = [
+   'mdy time' => 'H.i',
+   'mdy date' => 'F j, Y',
+   'mdy monthonly' => 'F Y',
+   'mdy both' => 'H.i, F j, Y',
+   'mdy pretty' => 'F j',
+   'dmy time' => 'H.i',
+   'dmy date' => 'j F Y',
+   'dmy monthonly' => 'F Y',
+   'dmy both' => 'H.i, j F Y',
+   'dmy pretty' => 'j F',
+   'ymd time' => 'H.i',
+   'ymd date' => 'Y F j',
+   'ymd monthonly' => 'Y F',
+   'ymd both' => 'H.i, Y F j',
+   'ymd pretty' => 'F j',
+   'ISO 8601 time' => 'xnH:xni:xns',
+   'ISO 8601 date' => 'xnY-xnm-xnd',
+   'ISO 8601 monthonly' => 'xnY-xnm',
+   'ISO 8601 both' => 'xnY-xnm-xnd"T"xnH:xni:xns',
+   'ISO 8601 pretty' => 'xnm-xnd'
+];
+
 $separatorTransformTable = [ ',' => '.', '.' => ',' ];
 $linkTrail = '/^([a-zÇĞçğİıÖöŞşÜüÂâÎîÛû]+)(.*)$/sDu';

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Create new table that will contain replicated revisions by l...

2017-08-09 Thread MusikAnimal (Code Review)
MusikAnimal has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370946 )

Change subject: Create new table that will contain replicated revisions by 
logged out users. This will be used to add support for IP ranges at 
Special:Contributions.
..

Create new table that will contain replicated revisions by
logged out users. This will be used to add support for IP ranges
at Special:Contributions.

DBA approval for this table can be found at T156318

Bug: T163562

Change-Id: I6593eb13701128faa782691a6b25ec01869c827d
---
M includes/installer/MysqlUpdater.php
A maintenance/archives/patch-ip_changes.sql
M maintenance/tables.sql
3 files changed, 48 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/46/370946/1

diff --git a/includes/installer/MysqlUpdater.php 
b/includes/installer/MysqlUpdater.php
index b4ae1dd..58728a3 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -304,6 +304,7 @@
 
// 1.30
[ 'modifyField', 'image', 'img_media_type', 
'patch-add-3d.sql' ],
+   [ 'addTable', 'ip_changes', 'patch-ip_changes.sql' ],
];
}
 
diff --git a/maintenance/archives/patch-ip_changes.sql 
b/maintenance/archives/patch-ip_changes.sql
new file mode 100644
index 000..5f05672
--- /dev/null
+++ b/maintenance/archives/patch-ip_changes.sql
@@ -0,0 +1,23 @@
+--
+-- Every time an edit by a logged out user is saved,
+-- a row is created in ip_changes. This stores
+-- the IP as a hex representation so that we can more
+-- easily find edits within an IP range.
+--
+CREATE TABLE /*_*/ip_changes (
+  -- Foreign key to the revision table, also serves as the unique primary key
+  ipc_rev_id int unsigned NOT NULL PRIMARY KEY DEFAULT '0',
+
+  -- The timestamp of the revision
+  ipc_rev_timestamp binary(14) NOT NULL DEFAULT '',
+
+  -- Hex representation of the IP address, as returned by IP::toHex()
+  -- For IPv4 it will resemble: ABCD1234
+  -- For IPv6: v6-ABCD1234
+  -- BETWEEN is then used to identify revisions within a given range
+  ipc_hex varbinary(35) NOT NULL DEFAULT ''
+
+) /*$wgDBTableOptions*/;
+
+CREATE INDEX /*i*/ipc_rev_timestamp ON /*_*/ip_changes (ipc_rev_timestamp);
+CREATE INDEX /*i*/ipc_hex_time ON /*_*/ip_changes (ipc_hex,ipc_rev_timestamp);
diff --git a/maintenance/tables.sql b/maintenance/tables.sql
index 14f6932..1497d6f 100644
--- a/maintenance/tables.sql
+++ b/maintenance/tables.sql
@@ -411,6 +411,30 @@
 CREATE INDEX /*i*/page_user_timestamp ON /*_*/revision 
(rev_page,rev_user,rev_timestamp);
 
 --
+-- Every time an edit by a logged out user is saved,
+-- a row is created in ip_changes. This stores
+-- the IP as a hex representation so that we can more
+-- easily find edits within an IP range.
+--
+CREATE TABLE /*_*/ip_changes (
+  -- Foreign key to the revision table, also serves as the unique primary key
+  ipc_rev_id int unsigned NOT NULL PRIMARY KEY DEFAULT '0',
+
+  -- The timestamp of the revision
+  ipc_rev_timestamp binary(14) NOT NULL DEFAULT '',
+
+  -- Hex representation of the IP address, as returned by IP::toHex()
+  -- For IPv4 it will resemble: ABCD1234
+  -- For IPv6: v6-ABCD1234
+  -- BETWEEN is then used to identify revisions within a given range
+  ipc_hex varbinary(35) NOT NULL DEFAULT ''
+
+) /*$wgDBTableOptions*/;
+
+CREATE INDEX /*i*/ipc_rev_timestamp ON /*_*/ip_changes (ipc_rev_timestamp);
+CREATE INDEX /*i*/ipc_hex_time ON /*_*/ip_changes (ipc_hex,ipc_rev_timestamp);
+
+--
 -- Holds text of individual page revisions.
 --
 -- Field names are a holdover from the 'old' revisions table in

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: OutputPage: Support HTML5 elements in older browsers using h...

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

Change subject: OutputPage: Support HTML5 elements in older browsers using 
html5shiv
..


OutputPage: Support HTML5 elements in older browsers using html5shiv

Bug: T122965
Change-Id: Ic11ca687a5459b2dc5d942cf1dc784daa0ddc2f3
---
M includes/OutputPage.php
A resources/lib/html5shiv/html5shiv.js
A resources/lib/html5shiv/html5shiv.min.js
3 files changed, 342 insertions(+), 0 deletions(-)

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



diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 969171d..7a2cf00 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2908,6 +2908,18 @@
$pieces[] = $this->buildExemptModules();
$pieces = array_merge( $pieces, array_values( 
$this->getHeadLinksArray() ) );
$pieces = array_merge( $pieces, array_values( $this->mHeadItems 
) );
+
+   $min = ResourceLoader::inDebugMode() ? '' : '.min';
+   // Use an IE conditional comment to serve the script only to 
old IE
+   $pieces[] = '';
+
$pieces[] = Html::closeElement( 'head' );
 
$bodyClasses = [];
diff --git a/resources/lib/html5shiv/html5shiv.js 
b/resources/lib/html5shiv/html5shiv.js
new file mode 100644
index 000..45ea723
--- /dev/null
+++ b/resources/lib/html5shiv/html5shiv.js
@@ -0,0 +1,326 @@
+/**
+* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 
Licensed
+*/
+;(function(window, document) {
+/*jshint evil:true */
+  /** version */
+  var version = '3.7.3';
+
+  /** Preset options */
+  var options = window.html5 || {};
+
+  /** Used to skip problem elements */
+  var reSkip = 
/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
+
+  /** Not all elements can be cloned in IE **/
+  var saveClones = 
/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
+
+  /** Detect whether the browser supports default html5 styles */
+  var supportsHtml5Styles;
+
+  /** Name of the expando, to work with multiple documents or to re-shiv one 
document */
+  var expando = '_html5shiv';
+
+  /** The id for the the documents expando */
+  var expanID = 0;
+
+  /** Cached data for each document */
+  var expandoData = {};
+
+  /** Detect whether the browser supports unknown elements */
+  var supportsUnknownElements;
+
+  (function() {
+try {
+var a = document.createElement('a');
+a.innerHTML = '';
+//if the hidden property is implemented we can assume, that the 
browser supports basic HTML5 Styles
+supportsHtml5Styles = ('hidden' in a);
+
+supportsUnknownElements = a.childNodes.length == 1 || (function() {
+  // assign a false positive if unable to shiv
+  (document.createElement)('a');
+  var frag = document.createDocumentFragment();
+  return (
+typeof frag.cloneNode == 'undefined' ||
+typeof frag.createDocumentFragment == 'undefined' ||
+typeof frag.createElement == 'undefined'
+  );
+}());
+} catch(e) {
+  // assign a false positive if detection fails => unable to shiv
+  supportsHtml5Styles = true;
+  supportsUnknownElements = true;
+}
+
+  }());
+
+  
/*--*/
+
+  /**
+   * Creates a style sheet with the given CSS text and adds it to the document.
+   * @private
+   * @param {Document} ownerDocument The document.
+   * @param {String} cssText The CSS text.
+   * @returns {StyleSheet} The style element.
+   */
+  function addStyleSheet(ownerDocument, cssText) {
+var p = ownerDocument.createElement('p'),
+parent = ownerDocument.getElementsByTagName('head')[0] || 
ownerDocument.documentElement;
+
+p.innerHTML = 'x' + cssText + '';
+return parent.insertBefore(p.lastChild, parent.firstChild);
+  }
+
+  /**
+   * Returns the value of `html5.elements` as an array.
+   * @private
+   * @returns {Array} An array of shived element node names.
+   */
+  function getElements() {
+var elements = html5.elements;
+return typeof elements == 'string' ? elements.split(' ') : elements;
+  }
+
+  /**
+   * Extends the built-in list of html5 elements
+   * @memberOf html5
+   * @param {String|Array} newElements whitespace separated list or array of 
new element names to shiv
+   * @param {Document} ownerDocument The context document.
+   */
+  function addElements(newElements, ownerDocument) {
+var elements = html5.elements;
+if(typeof elements != 'string'){
+  elements = elements.join(' ');
+}
+if(typeof newElements != 'string'){
+  newElements = newElements.join(' ');
+}
+html5.elements = elements +' '+ newElements;
+

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mw-collapsible: Add print styles to uncollapse content

2017-08-09 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370945 )

Change subject: mw-collapsible: Add print styles to uncollapse content
..

mw-collapsible: Add print styles to uncollapse content

Bug: T152330
Change-Id: I74ee6ad9f426f2fccd84b9190bc1afe0be4cc06d
---
M resources/src/jquery/jquery.makeCollapsible.css
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/45/370945/1

diff --git a/resources/src/jquery/jquery.makeCollapsible.css 
b/resources/src/jquery/jquery.makeCollapsible.css
index 2e5efba..a72b5a3 100644
--- a/resources/src/jquery/jquery.makeCollapsible.css
+++ b/resources/src/jquery/jquery.makeCollapsible.css
@@ -45,3 +45,19 @@
 .mw-collapsible-toggle-li {
list-style: none;
 }
+
+@media print {
+   .mw-collapsible-toggle {
+   display: none;
+   }
+   .mw-collapsed .mw-collapsible-content {
+   display: block !important;
+   }
+   .mw-collapsed > * > tr {
+   display: table-row !important;
+   }
+   .mw-collapsed > li,
+   .mw-collapsed > li {
+   display: list-item !important;
+   }
+}

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

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

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


[MediaWiki-commits] [Gerrit] marvin[master]: Chore: improve test performance

2017-08-09 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370944 )

Change subject: Chore: improve test performance
..

Chore: improve test performance

The hypothesis for poor performance is numerous shell invocations. This
is a well-known problem in recursive Make so the proposed explanation is
that shelling out in NPM for each script is causing a similar impedance.

Three solutions seemed immediately practical:
- NPM: repeat commands instead of reinvoking NPM.
- Make: has a nice rule syntax.
- Shell: simple and the interpreter NPM is already calling.

The NPM solution is the most straightforward but may cause bugs since
code could fall out of sync and reduces readability. There are numerous
pros and cons to Make vs shell. However, the Make solution would require
rather verbose function definitions to avoid subshells and ultimately
boil down to shell script anyway. Only the shell solution was explored.

This implementation replaces the package.json scripts with a new shell
script, marvin. The shell script's commands are almost one-to-one with
the previous package.json implementation but now have the benefit of
being able to share commands without shelling.

Notes:

- This solution adds a layer of indirection to development that is
  undesirable.
- nodemon was used insead of `dev:client& dev:server& wait` to avoid
  child process trapping and job crossplatform monitoring concerns.
- /dev/null is monitored instead of [watch:false] as this option doesn't
  appear to be exposed on the command line. An alternative would be to
  watch the likely nonexistent file, "false".
- A big switch statement is used which is very simple, concise, and
  easily extended and maintained.
  - Aliases were considered but overriding shell builtins like `test` is
a bad idea and dynamically invoking an alias from a variable
required wrapping it in a function first,
`eval "_$COMMAND() { $COMMAND \"\$@\"; }"` (direct evaluation
requires escaping the parameters via `printf '%q ' "$@"` but that is
a Bashism). Aliases do have the nice property of being easily
queried, `alias|sed "s%=.*%%"`.
  - Functions were also considered but since colons in function names
are forbidden in shell, commands must be translated,
`COMMAND="$(echo "$1"|sed 's%:%_%g')"`.

Bug: T172862
Change-Id: Ie4f5369393af3468da1520fd849a40ca5cf98e62
[watch:false]: https://github.com/remy/nodemon/issues/516
---
A marvin
M package.json
M readme.md
3 files changed, 29 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/44/370944/1

diff --git a/marvin b/marvin
new file mode 100755
index 000..0d295d0
--- /dev/null
+++ b/marvin
@@ -0,0 +1,24 @@
+#!/usr/bin/env sh
+set -eu
+
+execute() {
+  local command="$1"
+  shift
+
+  case "$command" in
+start) nodemon -q -w /dev/null -x "\"$0\" dev:client\"" -x "\"$0\" 
dev:server";;
+dev:client) NODE_ENV=development webpack -w;;
+dev:server) NODE_ENV=development nodemon -w dist/client -w src/server/ 
src/server/index.js;;
+prod:build) NODE_ENV=production webpack -p;;
+format) execute lint --fix "$@";;
+format:all) execute format '{src,test}/**/*.js';;
+lint) eslint --cache --max-warnings 0 "$@";;
+lint:all) execute lint '{src,test}/**/*.js';;
+test) execute lint:all && mocha '{src,test}/**/*.test.js';;
+test:watch) nodemon -q -w src -w test -x "\"$0\" test";;
+precommit) execute test;;
+*) ! :;;
+  esac
+}
+
+execute "$@"
diff --git a/package.json b/package.json
index f7be2a2..bad01d6 100644
--- a/package.json
+++ b/package.json
@@ -3,18 +3,8 @@
   "version": "0.0.0",
   "description": "An API driven skin for MediaWiki",
   "scripts": {
-"start": "run-p -sn dev:\\*",
-"dev:client": "NODE_ENV=development webpack -w",
-"dev:server": "NODE_ENV=development nodemon -w dist/client -w src/server/ 
src/server/index.js",
-"prod:build": "NODE_ENV=production webpack -p",
-"format": "npm run lint -s -- --fix",
-"format:all": "npm run format -s -- '{src,test}/**/*.js'",
-"lint": "eslint --cache --max-warnings 0",
-"lint:all": "npm run lint -s -- '{src,test}/**/*.js'",
-"pretest": "npm run lint:all -s",
-"test": "mocha '{src,test}/**/*.test.js'",
-"test:watch": "nodemon -w src -w test -x 'npm test'",
-"precommit": "npm run test -s"
+"test": "./marvin test",
+"precommit": "./marvin test"
   },
   "repository": {
 "type": "git",
diff --git a/readme.md b/readme.md
index 1eca95a..356eaff 100644
--- a/readme.md
+++ b/readme.md
@@ -9,9 +9,9 @@
 Marvin's requirements are listed in package.json **engines**. Generally the
 latest Node.js active LTS version, and npm > 5.X should do it.
 
-For running the project on development, run `npm install` and then `npm start`.
-That will run the server in development mode with file watching which will auto
-restart the server when files 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Redo "Enable CodeMirror everywhere but RTL wikis and wikidata"

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

Change subject: Redo "Enable CodeMirror everywhere but RTL wikis and wikidata"
..


Redo "Enable CodeMirror everywhere but RTL wikis and wikidata"

This reverts commit 33124d99739cac7079ad72529038327f0d750e58.

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

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



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index fab2d9d..2d9d8e2 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19334,9 +19334,10 @@
 ],
 
 'wmgUseCodeMirror' => [
-   'default' => false,
-   'simplewiki' => true,
-   'testwiki' => true, // T169284
+   'default' => true,
+   'rtl' => false,
+   'wikidatawiki' => false, // Didn't feel well when this was deployed
+   'testwikidatawiki' => false,
 ],
 
 'wmgUseParserMigration' => [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib54524d7abb23a4ec2599dc87f4a19c3bab222dd
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Redo "Enable CodeMirror everywhere but RTL wikis and wikidata"

2017-08-09 Thread MaxSem (Code Review)
Hello Florianschmidtwelzow, jenkins-bot, Kaldari,

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

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

to review the following change.


Change subject: Redo "Enable CodeMirror everywhere but RTL wikis and wikidata"
..

Redo "Enable CodeMirror everywhere but RTL wikis and wikidata"

This reverts commit 33124d99739cac7079ad72529038327f0d750e58.

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index bea92dc..cb9d26d 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19323,9 +19323,10 @@
 ],
 
 'wmgUseCodeMirror' => [
-   'default' => false,
-   'simplewiki' => true,
-   'testwiki' => true, // T169284
+   'default' => true,
+   'rtl' => false,
+   'wikidatawiki' => false, // Didn't feel well when this was deployed
+   'testwikidatawiki' => false,
 ],
 
 'wmgUseParserMigration' => [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib54524d7abb23a4ec2599dc87f4a19c3bab222dd
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix minor issues found with phan

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

Change subject: Fix minor issues found with phan
..


Fix minor issues found with phan

- fixed PHPDoc
- replaced deprecated function

Bug: T153252
Change-Id: I072a1c1201bd19eafe7c50bbbf32a71fa4a92a46
---
M includes/Revision.php
M includes/media/Bitmap.php
M includes/page/WikiPage.php
3 files changed, 10 insertions(+), 9 deletions(-)

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



diff --git a/includes/Revision.php b/includes/Revision.php
index 537b7c1..88b138d 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -860,7 +860,7 @@
 *   Revision::FOR_PUBLIC   to be displayed to all users
 *   Revision::FOR_THIS_USERto be displayed to the given user
 *   Revision::RAW  get the ID regardless of permissions
-* @param User $user User object to check for, only if FOR_THIS_USER is 
passed
+* @param User|null $user User object to check for, only if 
FOR_THIS_USER is passed
 *   to the $audience parameter
 * @return int
 */
@@ -894,7 +894,7 @@
 *   Revision::FOR_PUBLIC   to be displayed to all users
 *   Revision::FOR_THIS_USERto be displayed to the given user
 *   Revision::RAW  get the text regardless of permissions
-* @param User $user User object to check for, only if FOR_THIS_USER is 
passed
+* @param User|null $user User object to check for, only if 
FOR_THIS_USER is passed
 *   to the $audience parameter
 * @return string
 */
@@ -938,7 +938,7 @@
 *   Revision::FOR_PUBLIC   to be displayed to all users
 *   Revision::FOR_THIS_USERto be displayed to the given user
 *   Revision::RAW  get the text regardless of permissions
-* @param User $user User object to check for, only if FOR_THIS_USER is 
passed
+* @param User|null $user User object to check for, only if 
FOR_THIS_USER is passed
 *   to the $audience parameter
 * @return string
 */
diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php
index 0f0b074..1aeead5 100644
--- a/includes/media/Bitmap.php
+++ b/includes/media/Bitmap.php
@@ -129,7 +129,7 @@
 * @param File $image File associated with this thumbnail
 * @param array $params Array with scaler params
 *
-* @return MediaTransformError Error object if error occurred, false 
(=no error) otherwise
+* @return MediaTransformError|bool Error object if error occurred, 
false (=no error) otherwise
 */
protected function transformImageMagick( $image, $params ) {
# use ImageMagick
@@ -272,7 +272,7 @@
 * @param File $image File associated with this thumbnail
 * @param array $params Array with scaler params
 *
-* @return MediaTransformError Error object if error occurred, false 
(=no error) otherwise
+* @return MediaTransformError Error|bool object if error occurred, 
false (=no error) otherwise
 */
protected function transformImageMagickExt( $image, $params ) {
global $wgSharpenReductionThreshold, $wgSharpenParameter, 
$wgMaxAnimatedGifArea,
@@ -367,7 +367,7 @@
 * @param File $image File associated with this thumbnail
 * @param array $params Array with scaler params
 *
-* @return MediaTransformError Error object if error occurred, false 
(=no error) otherwise
+* @return MediaTransformError Error|bool object if error occurred, 
false (=no error) otherwise
 */
protected function transformCustom( $image, $params ) {
# Use a custom convert command
@@ -399,7 +399,7 @@
 * @param File $image File associated with this thumbnail
 * @param array $params Array with scaler params
 *
-* @return MediaTransformError Error object if error occurred, false 
(=no error) otherwise
+* @return MediaTransformError|bool Error object if error occurred, 
false (=no error) otherwise
 */
protected function transformGd( $image, $params ) {
# Use PHP's builtin GD library functions.
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index c05ba45..af906fb 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -383,11 +383,12 @@
if ( is_int( $from ) ) {
list( $index, $opts ) = 
DBAccessObjectUtils::getDBOptions( $from );
$data = $this->pageDataFromTitle( wfGetDB( $index ), 
$this->mTitle, $opts );
+   $loadBalancer = 
MediaWikiServices::getInstance()->getDBLoadBalancer();
 
if ( !$data
&& $index == DB_REPLICA
- 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix minor issues found with phan

2017-08-09 Thread WMDE-Fisch (Code Review)
WMDE-Fisch has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370942 )

Change subject: Fix minor issues found with phan
..

Fix minor issues found with phan

- fixed PHPDoc
- replaced deprecated function

Bug: T153252
Change-Id: I072a1c1201bd19eafe7c50bbbf32a71fa4a92a46
---
M includes/Revision.php
M includes/media/Bitmap.php
M includes/page/WikiPage.php
3 files changed, 10 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/42/370942/1

diff --git a/includes/Revision.php b/includes/Revision.php
index 537b7c1..88b138d 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -860,7 +860,7 @@
 *   Revision::FOR_PUBLIC   to be displayed to all users
 *   Revision::FOR_THIS_USERto be displayed to the given user
 *   Revision::RAW  get the ID regardless of permissions
-* @param User $user User object to check for, only if FOR_THIS_USER is 
passed
+* @param User|null $user User object to check for, only if 
FOR_THIS_USER is passed
 *   to the $audience parameter
 * @return int
 */
@@ -894,7 +894,7 @@
 *   Revision::FOR_PUBLIC   to be displayed to all users
 *   Revision::FOR_THIS_USERto be displayed to the given user
 *   Revision::RAW  get the text regardless of permissions
-* @param User $user User object to check for, only if FOR_THIS_USER is 
passed
+* @param User|null $user User object to check for, only if 
FOR_THIS_USER is passed
 *   to the $audience parameter
 * @return string
 */
@@ -938,7 +938,7 @@
 *   Revision::FOR_PUBLIC   to be displayed to all users
 *   Revision::FOR_THIS_USERto be displayed to the given user
 *   Revision::RAW  get the text regardless of permissions
-* @param User $user User object to check for, only if FOR_THIS_USER is 
passed
+* @param User|null $user User object to check for, only if 
FOR_THIS_USER is passed
 *   to the $audience parameter
 * @return string
 */
diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php
index 0f0b074..1aeead5 100644
--- a/includes/media/Bitmap.php
+++ b/includes/media/Bitmap.php
@@ -129,7 +129,7 @@
 * @param File $image File associated with this thumbnail
 * @param array $params Array with scaler params
 *
-* @return MediaTransformError Error object if error occurred, false 
(=no error) otherwise
+* @return MediaTransformError|bool Error object if error occurred, 
false (=no error) otherwise
 */
protected function transformImageMagick( $image, $params ) {
# use ImageMagick
@@ -272,7 +272,7 @@
 * @param File $image File associated with this thumbnail
 * @param array $params Array with scaler params
 *
-* @return MediaTransformError Error object if error occurred, false 
(=no error) otherwise
+* @return MediaTransformError Error|bool object if error occurred, 
false (=no error) otherwise
 */
protected function transformImageMagickExt( $image, $params ) {
global $wgSharpenReductionThreshold, $wgSharpenParameter, 
$wgMaxAnimatedGifArea,
@@ -367,7 +367,7 @@
 * @param File $image File associated with this thumbnail
 * @param array $params Array with scaler params
 *
-* @return MediaTransformError Error object if error occurred, false 
(=no error) otherwise
+* @return MediaTransformError Error|bool object if error occurred, 
false (=no error) otherwise
 */
protected function transformCustom( $image, $params ) {
# Use a custom convert command
@@ -399,7 +399,7 @@
 * @param File $image File associated with this thumbnail
 * @param array $params Array with scaler params
 *
-* @return MediaTransformError Error object if error occurred, false 
(=no error) otherwise
+* @return MediaTransformError|bool Error object if error occurred, 
false (=no error) otherwise
 */
protected function transformGd( $image, $params ) {
# Use PHP's builtin GD library functions.
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index c05ba45..af906fb 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -383,11 +383,12 @@
if ( is_int( $from ) ) {
list( $index, $opts ) = 
DBAccessObjectUtils::getDBOptions( $from );
$data = $this->pageDataFromTitle( wfGetDB( $index ), 
$this->mTitle, $opts );
+   $loadBalancer = 
MediaWikiServices::getInstance()->getDBLoadBalancer();
 
if ( !$data
&& $index == DB_REPLICA
-   

[MediaWiki-commits] [Gerrit] mediawiki...Math[master]: Improve some parameter docs

2017-08-09 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370941 )

Change subject: Improve some parameter docs
..

Improve some parameter docs

Change-Id: If7d52d77935b7dd6cddd583b9a6215735fa8b91e
---
M Math.hooks.php
M MathInputCheckRestbase.php
M MathLaTeXML.php
M MathMathML.php
M MathRenderer.php
M MathRestbaseInterface.php
M MathTexvc.php
M MathWikidataHook.php
M composer.json
M phpcs.xml
M tests/MathMathMLTest.php
11 files changed, 53 insertions(+), 52 deletions(-)


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

diff --git a/Math.hooks.php b/Math.hooks.php
index ad33220..632c29c 100644
--- a/Math.hooks.php
+++ b/Math.hooks.php
@@ -100,12 +100,13 @@
}
}
 
-   /*
+   /**
 * Generate a user dependent hash cache key.
 * The hash key depends on the rendering mode.
-* @param &$confstr The to-be-hashed key string that is being 
constructed
+* @param string &$confstr The to-be-hashed key string that is being 
constructed
 * @param User $user reference to the current user
 * @param array &$forOptions userOptions used on that page
+* @return true
 */
public static function onPageRenderingHash( &$confstr, $user = false, 
&$forOptions = [] ) {
global $wgUser;
@@ -166,8 +167,8 @@
/**
 * Register the  tag with the Parser.
 *
-* @param $parser Parser instance of Parser
-* @return Boolean: true
+* @param Parser $parser instance of Parser
+* @return bool true
 */
static function onParserFirstCallInit( $parser ) {
$parser->setHook( 'math', [ 'MathHooks', 'mathTagHook' ] );
@@ -181,8 +182,8 @@
/**
 * Callback function for the  parser hook.
 *
-* @param $content (the LaTeX input)
-* @param $attributes
+* @param string $content (the LaTeX input)
+* @param array $attributes
 * @param Parser $parser
 * @return array
 */
@@ -253,9 +254,9 @@
/**
 * Add the new math rendering options to Special:Preferences.
 *
-* @param $user Object: current User object
-* @param $defaultPreferences Object: Preferences object
-* @return Boolean: true
+* @param User $user current User object
+* @param array &$defaultPreferences Preferences array
+* @return bool true
 */
static function onGetPreferences( $user, &$defaultPreferences ) {
global $wgDefaultUserOptions;
@@ -311,7 +312,7 @@
/**
 * LoadExtensionSchemaUpdates handler; set up math table on 
install/upgrade.
 *
-* @param $updater DatabaseUpdater
+* @param DatabaseUpdater $updater
 * @throws Exception
 * @return bool
 */
@@ -357,7 +358,7 @@
 * Add 'math' and 'mathlatexml' tables to the list of tables that need 
to be copied to
 * temporary tables for parser tests to run.
 *
-* @param array $tables
+* @param array &$tables
 * @return bool
 */
static function onParserTestTables( &$tables ) {
@@ -367,8 +368,8 @@
}
 
/**
-* @param Parser $parser
-* @param $text
+* @param Parser &$parser
+* @param string &$text
 * @return bool
 */
public static function onParserAfterTidy( &$parser, &$text ) {
@@ -395,7 +396,7 @@
}
 
/**
-* @param string $toolbar HTML
+* @param string &$toolbar HTML
 */
static function onEditPageBeforeEditToolbar( &$toolbar ) {
global $wgOut;
@@ -415,8 +416,8 @@
/**
 * Callback function for the  parser hook.
 *
-* @param $content (the LaTeX input)
-* @param $attributes
+* @param string $content (the LaTeX input)
+* @param array $attributes
 * @param Parser $parser
 * @return array
 */
diff --git a/MathInputCheckRestbase.php b/MathInputCheckRestbase.php
index ab0dbf2..122a6f4 100644
--- a/MathInputCheckRestbase.php
+++ b/MathInputCheckRestbase.php
@@ -17,7 +17,7 @@
 * (performs no checking)
 * @param string $tex the TeX input string to be checked
 * @param string $type
-* @param MathRestbaseInterface $ref
+* @param MathRestbaseInterface &$ref
 */
public function __construct( $tex = '', $type = 'tex', &$ref = null ) {
parent::__construct( $tex );
diff --git a/MathLaTeXML.php b/MathLaTeXML.php
index e0c1323..3f902fd 100644
--- a/MathLaTeXML.php
+++ b/MathLaTeXML.php
@@ -151,8 +151,7 @@
 
/**
 * Internal version of @link self::embedMathML
-* @return string
-* @return html element with rendered math
+* 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Live Preview: Cope with the edit summary being an OOjs UI wi...

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

Change subject: Live Preview: Cope with the edit summary being an OOjs UI widget
..


Live Preview: Cope with the edit summary being an OOjs UI widget

Bug: T171156
Change-Id: Idb9118421ffbd438dd7b018a8dbf8bb991036232
---
M resources/Resources.php
M resources/src/mediawiki.action/mediawiki.action.edit.preview.js
2 files changed, 15 insertions(+), 4 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/Resources.php b/resources/Resources.php
index 45a90d1..a89fb42 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1452,6 +1452,7 @@
'mediawiki.diff.styles',
'mediawiki.util',
'mediawiki.jqueryMsg',
+   'oojs-ui-core',
],
'messages' => [
// Keep the uses message keys in sync with 
EditPage#setHeaders
diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js 
b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js
index 2b6fc9d..ec572af 100644
--- a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js
+++ b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js
@@ -3,12 +3,14 @@
  */
 ( function ( mw, $ ) {
 
+   var oojsuieditform;
+
/**
 * @ignore
 * @param {jQuery.Event} e
 */
function doLivePreview( e ) {
-   var isDiff, api, parseRequest, diffRequest, postData, 
copySelectors, section,
+   var isDiff, api, parseRequest, diffRequest, postData, 
copySelectors, section, summary,
$wikiPreview, $wikiDiff, $editform, $textbox, $summary, 
$copyElements, $spinner, $errorBox;
 
isDiff = ( e.target.name === 'wpDiff' );
@@ -16,7 +18,13 @@
$wikiDiff = $( '#wikiDiff' );
$editform = $( '#editform' );
$textbox = $editform.find( '#wpTextbox1' );
-   $summary = $editform.find( '#wpSummary' );
+
+   if ( oojsuieditform ) {
+   summary = OO.ui.infuse( $( '#wpSummaryWidget' ) );
+   } else {
+   $summary = $editform.find( '#wpSummary' );
+   }
+
$spinner = $( '.mw-spinner-preview' );
$errorBox = $( '.errorbox' );
section = $editform.find( '[name="wpSection"]' ).val();
@@ -78,7 +86,7 @@
formatversion: 2,
action: 'parse',
title: mw.config.get( 'wgPageName' ),
-   summary: $summary.textSelection( 'getContents' ),
+   summary: oojsuieditform ? summary.getValue() : 
$summary.val(),
prop: ''
};
 
@@ -281,6 +289,8 @@
}
 
$( function () {
+   oojsuieditform = $( '#editform' ).hasClass( 'mw-editform-ooui' 
);
+
// Do not enable on user .js/.css pages, as there's no sane way 
of "previewing"
// the scripts or styles without reloading the page.
if ( $( '#mw-userjsyoucanpreview' ).length || $( 
'#mw-usercssyoucanpreview' ).length ) {
@@ -307,7 +317,7 @@
}
 
if ( !$( '.mw-summary-preview' ).length ) {
-   $( '#wpSummary' ).after(
+   $( oojsuieditform ? '#wpSummaryWidget' : '#wpSummary' 
).after(
$( '' ).addClass( 'mw-summary-preview' )
);
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb9118421ffbd438dd7b018a8dbf8bb991036232
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jforrester 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: He7d3r 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Jforrester 
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] operations...pybal[master]: Allow BGP socket to listen on specific IPs and port

2017-08-09 Thread Mark Bergsma (Code Review)
Mark Bergsma has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370894 )

Change subject: Allow BGP socket to listen on specific IPs and port
..


Allow BGP socket to listen on specific IPs and port

Add global config option bgp-local-ips (default empty: all IPs) which
takes a set of IPs for BGP to bind to.
Add global config option bgp-local-port to override the
default TCP port 179.

Error handling has been altered to log a critical message and raise
an exception if pybal fails to bind to the port on on one of the IP
addresses, instead of ignoring it.

Bug: T103882
Change-Id: I0e4a1cae515602eea8ab07bffb61b9009d5a995a
---
M pybal/bgpfailover.py
1 file changed, 18 insertions(+), 5 deletions(-)



diff --git a/pybal/bgpfailover.py b/pybal/bgpfailover.py
index 5392bcb..b967837 100755
--- a/pybal/bgpfailover.py
+++ b/pybal/bgpfailover.py
@@ -8,6 +8,7 @@
 """
 
 from twisted.internet import reactor
+from twisted.internet.error import CannotListenError
 
 from pybal.util import log
 try:
@@ -67,11 +68,23 @@
 else:
 BGPFailover.peerings.append(self.bgpPeering)
 reactor.addSystemEventTrigger('before', 'shutdown', 
self.closeSession, self.bgpPeering)
-try:
-# Try to listen on the BGP port, not fatal if fails
-reactor.listenTCP(bgp.PORT, 
bgp.BGPServerFactory({self.bgpPeering.peerAddr: self.bgpPeering}))
-except Exception:
-pass
+
+# Bind on the IPs listed in 'bgp_local_ips'. Default to
+# localhost v4 and v6 if no IPs have been specified in the
+# configuration.
+bgp_local_ips = eval(self.globalConfig.get('bgp-local-ips', 
'[""]'))
+bgp_local_port = self.globalConfig.getint('bgp-local-port', 
bgp.PORT)
+# Try to listen on the BGP port, not fatal if fails
+for ip in bgp_local_ips:
+try:
+reactor.listenTCP(
+bgp_local_port,
+bgp.BGPServerFactory({self.bgpPeering.peerAddr: 
self.bgpPeering}),
+interface=ip)
+except CannotListenError as e:
+log.critical(
+"Could not listen for BGP connections: " + str(e))
+raise
 
 def closeSession(self, peering):
 log.info("Clearing session to {}".format(peering.peerAddr))

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e4a1cae515602eea8ab07bffb61b9009d5a995a
Gerrit-PatchSet: 3
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: master
Gerrit-Owner: Mark Bergsma 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: Mark Bergsma 
Gerrit-Reviewer: Volans 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[wmf/1.30.0-wmf.12]: Move JS config vars from page HTML into RL module

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

Change subject: Move JS config vars from page HTML into RL module
..


Move JS config vars from page HTML into RL module

Bug: T172458
Change-Id: I60bfab0028a21c3942508f5ad6377df9a285c7de
(cherry picked from commit 0f6d8818be27bdb534a7ebd037fd27a1e2ac63bf)
---
M CodeMirror.hooks.php
A ResourceLoaderCodeMirrorModule.php
M extension.json
M phpcs.xml
4 files changed, 113 insertions(+), 82 deletions(-)

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



diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php
index 1bd9c40..90c3eff 100644
--- a/CodeMirror.hooks.php
+++ b/CodeMirror.hooks.php
@@ -32,84 +32,6 @@
}
 
/**
-* Returns an array of variables for CodeMirror to work (tags and so on)
-*
-* @global Parser $wgParser
-* @global Language $wgContLang
-* @staticvar array $config Cached version of configuration
-* @return array
-*/
-   public static function getConfiguraton() {
-   global $wgParser, $wgContLang;
-   static $config = [];
-
-   // if we already created these variable array, return it
-   if ( !$config ) {
-// Use the content language, not the user language. 
(See T170130.)
-   $lang = $wgContLang;
-   $registry = ExtensionRegistry::getInstance();
-
-   if ( !isset( $wgParser->mFunctionSynonyms ) ) {
-   $wgParser->initialiseVariables();
-   $wgParser->firstCallInit();
-   }
-
-   // initialize configuration
-   $config = [
-   'pluginModules' => $registry->getAttribute( 
'CodeMirrorPluginModules' ),
-   'tagModes' => $registry->getAttribute( 
'CodeMirrorTagModes' ),
-   'tags' => array_fill_keys( 
$wgParser->getTags(), true ),
-   'doubleUnderscore' => [ [], [] ],
-   'functionSynonyms' => 
$wgParser->mFunctionSynonyms,
-   'urlProtocols' => $wgParser->mUrlProtocols,
-   'linkTrailCharacters' =>  $lang->linkTrail(),
-   ];
-
-   $mw = $lang->getMagicWords();
-   foreach ( MagicWord::getDoubleUnderscoreArray()->names 
as $name ) {
-   if ( isset( $mw[$name] ) ) {
-   $caseSensitive = array_shift( 
$mw[$name] ) == 0 ? 0 : 1;
-   foreach ( $mw[$name] as $n ) {
-   $n = $caseSensitive ? $n : 
$lang->lc( $n );
-   
$config['doubleUnderscore'][$caseSensitive][$n] = $name;
-   }
-   } else {
-   $config['doubleUnderscore'][0][] = 
$name;
-   }
-   }
-
-   foreach ( MagicWord::getVariableIDs() as $name ) {
-   if ( isset( $mw[$name] ) ) {
-   $caseSensitive = array_shift( 
$mw[$name] ) == 0 ? 0 : 1;
-   foreach ( $mw[$name] as $n ) {
-   $n = $caseSensitive ? $n : 
$lang->lc( $n );
-   
$config['functionSynonyms'][$caseSensitive][$n] = $name;
-   }
-   }
-   }
-
-   }
-
-   return $config;
-   }
-
-   /**
-* MakeGlobalVariablesScript hook handler
-*
-* @see 
https://www.mediawiki.org/wiki/Manual:Hooks/MakeGlobalVariablesScript
-*
-* @param array $vars
-* @param OutputPage $out
-*/
-   public static function onMakeGlobalVariablesScript( array &$vars, 
OutputPage $out ) {
-   $context = $out->getContext();
-   // add CodeMirror vars on edit pages, or if VE is installed
-   if ( self::isCodeMirrorEnabled( $context ) || class_exists( 
'VisualEditorHooks' ) ) {
-   $vars['extCodeMirrorConfig'] = self::getConfiguraton();
-   }
-   }
-
-   /**
 * BeforePageDisplay hook handler
 *
 * @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay
diff --git a/ResourceLoaderCodeMirrorModule.php 
b/ResourceLoaderCodeMirrorModule.php
new file mode 100644
index 000..457d5cd
--- /dev/null
+++ b/ResourceLoaderCodeMirrorModule.php
@@ -0,0 +1,109 @@

[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[master]: Renders Index: pages without replying their Wikitext seriali...

2017-08-09 Thread Tpt (Code Review)
Tpt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370940 )

Change subject: Renders Index: pages without replying their Wikitext 
serialization
..

Renders Index: pages without replying their Wikitext serialization

Change-Id: I3f3ffcae202a08acec55061dc07a20f033fa8d69
---
M includes/index/IndexContent.php
1 file changed, 24 insertions(+), 5 deletions(-)


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

diff --git a/includes/index/IndexContent.php b/includes/index/IndexContent.php
index 107915d..5fd0a01 100644
--- a/includes/index/IndexContent.php
+++ b/includes/index/IndexContent.php
@@ -4,7 +4,9 @@
 
 use Content;
 use MagicWord;
+use Parser;
 use ParserOptions;
+use ParserOutput;
 use TextContent;
 use Title;
 use User;
@@ -166,12 +168,29 @@
}
 
/**
-* @see Content::getParserOutput
+* @see AbstractContent::fillParserOutput
 */
-   public function getParserOutput(
-   Title $title, $revId = null, ParserOptions $options = null, 
$generateHtml = true
+   protected function fillParserOutput( Title $title, $revId,
+   ParserOptions $options, $generateHtml, ParserOutput &$output
) {
-   $wikitextContent = new WikitextContent( $this->serialize( 
CONTENT_FORMAT_WIKITEXT ) );
-   return $wikitextContent->getParserOutput( $title, $revId, 
$options, $generateHtml );
+   /** @var Parser $wgParser */
+   global $wgParser;
+
+   // We expand the index template
+   $wgParser->startExternalParse( $title, $options, 
Parser::OT_PREPROCESS );
+   $frame = $wgParser->getPreprocessor()->newCustomFrame( 
array_map( function ( Content $content ) {
+   return $content->serialize( CONTENT_FORMAT_WIKITEXT );
+   }, $this->fields ) );
+   $templateTitle = Title::makeTitle( NS_MEDIAWIKI, 'Proofreadpage 
index template' );
+   $templateText = $wgParser->fetchTemplate( $templateTitle );
+   $dom = $wgParser->preprocessToDom( $templateText, 
Parser::PTD_FOR_INCLUSION );
+   $text = $frame->expand( $dom );
+
+   // We do the final rendering
+   $output = $wgParser->parse( $text, $title, $options, true, 
true, $revId );
+   $output->addTemplate( $templateTitle,
+   $templateTitle->getArticleID(),
+   $templateTitle->getLatestRevID()
+   );
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...PageAssessments[master]: Test patch to check network at Wikimania

2017-08-09 Thread Niharika29 (Code Review)
Niharika29 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370939 )

Change subject: Test patch to check network at Wikimania
..

Test patch to check network at Wikimania

Change-Id: I6ae520e01edc7b031457769f22a0011ff36c961d
---
M PageAssessmentsBody.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/PageAssessmentsBody.php b/PageAssessmentsBody.php
index de2c05a..7ae8b85 100644
--- a/PageAssessmentsBody.php
+++ b/PageAssessmentsBody.php
@@ -1,5 +1,6 @@
 https://gerrit.wikimedia.org/r/370939
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ae520e01edc7b031457769f22a0011ff36c961d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageAssessments
Gerrit-Branch: master
Gerrit-Owner: Niharika29 

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Upgrade mapbox.js to v3.0.1 (upgrade leaflet to 1.0.2)

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

Change subject: Upgrade mapbox.js to v3.0.1 (upgrade leaflet to 1.0.2)
..


Upgrade mapbox.js to v3.0.1 (upgrade leaflet to 1.0.2)

Bug: T147347
Change-Id: Iefd04175e4391649d8072ad29b51db9505d15eff
---
A lib/mapbox/images/icons-ff.svg
M lib/mapbox/images/icons.svg
A lib/mapbox/images/marker-icon-2x.png
A lib/mapbox/images/marker-icon.png
M lib/mapbox/mapbox-lib.js
M lib/mapbox/style.css
M modules/box/Map.js
M modules/linkbox/Link.js
M modules/wikivoyage/ControlLayers.js
M package.json
M styles/leaflet-overrides.less
11 files changed, 9,627 insertions(+), 5,778 deletions(-)

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iefd04175e4391649d8072ad29b51db9505d15eff
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: JGirault 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MaxSem 
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] operations/mediawiki-config[master]: Correct config - commonswiki not commons

2017-08-09 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370924 )

Change subject: Correct config - commonswiki not commons
..

Correct config - commonswiki not commons

Bug: T170687
Change-Id: I1543147666a1a89ef02b87fa3314fef69acd7325
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index fab2d9d..b089754 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19382,7 +19382,7 @@
 'wgShortPagesNamespaceBlacklist' => [
'default' => [],
// T170687
-   'commons' => [ NS_FILE ],
+   'commonswiki' => [ NS_FILE ],
 ],
 
 // Temporarily enable until 1.30.0-wmf.12 rolls out -RK

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1543147666a1a89ef02b87fa3314fef69acd7325
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
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] operations/mediawiki-config[master]: Revert "db-codfw.php: Depool db2046"

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

Change subject: Revert "db-codfw.php: Depool db2046"
..


Revert "db-codfw.php: Depool db2046"

This reverts commit 554557000c4f781b60011749048839739b216f69.

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

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



diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php
index 4c7b64c..0a14787 100644
--- a/wmf-config/db-codfw.php
+++ b/wmf-config/db-codfw.php
@@ -142,7 +142,7 @@
's6' => [
'db2028' => 0,   # B6  2.9TB  96GB, master
'db2039' => 50,  # C6 2.9TB 160GB, rc, log
-   # 'db2046' => 400, # C6 2.9TB 160GB # T170662
+   'db2046' => 400, # C6 2.9TB 160GB
'db2053' => 100, # D6 2.9TB 160GB, dump (inactive), vslow
'db2060' => 100, # D6 3.3TB 160GB, api
'db2067' => 400, # D6 3.3TB 160GB

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie38f8a81e1b04ad2ba1fe7a01c46d5fe873cfaf5
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...rainbow[develop]: Add 'na.rm = TRUE' to sum functions

2017-08-09 Thread Chelsyx (Code Review)
Chelsyx has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370922 )

Change subject: Add 'na.rm = TRUE' to sum functions
..

Add 'na.rm = TRUE' to sum functions

Bug: T170469
Change-Id: I065f732b94bc59c487885e59c618abb1319c72ca
---
M utils.R
1 file changed, 22 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/rainbow 
refs/changes/22/370922/1

diff --git a/utils.R b/utils.R
index 6d25af8..ab34131 100644
--- a/utils.R
+++ b/utils.R
@@ -20,14 +20,14 @@
 dplyr::summarize(volume = sum(as.numeric(`search sessions`), na.rm = 
TRUE)) %>%
 dplyr::filter(volume > 0) %>%
 dplyr::arrange(desc(volume)) %>%
-dplyr::mutate(prop = volume / sum(volume),
+dplyr::mutate(prop = volume / sum(volume, na.rm = TRUE),
   label = sprintf("%s (%.3f%%)", language, 100 * prop))
   available_projects_desktop <<- desktop_langproj_dygraph_set %>%
 dplyr::group_by(project) %>%
 dplyr::summarize(volume = sum(as.numeric(`search sessions`), na.rm = 
TRUE)) %>%
 dplyr::filter(volume > 0) %>%
 dplyr::arrange(desc(volume)) %>%
-dplyr::mutate(prop = volume / sum(volume),
+dplyr::mutate(prop = volume / sum(volume, na.rm = TRUE),
   label = sprintf("%s (%.3f%%)", project, 100 * prop))
 }
 
@@ -69,7 +69,7 @@
 dplyr::filter(!is.na(click_position), !is.na(events)) %>%
 dplyr::distinct(date, click_position, .keep_all = TRUE) %>%
 dplyr::group_by(date) %>%
-dplyr::mutate(prop = round(events / sum(events) * 100, 2)) %>%
+dplyr::mutate(prop = round(events / sum(events, na.rm = TRUE) * 100, 2)) 
%>%
 dplyr::ungroup() %>%
 dplyr::select(-events) %>%
 tidyr::spread(click_position, prop, fill = 0)
@@ -80,7 +80,7 @@
 dplyr::filter(!is.na(invoke_source), !is.na(events)) %>%
 dplyr::distinct(date, invoke_source, .keep_all = TRUE) %>%
 dplyr::group_by(date) %>%
-dplyr::mutate(prop = round(events / sum(events) * 100, 2)) %>%
+dplyr::mutate(prop = round(events / sum(events, na.rm = TRUE) * 100, 2)) 
%>%
 dplyr::ungroup() %>%
 dplyr::select(-events) %>%
 tidyr::spread(invoke_source, prop, fill = 0)
@@ -179,14 +179,14 @@
 dplyr::summarize(volume = sum(as.numeric(total), na.rm = TRUE)) %>%
 dplyr::filter(volume > 0) %>%
 dplyr::arrange(desc(volume)) %>%
-dplyr::mutate(prop = volume / sum(volume),
+dplyr::mutate(prop = volume / sum(volume, na.rm = TRUE),
   label = sprintf("%s (%.3f%%)", language, 100 * prop))
   available_projects <<- langproj_with_automata %>%
 dplyr::group_by(project) %>%
 dplyr::summarize(volume = sum(as.numeric(total), na.rm = TRUE)) %>%
 dplyr::filter(volume > 0) %>%
 dplyr::arrange(desc(volume)) %>%
-dplyr::mutate(prop = volume / sum(volume),
+dplyr::mutate(prop = volume / sum(volume, na.rm = TRUE),
   label = sprintf("%s (%.3f%%)", project, 100 * prop))
   projects_db <<- readr::read_csv(system.file("extdata/projects.csv", package 
= "polloi"), col_types = "cclc")[, c("project", "multilingual")]
 }
@@ -203,7 +203,7 @@
   ) %>%
 dplyr::bind_rows(.id = "platform") %>%
 dplyr::group_by(date) %>%
-dplyr::summarize(clickthroughs = sum(clickthroughs), serps = sum(`Result 
pages opened`)) %>%
+dplyr::summarize(clickthroughs = sum(clickthroughs, na.rm = TRUE), serps = 
sum(`Result pages opened`, na.rm = TRUE)) %>%
 dplyr::right_join(threshold_data, by = "date") %>%
 dplyr::transmute(
   date = date,
@@ -244,7 +244,7 @@
   ) %>%
 dplyr::bind_rows(.id = "platform") %>%
 dplyr::group_by(date, language, project) %>%
-dplyr::summarize(clickthroughs = sum(clickthroughs), serps = sum(`Result 
pages opened`)) %>%
+dplyr::summarize(clickthroughs = sum(clickthroughs, na.rm = TRUE), serps = 
sum(`Result pages opened`, na.rm = TRUE)) %>%
 dplyr::right_join(threshold_data, by = c("date", "language", "project")) 
%>%
 dplyr::ungroup() %>%
 dplyr::transmute(
@@ -263,14 +263,14 @@
 dplyr::summarize(volume = sum(as.numeric(`Result pages opened`), na.rm = 
TRUE)) %>%
 dplyr::filter(volume > 0) %>%
 dplyr::arrange(desc(volume)) %>%
-dplyr::mutate(prop = volume / sum(volume),
+dplyr::mutate(prop = volume / sum(volume, na.rm = TRUE),
   label = sprintf("%s (%.3f%%)", language, 100 * prop))
   available_projects_ctr <<- augmented_clickthroughs_langproj %>%
 dplyr::group_by(project) %>%
 dplyr::summarize(volume = sum(as.numeric(`Result pages opened`), na.rm = 
TRUE)) %>%
 dplyr::filter(volume > 0) %>%
 dplyr::arrange(desc(volume)) %>%
-dplyr::mutate(prop = volume / sum(volume),
+dplyr::mutate(prop = volume / sum(volume, na.rm = TRUE),
   label = sprintf("%s (%.3f%%)", project, 100 * prop))
 }
 
@@ -301,14 +301,14 @@
 dplyr::summarize(volume = sum(as.numeric(`search sessions`), na.rm = 
TRUE)) 

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Revert "db-codfw.php: Depool db2046"

2017-08-09 Thread Marostegui (Code Review)
Hello Florianschmidtwelzow, jenkins-bot, Jcrespo,

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

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

to review the following change.


Change subject: Revert "db-codfw.php: Depool db2046"
..

Revert "db-codfw.php: Depool db2046"

This reverts commit 554557000c4f781b60011749048839739b216f69.

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


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

diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php
index 7afee2f..027b310 100644
--- a/wmf-config/db-codfw.php
+++ b/wmf-config/db-codfw.php
@@ -142,7 +142,7 @@
's6' => [
'db2028' => 0,   # B6  2.9TB  96GB, master
'db2039' => 50,  # C6 2.9TB 160GB, rc, log
-   # 'db2046' => 400, # C6 2.9TB 160GB # T170662
+   'db2046' => 400, # C6 2.9TB 160GB
'db2053' => 100, # D6 2.9TB 160GB, dump (inactive), vslow
'db2060' => 100, # D6 3.3TB 160GB, api
'db2067' => 400, # D6 3.3TB 160GB

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie38f8a81e1b04ad2ba1fe7a01c46d5fe873cfaf5
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove unused code snippets from EntityChangeFactory and rel...

2017-08-09 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370915 )

Change subject: Remove unused code snippets from EntityChangeFactory and related
..

Remove unused code snippets from EntityChangeFactory and related

This tackles post-merge comments from Iaa98722.

Bug: T172394
Change-Id: If47e719af40088b25e81c29059530146707d7de3
---
M client/includes/Changes/InjectRCRecordsJob.php
M lib/includes/Changes/EntityChangeFactory.php
2 files changed, 21 insertions(+), 20 deletions(-)


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

diff --git a/client/includes/Changes/InjectRCRecordsJob.php 
b/client/includes/Changes/InjectRCRecordsJob.php
index 6a50900..8371e89 100644
--- a/client/includes/Changes/InjectRCRecordsJob.php
+++ b/client/includes/Changes/InjectRCRecordsJob.php
@@ -2,17 +2,16 @@
 
 namespace Wikibase\Client\Changes;
 
+use InvalidArgumentException;
 use Job;
 use JobSpecification;
 use Liuggio\StatsdClient\Factory\StatsdDataFactoryInterface;
 use Psr\Log\LoggerInterface;
 use Psr\Log\NullLogger;
 use Title;
-use Wikibase\Client\Changes\ChangeHandler;
 use Wikibase\Client\RecentChanges\RecentChangeFactory;
 use Wikibase\Client\RecentChanges\RecentChangesDuplicateDetector;
 use Wikibase\Client\Store\TitleFactory;
-use Wikibase\Client\WikibaseClient;
 use Wikibase\EntityChange;
 use Wikibase\Lib\Changes\EntityChangeFactory;
 use Wikibase\Lib\Store\Sql\EntityChangeLookup;
@@ -114,6 +113,8 @@
 * @param RecentChangeFactory $rcFactory
 * @param array $params Needs to have two keys: "change": the id of the 
change,
 * "pages": array of pages, represented as $pageId => [ $namespace, 
$dbKey ].
+*
+* @throws InvalidArgumentException
 */
public function __construct(
LBFactory $lbFactory,
@@ -125,11 +126,6 @@
$title = Title::makeTitle( NS_SPECIAL, 'Badtitle/' . __CLASS__ 
);
parent::__construct( 'wikibase-InjectRCRecords', $title, 
$params );
 
-   Assert::parameter(
-   isset( $params['change'] ),
-   '$params',
-   '$params[\'change\'] not set.'
-   );
// TODO: disallow integer once T172394 has been deployed and 
old jobs have cleared the queue.
Assert::parameterType(
'integer|array',
@@ -137,11 +133,6 @@
'$params[\'change\']'
);
 
-   Assert::parameter(
-   isset( $params['pages'] ),
-   '$params',
-   '$params[\'pages\'] not set.'
-   );
Assert::parameterElementType(
'array',
$params['pages'],
@@ -187,6 +178,8 @@
 
/**
 * @param int $dbBatchSize
+*
+* @throws InvalidArgumentException
 */
public function setDbBatchSize( $dbBatchSize ) {
Assert::parameterType( 'integer', $dbBatchSize, '$dbBatchSize' 
);
@@ -244,7 +237,7 @@
$titles = [];
 
foreach ( $pages as $pageId => list( $namespace, $dbKey ) ) {
-   $titles[$pageId] = $this->titleFactory->makeTitle( 
$namespace, $dbKey );
+   $titles[] = $this->titleFactory->makeTitle( $namespace, 
$dbKey );
}
 
return $titles;
diff --git a/lib/includes/Changes/EntityChangeFactory.php 
b/lib/includes/Changes/EntityChangeFactory.php
index 8fb9411..e3e85a4 100644
--- a/lib/includes/Changes/EntityChangeFactory.php
+++ b/lib/includes/Changes/EntityChangeFactory.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Lib\Changes;
 
+use InvalidArgumentException;
 use MWException;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Entity\EntityId;
@@ -47,7 +48,7 @@
public function __construct(
EntityDiffer $entityDiffer,
EntityIdParser $idParser,
-   array $changeClasses = []
+   array $changeClasses
) {
$this->entityDiffer = $entityDiffer;
$this->idParser = $idParser;
@@ -92,25 +93,33 @@
 * @param EntityId $entityId
 * @param array $fields additional fields to set
 *
+* @throws InvalidArgumentException
 * @return EntityChange
 */
public function newForChangeType( $changeType, EntityId $entityId, 
array $fields ) {
-   $action = explode( '~', $changeType )[1];
+   $changeType = explode( '~', $changeType, 2 );
+   Assert::parameter(
+   isset( $changeType[1] ),
+   '$changeType',
+   'must conform to the format 
"wikibase-~"'
+   );
+
+   $action = 

[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[wmf/1.30.0-wmf.12]: Move JS config vars from page HTML into RL module

2017-08-09 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370904 )

Change subject: Move JS config vars from page HTML into RL module
..

Move JS config vars from page HTML into RL module

Bug: T172458
Change-Id: I60bfab0028a21c3942508f5ad6377df9a285c7de
(cherry picked from commit 0f6d8818be27bdb534a7ebd037fd27a1e2ac63bf)
---
M CodeMirror.hooks.php
A ResourceLoaderCodeMirrorModule.php
M extension.json
M phpcs.xml
4 files changed, 113 insertions(+), 82 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeMirror 
refs/changes/04/370904/1

diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php
index 1bd9c40..90c3eff 100644
--- a/CodeMirror.hooks.php
+++ b/CodeMirror.hooks.php
@@ -32,84 +32,6 @@
}
 
/**
-* Returns an array of variables for CodeMirror to work (tags and so on)
-*
-* @global Parser $wgParser
-* @global Language $wgContLang
-* @staticvar array $config Cached version of configuration
-* @return array
-*/
-   public static function getConfiguraton() {
-   global $wgParser, $wgContLang;
-   static $config = [];
-
-   // if we already created these variable array, return it
-   if ( !$config ) {
-// Use the content language, not the user language. 
(See T170130.)
-   $lang = $wgContLang;
-   $registry = ExtensionRegistry::getInstance();
-
-   if ( !isset( $wgParser->mFunctionSynonyms ) ) {
-   $wgParser->initialiseVariables();
-   $wgParser->firstCallInit();
-   }
-
-   // initialize configuration
-   $config = [
-   'pluginModules' => $registry->getAttribute( 
'CodeMirrorPluginModules' ),
-   'tagModes' => $registry->getAttribute( 
'CodeMirrorTagModes' ),
-   'tags' => array_fill_keys( 
$wgParser->getTags(), true ),
-   'doubleUnderscore' => [ [], [] ],
-   'functionSynonyms' => 
$wgParser->mFunctionSynonyms,
-   'urlProtocols' => $wgParser->mUrlProtocols,
-   'linkTrailCharacters' =>  $lang->linkTrail(),
-   ];
-
-   $mw = $lang->getMagicWords();
-   foreach ( MagicWord::getDoubleUnderscoreArray()->names 
as $name ) {
-   if ( isset( $mw[$name] ) ) {
-   $caseSensitive = array_shift( 
$mw[$name] ) == 0 ? 0 : 1;
-   foreach ( $mw[$name] as $n ) {
-   $n = $caseSensitive ? $n : 
$lang->lc( $n );
-   
$config['doubleUnderscore'][$caseSensitive][$n] = $name;
-   }
-   } else {
-   $config['doubleUnderscore'][0][] = 
$name;
-   }
-   }
-
-   foreach ( MagicWord::getVariableIDs() as $name ) {
-   if ( isset( $mw[$name] ) ) {
-   $caseSensitive = array_shift( 
$mw[$name] ) == 0 ? 0 : 1;
-   foreach ( $mw[$name] as $n ) {
-   $n = $caseSensitive ? $n : 
$lang->lc( $n );
-   
$config['functionSynonyms'][$caseSensitive][$n] = $name;
-   }
-   }
-   }
-
-   }
-
-   return $config;
-   }
-
-   /**
-* MakeGlobalVariablesScript hook handler
-*
-* @see 
https://www.mediawiki.org/wiki/Manual:Hooks/MakeGlobalVariablesScript
-*
-* @param array $vars
-* @param OutputPage $out
-*/
-   public static function onMakeGlobalVariablesScript( array &$vars, 
OutputPage $out ) {
-   $context = $out->getContext();
-   // add CodeMirror vars on edit pages, or if VE is installed
-   if ( self::isCodeMirrorEnabled( $context ) || class_exists( 
'VisualEditorHooks' ) ) {
-   $vars['extCodeMirrorConfig'] = self::getConfiguraton();
-   }
-   }
-
-   /**
 * BeforePageDisplay hook handler
 *
 * @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay
diff --git a/ResourceLoaderCodeMirrorModule.php 
b/ResourceLoaderCodeMirrorModule.php
new file mode 100644
index 000..457d5cd
--- /dev/null
+++ b/ResourceLoaderCodeMirrorModule.php
@@ 

[MediaWiki-commits] [Gerrit] operations...python-thumbor-wikimedia[master]: Upgrade to 1.2

2017-08-09 Thread Gilles (Code Review)
Gilles has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370907 )

Change subject: Upgrade to 1.2
..

Upgrade to 1.2

Includes the new STL engine.

Bug: T161719
Change-Id: I0a0b67cbbbe1a2b289a251af980cb9911f1b4f39
---
M debian/40-wikimedia.conf
M debian/changelog
M debian/control
M debian/rules
M setup.py
M tests/integration/__init__.py
A tests/integration/originals/4x2brick_0.00interference.STL
A tests/integration/originals/crystal-NEW.stl
A tests/integration/test_3d.py
M tests/integration/test_images_handler.py
A tests/integration/thumbnails/300px-4x2brick_0.00interference.stl.png
A tests/integration/thumbnails/300px-crystal-NEW.stl.png
A wikimedia_thumbor/engine/stl/__init__.py
A wikimedia_thumbor/engine/stl/stl.py
M wikimedia_thumbor/loader/swift/__init__.py
15 files changed, 15,354 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/operations/debs/python-thumbor-wikimedia 
refs/changes/07/370907/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a0b67cbbbe1a2b289a251af980cb9911f1b4f39
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/python-thumbor-wikimedia
Gerrit-Branch: master
Gerrit-Owner: Gilles 

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


[MediaWiki-commits] [Gerrit] mediawiki...LoginNotify[master]: Improve some parameter docs

2017-08-09 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370898 )

Change subject: Improve some parameter docs
..

Improve some parameter docs

Change-Id: I47e04c7e2b773d52289f459f59a46aeb9c4ad12e
---
M composer.json
M includes/Hooks.php
M phpcs.xml
3 files changed, 6 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LoginNotify 
refs/changes/98/370898/1

diff --git a/composer.json b/composer.json
index 7de1f1c..5204a3b 100644
--- a/composer.json
+++ b/composer.json
@@ -12,7 +12,7 @@
"scripts": {
"fix": "phpcbf",
"test": [
-   "parallel-lint . --exclude vendor",
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
"phpcs -p -s"
]
}
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 9685022..9ce77d8 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -88,7 +88,7 @@
 
/**
 * @param EchoEvent $event
-* @param string $bundleString
+* @param string &$bundleString
 * @return bool
 */
public static function onEchoGetBundleRules( EchoEvent $event, 
&$bundleString ) {
@@ -107,7 +107,7 @@
 *
 * @param User $user User in question.
 * @param string $pass The password (parameter not used).
-* @param integer $retval A LoginForm constant (e.g. 
LoginForm::SUCCESS).
+* @param int $retval A LoginForm constant (e.g. LoginForm::SUCCESS).
 */
public static function onLoginAuthenticateAudit( User $user, $pass, 
$retval ) {
if ( $retval === LoginForm::WRONG_PASS ) {
@@ -175,7 +175,7 @@
 *
 * @todo This still sets cookies if user creates an account while 
logged in as someone else.
 * @param User $user The user that has been created.
-* @param boolean $byMail Account created by email
+* @param bool $byMail Account created by email
 */
public static function onAddNewAccount( User $user, $byMail ) {
if ( !$byMail ) {
@@ -191,7 +191,7 @@
 *
 * @todo This still sets cookies if user creates account well logged in 
as someone else.
 * @param User $user User created
-* @param boolean $autocreated Whether this was an auto-created account
+* @param bool $autocreated Whether this was an auto-created account
 */
public static function onLocalUserCreated( $user, $autocreated ) {
if ( !$autocreated ) {
diff --git a/phpcs.xml b/phpcs.xml
index c2c9ce3..d1b5f11 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,11 +2,8 @@
 


-   
-   

.

-   
-   vendor
+   
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...JsonConfig[master]: Improve some parameter docs

2017-08-09 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370895 )

Change subject: Improve some parameter docs
..

Improve some parameter docs

Change-Id: I6bcf254a7a28a3e168af1488fa02ecc443b54022
---
M composer.json
M includes/JCApi.php
M includes/JCContent.php
M includes/JCContentHandler.php
M includes/JCDefaultContentView.php
M includes/JCDefaultObjContentView.php
M includes/JCLuaLibrary.php
M includes/JCMapDataContent.php
M includes/JCObjContent.php
M includes/JCSingleton.php
M includes/JCUtils.php
M includes/JCValidators.php
M phpcs.xml
13 files changed, 35 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JsonConfig 
refs/changes/95/370895/1

diff --git a/composer.json b/composer.json
index bf202bf..fd295f4 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
"scripts": {
"fix": "phpcbf",
"test": [
-   "parallel-lint . --exclude vendor",
+   "parallel-lint . --exclude vendor --exclude 
node_modules",
"phpcs -p -s"
]
}
diff --git a/includes/JCApi.php b/includes/JCApi.php
index 5a33688..2de38ad 100644
--- a/includes/JCApi.php
+++ b/includes/JCApi.php
@@ -160,6 +160,7 @@
 
/**
 * @see ApiBase::getExamplesMessages()
+* @return array
 */
protected function getExamplesMessages() {
return [
diff --git a/includes/JCContent.php b/includes/JCContent.php
index 8128c38..5056489 100644
--- a/includes/JCContent.php
+++ b/includes/JCContent.php
@@ -74,6 +74,7 @@
 
/**
 * Get content status object
+* @return \Status
 */
public function getStatus() {
return $this->status;
@@ -91,10 +92,11 @@
return $text === '' || $text === '{}';
}
 
-   /*
+   /**
 * Determines whether this content should be considered a "page" for 
statistics
 * In our case, just making sure it's not empty or a redirect
-*
+* @param bool $hasLinks
+* @return bool
 */
public function isCountable( $hasLinks = null ) {
return !$this->isEmpty() && !$this->isRedirect();
diff --git a/includes/JCContentHandler.php b/includes/JCContentHandler.php
index a0e1e4a..ccbf07b 100644
--- a/includes/JCContentHandler.php
+++ b/includes/JCContentHandler.php
@@ -32,7 +32,7 @@
 * Returns the content's text as-is.
 *
 * @param \Content|JCContent $content This is actually a Content object
-* @param $format string|null
+* @param string|null $format
 * @return mixed
 */
public function serializeContent( \Content $content, $format = null ) {
diff --git a/includes/JCDefaultContentView.php 
b/includes/JCDefaultContentView.php
index ea8ce99..c12a53f 100644
--- a/includes/JCDefaultContentView.php
+++ b/includes/JCDefaultContentView.php
@@ -127,7 +127,7 @@
/**
 * Determine if data is a container and should be rendered as a complex 
structure
 * @param JCContent $content
-* @param $data
+* @param array|object $data
 * @param array $path
 * @return bool
 */
@@ -142,7 +142,7 @@
 * Determine if data is a special container that needs to be rendered 
as a comma-separated list.
 * By default,
 * @param JCContent $content
-* @param $data
+* @param array|object $data
 * @param array $path
 * @return bool
 */
diff --git a/includes/JCDefaultObjContentView.php 
b/includes/JCDefaultObjContentView.php
index 9024cf6..d2895c5 100644
--- a/includes/JCDefaultObjContentView.php
+++ b/includes/JCDefaultObjContentView.php
@@ -96,7 +96,7 @@
 * Determine if data is a special container that needs to be rendered 
as a comma-separated list.
 * By default,
 * @param JCContent $content
-* @param $data
+* @param array|object $data
 * @param array $path
 * @return bool
 */
diff --git a/includes/JCLuaLibrary.php b/includes/JCLuaLibrary.php
index df5781b..c9b01ff 100644
--- a/includes/JCLuaLibrary.php
+++ b/includes/JCLuaLibrary.php
@@ -10,7 +10,7 @@
 
/**
 * @param string $engine
-* @param string[] $extraLibraries
+* @param string[] &$extraLibraries
 *
 * @return bool
 */
diff --git a/includes/JCMapDataContent.php b/includes/JCMapDataContent.php
index 3a05bbf..da2617a 100644
--- a/includes/JCMapDataContent.php
+++ b/includes/JCMapDataContent.php
@@ -31,7 +31,7 @@
}
 
/**
-* @inheritdoc
+* @inheritDoc
 */
public function getSafeData( $data ) {
/** @var Parser */
@@ -79,7 +79,7 @@
 * Recursively walk the geojson to replace localized "title" and 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix slightly broken @return documentations

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

Change subject: Fix slightly broken @return documentations
..


Fix slightly broken @return documentations

* We are consistently using "@return" without "s".
* Neither "false" nor "true" are types. "bool" is the type.

Change-Id: I07b09e74555de4aaa451366240fe7e13ea80f4d7
---
M client/includes/Changes/WikiPageUpdater.php
M lib/includes/WikibaseSettings.php
M repo/includes/Search/Elastic/ElasticTermResult.php
3 files changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/client/includes/Changes/WikiPageUpdater.php 
b/client/includes/Changes/WikiPageUpdater.php
index 2ab62a5..2739bc9 100644
--- a/client/includes/Changes/WikiPageUpdater.php
+++ b/client/includes/Changes/WikiPageUpdater.php
@@ -165,7 +165,7 @@
/**
 * @param Title[] $titles
 *
-* @returns array[] string $pageId => [ int $namespace, string $dbKey ]
+* @return array[] string $pageId => [ int $namespace, string $dbKey ]
 */
private function getPageParamForRefreshLinksJob( array $titles ) {
$pages = [];
diff --git a/lib/includes/WikibaseSettings.php 
b/lib/includes/WikibaseSettings.php
index 059a562..ad5abdc 100644
--- a/lib/includes/WikibaseSettings.php
+++ b/lib/includes/WikibaseSettings.php
@@ -23,7 +23,7 @@
 class WikibaseSettings {
 
/**
-* @returns true if and only if the Wikibase repository component is 
enabled on this wiki.
+* @return bool True if and only if the Wikibase repository component 
is enabled on this wiki.
 */
public static function isRepoEnabled() {
return defined( 'WB_VERSION' );
@@ -35,7 +35,7 @@
 *
 * @throws MWException
 *
-* @returns SettingsArray
+* @return SettingsArray
 */
public static function getRepoSettings() {
if ( !self::isRepoEnabled() ) {
@@ -48,7 +48,7 @@
}
 
/**
-* @returns true if and only if the Wikibase client component is 
enabled on this wiki.
+* @return bool True if and only if the Wikibase client component is 
enabled on this wiki.
 */
public static function isClientEnabled() {
return defined( 'WBC_VERSION' );
@@ -57,7 +57,7 @@
/**
 * @throws MWException
 *
-* @returns SettingsArray
+* @return SettingsArray
 */
public static function getClientSettings() {
if ( !self::isClientEnabled() ) {
diff --git a/repo/includes/Search/Elastic/ElasticTermResult.php 
b/repo/includes/Search/Elastic/ElasticTermResult.php
index b6bc9e9..6d1b043 100644
--- a/repo/includes/Search/Elastic/ElasticTermResult.php
+++ b/repo/includes/Search/Elastic/ElasticTermResult.php
@@ -52,7 +52,7 @@
/**
 * Get the source filtering to be used loading the result.
 *
-* @return false|string|array corresponding to Elasticsearch source 
filtering syntax
+* @return string[]
 */
public function getSourceFiltering() {
$fields = [ 'namespace', 'title' ];

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: tests: Avoid production-like dc and host names

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

Change subject: tests: Avoid production-like dc and host names
..


tests: Avoid production-like dc and host names

As a matter of principle, never use production-like names in test fixtures
and example values to avoid various bad things:
* Fragile dependence between tests and execution environment
  that might wrongly pass due to something being inherited.
* Docs looking outdated if/when we use a different DC.
  (Lots of docs looked outdated after pmtpa decom)
* Avoid false confidence in using examples verbatim during a switchover
  that will wrongly use eqiad instead of codfw (obvious examples don't
  look authoritative or current and will always encourage one to look at
  a better source).
* Avoid bad search results when looking for production host names and their
  "usage" across various WMF repos.

Change-Id: If55cd0e442e6a4b5b11c080fd564e04830d6585f
---
M CirrusSearch.php
M docs/settings.txt
M tests/unit/ClusterSettingsTest.php
M tests/unit/Maintenance/ReindexerTest.php
4 files changed, 40 insertions(+), 40 deletions(-)

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



diff --git a/CirrusSearch.php b/CirrusSearch.php
index bec54dd..ccf7d77 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -65,8 +65,8 @@
  * configured (see below).
  *
  * $wgCirrusSearchClusters = array(
- * 'eqiad' => array( 'es01.eqiad.wmnet', 'es02.eqiad.wmnet' ),
- * 'codfw' => array( 'es01.codfw.wmnet', 'es02.codfw.wmnet' ),
+ * 'dc-foo' => array( 'es01.foo.local', 'es02.foo.local' ),
+ * 'dc-bar' => array( 'es01.bar.local', 'es02.bar.local' ),
  * );
  */
 $wgCirrusSearchClusters = [
@@ -682,10 +682,10 @@
  * in $wgCirrusSearchClusters. Note that queries can use multiple features, in
  * the case multiple features have overrides the first match wins.
  *
- * Example sending more_like queries to codfw and completion to eqiad:
+ * Example sending more_like queries to dc-foo and completion to dc-bar:
  *   $wgCirrusSearchClusterOverrides = [
- * 'more_like' => 'codfw',
- * 'completion' => 'eqiad',
+ * 'more_like' => 'dc-foo',
+ * 'completion' => 'dc-bar',
  *   ];
  */
 $wgCirrusSearchClusterOverrides = [];
diff --git a/docs/settings.txt b/docs/settings.txt
index 7f92bde..cfabeed 100644
--- a/docs/settings.txt
+++ b/docs/settings.txt
@@ -41,8 +41,8 @@
 
 Example:
 $wgCirrusSearchClusters = array(
-'eqiad' => array( 'es01.eqiad.wmnet', 'es02.eqiad.wmnet' ),
-'codfw' => array( 'es01.codfw.wmnet', 'es02.codfw.wmnet' ),
+'dc-foo' => array( 'es01.foo.local', 'es02.foo.local' )
+'dc-bar' => array( 'es01.bar.local', 'es02.bar.local' )
 );
 
 ; $wgCirrusSearchWriteClusters
@@ -787,10 +787,10 @@
 in $wgCirrusSearchClusters. Note that queries can use multiple features, in
 the case multiple features have overrides the first match wins.
 
-Example sending more_like queries to codfw and completion to eqiad:
+Example sending more_like queries to dc-foo and completion to dc-bar:
 $wgCirrusSearchClusterOverrides = [
-'more_like' => 'codfw',
-'completion' => 'eqiad',
+'more_like' => 'dc-foo',
+'completion' => 'dc-bar',
 ];
 
 ; $wgCirrusSearchMoreLikeThisTTL
diff --git a/tests/unit/ClusterSettingsTest.php 
b/tests/unit/ClusterSettingsTest.php
index efd9cff..0d5fcbe 100644
--- a/tests/unit/ClusterSettingsTest.php
+++ b/tests/unit/ClusterSettingsTest.php
@@ -11,14 +11,14 @@
return [
'Handles per-index shard counts' => [
[ 'general' => 7 ],
-   'eqiad',
+   'dc-foo',
'general',
7,
],
 
'Handles per-cluster shard counts' => [
-   [ 'content' => 6, 'eqiad' => [ 'content' => 9 ] 
],
-   'eqiad',
+   [ 'content' => 6, 'dc-foo' => [ 'content' => 9 
] ],
+   'dc-foo',
'content',
9,
],
@@ -45,21 +45,21 @@
return [
'Simple replica config returns exact setting ' => [
'0-2',
-   'eqiad',
+   'dc-foo',
'content',
'0-2',
],
 
'Accepts array for replica config' => [
[ 'content' => '1-2' ],
-   'eqiad',
+   'dc-foo',
   

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: All group1 wikis except wikidata to 1.30.0-wmf.13

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

Change subject: All group1 wikis except wikidata to 1.30.0-wmf.13
..


All group1 wikis except wikidata to 1.30.0-wmf.13

Wikidata remains on wmf.11

Bug: T170631
Change-Id: I60e3e89d33ec1b50f11f8c70688358fd0a152adf
---
M wikiversions.json
1 file changed, 601 insertions(+), 601 deletions(-)

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



diff --git a/wikiversions.json b/wikiversions.json
index 3a4ed1f..c50cc58 100644
--- a/wikiversions.json
+++ b/wikiversions.json
@@ -1,33 +1,33 @@
 {
 "aawiki": "php-1.30.0-wmf.12",
-"aawikibooks": "php-1.30.0-wmf.12",
-"aawiktionary": "php-1.30.0-wmf.12",
+"aawikibooks": "php-1.30.0-wmf.13",
+"aawiktionary": "php-1.30.0-wmf.13",
 "abwiki": "php-1.30.0-wmf.12",
-"abwiktionary": "php-1.30.0-wmf.12",
+"abwiktionary": "php-1.30.0-wmf.13",
 "acewiki": "php-1.30.0-wmf.12",
-"advisorywiki": "php-1.30.0-wmf.12",
+"advisorywiki": "php-1.30.0-wmf.13",
 "adywiki": "php-1.30.0-wmf.12",
 "afwiki": "php-1.30.0-wmf.12",
-"afwikibooks": "php-1.30.0-wmf.12",
-"afwikiquote": "php-1.30.0-wmf.12",
-"afwiktionary": "php-1.30.0-wmf.12",
+"afwikibooks": "php-1.30.0-wmf.13",
+"afwikiquote": "php-1.30.0-wmf.13",
+"afwiktionary": "php-1.30.0-wmf.13",
 "akwiki": "php-1.30.0-wmf.12",
-"akwikibooks": "php-1.30.0-wmf.12",
-"akwiktionary": "php-1.30.0-wmf.12",
+"akwikibooks": "php-1.30.0-wmf.13",
+"akwiktionary": "php-1.30.0-wmf.13",
 "alswiki": "php-1.30.0-wmf.12",
-"alswikibooks": "php-1.30.0-wmf.12",
-"alswikiquote": "php-1.30.0-wmf.12",
-"alswiktionary": "php-1.30.0-wmf.12",
+"alswikibooks": "php-1.30.0-wmf.13",
+"alswikiquote": "php-1.30.0-wmf.13",
+"alswiktionary": "php-1.30.0-wmf.13",
 "amwiki": "php-1.30.0-wmf.12",
-"amwikiquote": "php-1.30.0-wmf.12",
-"amwiktionary": "php-1.30.0-wmf.12",
+"amwikiquote": "php-1.30.0-wmf.13",
+"amwiktionary": "php-1.30.0-wmf.13",
 "angwiki": "php-1.30.0-wmf.12",
-"angwikibooks": "php-1.30.0-wmf.12",
-"angwikiquote": "php-1.30.0-wmf.12",
-"angwikisource": "php-1.30.0-wmf.12",
-"angwiktionary": "php-1.30.0-wmf.12",
+"angwikibooks": "php-1.30.0-wmf.13",
+"angwikiquote": "php-1.30.0-wmf.13",
+"angwikisource": "php-1.30.0-wmf.13",
+"angwiktionary": "php-1.30.0-wmf.13",
 "anwiki": "php-1.30.0-wmf.12",
-"anwiktionary": "php-1.30.0-wmf.12",
+"anwiktionary": "php-1.30.0-wmf.13",
 "arbcom_cswiki": "php-1.30.0-wmf.12",
 "arbcom_dewiki": "php-1.30.0-wmf.12",
 "arbcom_enwiki": "php-1.30.0-wmf.12",
@@ -35,880 +35,880 @@
 "arbcom_nlwiki": "php-1.30.0-wmf.12",
 "arcwiki": "php-1.30.0-wmf.12",
 "arwiki": "php-1.30.0-wmf.12",
-"arwikibooks": "php-1.30.0-wmf.12",
-"arwikimedia": "php-1.30.0-wmf.12",
-"arwikinews": "php-1.30.0-wmf.12",
-"arwikiquote": "php-1.30.0-wmf.12",
-"arwikisource": "php-1.30.0-wmf.12",
-"arwikiversity": "php-1.30.0-wmf.12",
-"arwiktionary": "php-1.30.0-wmf.12",
+"arwikibooks": "php-1.30.0-wmf.13",
+"arwikimedia": "php-1.30.0-wmf.13",
+"arwikinews": "php-1.30.0-wmf.13",
+"arwikiquote": "php-1.30.0-wmf.13",
+"arwikisource": "php-1.30.0-wmf.13",
+"arwikiversity": "php-1.30.0-wmf.13",
+"arwiktionary": "php-1.30.0-wmf.13",
 "arzwiki": "php-1.30.0-wmf.12",
 "astwiki": "php-1.30.0-wmf.12",
-"astwikibooks": "php-1.30.0-wmf.12",
-"astwikiquote": "php-1.30.0-wmf.12",
-"astwiktionary": "php-1.30.0-wmf.12",
+"astwikibooks": "php-1.30.0-wmf.13",
+"astwikiquote": "php-1.30.0-wmf.13",
+"astwiktionary": "php-1.30.0-wmf.13",
 "aswiki": "php-1.30.0-wmf.12",
-"aswikibooks": "php-1.30.0-wmf.12",
-"aswikisource": "php-1.30.0-wmf.12",
-"aswiktionary": "php-1.30.0-wmf.12",
+"aswikibooks": "php-1.30.0-wmf.13",
+"aswikisource": "php-1.30.0-wmf.13",
+"aswiktionary": "php-1.30.0-wmf.13",
 "atjwiki": "php-1.30.0-wmf.12",
-"auditcomwiki": "php-1.30.0-wmf.12",
+"auditcomwiki": "php-1.30.0-wmf.13",
 "avwiki": "php-1.30.0-wmf.12",
-"avwiktionary": "php-1.30.0-wmf.12",
+"avwiktionary": "php-1.30.0-wmf.13",
 "aywiki": "php-1.30.0-wmf.12",
-"aywikibooks": "php-1.30.0-wmf.12",
-"aywiktionary": "php-1.30.0-wmf.12",
+"aywikibooks": "php-1.30.0-wmf.13",
+"aywiktionary": "php-1.30.0-wmf.13",
 "azbwiki": "php-1.30.0-wmf.12",
 "azwiki": "php-1.30.0-wmf.12",
-"azwikibooks": "php-1.30.0-wmf.12",
-"azwikiquote": "php-1.30.0-wmf.12",
-"azwikisource": "php-1.30.0-wmf.12",
-"azwiktionary": "php-1.30.0-wmf.12",
+"azwikibooks": "php-1.30.0-wmf.13",
+"azwikiquote": "php-1.30.0-wmf.13",
+"azwikisource": "php-1.30.0-wmf.13",
+"azwiktionary": "php-1.30.0-wmf.13",
 "barwiki": "php-1.30.0-wmf.12",
 

[MediaWiki-commits] [Gerrit] operations...pybal[master]: Allow BGP socket to listen on specific IPs only

2017-08-09 Thread Mark Bergsma (Code Review)
Mark Bergsma has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370894 )

Change subject: Allow BGP socket to listen on specific IPs only
..

Allow BGP socket to listen on specific IPs only

Adds a global config option bgp_local_ips (default empty: all IPv4 and
all IPv6 IPs) which takes a set of IPs for BGP to bind to.

Error handling has been altered to log a critical message and raise
an exception if pybal fails to bind to one of the IP addresses,
instead of ignoring it.

Bug: T103882
Change-Id: I0e4a1cae515602eea8ab07bffb61b9009d5a995a
---
M pybal/bgpfailover.py
1 file changed, 15 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal 
refs/changes/94/370894/1

diff --git a/pybal/bgpfailover.py b/pybal/bgpfailover.py
index 5392bcb..f63b274 100755
--- a/pybal/bgpfailover.py
+++ b/pybal/bgpfailover.py
@@ -67,11 +67,21 @@
 else:
 BGPFailover.peerings.append(self.bgpPeering)
 reactor.addSystemEventTrigger('before', 'shutdown', 
self.closeSession, self.bgpPeering)
-try:
-# Try to listen on the BGP port, not fatal if fails
-reactor.listenTCP(bgp.PORT, 
bgp.BGPServerFactory({self.bgpPeering.peerAddr: self.bgpPeering}))
-except Exception:
-pass
+
+# Bind on the IPs listed in 'bgp_local_ips'. Default to
+# localhost v4 and v6 if no IPs have been specified in the
+# configuration.
+bgp_local_ips = eval(configdict.get('bgp_local_ips', '["", ""]'))
+# Try to listen on the BGP port, not fatal if fails
+for ip in bgp_local_ips:
+try:
+reactor.listenTCP(
+bgp.PORT,
+bgp.BGPServerFactory({self.bgpPeering.peerAddr: 
self.bgpPeering}),
+interface=ip)
+except CannotListenError:
+log.critical("Could not listen for BGP connections on ip " 
+ ip)
+raise
 
 def closeSession(self, peering):
 log.info("Clearing session to {}".format(peering.peerAddr))

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e4a1cae515602eea8ab07bffb61b9009d5a995a
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: master
Gerrit-Owner: Mark Bergsma 

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


[MediaWiki-commits] [Gerrit] labs...heritage[master]: Catch yet another exception

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

Change subject: Catch yet another exception
..


Catch yet another exception

Change-Id: I57f1d52fdb46195046fd6cd6afa264b5622056cc
---
M erfgoedbot/populate_image_table.py
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/erfgoedbot/populate_image_table.py 
b/erfgoedbot/populate_image_table.py
index 9396f4a..45fa968 100644
--- a/erfgoedbot/populate_image_table.py
+++ b/erfgoedbot/populate_image_table.py
@@ -132,7 +132,7 @@
 # All uppercase, same happens in other list
 # monumentId = monumentId.upper()
 return monumentId
-except (UnicodeDecodeError, TypeError) as e:
+except (UnicodeDecodeError, TypeError, IndexError) as e:
 raise CannotNormalizeException(e)
 
 

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: All group1 wikis except wikidata to 1.30.0-wmf.13

2017-08-09 Thread 20after4 (Code Review)
20after4 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370882 )

Change subject: All group1 wikis except wikidata to 1.30.0-wmf.13
..

All group1 wikis except wikidata to 1.30.0-wmf.13

Wikidata remains on wmf.11

Bug: T170631
Change-Id: I60e3e89d33ec1b50f11f8c70688358fd0a152adf
---
M wikiversions.json
1 file changed, 601 insertions(+), 601 deletions(-)


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

diff --git a/wikiversions.json b/wikiversions.json
index 3a4ed1f..c50cc58 100644
--- a/wikiversions.json
+++ b/wikiversions.json
@@ -1,33 +1,33 @@
 {
 "aawiki": "php-1.30.0-wmf.12",
-"aawikibooks": "php-1.30.0-wmf.12",
-"aawiktionary": "php-1.30.0-wmf.12",
+"aawikibooks": "php-1.30.0-wmf.13",
+"aawiktionary": "php-1.30.0-wmf.13",
 "abwiki": "php-1.30.0-wmf.12",
-"abwiktionary": "php-1.30.0-wmf.12",
+"abwiktionary": "php-1.30.0-wmf.13",
 "acewiki": "php-1.30.0-wmf.12",
-"advisorywiki": "php-1.30.0-wmf.12",
+"advisorywiki": "php-1.30.0-wmf.13",
 "adywiki": "php-1.30.0-wmf.12",
 "afwiki": "php-1.30.0-wmf.12",
-"afwikibooks": "php-1.30.0-wmf.12",
-"afwikiquote": "php-1.30.0-wmf.12",
-"afwiktionary": "php-1.30.0-wmf.12",
+"afwikibooks": "php-1.30.0-wmf.13",
+"afwikiquote": "php-1.30.0-wmf.13",
+"afwiktionary": "php-1.30.0-wmf.13",
 "akwiki": "php-1.30.0-wmf.12",
-"akwikibooks": "php-1.30.0-wmf.12",
-"akwiktionary": "php-1.30.0-wmf.12",
+"akwikibooks": "php-1.30.0-wmf.13",
+"akwiktionary": "php-1.30.0-wmf.13",
 "alswiki": "php-1.30.0-wmf.12",
-"alswikibooks": "php-1.30.0-wmf.12",
-"alswikiquote": "php-1.30.0-wmf.12",
-"alswiktionary": "php-1.30.0-wmf.12",
+"alswikibooks": "php-1.30.0-wmf.13",
+"alswikiquote": "php-1.30.0-wmf.13",
+"alswiktionary": "php-1.30.0-wmf.13",
 "amwiki": "php-1.30.0-wmf.12",
-"amwikiquote": "php-1.30.0-wmf.12",
-"amwiktionary": "php-1.30.0-wmf.12",
+"amwikiquote": "php-1.30.0-wmf.13",
+"amwiktionary": "php-1.30.0-wmf.13",
 "angwiki": "php-1.30.0-wmf.12",
-"angwikibooks": "php-1.30.0-wmf.12",
-"angwikiquote": "php-1.30.0-wmf.12",
-"angwikisource": "php-1.30.0-wmf.12",
-"angwiktionary": "php-1.30.0-wmf.12",
+"angwikibooks": "php-1.30.0-wmf.13",
+"angwikiquote": "php-1.30.0-wmf.13",
+"angwikisource": "php-1.30.0-wmf.13",
+"angwiktionary": "php-1.30.0-wmf.13",
 "anwiki": "php-1.30.0-wmf.12",
-"anwiktionary": "php-1.30.0-wmf.12",
+"anwiktionary": "php-1.30.0-wmf.13",
 "arbcom_cswiki": "php-1.30.0-wmf.12",
 "arbcom_dewiki": "php-1.30.0-wmf.12",
 "arbcom_enwiki": "php-1.30.0-wmf.12",
@@ -35,880 +35,880 @@
 "arbcom_nlwiki": "php-1.30.0-wmf.12",
 "arcwiki": "php-1.30.0-wmf.12",
 "arwiki": "php-1.30.0-wmf.12",
-"arwikibooks": "php-1.30.0-wmf.12",
-"arwikimedia": "php-1.30.0-wmf.12",
-"arwikinews": "php-1.30.0-wmf.12",
-"arwikiquote": "php-1.30.0-wmf.12",
-"arwikisource": "php-1.30.0-wmf.12",
-"arwikiversity": "php-1.30.0-wmf.12",
-"arwiktionary": "php-1.30.0-wmf.12",
+"arwikibooks": "php-1.30.0-wmf.13",
+"arwikimedia": "php-1.30.0-wmf.13",
+"arwikinews": "php-1.30.0-wmf.13",
+"arwikiquote": "php-1.30.0-wmf.13",
+"arwikisource": "php-1.30.0-wmf.13",
+"arwikiversity": "php-1.30.0-wmf.13",
+"arwiktionary": "php-1.30.0-wmf.13",
 "arzwiki": "php-1.30.0-wmf.12",
 "astwiki": "php-1.30.0-wmf.12",
-"astwikibooks": "php-1.30.0-wmf.12",
-"astwikiquote": "php-1.30.0-wmf.12",
-"astwiktionary": "php-1.30.0-wmf.12",
+"astwikibooks": "php-1.30.0-wmf.13",
+"astwikiquote": "php-1.30.0-wmf.13",
+"astwiktionary": "php-1.30.0-wmf.13",
 "aswiki": "php-1.30.0-wmf.12",
-"aswikibooks": "php-1.30.0-wmf.12",
-"aswikisource": "php-1.30.0-wmf.12",
-"aswiktionary": "php-1.30.0-wmf.12",
+"aswikibooks": "php-1.30.0-wmf.13",
+"aswikisource": "php-1.30.0-wmf.13",
+"aswiktionary": "php-1.30.0-wmf.13",
 "atjwiki": "php-1.30.0-wmf.12",
-"auditcomwiki": "php-1.30.0-wmf.12",
+"auditcomwiki": "php-1.30.0-wmf.13",
 "avwiki": "php-1.30.0-wmf.12",
-"avwiktionary": "php-1.30.0-wmf.12",
+"avwiktionary": "php-1.30.0-wmf.13",
 "aywiki": "php-1.30.0-wmf.12",
-"aywikibooks": "php-1.30.0-wmf.12",
-"aywiktionary": "php-1.30.0-wmf.12",
+"aywikibooks": "php-1.30.0-wmf.13",
+"aywiktionary": "php-1.30.0-wmf.13",
 "azbwiki": "php-1.30.0-wmf.12",
 "azwiki": "php-1.30.0-wmf.12",
-"azwikibooks": "php-1.30.0-wmf.12",
-"azwikiquote": "php-1.30.0-wmf.12",
-"azwikisource": "php-1.30.0-wmf.12",
-"azwiktionary": "php-1.30.0-wmf.12",
+"azwikibooks": "php-1.30.0-wmf.13",
+"azwikiquote": "php-1.30.0-wmf.13",
+"azwikisource": "php-1.30.0-wmf.13",
+"azwiktionary": "php-1.30.0-wmf.13",
 "barwiki": 

[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: QA: Simplify toast notification step some more

2017-08-09 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370880 )

Change subject: QA: Simplify toast notification step some more
..

QA: Simplify toast notification step some more

If mediawiki.notification has loaded that should be enough to assume
the toast is ready to have its text checked.

Change-Id: Ic546877eae0ea6dd59dbf88bf9267bcd1957f779
---
M tests/browser/features/step_definitions/common_article_steps.rb
1 file changed, 0 insertions(+), 3 deletions(-)


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

diff --git a/tests/browser/features/step_definitions/common_article_steps.rb 
b/tests/browser/features/step_definitions/common_article_steps.rb
index c08ee3a..d2296a2 100644
--- a/tests/browser/features/step_definitions/common_article_steps.rb
+++ b/tests/browser/features/step_definitions/common_article_steps.rb
@@ -39,9 +39,6 @@
 Then(/^I should see a toast with message "(.+)"$/) do |msg|
   on(ArticlePage) do |page|
 page.wait_until_rl_module_ready('mediawiki.notification')
-page.wait_until do
-  page.toast_element.when_present.text.include? msg
-end
 expect(page.toast_element.when_present.text).to match msg
   end
 end

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic546877eae0ea6dd59dbf88bf9267bcd1957f779
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/MinervaNeue
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] labs...heritage[master]: Catch yet another exception

2017-08-09 Thread Lokal Profil (Code Review)
Lokal Profil has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370878 )

Change subject: Catch yet another exception
..

Catch yet another exception

Change-Id: I57f1d52fdb46195046fd6cd6afa264b5622056cc
---
M erfgoedbot/populate_image_table.py
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/erfgoedbot/populate_image_table.py 
b/erfgoedbot/populate_image_table.py
index 9396f4a..45fa968 100644
--- a/erfgoedbot/populate_image_table.py
+++ b/erfgoedbot/populate_image_table.py
@@ -132,7 +132,7 @@
 # All uppercase, same happens in other list
 # monumentId = monumentId.upper()
 return monumentId
-except (UnicodeDecodeError, TypeError) as e:
+except (UnicodeDecodeError, TypeError, IndexError) as e:
 raise CannotNormalizeException(e)
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I57f1d52fdb46195046fd6cd6afa264b5622056cc
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/heritage
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil 

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [DOC] Remove deprecated option -time from script documentation

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

Change subject: [DOC] Remove deprecated option -time from script documentation
..


[DOC] Remove deprecated option -time from script documentation

Change-Id: I61c9b6a29491da23a2580f02f48b963459f0aceb
---
M scripts/checkimages.py
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 7b22ade..1ca1baa 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -34,8 +34,6 @@
 
 -sleep[:#]  Time in seconds between repeat runs (default: 30)
 
--time[:#]   The -time option is deprecated. Use -sleep instead.
-
 -wait[:#]   Wait x second before check the images (default: 0)
 
 -skip[:#]   The bot skip the first [:#] images (default: 0)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I61c9b6a29491da23a2580f02f48b963459f0aceb
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt 
Gerrit-Reviewer: Dalba 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Ladsgroup 
Gerrit-Reviewer: Magul 
Gerrit-Reviewer: Mpaa 
Gerrit-Reviewer: Murfel 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] labs...heritage[master]: Fix case of `monument_article` parameter in ro_ro configuration

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

Change subject: Fix case of `monument_article` parameter in ro_ro configuration
..


Fix case of `monument_article` parameter in ro_ro configuration

In monuments_ro_(ro), the monument_article field was not
being populated despite the setting in monuments_config.

This was because the field was incorrectly set in the config,
as they are case-sensitive.

Bug: T172931
Change-Id: I992ad86ed487d2d2418fa2967c1e0c6efb4443d5
---
M erfgoedbot/monuments_config/ro_ro.json
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/erfgoedbot/monuments_config/ro_ro.json 
b/erfgoedbot/monuments_config/ro_ro.json
index 187bcb5..0e0349f 100644
--- a/erfgoedbot/monuments_config/ro_ro.json
+++ b/erfgoedbot/monuments_config/ro_ro.json
@@ -72,7 +72,7 @@
 },
 {
 "dest": "monument_article",
-"source": "denumire",
+"source": "Denumire",
 "conv": "extractWikilink"
 }
 ],

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...RandomSelection[master]: Applied the Inclumedia changes

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

Change subject: Applied the Inclumedia changes
..


Applied the Inclumedia changes

From https://github.com/Inclumedia/RandomSelection

Adds a "surround by template" feature which requires the end-user to use
 tags.

Change-Id: I1c95d72cdcaa692b2a38c20f3d2e208eec5df98f
---
M RandomSelection.class.php
1 file changed, 22 insertions(+), 0 deletions(-)

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



diff --git a/RandomSelection.class.php b/RandomSelection.class.php
index 7dee590..5abeb18 100644
--- a/RandomSelection.class.php
+++ b/RandomSelection.class.php
@@ -41,6 +41,15 @@
$input,
$out
);
+
+   # Find any references to a surrounding template
+   preg_match_all(
+   
"/]*?)?\\sweight=[\"']?([^\\s>]+))?"
+   . 
"(?:\\s[^>]*)?>([\\s\\S]*?)<\\/choicetemplate>/",
+   $input,
+   $outTemplate
+   );
+
$r = 0;
for ( $i = 0; $i < $len; $i++ ) {
if ( strlen( $out[1][$i] ) == 0 ) {
@@ -64,6 +73,19 @@
}
}
 
+   # Surround by template if applicable
+   if ( isset( $outTemplate[2][0] ) ) {
+   $input = '{{' . $outTemplate[2][0] . '|' . $input . 
'}}';
+   }
+
+   # Parse tags and return
+   if ( isset( $argv['before'] ) ) {
+   $input = $argv['before'] . $input;
+   }
+   if ( isset( $argv['after'] ) ) {
+   $input .= $argv['after'];
+   }
+
return $parser->recursiveTagParse( $input );
}
 }
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1c95d72cdcaa692b2a38c20f3d2e208eec5df98f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/RandomSelection
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: Kghbln 
Gerrit-Reviewer: SamanthaNguyen 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...RandomSelection[master]: Version 2.2.2: RationalWiki changes

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

Change subject: Version 2.2.2: RationalWiki changes
..


Version 2.2.2: RationalWiki changes

From https://github.com/RationalWiki/mediawiki-extensions-RandomSelection

* Adds {{#choose:}} in addition to the old  tag
** Example usage: http://rationalwiki.org/wiki/Fun:Trump_tweet_generator
* BREAKING CHANGE: Caching in the  tag is disabled only if the user 
specifies ; previously caching was disabled by default

Change-Id: I857824472237af2352ba5f1bdd01272e000ad964
---
M RandomSelection.class.php
A RandomSelection.i18n.magic.php
M extension.json
3 files changed, 100 insertions(+), 10 deletions(-)

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



diff --git a/RandomSelection.class.php b/RandomSelection.class.php
index 5abeb18..7c92a2f 100644
--- a/RandomSelection.class.php
+++ b/RandomSelection.class.php
@@ -6,20 +6,33 @@
  *
  * @file
  * @ingroup Extensions
- * @version 2.2
- * @date 23 June 2015
+ * @version 2.2.2
+ * @date 24 July 2017
  * @author Ross McClure 
  * @link https://www.mediawiki.org/wiki/Extension:RandomSelection Documentation
  */
 class RandomSelection {
/**
-* Register the  tag with the Parser.
+* Register the  tag and {{#choose:option 1|...|option N}} 
function
+* with the Parser.
 *
 * @param Parser $parser
 * @return bool
 */
public static function register( &$parser ) {
$parser->setHook( 'choose', array( __CLASS__, 'render' ) );
+   $parser->setFunctionHook( 'choose', array( __CLASS__, 
'renderParserFunction' ), Parser::SFH_OBJECT_ARGS );
+   return true;
+   }
+
+   /**
+* Register the magic word ID.
+*
+* @param array $variableIds
+* @return bool
+*/
+   public static function variableIds( &$variableIds ) {
+   $variableIds[] = 'choose';
return true;
}
 
@@ -27,12 +40,14 @@
 * Callback for register() which actually does all the processing.
 *
 * @param string $input User-supplied input
-* @param array $argv [unused]
+* @param array $argv User-supplied arguments to the tag, e.g. ...
 * @param Parser $parser
 */
public static function render( $input, $argv, $parser ) {
-   # Prevent caching
-   $parser->disableCache();
+   # Prevent caching if specified so by the user
+   if ( isset( $argv['uncached'] ) ) {
+   $parser->disableCache();
+   }
 
# Parse the options and calculate total weight
$len = preg_match_all(
@@ -88,4 +103,58 @@
 
return $parser->recursiveTagParse( $input );
}
+
+   /**
+* Callback for the {{#choose:}} magic word magic (see register() in 
this file)
+*
+* @param Parser $parser
+* @param PPFrame $frame
+* @param array $args User-supplied arguments
+*/
+   public static function renderParserFunction( &$parser, $frame, $args ) {
+   $options = array();
+   $r = 0;
+
+   // First one is not an object
+   $arg = array_shift( $args );
+   $parts = explode( '=', $arg, 2 );
+   if ( count( $parts ) == 2 ) {
+   $options[] = array( intval( trim( $parts[0] ) ), 
$parts[1] );
+   $r += intval( trim( $parts[0] ) );
+   } elseif ( count( $parts ) == 1 ) {
+   $options[] = array( 1, $parts[0] );
+   $r += 1;
+   }
+
+   foreach ( $args as $arg ) {
+   $bits = $arg->splitArg();
+   $nameNode = $bits['name'];
+   $index = $bits['index'];
+   $valueNode = $bits['value'];
+   if ( $index === '' ) {
+   $name = trim( $frame->expand( $nameNode ) );
+   $options[] = array( intval( $name ), $valueNode 
);
+   $r += intval( $name );
+   } else {
+   $options[] = array( 1, $valueNode );
+   $r += 1;
+   }
+   }
+
+   # Choose an option at random
+   if ( $r <= 0 ) {
+   return '';
+   }
+   $r = mt_rand( 1, $r );
+   for ( $i = 0; $i < count( $options ); $i++ ) {
+   $r -= $options[$i][0];
+   if ( $r <= 0 ) {
+   $output = $options[$i][1];
+   break;
+ 

[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix handling of coalesced changes in InjectRCRecordsJob

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

Change subject: Fix handling of coalesced changes in InjectRCRecordsJob
..


Fix handling of coalesced changes in InjectRCRecordsJob

Instead of representing changes using their IDs, we represent them
using their complete field data.

However, composite changes represent their children using their IDs.

Bug: T171370
Bug: T172394
Change-Id: Iaa98722779507bb57d449649f1147314da685312
---
M client/WikibaseClient.php
M client/includes/Changes/InjectRCRecordsJob.php
M client/includes/WikibaseClient.php
M client/tests/phpunit/includes/Changes/InjectRCRecordsJobTest.php
M client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php
M client/tests/phpunit/includes/WikibaseClientTest.php
M lib/includes/Changes/ChangeRow.php
M lib/includes/Changes/EntityChange.php
M lib/includes/Changes/EntityChangeFactory.php
M lib/tests/phpunit/Changes/EntityChangeFactoryTest.php
M lib/tests/phpunit/Changes/EntityChangeTest.php
M lib/tests/phpunit/Changes/TestChanges.php
M lib/tests/phpunit/Store/Sql/EntityChangeLookupTest.php
M repo/includes/WikibaseRepo.php
14 files changed, 427 insertions(+), 21 deletions(-)

Approvals:
  jenkins-bot: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved



diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php
index 012905d..836ac30 100644
--- a/client/WikibaseClient.php
+++ b/client/WikibaseClient.php
@@ -189,6 +189,7 @@
$job = new Wikibase\Client\Changes\InjectRCRecordsJob(
$mwServices->getDBLoadBalancerFactory(),
$wbServices->getStore()->getEntityChangeLookup(),
+   $wbServices->getEntityChangeFactory(),
$wbServices->getRecentChangeFactory(),
$params
);
diff --git a/client/includes/Changes/InjectRCRecordsJob.php 
b/client/includes/Changes/InjectRCRecordsJob.php
index 54c4781..6a50900 100644
--- a/client/includes/Changes/InjectRCRecordsJob.php
+++ b/client/includes/Changes/InjectRCRecordsJob.php
@@ -14,6 +14,7 @@
 use Wikibase\Client\Store\TitleFactory;
 use Wikibase\Client\WikibaseClient;
 use Wikibase\EntityChange;
+use Wikibase\Lib\Changes\EntityChangeFactory;
 use Wikibase\Lib\Store\Sql\EntityChangeLookup;
 use Wikimedia\Assert\Assert;
 use Wikimedia\Rdbms\LBFactory;
@@ -37,6 +38,11 @@
 * @var EntityChangeLookup
 */
private $changeLookup;
+
+   /**
+* @var EntityChangeFactory
+*/
+   private $changeFactory;
 
/**
 * @var RecentChangeFactory
@@ -82,8 +88,13 @@
$pages[$id] = [ $t->getNamespace(), $t->getDBkey() ];
}
 
+   // Note: Avoid serializing Change objects. Original changes can 
be restored
+   // from $changeData['info']['change-ids'], see getChange().
+   $changeData = $change->getFields();
+   $changeData['info'] = $change->getSerializedInfo( [ 'changes' ] 
);
+
$params = [
-   'change' => $change->getId(),
+   'change' => $changeData,
'pages' => $pages
];
 
@@ -91,7 +102,6 @@
'wikibase-InjectRCRecords',
$params
);
-
}
 
/**
@@ -100,6 +110,7 @@
 *
 * @param LBFactory $lbFactory
 * @param EntityChangeLookup $changeLookup
+* @param EntityChangeFactory $changeFactory
 * @param RecentChangeFactory $rcFactory
 * @param array $params Needs to have two keys: "change": the id of the 
change,
 * "pages": array of pages, represented as $pageId => [ $namespace, 
$dbKey ].
@@ -107,6 +118,7 @@
public function __construct(
LBFactory $lbFactory,
EntityChangeLookup $changeLookup,
+   EntityChangeFactory $changeFactory,
RecentChangeFactory $rcFactory,
array $params
) {
@@ -118,6 +130,13 @@
'$params',
'$params[\'change\'] not set.'
);
+   // TODO: disallow integer once T172394 has been deployed and 
old jobs have cleared the queue.
+   Assert::parameterType(
+   'integer|array',
+   $params['change'],
+   '$params[\'change\']'
+   );
+
Assert::parameter(
isset( $params['pages'] ),
'$params',
@@ -131,6 +150,7 @@
 
$this->lbFactory = $lbFactory;
$this->changeLookup = $changeLookup;
+   $this->changeFactory = $changeFactory;
$this->rcFactory = $rcFactory;
 
$this->titleFactory = new TitleFactory();
@@ 

[MediaWiki-commits] [Gerrit] mediawiki...RelatedArticles[master]: Merge footer hooks with Hooks

2017-08-09 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370876 )

Change subject: Merge footer hooks with Hooks
..

Merge footer hooks with Hooks

per Baha's suggestion we have no need for two Hooks files now
so let's merge them

Bug: T165991
Change-Id: I12c62aef837f50589297477f46bdf0f0d6b5536a
---
M extension.json
D includes/FooterHooks.php
M includes/Hooks.php
3 files changed, 206 insertions(+), 215 deletions(-)


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

diff --git a/extension.json b/extension.json
index 21f4c85..e2be270 100644
--- a/extension.json
+++ b/extension.json
@@ -14,7 +14,6 @@
"AutoloadClasses": {
"RelatedArticles\\ResourceLoaderMuHoganModule": 
"includes/ResourceLoaderMuhoganModule.php",
"RelatedArticles\\Hooks": "includes/Hooks.php",
-   "RelatedArticles\\FooterHooks": "includes/FooterHooks.php"
},
"ExtensionMessagesFiles": {
"RelatedArticlesMagic": "RelatedArticles.i18n.magic.php"
@@ -32,19 +31,19 @@
],
 
"MakeGlobalVariablesScript": [
-   
"RelatedArticles\\FooterHooks::onMakeGlobalVariablesScript"
+   "RelatedArticles\\Hooks::onMakeGlobalVariablesScript"
],
"BeforePageDisplay": [
-   "RelatedArticles\\FooterHooks::onBeforePageDisplay"
+   "RelatedArticles\\Hooks::onBeforePageDisplay"
],
"EventLoggingRegisterSchemas": [
-   
"RelatedArticles\\FooterHooks::onEventLoggingRegisterSchemas"
+   "RelatedArticles\\Hooks::onEventLoggingRegisterSchemas"
],
"ResourceLoaderGetConfigVars": [
-   
"RelatedArticles\\FooterHooks::onResourceLoaderGetConfigVars"
+   "RelatedArticles\\Hooks::onResourceLoaderGetConfigVars"
],
"ResourceLoaderRegisterModules": [
-   
"RelatedArticles\\FooterHooks::onResourceLoaderRegisterModules"
+   
"RelatedArticles\\Hooks::onResourceLoaderRegisterModules"
]
},
"MessagesDirs": {
diff --git a/includes/FooterHooks.php b/includes/FooterHooks.php
deleted file mode 100644
index d6d832b..000
--- a/includes/FooterHooks.php
+++ /dev/null
@@ -1,209 +0,0 @@
-MakeGlobalVariablesScript hook.
-*
-* Sets the value of the wgRelatedArticles global variable
-* to the list of related articles in the cached parser output.
-*
-* @param array &$vars variables to be added into the output of 
OutputPage::headElement.
-* @param OutputPage $out OutputPage instance calling the hook
-* @return bool Always true
-*/
-   public static function onMakeGlobalVariablesScript( &$vars, OutputPage 
$out ) {
-   $config = MediaWikiServices::getInstance()->getConfigFactory()
-   ->makeConfig( 'RelatedArticles' );
-
-   $vars['wgRelatedArticles'] = $out->getProperty( 
'RelatedArticles' );
-   $vars['wgRelatedArticlesUseCirrusSearch'] = $config->get( 
'RelatedArticlesUseCirrusSearch' );
-   $vars['wgRelatedArticlesOnlyUseCirrusSearch'] =
-   $config->get( 'RelatedArticlesOnlyUseCirrusSearch' );
-
-   return true;
-   }
-
-   /**
-* Uses the Disambiguator extension to test whether the page is a 
disambiguation page.
-*
-* If the Disambiguator extension isn't installed, then the test always 
fails, i.e. the page is
-* never a disambiguation page.
-*
-* @return boolean
-*/
-   private static function isDisambiguationPage( Title $title ) {
-   return \ExtensionRegistry::getInstance()->isLoaded( 
'Disambiguator' ) &&
-   DisambiguatorHooks::isDisambiguationPage( $title );
-   }
-
-   /**
-* Check whether the output page is a diff page
-*
-* @param OutputPage $out
-* @return bool
-*/
-   private static function isDiffPage( OutputPage $out ) {
-   $request = $out->getRequest();
-   $type = $request->getText( 'type' );
-   $diff = $request->getText( 'diff' );
-   $oldId = $request->getText( 'oldid' );
-   $isSpecialMobileDiff = $out->getTitle()->isSpecial( 
'MobileDiff' );
-
-   return $type === 'revision' || $diff || $oldId || 
$isSpecialMobileDiff;
-   }
-
-   /**
-* Is ReadMore allowed on skin?
-*
-* The feature is allowed on all skins as long as they are whitelisted
-* in the configuration variable 
`RelatedArticlesFooterWhitelistedSkins`.
-*
-* 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: tests: Avoid production-like dc and host names

2017-08-09 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370875 )

Change subject: tests: Avoid production-like dc and host names
..

tests: Avoid production-like dc and host names

As a matter of principle, never use production-like names in test fixtures
and example values to avoid various bad things:
* Fragile dependence between tests and execution environment
  that might wrongly pass due to something being inherited.
* Docs looking outdated if/when we use a different DC.
  (Lots of docs looked outdated after pmtpa decom)
* Avoid false confidence in using examples verbatim during a switchover
  that will wrongly use eqiad instead of codfw (obvious examples don't
  look authoritative or current and will always encourage one to look at
  a better source).
* Avoid bad search results when looking for production host names and their
  "usage" across various WMF repos.

Change-Id: If55cd0e442e6a4b5b11c080fd564e04830d6585f
---
M CirrusSearch.php
M docs/settings.txt
M tests/unit/ClusterSettingsTest.php
M tests/unit/Maintenance/ReindexerTest.php
4 files changed, 40 insertions(+), 40 deletions(-)


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

diff --git a/CirrusSearch.php b/CirrusSearch.php
index bec54dd..ccf7d77 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -65,8 +65,8 @@
  * configured (see below).
  *
  * $wgCirrusSearchClusters = array(
- * 'eqiad' => array( 'es01.eqiad.wmnet', 'es02.eqiad.wmnet' ),
- * 'codfw' => array( 'es01.codfw.wmnet', 'es02.codfw.wmnet' ),
+ * 'dc-foo' => array( 'es01.foo.local', 'es02.foo.local' ),
+ * 'dc-bar' => array( 'es01.bar.local', 'es02.bar.local' ),
  * );
  */
 $wgCirrusSearchClusters = [
@@ -682,10 +682,10 @@
  * in $wgCirrusSearchClusters. Note that queries can use multiple features, in
  * the case multiple features have overrides the first match wins.
  *
- * Example sending more_like queries to codfw and completion to eqiad:
+ * Example sending more_like queries to dc-foo and completion to dc-bar:
  *   $wgCirrusSearchClusterOverrides = [
- * 'more_like' => 'codfw',
- * 'completion' => 'eqiad',
+ * 'more_like' => 'dc-foo',
+ * 'completion' => 'dc-bar',
  *   ];
  */
 $wgCirrusSearchClusterOverrides = [];
diff --git a/docs/settings.txt b/docs/settings.txt
index 7f92bde..cfabeed 100644
--- a/docs/settings.txt
+++ b/docs/settings.txt
@@ -41,8 +41,8 @@
 
 Example:
 $wgCirrusSearchClusters = array(
-'eqiad' => array( 'es01.eqiad.wmnet', 'es02.eqiad.wmnet' ),
-'codfw' => array( 'es01.codfw.wmnet', 'es02.codfw.wmnet' ),
+'dc-foo' => array( 'es01.foo.local', 'es02.foo.local' )
+'dc-bar' => array( 'es01.bar.local', 'es02.bar.local' )
 );
 
 ; $wgCirrusSearchWriteClusters
@@ -787,10 +787,10 @@
 in $wgCirrusSearchClusters. Note that queries can use multiple features, in
 the case multiple features have overrides the first match wins.
 
-Example sending more_like queries to codfw and completion to eqiad:
+Example sending more_like queries to dc-foo and completion to dc-bar:
 $wgCirrusSearchClusterOverrides = [
-'more_like' => 'codfw',
-'completion' => 'eqiad',
+'more_like' => 'dc-foo',
+'completion' => 'dc-bar',
 ];
 
 ; $wgCirrusSearchMoreLikeThisTTL
diff --git a/tests/unit/ClusterSettingsTest.php 
b/tests/unit/ClusterSettingsTest.php
index efd9cff..0d5fcbe 100644
--- a/tests/unit/ClusterSettingsTest.php
+++ b/tests/unit/ClusterSettingsTest.php
@@ -11,14 +11,14 @@
return [
'Handles per-index shard counts' => [
[ 'general' => 7 ],
-   'eqiad',
+   'dc-foo',
'general',
7,
],
 
'Handles per-cluster shard counts' => [
-   [ 'content' => 6, 'eqiad' => [ 'content' => 9 ] 
],
-   'eqiad',
+   [ 'content' => 6, 'dc-foo' => [ 'content' => 9 
] ],
+   'dc-foo',
'content',
9,
],
@@ -45,21 +45,21 @@
return [
'Simple replica config returns exact setting ' => [
'0-2',
-   'eqiad',
+   'dc-foo',
'content',
'0-2',
],
 
'Accepts array for replica config' => [
[ 'content' => '1-2' ],
-   'eqiad',
+   'dc-foo',
'content',
 

[MediaWiki-commits] [Gerrit] mediawiki...UploadWizard[master]: Skip duplicate deprecated language codes in the language dro...

2017-08-09 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370874 )

Change subject: Skip duplicate deprecated language codes in the language 
dropdown
..

Skip duplicate deprecated language codes in the language dropdown

LanguageCode::getDeprecatedCodeMapping() is a very convenient function
recently introduced in MW 1.29.

This check is added at the end because we have to check the template
existence first - if the wiki has e.g. a Template:Be-x-old, but not
Template:Be-tarask, we don't want to hide the be-x-old.

Bug: T172220
Change-Id: I71d266eee205d2201772e903cb0bcb06bf567b2f
---
M UploadWizard.config.php
1 file changed, 10 insertions(+), 1 deletion(-)


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

diff --git a/UploadWizard.config.php b/UploadWizard.config.php
index 09cda85..79fc662 100644
--- a/UploadWizard.config.php
+++ b/UploadWizard.config.php
@@ -9,7 +9,8 @@
 
 $userLangCode = $wgLang->getCode();
 // We need to get a list of languages for the description dropdown.
-$cacheKey = wfMemcKey( 'uploadwizard', 'language-templates', $userLangCode );
+// Increase the number below to invalidate the cache if this code changes.
+$cacheKey = wfMemcKey( 'uploadwizard', 'language-templates2', $userLangCode );
 // Try to get a cached version of the list
 $uwLanguages = $wgMemc->get( $cacheKey );
 // Commons only: ISO 646 code of Tagalog is 'tl', but language template is 
'tgl'
@@ -54,6 +55,14 @@
}
}
}
+
+   // Skip the duplicate deprecated language codes if the new one is okay 
to use.
+   foreach ( LanguageCode::getDeprecatedCodeMapping() as $oldKey => 
$newKey ) {
+   if ( isset( $uwLanguages[$newKey] ) && isset( 
$uwLanguages[$oldKey] ) ) {
+   unset( $uwLanguages[$oldKey] );
+   }
+   }
+
// Sort the list by the language name
natcasesort( $uwLanguages );
// Cache the list for 1 day

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71d266eee205d2201772e903cb0bcb06bf567b2f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] mediawiki...Scribunto[master]: Mention mw.logObject in the debug console intro

2017-08-09 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370873 )

Change subject: Mention mw.logObject in the debug console intro
..

Mention mw.logObject in the debug console intro

Apparently many users are not aware of this.

It has been introduced in d9ba2005716a way back in 2013.

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


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

diff --git a/i18n/en.json b/i18n/en.json
index 8902545..57bf597 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -15,7 +15,7 @@
"scribunto-doc-page-does-not-exist": "''Documentation for this module 
may be created at [[$1]]''",
"scribunto-doc-page-show": "{{$1}}\n",
"scribunto-doc-page-header": "'''This is the documentation page for 
[[$1]]'''",
-   "scribunto-console-intro": "* The module exports are available as the 
variable \"p\", including unsaved modifications.\n* Precede a line with \"=\" 
to evaluate it as an expression, or use print().\n* Use mw.log() in module code 
to send messages to this console.",
+   "scribunto-console-intro": "* The module exports are available as the 
variable \"p\", including unsaved modifications.\n* Precede a line with \"=\" 
to evaluate it as an expression or use print(). Use mw.logObject() for 
tables.\n* Use mw.log() and mw.logObject() in module code to send messages to 
this console.",
"scribunto-console-title": "Debug console",
"scribunto-console-too-large": "This console session is too large. 
Please clear the console history or reduce the size of the module.",
"scribunto-console-current-src": "console input",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ff005e8889a545b6f11e3a6e3bf418b7826f926
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Hoo man 

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix slightly broken @return documentations

2017-08-09 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370872 )

Change subject: Fix slightly broken @return documentations
..

Fix slightly broken @return documentations

* We are consistently using "@return" without "s".
* Neither "false" nor "true" are types. "bool" is the type.

Change-Id: I07b09e74555de4aaa451366240fe7e13ea80f4d7
---
M client/includes/Changes/WikiPageUpdater.php
M lib/includes/WikibaseSettings.php
M repo/includes/Search/Elastic/ElasticTermResult.php
3 files changed, 6 insertions(+), 6 deletions(-)


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

diff --git a/client/includes/Changes/WikiPageUpdater.php 
b/client/includes/Changes/WikiPageUpdater.php
index 2ab62a5..2739bc9 100644
--- a/client/includes/Changes/WikiPageUpdater.php
+++ b/client/includes/Changes/WikiPageUpdater.php
@@ -165,7 +165,7 @@
/**
 * @param Title[] $titles
 *
-* @returns array[] string $pageId => [ int $namespace, string $dbKey ]
+* @return array[] string $pageId => [ int $namespace, string $dbKey ]
 */
private function getPageParamForRefreshLinksJob( array $titles ) {
$pages = [];
diff --git a/lib/includes/WikibaseSettings.php 
b/lib/includes/WikibaseSettings.php
index 059a562..ad5abdc 100644
--- a/lib/includes/WikibaseSettings.php
+++ b/lib/includes/WikibaseSettings.php
@@ -23,7 +23,7 @@
 class WikibaseSettings {
 
/**
-* @returns true if and only if the Wikibase repository component is 
enabled on this wiki.
+* @return bool True if and only if the Wikibase repository component 
is enabled on this wiki.
 */
public static function isRepoEnabled() {
return defined( 'WB_VERSION' );
@@ -35,7 +35,7 @@
 *
 * @throws MWException
 *
-* @returns SettingsArray
+* @return SettingsArray
 */
public static function getRepoSettings() {
if ( !self::isRepoEnabled() ) {
@@ -48,7 +48,7 @@
}
 
/**
-* @returns true if and only if the Wikibase client component is 
enabled on this wiki.
+* @return bool True if and only if the Wikibase client component is 
enabled on this wiki.
 */
public static function isClientEnabled() {
return defined( 'WBC_VERSION' );
@@ -57,7 +57,7 @@
/**
 * @throws MWException
 *
-* @returns SettingsArray
+* @return SettingsArray
 */
public static function getClientSettings() {
if ( !self::isClientEnabled() ) {
diff --git a/repo/includes/Search/Elastic/ElasticTermResult.php 
b/repo/includes/Search/Elastic/ElasticTermResult.php
index b6bc9e9..6d1b043 100644
--- a/repo/includes/Search/Elastic/ElasticTermResult.php
+++ b/repo/includes/Search/Elastic/ElasticTermResult.php
@@ -52,7 +52,7 @@
/**
 * Get the source filtering to be used loading the result.
 *
-* @return false|string|array corresponding to Elasticsearch source 
filtering syntax
+* @return string[]
 */
public function getSourceFiltering() {
$fields = [ 'namespace', 'title' ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07b09e74555de4aaa451366240fe7e13ea80f4d7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) 

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


[MediaWiki-commits] [Gerrit] wikimedia...rainbow[develop]: Annotate sample rate change

2017-08-09 Thread Chelsyx (Code Review)
Chelsyx has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370857 )

Change subject: Annotate sample rate change
..


Annotate sample rate change

On April 25th, we changed the sample rates for several projects, which results 
in changes in our search metrics.

Bug: T172428
Change-Id: I709222fa4fad807762c23858e6c00c43d0747d9a
---
M modules/desktop/events.R
M modules/desktop/load_times.R
M modules/desktop/paulscore.R
M modules/page_visit_times.R
M tab_documentation/desktop_events.md
M tab_documentation/desktop_load.md
M tab_documentation/paulscore_approx.html
M tab_documentation/survival.md
8 files changed, 12 insertions(+), 6 deletions(-)

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



diff --git a/modules/desktop/events.R b/modules/desktop/events.R
index bcfd686..4f94e44 100644
--- a/modules/desktop/events.R
+++ b/modules/desktop/events.R
@@ -32,5 +32,6 @@
 polloi::make_dygraph(xlab = "Date", ylab = "Events", title = "Desktop 
search events, by day") %>%
 dyRangeSelector %>%
 dyEvent(as.Date("2016-07-12"), "A (schema switch)", labelLoc = "bottom") 
%>%
-dyEvent(as.Date("2017-01-01"), "R (reportupdater)", labelLoc = "bottom")
+dyEvent(as.Date("2017-01-01"), "R (reportupdater)", labelLoc = "bottom") 
%>%
+dyEvent(as.Date("2017-04-25"), "S (rates)", labelLoc = "bottom")
 })
diff --git a/modules/desktop/load_times.R b/modules/desktop/load_times.R
index 50fb49a..a797c80 100644
--- a/modules/desktop/load_times.R
+++ b/modules/desktop/load_times.R
@@ -5,5 +5,6 @@
 dyRangeSelector %>%
 dyEvent(as.Date("2016-07-12"), "A (schema switch)", labelLoc = "bottom") 
%>%
 dyEvent(as.Date("2017-01-01"), "R (reportupdater)", labelLoc = "bottom") 
%>%
-dyEvent(as.Date("2017-06-15"), "B (sister search)", labelLoc = "bottom")
+dyEvent(as.Date("2017-06-15"), "B (sister search)", labelLoc = "bottom") 
%>%
+dyEvent(as.Date("2017-04-25"), "S (rates)", labelLoc = "bottom")
 })
diff --git a/modules/desktop/paulscore.R b/modules/desktop/paulscore.R
index 144569b..b0ffb14 100644
--- a/modules/desktop/paulscore.R
+++ b/modules/desktop/paulscore.R
@@ -10,7 +10,7 @@
 polloi::make_dygraph(xlab = "Date", ylab = "PaulScore", title = "PaulScore 
for fulltext searches, by day", use_si = FALSE, group = "paulscore_approx") %>%
 dyRangeSelector %>%
 dyLegend(labelsDiv = "paulscore_approx_legend", show = "always") %>%
-dyEvent(as.Date("2017-04-19"), "A (rates)", labelLoc = "bottom")
+dyEvent(as.Date("2017-04-25"), "S (rates)", labelLoc = "bottom")
   if (input$paulscore_relative) {
 dyOut <- dyAxis(dyOut, "y", axisLabelFormatter = "function(x) { return 
Math.round(100 * x, 3) + '%'; }", valueFormatter = "function(x) { return 
Math.round(100 * x, 3) + '%'; }")
   }
@@ -29,7 +29,7 @@
 polloi::make_dygraph(xlab = "Date", ylab = "PaulScore", title = "PaulScore 
for autocomplete searches, by day", use_si = FALSE, group = "paulscore_approx") 
%>%
 dyRangeSelector %>%
 dyLegend(labelsDiv = "paulscore_approx_legend", show = "always") %>%
-dyEvent(as.Date("2017-04-19"), "A (rates)", labelLoc = "bottom")
+dyEvent(as.Date("2017-04-25"), "S (rates)", labelLoc = "bottom")
   if (input$paulscore_relative) {
 dyOut <- dyAxis(dyOut, "y", axisLabelFormatter = "function(x) { return 
Math.round(100 * x, 3) + '%'; }", valueFormatter = "function(x) { return 
Math.round(100 * x, 3) + '%'; }")
   }
diff --git a/modules/page_visit_times.R b/modules/page_visit_times.R
index 4a51a78..115cbb4 100644
--- a/modules/page_visit_times.R
+++ b/modules/page_visit_times.R
@@ -6,5 +6,6 @@
axisLabelWidth = 100, pixelsPerLabel = 80) %>%
 dyLegend(labelsDiv = "lethal_dose_plot_legend") %>%
 dyRangeSelector(fillColor = "", strokeColor = "") %>%
-dyEvent(as.Date("2017-01-01"), "R (reportupdater)", labelLoc = "bottom")
+dyEvent(as.Date("2017-01-01"), "R (reportupdater)", labelLoc = "bottom") 
%>%
+dyEvent(as.Date("2017-04-25"), "S (rates)", labelLoc = "bottom")
 })
diff --git a/tab_documentation/desktop_events.md 
b/tab_documentation/desktop_events.md
index 94c5f95..be4d9d8 100644
--- a/tab_documentation/desktop_events.md
+++ b/tab_documentation/desktop_events.md
@@ -21,6 +21,7 @@
 * Data in late September/early October 2015 is unavailable due to another bug 
in EventLogging as a whole, which impacted data collection.
 * '__A__': we switched to using data from 
[Schema:TestSearchSatisfaction2](https://meta.wikimedia.org/wiki/Schema:TestSearchSatisfaction2)
 instead of [Schema:Search](https://meta.wikimedia.org/wiki/Schema:Search) for 
Desktop event counts and load times on 12 July 2016.
 * '__R__': on 2017-01-01 we started calculating all of Discovery's metrics 
using a new version of [our data retrieval and processing 
codebase](https://phabricator.wikimedia.org/diffusion/WDGO/) that we migrated 
to [Wikimedia 

[MediaWiki-commits] [Gerrit] labs...heritage[master]: Fix case of `monument_article` parameter in ro_ro configuration

2017-08-09 Thread Code Review
Jean-Frédéric has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370871 )

Change subject: Fix case of `monument_article` parameter in ro_ro configuration
..

Fix case of `monument_article` parameter in ro_ro configuration

In monuments_ro_(ro), the monument_article field was not
being populated despite the setting in monuments_config.

This was because the field was incorrectly set in the config,
as they are case-sensitive.

Bug: T172931
Change-Id: I992ad86ed487d2d2418fa2967c1e0c6efb4443d5
---
M erfgoedbot/monuments_config/ro_ro.json
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/erfgoedbot/monuments_config/ro_ro.json 
b/erfgoedbot/monuments_config/ro_ro.json
index 187bcb5..0e0349f 100644
--- a/erfgoedbot/monuments_config/ro_ro.json
+++ b/erfgoedbot/monuments_config/ro_ro.json
@@ -72,7 +72,7 @@
 },
 {
 "dest": "monument_article",
-"source": "denumire",
+"source": "Denumire",
 "conv": "extractWikilink"
 }
 ],

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I992ad86ed487d2d2418fa2967c1e0c6efb4443d5
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] 3d2png[master]: Skip extension check of input file

2017-08-09 Thread MarkTraceur (Code Review)
MarkTraceur has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370680 )

Change subject: Skip extension check of input file
..


Skip extension check of input file

This is necessary for Thumbor support, since the temporary file for
STL input has no extension.

Change-Id: Iae903c78f8532f16d5d0e39131c0f007fd0577dd
---
M 3d2png.js
1 file changed, 4 insertions(+), 6 deletions(-)

Approvals:
  MarkTraceur: Verified; Looks good to me, approved
  Gilles: Looks good to me, but someone else must approve



diff --git a/3d2png.js b/3d2png.js
index da29b88..d63a488 100755
--- a/3d2png.js
+++ b/3d2png.js
@@ -64,12 +64,10 @@
  * @param {string} filePath Full path to the file
  * @returns {THREE.Loader} File loader
  */
-ThreeDtoPNG.prototype.getLoader = function( filePath ) {
-   if ( filePath.toLowerCase().endsWith( '.stl' ) ) {
-   return new THREE.STLLoader();
-   }
-
-   throw 'Unexpected model file extension, only STL is supported';
+ThreeDtoPNG.prototype.getLoader = function() {
+   // TODO XXX if more file formats are supported later, need a command 
line option
+   // to signify the expected format of the input file.
+   return new THREE.STLLoader();
 };
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iae903c78f8532f16d5d0e39131c0f007fd0577dd
Gerrit-PatchSet: 1
Gerrit-Project: 3d2png
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: MarkTraceur 

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


[MediaWiki-commits] [Gerrit] operations...pybal[master]: Add BGP.parse{KeepAlive, Notification} test cases

2017-08-09 Thread Ema (Code Review)
Ema has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/356620 )

Change subject: Add BGP.parse{KeepAlive,Notification} test cases
..


Add BGP.parse{KeepAlive,Notification} test cases

Change-Id: I57c71ddd12fe0c9f271debd4dcbda99181025484
---
M pybal/bgp/test/test_bgp.py
1 file changed, 12 insertions(+), 0 deletions(-)

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



diff --git a/pybal/bgp/test/test_bgp.py b/pybal/bgp/test/test_bgp.py
index 5776ee6..c0131af 100644
--- a/pybal/bgp/test/test_bgp.py
+++ b/pybal/bgp/test/test_bgp.py
@@ -242,3 +242,15 @@
 msgdata = bytearray(bytes(update)[bgp.HDR_LEN:])
 msgdata[0] += 66
 self.assertRaises(Exception, self.proto.parseUpdate, msgdata)
+
+def testParseKeepAlive(self):
+self.assertRaises(bgp.BadMessageLength, self.proto.parseKeepAlive, b' 
')
+
+def testParseNotification(self):
+# Verify whether a valid NOTIFICATION parses correctly
+msg = (struct.pack('!BB', bgp.ERR_MSG_UPDATE,
+bgp.ERR_MSG_UPDATE_MALFORMED_ASPATH) + b"Unit test")
+self.assertEquals(self.proto.parseNotification(msg),
+(bgp.ERR_MSG_UPDATE, bgp.ERR_MSG_UPDATE_MALFORMED_ASPATH, b"Unit 
test"))
+# Verify a truncated message raises BadMessageLength
+self.assertRaises(bgp.BadMessageLength, self.proto.parseNotification, 
b' ')

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I57c71ddd12fe0c9f271debd4dcbda99181025484
Gerrit-PatchSet: 6
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: master
Gerrit-Owner: Mark Bergsma 
Gerrit-Reviewer: Ema 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: Volans 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: db-codfw.php: Depool db2045

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

Change subject: db-codfw.php: Depool db2045
..


db-codfw.php: Depool db2045

Some duplicate entries showed up on db2075 when compressing InnoDB
there.
As db2075 got its data from db2045, I am going to fix those tables on
db2045 so we can avoid spreading the issue more
The affected tables are:
dewiki.watchlist
wikidatawiki.wb_items_per_site

Bug: T151029
Change-Id: Ib6c48b8664bf60d484f8d4b4bb9f8e648d2a66b4
---
M wmf-config/db-codfw.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php
index 7afee2f..4c7b64c 100644
--- a/wmf-config/db-codfw.php
+++ b/wmf-config/db-codfw.php
@@ -133,7 +133,7 @@
's5' => [
'db2023' => 0,   # B6 2.9TB  96GB, master
'db2038' => 50,  # C6 2.9TB 160GB, rc, log
-   'db2045' => 400, # C6 2.9TB 160GB
+   # 'db2045' => 400, # C6 2.9TB 160GB # Fix dup entries T151029
'db2052' => 50,  # D6 2.9TB 160GB, dump (inactive), vslow
'db2059' => 100, # D6 3.3TB 160GB, api
'db2066' => 400, # D6 3.3TB 160GB

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6c48b8664bf60d484f8d4b4bb9f8e648d2a66b4
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Marostegui 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Jcrespo 
Gerrit-Reviewer: Marostegui 
Gerrit-Reviewer: jenkins-bot <>

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


  1   2   3   >