[MediaWiki-commits] [Gerrit] mediawiki...MultimediaViewer[master]: Shorten clickable link text in HTML credit lines

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

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

Change subject: Shorten clickable link text in HTML credit lines
..

Shorten clickable link text in HTML credit lines

Previously, the clickable text in the generated HTML credit lines
was the entire link to the article. This is shortened to a localized
version of "Link".

Bug: T119686
Change-Id: I708f65a85bfa26c264cdd06a265096027266240c
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M resources/mmv/mmv.EmbedFileFormatter.js
M tests/qunit/mmv/mmv.EmbedFileFormatter.test.js
5 files changed, 9 insertions(+), 6 deletions(-)


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

diff --git a/extension.json b/extension.json
index f4b1b20..0beefd2 100644
--- a/extension.json
+++ b/extension.json
@@ -232,7 +232,8 @@
"multimediaviewer-text-embed-credit-text-l",
"multimediaviewer-html-embed-credit-text-bl",
"multimediaviewer-html-embed-credit-text-b",
-   "multimediaviewer-html-embed-credit-text-l"
+   "multimediaviewer-html-embed-credit-text-l",
+   "multimediaviewer-html-embed-credit-link-text"
]
},
"mmv.ui.download.pane": {
diff --git a/i18n/en.json b/i18n/en.json
index 17fc6f2..e7d7ac5 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -96,6 +96,7 @@
"multimediaviewer-html-embed-credit-text-bl": "By $1, $2, $3",
"multimediaviewer-html-embed-credit-text-b": "By $1, $2",
"multimediaviewer-html-embed-credit-text-l": "$1, $2",
+   "multimediaviewer-html-embed-credit-link-text": "Link",
"multimediaviewer-embed-byline": "By $1",
"multimediaviewer-embed-license": "Licensed under $1.",
"multimediaviewer-embed-license-nonfree": "$1.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index dda5c8e..dc563f1 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -105,6 +105,7 @@
"multimediaviewer-html-embed-credit-text-bl": "Credit text, used when 
generating HTML to reuse an image - used as a caption, not in the middle of a 
sentence.\n\nWhich one of the multimediaviewer-html-embed-credit-text-* 
messages is used will depend on what information about the image is 
available.\n\nParameters:\n* $1 - name of the author\n* $2 - copyright tag 
(usually a license)\n* $3 - URL to the image source\nEach of the parameters 
could be either plain text or a 
link.\n{{Related|Multimediaviewer-embed-credit-text}}",
"multimediaviewer-html-embed-credit-text-b": "Credit text, used when 
generating HTML to reuse an image - used as a caption, not in the middle of a 
sentence.\n\nWhich one of the multimediaviewer-html-embed-credit-text-* 
messages is used will depend on what information about the image is 
available.\n\nParameters:\n* $1 - name of the author\n* $2 - URL to the image 
source\nEach of the parameters could be either plain text or a 
link.\n{{Related|Multimediaviewer-embed-credit-text}}",
"multimediaviewer-html-embed-credit-text-l": "{{optional}}\nCredit 
text, used when generating HTML to reuse an image - used as a caption, not in 
the middle of a sentence.\n\nWhich one of the 
multimediaviewer-html-embed-credit-text-* messages is used will depend on what 
information about the image is available.\n\nParameters:\n* $1 - copyright tag 
(usually a license)\n* $2 - URL to the image source\nEach of the parameters 
could be either plain text or a 
link.\n{{Related|Multimediaviewer-embed-credit-text}}",
+  "multimediaviewer-html-embed-credit-link-text": "The clickable text of a 
link in a credit line, used when generating HTML to reuse an 
image.\n{{Related|Multimediaviewer-embed-credit-text}}",
"multimediaviewer-embed-byline": "Byline (author credit) text, used 
when generating wikitext/HTML to reuse the image. $1 is author 
name.\n{{Identical|By}}",
"multimediaviewer-embed-license": "License information, used when 
generating wikitext/HTML to reuse the image. $1 is the license name.",
"multimediaviewer-embed-license-nonfree": "Like 
{{msg-mw|multimediaviewer-embed-license}}, but for non-free images (where $1 is 
typically not a license name but something like \"Fair use\").",
diff --git a/resources/mmv/mmv.EmbedFileFormatter.js 
b/resources/mmv/mmv.EmbedFileFormatter.js
index 0756238..e0cdc06 100644
--- a/resources/mmv/mmv.EmbedFileFormatter.js
+++ b/resources/mmv/mmv.EmbedFileFormatter.js
@@ -163,7 +163,7 @@
EFFP.getCreditHtml = function ( info ) {
var creditText, creditParams,
shortURL = info.imageInfo.descriptionShortUrl,
-   shortLink = this.htmlUtils.makeLinkText( shortURL, { 
href: shortURL } ),
+   

[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Handle geoshapes ExternalData

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

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

Change subject: Handle geoshapes ExternalData
..

Handle geoshapes ExternalData

GeoJSON can now contain a list of wikidata ids or a sparql query
{
  "type": "ExternalData",
  "href": "geoshape:///?ids=Q30"
}

Bug: T134086
Change-Id: I9b6855f7910e839613aca3fdbba8d4c26e2fd325
---
M extension.json
A lib/topojson/topojson.js
M modules/box/Map.js
3 files changed, 654 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/20/308420/1

diff --git a/extension.json b/extension.json
index 5da73b7..d05c733 100644
--- a/extension.json
+++ b/extension.json
@@ -161,6 +161,7 @@
"dependencies": [
"oojs-ui.styles.icons-media",
"mapbox",
+   "ext.kartographer.lib.topojson",
"ext.kartographer",
"ext.kartographer.style",
"ext.kartographer.settings",
@@ -301,6 +302,18 @@
"desktop"
]
},
+   "ext.kartographer.lib.topojson": {
+   "dependencies": [
+   "mapbox"
+   ],
+   "scripts": [
+   "lib/topojson/topojson.js"
+   ],
+   "targets": [
+   "mobile",
+   "desktop"
+   ]
+   },
"ext.kartographer.wv": {
"dependencies": [
"oojs-ui.styles.icons-editing-core",
diff --git a/lib/topojson/topojson.js b/lib/topojson/topojson.js
new file mode 100644
index 000..da42c85
--- /dev/null
+++ b/lib/topojson/topojson.js
@@ -0,0 +1,545 @@
+(function (global, factory) {
+  typeof exports === 'object' && typeof module !== 'undefined' ? 
factory(exports) :
+  typeof define === 'function' && define.amd ? define(['exports'], factory) :
+  (factory((global.topojson = global.topojson || {})));
+}(this, function (exports) { 'use strict';
+
+  function noop() {}
+
+  function transformAbsolute(transform) {
+if (!transform) return noop;
+var x0,
+y0,
+kx = transform.scale[0],
+ky = transform.scale[1],
+dx = transform.translate[0],
+dy = transform.translate[1];
+return function(point, i) {
+  if (!i) x0 = y0 = 0;
+  point[0] = (x0 += point[0]) * kx + dx;
+  point[1] = (y0 += point[1]) * ky + dy;
+};
+  }
+
+  function transformRelative(transform) {
+if (!transform) return noop;
+var x0,
+y0,
+kx = transform.scale[0],
+ky = transform.scale[1],
+dx = transform.translate[0],
+dy = transform.translate[1];
+return function(point, i) {
+  if (!i) x0 = y0 = 0;
+  var x1 = Math.round((point[0] - dx) / kx),
+  y1 = Math.round((point[1] - dy) / ky);
+  point[0] = x1 - x0;
+  point[1] = y1 - y0;
+  x0 = x1;
+  y0 = y1;
+};
+  }
+
+  function reverse(array, n) {
+var t, j = array.length, i = j - n;
+while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;
+  }
+
+  function bisect(a, x) {
+var lo = 0, hi = a.length;
+while (lo < hi) {
+  var mid = lo + hi >>> 1;
+  if (a[mid] < x) lo = mid + 1;
+  else hi = mid;
+}
+return lo;
+  }
+
+  function feature(topology, o) {
+return o.type === "GeometryCollection" ? {
+  type: "FeatureCollection",
+  features: o.geometries.map(function(o) { return feature$1(topology, o); 
})
+} : feature$1(topology, o);
+  }
+
+  function feature$1(topology, o) {
+var f = {
+  type: "Feature",
+  id: o.id,
+  properties: o.properties || {},
+  geometry: object(topology, o)
+};
+if (o.id == null) delete f.id;
+return f;
+  }
+
+  function object(topology, o) {
+var absolute = transformAbsolute(topology.transform),
+arcs = topology.arcs;
+
+function arc(i, points) {
+  if (points.length) points.pop();
+  for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length, p; k < n; ++k) {
+points.push(p = a[k].slice());
+absolute(p, k);
+  }
+  if (i < 0) reverse(points, n);
+}
+
+function point(p) {
+  p = p.slice();
+  absolute(p, 0);
+  return p;
+}
+
+function line(arcs) {
+  var points = [];
+  for (var i = 0, n = arcs.length; i < n; ++i) arc(arcs[i], points);
+  if (points.length < 2) points.push(points[0].slice());
+  return points;
+}
+
+function ring(arcs) {
+  var points = line(arcs);
+  while (points.length < 4) points.push(points[0].slice());
+  return points;
+

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Added a Database::buildStringCast and use on int/string join

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

Change subject: Added a Database::buildStringCast and use on int/string join
..


Added a Database::buildStringCast and use on int/string join

The database specific sql is untested, but sql is taken from docs

mssql - knows about impilict casts -
https://technet.microsoft.com/en-us/library/ms191530(v=sql.105).aspx
mysql - knows about impilict casts
oracle - https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqlj33562.html
postgresql -
https://www.postgresql.org/docs/9.2/static/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS
sqlite - http://www.sqlite.org/lang_expr.html

Bug: T69065
Change-Id: I3a83276dc65aae58124460af1810d37dff52e943
---
M includes/db/Database.php
M includes/db/DatabaseOracle.php
M includes/db/DatabasePostgres.php
M includes/db/DatabaseSqlite.php
M includes/specials/SpecialProtectedpages.php
5 files changed, 37 insertions(+), 1 deletion(-)

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



diff --git a/includes/db/Database.php b/includes/db/Database.php
index 5b0f230..f031d11 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -1809,6 +1809,15 @@
return '(' . $this->selectSQLText( $table, $fld, $conds, null, 
[], $join_conds ) . ')';
}
 
+   /**
+* @param string $field Field or column to cast
+* @return string
+* @since 1.28
+*/
+   public function buildStringCast( $field ) {
+   return $field;
+   }
+
public function selectDB( $db ) {
# Stub. Shouldn't cause serious problems if it's not 
overridden, but
# if your database engine supports a concept similar to MySQL's
diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php
index 33a8280..171191b 100644
--- a/includes/db/DatabaseOracle.php
+++ b/includes/db/DatabaseOracle.php
@@ -1555,6 +1555,15 @@
return '(' . $this->selectSQLText( $table, $fld, $conds, null, 
[], $join_conds ) . ')';
}
 
+   /**
+* @param string $field Field or column to cast
+* @return string
+* @since 1.28
+*/
+   public function buildStringCast( $field ) {
+   return 'CAST ( ' . $field . ' AS VARCHAR2 )';
+   }
+
public function getSearchEngine() {
return 'SearchOracle';
}
diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php
index c8e9ac7..9cd95a1 100644
--- a/includes/db/DatabasePostgres.php
+++ b/includes/db/DatabasePostgres.php
@@ -1535,6 +1535,15 @@
return '(' . $this->selectSQLText( $table, $fld, $conds, null, 
[], $join_conds ) . ')';
}
 
+   /**
+* @param string $field Field or column to cast
+* @return string
+* @since 1.28
+*/
+   public function buildStringCast( $field ) {
+   return $field . '::text';
+   }
+
public function getSearchEngine() {
return 'SearchPostgres';
}
diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php
index 5bbba88..e6401b3 100644
--- a/includes/db/DatabaseSqlite.php
+++ b/includes/db/DatabaseSqlite.php
@@ -833,6 +833,15 @@
}
 
/**
+* @param string $field Field or column to cast
+* @return string
+* @since 1.28
+*/
+   public function buildStringCast( $field ) {
+   return 'CAST ( ' . $field . ' AS TEXT )';
+   }
+
+   /**
 * @return string
 */
public function getSearchEngine() {
diff --git a/includes/specials/SpecialProtectedpages.php 
b/includes/specials/SpecialProtectedpages.php
index 342509c..5bdae15 100644
--- a/includes/specials/SpecialProtectedpages.php
+++ b/includes/specials/SpecialProtectedpages.php
@@ -558,7 +558,7 @@
'join_conds' => [
'log_search' => [
'LEFT JOIN', [
-   'ls_field' => 'pr_id', 
'ls_value = pr_id'
+   'ls_field' => 'pr_id', 
'ls_value = ' . $this->mDb->buildStringCast( 'pr_id' )
]
],
'logging' => [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3a83276dc65aae58124460af1810d37dff52e943
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: jenkins-bot <>


[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: New Wikidata Build - 2016-09-03T10:00:01+0000

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

Change subject: New Wikidata Build - 2016-09-03T10:00:01+
..


New Wikidata Build - 2016-09-03T10:00:01+

Change-Id: I212f9521592ffe2f396a289bd6bb29d0a48818f0
---
M composer.lock
M extensions/Wikibase/client/includes/Api/ApiPropsEntityUsage.php
M extensions/Wikibase/phpcs.xml
M extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageBuilder.php
M extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageIdPager.php
M extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageTable.php
M extensions/Wikibase/repo/includes/Store/Sql/ItemsPerSiteBuilder.php
M extensions/Wikibase/repo/includes/Store/Sql/SqlStore.php
M extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityRedirectLookup.php
M extensions/Wikibase/repo/maintenance/dumpEntities.php
M extensions/Wikibase/repo/maintenance/rebuildEntityPerPage.php
M extensions/Wikibase/repo/maintenance/rebuildItemsPerSite.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/DatabaseSchemaUpdaterTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/DispatchStatsTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/EntityPerPageBuilderTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/EntityPerPageIdPagerTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/EntityPerPageTableTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/ItemsPerSiteBuilderTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/PropertyInfoTableBuilderTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/SqlChangeStoreTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/SqlIdGeneratorTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/SqlSiteLinkConflictLookupTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/SqlSubscriptionLookupTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/TermSearchKeyBuilderTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityRedirectLookupTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
M vendor/composer/autoload_classmap.php
M vendor/composer/installed.json
30 files changed, 155 insertions(+), 121 deletions(-)

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



diff --git a/composer.lock b/composer.lock
index e725e16..62284f8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1574,12 +1574,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git;,
-"reference": "547ab4174067203a9dfb90220ebffec5a410cea1"
+"reference": "35d1215e7630422918eea2b03a57660eb08fec1a"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/547ab4174067203a9dfb90220ebffec5a410cea1;,
-"reference": "547ab4174067203a9dfb90220ebffec5a410cea1",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/35d1215e7630422918eea2b03a57660eb08fec1a;,
+"reference": "35d1215e7630422918eea2b03a57660eb08fec1a",
 "shasum": ""
 },
 "require": {
@@ -1651,7 +1651,7 @@
 "wikibaserepo",
 "wikidata"
 ],
-"time": "2016-09-02 07:56:58"
+"time": "2016-09-02 12:18:28"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/client/includes/Api/ApiPropsEntityUsage.php 
b/extensions/Wikibase/client/includes/Api/ApiPropsEntityUsage.php
index 51726b2..6887717 100644
--- a/extensions/Wikibase/client/includes/Api/ApiPropsEntityUsage.php
+++ b/extensions/Wikibase/client/includes/Api/ApiPropsEntityUsage.php
@@ -208,7 +208,7 @@
}
 
public function getHelpUrls() {
-   return 
'https://www.mediawiki.org/wiki/API:Wikibase/EntityUsage';
+   return 
'https://www.mediawiki.org/wiki/Wikibase/API#wbentityusage';
}
 
 }
diff --git a/extensions/Wikibase/phpcs.xml b/extensions/Wikibase/phpcs.xml
index 5ff1efb..5ffc2cc 100644
--- a/extensions/Wikibase/phpcs.xml
+++ b/extensions/Wikibase/phpcs.xml
@@ -32,11 +32,7 @@


(RdfWriterFactory|UrlSchemeValidators)\.php

-   
-   
-   
-   
-   
+   
 

 
diff --git 
a/extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageBuilder.php 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RevertAction: Prevent file revert if current version is iden...

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

Change subject: RevertAction: Prevent file revert if current version is 
identical
..


RevertAction: Prevent file revert if current version is identical

There are several reasons for this:

* The file thumbnail shown on the main file page is cached by the
  browser, as images tend to be. This often confuses users into
  thinking their revert did not work, and into attempting it again.
  Recent examples:
  * 
https://commons.wikimedia.org/wiki/Commons:Village_pump/Archive/2016/07#Wrong_SVG_rendering_on_File:DuckDuckGo_logo_and_wordmark.svg
  * 
https://commons.wikimedia.org/w/index.php?title=Commons:Upload_help=205348523#Reversion_is_not_working_for_me.
  Ideally we'd prevent the caching, but preventing repeated reverts
  should also work.

* Refreshing the success page causes the revert to be attempted again
  (T53383). The usual solution to this is the Post/Redirect/Get
  pattern, but we want to show a success message so that would require
  some more changes (something similar to the post-edit notification).

* It can serve as a "revert conflict" detection mechanism, crude but
  better than none.

In the unlikely case that uploading an identical older version of
the file is necessary, it can still be done using Special:Upload.

Bug: T53383
Change-Id: I37e04a536c5c2fc6cdbe59f6f598bb0c7f25d7a7
---
M includes/actions/RevertAction.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 12 insertions(+), 4 deletions(-)

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



diff --git a/includes/actions/RevertAction.php 
b/includes/actions/RevertAction.php
index c800ce7..e466e65 100644
--- a/includes/actions/RevertAction.php
+++ b/includes/actions/RevertAction.php
@@ -112,13 +112,19 @@
public function onSubmit( $data ) {
$this->useTransactionalTimeLimit();
 
-   $source = $this->page->getFile()->getArchiveVirtualUrl(
-   $this->getRequest()->getText( 'oldimage' )
-   );
+   $old = $this->getRequest()->getText( 'oldimage' );
+   $localFile = $this->page->getFile();
+   $oldFile = OldLocalFile::newFromArchiveName( $this->getTitle(), 
$localFile->getRepo(), $old );
+
+   $source = $localFile->getArchiveVirtualUrl( $old );
$comment = $data['comment'];
 
+   if ( $localFile->getSha1() === $oldFile->getSha1() ) {
+   return Status::newFatal( 'filerevert-identical' );
+   }
+
// TODO: Preserve file properties from database instead of 
reloading from file
-   return $this->page->getFile()->upload(
+   return $localFile->upload(
$source,
$comment,
$comment,
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index dcd3981..bcd740c 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1682,6 +1682,7 @@
"filerevert-submit": "Revert",
"filerevert-success": "[[Media:$1|$1]] has been 
reverted to the [$4 version as of $3, $2].",
"filerevert-badversion": "There is no previous local version of this 
file with the provided timestamp.",
+   "filerevert-identical": "The current version of the file is already 
identical to the selected one.",
"filedelete": "Delete $1",
"filedelete-legend": "Delete file",
"filedelete-intro": "You are about to delete the file 
[[Media:$1|$1]] along with all of its history.",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 48f2013..655ddfa 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -1865,6 +1865,7 @@
"filerevert-submit": "{{Identical|Revert}}",
"filerevert-success": "Message displayed when you succeed in reverting 
a version of a file.\n* $1 is the name of the media\n* $2 is a date\n* $3 is a 
time\n* $4 is an URL and must follow square bracket: [$4\n{{Identical|Revert}}",
"filerevert-badversion": "Used as error message.",
+   "filerevert-identical": "Used as error message.",
"filedelete": "Used as page title. Parameters:\n* $1 - file title\nSee 
also:\n* {{msg-mw|Filedelete-intro}}",
"filedelete-legend": "Used as fieldset label in the \"Delete file\" 
form.\n{{Identical|Delete file}}",
"filedelete-intro": "Used as introduction for FileDelete form. 
Parameters:\n* $1 - page title for file\nSee also:\n* {{msg-mw|Filedelete|page 
title}}",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I37e04a536c5c2fc6cdbe59f6f598bb0c7f25d7a7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 

[MediaWiki-commits] [Gerrit] labs...deploy[master]: Add 502, 503 and 504 error pages

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

Change subject: Add 502, 503 and 504 error pages
..


Add 502, 503 and 504 error pages

Add a Bad Gateway, Service Unavailable and Gateway Timeout error pages
that can be used in the webserver's configuration to replace the bland
defaults.

Bug: T144040
Change-Id: I7e54c867211fea45258dfc6bae48467b43c8bb2f
---
A public_html/502.html
A public_html/503.html
A public_html/504.html
3 files changed, 144 insertions(+), 0 deletions(-)

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



diff --git a/public_html/502.html b/public_html/502.html
new file mode 100644
index 000..cf48cb3
--- /dev/null
+++ b/public_html/502.html
@@ -0,0 +1,48 @@
+
+
+  
+
+
+
+
+Bad Gateway
+
+
+
+  
+  
+
+  
+502 Bad Gateway
+The server was acting as a https://en.wikipedia.org/wiki/Gateway_(telecommunications)">gateway 
or proxy and received an invalid response from the upstream server.
+
+  https://en.wikipedia.org/w/index.php?title=List_of_HTTP_status_codesoldid=736266399;>"List
 of HTTP status codes."
+  Wikipedia: The Free 
Encyclopedia.
+  Wikimedia Foundation, Inc.
+  26 August 2016.
+  Web. 27 August 2016.
+
+  
+  The backend server is not returning a valid answer for your request. 
This is probably temporary and should be fixed soon. Please try again later.
+  You may be able to get further information in the #wikimedia-labs channel on 
the Freenode IRC network.
+
+
+  
+
+  
+
+
+
+  https://wikimediafoundation.org/wiki/Privacy_policy;>Privacy 
policy
+  https://phabricator.wikimedia.org/diffusion/LSTR/;>Source
+  https://phabricator.wikimedia.org/tag/striker/;>Issues
+  https://wikitech.wikimedia.org/wiki/Toolsadmin.wikimedia.org;>Docs
+
+  
+  
+Code licensed https://phabricator.wikimedia.org/diffusion/LSTR/browse/master/LICENSE; 
rel="license">GPLv3+, docs https://creativecommons.org/licenses/by-sa/3.0/; rel="license">CC BY-SA 
3.0.
+
+  
+
+  
+
diff --git a/public_html/503.html b/public_html/503.html
new file mode 100644
index 000..733c650
--- /dev/null
+++ b/public_html/503.html
@@ -0,0 +1,48 @@
+
+
+  
+
+
+
+
+Service Temporarily Unavailable
+
+
+
+  
+  
+
+  
+503 Service Unavailable
+The server is currently unavailable (because it is overloaded or 
down for maintenance). Generally, this is a temporary state.
+
+  https://en.wikipedia.org/w/index.php?title=List_of_HTTP_status_codes=736266399;>List
 of HTTP status codes.
+  Wikipedia: The Free 
Encyclopedia.
+  Wikimedia Foundation, Inc.
+  26 August 2016.
+  Web. 27 August 2016.
+
+  
+  The backend server is not returning an answer for your request. This 
is probably temporary and should be fixed soon. Please try again later.
+  You may be able to get further information in the #wikimedia-labs channel on 
the Freenode IRC network.
+
+
+  
+
+  
+
+
+
+  https://wikimediafoundation.org/wiki/Privacy_policy;>Privacy 
policy
+  https://phabricator.wikimedia.org/diffusion/LSTR/;>Source
+  https://phabricator.wikimedia.org/tag/striker/;>Issues
+  https://wikitech.wikimedia.org/wiki/Toolsadmin.wikimedia.org;>Docs
+
+  
+  
+Code licensed https://phabricator.wikimedia.org/diffusion/LSTR/browse/master/LICENSE; 
rel="license">GPLv3+, docs https://creativecommons.org/licenses/by-sa/3.0/; rel="license">CC BY-SA 
3.0.
+
+  
+
+  
+
diff --git a/public_html/504.html b/public_html/504.html
new file mode 100644
index 000..d96ed12
--- /dev/null
+++ b/public_html/504.html
@@ -0,0 +1,48 @@
+
+
+  
+
+
+
+
+Gateway Timeout
+
+
+
+  
+  
+
+  
+504 Gateway Timeout
+The server was acting as a gateway or proxy and did not receive a 
timely response from the upstream server.
+
+  https://en.wikipedia.org/w/index.php?title=List_of_HTTP_status_codesoldid=736266399;>"List
 of HTTP status codes."
+  Wikipedia: The Free 
Encyclopedia.
+  Wikimedia Foundation, Inc.
+  26 August 2016.
+  Web. 27 August 2016.
+
+  
+  The backend server is taking too long to return an answer for your 
request. This is probably temporary and should be fixed soon. Please try again 
later.
+  You may be able to get further information in the #wikimedia-labs channel on 
the Freenode IRC network.
+
+
+  
+
+  
+
+
+
+  https://wikimediafoundation.org/wiki/Privacy_policy;>Privacy 
policy
+  

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove unused DB position values in LoadBalancer

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

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

Change subject: Remove unused DB position values in LoadBalancer
..

Remove unused DB position values in LoadBalancer

Also fixed IDEA error about useless $conn declaration.

Change-Id: I73572cb201e44db45fbe9bdb8e06bff4b50cecb2
---
M includes/db/loadbalancer/LoadBalancer.php
1 file changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/62/308362/1

diff --git a/includes/db/loadbalancer/LoadBalancer.php 
b/includes/db/loadbalancer/LoadBalancer.php
index 7ca0b33..d3a2902 100644
--- a/includes/db/loadbalancer/LoadBalancer.php
+++ b/includes/db/loadbalancer/LoadBalancer.php
@@ -284,7 +284,6 @@
 
# No server found yet
$i = false;
-   $conn = false;
# First try quickly looking through the available servers for a 
server that
# meets our criteria
$currentLoads = $nonErrorLoads;
@@ -353,9 +352,7 @@
# Replica DB connection successful.
# Wait for the session master pos for a short time.
if ( $this->mWaitForPos && $i > 0 ) {
-   if ( !$this->doWait( $i ) ) {
-   $this->mServers[$i]['slave pos'] = 
$conn->getSlavePos();
-   }
+   $this->doWait( $i );
}
if ( $this->mReadIndex <= 0 && $this->mLoads[$i] > 0 && 
$group === false ) {
$this->mReadIndex = $i;
@@ -384,7 +381,6 @@
 
if ( $i > 0 ) {
if ( !$this->doWait( $i ) ) {
-   $this->mServers[$i]['slave pos'] = 
$this->getAnyOpenConnection( $i )->getSlavePos();
$this->laggedReplicaMode = true;
}
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Rename some variables in DatabaseMysqlBase

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

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

Change subject: Rename some variables in DatabaseMysqlBase
..

Rename some variables in DatabaseMysqlBase

Positions may be MariaDB GTIDs, which can even be kept in sync
in master/master Galera setups.

See https://mariadb.com/kb/en/mariadb/gtid/

Change-Id: I3dc80ae099d0849e57a7278d662317da362ff8fc
---
M includes/db/DatabaseMysqlBase.php
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/63/308363/1

diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/db/DatabaseMysqlBase.php
index 3c383e3..e813f80 100644
--- a/includes/db/DatabaseMysqlBase.php
+++ b/includes/db/DatabaseMysqlBase.php
@@ -31,7 +31,7 @@
  */
 abstract class DatabaseMysqlBase extends Database {
/** @var MysqlMasterPos */
-   protected $lastKnownSlavePos;
+   protected $lastKnownReplicaPos;
/** @var string Method to detect replica DB lag */
protected $lagDetectionMethod;
/** @var array Method to detect replica DB lag */
@@ -771,7 +771,7 @@
 
if ( $this->getLBInfo( 'is static' ) === true ) {
return 0; // this is a copy of a read-only dataset with 
no master DB
-   } elseif ( $this->lastKnownSlavePos && 
$this->lastKnownSlavePos->hasReached( $pos ) ) {
+   } elseif ( $this->lastKnownReplicaPos && 
$this->lastKnownReplicaPos->hasReached( $pos ) ) {
return 0; // already reached this point for sure
}
 
@@ -799,14 +799,14 @@
// with an old master hostname. Such calls make 
MASTER_POS_WAIT() return null. Try
// to detect this and treat the replica DB as having 
reached the position; a proper master
// switchover already requires that the new master be 
caught up before the switch.
-   $slavePos = $this->getSlavePos();
-   if ( $slavePos && !$slavePos->channelsMatch( $pos ) ) {
-   $this->lastKnownSlavePos = $slavePos;
+   $replicationPos = $this->getSlavePos();
+   if ( $replicationPos && 
!$replicationPos->channelsMatch( $pos ) ) {
+   $this->lastKnownReplicaPos = $replicationPos;
$status = 0;
}
} elseif ( $status >= 0 ) {
// Remember that this position was reached to save 
queries next time
-   $this->lastKnownSlavePos = $pos;
+   $this->lastKnownReplicaPos = $pos;
}
 
return $status;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Rename some DB/LB variables to be more consistent

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

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

Change subject: Rename some DB/LB variables to be more consistent
..

Rename some DB/LB variables to be more consistent

Change-Id: I21de9c972402144159b7b2fc824533f8cefb03e7
---
M includes/db/Database.php
M includes/db/loadbalancer/LoadBalancer.php
2 files changed, 25 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/61/308361/1

diff --git a/includes/db/Database.php b/includes/db/Database.php
index 5b0f230..786d5f9 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -128,7 +128,7 @@
 */
private $mTrxTimestamp = null;
/** @var float Lag estimate at the time of BEGIN */
-   private $mTrxSlaveLag = null;
+   private $mTrxReplicaLag = null;
/**
 * Remembers the function name given for starting the most recent 
transaction via begin().
 * Used to provide additional context for error reporting.
@@ -1028,20 +1028,21 @@
 * @param float $runtime Total runtime, including RTT
 */
private function updateTrxWriteQueryTime( $sql, $runtime ) {
-   $indicativeOfSlaveRuntime = true;
+   // Whether this is indicative of replica DB runtime (except for 
RBR or ws_repl)
+   $indicativeOfReplicaRuntime = true;
if ( $runtime > self::SLOW_WRITE_SEC ) {
$verb = $this->getQueryVerb( $sql );
// insert(), upsert(), replace() are fast unless bulky 
in size or blocked on locks
if ( $verb === 'INSERT' ) {
-   $indicativeOfSlaveRuntime = 
$this->affectedRows() > self::SMALL_WRITE_ROWS;
+   $indicativeOfReplicaRuntime = 
$this->affectedRows() > self::SMALL_WRITE_ROWS;
} elseif ( $verb === 'REPLACE' ) {
-   $indicativeOfSlaveRuntime = 
$this->affectedRows() > self::SMALL_WRITE_ROWS / 2;
+   $indicativeOfReplicaRuntime = 
$this->affectedRows() > self::SMALL_WRITE_ROWS / 2;
}
}
 
$this->mTrxWriteDuration += $runtime;
$this->mTrxWriteQueryCount += 1;
-   if ( $indicativeOfSlaveRuntime ) {
+   if ( $indicativeOfReplicaRuntime ) {
$this->mTrxWriteAdjDuration += $runtime;
$this->mTrxWriteAdjQueryCount += 1;
}
@@ -2911,7 +2912,7 @@
// Get an estimate of the replica DB lag before then, treating 
estimate staleness
// as lag itself just to be safe
$status = $this->getApproximateLagStatus();
-   $this->mTrxSlaveLag = $status['lag'] + ( microtime( true ) - 
$status['since'] );
+   $this->mTrxReplicaLag = $status['lag'] + ( microtime( true ) - 
$status['since'] );
}
 
/**
@@ -3206,7 +3207,7 @@
 */
public function getTransactionLagStatus() {
return $this->mTrxLevel
-   ? [ 'lag' => $this->mTrxSlaveLag, 'since' => 
$this->trxTimestamp() ]
+   ? [ 'lag' => $this->mTrxReplicaLag, 'since' => 
$this->trxTimestamp() ]
: null;
}
 
diff --git a/includes/db/loadbalancer/LoadBalancer.php 
b/includes/db/loadbalancer/LoadBalancer.php
index 36df466..7ca0b33 100644
--- a/includes/db/loadbalancer/LoadBalancer.php
+++ b/includes/db/loadbalancer/LoadBalancer.php
@@ -61,9 +61,9 @@
/** @var bool|DBMasterPos False if not set */
private $mWaitForPos;
/** @var bool Whether the generic reader fell back to a lagged replica 
DB */
-   private $laggedSlaveMode = false;
+   private $laggedReplicaMode = false;
/** @var bool Whether the generic reader fell back to a lagged replica 
DB */
-   private $slavesDownMode = false;
+   private $allReplicasDownMode = false;
/** @var string The last DB selection or connection error */
private $mLastError = 'Unknown error';
/** @var string|bool Reason the LB is read-only or false if not */
@@ -280,7 +280,7 @@
# Scale the configured load ratios according to the dynamic 
load (if the load monitor supports it)
$this->getLoadMonitor()->scaleLoads( $nonErrorLoads, $group, 
$wiki );
 
-   $laggedSlaveMode = false;
+   $laggedReplicaMode = false;
 
# No server found yet
$i = false;
@@ -289,7 +289,7 @@
# meets our criteria
$currentLoads = $nonErrorLoads;
while ( count( $currentLoads ) ) {
-   if ( $this->mAllowLagged || $laggedSlaveMode ) {
+   if ( $this->mAllowLagged || $laggedReplicaMode ) 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make replication DB-related comments/messages more uniform

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

Change subject: Make replication DB-related comments/messages more uniform
..


Make replication DB-related comments/messages more uniform

Change-Id: If04254aad085c05d2a6b6588b4c9b55a1736110d
---
M includes/db/ChronologyProtector.php
M includes/db/Database.php
M includes/db/DatabaseMysqlBase.php
M includes/db/DatabaseUtility.php
M includes/db/IDatabase.php
M includes/db/loadbalancer/LBFactory.php
M includes/db/loadbalancer/LoadBalancer.php
7 files changed, 55 insertions(+), 55 deletions(-)

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



diff --git a/includes/db/ChronologyProtector.php 
b/includes/db/ChronologyProtector.php
index 2539b87..b4619f3 100644
--- a/includes/db/ChronologyProtector.php
+++ b/includes/db/ChronologyProtector.php
@@ -79,9 +79,9 @@
 * Initialise a LoadBalancer to give it appropriate chronology 
protection.
 *
 * If the stash has a previous master position recorded, this will try 
to
-* make sure that the next query to a slave of that master will see 
changes up
+* make sure that the next query to a replica DB of that master will 
see changes up
 * to that position by delaying execution. The delay may timeout and 
allow stale
-* data if no non-lagged slaves are available.
+* data if no non-lagged replica DBs are available.
 *
 * @param LoadBalancer $lb
 * @return void
diff --git a/includes/db/Database.php b/includes/db/Database.php
index 0a660d9..5b0f230 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -2908,7 +2908,7 @@
$this->mTrxWriteAdjQueryCount = 0;
$this->mTrxWriteCallers = [];
// First SELECT after BEGIN will establish the snapshot in 
REPEATABLE-READ.
-   // Get an estimate of the slave lag before then, treating 
estimate staleness
+   // Get an estimate of the replica DB lag before then, treating 
estimate staleness
// as lag itself just to be safe
$status = $this->getApproximateLagStatus();
$this->mTrxSlaveLag = $status['lag'] + ( microtime( true ) - 
$status['since'] );
@@ -3194,7 +3194,7 @@
}
 
/**
-* Get the slave lag when the current transaction started
+* Get the replica DB lag when the current transaction started
 *
 * This is useful when transactions might use snapshot isolation
 * (e.g. REPEATABLE-READ in innodb), so the "real" lag of that data
@@ -3211,7 +3211,7 @@
}
 
/**
-* Get a slave lag estimate for this server
+* Get a replica DB lag estimate for this server
 *
 * @return array ('lag': seconds or false on error, 'since': UNIX 
timestamp of estimate)
 * @since 1.27
diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/db/DatabaseMysqlBase.php
index 93814d2..3c383e3 100644
--- a/includes/db/DatabaseMysqlBase.php
+++ b/includes/db/DatabaseMysqlBase.php
@@ -32,9 +32,9 @@
 abstract class DatabaseMysqlBase extends Database {
/** @var MysqlMasterPos */
protected $lastKnownSlavePos;
-   /** @var string Method to detect slave lag */
+   /** @var string Method to detect replica DB lag */
protected $lagDetectionMethod;
-   /** @var array Method to detect slave lag */
+   /** @var array Method to detect replica DB lag */
protected $lagDetectionOptions = [];
/** @var bool bool Whether to use GTID methods */
protected $useGTIDs = false;
@@ -695,7 +695,7 @@
$key = $cache->makeGlobalKey(
'mysql',
'master-info',
-   // Using one key for all cluster slaves is preferable
+   // Using one key for all cluster replica DBs is 
preferable
$this->getLBInfo( 'clusterMasterHost' ) ?: 
$this->getServer()
);
 
@@ -797,7 +797,7 @@
if ( $status === null ) {
// T126436: jobs programmed to wait on master positions 
might be referencing binlogs
// with an old master hostname. Such calls make 
MASTER_POS_WAIT() return null. Try
-   // to detect this and treat the slave as having reached 
the position; a proper master
+   // to detect this and treat the replica DB as having 
reached the position; a proper master
// switchover already requires that the new master be 
caught up before the switch.
$slavePos = $this->getSlavePos();
if ( $slavePos && !$slavePos->channelsMatch( $pos ) ) {
diff --git a/includes/db/DatabaseUtility.php b/includes/db/DatabaseUtility.php
index b6c37ee..aeaa27f 100644
--- 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [IMPR] Simplify returnOlderTime()

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

Change subject: [IMPR] Simplify returnOlderTime()
..


[IMPR] Simplify returnOlderTime()

- rename returnOlderTime to important_image because the method does
  return the most important image i.e. the most used or oldest
  but not any time information
- return a FilePage object instead a title
- remove obsolete timeListGiven as data is included in listGiven
- use Page object in listGiven instead of the title
- use enumerate for counting
- use max() function to find the oldest image
- rename num_older for better readability
- add some doc for readability
- use FilePage from important_image later in the script
- use its title method instead of throw parts together
- also use title method for dup_page to collect the titles
- remove trivial doc strings

Change-Id: I9022c31d957f9afd67408de96184b4d769862472
---
M scripts/checkimages.py
1 file changed, 47 insertions(+), 52 deletions(-)

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



diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 02e9a0b..375fa33 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -807,35 +807,31 @@
 for element in self.load(pageHiddenText):
 self.hiddentemplates.add(pywikibot.Page(self.site, element))
 
-def returnOlderTime(self, listGiven, timeListGiven):
-"""Get some time and return the oldest of them."""
-num = 0
-num_older = None
-max_usage = 0
-for element in listGiven:
-imageName = element[1]
-imagePage = pywikibot.FilePage(self.site, imageName)
-imageUsage = [page for page in imagePage.usingPages()]
-if len(imageUsage) > 0 and len(imageUsage) > max_usage:
-max_usage = len(imageUsage)
-num_older = num
-num += 1
+def important_image(self, listGiven):
+"""
+Get tuples of image and time, return the most used or oldest image.
 
-if num_older:
-return listGiven[num_older][1]
+@param listGiven: a list of tuples which hold seconds and FilePage
+@type listGiven: list
+@return: the most used or oldest image
+@rtype: FilePage
+"""
+# find the most used image
+inx_found = None  # index of found image
+max_usage = 0  # hold max amount of using pages
+for num, element in enumerate(listGiven):
+image = element[1]
+image_used = len([page for page in image.usingPages()])
+if image_used > max_usage:
+max_usage = image_used
+inx_found = num
 
-for element in listGiven:
-time = element[0]
-imageName = element[1]
-not_the_oldest = False
+if inx_found is not None:
+return listGiven[inx_found][1]
 
-for time_selected in timeListGiven:
-if time > time_selected:
-not_the_oldest = True
-break
-
-if not not_the_oldest:
-return imageName
+# find the oldest image
+sec, image = max(listGiven, key=lambda element: element[0])
+return image
 
 @deprecated('Page.revision_count()')
 def countEdits(self, pagename, userlist):
@@ -928,7 +924,6 @@
  'count': len(duplicates) - 1}))
 if dupText and dupRegex:
 time_image_list = []
-time_list = []
 
 for dup_page in duplicates:
 if (dup_page.title(asUrl=True) != 
self.image.title(asUrl=True) or
@@ -939,10 +934,8 @@
 continue
 data = self.timestamp.timetuple()
 data_seconds = time.mktime(data)
-time_image_list.append([data_seconds, dup_page.title()])
-time_list.append(data_seconds)
-older_image = self.returnOlderTime(time_image_list, time_list)
-Page_older_image = pywikibot.FilePage(self.site, older_image)
+time_image_list.append([data_seconds, dup_page])
+Page_older_image = self.important_image(time_image_list)
 older_page_text = Page_older_image.text
 # And if the images are more than two?
 string = ''
@@ -950,43 +943,42 @@
 
 for dup_page in duplicates:
 if dup_page == Page_older_image:
-# the older image, not report also this as duplicate
+# the most used or oldest image
+# not report also this as duplicate
 continue
 try:
 DupPageText = dup_page.text
 except pywikibot.NoPage:
-   

[MediaWiki-commits] [Gerrit] operations/puppet[production]: striker: Add custom error pages to apache vhost

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

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

Change subject: striker: Add custom error pages to apache vhost
..

striker: Add custom error pages to apache vhost

Bug: T144040
Change-Id: I844510b030c0487c34f0843f5b5a6901777cc912
---
M modules/striker/templates/apache.conf.erb
1 file changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/59/308359/1

diff --git a/modules/striker/templates/apache.conf.erb 
b/modules/striker/templates/apache.conf.erb
index ec2db0b..599efaa 100644
--- a/modules/striker/templates/apache.conf.erb
+++ b/modules/striker/templates/apache.conf.erb
@@ -50,6 +50,14 @@
 ProxyPass !
   
 
+  
+# Error pages should not be cached
+ExpiresDefault "access plus 0 seconds"
+Header set Cache-Control "no-cache"
+# Do not proxy matching requests
+ProxyPass !
+  
+
   # Reverse proxy everything that's not excluded to the uwsgi backend
   ProxyPassMatch "/(.*)" "balancer://uwsgi/$1"
   
@@ -61,5 +69,9 @@
   LogLevel warn
   CustomLog /var/log/apache2/<%= @server_name %>-access.log wmf
   ErrorLog  /var/log/apache2/<%= @server_name %>-error.log
+
+  ErrorDocument 502 /502.html
+  ErrorDocument 503 /503.html
+  ErrorDocument 504 /504.html
 
 # vim:ft=apache:sw=2:ts=2:sts=2:et:

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: OutputPage: Ensure setupSkinUserCss() always applies to head...

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

Change subject: OutputPage: Ensure setupSkinUserCss() always applies to 
headElement()
..


OutputPage: Ensure setupSkinUserCss() always applies to headElement()

Follows-up 80e5b160e0, which had to move this call out of the
headElement() and buildCssLinks() methods as it was no longer
allowed to modify the module queue after it was created.

It was moved to OutputPage::output(), right before Skin::outputPage()
is called, which ends up calling headElement().

The point in time was effectively unchanged for page views.

However for the caller in ApiParse() this meant setupSkinUserCss()
no longer got called at all as it never calls output(), but instead
calls headElement() directly.

Move it to getRlClient(), which is where we set all other 
OutputPage-specific things relating to module loading already.

* For page views this has no impact.
* For ApiParse it means headElement(), which calls getRlClient(),
  will once again include skin stylesheets.

Bug: T144301
Change-Id: I5fd4a27fb2d70b98ce9161dc050788d8ac364110
---
M includes/OutputPage.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 1083687..5aaa474 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2303,7 +2303,6 @@
// Hook that allows last minute changes to the output 
page, e.g.
// adding of CSS or Javascript by extensions.
Hooks::run( 'BeforePageDisplay', [ &$this, &$sk ] );
-   $this->getSkin()->setupSkinUserCss( $this );
 
try {
$sk->outputPage();
@@ -2675,6 +2674,7 @@
'user.styles',
'user.cssprefs',
] );
+   $this->getSkin()->setupSkinUserCss( $this );
 
// Prepare exempt modules for buildExemptModules()
$exemptGroups = [ 'site' => [], 'noscript' => [], 
'private' => [], 'user' => [] ];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5fd4a27fb2d70b98ce9161dc050788d8ac364110
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ArticleFeedbackv5[master]: Remove wfProfile(In|Out) calls because those functions have ...

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: Remove wfProfile(In|Out) calls because those functions have 
been no-op since MW 1.25
..

Remove wfProfile(In|Out) calls because those functions have been no-op since MW 
1.25

Change-Id: I66f466899265ef4e40d11bf8f2617482fae48e27
---
M ArticleFeedbackv5.flagging.php
M ArticleFeedbackv5.log.php
M ArticleFeedbackv5.mailerJob.php
M api/ApiAddFlagNoteArticleFeedbackv5.php
M api/ApiArticleFeedbackv5.php
M api/ApiFlagFeedbackArticleFeedbackv5.php
M api/ApiGetCountArticleFeedbackv5.php
M api/ApiSetStatusArticleFeedbackv5.php
M api/ApiViewActivityArticleFeedbackv5.php
M api/ApiViewFeedbackArticleFeedbackv5.php
10 files changed, 0 insertions(+), 49 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleFeedbackv5 
refs/changes/58/308358/1

diff --git a/ArticleFeedbackv5.flagging.php b/ArticleFeedbackv5.flagging.php
index 2715abd..7973db8 100644
--- a/ArticleFeedbackv5.flagging.php
+++ b/ArticleFeedbackv5.flagging.php
@@ -89,8 +89,6 @@
 *the error can be fetched through ->getError())
 */
public function run( $flag, $notes = '', $toggle = false, $source = 
'unknown' ) {
-   wfProfileIn( __METHOD__ . "-{$flag}" );
-
// check if feedback record exists
if ( !$this->feedback ) {
$this->error = 'articlefeedbackv5-invalid-feedback-id';
@@ -143,8 +141,6 @@
 
// update feedback entry for real
$this->feedback->update( false );
-
-   wfProfileOut( __METHOD__ . "-{$flag}" );
 
return true;
}
diff --git a/ArticleFeedbackv5.log.php b/ArticleFeedbackv5.log.php
index a1382b5..a6374de 100644
--- a/ArticleFeedbackv5.log.php
+++ b/ArticleFeedbackv5.log.php
@@ -20,8 +20,6 @@
 * @return int The id of the newly inserted log entry
 */
public static function log( $type, $pageId, $itemId, $notes, $doer, 
array $params = array() ) {
-   wfProfileIn( __METHOD__ );
-
global $wgLogActionsHandlers, 
$wgArticleFeedbackv5MaxActivityNoteLength, $wgLang;
 
if ( isset( 
ArticleFeedbackv5Activity::$actions[$type]['log_type'] ) ) {
@@ -31,14 +29,12 @@
// other AFTv5-related log entry (e.g. "create")
$logType = 'articlefeedbackv5';
} else {
-   wfProfileOut( __METHOD__ );
return null;
}
 
// fetch title of the page the feedback was given for: 
Special:ArticleFeedbackv5//
$pageTitle = Title::newFromID( $pageId );
if ( !$pageTitle ) {
-   wfProfileOut( __METHOD__ );
return null;
}
$target = SpecialPage::getTitleFor( 'ArticleFeedbackv5', 
$pageTitle->getPrefixedDBkey() . "/$itemId" );
@@ -75,8 +71,6 @@
 */
$wiki = false;
ArticleFeedbackv5Utils::$written[$wiki] = true;
-
-   wfProfileOut( __METHOD__ );
 
return $logId;
}
diff --git a/ArticleFeedbackv5.mailerJob.php b/ArticleFeedbackv5.mailerJob.php
index 784eb4b..d2df20c 100644
--- a/ArticleFeedbackv5.mailerJob.php
+++ b/ArticleFeedbackv5.mailerJob.php
@@ -45,8 +45,6 @@
 * @return boolean success
 */
function run() {
-   wfProfileIn( __METHOD__ );
-
global $wgArticleFeedbackv5OversightEmails, 
$wgArticleFeedbackv5OversightEmailName;
global $wgPasswordSender, $wgNoReplyAddress;
 
@@ -54,14 +52,12 @@
 
// if the oversight email address is empty we're going to just 
skip all this, but return true
if ( $wgArticleFeedbackv5OversightEmails === null ) {
-   wfProfileOut( __METHOD__ );
return true;
}
 
// if we don't have the right params set return false, job 
can't run
$missing = array_diff( $this->requiredParams, array_keys( 
$params ) );
if ( $missing ) {
-   wfProfileOut( __METHOD__ );
return false;
}
 
@@ -81,8 +77,6 @@
);
 
$status = UserMailer::send( $to, $from, $subject, $body, array( 
'replyTo' => $replyto ) );
-
-   wfProfileOut( __METHOD__ );
 
return $status->isOK();
}
diff --git a/api/ApiAddFlagNoteArticleFeedbackv5.php 
b/api/ApiAddFlagNoteArticleFeedbackv5.php
index d83e558..d5a2d8f 100644
--- a/api/ApiAddFlagNoteArticleFeedbackv5.php
+++ b/api/ApiAddFlagNoteArticleFeedbackv5.php
@@ -26,8 +26,6 @@
 * a piece of feedback
 */
public function execute() {
-   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix IDEA error in prepareQuickTemplate() call

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

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

Change subject: Fix IDEA error in prepareQuickTemplate() call
..

Fix IDEA error in prepareQuickTemplate() call

Change-Id: I5ee3424c55a499296bfd417ed1eda49a06d2c3f9
---
M includes/skins/SkinTemplate.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/57/308357/1

diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index b4be461..9e79c29 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -244,7 +244,7 @@
$out = $this->getOutput();
 
$this->initPage( $out );
-   $tpl = $this->prepareQuickTemplate( $out );
+   $tpl = $this->prepareQuickTemplate();
// execute template
$res = $tpl->execute();
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5ee3424c55a499296bfd417ed1eda49a06d2c3f9
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] operations/puppet[production]: statsd_proxy: Fix optional parameter listed before required ...

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

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

Change subject: statsd_proxy: Fix optional parameter listed before required 
parameter
..

statsd_proxy: Fix optional parameter listed before required parameter

Bug: T93645
Change-Id: I8bc0529c0e4e15df4d13ec483ae38241954c0b1f
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/56/308356/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: snapshot: Fix variable contains an uppercase letter

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

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

Change subject: snapshot: Fix variable contains an uppercase letter
..

snapshot: Fix variable contains an uppercase letter

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


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/55/308355/1


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

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

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: tools.py: add file_mode_checker()

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

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

Change subject: tools.py: add file_mode_checker()
..

tools.py: add file_mode_checker()

Implement a single function for file permission checks.

File permission check is currently done in http.py and login.py, with
code repetitions.

Tests added.

Change-Id: I47fc750a20b024fce4fad20c4c9a726170a25da0
---
M pywikibot/comms/http.py
M pywikibot/login.py
M pywikibot/tools/__init__.py
M tests/tools_tests.py
4 files changed, 69 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/54/308354/1

diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 0f6e083..c3acdbc 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -23,8 +23,6 @@
 __docformat__ = 'epytext'
 
 import atexit
-import os
-import stat
 import sys
 
 from distutils.version import StrictVersion
@@ -56,6 +54,7 @@
 from pywikibot.logging import critical, debug, error, log, warning
 from pywikibot.tools import (
 deprecate_arg,
+file_mode_checker,
 issue_deprecation_warning,
 PY2,
 StringTypes,
@@ -77,18 +76,6 @@
 config.socket_timeout = min(config.socket_timeout)
 
 
-def mode_check(filename):
-"""Check if filename has mode 600 and, if not, set it."""
-mode_600 = stat.S_IRUSR | stat.S_IWUSR
-warn_str = 'File {0} had no {1:o} mode; converted to {1:o} mode'
-st_mode = os.stat(filename).st_mode
-if stat.S_ISREG(st_mode) and (st_mode - stat.S_IFREG != mode_600):
-os.chmod(filename, mode_600)
-# re-read and check changes
-if os.stat(filename).st_mode != st_mode:
-pywikibot.warning(warn_str.format(filename, mode_600))
-
-
 def mode_check_decorator(func):
 """Decorate load()/save() CookieJar methods."""
 def wrapper(cls, **kwargs):
@@ -97,7 +84,7 @@
 except KeyError:
 filename = cls.filename
 res = func(cls, **kwargs)
-mode_check(filename)
+file_mode_checker(filename, mode=0o600)
 return res
 return wrapper
 
diff --git a/pywikibot/login.py b/pywikibot/login.py
index 4ce223b..e5de430 100644
--- a/pywikibot/login.py
+++ b/pywikibot/login.py
@@ -13,8 +13,9 @@
 #
 import codecs
 import os
-import stat
 import webbrowser
+
+from pywikibot.tools import file_mode_checker
 
 from warnings import warn
 
@@ -236,12 +237,8 @@
 if not os.path.isfile(password_file):
 password_file = config.password_file
 
-# We fix password file permission first,
-# lift upper permission (regular file) from st_mode
-# to compare it with private_files_permission.
-if os.stat(password_file).st_mode - stat.S_IFREG \
-!= config.private_files_permission:
-os.chmod(password_file, config.private_files_permission)
+# We fix password file permission first.
+file_mode_checker(password_file, mode=config.private_files_permission)
 
 password_f = codecs.open(password_file, encoding='utf-8')
 for line_nr, line in enumerate(password_f):
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index 5e4cb80..0390f9b 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -12,7 +12,9 @@
 import gzip
 import inspect
 import itertools
+import os
 import re
+import stat
 import subprocess
 import sys
 import threading
@@ -168,6 +170,7 @@
 
 
 class UnicodeMixin(object):
+
 """Mixin class to add __str__ method in Python 2 or 3."""
 
 @py2_encode_utf_8
@@ -1666,3 +1669,21 @@
 def open_compressed(filename, use_extension=False):
 """DEPRECATED: Open a file and uncompress it if needed."""
 return open_archive(filename, use_extension=use_extension)
+
+
+def file_mode_checker(filename, mode=0o600):
+"""Check file mode and update it, if needed.
+
+@param filename: filename path
+@type filename: basestring
+@param mode: requested file mode
+@type mode: int
+
+"""
+warn_str = 'File {0} had {1:o} mode; converted to {2:o} mode'
+st_mode = os.stat(filename).st_mode
+if stat.S_ISREG(st_mode) and (st_mode - stat.S_IFREG != mode):
+os.chmod(filename, mode)
+# re-read and check changes
+if os.stat(filename).st_mode != st_mode:
+warn(warn_str.format(filename, st_mode - stat.S_IFREG, mode))
diff --git a/tests/tools_tests.py b/tests/tools_tests.py
index b38048b..7cc17e9 100644
--- a/tests/tools_tests.py
+++ b/tests/tools_tests.py
@@ -12,6 +12,7 @@
 import collections
 import decimal
 import inspect
+import mock
 import os.path
 import subprocess
 import tempfile
@@ -675,6 +676,47 @@
 return inspect.getargspec(method)
 
 
+class TestFileModeChecker(TestCase):
+
+"""Test parsing password files."""
+
+net = False
+
+def patch(self, name):
+"""Patch up  in self.setUp."""
+patcher = 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Set autocomplete='off' to AuthManager forms

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

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

Change subject: Set autocomplete='off' to AuthManager forms
..

Set autocomplete='off' to AuthManager forms

AuthManager forms usually contain authentication relevant information,
which shouldn't be cached by the browser (such as usernames or any other
private information). E.g. for one-time-passwords, saving the codes doesn't
make much sense at all, as they're (like one would expect) only valid once.

This change sets the autocomplete='off' attribute to all forms generated by
AuthManager to say the browser not to save/show the previous values of an
input field.

Bug: T141735
Change-Id: Ib571de1d4bd3fa8cc7475108bfc215744145c1b8
---
M includes/specialpage/AuthManagerSpecialPage.php
M includes/specialpage/LoginSignupSpecialPage.php
2 files changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/includes/specialpage/AuthManagerSpecialPage.php 
b/includes/specialpage/AuthManagerSpecialPage.php
index 3adf5a6..2db2218 100644
--- a/includes/specialpage/AuthManagerSpecialPage.php
+++ b/includes/specialpage/AuthManagerSpecialPage.php
@@ -533,6 +533,7 @@
$context->setRequest( $this->getRequest() );
}
$form = HTMLForm::factory( 'ooui', $formDescriptor, $context );
+   $form->setAutocomplete( 'off' );
$form->setAction( $this->getFullTitle()->getFullURL( 
$this->getPreservedParams() ) );
$form->addHiddenField( $this->getTokenName(), 
$this->getToken()->toString() );
$form->addHiddenField( 'authAction', $this->authAction );
diff --git a/includes/specialpage/LoginSignupSpecialPage.php 
b/includes/specialpage/LoginSignupSpecialPage.php
index c3d43df..b0ed77f 100644
--- a/includes/specialpage/LoginSignupSpecialPage.php
+++ b/includes/specialpage/LoginSignupSpecialPage.php
@@ -595,6 +595,7 @@
}
$form = HTMLForm::factory( 'vform', $formDescriptor, $context );
 
+   $form->setAutocomplete( 'off' );
$form->addHiddenField( 'authAction', $this->authAction );
if ( $wgLoginLanguageSelector ) {
$form->addHiddenField( 'uselang', $this->mLanguage );

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

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

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


[MediaWiki-commits] [Gerrit] labs...stewardbots[master]: Update main page

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

Change subject: Update main page
..


Update main page

Change-Id: Ic3758653afd744b1a6435b9fc0694066736eb29d
---
M index.html
1 file changed, 11 insertions(+), 79 deletions(-)

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



diff --git a/index.html b/index.html
index 2590822..88948c8 100644
--- a/index.html
+++ b/index.html
@@ -2,8 +2,7 @@
 
 
Stewardbots Home - Wikimedia Labs
-   
-
+   
 
 
 
@@ -16,76 +15,7 @@
 
 
 
-Users with access
-
-The following is a list of users with access.
-
-
-   
-   
-   Username
-   IRC nick
-   
-   
-   https://meta.wikimedia.org/wiki/User:Barras;>Barras
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Billinghurst;>Billinghurst
-   sDrewth
-   
-   
-   https://meta.wikimedia.org/wiki/User:DerHexer;>DerHexer
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Jyothis;>Jyothis
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Linedwell;>Linedwell
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:M7;>M7
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:MarcoAurelio;>MarcoAurelio
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Matanya;>Matanya
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Melos;>Melos
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:MF-Warburg;>MF-Warburg
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Pathoschild;>Pathoschild
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Quentinv57;>Quentinv57
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Snowolf;>Snowolf
-   QueenOfFrance
-   
-   
-
-
-( indicates that they use the same 
IRC nick)
-
-You can reach them on the IRC channel#wikimedia-stewardsin the Freenode network, or on 
theirhttps://meta.wikimedia.org/wiki/Main_Page;>talk pages at 
Meta-Wiki. It is also possible to contact them by on-wiki email function 
and by IRC memo.
-
-List of tools
+List of tools
 
 Currently the following tools are avalaible:
 
@@ -96,24 +26,26 @@
https://tools.wmflabs.org/rightstool/cgi-bin/rightsstats;>Userrights 
statistics: Number of users with a specific right per project.
 
 
-Help pages for the bots
+Help pages for the bots
 
 
SULWatcher
StewardBot
 
 
-Code
+Code
 
-You can browse our code at our https://github.com/wikimedia/labs-tools-stewardbots;>GitHubrepository.
+You can browse our code at our https://phabricator.wikimedia.org/diffusion/TSTW/;>Phabricator 
repository or its mirror athttps://github.com/wikimedia/labs-tools-stewardbots;>GitHub.
 
-Bugs and suggestions
+Bugs and suggestions
 
 You can report bugs and suggestions at https://phabricator.wikimedia.org/maniphest/task/create/?projects=Tool-Labs-tools-stewardbots;>Phabricator.
 
 
-Powered by Wikimedia Labs
+
+
 
-https://tools.wmflabs.org/;>Return 
to main page
+https://tools.wmflabs.org/;>Return to 
main page  https://wikitech.wikimedia.org/wiki/Wikitech:Labs_Terms_of_use; 
target="_blank">Terms of Use
+
 
-
+
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic3758653afd744b1a6435b9fc0694066736eb29d
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/stewardbots
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio 
Gerrit-Reviewer: MarcoAurelio 
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...stewardbots[master]: Update main page

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

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

Change subject: Update main page
..

Update main page

Change-Id: Ic3758653afd744b1a6435b9fc0694066736eb29d
---
M index.html
1 file changed, 11 insertions(+), 79 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/stewardbots 
refs/changes/51/308351/1

diff --git a/index.html b/index.html
index 2590822..88948c8 100644
--- a/index.html
+++ b/index.html
@@ -2,8 +2,7 @@
 
 
Stewardbots Home - Wikimedia Labs
-   
-
+   
 
 
 
@@ -16,76 +15,7 @@
 
 
 
-Users with access
-
-The following is a list of users with access.
-
-
-   
-   
-   Username
-   IRC nick
-   
-   
-   https://meta.wikimedia.org/wiki/User:Barras;>Barras
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Billinghurst;>Billinghurst
-   sDrewth
-   
-   
-   https://meta.wikimedia.org/wiki/User:DerHexer;>DerHexer
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Jyothis;>Jyothis
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Linedwell;>Linedwell
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:M7;>M7
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:MarcoAurelio;>MarcoAurelio
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Matanya;>Matanya
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Melos;>Melos
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:MF-Warburg;>MF-Warburg
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Pathoschild;>Pathoschild
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Quentinv57;>Quentinv57
-   
-   
-   
-   https://meta.wikimedia.org/wiki/User:Snowolf;>Snowolf
-   QueenOfFrance
-   
-   
-
-
-( indicates that they use the same 
IRC nick)
-
-You can reach them on the IRC channel#wikimedia-stewardsin the Freenode network, or on 
theirhttps://meta.wikimedia.org/wiki/Main_Page;>talk pages at 
Meta-Wiki. It is also possible to contact them by on-wiki email function 
and by IRC memo.
-
-List of tools
+List of tools
 
 Currently the following tools are avalaible:
 
@@ -96,24 +26,26 @@
https://tools.wmflabs.org/rightstool/cgi-bin/rightsstats;>Userrights 
statistics: Number of users with a specific right per project.
 
 
-Help pages for the bots
+Help pages for the bots
 
 
SULWatcher
StewardBot
 
 
-Code
+Code
 
-You can browse our code at our https://github.com/wikimedia/labs-tools-stewardbots;>GitHubrepository.
+You can browse our code at our https://phabricator.wikimedia.org/diffusion/TSTW/;>Phabricator 
repository or its mirror athttps://github.com/wikimedia/labs-tools-stewardbots;>GitHub.
 
-Bugs and suggestions
+Bugs and suggestions
 
 You can report bugs and suggestions at https://phabricator.wikimedia.org/maniphest/task/create/?projects=Tool-Labs-tools-stewardbots;>Phabricator.
 
 
-Powered by Wikimedia Labs
+
+
 
-https://tools.wmflabs.org/;>Return 
to main page
+https://tools.wmflabs.org/;>Return to 
main page  https://wikitech.wikimedia.org/wiki/Wikitech:Labs_Terms_of_use; 
target="_blank">Terms of Use
+
 
-
+
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3758653afd744b1a6435b9fc0694066736eb29d
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/stewardbots
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: rsync: Fix variable contains an uppercase letter

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

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

Change subject: rsync: Fix variable contains an uppercase letter
..

rsync: Fix variable contains an uppercase letter

Bug: T93645
Change-Id: I60a8dcd232dac9d9b563c97285cb58534e962b73
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/50/308350/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: pybal: Fix optional parameter listed before required parameter

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

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

Change subject: pybal: Fix optional parameter listed before required parameter
..

pybal: Fix optional parameter listed before required parameter

Bug: T93645
Change-Id: I09cc342039205b3efa9ab2d511bca2abadf23445
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/49/308349/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: puppetmaster: Fix trailing whitespace found

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

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

Change subject: puppetmaster: Fix trailing whitespace found
..

puppetmaster: Fix trailing whitespace found

Bug: T93645
Change-Id: I387e75e3fe6b1ccc20d6e83e82d29b80c4b35e01
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/48/308348/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: puppetmaster: Fix indentation of =>

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

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

Change subject: puppetmaster: Fix indentation of =>
..

puppetmaster: Fix indentation of =>

Bug: T93645
Change-Id: I0eba3799f831a5a47f95c4f1ad42918b064db548
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/47/308347/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: openstack: Fix indentation of =>

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

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

Change subject: openstack: Fix indentation of =>
..

openstack: Fix indentation of =>

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


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/46/308346/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: openstack: Fix optional parameter listed before required par...

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

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

Change subject: openstack: Fix optional parameter listed before required 
parameter
..

openstack: Fix optional parameter listed before required parameter

Bug: T93645
Change-Id: I6d3a11e5ca311c8525d5a9c48a3cd58827972c05
---
0 files changed, 0 insertions(+), 0 deletions(-)


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


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: nagios_common: Fix optional parameter listed before required...

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

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

Change subject: nagios_common: Fix optional parameter listed before required 
parameter
..

nagios_common: Fix optional parameter listed before required parameter

Bug: T93645
Change-Id: I2b02c493f303ff2000e609635be660ce1e5257bf
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/44/308344/1


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

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

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [bugfix] omit mode 600 warning for non-unix platforms

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

Change subject: [bugfix] omit mode 600 warning for non-unix platforms
..


[bugfix] omit mode 600 warning for non-unix platforms

- mode 600 is availlable for unix platforms only.
  Therefor re-read the changes and inform the user.

Bug: T144157
Change-Id: I1bfac31cee201dbfe5b595fb7606663ec13f54f4
---
M pywikibot/comms/http.py
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 9fc29ae..0f6e083 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -84,7 +84,9 @@
 st_mode = os.stat(filename).st_mode
 if stat.S_ISREG(st_mode) and (st_mode - stat.S_IFREG != mode_600):
 os.chmod(filename, mode_600)
-pywikibot.warning(warn_str.format(filename, mode_600))
+# re-read and check changes
+if os.stat(filename).st_mode != st_mode:
+pywikibot.warning(warn_str.format(filename, mode_600))
 
 
 def mode_check_decorator(func):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1bfac31cee201dbfe5b595fb7606663ec13f54f4
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Merlijn van Deen 
Gerrit-Reviewer: Mpaa 
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]: mathoid: Fix variable contains an uppercase letter

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

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

Change subject: mathoid: Fix variable contains an uppercase letter
..

mathoid: Fix variable contains an uppercase letter

Bug: T93645
Change-Id: Ia04beeed56d8cda1d58af3692da00bc3e862f022
---
0 files changed, 0 insertions(+), 0 deletions(-)


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


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: lvs: Fix optional parameter listed before required parameter

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

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

Change subject: lvs: Fix optional parameter listed before required parameter
..

lvs: Fix optional parameter listed before required parameter

Bug: T93645
Change-Id: Ie946603eee038ac642501cdf559a75c0cb70b9c8
---
0 files changed, 0 insertions(+), 0 deletions(-)


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


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: lvs: Fix indentation of =>

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

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

Change subject: lvs: Fix indentation of =>
..

lvs: Fix indentation of =>

Bug: T93645
Change-Id: I42a704f38512a5e56f7d7fde3e1da170471e9432
---
0 files changed, 0 insertions(+), 0 deletions(-)


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


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs_dns: Fix optional parameter listed before required para...

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

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

Change subject: labs_dns: Fix optional parameter listed before required 
parameter
..

labs_dns: Fix optional parameter listed before required parameter

Bug: T93645
Change-Id: I77f2ae2b412aea7717f063f6267bf87465ac9deb
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/40/308340/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ganglia: Fix optional parameter listed before required param...

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

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

Change subject: ganglia: Fix optional parameter listed before required parameter
..

ganglia: Fix optional parameter listed before required parameter

Bug: T93645
Change-Id: Icf06eaba5964e34921b03aa90741770b30249656
---
0 files changed, 0 insertions(+), 0 deletions(-)


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


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: facilities: Fix variable contains an uppercase letter

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

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

Change subject: facilities: Fix variable contains an uppercase letter
..

facilities: Fix variable contains an uppercase letter

Bug: T93645
Change-Id: I0078f9eb6e3c357249b2d632395d740354cf7a67
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/38/308338/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: docker: Fix optional parameter listed before required parameter

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

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

Change subject: docker: Fix optional parameter listed before required parameter
..

docker: Fix optional parameter listed before required parameter

Bug: T93645
Change-Id: Iae18ce2681268be46852ed80f2787f531fc22f32
---
0 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/37/308337/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: deployment: Fix optional parameter listed before required pa...

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

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

Change subject: deployment: Fix optional parameter listed before required 
parameter
..

deployment: Fix optional parameter listed before required parameter

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


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


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

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

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [bugfix] omit mode 600 warning for non-linux platforms

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

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

Change subject: [bugfix] omit mode 600 warning for non-linux platforms
..

[bugfix] omit mode 600 warning for non-linux platforms

- mode 600 is availlable for linux platfroms only. Don't try to chmod
  for other operating systema.

Bug: T144157
Change-Id: I1bfac31cee201dbfe5b595fb7606663ec13f54f4
---
M pywikibot/comms/http.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/35/308335/1

diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 9fc29ae..9bc8c6f 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -95,7 +95,8 @@
 except KeyError:
 filename = cls.filename
 res = func(cls, **kwargs)
-mode_check(filename)
+if sys.platform.startswith('linux'):
+mode_check(filename)
 return res
 return wrapper
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bfac31cee201dbfe5b595fb7606663ec13f54f4
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt 

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


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Only call API if missing groups data

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

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

Change subject: Only call API if missing groups data
..

Only call API if missing groups data

Bug: T144670
Change-Id: I3cbe070d578056191581127573573b332b9e3c1f
---
M modules/box/Map.js
1 file changed, 16 insertions(+), 17 deletions(-)


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

diff --git a/modules/box/Map.js b/modules/box/Map.js
index fcb5d70..7d511aa 100644
--- a/modules/box/Map.js
+++ b/modules/box/Map.js
@@ -117,7 +117,7 @@
 * @private
 */
function getMapGroupData( dataGroups ) {
-   var deferred = $.Deferred(),
+   var apiPromise = $.Deferred(),
groupsLoaded = mw.config.get( 'wgKartographerLiveData' 
),
groupsToLoad = [],
promises = [];
@@ -134,31 +134,30 @@
if ( data === undefined ) {
groupsToLoad.push( value );
// Once loaded, this value will be replaced 
with the received data
-   groupsLoaded[ value ] = deferred.promise();
+   groupsLoaded[ value ] = apiPromise.promise();
} else if ( data !== null && $.isFunction( data.then ) 
) {
promises.push( data );
}
} );
 
if ( groupsToLoad.length ) {
-   promises.push( deferred.promise() );
+   new mw.Api().get( {
+   action: 'query',
+   formatversion: '2',
+   titles: mw.config.get( 'wgPageName' ),
+   prop: 'mapdata',
+   mpdgroups: groupsToLoad.join( '|' )
+   } ).done( function ( data ) {
+   var rawMapData = data.query.pages[ 0 ].mapdata,
+   mapData = rawMapData && JSON.parse( 
rawMapData ) || {};
+   $.extend( groupsLoaded, mapData );
+   apiPromise.resolve( groupsLoaded );
+   } );
+   promises.push( apiPromise.promise() );
}
if ( !promises.length ) {
-   return deferred.resolve( groupsLoaded ).promise();
+   return apiPromise.resolve( groupsLoaded ).promise();
}
-
-   new mw.Api().get( {
-   action: 'query',
-   formatversion: '2',
-   titles: mw.config.get( 'wgPageName' ),
-   prop: 'mapdata',
-   mpdgroups: groupsToLoad.join( '|' )
-   } ).done( function ( data ) {
-   var rawMapData = data.query.pages[ 0 ].mapdata,
-   mapData = rawMapData && JSON.parse( rawMapData 
) || {};
-   $.extend( groupsLoaded, mapData );
-   deferred.resolve( groupsLoaded );
-   } );
 
return $.when.apply( $, promises ).then( function () {
// All pending promises are done

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3cbe070d578056191581127573573b332b9e3c1f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: Yurik 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: cgred: Fix indentation of =>

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

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

Change subject: cgred: Fix indentation of =>
..

cgred: Fix indentation of =>

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


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/33/308333/1


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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Typo in a test: '+' instead of '.' to concatenate strings

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

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

Change subject: Typo in a test: '+' instead of '.' to concatenate strings
..

Typo in a test: '+' instead of '.' to concatenate strings

I found it by executing tests with PHP 7.1.0RC1, but even
if PHP 7.1.0 is still a RC, this is a typo in PHP language.

Change-Id: Ia97f881f8c80a23c51512189d9ca5a012612c532
---
M tests/phpunit/includes/filerepo/file/FileTest.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/32/308332/1

diff --git a/tests/phpunit/includes/filerepo/file/FileTest.php 
b/tests/phpunit/includes/filerepo/file/FileTest.php
index c5fd369..6520610 100644
--- a/tests/phpunit/includes/filerepo/file/FileTest.php
+++ b/tests/phpunit/includes/filerepo/file/FileTest.php
@@ -206,7 +206,7 @@
] ],
[ [
'supportsBucketing' => true,
-   'tmpBucketedThumbCache' => [ 1024 => 
'/tmp/shouldnotexist' + rand() ],
+   'tmpBucketedThumbCache' => [ 1024 => 
'/tmp/shouldnotexist' . rand() ],
'thumbnailBucket' => 1024,
'physicalWidth' => 2048,
'expectedPath' => 'fsFilePath',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Make flushDeferredQueue() not try to commit the transaction ...

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

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

Change subject: Make flushDeferredQueue() not try to commit the transaction 
round
..

Make flushDeferredQueue() not try to commit the transaction round

It will flush the jobs to the main PRESEND queue instead.
Trying to run deferred updates here causes DBTransactionError
in LBFactory::beginMasterChanges().

Maintenance scripts already try to run jobs in various points,
so is not likely to be a build up problem (it even queues some
updates as Jobs if the buffer is too big). Nevertheless, call
DeferredUpdates::tryOpportunisticExecute() after adding the
jobs to main queue, in case they *can* safely be run.

Change-Id: Id1bf70c586fd06d4fda94721e60fed982441bee5
---
M includes/Import/Importer.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/31/308331/1

diff --git a/includes/Import/Importer.php b/includes/Import/Importer.php
index 1cff2fa..f320ac6 100644
--- a/includes/Import/Importer.php
+++ b/includes/Import/Importer.php
@@ -430,9 +430,12 @@
 
protected function flushDeferredQueue() {
while ( !$this->deferredQueue->isEmpty() ) {
-   DeferredUpdates::addCallableUpdate( 
$this->deferredQueue->dequeue() );
+   DeferredUpdates::addCallableUpdate(
+   $this->deferredQueue->dequeue(),
+   DeferredUpdates::PRESEND
+   );
+   DeferredUpdates::tryOpportunisticExecute();
}
-   DeferredUpdates::doUpdates();
}
 
protected function clearDeferredQueue() {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make replication DB-related comments/message more uniform

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

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

Change subject: Make replication DB-related comments/message more uniform
..

Make replication DB-related comments/message more uniform

Change-Id: If04254aad085c05d2a6b6588b4c9b55a1736110d
---
M includes/db/ChronologyProtector.php
M includes/db/Database.php
M includes/db/DatabaseMysqlBase.php
M includes/db/DatabaseUtility.php
M includes/db/IDatabase.php
M includes/db/loadbalancer/LBFactory.php
M includes/db/loadbalancer/LoadBalancer.php
7 files changed, 55 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/30/308330/1

diff --git a/includes/db/ChronologyProtector.php 
b/includes/db/ChronologyProtector.php
index 2539b87..b4619f3 100644
--- a/includes/db/ChronologyProtector.php
+++ b/includes/db/ChronologyProtector.php
@@ -79,9 +79,9 @@
 * Initialise a LoadBalancer to give it appropriate chronology 
protection.
 *
 * If the stash has a previous master position recorded, this will try 
to
-* make sure that the next query to a slave of that master will see 
changes up
+* make sure that the next query to a replica DB of that master will 
see changes up
 * to that position by delaying execution. The delay may timeout and 
allow stale
-* data if no non-lagged slaves are available.
+* data if no non-lagged replica DBs are available.
 *
 * @param LoadBalancer $lb
 * @return void
diff --git a/includes/db/Database.php b/includes/db/Database.php
index 0a660d9..5b0f230 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -2908,7 +2908,7 @@
$this->mTrxWriteAdjQueryCount = 0;
$this->mTrxWriteCallers = [];
// First SELECT after BEGIN will establish the snapshot in 
REPEATABLE-READ.
-   // Get an estimate of the slave lag before then, treating 
estimate staleness
+   // Get an estimate of the replica DB lag before then, treating 
estimate staleness
// as lag itself just to be safe
$status = $this->getApproximateLagStatus();
$this->mTrxSlaveLag = $status['lag'] + ( microtime( true ) - 
$status['since'] );
@@ -3194,7 +3194,7 @@
}
 
/**
-* Get the slave lag when the current transaction started
+* Get the replica DB lag when the current transaction started
 *
 * This is useful when transactions might use snapshot isolation
 * (e.g. REPEATABLE-READ in innodb), so the "real" lag of that data
@@ -3211,7 +3211,7 @@
}
 
/**
-* Get a slave lag estimate for this server
+* Get a replica DB lag estimate for this server
 *
 * @return array ('lag': seconds or false on error, 'since': UNIX 
timestamp of estimate)
 * @since 1.27
diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/db/DatabaseMysqlBase.php
index 93814d2..3c383e3 100644
--- a/includes/db/DatabaseMysqlBase.php
+++ b/includes/db/DatabaseMysqlBase.php
@@ -32,9 +32,9 @@
 abstract class DatabaseMysqlBase extends Database {
/** @var MysqlMasterPos */
protected $lastKnownSlavePos;
-   /** @var string Method to detect slave lag */
+   /** @var string Method to detect replica DB lag */
protected $lagDetectionMethod;
-   /** @var array Method to detect slave lag */
+   /** @var array Method to detect replica DB lag */
protected $lagDetectionOptions = [];
/** @var bool bool Whether to use GTID methods */
protected $useGTIDs = false;
@@ -695,7 +695,7 @@
$key = $cache->makeGlobalKey(
'mysql',
'master-info',
-   // Using one key for all cluster slaves is preferable
+   // Using one key for all cluster replica DBs is 
preferable
$this->getLBInfo( 'clusterMasterHost' ) ?: 
$this->getServer()
);
 
@@ -797,7 +797,7 @@
if ( $status === null ) {
// T126436: jobs programmed to wait on master positions 
might be referencing binlogs
// with an old master hostname. Such calls make 
MASTER_POS_WAIT() return null. Try
-   // to detect this and treat the slave as having reached 
the position; a proper master
+   // to detect this and treat the replica DB as having 
reached the position; a proper master
// switchover already requires that the new master be 
caught up before the switch.
$slavePos = $this->getSlavePos();
if ( $slavePos && !$slavePos->channelsMatch( $pos ) ) {
diff --git a/includes/db/DatabaseUtility.php b/includes/db/DatabaseUtility.php
index b6c37ee..aeaa27f 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make deferred updates fully own their transaction rounds

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

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

Change subject: Make deferred updates fully own their transaction rounds
..

Make deferred updates fully own their transaction rounds

This will matter when commitMasterChanges() enforcement is tighter.
For now, any thing can still call that method anytime.

Change-Id: I0b08e9e9118a6c6118c117e3856d0a8e0ca3d457
---
M includes/deferred/DeferredUpdates.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/308329/1

diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index 24c7930..8de7cd9 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -221,9 +221,10 @@
private static function runUpdate( DeferrableUpdate $update, LBFactory 
$lbFactory, $stage ) {
$guiError = null;
try {
-   $lbFactory->beginMasterChanges( __METHOD__ );
+   $fnameTrxOwner = get_class( $update ) . '::doUpdate';
+   $lbFactory->beginMasterChanges( $fnameTrxOwner );
$update->doUpdate();
-   $lbFactory->commitMasterChanges( __METHOD__ );
+   $lbFactory->commitMasterChanges( $fnameTrxOwner );
} catch ( Exception $e ) {
// Reporting GUI exceptions does not work post-send
if ( $e instanceof ErrorPageError && $stage === 
self::PRESEND ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b08e9e9118a6c6118c117e3856d0a8e0ca3d457
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] operations/puppet[production]: aqs and restbase: Fix variable contains an uppercase letter

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

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

Change subject: aqs and restbase: Fix variable contains an uppercase letter
..

aqs and restbase: Fix variable contains an uppercase letter

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


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/28/308328/1


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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add caching to Title::loadRestrictions()

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

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

Change subject: Add caching to Title::loadRestrictions()
..

Add caching to Title::loadRestrictions()

Change-Id: Id9dac9b67cf969cddaaa8d412cb7fd033146f17d
---
M includes/Title.php
1 file changed, 41 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/26/308326/1

diff --git a/includes/Title.php b/includes/Title.php
index 2021e0a..0674c38 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -2849,23 +2849,6 @@
}
 
/**
-* Loads a string into mRestrictions array
-*
-* @param ResultWrapper $res Resource restrictions as an SQL result.
-* @param string $oldFashionedRestrictions Comma-separated list of page
-*restrictions from page table (pre 1.10)
-*/
-   private function loadRestrictionsFromResultWrapper( $res, 
$oldFashionedRestrictions = null ) {
-   $rows = [];
-
-   foreach ( $res as $row ) {
-   $rows[] = $row;
-   }
-
-   $this->loadRestrictionsFromRows( $rows, 
$oldFashionedRestrictions );
-   }
-
-   /**
 * Compiles list of active page restrictions from both page table (pre 
1.10)
 * and page_restrictions table for this existing page.
 * Public for usage by LiquidThreads.
@@ -2948,36 +2931,52 @@
 *   restrictions from page table (pre 1.10)
 */
public function loadRestrictions( $oldFashionedRestrictions = null ) {
-   if ( !$this->mRestrictionsLoaded ) {
-   $dbr = wfGetDB( DB_SLAVE );
-   if ( $this->exists() ) {
-   $res = $dbr->select(
-   'page_restrictions',
-   [ 'pr_type', 'pr_expiry', 'pr_level', 
'pr_cascade' ],
-   [ 'pr_page' => $this->getArticleID() ],
-   __METHOD__
-   );
+   if ( $this->mRestrictionsLoaded ) {
+   return;
+   }
 
-   $this->loadRestrictionsFromResultWrapper( $res, 
$oldFashionedRestrictions );
-   } else {
-   $title_protection = $this->getTitleProtection();
+   $dbr = wfGetDB( DB_SLAVE );
 
-   if ( $title_protection ) {
-   $now = wfTimestampNow();
-   $expiry = $dbr->decodeExpiry( 
$title_protection['expiry'] );
+   $id = $this->getArticleID();
+   if ( $id ) {
+   $cache = ObjectCache::getMainWANInstance();
+   $rows = $cache->getWithSetCallback(
+   $cache->makeKey( 'page-restrictions', $id, 
$this->getTouched() ),
+   $cache::TTL_DAY,
+   function ( $curValue, &$ttl, array &$setOpts ) 
use ( $dbr ) {
+   $setOpts += 
Database::getCacheSetOptions( $dbr );
 
-   if ( !$expiry || $expiry > $now ) {
-   // Apply the restrictions
-   
$this->mRestrictionsExpiry['create'] = $expiry;
-   $this->mRestrictions['create'] 
= explode( ',', trim( $title_protection['permission'] ) );
-   } else { // Get rid of the old 
restrictions
-   $this->mTitleProtection = false;
-   }
-   } else {
-   $this->mRestrictionsExpiry['create'] = 
'infinity';
+   return iterator_to_array(
+   $dbr->select(
+   'page_restrictions',
+   [ 'pr_type', 
'pr_expiry', 'pr_level', 'pr_cascade' ],
+   [ 'pr_page' => 
$this->getArticleID() ],
+   __METHOD__
+   )
+   );
}
-   $this->mRestrictionsLoaded = true;
+   );
+
+   $this->loadRestrictionsFromRows( $rows, 
$oldFashionedRestrictions );
+   } else {
+   $title_protection = $this->getTitleProtection();
+
+   if ( $title_protection ) 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: http.py: create/convert pywikibot.lwp file to 600

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

Change subject: http.py: create/convert pywikibot.lwp file to 600
..


http.py: create/convert pywikibot.lwp file to 600

cookielib.LWPCookieJar is subclassed to check file mode when saving or
loading.

pywikibot.lwp file is created with 600 mode or converted to 600 mode if
other permissions are present.

Bug: T144157
Change-Id: I493c7ed4a5b5184302bdaa6612005b4ff6418386
---
M pywikibot/comms/http.py
1 file changed, 44 insertions(+), 3 deletions(-)

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



diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index 5ae05de..9fc29ae 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -14,7 +14,7 @@
 from __future__ import absolute_import, print_function, unicode_literals
 
 #
-# (C) Pywikibot team, 2007-2015
+# (C) Pywikibot team, 2007-2016
 #
 # Distributed under the terms of the MIT license.
 #
@@ -23,6 +23,8 @@
 __docformat__ = 'epytext'
 
 import atexit
+import os
+import stat
 import sys
 
 from distutils.version import StrictVersion
@@ -74,8 +76,47 @@
 'two.')
 config.socket_timeout = min(config.socket_timeout)
 
-cookie_jar = cookielib.LWPCookieJar(
-config.datafilepath('pywikibot.lwp'))
+
+def mode_check(filename):
+"""Check if filename has mode 600 and, if not, set it."""
+mode_600 = stat.S_IRUSR | stat.S_IWUSR
+warn_str = 'File {0} had no {1:o} mode; converted to {1:o} mode'
+st_mode = os.stat(filename).st_mode
+if stat.S_ISREG(st_mode) and (st_mode - stat.S_IFREG != mode_600):
+os.chmod(filename, mode_600)
+pywikibot.warning(warn_str.format(filename, mode_600))
+
+
+def mode_check_decorator(func):
+"""Decorate load()/save() CookieJar methods."""
+def wrapper(cls, **kwargs):
+try:
+filename = kwargs['filename']
+except KeyError:
+filename = cls.filename
+res = func(cls, **kwargs)
+mode_check(filename)
+return res
+return wrapper
+
+
+# in PY2 cookielib.LWPCookieJar is not a new-style class.
+class PywikibotCookieJar(cookielib.LWPCookieJar, object):
+
+"""CookieJar which checks file permissions."""
+
+@mode_check_decorator
+def load(self, **kwargs):
+"""Load cookies from file."""
+super(PywikibotCookieJar, self).load()
+
+@mode_check_decorator
+def save(self, **kwargs):
+"""Save cookies to file."""
+super(PywikibotCookieJar, self).save()
+
+
+cookie_jar = PywikibotCookieJar(config.datafilepath('pywikibot.lwp'))
 try:
 cookie_jar.load()
 except (IOError, cookielib.LoadError):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I493c7ed4a5b5184302bdaa6612005b4ff6418386
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Merlijn van Deen 
Gerrit-Reviewer: Mpaa 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Archive Extension:ApiSandbox on ZUUL

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

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

Change subject: Archive Extension:ApiSandbox on ZUUL
..

Archive Extension:ApiSandbox on ZUUL

Bug: T127012
Change-Id: I0d59d294d2fd2a80a64afe6dc5dc2ef7359b1ac3
---
M zuul/layout.yaml
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/25/308325/1

diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 866459a..1f58c10 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2570,7 +2570,11 @@
   - name: mediawiki/extensions/APC
 template:
   - name: archived
-
+ 
+  - name: mediawiki/extensions/ApiSandbox
+template:
+  - name: archived
+ 
   - name: mediawiki/extensions/ApprovedRevs
 template:
   - name: jshint

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...LinkFilter[master]: [SECURITY] Version 3.3: add CSRF protection into the API mod...

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: [SECURITY] Version 3.3: add CSRF protection into the API module 
and the special pages which perform write actions
..


[SECURITY] Version 3.3: add CSRF protection into the API module and the special 
pages which perform write actions

Also swapped jQuery to $ in the JS file and fixed a bug in
Special:LinkEdit where the redirection to Special:LinkSubmit wasn't always
working.

Change-Id: I39f619f620325911bccd12d60c2a19df50315fd6
---
M ApiLinkFilter.php
M LinkFilter.js
M SpecialLinkEdit.php
M SpecialLinkSubmit.php
M extension.json
5 files changed, 53 insertions(+), 36 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/ApiLinkFilter.php b/ApiLinkFilter.php
index 9a8836a..bc05091 100644
--- a/ApiLinkFilter.php
+++ b/ApiLinkFilter.php
@@ -63,6 +63,14 @@
return true;
}
 
+   public function needsToken() {
+   return 'csrf';
+   }
+
+   public function isWriteMode() {
+   return true;
+   }
+
/**
 * @return String: human-readable module description
 */
diff --git a/LinkFilter.js b/LinkFilter.js
index 46eeeb7..54f14fb 100644
--- a/LinkFilter.js
+++ b/LinkFilter.js
@@ -3,7 +3,6 @@
  *
  * @file
  * @author Jack Phoenix 
- * @date 9 August 2015
  */
 var LinkFilter = {
/**
@@ -14,28 +13,25 @@
 * @param {Number} ID of the link to approve or reject
 */
linkAction: function( action, link_id ) {
-   jQuery( 'div.action-buttons-1' ).hide();
+   $( 'div.action-buttons-1' ).hide();
 
-   jQuery.post(
-   mw.util.wikiScript( 'api' ), {
-   action: 'linkfilter',
-   id: link_id,
-   status: action,
-   format: 'json'
-   },
-   function( data ) {
-   var msg;
-   switch ( action ) {
-   case 1:
-   msg = mw.msg( 
'linkfilter-admin-accept-success' );
-   break;
-   case 2:
-   msg = mw.msg( 
'linkfilter-admin-reject-success' );
-   break;
-   }
-   jQuery( '#action-buttons-' + link_id ).html( 
msg ).show( 1000 );
+   ( new mw.Api() ).postWithToken( 'edit', {
+   action: 'linkfilter',
+   id: link_id,
+   status: action,
+   format: 'json'
+   } ).done( function( data ) {
+   var msg;
+   switch ( action ) {
+   case 1:
+   msg = mw.msg( 
'linkfilter-admin-accept-success' );
+   break;
+   case 2:
+   msg = mw.msg( 
'linkfilter-admin-reject-success' );
+   break;
}
-   );
+   $( '#action-buttons-' + link_id ).html( msg ).show( 
1000 );
+   } );
},
 
/**
@@ -91,28 +87,28 @@
}
 };
 
-jQuery( document ).ready( function() {
+$( document ).ready( function() {
// "Accept" links on Special:LinkApprove
-   jQuery( 'a.action-accept' ).click( function() {
-   var that = jQuery( this );
+   $( 'a.action-accept' ).click( function() {
+   var that = $( this );
LinkFilter.linkAction( 1, that.data( 'link-id' ) );
} );
 
// "Reject" links on Special:LinkApprove
-   jQuery( 'a.action-reject' ).click( function() {
-   var that = jQuery( this );
+   $( 'a.action-reject' ).click( function() {
+   var that = $( this );
LinkFilter.linkAction( 2, that.data( 'link-id' ) );
} );
 
// Textarea on Special:LinkEdit/Special:LinkSubmit
-   jQuery( 'textarea.lr-input' ).bind( 'keyup', function() {
+   $( 'textarea.lr-input' ).bind( 'keyup', function() {
LinkFilter.limitText( document.link.lf_desc, 300 );
} ).bind( 'keydown', function() {
LinkFilter.limitText( document.link.lf_desc, 300 );
} );
 
// Submit button on Special:LinkEdit/Special:LinkSubmit
-   jQuery( '#link-submit-button' ).click( function() {
+   $( '#link-submit-button' ).click( function() {
LinkFilter.submitLink();
} );
 } );
\ No newline at end of 

[MediaWiki-commits] [Gerrit] mediawiki...LinkFilter[master]: [SECURITY] Version 3.3: add CSRF protection into the API mod...

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: [SECURITY] Version 3.3: add CSRF protection into the API module 
and the special pages which perform write actions
..

[SECURITY] Version 3.3: add CSRF protection into the API module and the special 
pages which perform write actions

Also swapped jQuery to $ in the JS file and fixed a bug in
Special:LinkEdit where the redirection to Special:LinkSubmit wasn't always
working.

Change-Id: I39f619f620325911bccd12d60c2a19df50315fd6
---
M ApiLinkFilter.php
M LinkFilter.js
M SpecialLinkEdit.php
M SpecialLinkSubmit.php
M extension.json
5 files changed, 53 insertions(+), 36 deletions(-)


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

diff --git a/ApiLinkFilter.php b/ApiLinkFilter.php
index 9a8836a..bc05091 100644
--- a/ApiLinkFilter.php
+++ b/ApiLinkFilter.php
@@ -63,6 +63,14 @@
return true;
}
 
+   public function needsToken() {
+   return 'csrf';
+   }
+
+   public function isWriteMode() {
+   return true;
+   }
+
/**
 * @return String: human-readable module description
 */
diff --git a/LinkFilter.js b/LinkFilter.js
index 46eeeb7..54f14fb 100644
--- a/LinkFilter.js
+++ b/LinkFilter.js
@@ -3,7 +3,6 @@
  *
  * @file
  * @author Jack Phoenix 
- * @date 9 August 2015
  */
 var LinkFilter = {
/**
@@ -14,28 +13,25 @@
 * @param {Number} ID of the link to approve or reject
 */
linkAction: function( action, link_id ) {
-   jQuery( 'div.action-buttons-1' ).hide();
+   $( 'div.action-buttons-1' ).hide();
 
-   jQuery.post(
-   mw.util.wikiScript( 'api' ), {
-   action: 'linkfilter',
-   id: link_id,
-   status: action,
-   format: 'json'
-   },
-   function( data ) {
-   var msg;
-   switch ( action ) {
-   case 1:
-   msg = mw.msg( 
'linkfilter-admin-accept-success' );
-   break;
-   case 2:
-   msg = mw.msg( 
'linkfilter-admin-reject-success' );
-   break;
-   }
-   jQuery( '#action-buttons-' + link_id ).html( 
msg ).show( 1000 );
+   ( new mw.Api() ).postWithToken( 'edit', {
+   action: 'linkfilter',
+   id: link_id,
+   status: action,
+   format: 'json'
+   } ).done( function( data ) {
+   var msg;
+   switch ( action ) {
+   case 1:
+   msg = mw.msg( 
'linkfilter-admin-accept-success' );
+   break;
+   case 2:
+   msg = mw.msg( 
'linkfilter-admin-reject-success' );
+   break;
}
-   );
+   $( '#action-buttons-' + link_id ).html( msg ).show( 
1000 );
+   } );
},
 
/**
@@ -91,28 +87,28 @@
}
 };
 
-jQuery( document ).ready( function() {
+$( document ).ready( function() {
// "Accept" links on Special:LinkApprove
-   jQuery( 'a.action-accept' ).click( function() {
-   var that = jQuery( this );
+   $( 'a.action-accept' ).click( function() {
+   var that = $( this );
LinkFilter.linkAction( 1, that.data( 'link-id' ) );
} );
 
// "Reject" links on Special:LinkApprove
-   jQuery( 'a.action-reject' ).click( function() {
-   var that = jQuery( this );
+   $( 'a.action-reject' ).click( function() {
+   var that = $( this );
LinkFilter.linkAction( 2, that.data( 'link-id' ) );
} );
 
// Textarea on Special:LinkEdit/Special:LinkSubmit
-   jQuery( 'textarea.lr-input' ).bind( 'keyup', function() {
+   $( 'textarea.lr-input' ).bind( 'keyup', function() {
LinkFilter.limitText( document.link.lf_desc, 300 );
} ).bind( 'keydown', function() {
LinkFilter.limitText( document.link.lf_desc, 300 );
} );
 
// Submit button on Special:LinkEdit/Special:LinkSubmit
-   jQuery( '#link-submit-button' ).click( function() {
+   $( '#link-submit-button' ).click( function() {

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [bugfix] Bot class arguments for constructor

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

Change subject: [bugfix] Bot class arguments for constructor
..


[bugfix] Bot class arguments for constructor

Bot class arguments for constructor should be called as keyword argument

Bot class handles 'site' and ' always' as keyword arguments. In replace.py
instantiating the bot uses postional argument which breaks this rule and
derived bots may be break if not all (positional) arguments are given.

- instantiate ReplaceRobot with keyword arguments for 'always' and 'site'
  handled by bot class to allow other bots to use this special bot.
- catch them with **kwargs
- remove unused and deprecated acceptall variable
- change parameter description for ReplaceRobot constructor, markup for epydoc
- move __init__ doc to class because doc strings of hidden methods aren't
  shown in epydoc's documentation.
- this also solves the 2nd warning issue of 
https://gerrit.wikimedia.org/r/#/c/266321/

Bug: T125046
Bug: T125049
Change-Id: I23570783fda9f497a6f57aaa8f5e17895534af50
---
M scripts/replace.py
1 file changed, 51 insertions(+), 47 deletions(-)

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



diff --git a/scripts/replace.py b/scripts/replace.py
index 48fd15d..e03d935 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -128,7 +128,7 @@
 """
 #
 # (C) Daniel Herding, 2004-2012
-# (C) Pywikibot team, 2004-2015
+# (C) Pywikibot team, 2004-2016
 #
 # Distributed under the terms of the MIT license.
 #
@@ -494,53 +494,58 @@
 
 class ReplaceRobot(Bot):
 
-"""A bot that can do text replacements."""
+"""A bot that can do text replacements.
+
+@param generator: generator that yields Page objects
+@type generator: generator
+@param replacements: a list of Replacement instances or sequences of
+length 2 with the  original text (as a compiled regular expression)
+and replacement text (as a string).
+@type replacements: list
+@param exceptions: a dictionary which defines when not to change an
+occurrence. This dictionary can have these keys:
+
+title
+A list of regular expressions. All pages with titles that
+are matched by one of these regular expressions are skipped.
+text-contains
+A list of regular expressions. All pages with text that
+contains a part which is matched by one of these regular
+expressions are skipped.
+inside
+A list of regular expressions. All occurrences are skipped which
+lie within a text region which is matched by one of these
+regular expressions.
+inside-tags
+A list of strings. These strings must be keys from the
+exceptionRegexes dictionary in textlib.replaceExcept().
+
+@type exceptions: dict
+@param allowoverlap: when matches overlap, all of them are replaced.
+@type allowoverlap: bool
+@param recursive: Recurse replacement as long as possible.
+@type recursice: bool
+@warning: Be careful, this might lead to an infinite loop.
+@param addedCat: category to be added to every page touched
+@type addedCat: pywikibot.Category or str or None
+@param sleep: slow down between processing multiple regexes
+@type sleep: int
+@param summary: Set the summary message text bypassing the default
+@type summary: str
+@keyword always: the user won't be prompted before changes are made
+@type keyword: bool
+@keyword site: Site the bot is working on.
+@warning: site parameter should be passed to constructor.
+Otherwise the bot takes the current site and warns the operator
+about the missing site
+"""
 
 @deprecated_args(acceptall='always')
 def __init__(self, generator, replacements, exceptions={},
- always=False, allowoverlap=False, recursive=False,
- addedCat=None, sleep=None, summary='', site=None, **kwargs):
-"""
-Constructor.
-
-Arguments:
-* generator- A generator that yields Page objects.
-* replacements - A list of Replacement instances or sequences of
- length 2 with the  original text (as a compiled
- regular expression) and replacement text (as a
- string).
-* exceptions   - A dictionary which defines when not to change an
- occurrence. See below.
-* always   - If True, the user won't be prompted before changes
- are made.
-* allowoverlap - If True, when matches overlap, all of them are
- replaced.
-* addedCat - If set to a value, add this category to every page
- touched.
- It can be a string or a 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [bugfix] Solve flake8 F999 doctests

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

Change subject: [bugfix] Solve flake8 F999 doctests
..


[bugfix] Solve flake8 F999 doctests

There where repeated keys in the same dictionary. The last key has been kept.

Bug: T144662
Bug: T115929
Change-Id: I607d162ad8c3bbfa634da776629f628c73e417cd
---
M pywikibot/date.py
M pywikibot/userinterfaces/transliteration.py
2 files changed, 4 insertions(+), 7 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  Xqt: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/pywikibot/date.py b/pywikibot/date.py
index c3cb04c..23009fe 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -1112,7 +1112,6 @@
 'DecadeAD': {
 'als': lambda v: dh_decAD(v, u'%der'),
 'ar': lambda v: dh_decAD(v, u'%d عقد'),
-'ast': lambda v: dh_decAD(v, u'Años %d'),
 'ang': lambda v: dh_decAD(v, u'%de'),
 'ast': lambda v: dh_decAD(v, u'Años %d'),
 'bg': lambda v: dh_decAD(v, u'%d-те'),
@@ -1223,7 +1222,6 @@
   lambda ii: (ii[1] - 1) * 100 + ii[0]),
  alwaysTrue)]),
 'pt': lambda v: dh_decAD(v, u'Década de %d'),
-'ro': lambda v: dh_decAD(v, u'Anii %d'),
 'ro': lambda m: multi(m, [
 (lambda v: dh_constVal(v, 0, u'Primul deceniu d.Hr.'),
  lambda p: p == 0),
@@ -1922,9 +1920,8 @@
 'ko': lambda v: dh_singVal(v, u'요즘 화제'),
 'ksh': lambda v: dh_singVal(v, u'Et Neuste'),
 'ku': lambda v: dh_singVal(v, u'Bûyerên rojane'),
-'la': lambda v: dh_singVal(v, u'Novissima'),
-'lb': lambda v: dh_singVal(v, u'Aktualitéit'),
 'la': lambda v: dh_singVal(v, u"Nuntii"),
+'lb': lambda v: dh_singVal(v, u'Aktualitéit'),
 'li': lambda v: dh_singVal(v, u"In 't nuujs"),
 'mn': lambda v: dh_singVal(v, u'Мэдээ'),
 'nl': lambda v: dh_singVal(v, u'In het nieuws'),
diff --git a/pywikibot/userinterfaces/transliteration.py 
b/pywikibot/userinterfaces/transliteration.py
index e1fac31..3d2ded4 100644
--- a/pywikibot/userinterfaces/transliteration.py
+++ b/pywikibot/userinterfaces/transliteration.py
@@ -296,18 +296,18 @@
u"І": u"I", u"і": u"i", u"Ї": u"Ji", u"ї": u"ji",
u"Є": u"Je", u"є": u"je", u"Ґ": u"G", u"Ҝ": u"G",
u"ґ": u"g", u"ҝ": u"g", u"Ђ": u"Dj", u"ђ": u"dj",
-   u"Ӣ": u"Y", u"ӣ": u"y", u"Љ": u"Lj", u"љ": u"lj",
+   "Љ": "Lj", "љ": "lj",
u"Њ": u"Nj", u"њ": u"nj", u"Ћ": u"Cj", u"ћ": u"cj",
u"Җ": u"Zhj", u"җ": u"zhj", u"Ѓ": u"Gj", u"ѓ": 
u"gj",
u"Ќ": u"Kj", u"ќ": u"kj", u"Ӣ": u"Ii", u"ӣ": u"ii",
-   u"Ӯ": u"U", u"ӯ": u"u", u"Ҳ": u"H", u"ҳ": u"h",
+   "Ҳ": "H", "ҳ": "h",
u"Ҷ": u"Dz", u"ҷ": u"dz", u"Ө": u"Ô", u"Ӫ": u"Ô",
u"ө": u"ô", u"ӫ": u"ô", u"Ү": u"Y", u"ү": u"y", 
u"Һ": u"H",
u"һ": u"h", u"Ә": u"AE", u"Ӕ": u"AE", u"ә": u"ae",
u"Ӛ": u"Ë", u"Ӭ": u"Ë", u"ӛ": u"ë", u"ӭ": u"ë", 
u"Җ": u"Zhj",
u"җ": u"zhj", u"Ұ": u"U", u"ұ": u"u", u"ў": u"ù", 
u"Ў": u"Ù",
u"ѝ": u"ì", u"Ѝ": u"Ì", u"Ӑ": u"A", u"ă": u"a", 
u"Ӓ": u"Ä",
-   u"ҿ": u"ä", u"Ҽ": u"Ts", u"Ҿ": u"Ts", u"ҽ": u"ts", 
u"ҿ": u"ts",
+   "Ҽ": "Ts", "Ҿ": "Ts", "ҽ": "ts", "ҿ": "ts",
u"Ҙ": u"Dh", u"ҙ": u"dh", u"Ӏ": u"", u"ӏ": u"", 
u"Ӆ": u"L",
u"ӆ": u"l", u"Ӎ": u"M", u"ӎ": u"m", u"Ӧ": u"Ö", 
u"ӧ": u"ö",
u"Ҩ": u"u", u"ҩ": u"u", u"Ҧ": u"Ph", u"ҧ": u"ph", 
u"Ҏ": u"R",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I607d162ad8c3bbfa634da776629f628c73e417cd
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Merlijn van Deen 
Gerrit-Reviewer: Mpaa 
Gerrit-Reviewer: Xqt 
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...UnusedRedirects[master]: Initial commit of a new extension

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: Initial commit of a new extension
..


Initial commit of a new extension

Bug: T144245
Change-Id: I682db8d14eeeb53b136a12ef6a79bc7353478b7d
---
A SpecialUnusedRedirects.php
A UnusedRedirects.alias.php
A extension.json
A i18n/en.json
A i18n/fi.json
A i18n/fr.json
6 files changed, 266 insertions(+), 0 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/SpecialUnusedRedirects.php b/SpecialUnusedRedirects.php
new file mode 100644
index 000..0119fcd
--- /dev/null
+++ b/SpecialUnusedRedirects.php
@@ -0,0 +1,188 @@
+.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup SpecialPage
+ * @author Jack Phoenix 
+ * @date 30 August 2016
+ * @see https://phabricator.wikimedia.org/T144245
+ */
+
+/**
+ * @ingroup SpecialPage
+ */
+class UnusedRedirectsPage extends QueryPage {
+   function __construct( $name = 'UnusedRedirects' ) {
+   parent::__construct( $name );
+   }
+
+   public function isExpensive() {
+   return true;
+   }
+
+   function getPageHeader() {
+   return $this->msg( 'unusedredirects-text' )->parseAsBlock();
+   }
+
+   public function getQueryInfo() {
+   return [
+   'tables' => [
+   'p1' => 'page',
+   'redirect',
+   'p2' => 'page',
+   'pagelinks',
+   ],
+   'fields' => [
+   'namespace' => 'p1.page_namespace',
+   'title' => 'p1.page_title',
+   'value' => 'p1.page_title',
+   'rd_namespace',
+   'rd_title',
+   'rd_fragment',
+   'rd_interwiki',
+   'redirid' => 'p2.page_id',
+   ],
+   'conds' => [
+   'p1.page_is_redirect' => 1,
+   'pl_from IS NULL'
+   ],
+   'join_conds' => [
+   'redirect' => [ 'LEFT JOIN', 'rd_from = 
p1.page_id' ],
+   'p2' => [ 'LEFT JOIN', [
+   'p2.page_namespace = rd_namespace',
+   'p2.page_title = rd_title' ]
+   ],
+   'pagelinks' => [ 'LEFT JOIN', 'pl_title = 
p1.page_title' ]
+   ]
+   ];
+   }
+
+   function getOrderFields() {
+   return [ 'p1.page_namespace', 'p1.page_title' ];
+   }
+
+   /**
+* Cache page existence for performance
+*
+* @param IDatabase $db
+* @param ResultWrapper $res
+*/
+   function preprocessResults( $db, $res ) {
+   if ( !$res->numRows() ) {
+   return;
+   }
+
+   $batch = new LinkBatch;
+   foreach ( $res as $row ) {
+   $batch->add( $row->namespace, $row->title );
+   $batch->addObj( $this->getRedirectTarget( $row ) );
+   }
+   $batch->execute();
+
+   // Back to start for display
+   $res->seek( 0 );
+   }
+
+   protected function getRedirectTarget( $row ) {
+   if ( isset( $row->rd_title ) ) {
+   // ashley: added the below checks, the core code (w/o 
'em) was
+   // returning weird results locally (things which were 
*not* supposed
+   // to be formatted like interwiki links were formatted 
like IW links)
+   // Seems that this breaks the display of fragments 
though, I'm not
+   // sure why, but it's not a big deal IMHO.
+   $fragment = $interwiki = '';
+   if ( isset( $row->rd_fragment ) 

[MediaWiki-commits] [Gerrit] mediawiki...UnusedRedirects[master]: Initial commit of a new extension

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: Initial commit of a new extension
..

Initial commit of a new extension

Bug: T144245
Change-Id: I682db8d14eeeb53b136a12ef6a79bc7353478b7d
---
A SpecialUnusedRedirects.php
A UnusedRedirects.alias.php
A extension.json
A i18n/en.json
A i18n/fi.json
A i18n/fr.json
6 files changed, 266 insertions(+), 0 deletions(-)


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

diff --git a/SpecialUnusedRedirects.php b/SpecialUnusedRedirects.php
new file mode 100644
index 000..0119fcd
--- /dev/null
+++ b/SpecialUnusedRedirects.php
@@ -0,0 +1,188 @@
+.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup SpecialPage
+ * @author Jack Phoenix 
+ * @date 30 August 2016
+ * @see https://phabricator.wikimedia.org/T144245
+ */
+
+/**
+ * @ingroup SpecialPage
+ */
+class UnusedRedirectsPage extends QueryPage {
+   function __construct( $name = 'UnusedRedirects' ) {
+   parent::__construct( $name );
+   }
+
+   public function isExpensive() {
+   return true;
+   }
+
+   function getPageHeader() {
+   return $this->msg( 'unusedredirects-text' )->parseAsBlock();
+   }
+
+   public function getQueryInfo() {
+   return [
+   'tables' => [
+   'p1' => 'page',
+   'redirect',
+   'p2' => 'page',
+   'pagelinks',
+   ],
+   'fields' => [
+   'namespace' => 'p1.page_namespace',
+   'title' => 'p1.page_title',
+   'value' => 'p1.page_title',
+   'rd_namespace',
+   'rd_title',
+   'rd_fragment',
+   'rd_interwiki',
+   'redirid' => 'p2.page_id',
+   ],
+   'conds' => [
+   'p1.page_is_redirect' => 1,
+   'pl_from IS NULL'
+   ],
+   'join_conds' => [
+   'redirect' => [ 'LEFT JOIN', 'rd_from = 
p1.page_id' ],
+   'p2' => [ 'LEFT JOIN', [
+   'p2.page_namespace = rd_namespace',
+   'p2.page_title = rd_title' ]
+   ],
+   'pagelinks' => [ 'LEFT JOIN', 'pl_title = 
p1.page_title' ]
+   ]
+   ];
+   }
+
+   function getOrderFields() {
+   return [ 'p1.page_namespace', 'p1.page_title' ];
+   }
+
+   /**
+* Cache page existence for performance
+*
+* @param IDatabase $db
+* @param ResultWrapper $res
+*/
+   function preprocessResults( $db, $res ) {
+   if ( !$res->numRows() ) {
+   return;
+   }
+
+   $batch = new LinkBatch;
+   foreach ( $res as $row ) {
+   $batch->add( $row->namespace, $row->title );
+   $batch->addObj( $this->getRedirectTarget( $row ) );
+   }
+   $batch->execute();
+
+   // Back to start for display
+   $res->seek( 0 );
+   }
+
+   protected function getRedirectTarget( $row ) {
+   if ( isset( $row->rd_title ) ) {
+   // ashley: added the below checks, the core code (w/o 
'em) was
+   // returning weird results locally (things which were 
*not* supposed
+   // to be formatted like interwiki links were formatted 
like IW links)
+   // Seems that this breaks the display of fragments 
though, I'm not
+   // sure why, but it's not a big deal IMHO.
+   $fragment 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: role: move mediawiki::install to autoloader layout

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

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

Change subject: role: move mediawiki::install to autoloader layout
..

role: move mediawiki::install to autoloader layout

Bug: T93645
Change-Id: Id2c0f5212add1b6e80cc83ecedbef9c17db165c3
---
R modules/role/manifests/deprecated/mediawiki/install.pp
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/22/308322/1

diff --git a/modules/role/manifests/deprecated/mediawiki.pp 
b/modules/role/manifests/deprecated/mediawiki/install.pp
similarity index 100%
rename from modules/role/manifests/deprecated/mediawiki.pp
rename to modules/role/manifests/deprecated/mediawiki/install.pp

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...LinkFilter[master]: Split the ext.linkFilter RL module into two separate modules...

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: Split the ext.linkFilter RL module into two separate modules, 
one for CSS and another for JS
..


Split the ext.linkFilter RL module into two separate modules, one for CSS and 
another for JS

Change-Id: I4a5b390a6ca3c305d5cccf48f7f9c61940992fcb
---
M LinkFilterHooks.php
M SpecialLinkApprove.php
M SpecialLinkEdit.php
M SpecialLinkSubmit.php
M SpecialLinksHome.php
M extension.json
6 files changed, 16 insertions(+), 10 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/LinkFilterHooks.php b/LinkFilterHooks.php
index f7d7386..2f4cd11 100644
--- a/LinkFilterHooks.php
+++ b/LinkFilterHooks.php
@@ -88,7 +88,7 @@
$wgSupressSubTitle = true;
 
// Add CSS
-   $wgOut->addModuleStyles( 'ext.linkFilter' );
+   $wgOut->addModuleStyles( 'ext.linkFilter.styles' );
 
$article = new LinkPage( $title );
}
@@ -117,7 +117,7 @@
 
// Add CSS (ParserOutput class only has addModules(), not
// addModuleStyles() or addModuleScripts()...strange)
-   $wgOut->addModuleStyles( 'ext.linkFilter' );
+   $wgOut->addModuleStyles( 'ext.linkFilter.styles' );
 
if ( isset( $args['count'] ) ) {
$count = intval( $args['count'] );
@@ -237,8 +237,7 @@
 * @return Boolean: true
 */
public static function applySchemaChanges( $updater ) {
-   $dir = dirname( __FILE__ );
-   $file = "$dir/link.sql";
+   $file = __DIR__ . '/link.sql';
$updater->addExtensionUpdate( array( 'addTable', 'link', $file, 
true ) );
return true;
}
diff --git a/SpecialLinkApprove.php b/SpecialLinkApprove.php
index d09a5ba..ec4ee6e 100644
--- a/SpecialLinkApprove.php
+++ b/SpecialLinkApprove.php
@@ -117,7 +117,8 @@
$out->setPageTitle( $this->msg( 'linkfilter-approve-title' 
)->plain() );
 
// Add CSS & JS
-   $out->addModules( 'ext.linkFilter' );
+   $out->addModuleStyles( 'ext.linkFilter.styles' );
+   $out->addModules( 'ext.linkFilter.scripts' );
 
$output = '';
 
diff --git a/SpecialLinkEdit.php b/SpecialLinkEdit.php
index 0265e4a..197d8c8 100644
--- a/SpecialLinkEdit.php
+++ b/SpecialLinkEdit.php
@@ -37,7 +37,8 @@
}
 
// Add CSS & JS
-   $out->addModules( 'ext.linkFilter' );
+   $out->addModuleStyles( 'ext.linkFilter.styles' );
+   $out->addModules( 'ext.linkFilter.scripts' );
 
if ( $request->wasPosted() && $_SESSION['alreadysubmitted'] == 
false ) {
$_SESSION['alreadysubmitted'] = true;
diff --git a/SpecialLinkSubmit.php b/SpecialLinkSubmit.php
index 9f56b44..2e8060f 100644
--- a/SpecialLinkSubmit.php
+++ b/SpecialLinkSubmit.php
@@ -41,7 +41,8 @@
}
 
// Add CSS & JS (JS is required by displayAddForm())
-   $out->addModules( 'ext.linkFilter' );
+   $out->addModuleStyles( 'ext.linkFilter.styles' );
+   $out->addModules( 'ext.linkFilter.scripts' );
 
// If the request was POSTed and we haven't already submitted 
it, start
// processing it
diff --git a/SpecialLinksHome.php b/SpecialLinksHome.php
index 6a8eabe..8b4e268 100644
--- a/SpecialLinksHome.php
+++ b/SpecialLinksHome.php
@@ -156,7 +156,8 @@
$wgSupressPageTitle = true;
 
// Add CSS & JS
-   $out->addModules( 'ext.linkFilter' );
+   $out->addModuleStyles( 'ext.linkFilter.styles' );
+   $out->addModules( 'ext.linkFilter.scripts' );
 
$per_page = 20;
$page = $request->getInt( 'page', 1 );
diff --git a/extension.json b/extension.json
index 8aee40a..10a37ee 100644
--- a/extension.json
+++ b/extension.json
@@ -113,15 +113,18 @@
"remoteExtPath": "LinkFilter"
},
"ResourceModules": {
-   "ext.linkFilter": {
+   "ext.linkFilter.styles": {
"styles": "LinkFilter.css",
+   "position": "top"
+   },
+   "ext.linkFilter.scripts": {
"scripts": "LinkFilter.js",
"messages": [
"linkfilter-admin-accept-success", 
"linkfilter-admin-reject-success",
"linkfilter-submit-no-title", 
"linkfilter-submit-no-type",
"linkfilter-submit-no-desc", 
"linkfilter-submit-no-url"
],
-   "position": "top"
+   "position": "bottom"
}
   

[MediaWiki-commits] [Gerrit] mediawiki...LinkFilter[master]: Split the ext.linkFilter RL module into two separate modules...

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: Split the ext.linkFilter RL module into two separate modules, 
one for CSS and another for JS
..

Split the ext.linkFilter RL module into two separate modules, one for CSS and 
another for JS

Change-Id: I4a5b390a6ca3c305d5cccf48f7f9c61940992fcb
---
M LinkFilterHooks.php
M SpecialLinkApprove.php
M SpecialLinkEdit.php
M SpecialLinkSubmit.php
M SpecialLinksHome.php
M extension.json
6 files changed, 16 insertions(+), 10 deletions(-)


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

diff --git a/LinkFilterHooks.php b/LinkFilterHooks.php
index f7d7386..2f4cd11 100644
--- a/LinkFilterHooks.php
+++ b/LinkFilterHooks.php
@@ -88,7 +88,7 @@
$wgSupressSubTitle = true;
 
// Add CSS
-   $wgOut->addModuleStyles( 'ext.linkFilter' );
+   $wgOut->addModuleStyles( 'ext.linkFilter.styles' );
 
$article = new LinkPage( $title );
}
@@ -117,7 +117,7 @@
 
// Add CSS (ParserOutput class only has addModules(), not
// addModuleStyles() or addModuleScripts()...strange)
-   $wgOut->addModuleStyles( 'ext.linkFilter' );
+   $wgOut->addModuleStyles( 'ext.linkFilter.styles' );
 
if ( isset( $args['count'] ) ) {
$count = intval( $args['count'] );
@@ -237,8 +237,7 @@
 * @return Boolean: true
 */
public static function applySchemaChanges( $updater ) {
-   $dir = dirname( __FILE__ );
-   $file = "$dir/link.sql";
+   $file = __DIR__ . '/link.sql';
$updater->addExtensionUpdate( array( 'addTable', 'link', $file, 
true ) );
return true;
}
diff --git a/SpecialLinkApprove.php b/SpecialLinkApprove.php
index d09a5ba..ec4ee6e 100644
--- a/SpecialLinkApprove.php
+++ b/SpecialLinkApprove.php
@@ -117,7 +117,8 @@
$out->setPageTitle( $this->msg( 'linkfilter-approve-title' 
)->plain() );
 
// Add CSS & JS
-   $out->addModules( 'ext.linkFilter' );
+   $out->addModuleStyles( 'ext.linkFilter.styles' );
+   $out->addModules( 'ext.linkFilter.scripts' );
 
$output = '';
 
diff --git a/SpecialLinkEdit.php b/SpecialLinkEdit.php
index 0265e4a..197d8c8 100644
--- a/SpecialLinkEdit.php
+++ b/SpecialLinkEdit.php
@@ -37,7 +37,8 @@
}
 
// Add CSS & JS
-   $out->addModules( 'ext.linkFilter' );
+   $out->addModuleStyles( 'ext.linkFilter.styles' );
+   $out->addModules( 'ext.linkFilter.scripts' );
 
if ( $request->wasPosted() && $_SESSION['alreadysubmitted'] == 
false ) {
$_SESSION['alreadysubmitted'] = true;
diff --git a/SpecialLinkSubmit.php b/SpecialLinkSubmit.php
index 9f56b44..2e8060f 100644
--- a/SpecialLinkSubmit.php
+++ b/SpecialLinkSubmit.php
@@ -41,7 +41,8 @@
}
 
// Add CSS & JS (JS is required by displayAddForm())
-   $out->addModules( 'ext.linkFilter' );
+   $out->addModuleStyles( 'ext.linkFilter.styles' );
+   $out->addModules( 'ext.linkFilter.scripts' );
 
// If the request was POSTed and we haven't already submitted 
it, start
// processing it
diff --git a/SpecialLinksHome.php b/SpecialLinksHome.php
index 6a8eabe..8b4e268 100644
--- a/SpecialLinksHome.php
+++ b/SpecialLinksHome.php
@@ -156,7 +156,8 @@
$wgSupressPageTitle = true;
 
// Add CSS & JS
-   $out->addModules( 'ext.linkFilter' );
+   $out->addModuleStyles( 'ext.linkFilter.styles' );
+   $out->addModules( 'ext.linkFilter.scripts' );
 
$per_page = 20;
$page = $request->getInt( 'page', 1 );
diff --git a/extension.json b/extension.json
index 8aee40a..10a37ee 100644
--- a/extension.json
+++ b/extension.json
@@ -113,15 +113,18 @@
"remoteExtPath": "LinkFilter"
},
"ResourceModules": {
-   "ext.linkFilter": {
+   "ext.linkFilter.styles": {
"styles": "LinkFilter.css",
+   "position": "top"
+   },
+   "ext.linkFilter.scripts": {
"scripts": "LinkFilter.js",
"messages": [
"linkfilter-admin-accept-success", 
"linkfilter-admin-reject-success",
"linkfilter-submit-no-title", 
"linkfilter-submit-no-type",
"linkfilter-submit-no-desc", 
"linkfilter-submit-no-url"
],
-   "position": 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: labstore: ignore autoloader layout lint error

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

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

Change subject: labstore: ignore autoloader layout lint error
..

labstore: ignore autoloader layout lint error

labstore::drbd has a few defines that are used to ensure uniquness of
resources.  Even if they do not match the autoloader layout, there is
probably no point in having each in a standalone .pp file.

Bug: T93645
Change-Id: I46ca1bb6363abc81ce199726277b5a292a1f1651
---
M modules/labstore/manifests/drbd/resource.pp
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/20/308320/1

diff --git a/modules/labstore/manifests/drbd/resource.pp 
b/modules/labstore/manifests/drbd/resource.pp
index 2cc0d76..2f68b73 100644
--- a/modules/labstore/manifests/drbd/resource.pp
+++ b/modules/labstore/manifests/drbd/resource.pp
@@ -89,6 +89,7 @@
 }
 }
 
+# lint:ignore:autoloader_layout
 define labstore::drbd::resource::port {
 }
 
@@ -97,3 +98,4 @@
 
 define labstore::drbd::resource::disk {
 }
+# lint:endignore

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

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

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [bugfix] Solve flake8 F999 doctests

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

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

Change subject: [bugfix] Solve flake8 F999 doctests
..

[bugfix] Solve flake8 F999 doctests

There where repeated keys in the same dictionary. The last key has been kept.

Bug: T144664
Change-Id: I607d162ad8c3bbfa634da776629f628c73e417cd
---
M pywikibot/date.py
M pywikibot/userinterfaces/transliteration.py
2 files changed, 4 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/19/308319/1

diff --git a/pywikibot/date.py b/pywikibot/date.py
index c3cb04c..23009fe 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -1112,7 +1112,6 @@
 'DecadeAD': {
 'als': lambda v: dh_decAD(v, u'%der'),
 'ar': lambda v: dh_decAD(v, u'%d عقد'),
-'ast': lambda v: dh_decAD(v, u'Años %d'),
 'ang': lambda v: dh_decAD(v, u'%de'),
 'ast': lambda v: dh_decAD(v, u'Años %d'),
 'bg': lambda v: dh_decAD(v, u'%d-те'),
@@ -1223,7 +1222,6 @@
   lambda ii: (ii[1] - 1) * 100 + ii[0]),
  alwaysTrue)]),
 'pt': lambda v: dh_decAD(v, u'Década de %d'),
-'ro': lambda v: dh_decAD(v, u'Anii %d'),
 'ro': lambda m: multi(m, [
 (lambda v: dh_constVal(v, 0, u'Primul deceniu d.Hr.'),
  lambda p: p == 0),
@@ -1922,9 +1920,8 @@
 'ko': lambda v: dh_singVal(v, u'요즘 화제'),
 'ksh': lambda v: dh_singVal(v, u'Et Neuste'),
 'ku': lambda v: dh_singVal(v, u'Bûyerên rojane'),
-'la': lambda v: dh_singVal(v, u'Novissima'),
-'lb': lambda v: dh_singVal(v, u'Aktualitéit'),
 'la': lambda v: dh_singVal(v, u"Nuntii"),
+'lb': lambda v: dh_singVal(v, u'Aktualitéit'),
 'li': lambda v: dh_singVal(v, u"In 't nuujs"),
 'mn': lambda v: dh_singVal(v, u'Мэдээ'),
 'nl': lambda v: dh_singVal(v, u'In het nieuws'),
diff --git a/pywikibot/userinterfaces/transliteration.py 
b/pywikibot/userinterfaces/transliteration.py
index e1fac31..3d2ded4 100644
--- a/pywikibot/userinterfaces/transliteration.py
+++ b/pywikibot/userinterfaces/transliteration.py
@@ -296,18 +296,18 @@
u"І": u"I", u"і": u"i", u"Ї": u"Ji", u"ї": u"ji",
u"Є": u"Je", u"є": u"je", u"Ґ": u"G", u"Ҝ": u"G",
u"ґ": u"g", u"ҝ": u"g", u"Ђ": u"Dj", u"ђ": u"dj",
-   u"Ӣ": u"Y", u"ӣ": u"y", u"Љ": u"Lj", u"љ": u"lj",
+   "Љ": "Lj", "љ": "lj",
u"Њ": u"Nj", u"њ": u"nj", u"Ћ": u"Cj", u"ћ": u"cj",
u"Җ": u"Zhj", u"җ": u"zhj", u"Ѓ": u"Gj", u"ѓ": 
u"gj",
u"Ќ": u"Kj", u"ќ": u"kj", u"Ӣ": u"Ii", u"ӣ": u"ii",
-   u"Ӯ": u"U", u"ӯ": u"u", u"Ҳ": u"H", u"ҳ": u"h",
+   "Ҳ": "H", "ҳ": "h",
u"Ҷ": u"Dz", u"ҷ": u"dz", u"Ө": u"Ô", u"Ӫ": u"Ô",
u"ө": u"ô", u"ӫ": u"ô", u"Ү": u"Y", u"ү": u"y", 
u"Һ": u"H",
u"һ": u"h", u"Ә": u"AE", u"Ӕ": u"AE", u"ә": u"ae",
u"Ӛ": u"Ë", u"Ӭ": u"Ë", u"ӛ": u"ë", u"ӭ": u"ë", 
u"Җ": u"Zhj",
u"җ": u"zhj", u"Ұ": u"U", u"ұ": u"u", u"ў": u"ù", 
u"Ў": u"Ù",
u"ѝ": u"ì", u"Ѝ": u"Ì", u"Ӑ": u"A", u"ă": u"a", 
u"Ӓ": u"Ä",
-   u"ҿ": u"ä", u"Ҽ": u"Ts", u"Ҿ": u"Ts", u"ҽ": u"ts", 
u"ҿ": u"ts",
+   "Ҽ": "Ts", "Ҿ": "Ts", "ҽ": "ts", "ҿ": "ts",
u"Ҙ": u"Dh", u"ҙ": u"dh", u"Ӏ": u"", u"ӏ": u"", 
u"Ӆ": u"L",
u"ӆ": u"l", u"Ӎ": u"M", u"ӎ": u"m", u"Ӧ": u"Ö", 
u"ӧ": u"ö",
u"Ҩ": u"u", u"ҩ": u"u", u"Ҧ": u"Ph", u"ҧ": u"ph", 
u"Ҏ": u"R",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I607d162ad8c3bbfa634da776629f628c73e417cd
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt 

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


[MediaWiki-commits] [Gerrit] mediawiki...LinkFilter[master]: Update RandomGameUnit calls so that the random game units di...

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: Update RandomGameUnit calls so that the random game units 
display when the master version of RandomGameUnit ext. is installed
..


Update RandomGameUnit calls so that the random game units display when the 
master version of RandomGameUnit ext. is installed

Change-Id: Id58ff2696e2425707f83e0d720854265493b0b48
---
M LinkPage.php
M SpecialLinksHome.php
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/LinkPage.php b/LinkPage.php
index 5d25e49..bd5f191 100644
--- a/LinkPage.php
+++ b/LinkPage.php
@@ -323,8 +323,8 @@
return '';
}
 
-   if ( function_exists( 'wfGetRandomGameUnit' ) ) {
-   return wfGetRandomGameUnit();
+   if ( class_exists( 'RandomGameUnit' ) ) {
+   return RandomGameUnit::getRandomGameUnit();
} else {
return '';
}
diff --git a/SpecialLinksHome.php b/SpecialLinksHome.php
index d9cf7ab..6a8eabe 100644
--- a/SpecialLinksHome.php
+++ b/SpecialLinksHome.php
@@ -102,8 +102,8 @@
 * @return HTML or nothing
 */
function getRandomCasualGame() {
-   if ( function_exists( 'wfGetRandomGameUnit' ) ) {
-   return wfGetRandomGameUnit();
+   if ( class_exists( 'RandomGameUnit' ) ) {
+   return RandomGameUnit::getRandomGameUnit();
} else {
return '';
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id58ff2696e2425707f83e0d720854265493b0b48
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LinkFilter
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 
Gerrit-Reviewer: Jack Phoenix 

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


[MediaWiki-commits] [Gerrit] mediawiki...LinkFilter[master]: Update RandomGameUnit calls so that the random game units di...

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: Update RandomGameUnit calls so that the random game units 
display when the master version of RandomGameUnit ext. is installed
..

Update RandomGameUnit calls so that the random game units display when the 
master version of RandomGameUnit ext. is installed

Change-Id: Id58ff2696e2425707f83e0d720854265493b0b48
---
M LinkPage.php
M SpecialLinksHome.php
2 files changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/LinkPage.php b/LinkPage.php
index 5d25e49..bd5f191 100644
--- a/LinkPage.php
+++ b/LinkPage.php
@@ -323,8 +323,8 @@
return '';
}
 
-   if ( function_exists( 'wfGetRandomGameUnit' ) ) {
-   return wfGetRandomGameUnit();
+   if ( class_exists( 'RandomGameUnit' ) ) {
+   return RandomGameUnit::getRandomGameUnit();
} else {
return '';
}
diff --git a/SpecialLinksHome.php b/SpecialLinksHome.php
index d9cf7ab..6a8eabe 100644
--- a/SpecialLinksHome.php
+++ b/SpecialLinksHome.php
@@ -102,8 +102,8 @@
 * @return HTML or nothing
 */
function getRandomCasualGame() {
-   if ( function_exists( 'wfGetRandomGameUnit' ) ) {
-   return wfGetRandomGameUnit();
+   if ( class_exists( 'RandomGameUnit' ) ) {
+   return RandomGameUnit::getRandomGameUnit();
} else {
return '';
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id58ff2696e2425707f83e0d720854265493b0b48
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LinkFilter
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix 

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


[MediaWiki-commits] [Gerrit] mediawiki...LinkFilter[master]: Deprecate (but don't remove) the PHP entry point, LinkFilter...

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has submitted this change and it was merged.

Change subject: Deprecate (but don't remove) the PHP entry point, 
LinkFilter.php, in favor of extension.json
..


Deprecate (but don't remove) the PHP entry point, LinkFilter.php, in favor of 
extension.json

MediaWiki 1.25+ is thus explicitly required.

Change-Id: I19c141fecf0e383df7b45d179fb039ad9e793b8a
---
M LinkFilter.php
1 file changed, 11 insertions(+), 112 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/LinkFilter.php b/LinkFilter.php
index 8dc1791..99eda45 100644
--- a/LinkFilter.php
+++ b/LinkFilter.php
@@ -12,115 +12,14 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
-// Extension credits that will show up on Special:Version
-$wgExtensionCredits['other'][] = array(
-   'path' => __FILE__,
-   'name' => 'LinkFilter',
-   'version' => '3.2.2',
-   'author' => array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ),
-   'descriptionmsg' => 'linkfilter-desc',
-   'url' => 'https://www.mediawiki.org/wiki/Extension:LinkFilter'
-);
-
-// ResourceLoader support for MediaWiki 1.17+
-$wgResourceModules['ext.linkFilter'] = array(
-   'styles' => 'LinkFilter.css',
-   'scripts' => 'LinkFilter.js',
-   'messages' => array(
-   'linkfilter-admin-accept-success', 
'linkfilter-admin-reject-success',
-   'linkfilter-submit-no-title', 'linkfilter-submit-no-type',
-   'linkfilter-submit-no-desc', 'linkfilter-submit-no-url'
-   ),
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'LinkFilter',
-   'position' => 'top' // available since r85616
-);
-
-// Define some constants (for namespaces)
-define( 'NS_LINK', 700 );
-define( 'NS_LINK_TALK', 701 );
-
-// Array of LinkFilter types
-// Key is: number => 'description'
-// For example: 2 => 'Awesome',
-$wgLinkFilterTypes = array(
-   1 => 'Arrest Report',
-   2 => 'Awesome',
-   3 => 'Cool',
-   4 => 'Funny',
-   6 => 'Interesting',
-   7 => 'Obvious',
-   8 => 'OMG WTF?!?',
-   9 => 'Rumor',
-   10 => 'Scary',
-   11 => 'Stupid',
-);
-
-// Internationalization files
-$wgMessagesDirs['LinkFilter'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['LinkFilterAlias'] = __DIR__ . '/Link.alias.php';
-// Namespace translations
-$wgExtensionMessagesFiles['LinkNamespaces'] = __DIR__ . '/Link.namespaces.php';
-
-// Some base classes to be autoloaded
-$wgAutoloadClasses['Link'] = __DIR__ . '/LinkClass.php';
-$wgAutoloadClasses['LinkList'] = __DIR__ . '/LinkClass.php';
-$wgAutoloadClasses['LinkPage'] = __DIR__ . '/LinkPage.php';
-
-// RSS feed class used on Special:LinksHome (replaces the hardcoded feed)
-$wgAutoloadClasses['LinkFeed'] = __DIR__ . '/LinkFeed.php';
-
-// Special pages
-$wgAutoloadClasses['LinksHome'] = __DIR__ . '/SpecialLinksHome.php';
-$wgSpecialPages['LinksHome'] = 'LinksHome';
-
-$wgAutoloadClasses['LinkSubmit'] = __DIR__ . '/SpecialLinkSubmit.php';
-$wgSpecialPages['LinkSubmit'] = 'LinkSubmit';
-
-$wgAutoloadClasses['LinkRedirect'] = __DIR__ . '/SpecialLinkRedirect.php';
-$wgSpecialPages['LinkRedirect'] = 'LinkRedirect';
-
-$wgAutoloadClasses['LinkApprove'] = __DIR__ . '/SpecialLinkApprove.php';
-$wgSpecialPages['LinkApprove'] = 'LinkApprove';
-
-$wgAutoloadClasses['LinkEdit'] = __DIR__ . '/SpecialLinkEdit.php';
-$wgSpecialPages['LinkEdit'] = 'LinkEdit';
-
-// API module used by the JavaScript file
-$wgAutoloadClasses['ApiLinkFilter'] = __DIR__ . '/ApiLinkFilter.php';
-$wgAPIModules['linkfilter'] = 'ApiLinkFilter';
-
-// Default setup for displaying sections
-$wgLinkPageDisplay = array(
-   'leftcolumn' => true,
-   'rightcolumn' => false,
-   'author' => true,
-   'left_ad' => false,
-   'popular_articles' => false,
-   'in_the_news' => false,
-   'comments_of_day' => true,
-   'games' => true,
-   'new_links' => false
-);
-
-// New user right, which is required to approve user-submitted links
-$wgAvailableRights[] = 'linkadmin';
-$wgGroupPermissions['linkadmin']['linkadmin'] = true;
-$wgGroupPermissions['staff']['linkadmin'] = true;
-$wgGroupPermissions['sysop']['linkadmin'] = true;
-
-// Hooked functions
-$wgAutoloadClasses['LinkFilterHooks'] = __DIR__ . '/LinkFilterHooks.php';
-
-// Hooked function registrations
-$wgHooks['TitleMoveComplete'][] = 'LinkFilterHooks::updateLinkFilter';
-$wgHooks['ArticleDelete'][] = 'LinkFilterHooks::deleteLinkFilter';
-$wgHooks['ArticleFromTitle'][] = 'LinkFilterHooks::linkFromTitle';
-$wgHooks['ParserFirstCallInit'][] = 'LinkFilterHooks::registerLinkFilterHook';
-$wgHooks['LoadExtensionSchemaUpdates'][] = 
'LinkFilterHooks::applySchemaChanges';
-$wgHooks['CanonicalNamespaces'][] = 'LinkFilterHooks::onCanonicalNamespaces';
-// For the Renameuser extension
-$wgHooks['RenameUserSQL'][] = 'LinkFilterHooks::onUserRename';
-// Interaction 

[MediaWiki-commits] [Gerrit] mediawiki...LinkFilter[master]: Deprecate (but don't remove) the PHP entry point, LinkFilter...

2016-09-03 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review.

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

Change subject: Deprecate (but don't remove) the PHP entry point, 
LinkFilter.php, in favor of extension.json
..

Deprecate (but don't remove) the PHP entry point, LinkFilter.php, in favor of 
extension.json

MediaWiki 1.25+ is thus explicitly required.

Change-Id: I19c141fecf0e383df7b45d179fb039ad9e793b8a
---
M LinkFilter.php
1 file changed, 11 insertions(+), 112 deletions(-)


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

diff --git a/LinkFilter.php b/LinkFilter.php
index 8dc1791..99eda45 100644
--- a/LinkFilter.php
+++ b/LinkFilter.php
@@ -12,115 +12,14 @@
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
 
-// Extension credits that will show up on Special:Version
-$wgExtensionCredits['other'][] = array(
-   'path' => __FILE__,
-   'name' => 'LinkFilter',
-   'version' => '3.2.2',
-   'author' => array( 'Aaron Wright', 'David Pean', 'Jack Phoenix' ),
-   'descriptionmsg' => 'linkfilter-desc',
-   'url' => 'https://www.mediawiki.org/wiki/Extension:LinkFilter'
-);
-
-// ResourceLoader support for MediaWiki 1.17+
-$wgResourceModules['ext.linkFilter'] = array(
-   'styles' => 'LinkFilter.css',
-   'scripts' => 'LinkFilter.js',
-   'messages' => array(
-   'linkfilter-admin-accept-success', 
'linkfilter-admin-reject-success',
-   'linkfilter-submit-no-title', 'linkfilter-submit-no-type',
-   'linkfilter-submit-no-desc', 'linkfilter-submit-no-url'
-   ),
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'LinkFilter',
-   'position' => 'top' // available since r85616
-);
-
-// Define some constants (for namespaces)
-define( 'NS_LINK', 700 );
-define( 'NS_LINK_TALK', 701 );
-
-// Array of LinkFilter types
-// Key is: number => 'description'
-// For example: 2 => 'Awesome',
-$wgLinkFilterTypes = array(
-   1 => 'Arrest Report',
-   2 => 'Awesome',
-   3 => 'Cool',
-   4 => 'Funny',
-   6 => 'Interesting',
-   7 => 'Obvious',
-   8 => 'OMG WTF?!?',
-   9 => 'Rumor',
-   10 => 'Scary',
-   11 => 'Stupid',
-);
-
-// Internationalization files
-$wgMessagesDirs['LinkFilter'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['LinkFilterAlias'] = __DIR__ . '/Link.alias.php';
-// Namespace translations
-$wgExtensionMessagesFiles['LinkNamespaces'] = __DIR__ . '/Link.namespaces.php';
-
-// Some base classes to be autoloaded
-$wgAutoloadClasses['Link'] = __DIR__ . '/LinkClass.php';
-$wgAutoloadClasses['LinkList'] = __DIR__ . '/LinkClass.php';
-$wgAutoloadClasses['LinkPage'] = __DIR__ . '/LinkPage.php';
-
-// RSS feed class used on Special:LinksHome (replaces the hardcoded feed)
-$wgAutoloadClasses['LinkFeed'] = __DIR__ . '/LinkFeed.php';
-
-// Special pages
-$wgAutoloadClasses['LinksHome'] = __DIR__ . '/SpecialLinksHome.php';
-$wgSpecialPages['LinksHome'] = 'LinksHome';
-
-$wgAutoloadClasses['LinkSubmit'] = __DIR__ . '/SpecialLinkSubmit.php';
-$wgSpecialPages['LinkSubmit'] = 'LinkSubmit';
-
-$wgAutoloadClasses['LinkRedirect'] = __DIR__ . '/SpecialLinkRedirect.php';
-$wgSpecialPages['LinkRedirect'] = 'LinkRedirect';
-
-$wgAutoloadClasses['LinkApprove'] = __DIR__ . '/SpecialLinkApprove.php';
-$wgSpecialPages['LinkApprove'] = 'LinkApprove';
-
-$wgAutoloadClasses['LinkEdit'] = __DIR__ . '/SpecialLinkEdit.php';
-$wgSpecialPages['LinkEdit'] = 'LinkEdit';
-
-// API module used by the JavaScript file
-$wgAutoloadClasses['ApiLinkFilter'] = __DIR__ . '/ApiLinkFilter.php';
-$wgAPIModules['linkfilter'] = 'ApiLinkFilter';
-
-// Default setup for displaying sections
-$wgLinkPageDisplay = array(
-   'leftcolumn' => true,
-   'rightcolumn' => false,
-   'author' => true,
-   'left_ad' => false,
-   'popular_articles' => false,
-   'in_the_news' => false,
-   'comments_of_day' => true,
-   'games' => true,
-   'new_links' => false
-);
-
-// New user right, which is required to approve user-submitted links
-$wgAvailableRights[] = 'linkadmin';
-$wgGroupPermissions['linkadmin']['linkadmin'] = true;
-$wgGroupPermissions['staff']['linkadmin'] = true;
-$wgGroupPermissions['sysop']['linkadmin'] = true;
-
-// Hooked functions
-$wgAutoloadClasses['LinkFilterHooks'] = __DIR__ . '/LinkFilterHooks.php';
-
-// Hooked function registrations
-$wgHooks['TitleMoveComplete'][] = 'LinkFilterHooks::updateLinkFilter';
-$wgHooks['ArticleDelete'][] = 'LinkFilterHooks::deleteLinkFilter';
-$wgHooks['ArticleFromTitle'][] = 'LinkFilterHooks::linkFromTitle';
-$wgHooks['ParserFirstCallInit'][] = 'LinkFilterHooks::registerLinkFilterHook';
-$wgHooks['LoadExtensionSchemaUpdates'][] = 
'LinkFilterHooks::applySchemaChanges';
-$wgHooks['CanonicalNamespaces'][] = 'LinkFilterHooks::onCanonicalNamespaces';
-// For the Renameuser extension

[MediaWiki-commits] [Gerrit] operations/puppet[production]: manifests/role: Fix indentation

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

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

Change subject: manifests/role: Fix indentation
..

manifests/role: Fix indentation

Fixes file dns.pp

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


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


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: manifests/role: Fix optional parameter listed before require...

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

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

Change subject: manifests/role: Fix optional parameter listed before required 
parameter
..

manifests/role: Fix optional parameter listed before required parameter

Fixes file coredb.pp

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


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/15/308315/1


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ldap: migrate role classes to autoloader layout

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

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

Change subject: ldap: migrate role classes to autoloader layout
..

ldap: migrate role classes to autoloader layout

Move role manifests in the ldap module to please Puppet autoloading
mecanism.

Impact all labs instances.

Bug: T93645
Change-Id: I6892633f9a1681855bfb77430b6bd7f928436df8
---
R modules/ldap/manifests/role/client/labs.pp
R modules/ldap/manifests/role/config/labs.pp
2 files changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/14/308314/1

diff --git a/modules/ldap/manifests/role/client.pp 
b/modules/ldap/manifests/role/client/labs.pp
similarity index 100%
rename from modules/ldap/manifests/role/client.pp
rename to modules/ldap/manifests/role/client/labs.pp
diff --git a/modules/ldap/manifests/role/config.pp 
b/modules/ldap/manifests/role/config/labs.pp
similarity index 100%
rename from modules/ldap/manifests/role/config.pp
rename to modules/ldap/manifests/role/config/labs.pp

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: quarry: migrate classes to autoloader layout

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

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

Change subject: quarry: migrate classes to autoloader layout
..

quarry: migrate classes to autoloader layout

Split classes from quarry/init.pp to standalone files that match the
Puppet autoloader layout.

Bug: T93645
Change-Id: I895e376352d808dab8b7a8392b29d1be63a52035
---
A modules/quarry/manifests/base.pp
A modules/quarry/manifests/database.pp
D modules/quarry/manifests/init.pp
A modules/quarry/manifests/querykiller.pp
A modules/quarry/manifests/redis.pp
5 files changed, 89 insertions(+), 90 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/13/308313/1

diff --git a/modules/quarry/manifests/base.pp b/modules/quarry/manifests/base.pp
new file mode 100644
index 000..850d7fb
--- /dev/null
+++ b/modules/quarry/manifests/base.pp
@@ -0,0 +1,40 @@
+# = Class: quarry::base
+#
+# This class sets up the basic underlying structure for both
+# Quarry web frontends and Quarry query runners.
+class quarry::base(
+$clone_path = '/srv/quarry',
+$result_path_parent = '/data/project/quarry',
+$result_path = '/data/project/quarry/results',
+) {
+include ::redis::client::python
+
+package { [
+'python-celery',
+'python-sqlalchemy',
+'python-unicodecsv',
+'python-translitcodec',
+]:
+ensure => latest
+}
+
+user { 'quarry':
+ensure => present,
+system => true
+}
+
+file { [$clone_path, $result_path_parent, $result_path]:
+ensure  => directory,
+owner   => 'quarry',
+require => User['quarry']
+}
+
+git::clone { 'analytics/quarry/web':
+ensure=> present,
+directory => $clone_path,
+branch=> 'master',
+require   => [File[$clone_path], User['quarry']],
+owner => 'quarry',
+group => 'www-data'
+}
+}
diff --git a/modules/quarry/manifests/database.pp 
b/modules/quarry/manifests/database.pp
new file mode 100644
index 000..e43180c
--- /dev/null
+++ b/modules/quarry/manifests/database.pp
@@ -0,0 +1,15 @@
+# = Class: quarry::database
+#
+# Sets up a mysql database for use by Quarry web frontends
+# and Quarry query runners
+class quarry::database {
+$data_path = '/srv/mysql/data'
+
+class { 'mysql::server':
+package_name => 'mariadb-server',
+config_hash  => {
+'datadir'  => $data_path,
+'bind_address' => '0.0.0.0',
+}
+}
+}
diff --git a/modules/quarry/manifests/init.pp b/modules/quarry/manifests/init.pp
deleted file mode 100644
index 037c410..000
--- a/modules/quarry/manifests/init.pp
+++ /dev/null
@@ -1,90 +0,0 @@
-# = Class: quarry::base
-#
-# This class sets up the basic underlying structure for both
-# Quarry web frontends and Quarry query runners.
-class quarry::base(
-$clone_path = '/srv/quarry',
-$result_path_parent = '/data/project/quarry',
-$result_path = '/data/project/quarry/results',
-) {
-include ::redis::client::python
-
-package { [
-'python-celery',
-'python-sqlalchemy',
-'python-unicodecsv',
-'python-translitcodec',
-]:
-ensure => latest
-}
-
-user { 'quarry':
-ensure => present,
-system => true
-}
-
-file { [$clone_path, $result_path_parent, $result_path]:
-ensure  => directory,
-owner   => 'quarry',
-require => User['quarry']
-}
-
-git::clone { 'analytics/quarry/web':
-ensure=> present,
-directory => $clone_path,
-branch=> 'master',
-require   => [File[$clone_path], User['quarry']],
-owner => 'quarry',
-group => 'www-data'
-}
-}
-
-# = Class: quarry::database
-#
-# Sets up a mysql database for use by Quarry web frontends
-# and Quarry query runners
-class quarry::database {
-$data_path = '/srv/mysql/data'
-
-class { 'mysql::server':
-package_name => 'mariadb-server',
-config_hash  => {
-'datadir'  => $data_path,
-'bind_address' => '0.0.0.0',
-}
-}
-}
-
-# = Class: quarry::redis
-#
-# Sets up a redis instance for use as caching and session storage
-# by the Quarry frontends and also as working queue & results
-# backend by the query runners.
-class quarry::redis {
-redis::instance { '6379':
-settings => {
-bind  => '0.0.0.0',
-dir   => '/srv/redis',
-maxmemory => '2GB',
-}
-}
-}
-
-# = Class: quarry:querykiller
-#
-# Sets up a cron based query-killer
-class quarry::querykiller {
-require quarry::base
-
-file { '/var/log/quarry':
-ensure => directory,
-owner  => 'quarry',
-group  => 'quarry'
-}
-
-cron { 'query-killer':
-command => "${quarry::base::clone_path}/quarry/web/killer.py",
- 

[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: New Wikidata Build - 2016-09-03T10:00:01+0000

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

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

Change subject: New Wikidata Build - 2016-09-03T10:00:01+
..

New Wikidata Build - 2016-09-03T10:00:01+

Change-Id: I212f9521592ffe2f396a289bd6bb29d0a48818f0
---
M composer.lock
M extensions/Wikibase/client/includes/Api/ApiPropsEntityUsage.php
M extensions/Wikibase/phpcs.xml
M extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageBuilder.php
M extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageIdPager.php
M extensions/Wikibase/repo/includes/Store/Sql/EntityPerPageTable.php
M extensions/Wikibase/repo/includes/Store/Sql/ItemsPerSiteBuilder.php
M extensions/Wikibase/repo/includes/Store/Sql/SqlStore.php
M extensions/Wikibase/repo/includes/Store/Sql/WikiPageEntityRedirectLookup.php
M extensions/Wikibase/repo/maintenance/dumpEntities.php
M extensions/Wikibase/repo/maintenance/rebuildEntityPerPage.php
M extensions/Wikibase/repo/maintenance/rebuildItemsPerSite.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/DatabaseSchemaUpdaterTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/DispatchStatsTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/EntityPerPageBuilderTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/EntityPerPageIdPagerTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/EntityPerPageTableTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/ItemsPerSiteBuilderTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/PropertyInfoTableBuilderTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/SqlChangeDispatchCoordinatorTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/SqlChangeStoreTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/SqlIdGeneratorTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/SqlSiteLinkConflictLookupTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/SqlSubscriptionLookupTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/TermSearchKeyBuilderTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityRedirectLookupTest.php
M 
extensions/Wikibase/repo/tests/phpunit/includes/Store/Sql/WikiPageEntityStoreTest.php
M vendor/composer/autoload_classmap.php
M vendor/composer/installed.json
30 files changed, 155 insertions(+), 121 deletions(-)


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

diff --git a/composer.lock b/composer.lock
index e725e16..62284f8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1574,12 +1574,12 @@
 "source": {
 "type": "git",
 "url": 
"https://github.com/wikimedia/mediawiki-extensions-Wikibase.git;,
-"reference": "547ab4174067203a9dfb90220ebffec5a410cea1"
+"reference": "35d1215e7630422918eea2b03a57660eb08fec1a"
 },
 "dist": {
 "type": "zip",
-"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/547ab4174067203a9dfb90220ebffec5a410cea1;,
-"reference": "547ab4174067203a9dfb90220ebffec5a410cea1",
+"url": 
"https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/35d1215e7630422918eea2b03a57660eb08fec1a;,
+"reference": "35d1215e7630422918eea2b03a57660eb08fec1a",
 "shasum": ""
 },
 "require": {
@@ -1651,7 +1651,7 @@
 "wikibaserepo",
 "wikidata"
 ],
-"time": "2016-09-02 07:56:58"
+"time": "2016-09-02 12:18:28"
 },
 {
 "name": "wikibase/wikimedia-badges",
diff --git a/extensions/Wikibase/client/includes/Api/ApiPropsEntityUsage.php 
b/extensions/Wikibase/client/includes/Api/ApiPropsEntityUsage.php
index 51726b2..6887717 100644
--- a/extensions/Wikibase/client/includes/Api/ApiPropsEntityUsage.php
+++ b/extensions/Wikibase/client/includes/Api/ApiPropsEntityUsage.php
@@ -208,7 +208,7 @@
}
 
public function getHelpUrls() {
-   return 
'https://www.mediawiki.org/wiki/API:Wikibase/EntityUsage';
+   return 
'https://www.mediawiki.org/wiki/Wikibase/API#wbentityusage';
}
 
 }
diff --git a/extensions/Wikibase/phpcs.xml b/extensions/Wikibase/phpcs.xml
index 5ff1efb..5ffc2cc 100644
--- a/extensions/Wikibase/phpcs.xml
+++ b/extensions/Wikibase/phpcs.xml
@@ -32,11 +32,7 @@


(RdfWriterFactory|UrlSchemeValidators)\.php

-   
-   
-   
-   
-   
+   
 

 
diff --git 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: ircyall: move role to module/role

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

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

Change subject: ircyall: move role to module/role
..

ircyall: move role to module/role

Change-Id: I59eeb42bf6a486990aa2b4e939a6541f7cddd3af
---
R modules/role/manifests/ircyall/init.pp
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/11/308311/1

diff --git a/manifests/role/ircyall.pp b/modules/role/manifests/ircyall/init.pp
similarity index 100%
rename from manifests/role/ircyall.pp
rename to modules/role/manifests/ircyall/init.pp

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Not including results when oresm_is_current = 0

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

Change subject: Not including results when oresm_is_current = 0
..


Not including results when oresm_is_current = 0

It fixes almost all cases of redundant results

Bug: T144233
Change-Id: I36d67d9461270c621308575b8c1860b5f85ccadd
---
M includes/Hooks.php
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/includes/Hooks.php b/includes/Hooks.php
index b900417..e1624e7 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -137,6 +137,8 @@
$conds[] = '(oresm_name = ' . $dbr->addQuotes( 'damaging' ) .
' OR oresm_name IS NULL)';
 
+   $conds[] = 'oresm_is_current != 0';
+
$join_conds['ores_classification'] = [ 'LEFT JOIN',
'rc_this_oldid = oresc_rev ' .
'AND oresc_class = 1' ];
@@ -259,6 +261,8 @@
$query['conds'][] = '(oresm_name = ' . $dbr->addQuotes( 
'damaging' ) .
' OR oresm_name IS NULL)';
 
+   $query['conds'][] = 'oresm_is_current != 0';
+
$query['join_conds']['ores_classification'] = [ 'LEFT JOIN',
'rev_id = oresc_rev ' .
'AND oresc_class = 1' ];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I36d67d9461270c621308575b8c1860b5f85ccadd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup 
Gerrit-Reviewer: Ladsgroup 
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] integration/config[master]: elasticsearch-tool: adding project to continuous integration

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

Change subject: elasticsearch-tool: adding project to continuous integration
..


elasticsearch-tool: adding project to continuous integration

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

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

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



diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 7bd2465..866459a 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2299,6 +2299,10 @@
 template:
   - name: tox-jessie
 
+  - name: operations/software/elasticsearch-tool
+template:
+  - name: tox-jessie
+
   - name: operations/software/ircyall
 template:
   - name: tox-jessie

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I90f0d99498f32519e9c2c4a94a338099d469808b
Gerrit-PatchSet: 2
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Gehel 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] integration/config[master]: Add jenkins job for apertium-ita, apertium-srd, apertium-srd...

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

Change subject: Add jenkins job for apertium-ita, apertium-srd, apertium-srd-ita
..


Add jenkins job for apertium-ita, apertium-srd, apertium-srd-ita

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

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



diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 709e0cd..7bd2465 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -2156,6 +2156,7 @@
   - { name: operations/debs/contenttranslation/apertium-isl,   test: 
['debian-glue'] }
   - { name: operations/debs/contenttranslation/apertium-isl-eng,   test: 
['debian-glue'] }
   - { name: operations/debs/contenttranslation/apertium-is-sv, test: 
['debian-glue'] }
+  - { name: operations/debs/contenttranslation/apertium-ita,   test: 
['debian-glue'] }
   - { name: operations/debs/contenttranslation/apertium-kaz,   test: 
['debian-glue'] }
   - { name: operations/debs/contenttranslation/apertium-kaz-tat,   test: 
['debian-glue'] }
   - { name: operations/debs/contenttranslation/apertium-lex-tools, test: 
['debian-glue'] }
@@ -2173,6 +2174,8 @@
   - { name: operations/debs/contenttranslation/apertium-sme-nob,   test: 
['debian-glue'] }
   - { name: operations/debs/contenttranslation/apertium-spa,   test: 
['debian-glue'] }
   - { name: operations/debs/contenttranslation/apertium-spa-arg,   test: 
['debian-glue'] }
+  - { name: operations/debs/contenttranslation/apertium-srd,   test: 
['debian-glue'] }
+  - { name: operations/debs/contenttranslation/apertium-srd-ita,   test: 
['debian-glue'] }
   - { name: operations/debs/contenttranslation/apertium-sv-da, test: 
['debian-glue'] }
   - { name: operations/debs/contenttranslation/apertium-swe,   test: 
['debian-glue'] }
   - { name: operations/debs/contenttranslation/apertium-swe-dan,   test: 
['debian-glue'] }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3a338ee65605b0b6f755a9d4855dfa9d206ad0bc
Gerrit-PatchSet: 2
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: KartikMistry 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Paladox 
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]: [WIP] objectcache: add WANObjectCacheRepear for replaying pu...

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

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

Change subject: [WIP] objectcache: add WANObjectCacheRepear for replaying purges
..

[WIP] objectcache: add WANObjectCacheRepear for replaying purges

This triggers as a deferred updates on RC view.

Change-Id: I7f14b9ca2533032147e62b1a3cc004a23da86579
---
M autoload.php
A includes/deferred/WANCacheReapUpdate.php
M includes/libs/objectcache/WANObjectCache.php
A includes/libs/objectcache/WANObjectCacheReaper.php
M includes/specialpage/ChangesListSpecialPage.php
5 files changed, 329 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/308310/1

diff --git a/autoload.php b/autoload.php
index 652535c..2132341 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1497,7 +1497,9 @@
'ViewAction' => __DIR__ . '/includes/actions/ViewAction.php',
'VirtualRESTService' => __DIR__ . 
'/includes/libs/virtualrest/VirtualRESTService.php',
'VirtualRESTServiceClient' => __DIR__ . 
'/includes/libs/virtualrest/VirtualRESTServiceClient.php',
+   'WANCacheReapUpdate' => __DIR__ . 
'/includes/deferred/WANCacheReapUpdate.php',
'WANObjectCache' => __DIR__ . 
'/includes/libs/objectcache/WANObjectCache.php',
+   'WANObjectCacheRepear' => __DIR__ . 
'/includes/libs/objectcache/WANObjectCacheReaper.php',
'WaitConditionLoop' => __DIR__ . '/includes/libs/WaitConditionLoop.php',
'WantedCategoriesPage' => __DIR__ . 
'/includes/specials/SpecialWantedcategories.php',
'WantedFilesPage' => __DIR__ . 
'/includes/specials/SpecialWantedfiles.php',
diff --git a/includes/deferred/WANCacheReapUpdate.php 
b/includes/deferred/WANCacheReapUpdate.php
new file mode 100644
index 000..3dc3476
--- /dev/null
+++ b/includes/deferred/WANCacheReapUpdate.php
@@ -0,0 +1,108 @@
+db = $db;
+   }
+
+   function doUpdate() {
+   $reaper = new WANObjectCacheRepear(
+   ObjectCache::getMainWANInstance(),
+   ObjectCache::getLocalClusterInstance(),
+   [ $this, 'getChangedTitles' ],
+   [ $this, 'getAffectedKeys' ],
+   [
+   'channel' => 'table:recentchanges',
+   'logger' => 
\MediaWiki\Logger\LoggerFactory::getInstance( 'objectcache' )
+   ]
+   );
+
+   $reaper->invoke();
+   }
+
+   /**
+* @see WANObjectCacheRepear
+*
+* @param int $start
+* @param int $id
+* @param int $end
+* @return array
+*/
+   public function getChangedTitles( $start, $id, $end ) {
+   $db = $this->db;
+
+   $encStart = $db->addQuotes( $db->timestamp( $start ) );
+   $encEnd = $db->addQuotes( $db->timestamp( $end ) );
+
+   $res = $db->select(
+   'recentchanges',
+   [ 'rc_namespace', 'rc_title', 'rc_timestamp', 'rc_id' ],
+   [
+   $db->makeList( [
+   "rc_timestamp > $encStart",
+   "rc_timestamp = $encStart AND rc_id > " 
. $db->addQuotes( $id )
+   ], LIST_OR ),
+   "rc_timestamp < $encEnd"
+   ],
+   __METHOD__,
+   [ 'ORDER BY' => 'rc_timestamp ASC, rc_id ASC' ]
+   );
+
+   $events = [];
+   foreach ( $res as $row ) {
+   $events[] = [
+   'id' => (int)$row->rc_id,
+   'pos' => wfTimestamp( TS_UNIX, 
$row->rc_timestamp ),
+   'item' => new TitleValue( 
(int)$row->rc_namespace, $row->rc_title )
+   ];
+   }
+
+   return $events;
+   }
+
+   /**
+* Gets a list of important cache keys associated with a title
+*
+* @see WANObjectCacheRepear
+* @param WANObjectCache $cache
+* @param TitleValue $t
+* @returns string[]
+* @TODO: avoid key generation code duplication
+*/
+   public function getAffectedKeys( WANObjectCache $cache, TitleValue $t ) 
{
+   $keys = [];
+   if ( $t->inNamespace( NS_FILE ) ) {
+   /** @var LocalFile $file */
+   $file = 
RepoGroup::singleton()->getLocalRepo()->newFile( $t->getDBkey() );
+   $keys[] = $file->getCacheKey();
+   }
+
+   if ( $t->inNamespace( NS_FILE ) || $t->inNamespace( NS_TEMPLATE 
) ) {
+   $keys[] = $cache->makeKey( 'page', $t->getNamespace(), 
sha1( $t->getDBkey() ) );
+   }
+
+