[MediaWiki-commits] [Gerrit] operations/puppet[production]: LibreNMS add rancid integration

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

Change subject: LibreNMS add rancid integration
..


LibreNMS add rancid integration

Bug: T164911
Change-Id: I9033e9d2f8d60eea442c8dc6a26204c7b0426f81
---
M modules/role/manifests/librenms.pp
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/modules/role/manifests/librenms.pp 
b/modules/role/manifests/librenms.pp
index e1ce2f6..6daa370 100644
--- a/modules/role/manifests/librenms.pp
+++ b/modules/role/manifests/librenms.pp
@@ -77,6 +77,8 @@
 'email_from' => 'librenms',
 'twofactor' => true,
 'twofactor_lock' => 300,
+'rancid_configs' => ['/var/lib/rancid/core/configs/'],
+'rancid_ignorecomments'  => 1,
 'enable_inventory' => 1,
 'enable_syslog'=> 1,
 'enable_billing'   => 1,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9033e9d2f8d60eea442c8dc6a26204c7b0426f81
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ayounsi 
Gerrit-Reviewer: Ayounsi 
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]: LibreNMS add rancid integration

2017-06-08 Thread Ayounsi (Code Review)
Ayounsi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357973 )

Change subject: LibreNMS add rancid integration
..

LibreNMS add rancid integration

Bug: T164911
Change-Id: I9033e9d2f8d60eea442c8dc6a26204c7b0426f81
---
M modules/role/manifests/librenms.pp
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/modules/role/manifests/librenms.pp 
b/modules/role/manifests/librenms.pp
index e1ce2f6..6daa370 100644
--- a/modules/role/manifests/librenms.pp
+++ b/modules/role/manifests/librenms.pp
@@ -77,6 +77,8 @@
 'email_from' => 'librenms',
 'twofactor' => true,
 'twofactor_lock' => 300,
+'rancid_configs' => ['/var/lib/rancid/core/configs/'],
+'rancid_ignorecomments'  => 1,
 'enable_inventory' => 1,
 'enable_syslog'=> 1,
 'enable_billing'   => 1,

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

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

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


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

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

Change subject: Revert "db-eqiad.php: Depool db1056"
..


Revert "db-eqiad.php: Depool db1056"

This reverts commit 52efc21c435cd403ff4871cb8ece0cee3a8ddd78.

Change-Id: Ife505306ae86d1de4128244ddd3117a120f2f393
---
M wmf-config/db-eqiad.php
1 file changed, 6 insertions(+), 6 deletions(-)

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



diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index efff5cf..24b8792 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -127,7 +127,7 @@
's4' => [
'db1068' => 0,   # D1 2.8TB 160GB, master
'db1053' => 1,   # A2 2.8TB  96GB, watchlist, recentchanges, 
contributions, logpager
-#  'db1056' => 1,   # C2 2.8TB  96GB, watchlist, recentchanges, 
contributions, logpager #T166206
+   'db1056' => 1,   # C2 2.8TB  96GB, watchlist, recentchanges, 
contributions, logpager
'db1059' => 1,   # C2 2.8TB  96GB, api
'db1064' => 0,   # D1 2.8TB 160GB, vslow, dump #Master for 
db1095 - new sanitarium
'db1081' => 300, # A2 3.6TB 512GB, api
@@ -328,23 +328,23 @@
],
'watchlist' => [
'db1053' => 1,
-#  'db1056' => 1,
+   'db1056' => 1,
],
'recentchanges' => [
'db1053' => 1,
-#  'db1056' => 1,
+   'db1056' => 1,
],
'recentchangeslinked' => [
'db1053' => 1,
-#  'db1056' => 1,
+   'db1056' => 1,
],
'contributions' => [
'db1053' => 1,
-#  'db1056' => 1,
+   'db1056' => 1,
],
'logpager' => [
'db1053' => 1,
-#  'db1056' => 1,
+   'db1056' => 1,
],
],
's5' => [

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

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

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


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

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

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

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

to review the following change.


Change subject: Revert "db-eqiad.php: Depool db1056"
..

Revert "db-eqiad.php: Depool db1056"

This reverts commit 52efc21c435cd403ff4871cb8ece0cee3a8ddd78.

Change-Id: Ife505306ae86d1de4128244ddd3117a120f2f393
---
M wmf-config/db-eqiad.php
1 file changed, 6 insertions(+), 6 deletions(-)


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

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index efff5cf..24b8792 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -127,7 +127,7 @@
's4' => [
'db1068' => 0,   # D1 2.8TB 160GB, master
'db1053' => 1,   # A2 2.8TB  96GB, watchlist, recentchanges, 
contributions, logpager
-#  'db1056' => 1,   # C2 2.8TB  96GB, watchlist, recentchanges, 
contributions, logpager #T166206
+   'db1056' => 1,   # C2 2.8TB  96GB, watchlist, recentchanges, 
contributions, logpager
'db1059' => 1,   # C2 2.8TB  96GB, api
'db1064' => 0,   # D1 2.8TB 160GB, vslow, dump #Master for 
db1095 - new sanitarium
'db1081' => 300, # A2 3.6TB 512GB, api
@@ -328,23 +328,23 @@
],
'watchlist' => [
'db1053' => 1,
-#  'db1056' => 1,
+   'db1056' => 1,
],
'recentchanges' => [
'db1053' => 1,
-#  'db1056' => 1,
+   'db1056' => 1,
],
'recentchangeslinked' => [
'db1053' => 1,
-#  'db1056' => 1,
+   'db1056' => 1,
],
'contributions' => [
'db1053' => 1,
-#  'db1056' => 1,
+   'db1056' => 1,
],
'logpager' => [
'db1053' => 1,
-#  'db1056' => 1,
+   'db1056' => 1,
],
],
's5' => [

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

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

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


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

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

Change subject: Revert "db-eqiad.php: Depool db1074"
..


Revert "db-eqiad.php: Depool db1074"

This reverts commit 2945514a25b98487706bf49f1bad0babd87d66dc.

Change-Id: Ifc216d198bd7c81f807574c3c12df3c97137b4fb
---
M wmf-config/db-eqiad.php
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 9784d1f..efff5cf 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -111,8 +111,8 @@
'db1021' => 0,   # B1 1.4TB  64GB, vslow, dump
'db1036' => 1,   # B2 1.4TB  64GB, watchlist, recentchanges, 
contributions, logpager
'db1060' => 1,   # C2 2.8TB  96GB, api
-#  'db1074' => 300, # A2 3.6TB 512GB, api #T166205
-   'db1076' => 300, # B1 3.6TB 512GB #temporary api #T166205
+   'db1074' => 300, # A2 3.6TB 512GB, api
+   'db1076' => 500, # B1 3.6TB 512GB
'db1090' => 500, # C3 3.6TB 512GB
],
/* s3 */ 'DEFAULT' => [
@@ -274,7 +274,7 @@
],
'api' => [
'db1060' => 2,
-   'db1076' => 1,
+   'db1074' => 1,
],
'watchlist' => [
'db1036' => 1,

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

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

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


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

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

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

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

to review the following change.


Change subject: Revert "db-eqiad.php: Depool db1074"
..

Revert "db-eqiad.php: Depool db1074"

This reverts commit 2945514a25b98487706bf49f1bad0babd87d66dc.

Change-Id: Ifc216d198bd7c81f807574c3c12df3c97137b4fb
---
M wmf-config/db-eqiad.php
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 9784d1f..efff5cf 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -111,8 +111,8 @@
'db1021' => 0,   # B1 1.4TB  64GB, vslow, dump
'db1036' => 1,   # B2 1.4TB  64GB, watchlist, recentchanges, 
contributions, logpager
'db1060' => 1,   # C2 2.8TB  96GB, api
-#  'db1074' => 300, # A2 3.6TB 512GB, api #T166205
-   'db1076' => 300, # B1 3.6TB 512GB #temporary api #T166205
+   'db1074' => 300, # A2 3.6TB 512GB, api
+   'db1076' => 500, # B1 3.6TB 512GB
'db1090' => 500, # C3 3.6TB 512GB
],
/* s3 */ 'DEFAULT' => [
@@ -274,7 +274,7 @@
],
'api' => [
'db1060' => 2,
-   'db1076' => 1,
+   'db1074' => 1,
],
'watchlist' => [
'db1036' => 1,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Remove unused code in Swit proxy rewrite.py

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

Change subject: Remove unused code in Swit proxy rewrite.py
..


Remove unused code in Swit proxy rewrite.py

Bug: T167490
Change-Id: Ibda399048c44de16818dbc1759517c465c4d35d8
---
M puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
1 file changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py 
b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
index a676803..b43b2af 100644
--- a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
+++ b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
@@ -7,7 +7,6 @@
 import webob
 import webob.exc
 import re
-import eventlet
 from eventlet.green import urllib2
 import time
 import urlparse
@@ -50,7 +49,6 @@
 host and returns it. Note also that the thumb host might write it out
 to Swift so it won't 404 next time.
 """
-original_request_url = reqorig.url
 # go to the thumb media store for unknown files
 reqorig.host = self.thumbhost
 # upload doesn't like our User-agent, otherwise we could call it

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Rancid: set configs world readable

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

Change subject: Rancid: set configs world readable
..


Rancid: set configs world readable

Bug: T167288
Change-Id: I1a9fcbfcdeef265ee1906fb7b302d116f51e97be
---
M modules/rancid/files/rancid.conf
M modules/rancid/manifests/init.pp
2 files changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/rancid/files/rancid.conf b/modules/rancid/files/rancid.conf
index 2573017..a1944df 100644
--- a/modules/rancid/files/rancid.conf
+++ b/modules/rancid/files/rancid.conf
@@ -7,7 +7,7 @@
 #
 # Create files w/o world read/write/exec permissions, but read/exec permissions
 # for group.
-umask 027
+umask 022
 #
 # Under BASEDIR (i.e.: --localstatedir), there will be a "logs" directory for
 # the logs from rancid and a directory for each group of routers defined in
diff --git a/modules/rancid/manifests/init.pp b/modules/rancid/manifests/init.pp
index f1add61..65a2a12 100644
--- a/modules/rancid/manifests/init.pp
+++ b/modules/rancid/manifests/init.pp
@@ -36,7 +36,7 @@
 require => [ Package['rancid'], User['rancid'] ],
 owner   => 'rancid',
 group   => 'rancid',
-mode=> '0770',
+mode=> '0774',
 recurse => remote,
 source  => 'puppet:///modules/rancid/core',
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1a9fcbfcdeef265ee1906fb7b302d116f51e97be
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ayounsi 
Gerrit-Reviewer: Ayounsi 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Remove unused code in Swit proxy rewrite.py

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

Change subject: Remove unused code in Swit proxy rewrite.py
..

Remove unused code in Swit proxy rewrite.py

Bug: T167490
Change-Id: Ibda399048c44de16818dbc1759517c465c4d35d8
---
M puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/70/357970/1

diff --git a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py 
b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
index a676803..b43b2af 100644
--- a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
+++ b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
@@ -7,7 +7,6 @@
 import webob
 import webob.exc
 import re
-import eventlet
 from eventlet.green import urllib2
 import time
 import urlparse
@@ -50,7 +49,6 @@
 host and returns it. Note also that the thumb host might write it out
 to Swift so it won't 404 next time.
 """
-original_request_url = reqorig.url
 # go to the thumb media store for unknown files
 reqorig.host = self.thumbhost
 # upload doesn't like our User-agent, otherwise we could call it

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Rancid: set configs world readable

2017-06-08 Thread Ayounsi (Code Review)
Ayounsi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357969 )

Change subject: Rancid: set configs world readable
..

Rancid: set configs world readable

Bug: T167288
Change-Id: I1a9fcbfcdeef265ee1906fb7b302d116f51e97be
---
M modules/rancid/files/rancid.conf
M modules/rancid/manifests/init.pp
2 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/modules/rancid/files/rancid.conf b/modules/rancid/files/rancid.conf
index 2573017..a1944df 100644
--- a/modules/rancid/files/rancid.conf
+++ b/modules/rancid/files/rancid.conf
@@ -7,7 +7,7 @@
 #
 # Create files w/o world read/write/exec permissions, but read/exec permissions
 # for group.
-umask 027
+umask 022
 #
 # Under BASEDIR (i.e.: --localstatedir), there will be a "logs" directory for
 # the logs from rancid and a directory for each group of routers defined in
diff --git a/modules/rancid/manifests/init.pp b/modules/rancid/manifests/init.pp
index f1add61..65a2a12 100644
--- a/modules/rancid/manifests/init.pp
+++ b/modules/rancid/manifests/init.pp
@@ -36,7 +36,7 @@
 require => [ Package['rancid'], User['rancid'] ],
 owner   => 'rancid',
 group   => 'rancid',
-mode=> '0770',
+mode=> '0774',
 recurse => remote,
 source  => 'puppet:///modules/rancid/core',
 }

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Avoid triggering master queries in ApiValidatePassword

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

Change subject: Avoid triggering master queries in ApiValidatePassword
..


Avoid triggering master queries in ApiValidatePassword

Bug: T92357
Change-Id: Ida56c6279a1deaefb9d19d3e450632de544e5f5a
---
M includes/CentralAuthHooks.php
1 file changed, 8 insertions(+), 3 deletions(-)

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



diff --git a/includes/CentralAuthHooks.php b/includes/CentralAuthHooks.php
index d3e84ec..9c01859 100644
--- a/includes/CentralAuthHooks.php
+++ b/includes/CentralAuthHooks.php
@@ -781,6 +781,7 @@
if ( $ca->isAttached() ) {
$ca->saveSettings();
}
+
return true;
}
 
@@ -790,11 +791,15 @@
 * @return bool
 */
static function onUserSetEmailAuthenticationTimestamp( $user, 
&$timestamp ) {
-   $ca = CentralAuthUser::getMasterInstance( $user );
+   $ca = CentralAuthUser::getInstance( $user );
if ( $ca->isAttached() ) {
-   $ca->setEmailAuthenticationTimestamp( $timestamp );
-   $ca->saveSettings();
+   $latestCa = CentralAuthUser::newMasterInstanceById( 
$ca->getId() );
+   if ( $latestCa->isAttached() ) {
+   $latestCa->setEmailAuthenticationTimestamp( 
$timestamp );
+   $latestCa->saveSettings();
+}
}
+
return true;
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ida56c6279a1deaefb9d19d3e450632de544e5f5a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Legoktm 
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] operations/puppet[production]: Disable Thumbor dual-serving and serve testwiki with Thumbor

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

Change subject: Disable Thumbor dual-serving and serve testwiki with Thumbor
..

Disable Thumbor dual-serving and serve testwiki with Thumbor

Bug: T167490
Change-Id: Ia943a020b360308fe1d11d8e7ee9ddf8fffc375d
---
M hieradata/common/swift/proxy.yaml
M modules/swift/files/SwiftMedia/wmf/rewrite.py
2 files changed, 8 insertions(+), 70 deletions(-)


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

diff --git a/hieradata/common/swift/proxy.yaml 
b/hieradata/common/swift/proxy.yaml
index c65a3d3..25cefb5 100644
--- a/hieradata/common/swift/proxy.yaml
+++ b/hieradata/common/swift/proxy.yaml
@@ -57,19 +57,6 @@
  ]
 
 swift::proxy::thumbor_wiki_list: [
-  'wikimedia-commons',
-  'wikipedia-en', 'wikipedia-ja', 'wikipedia-de', 'wikipedia-ru',
-  'wikipedia-it', 'wikipedia-pt', 'wikipedia-he', 'wikipedia-fr',
-  'wikipedia-id', 'wikipedia-zh', 'wikipedia-th', 'wikipedia-uk',
-  'wikipedia-ar', 'wikipedia-tr', 'wikipedia-es',
-  'wikipedia-fa', 'wikipedia-vi', 'wikipedia-fi', 'wikipedia-hu',
-  'wikipedia-ro', 'wikipedia-sr', 'wikipedia-ko', 'wikipedia-ms',
-  'wikipedia-arz', 'wikipedia-az', 'wikipedia-el', 'wikipedia-lt',
-  'wikipedia-hr', 'wikipedia-lv', 'wikipedia-af', 'wikipedia-bs',
-  'wikipedia-te', 'wikipedia-ka', 'wikipedia-ta', 'wikipedia-sq',
-  'wikipedia-kk', 'wikibooks-de', 'wikipedia-hi', 'wikipedia-sl',
-  'wikibooks-en', 'wikipedia-cy', 'wikipedia-bn', 'wikipedia-ca',
-  'wikiversity-en', 'wikipedia-mr', 'wikipedia-gl', 'wikipedia-sh',
-  'wikipedia-hy', 'wikisource-ar', 'wikipedia-my'
+  'wikipedia-test'
 # no trailing comma!
 ]
diff --git a/modules/swift/files/SwiftMedia/wmf/rewrite.py 
b/modules/swift/files/SwiftMedia/wmf/rewrite.py
index 35dec2c..4e7d733 100644
--- a/modules/swift/files/SwiftMedia/wmf/rewrite.py
+++ b/modules/swift/files/SwiftMedia/wmf/rewrite.py
@@ -50,30 +50,6 @@
 self.backend_url_format = conf['backend_url_format'].strip()  # asis, 
sitelang
 self.tld = conf['tld'].strip()
 
-def collectHttpStatusCodes(self, url, thumbor_thread, mediawiki_code):
-self.logger.debug("Mediawiki: %d %s" % (mediawiki_code, url))
-
-if thumbor_thread is None:
-return
-
-try:
-# Waits for Thumbor if it took longer than Mediawiki to process 
the image
-# Otherwise returns/throws exceptions immediately
-thumbor_result = thumbor_thread.wait()
-code = thumbor_result.getcode()
-except urllib2.HTTPError, error:
-code = error.code
-except urllib2.URLError, error:
-code = 503
-
-self.logger.debug("Thumbor: %d %s" % (code, url))
-
-if code != mediawiki_code:
-self.logger.warn(
-"HTTP status code mismatch. Mediawiki: %d Thumbor: %d URL: %s"
-% (mediawiki_code, code, url)
-)
-
 def handle404(self, reqorig, url, container, obj):
 """
 Return a webob.Response which fetches the thumbnail from the thumb
@@ -175,24 +151,13 @@
 else:
 self.logger.warn("no sitelang match on encodedurl: %s" % 
encodedurl)
 
-thumbor_thread = None
-
-# call thumbor first, otherwise if Mediawiki image scalers return 
an error,
-# thumbor doesn't get a change to try to generate that thumbnail
 if self.thumborhost:
 if not self.thumbor_wiki_list or '-'.join((proj, lang)) in 
self.thumbor_wiki_list:
-# call Thumbor but don't wait for the result
-thumbor_thread = eventlet.spawn(thumbor_opener.open, 
thumbor_encodedurl)
-
-# ok, call the encoded url
-upcopy = opener.open(encodedurl)
-eventlet.spawn(
-self.collectHttpStatusCodes,
-original_request_url,
-thumbor_thread,
-upcopy.getcode()
-)
-
+upcopy = thumbor_opener.open(thumbor_encodedurl)
+else:
+upcopy = opener.open(encodedurl)
+else:
+upcopy = opener.open(encodedurl)
 except urllib2.HTTPError, error:
 # copy the urllib2 HTTPError into a webob HTTPError class as-is
 
@@ -208,25 +173,11 @@
 detail="".join(error.readlines()),
 headers=error.hdrs.items())
 
-resp = CopiedHTTPError()
-eventlet.spawn(
-self.collectHttpStatusCodes,
-original_request_url,
-thumbor_thread,
-resp.code
-)
-return resp
+return CopiedHTTPError()
 except urllib2.URLError, error:
 msg = 'There was a problem while contacting the image scaler: %s' 
% \
  

[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Don’t dual-serve Thumbor traffic anymore

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

Change subject: Don’t dual-serve Thumbor traffic anymore
..


Don’t dual-serve Thumbor traffic anymore

Bug: T167490
Change-Id: I78aab59bace6070f6e02763028ce878f85d5fd92
---
M puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
1 file changed, 5 insertions(+), 32 deletions(-)

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



diff --git a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py 
b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
index 6c0b2ee..a676803 100644
--- a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
+++ b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
@@ -44,27 +44,6 @@
 # converted  and only the path sent back (eg en.wikipedia/thumb).
 self.backend_url_format = conf['backend_url_format'].strip()  # asis, 
sitelang
 
-def collectHttpStatusCodes(self, url, thumbor_thread, mediawiki_code):
-self.logger.debug("Mediawiki: %d %s" % (mediawiki_code, url))
-
-if thumbor_thread is None:
-return
-
-try:
-# Waits for Thumbor if it took longer than Mediawiki to process 
the image
-# Otherwise returns/throws exceptions immediately
-thumbor_result = thumbor_thread.wait()
-code = thumbor_result.getcode()
-except urllib2.HTTPError, error:
-code = error.code
-except urllib2.URLError, error:
-code = 503
-
-self.logger.debug("Thumbor: %d %s" % (code, url))
-
-if code != mediawiki_code:
-self.logger.warn("HTTP status code mismatch. Mediawiki: %d 
Thumbor: %d URL: %s" % (mediawiki_code, code, url))
-
 def handle404(self, reqorig, url, container, obj):
 """
 Return a webob.Response which fetches the thumbnail from the thumb
@@ -156,18 +135,14 @@
 else:
 self.logger.warn("no sitelang match on encodedurl: %s" % 
encodedurl)
 
-thumbor_thread = None
-
-# call thumbor first, otherwise if Mediawiki image scalers return 
an error,
-# thumbor doesn't get a change to try to generate that thumbnail
 if self.thumborhost:
 if not self.thumbor_wiki_list or '-'.join((proj, lang)) in 
self.thumbor_wiki_list:
-# call Thumbor but don't wait for the result
-thumbor_thread = eventlet.spawn(thumbor_opener.open, 
thumbor_encodedurl)
+upcopy = thumbor_opener.open(thumbor_encodedurl)
+else:
+upcopy = opener.open(encodedurl)
+else:
+upcopy = opener.open(encodedurl)
 
-# ok, call the encoded url
-upcopy = opener.open(encodedurl)
-self.collectHttpStatusCodes(original_request_url, thumbor_thread, 
upcopy.getcode())
 except urllib2.HTTPError, error:
 # copy the urllib2 HTTPError into a webob HTTPError class as-is
 
@@ -184,13 +159,11 @@
 headers=error.hdrs.items())
 
 resp = CopiedHTTPError()
-self.collectHttpStatusCodes(original_request_url, thumbor_thread, 
resp.code)
 return resp
 except urllib2.URLError, error:
 msg = 'There was a problem while contacting the image scaler: %s' 
% \
   error.reason
 resp = webob.exc.HTTPServiceUnavailable(msg)
-self.collectHttpStatusCodes(original_request_url, thumbor_thread, 
resp.code)
 return resp
 
 # get the Content-Type.

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Don’t dual-serve Thumbor traffic anymore

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

Change subject: Don’t dual-serve Thumbor traffic anymore
..

Don’t dual-serve Thumbor traffic anymore

Bug: T167490
Change-Id: I78aab59bace6070f6e02763028ce878f85d5fd92
---
M puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
1 file changed, 5 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/67/357967/1

diff --git a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py 
b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
index 6c0b2ee..a676803 100644
--- a/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
+++ b/puppet/modules/swift/files/SwiftMedia/wmf/rewrite.py
@@ -44,27 +44,6 @@
 # converted  and only the path sent back (eg en.wikipedia/thumb).
 self.backend_url_format = conf['backend_url_format'].strip()  # asis, 
sitelang
 
-def collectHttpStatusCodes(self, url, thumbor_thread, mediawiki_code):
-self.logger.debug("Mediawiki: %d %s" % (mediawiki_code, url))
-
-if thumbor_thread is None:
-return
-
-try:
-# Waits for Thumbor if it took longer than Mediawiki to process 
the image
-# Otherwise returns/throws exceptions immediately
-thumbor_result = thumbor_thread.wait()
-code = thumbor_result.getcode()
-except urllib2.HTTPError, error:
-code = error.code
-except urllib2.URLError, error:
-code = 503
-
-self.logger.debug("Thumbor: %d %s" % (code, url))
-
-if code != mediawiki_code:
-self.logger.warn("HTTP status code mismatch. Mediawiki: %d 
Thumbor: %d URL: %s" % (mediawiki_code, code, url))
-
 def handle404(self, reqorig, url, container, obj):
 """
 Return a webob.Response which fetches the thumbnail from the thumb
@@ -156,18 +135,14 @@
 else:
 self.logger.warn("no sitelang match on encodedurl: %s" % 
encodedurl)
 
-thumbor_thread = None
-
-# call thumbor first, otherwise if Mediawiki image scalers return 
an error,
-# thumbor doesn't get a change to try to generate that thumbnail
 if self.thumborhost:
 if not self.thumbor_wiki_list or '-'.join((proj, lang)) in 
self.thumbor_wiki_list:
-# call Thumbor but don't wait for the result
-thumbor_thread = eventlet.spawn(thumbor_opener.open, 
thumbor_encodedurl)
+upcopy = thumbor_opener.open(thumbor_encodedurl)
+else:
+upcopy = opener.open(encodedurl)
+else:
+upcopy = opener.open(encodedurl)
 
-# ok, call the encoded url
-upcopy = opener.open(encodedurl)
-self.collectHttpStatusCodes(original_request_url, thumbor_thread, 
upcopy.getcode())
 except urllib2.HTTPError, error:
 # copy the urllib2 HTTPError into a webob HTTPError class as-is
 
@@ -184,13 +159,11 @@
 headers=error.hdrs.items())
 
 resp = CopiedHTTPError()
-self.collectHttpStatusCodes(original_request_url, thumbor_thread, 
resp.code)
 return resp
 except urllib2.URLError, error:
 msg = 'There was a problem while contacting the image scaler: %s' 
% \
   error.reason
 resp = webob.exc.HTTPServiceUnavailable(msg)
-self.collectHttpStatusCodes(original_request_url, thumbor_thread, 
resp.code)
 return resp
 
 # get the Content-Type.

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

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

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


[MediaWiki-commits] [Gerrit] pywikibot/core[master]: weblinkchecker.py: Sorting of carriage returns

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

Change subject: weblinkchecker.py: Sorting of carriage returns
..


weblinkchecker.py: Sorting of carriage returns

Bug: T166934
Change-Id: I0e662deafdf00e1d68eb064232b2166d8e628a80
---
M scripts/weblinkchecker.py
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/scripts/weblinkchecker.py b/scripts/weblinkchecker.py
index e261164..c1618a5 100755
--- a/scripts/weblinkchecker.py
+++ b/scripts/weblinkchecker.py
@@ -793,7 +793,7 @@
 '{lightaqua}** Reporting dead link on {0}...{default}',
 talkPage.title(asLink=True)))
 try:
-content = talkPage.get() + "\n\n"
+content = talkPage.get() + "\n\n\n"
 if url in content:
 pywikibot.output(color_format(
 '{lightaqua}** Dead link seems to have already '
@@ -824,7 +824,7 @@
 i += 1
 count = u' ' + str(i)
 caption += count
-content += '\n\n== %s ==\n\n%s\n\n%s%s--' % \
+content += '== %s ==\n\n%s\n\n%s%s\n--' % \
(caption,
 i18n.twtranslate(containingPage.site,
  'weblinkchecker-report'),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e662deafdf00e1d68eb064232b2166d8e628a80
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Framawiki 
Gerrit-Reviewer: Framawiki 
Gerrit-Reviewer: John Vandenberg 
Gerrit-Reviewer: Magul 
Gerrit-Reviewer: Xqt 
Gerrit-Reviewer: Zoranzoki21 
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...CentralAuth[master]: Avoid master queries in beginSecondaryAuthentication()

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

Change subject: Avoid master queries in beginSecondaryAuthentication()
..


Avoid master queries in beginSecondaryAuthentication()

Bug: T92357
Change-Id: Id4474c8050c5e2c686b3ec3eb94f1d703bd79333
---
M includes/CentralAuthSecondaryAuthenticationProvider.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/CentralAuthSecondaryAuthenticationProvider.php 
b/includes/CentralAuthSecondaryAuthenticationProvider.php
index f97be5b..332b42c 100644
--- a/includes/CentralAuthSecondaryAuthenticationProvider.php
+++ b/includes/CentralAuthSecondaryAuthenticationProvider.php
@@ -39,7 +39,7 @@
}
 
public function beginSecondaryAuthentication( $user, array $reqs ) {
-   $centralUser = CentralAuthUser::getMasterInstance( $user );
+   $centralUser = CentralAuthUser::getInstance( $user );
 
// Since logins are rare, check the actual DB
$rename = $centralUser->renameInProgressOn( wfWikiID() );

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

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

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: Element: Work around browsers that set fractional scrollTop ...

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

Change subject: Element: Work around browsers that set fractional scrollTop 
values
..


Element: Work around browsers that set fractional scrollTop values

Change-Id: I41a4d65fe78a5398b835ebb300250a8c7cad3613
---
M src/Element.js
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/src/Element.js b/src/Element.js
index 667ad32..5f61429 100644
--- a/src/Element.js
+++ b/src/Element.js
@@ -607,7 +607,9 @@
scrollTop = body.scrollTop;
body.scrollTop = 1;
 
-   if ( body.scrollTop === 1 ) {
+   // In some browsers (observed in Chrome 56 on Linux Mint 18.1),
+   // body.scrollTop doesn't become exactly 1, but a fractional 
value like 0.76
+   if ( Math.round( body.scrollTop ) === 1 ) {
body.scrollTop = scrollTop;
OO.ui.scrollableElement = 'body';
} else {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I41a4d65fe78a5398b835ebb300250a8c7cad3613
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make DeferredUpdates detect LBFactory transaction rounds

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

Change subject: Make DeferredUpdates detect LBFactory transaction rounds
..

Make DeferredUpdates detect LBFactory transaction rounds

Previously, tryOpportunisticExecute() tried to nest transaction rounds,
which would fail. Added LBFactory::hasTransactionRound() as needed.

Also cleaned up some unqualified class names in callbacks and set the
PRESEND flag for the JobQueueDB AutoCommitUpdate callback. Use the
proper getMasterDB() method while at it. These follow up 24842cfac.

Bug: T154425
Change-Id: Ib1d38f68bd217903d1a7d46fb15b7d7d9620daa6
---
M includes/MediaWiki.php
M includes/deferred/DeferredUpdates.php
M includes/jobqueue/JobQueueDB.php
M includes/jobqueue/JobRunner.php
M includes/libs/rdbms/lbfactory/ILBFactory.php
M includes/libs/rdbms/lbfactory/LBFactory.php
6 files changed, 32 insertions(+), 17 deletions(-)


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

diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 2125c23..364ed86 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -898,9 +898,8 @@
__METHOD__
);
 
-   // Push lazilly-pushed jobs
// Important: this must be the last deferred update added 
(T100085, T154425)
-   DeferredUpdates::addCallableUpdate( [ 'JobQueueGroup', 
'pushLazyJobs' ] );
+   DeferredUpdates::addCallableUpdate( [ JobQueueGroup::class, 
'pushLazyJobs' ] );
 
// Do any deferred jobs
DeferredUpdates::doUpdates( 'enqueue' );
diff --git a/includes/deferred/DeferredUpdates.php 
b/includes/deferred/DeferredUpdates.php
index 51f5a28..a3a37f6 100644
--- a/includes/deferred/DeferredUpdates.php
+++ b/includes/deferred/DeferredUpdates.php
@@ -286,7 +286,7 @@
}
 
// Avoiding running updates without them having outer scope
-   if ( !self::getBusyDbConnections() ) {
+   if ( !self::areDatabaseTransactionsActive() ) {
self::doUpdates( $mode );
return true;
}
@@ -356,16 +356,19 @@
}
 
/**
-* @return IDatabase[] Connection where commit() cannot be called yet
+* @return bool If a transaction round is active or connection is not 
ready for commit()
 */
-   private static function getBusyDbConnections() {
-   $connsBusy = [];
-
+   private static function areDatabaseTransactionsActive() {
$lbFactory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+   if ( $lbFactory->hasTransactionRound() ) {
+   return true;
+   }
+
+   $connsBusy = false;
$lbFactory->forEachLB( function ( LoadBalancer $lb ) use ( 
&$connsBusy ) {
$lb->forEachOpenMasterConnection( function ( IDatabase 
$conn ) use ( &$connsBusy ) {
if ( $conn->writesOrCallbacksPending() || 
$conn->explicitTrxActive() ) {
-   $connsBusy[] = $conn;
+   $connsBusy = true;
}
} );
} );
diff --git a/includes/jobqueue/JobQueueDB.php b/includes/jobqueue/JobQueueDB.php
index 5e45730..9b9928d 100644
--- a/includes/jobqueue/JobQueueDB.php
+++ b/includes/jobqueue/JobQueueDB.php
@@ -185,13 +185,16 @@
 * @return void
 */
protected function doBatchPush( array $jobs, $flags ) {
-   DeferredUpdates::addUpdate( new AutoCommitUpdate(
-   wfGetDB( DB_MASTER ),
-   __METHOD__,
-   function ( IDatabase $dbw, $fname ) use ( $jobs, $flags 
) {
-   $this->doBatchPushInternal( $dbw, $jobs, 
$flags, $fname );
-   }
-   ) );
+   DeferredUpdates::addUpdate(
+   new AutoCommitUpdate(
+   $this->getMasterDB(),
+   __METHOD__,
+   function ( IDatabase $dbw, $fname ) use ( 
$jobs, $flags ) {
+   $this->doBatchPushInternal( $dbw, 
$jobs, $flags, $fname );
+   }
+   ),
+   DeferredUpdates::PRESEND
+   );
}
 
/**
diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php
index 0a0e9e0..ff90a9e 100644
--- a/includes/jobqueue/JobRunner.php
+++ b/includes/jobqueue/JobRunner.php
@@ -289,9 +289,8 @@
$status = $job->run();
$error = $job->getLastError();

[MediaWiki-commits] [Gerrit] oojs/ui[master]: WikimedaUI: Pull in and use upstream WikimediaUI package

2017-06-08 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357965 )

Change subject: WikimedaUI: Pull in and use upstream WikimediaUI package
..

WikimedaUI: Pull in and use upstream WikimediaUI package

Bug: T165650
Change-Id: Icb4d62fad46e6b243155a29fcb070490ae8387d2
---
M Gruntfile.js
M package.json
A src/themes/wikimediaui/wikimedia-ui-base.less
3 files changed, 12 insertions(+), 2 deletions(-)


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

diff --git a/Gruntfile.js b/Gruntfile.js
index b135740..2d2f366 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -302,7 +302,7 @@
},
demos: {
// Make sure you update this if dependencies 
are added
-   src: 
'{node_modules/{jquery,oojs}/dist/**/*,composer.json,dist/**/*,php/**/*,node_modules/prismjs/**/*}',
+   src: 
'{node_modules/{jquery,oojs}/dist/**/*,wikimedia-ui-base/wikimedia-ui-base.less,composer.json,dist/**/*,php/**/*,node_modules/prismjs/**/*}',
dest: 'demos/',
expand: true
},
@@ -313,6 +313,13 @@
'README.md'
],
dest: 'dist/'
+   },
+   wikimediaui: {
+   flatten: true,
+   src: [
+   
'node_modules/wikimedia-ui-base/wikimedia-ui-base.less'
+   ],
+   dest: 'dist/wikimedia-ui-base.less'
},
// Copies the necessary vendor/ files for demos without 
running "composer install"
fastcomposerdemos: {
@@ -612,6 +619,7 @@
'clean:build', 'fileExists', 'tyops', 'build-code', 
'build-styling', 'build-i18n',
'concat:omnibus',
'copy:dist',
+   'copy:wikimediaui',
'clean:tmp', 'demos'
] );
 
diff --git a/package.json b/package.json
index 7a18873..5d04b17 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,8 @@
   },
   "dependencies": {
 "jquery": "3.2.1",
-"oojs": "2.1.0"
+"oojs": "2.1.0",
+   "wikimedia-ui-base": "0.9.2"
   },
   "devDependencies": {
 "eslint-config-wikimedia": "0.4.0",
diff --git a/src/themes/wikimediaui/wikimedia-ui-base.less 
b/src/themes/wikimediaui/wikimedia-ui-base.less
new file mode 12
index 000..036066f
--- /dev/null
+++ b/src/themes/wikimediaui/wikimedia-ui-base.less
@@ -0,0 +1 @@
+node_modules/wikimedia-ui-base/wikimedia-ui-base.less
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb4d62fad46e6b243155a29fcb070490ae8387d2
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Jforrester 

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: Element: Work around browsers that set fractional scrollTop ...

2017-06-08 Thread Catrope (Code Review)
Catrope has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357964 )

Change subject: Element: Work around browsers that set fractional scrollTop 
values
..

Element: Work around browsers that set fractional scrollTop values

Change-Id: I41a4d65fe78a5398b835ebb300250a8c7cad3613
---
M src/Element.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/64/357964/1

diff --git a/src/Element.js b/src/Element.js
index 667ad32..5f61429 100644
--- a/src/Element.js
+++ b/src/Element.js
@@ -607,7 +607,9 @@
scrollTop = body.scrollTop;
body.scrollTop = 1;
 
-   if ( body.scrollTop === 1 ) {
+   // In some browsers (observed in Chrome 56 on Linux Mint 18.1),
+   // body.scrollTop doesn't become exactly 1, but a fractional 
value like 0.76
+   if ( Math.round( body.scrollTop ) === 1 ) {
body.scrollTop = scrollTop;
OO.ui.scrollableElement = 'body';
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41a4d65fe78a5398b835ebb300250a8c7cad3613
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Catrope 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: UsersMultiSelectWidget: Port from CapsuleMultiselectWidget t...

2017-06-08 Thread Catrope (Code Review)
Catrope has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357963 )

Change subject: UsersMultiSelectWidget: Port from CapsuleMultiselectWidget to 
MenuTagMultiselectWidget
..

UsersMultiSelectWidget: Port from CapsuleMultiselectWidget to 
MenuTagMultiselectWidget

Bonus:
* Remove puzzling code that claimed to fix a bug that I couldn't reproduce
  but instead made single-character searches never display suggestions
* Clear the input after choosing a menu item

Change-Id: I44e72205880d152639ee823238dc5ab84d34402b
---
M includes/widget/UsersMultiselectWidget.php
M resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js
2 files changed, 21 insertions(+), 18 deletions(-)


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

diff --git a/includes/widget/UsersMultiselectWidget.php 
b/includes/widget/UsersMultiselectWidget.php
index d24ab7b..999cb6a 100644
--- a/includes/widget/UsersMultiselectWidget.php
+++ b/includes/widget/UsersMultiselectWidget.php
@@ -53,7 +53,7 @@
 
public function getConfig( &$config ) {
if ( $this->usersArray !== null ) {
-   $config['data'] = $this->usersArray;
+   $config['selected'] = $this->usersArray;
}
if ( $this->inputName !== null ) {
$config['name'] = $this->inputName;
diff --git 
a/resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js 
b/resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js
index d7464b9..c1676b8 100644
--- a/resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js
+++ b/resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js
@@ -14,7 +14,7 @@
 * newline-separated usernames.
 *
 * @class
-* @extends OO.ui.CapsuleMultiselectWidget
+* @extends OO.ui.MenuTagMultiselectWidget
 *
 * @constructor
 * @param {Object} [config] Configuration options
@@ -57,16 +57,12 @@
 
// Events
// Update contents of autocomplete menu as user types letters
-   this.$input.on( {
+   this.input.$input.on( {
keyup: this.updateMenuItems.bind( this )
-   } );
-   // When option is selected from autocomplete menu, update the 
menu
-   this.menu.connect( this, {
-   select: 'updateMenuItems'
} );
// When list of selected usernames changes, update hidden input
this.connect( this, {
-   change: 'updateHiddenInput'
+   change: 'onMultiselectChange'
} );
 
// API init
@@ -75,7 +71,7 @@
 
/* Setup */
 
-   OO.inheritClass( mw.widgets.UsersMultiselectWidget, 
OO.ui.CapsuleMultiselectWidget );
+   OO.inheritClass( mw.widgets.UsersMultiselectWidget, 
OO.ui.MenuTagMultiselectWidget );
OO.mixinClass( mw.widgets.UsersMultiselectWidget, 
OO.ui.mixin.PendingElement );
 
/* Methods */
@@ -83,10 +79,10 @@
/**
 * Get currently selected usernames
 *
-* @return {Array} usernames
+* @return {string[]} usernames
 */
mw.widgets.UsersMultiselectWidget.prototype.getSelectedUsernames = 
function () {
-   return this.getItemsData();
+   return this.getValue();
};
 
/**
@@ -95,7 +91,7 @@
 * @private
 */
mw.widgets.UsersMultiselectWidget.prototype.updateMenuItems = function 
() {
-   var inputValue = this.$input.val();
+   var inputValue = this.input.getValue();
 
if ( inputValue === this.inputValue ) {
// Do not restart api query if nothing has changed in 
the input
@@ -134,12 +130,9 @@
 
// Remove all items from menu add fill it with 
new
this.menu.clearItems();
-
-   // Additional check to prevent bug of 
autoinserting first suggestion
-   // while removing user from the list
-   if ( inputValue.length > 1 || 
suggestions.length > 1 ) {
-   this.menu.addItems( suggestions );
-   }
+   this.menu.addItems( suggestions );
+   // Make the menu visible; it might not be if it 
was previously empty
+   this.menu.toggle( true );
 
this.popPending();
}.bind( this ) ).fail( this.popPending.bind( this ) );
@@ -160,4 +153,14 @@
}
};
 
+   /**
+* React to the 'change' event.
+*
+* Updates the hidden 

[MediaWiki-commits] [Gerrit] mediawiki...CodeReview[master]: Use short array syntax

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

Change subject: Use short array syntax
..


Use short array syntax

Done by phpcbf over composer fix

Change-Id: I3879b6807d4df927295cbbc2b59547b6f59c09b3
---
M .gitignore
M CodeReview.alias.php
M CodeReviewHooks.php
M phpcs.xml
4 files changed, 272 insertions(+), 273 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index 455433b..4f0a566 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
 .*.swp
 node_modules/
 vendor/
+composer.lock
diff --git a/CodeReview.alias.php b/CodeReview.alias.php
index b593ad3..18ba29c 100644
--- a/CodeReview.alias.php
+++ b/CodeReview.alias.php
@@ -5,380 +5,379 @@
  * @file
  * @ingroup Extensions
  */
-// @codingStandardsIgnoreFile
 
-$specialPageAliases = array();
+$specialPageAliases = [];
 
 /** English (English) */
-$specialPageAliases['en'] = array(
-   'Code' => array( 'Code', 'CodeReview' ),
-   'RepoAdmin' => array( 'RepoAdmin' ),
-);
+$specialPageAliases['en'] = [
+   'Code' => [ 'Code', 'CodeReview' ],
+   'RepoAdmin' => [ 'RepoAdmin' ],
+];
 
 /** Arabic (العربية) */
-$specialPageAliases['ar'] = array(
-   'Code' => array( 'كود', 'مراجعة_الكود' ),
-   'RepoAdmin' => array( 'إدارة_المستودع' ),
-);
+$specialPageAliases['ar'] = [
+   'Code' => [ 'كود', 'مراجعة_الكود' ],
+   'RepoAdmin' => [ 'إدارة_المستودع' ],
+];
 
 /** Egyptian Arabic (مصرى) */
-$specialPageAliases['arz'] = array(
-   'Code' => array( 'كود', 'مراجعة_الكود' ),
-   'RepoAdmin' => array( 'ادارة_المستودع' ),
-);
+$specialPageAliases['arz'] = [
+   'Code' => [ 'كود', 'مراجعة_الكود' ],
+   'RepoAdmin' => [ 'ادارة_المستودع' ],
+];
 
 /** Assamese (অসমীয়া) */
-$specialPageAliases['as'] = array(
-   'Code' => array( 'কোড', 'কোডৰিভিউ' ),
-);
+$specialPageAliases['as'] = [
+   'Code' => [ 'কোড', 'কোডৰিভিউ' ],
+];
 
 /** Avaric (авар) */
-$specialPageAliases['av'] = array(
-   'Code' => array( 'Код' ),
-);
+$specialPageAliases['av'] = [
+   'Code' => [ 'Код' ],
+];
 
 /** Western Balochi (بلوچی رخشانی) */
-$specialPageAliases['bgn'] = array(
-   'Code' => array( 'کوڈ' ),
-   'RepoAdmin' => array( 'خزانه_ئی_مدیر' ),
-);
+$specialPageAliases['bgn'] = [
+   'Code' => [ 'کوڈ' ],
+   'RepoAdmin' => [ 'خزانه_ئی_مدیر' ],
+];
 
 /** Banjar (Bahasa Banjar) */
-$specialPageAliases['bjn'] = array(
-   'Code' => array( 'Kode' ),
-);
+$specialPageAliases['bjn'] = [
+   'Code' => [ 'Kode' ],
+];
 
 /** Breton (brezhoneg) */
-$specialPageAliases['br'] = array(
-   'Code' => array( 'Kod' ),
-);
+$specialPageAliases['br'] = [
+   'Code' => [ 'Kod' ],
+];
 
 /** Bosnian (bosanski) */
-$specialPageAliases['bs'] = array(
-   'Code' => array( 'Kod', 'PregledKoda' ),
-   'RepoAdmin' => array( 'RepoAdministracija' ),
-);
+$specialPageAliases['bs'] = [
+   'Code' => [ 'Kod', 'PregledKoda' ],
+   'RepoAdmin' => [ 'RepoAdministracija' ],
+];
 
 /** Min Dong Chinese (Mìng-dĕ̤ng-ngṳ̄) */
-$specialPageAliases['cdo'] = array(
-   'Code' => array( '代碼' ),
-);
+$specialPageAliases['cdo'] = [
+   'Code' => [ '代碼' ],
+];
 
 /** Chechen (нохчийн) */
-$specialPageAliases['ce'] = array(
-   'Code' => array( 'Код' ),
-);
+$specialPageAliases['ce'] = [
+   'Code' => [ 'Код' ],
+];
 
 /** German (Deutsch) */
-$specialPageAliases['de'] = array(
-   'Code' => array( 'Quelltext', 'Quelltextprüfung' ),
-   'RepoAdmin' => array( 'Repositoriumsverwaltung' ),
-);
+$specialPageAliases['de'] = [
+   'Code' => [ 'Quelltext', 'Quelltextprüfung' ],
+   'RepoAdmin' => [ 'Repositoriumsverwaltung' ],
+];
 
 /** Zazaki (Zazaki) */
-$specialPageAliases['diq'] = array(
-   'Code' => array( 'Qode', 'VerasayışaQoder' ),
-   'RepoAdmin' => array( 'AdminéRepoy' ),
-);
+$specialPageAliases['diq'] = [
+   'Code' => [ 'Qode', 'VerasayışaQoder' ],
+   'RepoAdmin' => [ 'AdminéRepoy' ],
+];
 
 /** Lower Sorbian (dolnoserbski) */
-$specialPageAliases['dsb'] = array(
-   'Code' => array( 'Žrědłowy_tekst' ),
-);
+$specialPageAliases['dsb'] = [
+   'Code' => [ 'Žrědłowy_tekst' ],
+];
 
 /** Esperanto (Esperanto) */
-$specialPageAliases['eo'] = array(
-   'Code' => array( 'Kodo' ),
-);
+$specialPageAliases['eo'] = [
+   'Code' => [ 'Kodo' ],
+];
 
 /** Spanish (español) */
-$specialPageAliases['es'] = array(
-   'Code' => array( 'Código', 'RevisarCódigo' ),
-);
+$specialPageAliases['es'] = [
+   'Code' => [ 'Código', 'RevisarCódigo' ],
+];
 
 /** Basque (euskara) */
-$specialPageAliases['eu'] = array(
-   'Code' => array( 'Kodea' ),
-);
+$specialPageAliases['eu'] = [
+   'Code' => [ 'Kodea' ],
+];
 
 /** Persian (فارسی) */
-$specialPageAliases['fa'] = array(
-   'Code' => array( 'کد' ),
-   'RepoAdmin' => array( 'مدیر_مخزن' ),
-);

[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Always use braces after if

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

Change subject: Always use braces after if
..


Always use braces after if

Makes if blocks more readable

Change-Id: Ic15e469107736eae21aaa45c27d57669ef7b16a1
---
M api/FlaggedRevsApi.hooks.php
M backend/FRExtraCacheUpdate.php
M backend/FRUserCounters.php
M backend/FlaggedRevision.php
M frontend/FlaggablePageView.php
M frontend/FlaggedRevsStableLogFormatter.php
M frontend/FlaggedRevsUI.hooks.php
M frontend/specialpages/reports/ProblemChanges_body.php
M frontend/specialpages/reports/QualityOversight_body.php
M maintenance/updateTracking.php
M phpcs.xml
11 files changed, 62 insertions(+), 26 deletions(-)

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



diff --git a/api/FlaggedRevsApi.hooks.php b/api/FlaggedRevsApi.hooks.php
index e7c8135..bfd9c3f 100644
--- a/api/FlaggedRevsApi.hooks.php
+++ b/api/FlaggedRevsApi.hooks.php
@@ -43,8 +43,9 @@
foreach ( $data as $pageid => $page ) {
if ( array_key_exists( 'revisions', (array)$page ) ) {
foreach ( $page['revisions'] as $index => $rev 
) {
-   if ( array_key_exists( 'revid', 
(array)$rev ) )
+   if ( array_key_exists( 'revid', 
(array)$rev ) ) {

$pageids[$pageid][$rev['revid']] = $index;
+   }
}
}
}
diff --git a/backend/FRExtraCacheUpdate.php b/backend/FRExtraCacheUpdate.php
index bfc6662..9e27e55 100644
--- a/backend/FRExtraCacheUpdate.php
+++ b/backend/FRExtraCacheUpdate.php
@@ -53,8 +53,9 @@
if ( $row ) {
$id = $row[0];
$last = $id; // $id is the last page_id 
of this batch
-   if ( $first === false )
+   if ( $first === false ) {
$first = $id; // set first 
page_id of this batch
+   }
# Out of rows?
} else {
$id = false;
@@ -91,7 +92,9 @@
 */
public function invalidateIDs( ResultWrapper $res ) {
global $wgUseFileCache, $wgUseSquid;
-   if ( $res->numRows() == 0 ) return; // sanity check
+   if ( $res->numRows() == 0 ) {
+   return; // sanity check
+   }
 
$dbw = wfGetDB( DB_MASTER );
$timestamp = $dbw->timestamp();
@@ -109,7 +112,9 @@
break;
}
}
-   if ( count( $ids ) == 0 ) break;
+   if ( count( $ids ) == 0 ) {
+   break;
+   }
# Update page_touched
$dbw->update( 'page', [ 'page_touched' => $timestamp ],
[ 'page_id' => $ids ], __METHOD__ );
diff --git a/backend/FRUserCounters.php b/backend/FRUserCounters.php
index b714f58..75d0c87 100644
--- a/backend/FRUserCounters.php
+++ b/backend/FRUserCounters.php
@@ -65,7 +65,9 @@
$options = [];
if ( $flags & FR_MASTER || $flags & FR_FOR_UPDATE ) {
$db = wfGetDB( DB_MASTER, [], $dBName );
-   if ( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE';
+   if ( $flags & FR_FOR_UPDATE ) {
+   $options[] = 'FOR UPDATE';
+   }
} else {
$db = wfGetDB( DB_SLAVE, [], $dBName );
}
diff --git a/backend/FlaggedRevision.php b/backend/FlaggedRevision.php
index 08b7ebc..88411e3 100644
--- a/backend/FlaggedRevision.php
+++ b/backend/FlaggedRevision.php
@@ -107,7 +107,9 @@
# User master/slave as appropriate...
if ( $flags & FR_FOR_UPDATE || $flags & FR_MASTER ) {
$db = wfGetDB( DB_MASTER );
-   if ( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE';
+   if ( $flags & FR_FOR_UPDATE ) {
+   $options[] = 'FOR UPDATE';
+   }
$pageId = $title->getArticleID( Title::GAID_FOR_UPDATE 
);
} else {
$db = wfGetDB( DB_SLAVE );
@@ -155,7 +157,9 @@
# User master/slave as appropriate...
if ( $flags & FR_FOR_UPDATE || $flags & FR_MASTER ) {
$db = wfGetDB( 

[MediaWiki-commits] [Gerrit] mediawiki...Petition[master]: Add phpcs and make pass

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

Change subject: Add phpcs and make pass
..


Add phpcs and make pass

Change-Id: I1c55f273826304228f5cfabffbb0a01b3cf26863
---
M Petition.alias.php
M Petition.php
M PetitionHooks.php
M SpecialPetition.php
M SpecialPetitionData.php
M composer.json
A phpcs.xml
7 files changed, 74 insertions(+), 63 deletions(-)

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



diff --git a/Petition.alias.php b/Petition.alias.php
index fb33640..f0e8830 100644
--- a/Petition.alias.php
+++ b/Petition.alias.php
@@ -6,11 +6,10 @@
  * @ingroup Extensions
  */
 
-$specialPageAliases = array();
+$specialPageAliases = [];
 
 /** English */
-$specialPageAliases['en'] = array(
-   'Petition' => array( 'Petition' ),
-   'PetitionData' => array( 'PetitionData' )
-);
-
+$specialPageAliases['en'] = [
+   'Petition' => [ 'Petition' ],
+   'PetitionData' => [ 'PetitionData' ]
+];
diff --git a/Petition.php b/Petition.php
index 600c331..7f2ff54 100644
--- a/Petition.php
+++ b/Petition.php
@@ -5,10 +5,11 @@
$wgMessagesDirs['Petition'] = __DIR__ . '/i18n';
$wgExtensionMessagesFiles['PetitionAlias'] = __DIR__ . 
'/Petition.alias.php';
/*wfWarn(
-   'Deprecated PHP entry point used for Petition extension. Please 
use wfLoadExtension instead, ' .
+   'Deprecated PHP entry point used for Petition extension. ' .
+   'Please use wfLoadExtension instead, ' .
'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
);*/
return;
 } else {
die( 'This version of the Petition extension requires MediaWiki 1.25+' 
);
-}
\ No newline at end of file
+}
diff --git a/PetitionHooks.php b/PetitionHooks.php
index 3510e57..5d998c7 100644
--- a/PetitionHooks.php
+++ b/PetitionHooks.php
@@ -9,4 +9,4 @@
$updater->addExtensionTable( 'petition_data', __DIR__ . 
'/table.sql', true );
return true;
}
-}
\ No newline at end of file
+}
diff --git a/SpecialPetition.php b/SpecialPetition.php
index 8a9ddc6..91e1273 100755
--- a/SpecialPetition.php
+++ b/SpecialPetition.php
@@ -30,26 +30,26 @@
 
$countries = SpecialPetition::getCountryArray( 
$this->getLanguage()->getCode() );
$form = SpecialPetition::defineForm( $petitionName, $source, 
$countries );
-   $form->setSubmitCallback( array( $this, 'petitionSubmit' ) );
+   $form->setSubmitCallback( [ $this, 'petitionSubmit' ] );
 
$form->prepareForm();
 
$result = $form->tryAuthorizedSubmit();
 
if ( $result === true || ( $result instanceof Status && 
$result->isGood() ) ) {
-   $htmlOut = '' . 
wfMessage('petition-done')->text() . '';
+   $htmlOut = '' . wfMessage( 
'petition-done' )->text() . '';
} else {
$htmlOut = '' . "\n";
$numberOfSignatures = 
SpecialPetition::getNumberOfSignatures( $petitionName );
$htmlOut .= '';
-   $htmlOut .= wfMessage('petition-num-signatures', 
$numberOfSignatures)->escaped();
+   $htmlOut .= wfMessage( 'petition-num-signatures', 
$numberOfSignatures )->escaped();
$htmlOut .= '' . "\n";
// Add the form, with any errors if there was an 
attempted submission
-   $htmlOut .= $form->getHtml($result) . "\n";
+   $htmlOut .= $form->getHtml( $result ) . "\n";
$htmlOut .= '' . "\n";
}
 
-   $out->addHtml($htmlOut);
+   $out->addHtml( $htmlOut );
 
}
 
@@ -64,15 +64,15 @@
global $wgPetitionDatabase;
 
if ( $this->getUser()->pingLimiter( 'edit' ) ) {
-   return wfMessage('actionthrottledtext')->text();
+   return wfMessage( 'actionthrottledtext' )->text();
}
 
-   $dbw = wfGetDB( DB_MASTER, array(), $wgPetitionDatabase );
+   $dbw = wfGetDB( DB_MASTER, [], $wgPetitionDatabase );
if ( $dbw->isReadOnly() ) {
throw new ReadOnlyError();
}
 
-   $dbw->insert( 'petition_data', array(
+   $dbw->insert( 'petition_data', [
'pt_petitionname' => $formData['petitionname'],
'pt_source'   => $formData['source'],
'pt_name' => $formData['name'],
@@ -81,8 +81,9 @@
'pt_message'  => 
$formData['personalmessage'],
'pt_share'=> $formData['share'],

[MediaWiki-commits] [Gerrit] mediawiki...ContributionTracking[master]: Add phpcs and make pass

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

Change subject: Add phpcs and make pass
..


Add phpcs and make pass

Change-Id: I6521ab780b64b724a3342b8d795d0bd13f32051d
---
M ApiContributionTracking.php
M ContributionTracking.hooks.php
M ContributionTracking.php
M ContributionTracking.processor.php
M ContributionTracking_Tester.php
M ContributionTracking_body.php
M composer.json
A phpcs.xml
M special/SpecialFundraiserMaintenance.php
9 files changed, 149 insertions(+), 139 deletions(-)

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



diff --git a/ApiContributionTracking.php b/ApiContributionTracking.php
index fbb91c9..6ed4812 100644
--- a/ApiContributionTracking.php
+++ b/ApiContributionTracking.php
@@ -30,7 +30,7 @@
 
foreach ( $params as $key => $value ) {
if ( $value === '' ) {
-   unset( $params[$key] ); //gotcha. And might I 
add: BOO-URNS.
+   unset( $params[$key] ); // gotcha. And might I 
add: BOO-URNS.
}
}
return $params;
@@ -42,18 +42,18 @@
 * @param array $params Original (staged) request paramaters.
 */
function doReturn( $id, $params ) {
-// foreach ($params as $key=>$value){
-// if ($value != ''){
-// $this->getResult()->addValue(array('returns', 
'parrot'), $key, $value);
-// }
-// }
+   // foreach ($params as $key=>$value){
+   //  if ($value != ''){
+   //  $this->getResult()->addValue(array('returns', 
'parrot'), $key, $value);
+   //  }
+   // }
$params['contribution_tracking_id'] = $id;
 
$repost = ContributionTrackingProcessor::getRepostFields( 
$params );
 
-   $this->getResult()->addValue( array( 'returns', 'action' ), 
'url', $repost['action'] );
+   $this->getResult()->addValue( [ 'returns', 'action' ], 'url', 
$repost['action'] );
foreach ( $repost['fields'] as $key => $value ) {
-   $this->getResult()->addValue( array( 'returns', 
'fields' ), $key, $value );
+   $this->getResult()->addValue( [ 'returns', 'fields' ], 
$key, $value );
}
}
 
@@ -62,101 +62,101 @@
 * @return array An array of parameters allowed by 
ApiContributionTracking
 */
public function getAllowedParams() {
-   return array(
-   'amount' => array(
+   return [
+   'amount' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true,
-   ),
-   'referrer' => array(
+   ],
+   'referrer' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true,
-   ),
-   'gateway' => array(
+   ],
+   'gateway' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true,
-   ),
-   'comment' => array(
+   ],
+   'comment' => [
ApiBase::PARAM_TYPE => 'string',
-   ),
-   'comment-option' => array(
+   ],
+   'comment-option' => [
ApiBase::PARAM_TYPE => 'boolean',
-   ),
-   'utm_source' => array(
+   ],
+   'utm_source' => [
ApiBase::PARAM_TYPE => 'string',
-   ),
-   'utm_medium' => array(
+   ],
+   'utm_medium' => [
ApiBase::PARAM_TYPE => 'string',
-   ),
-   'utm_campaign' => array(
+   ],
+   'utm_campaign' => [
ApiBase::PARAM_TYPE => 'string',
-   ),
-   'utm_key' => array(
+   ],
+   'utm_key' => [
ApiBase::PARAM_TYPE => 'string',
-   ),
-   'payments_form' => array(
+   ],
+   'payments_form' => [
ApiBase::PARAM_TYPE => 'string',
-   ),
-

[MediaWiki-commits] [Gerrit] mediawiki...CodeReview[master]: Use short array syntax - api / backend

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

Change subject: Use short array syntax - api / backend
..


Use short array syntax - api / backend

Done by phpcbf over composer fix

Change-Id: I9931f60a11cef61fdf82c8226de6ffb6b24ca9f6
---
M api/ApiCodeDiff.php
M api/ApiCodeUpdate.php
M api/ApiQueryCodeComments.php
M api/ApiQueryCodePaths.php
M api/ApiQueryCodeRevisions.php
M api/ApiQueryCodeTags.php
M api/ApiRevisionUpdate.php
M backend/CodeComment.php
M backend/CodeCommentLinker.php
M backend/CodeRepository.php
M backend/CodeRevision.php
M backend/CodeSignoff.php
M backend/DiffHighlighter.php
M backend/RepoStats.php
M backend/Subversion.php
15 files changed, 380 insertions(+), 380 deletions(-)

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



diff --git a/api/ApiCodeDiff.php b/api/ApiCodeDiff.php
index 46a5c42..451db8a 100644
--- a/api/ApiCodeDiff.php
+++ b/api/ApiCodeDiff.php
@@ -23,7 +23,7 @@
global $wgCodeReviewMaxDiffSize;
 
// Before doing anything at all, let's check permissions
-   if ( is_callable( array( $this, 'checkUserRightsAny' ) ) ) {
+   if ( is_callable( [ $this, 'checkUserRightsAny' ] ) ) {
$this->checkUserRightsAny( 'codereview-use' );
} else {
if ( !$this->getUser()->isAllowed( 'codereview-use' ) ) 
{
@@ -34,8 +34,8 @@
 
$repo = CodeRepository::newFromName( $params['repo'] );
if ( !$repo ) {
-   if ( is_callable( array( $this, 'dieWithError' ) ) ) {
-   $this->dieWithError( array( 
'apierror-invalidrepo', wfEscapeWikiText( $params['repo'] ) ) );
+   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
+   $this->dieWithError( [ 'apierror-invalidrepo', 
wfEscapeWikiText( $params['repo'] ) ] );
} else {
$this->dieUsage( "Invalid repo 
``{$params['repo']}''", 'invalidrepo' );
}
@@ -44,8 +44,8 @@
$lastStoredRev = $repo->getLastStoredRev();
 
if ( $params['rev'] > $lastStoredRev ) {
-   if ( is_callable( array( $this, 'dieWithError' ) ) ) {
-   $this->dieWithError( array( 
'apierror-nosuchrevid', $params['rev'] ) );
+   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
+   $this->dieWithError( [ 'apierror-nosuchrevid', 
$params['rev'] ] );
} else {
$this->dieUsage( "There is no revision with ID 
{$params['rev']}", 'nosuchrev' );
}
@@ -63,35 +63,35 @@
$html = $hilite->render( $diff );
}
 
-   $data = array(
+   $data = [
'repo' => $params['repo'],
'id' => $params['rev'],
'diff' => $html
-   );
+   ];
$this->getResult()->addValue( 'code', 'rev', $data );
}
 
public function getAllowedParams() {
-   return array(
-   'repo' => array(
+   return [
+   'repo' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true,
-   ),
-   'rev' => array(
+   ],
+   'rev' => [
ApiBase::PARAM_TYPE => 'integer',
ApiBase::PARAM_MIN => 1,
ApiBase::PARAM_REQUIRED => true,
-   )
-   );
+   ]
+   ];
}
 
/**
 * @see ApiBase::getExamplesMessages()
 */
protected function getExamplesMessages() {
-   return array(
+   return [
'action=codediff=MediaWiki=42080'
=> 'apihelp-codediff-example-1',
-   );
+   ];
}
 }
diff --git a/api/ApiCodeUpdate.php b/api/ApiCodeUpdate.php
index 51500ed..4a6a0a6 100644
--- a/api/ApiCodeUpdate.php
+++ b/api/ApiCodeUpdate.php
@@ -22,7 +22,7 @@
 
public function execute() {
// Before doing anything at all, let's check permissions
-   if ( is_callable( array( $this, 'checkUserRightsAny' ) ) ) {
+   if ( is_callable( [ $this, 'checkUserRightsAny' ] ) ) {
$this->checkUserRightsAny( 'codereview-use' );
} else {
if ( !$this->getUser()->isAllowed( 'codereview-use' ) ) 
{
@@ -33,8 +33,8 @@
 

[MediaWiki-commits] [Gerrit] mediawiki...CodeReview[master]: Use short array syntax - ui

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

Change subject: Use short array syntax - ui
..


Use short array syntax - ui

Done by phpcbf over composer fix

Change-Id: If4a2b2e4e71fec484145c7f053869567416b8a10
---
M ui/CodeCommentsListView.php
M ui/CodeReleaseNotes.php
M ui/CodeRepoStatsView.php
M ui/CodeRevisionAuthorLink.php
M ui/CodeRevisionAuthorView.php
M ui/CodeRevisionCommitter.php
M ui/CodeRevisionListView.php
M ui/CodeRevisionView.php
M ui/CodeStatusChangeListView.php
M ui/CodeTagListView.php
M ui/CodeView.php
M ui/SpecialCode.php
M ui/SpecialRepoAdmin.php
M ui/WordCloud.php
14 files changed, 193 insertions(+), 193 deletions(-)

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



diff --git a/ui/CodeCommentsListView.php b/ui/CodeCommentsListView.php
index c2bfd4a..d09bfa3 100644
--- a/ui/CodeCommentsListView.php
+++ b/ui/CodeCommentsListView.php
@@ -18,20 +18,20 @@
}
 
function getQueryInfo() {
-   $query = array(
-   'tables' => array( 'code_comment', 'code_rev' ),
+   $query = [
+   'tables' => [ 'code_comment', 'code_rev' ],
'fields' => array_keys( $this->getFieldNames() ),
-   'conds' => array( 'cc_repo_id' => $this->mRepo->getId() 
),
-   'join_conds' => array(
-   'code_rev' => array( 'LEFT JOIN', 'cc_repo_id = 
cr_repo_id AND cc_rev_id = cr_id' )
-   ),
-   'options' => array(),
-   );
+   'conds' => [ 'cc_repo_id' => $this->mRepo->getId() ],
+   'join_conds' => [
+   'code_rev' => [ 'LEFT JOIN', 'cc_repo_id = 
cr_repo_id AND cc_rev_id = cr_id' ]
+   ],
+   'options' => [],
+   ];
 
if ( count( $this->mView->mPath ) ) {
$query['tables'][] = 'code_paths';
-   $query['join_conds']['code_paths'] = array( 'INNER 
JOIN',
-   'cc_repo_id = cp_repo_id AND cc_rev_id = 
cp_rev_id' );
+   $query['join_conds']['code_paths'] = [ 'INNER JOIN',
+   'cc_repo_id = cp_repo_id AND cc_rev_id = 
cp_rev_id' ];
$query['conds']['cp_path'] = $this->mView->mPath;
}
if ( $this->mView->mAuthor ) {
@@ -44,20 +44,20 @@
function getCountQuery() {
$query = $this->getQueryInfo();
 
-   $query['fields'] = array( 'COUNT( DISTINCT cc_id ) AS 
rev_count' );
+   $query['fields'] = [ 'COUNT( DISTINCT cc_id ) AS rev_count' ];
unset( $query['options']['GROUP BY'] );
return $query;
}
 
function getFieldNames() {
-   return array(
+   return [
'cc_timestamp' => $this->msg( 'code-field-timestamp' 
)->text(),
'cc_user_text' => $this->msg( 'code-field-user' 
)->text(),
'cc_rev_id' => $this->msg( 'code-field-id' )->text(),
'cr_status' => $this->msg( 'code-field-status' 
)->text(),
'cr_message' => $this->msg( 'code-field-message' 
)->text(),
'cc_text' => $this->msg( 'code-field-text' )->text()
-   );
+   ];
}
 
function formatValue( $name, $value ) {
diff --git a/ui/CodeReleaseNotes.php b/ui/CodeReleaseNotes.php
index 8f7f7b1..6cf1f51 100644
--- a/ui/CodeReleaseNotes.php
+++ b/ui/CodeReleaseNotes.php
@@ -31,7 +31,7 @@
global $wgOut, $wgScript;
$special = SpecialPage::getTitleFor( 'Code', 
$this->mRepo->getName() . '/releasenotes' );
$wgOut->addHTML(
-   Xml::openElement( 'form', array( 'action' => $wgScript, 
'method' => 'get' ) ) .
+   Xml::openElement( 'form', [ 'action' => $wgScript, 
'method' => 'get' ] ) .
'' . wfMessage( 'code-release-legend' 
)->escaped() . '' .
Html::hidden( 'title', 
$special->getPrefixedDBkey() ) . '' .
Xml::inputLabel( wfMessage( 
'code-release-startrev' )->text(), 'startrev',
@@ -51,7 +51,7 @@
protected function showReleaseNotes() {
global $wgOut;
$dbr = wfGetDB( DB_SLAVE );
-   $where = array();
+   $where = [];
if ( $this->mEndRev ) {
$where[] = 'cr_id BETWEEN ' . intval( $this->mStartRev 
) . ' AND ' .
intval( $this->mEndRev );
@@ -63,18 +63,18 @@
}
# Select commits within this range...
 

[MediaWiki-commits] [Gerrit] mediawiki...CodeReview[master]: Use short array syntax - maintenance / tests

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

Change subject: Use short array syntax - maintenance / tests
..


Use short array syntax - maintenance / tests

Done by phpcbf over composer fix

Change-Id: I61d68040dc90fd58e77d2763d2dc7164404882f8
---
M maintenance/bulkStatusUpdate.php
M maintenance/deleteBadTags.php
M maintenance/getRevisionDiffs.php
M maintenance/populateCaUserColumn.php
M maintenance/populateFollowupRevisions.php
M maintenance/repopulateCodePaths.php
M maintenance/showEmails.php
M maintenance/svnImport.php
M tests/phpunit/CodeReviewApiTest.php
M tests/phpunit/CodeReviewTest.php
M tests/phpunit/DiffHighlighterTest.php
11 files changed, 53 insertions(+), 53 deletions(-)

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



diff --git a/maintenance/bulkStatusUpdate.php b/maintenance/bulkStatusUpdate.php
index 79d2389..257bb6c 100644
--- a/maintenance/bulkStatusUpdate.php
+++ b/maintenance/bulkStatusUpdate.php
@@ -67,7 +67,7 @@
$res = $dbr->select(
'code_rev',
'*',
-   array( 'cr_id' => $revisions, 'cr_repo_id' => 
$repo->getId() ),
+   [ 'cr_id' => $revisions, 'cr_repo_id' => $repo->getId() 
],
__METHOD__
);
 
diff --git a/maintenance/deleteBadTags.php b/maintenance/deleteBadTags.php
index 08f9a7e..ef5f9f7 100644
--- a/maintenance/deleteBadTags.php
+++ b/maintenance/deleteBadTags.php
@@ -17,7 +17,7 @@
public function execute() {
$dbw = wfGetDB( DB_MASTER );
$dbw->begin( __METHOD__ );
-   $dbw->delete( 'code_tags', array( 'ct_tag' => '' ), __METHOD__ 
);
+   $dbw->delete( 'code_tags', [ 'ct_tag' => '' ], __METHOD__ );
$count = $dbw->affectedRows();
 
$this->output( "Deleting empty tags...\n" );
diff --git a/maintenance/getRevisionDiffs.php b/maintenance/getRevisionDiffs.php
index c7c5e34..405675a 100644
--- a/maintenance/getRevisionDiffs.php
+++ b/maintenance/getRevisionDiffs.php
@@ -32,7 +32,7 @@
$res = $dbr->select(
'code_rev',
'cr_id',
-   array( 'cr_repo_id' => $repo->getId(), 'cr_diff IS 
NULL' ),
+   [ 'cr_repo_id' => $repo->getId(), 'cr_diff IS NULL' ],
__METHOD__
);
 
diff --git a/maintenance/populateCaUserColumn.php 
b/maintenance/populateCaUserColumn.php
index acb2943..4e7d951 100644
--- a/maintenance/populateCaUserColumn.php
+++ b/maintenance/populateCaUserColumn.php
@@ -43,10 +43,10 @@
$res = $dbr->select(
'code_authors',
'ca_user_text',
-   array(
+   [
'ca_repo_id' => $repo->getId(),
'ca_user' => 0
-   ),
+   ],
__METHOD__
);
 
@@ -77,11 +77,11 @@
 
$dbw->update(
'code_authors',
-   array( 'ca_user' => $userId ),
-   array(
+   [ 'ca_user' => $userId ],
+   [
'ca_repo_id' => $repo->getId(),
'ca_user_text' => $row->ca_user_text
-   ),
+   ],
__METHOD__
);
}
diff --git a/maintenance/populateFollowupRevisions.php 
b/maintenance/populateFollowupRevisions.php
index 0005f45..9ea7cce 100644
--- a/maintenance/populateFollowupRevisions.php
+++ b/maintenance/populateFollowupRevisions.php
@@ -50,7 +50,7 @@
$res = $dbr->select(
'code_rev',
'*',
-   array( 'cr_id' => $revisions, 'cr_repo_id' => 
$repo->getId() ),
+   [ 'cr_id' => $revisions, 'cr_repo_id' => $repo->getId() 
],
__METHOD__
);
 
diff --git a/maintenance/repopulateCodePaths.php 
b/maintenance/repopulateCodePaths.php
index cb45a85..5786f9b 100644
--- a/maintenance/repopulateCodePaths.php
+++ b/maintenance/repopulateCodePaths.php
@@ -44,7 +44,7 @@
$res = $dbr->select(
'code_paths',
'*',
-   array( 'cp_rev_id' => $revisions, 'cp_repo_id' => 
$repo->getId() ),
+   [ 'cp_rev_id' => $revisions, 'cp_repo_id' => 
$repo->getId() ],
__METHOD__
);
 
@@ -53,7 +53,7 @@
 
foreach ( $res as $row ) {
 

[MediaWiki-commits] [Gerrit] mediawiki...GettingStarted[master]: Add phpcs and make pass

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

Change subject: Add phpcs and make pass
..


Add phpcs and make pass

Change-Id: I0c817a6613658e29a16a656e63c6ff20e6936585
---
M BasePageFilter.php
M CategoryPageFilter.php
M CategoryPageSuggester.php
M Hooks.php
M MoreLikePageSuggester.php
M PageSuggesterFactory.php
M RedisCategorySync.php
M TaskRecommendationsExperimentV1.php
M composer.json
A phpcs.xml
10 files changed, 64 insertions(+), 54 deletions(-)

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



diff --git a/BasePageFilter.php b/BasePageFilter.php
index 9e3a20b..e1ac2e5 100644
--- a/BasePageFilter.php
+++ b/BasePageFilter.php
@@ -6,9 +6,9 @@
 use User;
 
 /**
-  Approve or reject a given page for suitability with GettingStarted.
-  Base filter shared for all task types
-*/
+ * Approve or reject a given page for suitability with GettingStarted.
+ * Base filter shared for all task types
+ */
 class BasePageFilter {
/** @var User */
protected $user;
@@ -34,11 +34,11 @@
$articleID = $title->getArticleID();
$excludedCategories = self::getExcludedCategories();
$dbr = wfGetDB( DB_SLAVE );
-   foreach( $excludedCategories as $cat ) {
-   $res = $dbr->selectRow( 'categorylinks', '1', array(
+   foreach ( $excludedCategories as $cat ) {
+   $res = $dbr->selectRow( 'categorylinks', '1', [
'cl_from' => $articleID,
'cl_to' => $cat,
-   ), __METHOD__ );
+   ], __METHOD__ );
 
if ( $res !== false ) {
return true;
@@ -55,8 +55,8 @@
// TODO (phuedx 2014-02-010) Create a collection class
// for categories, which could be generalised in the
// future, i.e. CategoryCollection.
-   self::$excludedCategories = array();
-   foreach( $wgGettingStartedExcludedCategories as 
$rawCategory ) {
+   self::$excludedCategories = [];
+   foreach ( $wgGettingStartedExcludedCategories as 
$rawCategory ) {
// Canonicalize the category name.
$title = Title::newFromText( $rawCategory );
if ( !$title || !$title->inNamespace( 
NS_CATEGORY ) ) {
diff --git a/CategoryPageFilter.php b/CategoryPageFilter.php
index 687566b..5fa458e 100644
--- a/CategoryPageFilter.php
+++ b/CategoryPageFilter.php
@@ -5,9 +5,9 @@
 use Title;
 
 /**
-   Approve or reject a given page for suitability with GettingStarted.
-   For use in conjunction with CategoryPageSuggester
-*/
+ * Approve or reject a given page for suitability with GettingStarted.
+ * For use in conjunction with CategoryPageSuggester
+ */
 class CategoryPageFilter extends BasePageFilter {
const MAX_PAGE_LENGTH = 1;
 
diff --git a/CategoryPageSuggester.php b/CategoryPageSuggester.php
index cec6bae..1835f2d 100644
--- a/CategoryPageSuggester.php
+++ b/CategoryPageSuggester.php
@@ -27,21 +27,21 @@
 
if ( !$this->redisConnection ) {
wfDebugLog( 'GettingStarted', "Unable to acquire redis 
connection.  Returning early.\n" );
-   return array();
+   return [];
}
 
try {
$randomArticleIDs = 
$this->redisConnection->sRandMember( $key, $count );
} catch ( RedisException $e ) {
wfDebugLog( 'GettingStarted', 'Redis exception: ' . 
$e->getMessage() . ".  Returning early.\n" );
-   return array();
+   return [];
}
 
if ( is_array( $randomArticleIDs ) ) {
return \Title::newFromIDs( $randomArticleIDs );
} else {
wfDebugLog( 'GettingStarted', 'Redis returned a 
non-array value, possibly an error.' );
-   return array();
+   return [];
}
}
 
diff --git a/Hooks.php b/Hooks.php
index 960f355..e01c992 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -35,10 +35,10 @@
 
const USER_TOKEN_COOKIE_NAME = '-gettingStartedUserId';
 
-   protected static $COOKIE_OPTIONS = array(
+   protected static $COOKIE_OPTIONS = [
'prefix' => '',
'path' => '/',
-   );
+   ];
 
const INTRO_OPTION = 'gettingstarted-task-toolbar-show-intro';
 
@@ -68,7 +68,7 @@
$cookie = $request->getCookie( self::OPENTASK_COOKIE_NAME, '' );
$tasks = FormatJson::decode( $cookie, true );
if ( 

[MediaWiki-commits] [Gerrit] mediawiki...GettingStarted[master]: Make phpcs pass - api / maintenance / tests

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

Change subject: Make phpcs pass - api / maintenance / tests
..


Make phpcs pass - api / maintenance / tests

Change-Id: I9608c0655d7423df162d0804a6cec0b9ef178fa1
---
M api/ApiGettingStartedGetPages.php
M maintenance/dump_redis.php
M maintenance/generate_config.php
M maintenance/populate_categories.php
M tests/phpunit/TaskRecommendationsExperimentV1Test.php
5 files changed, 47 insertions(+), 48 deletions(-)

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



diff --git a/api/ApiGettingStartedGetPages.php 
b/api/ApiGettingStartedGetPages.php
index edcb095..338559e 100644
--- a/api/ApiGettingStartedGetPages.php
+++ b/api/ApiGettingStartedGetPages.php
@@ -16,9 +16,9 @@
public function execute() {
$result = $this->getResult();
 
-   $data = array(
-   'titles' => array()
-   );
+   $data = [
+   'titles' => []
+   ];
 
$titles = $this->getArticles();
 
@@ -75,13 +75,13 @@
$attempts = 0;
$offset = 0;
$isRandomized = $suggester->isRandomized();
-   $filteredTitles = array();
+   $filteredTitles = [];
 
do {
$unfilteredTitles = $suggester->getArticles( $numWanted 
- $totalResultCount, $offset );
 
$newFilteredTitles = array_filter( $unfilteredTitles,
-   array( $pageFilter, 'isAllowedPage' )
+   [ $pageFilter, 'isAllowedPage' ]
);
$newFilteredTitles = array_udiff( $newFilteredTitles, 
$filteredTitles,
function ( $t1, $t2 ) {
@@ -113,44 +113,44 @@
}
 
public function getDescription() {
-   return array(
+   return [
'This API is for getting a list of one or more pages 
related to a ' .
'particular GettingStarted task.',
-   );
+   ];
}
 
public function getParamDescription() {
-   return array(
+   return [
'taskname' => 'Task name, generally either "copyedit" 
(copy-editing suggestions) or ' .
' "morelike" (pages similar to the base 
page/excluded title)',
'excludedtitle' => 'Full title of a page to exclude 
from the list; also used as the ' .
'base title for recommendations based on a 
given page',
'count' => 'Requested count; will attempt to fetch this 
exact number, but may fetch ' .
'fewer if no more are found after multiple 
attempts',
-   );
+   ];
}
 
public function getAllowedParams() {
-   return array(
-   'taskname' => array(
+   return [
+   'taskname' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true,
-   ),
-   'excludedtitle' => array(
+   ],
+   'excludedtitle' => [
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => false,
-   ),
-   'count' => array(
+   ],
+   'count' => [
ApiBase::PARAM_TYPE => 'integer',
ApiBase::PARAM_REQUIRED => true,
-   ),
-   );
+   ],
+   ];
}
 
public function getExamples() {
-   return array(
+   return [

'api.php?action=query=gettingstartedgetpages=copyedit' .
'=Earth=1',
-   );
+   ];
}
 }
diff --git a/maintenance/dump_redis.php b/maintenance/dump_redis.php
index fdbe4a9..214de53 100755
--- a/maintenance/dump_redis.php
+++ b/maintenance/dump_redis.php
@@ -16,7 +16,7 @@
  */
 
 $IP = getenv( 'MW_INSTALL_PATH' );
-if( $IP === false ) {
+if ( $IP === false ) {
$IP = __DIR__ . '/../../..';
 }
 
diff --git a/maintenance/generate_config.php b/maintenance/generate_config.php
index bb1cd5f..588095e 100644
--- a/maintenance/generate_config.php
+++ b/maintenance/generate_config.php
@@ -14,7 +14,7 @@
 use Title;
 
 $IP = getenv( 'MW_INSTALL_PATH' );
-if( $IP === false ) {
+if ( $IP === false ) {
$IP = __DIR__ . '/../../..';
 }
 
@@ -33,9 +33,9 @@
 * (see $wgGettingStartedTasks) and 

[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Make phpcs pass - classes

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

Change subject: Make phpcs pass - classes
..


Make phpcs pass - classes

Short array syntax will be used in follow ups
to keep this patch set small

Change-Id: I91a63277eae052dbb503f80b94cfd4fff3081941
---
M classes/DeletionController.php
M classes/Dispatch.php
M classes/HistoricalThread.php
M classes/Hooks.php
M classes/Thread.php
M classes/ThreadHistoryPager.php
M classes/View.php
7 files changed, 125 insertions(+), 121 deletions(-)

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



diff --git a/classes/DeletionController.php b/classes/DeletionController.php
index 22d7479..2ee0af1 100644
--- a/classes/DeletionController.php
+++ b/classes/DeletionController.php
@@ -30,7 +30,7 @@
} elseif ( $thread->replies() ) {
foreach ( $thread->replies() as $reply ) {
$reply->setSuperthread( $thread->superthread() 
);
-   $reply->save( );
+   $reply->save();
}
}
 
diff --git a/classes/Dispatch.php b/classes/Dispatch.php
index faeef52..fd64b64 100644
--- a/classes/Dispatch.php
+++ b/classes/Dispatch.php
@@ -44,8 +44,9 @@
$viewname = 'TalkpageView';
} elseif ( !$lqt_action && (
( !in_array( $action, $lqt_actions ) && $action 
) ||
-   $request->getVal( 'diff', null ) !== null  ||
-   $request->getVal( 'oldid', null ) !== null ) ) {
+   $request->getVal( 'diff', null ) !== null ||
+   $request->getVal( 'oldid', null ) !== null )
+   ) {
// Pass through wrapper
$viewname = 'TalkpageHeaderView';
} elseif ( $action == 'protect' || $action == 'unprotect' ) {
diff --git a/classes/HistoricalThread.php b/classes/HistoricalThread.php
index 6d25622..61cc289 100644
--- a/classes/HistoricalThread.php
+++ b/classes/HistoricalThread.php
@@ -60,7 +60,6 @@
return true;
}
 
-
function changeType() {
return $this->changeType;
}
diff --git a/classes/Hooks.php b/classes/Hooks.php
index 0b43ca9..58c623e 100644
--- a/classes/Hooks.php
+++ b/classes/Hooks.php
@@ -247,8 +247,8 @@
}
 
static function modifyOAIQuery( &$tables, &$fields, &$conds,
-   &$options, &$join_conds ) {
-
+   &$options, &$join_conds
+   ) {
$tables[] = 'thread';
 
$join_conds['thread'] = array( 'left join', array( 
'thread_root=page_id' ) );
@@ -284,7 +284,7 @@
 */
public static function onUserRename( $renameUserSQL ) {
// Always use the job queue, talk page edits will take forever
-   foreach( self::$userTables as $table => $fields ) {
+   foreach ( self::$userTables as $table => $fields ) {
$renameUserSQL->tablesJob[$table] = $fields;
}
return true;
@@ -303,7 +303,7 @@
 */
public static function onUserMergeAccountFields( &$updateFields ) {
// array( tableName, idField, textField )
-   foreach( self::$userTables as $table => $fields ) {
+   foreach ( self::$userTables as $table => $fields ) {
$updateFields[] = array( $table, $fields[1], $fields[0] 
);
}
return true;
@@ -389,7 +389,7 @@
if ( $updater instanceof PostgresUpdater ) {
$updater->addExtensionTable( 'thread', 
"$dir/lqt.pg.sql" );
$updater->addExtensionTable( 'thread_history',
-   
"$dir/schema-changes/thread_history_table.pg.sql"  );
+   
"$dir/schema-changes/thread_history_table.pg.sql" );
$updater->addExtensionTable( 
'thread_pending_relationship',

"$dir/schema-changes/thread_pending_relationship.pg.sql" );
$updater->addExtensionTable( 'thread_reaction',
@@ -582,30 +582,31 @@
 * @return bool
 */
static function onPageContentSaveComplete( &$article, &$user, $content, 
$summary,
-   $minoredit, $watchthis, $sectionanchor, &$flags, 
$revision,
-   &$status, $baseRevId ) {
-   if ( !$status->isGood() ) {
-   // Failed
-   return true;
-   }
+   $minoredit, $watchthis, $sectionanchor, &$flags, $revision,
+   &$status, $baseRevId
+   ) {
+   if ( !$status->isGood() 

[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Use short array syntax

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

Change subject: Use short array syntax
..


Use short array syntax

Done by phpcbf over composer fix

Change-Id: Ib1f296fa78b67e286a5c80ad651352d17131b8c7
---
M api/ApiFeedLQTThreads.php
M api/ApiQueryLQTThreads.php
M api/ApiThreadAction.php
M i18n/LiquidThreads.magic.php
M i18n/Lqt.alias.php
M i18n/Lqt.namespaces.php
M migrateDatabase.php
M phpcs.xml
8 files changed, 708 insertions(+), 710 deletions(-)

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



diff --git a/api/ApiFeedLQTThreads.php b/api/ApiFeedLQTThreads.php
index beddbb5..744e928 100644
--- a/api/ApiFeedLQTThreads.php
+++ b/api/ApiFeedLQTThreads.php
@@ -54,14 +54,14 @@
 
$feedTitle = $this->createFeedTitle( $params );
$feedClass = $wgFeedClasses[$params['feedformat']];
-   $feedItems = array();
+   $feedItems = [];
 
$feedUrl = Title::newMainPage()->getFullURL();
 
-   $tables = array( 'thread' );
-   $fields = array( $db->tableName( 'thread' ) . ".*" );
+   $tables = [ 'thread' ];
+   $fields = [ $db->tableName( 'thread' ) . ".*" ];
$conds = $this->getConditions( $params, $db );
-   $options = array( 'LIMIT' => 200, 'ORDER BY' => 'thread_created 
DESC' );
+   $options = [ 'LIMIT' => 200, 'ORDER BY' => 'thread_created 
DESC' ];
 
$res = $db->select( $tables, $fields, $conds, __METHOD__, 
$options );
 
@@ -112,7 +112,7 @@
}
 
public function createFeedTitle( $params ) {
-   $fromPlaces = array();
+   $fromPlaces = [];
 
foreach ( (array)$params['thread'] as $thread ) {
$t = Title::newFromText( $thread );
@@ -136,7 +136,7 @@
// What's included?
$types = (array)$params['type'];
 
-   if ( !count( array_diff( array( 'replies', 'newthreads' ), 
$types ) ) ) {
+   if ( !count( array_diff( [ 'replies', 'newthreads' ], $types ) 
) ) {
$msg = 'lqt-feed-title-all';
} elseif ( in_array( 'replies', $types ) ) {
$msg = 'lqt-feed-title-replies';
@@ -159,7 +159,7 @@
 * @return array
 */
function getConditions( $params, $db ) {
-   $conds = array();
+   $conds = [];
 
// Types
$conds['thread_type'] = Threads::TYPE_NORMAL;
@@ -170,22 +170,22 @@
$conds[] = 'thread_created > ' . $db->addQuotes( $cutoff );
 
// Talkpage conditions
-   $pageConds = array();
+   $pageConds = [];
 
$talkpages = (array)$params['talkpage'];
foreach ( $talkpages as $page ) {
$title = Title::newFromText( $page );
if ( !$title ) {
if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
-   $this->dieWithError( array( 
'apierror-invalidtitle', wfEscapeWikiText( $page ) ) );
+   $this->dieWithError( [ 
'apierror-invalidtitle', wfEscapeWikiText( $page ) ] );
} else {
-   $this->dieUsageMsg( array( 
'invalidtitle', $page ) );
+   $this->dieUsageMsg( [ 'invalidtitle', 
$page ] );
}
}
-   $pageCond = array(
+   $pageCond = [
'thread_article_namespace' => 
$title->getNamespace(),
'thread_article_title' => $title->getDBkey()
-   );
+   ];
$pageConds[] = $db->makeList( $pageCond, LIST_AND );
}
 
@@ -199,10 +199,10 @@
continue;
}
 
-   $threadCond = array(
+   $threadCond = [
'thread_ancestor' => $thread->id(),
'thread_id' => $thread->id()
-   );
+   ];
$pageConds[] = $db->makeList( $threadCond, LIST_OR );
}
if ( count( $pageConds ) ) {
@@ -223,42 +223,42 @@
public function getAllowedParams() {
global $wgFeedClasses;
$feedFormatNames = array_keys( $wgFeedClasses );
-   return array(
-   'feedformat' => array(
+   return [
+   'feedformat' => [
ApiBase :: PARAM_DFLT => 'rss',
  

[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Use short array syntax - classes

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

Change subject: Use short array syntax - classes
..


Use short array syntax - classes

Done by phpcbf over composer fix

Change-Id: Ia30ef80cc11190297d8652712456d1cf992d8124
---
M classes/DeletionController.php
M classes/Dispatch.php
M classes/HistoricalThread.php
M classes/Hooks.php
M classes/LogFormatter.php
M classes/NewMessagesController.php
M classes/ParserFunctions.php
M classes/Thread.php
M classes/ThreadHistoryPager.php
M classes/ThreadRevision.php
M classes/Threads.php
M classes/View.php
12 files changed, 463 insertions(+), 463 deletions(-)

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



diff --git a/classes/DeletionController.php b/classes/DeletionController.php
index 2ee0af1..2b9bed8 100644
--- a/classes/DeletionController.php
+++ b/classes/DeletionController.php
@@ -9,7 +9,7 @@
return true;
}
 
-   $threads = Threads::where( array( 'thread_root' => $id ) );
+   $threads = Threads::where( [ 'thread_root' => $id ] );
 
if ( !count( $threads ) ) {
wfDebugLog( 'LiquidThreads', __METHOD__ . ": no threads 
with root $id, ignoring...\n" );
@@ -75,7 +75,7 @@
 
// TX has not been committed yet, so we must select 
from the master
$dbw = wfGetDB( DB_MASTER );
-   $res = $dbw->select( 'thread', '*', array( 
'thread_root' => $pageid ), __METHOD__ );
+   $res = $dbw->select( 'thread', '*', [ 'thread_root' => 
$pageid ], __METHOD__ );
$threads = Threads::loadFromResult( $res, $dbw );
 
if ( count( $threads ) ) {
diff --git a/classes/Dispatch.php b/classes/Dispatch.php
index fd64b64..dfaa9e2 100644
--- a/classes/Dispatch.php
+++ b/classes/Dispatch.php
@@ -2,7 +2,7 @@
 
 class LqtDispatch {
/** static cache of per-page LiquidThreads activation setting */
-   public static $userLqtOverride = array();
+   public static $userLqtOverride = [];
public static $primaryView = null;
 
/**
@@ -33,7 +33,7 @@
$action = $request->getVal( 'action', 'view' );
 
// Actions handled by LQT.
-   $lqt_actions = array( 'view', 'protect', 'unprotect' );
+   $lqt_actions = [ 'view', 'protect', 'unprotect' ];
 
$lqt_action = $request->getVal( 'lqt_method' );
if ( $action == 'edit' && $request->getVal( 'section' ) == 
'new' ) {
@@ -144,7 +144,7 @@
 
$isTalkPage = $isTalkPage && !$title->isRedirect();
 
-   Hooks::run( 'LiquidThreadsIsLqtPage', array( $title, 
&$isTalkPage ) );
+   Hooks::run( 'LiquidThreadsIsLqtPage', [ $title, &$isTalkPage ] 
);
 
return $isTalkPage;
}
@@ -186,10 +186,10 @@
$row = $dbr->selectRow(
'page_props',
'pp_value',
-   array(
+   [
'pp_propname' => 'use-liquid-threads',
'pp_page' => $articleid
-   ),
+   ],
__METHOD__
);
 
diff --git a/classes/HistoricalThread.php b/classes/HistoricalThread.php
index 61cc289..8042030 100644
--- a/classes/HistoricalThread.php
+++ b/classes/HistoricalThread.php
@@ -24,7 +24,7 @@
$this->revisionNumber = $t->revisionNumber;
$this->editedness = $t->editedness;
 
-   $this->replies = array();
+   $this->replies = [];
foreach ( $t->replies() as $r ) {
$this->replies[] = new HistoricalThread( $r );
}
@@ -44,10 +44,10 @@
$line = $dbr->selectRow(
'historical_thread',
'hthread_contents',
-   array(
+   [
'hthread_id' => $id,
'hthread_revision' => $rev
-   ),
+   ],
__METHOD__ );
if ( $line ) {
return HistoricalThread::fromTextRepresentation( 
$line->hthread_contents );
diff --git a/classes/Hooks.php b/classes/Hooks.php
index 58c623e..340cf2e 100644
--- a/classes/Hooks.php
+++ b/classes/Hooks.php
@@ -14,19 +14,19 @@
 */
public static $editArticle = null;
public static $editTalkpage = null;
-   public static $scriptVariables = array();
+   public static $scriptVariables = [];
 
-   public static $editedStati = array(
+   public static $editedStati = [
Threads::EDITED_NEVER => 'never',

[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Use short array syntax - pages

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

Change subject: Use short array syntax - pages
..


Use short array syntax - pages

Done by phpcbf over composer fix

Change-Id: Ib23b716a8efdbd589af96ed941f80fab18031c6e
---
M pages/IndividualThreadHistoryView.php
M pages/NewUserMessagesView.php
M pages/SpecialMergeThread.php
M pages/SpecialMoveThread.php
M pages/SpecialSplitThread.php
M pages/TalkpageHeaderView.php
M pages/TalkpageHistoryView.php
M pages/TalkpageView.php
M pages/ThreadActionPage.php
M pages/ThreadDiffView.php
M pages/ThreadHistoricalRevisionView.php
M pages/ThreadPermalinkView.php
12 files changed, 164 insertions(+), 164 deletions(-)

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



diff --git a/pages/IndividualThreadHistoryView.php 
b/pages/IndividualThreadHistoryView.php
index 0a6bf8f..b5d7e24 100644
--- a/pages/IndividualThreadHistoryView.php
+++ b/pages/IndividualThreadHistoryView.php
@@ -41,7 +41,7 @@
return false;
}
 
-   $wgHooks['PageHistoryBeforeList'][] = array( $this, 
'customizeSubtitle' );
+   $wgHooks['PageHistoryBeforeList'][] = [ $this, 
'customizeSubtitle' ];
 
return true;
}
diff --git a/pages/NewUserMessagesView.php b/pages/NewUserMessagesView.php
index 38ee3de..2abeea0 100644
--- a/pages/NewUserMessagesView.php
+++ b/pages/NewUserMessagesView.php
@@ -13,13 +13,13 @@
$html .= Html::hidden( 'lqt_operand', $ids_s );
$html .= Xml::submitButton(
$label,
-   array(
+   [
'name' => 'lqt_read_button',
'title' => $title,
'class' => 'lqt-read-button'
-   )
+   ]
);
-   $html = Xml::tags( 'form', array( 'method' => 'post', 'class' 
=> $class ), $html );
+   $html = Xml::tags( 'form', [ 'method' => 'post', 'class' => 
$class ], $html );
 
return $html;
}
@@ -29,7 +29,7 @@
wfMessage( 'lqt-read-all' )->text(),
wfMessage( 'lqt-read-all-tooltip' )->text(),
'lqt_newmessages_read_all_button',
-   array( 'all' )
+   [ 'all' ]
);
}
 
@@ -52,15 +52,15 @@
$html .= Html::hidden( 'lqt_operand', $operand );
$html .= ' ' . Xml::submitButton(
wfMessage( 'lqt-email-undo' )->text(),
-   array(
+   [
'name' => 'lqt_read_button',
'title' => wfMessage( 'lqt-email-info-undo' 
)->text()
-   )
+   ]
);
 
$html = Xml::tags(
'form',
-   array( 'method' => 'post', 'class' => 
'lqt_undo_mark_as_read' ),
+   [ 'method' => 'post', 'class' => 
'lqt_undo_mark_as_read' ],
$html
);
 
@@ -172,8 +172,8 @@
$contextLink = $linkRenderer->makeKnownLink(
$title,
new HtmlArmor( wfMessage( 'lqt-newmessages-context' 
)->parse() ),
-   array(),
-   array( 'offset' => $offset )
+   [],
+   [ 'offset' => $offset ]
);
 
$talkpageLink = $linkRenderer->makeLink( 
$topmostThread->getTitle() );
@@ -183,14 +183,14 @@
$leftColumn = Xml::tags( 'p', null, $read_button ) .
Xml::tags( 'p', null, 
$contextLink ) .
$talkpageInfo;
-   $leftColumn = Xml::tags( 'td', array( 'class' => 
'lqt-newmessages-left' ),
+   $leftColumn = Xml::tags( 'td', [ 'class' => 
'lqt-newmessages-left' ],

$leftColumn );
$html = "$leftColumn";
$this->output->addHTML( $html );
 
$mustShowThreads = $this->highlightThreads;
 
-   $this->showThread( $t, 1, 1, array( 'mustShowThreads' => 
$mustShowThreads ) );
+   $this->showThread( $t, 1, 1, [ 'mustShowThreads' => 
$mustShowThreads ] );
$this->output->addModules( 'ext.liquidThreads.newMessages' );
$this->output->addHTML( "" );
}
@@ -219,20 +219,20 @@
 
$threads = Thread::bulkLoad( $rows );
$thread_ids = array_keys( $threads );
-   $output = array();
+   $output = [];
 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: WIP: deprecate $wgExperimentalHtmlIds

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

Change subject: WIP: deprecate $wgExperimentalHtmlIds
..

WIP: deprecate $wgExperimentalHtmlIds

Bug: T167470
Change-Id: I443d449fc2b0b7c62512f10d42545f4d9e4b8b31
---
M includes/DefaultSettings.php
M includes/Sanitizer.php
M includes/api/ApiMain.php
M includes/parser/Parser.php
M tests/parser/ParserTestRunner.php
M tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
6 files changed, 13 insertions(+), 83 deletions(-)


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

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 5b7ca3e..79b4cc6 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3370,13 +3370,7 @@
 $wgDisableOutputCompression = false;
 
 /**
- * Should we allow a broader set of characters in id attributes, per HTML5?  If
- * not, use only HTML 4-compatible IDs.  This option is for testing -- when the
- * functionality is ready, it will be on by default with no option.
- *
- * Currently this appears to work fine in all browsers, but it's disabled by
- * default because it normalizes id's a bit too aggressively, breaking 
preexisting
- * content (particularly Cite).  See T29733, T29694, T29474.
+ * @deprecated Does nothing since 1.30
  */
 $wgExperimentalHtmlIds = false;
 
diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php
index c4883ba..0ecb29a 100644
--- a/includes/Sanitizer.php
+++ b/includes/Sanitizer.php
@@ -1139,10 +1139,8 @@
 
/**
 * Given a value, escape it so that it can be used in an id attribute 
and
-* return it.  This will use HTML5 validation if $wgExperimentalHtmlIds 
is
-* true, allowing anything but ASCII whitespace.  Otherwise it will use
-* HTML 4 rules, which means a narrow subset of ASCII, with bad 
characters
-* escaped with lots of dots.
+* return it.  This will HTML 4 rules, which means a narrow subset of 
ASCII,
+* with bad characters escaped with lots of dots.
 *
 * To ensure we don't have to bother escaping anything, we also strip 
', ",
 * & even if $wgExperimentalIds is true.  TODO: Is this the best tactic?
@@ -1161,29 +1159,14 @@
 * @param string|array $options String or array of strings (default is 
array()):
 *   'noninitial': This is a non-initial fragment of an id, not a full 
id,
 *   so don't pay attention if the first character isn't valid at 
the
-*   beginning of an id.  Only matters if $wgExperimentalHtmlIds is
-*   false.
-*   'legacy': Behave the way the old HTML 4-based ID escaping worked 
even
-*   if $wgExperimentalHtmlIds is used, so we can generate extra
-*   anchors and links won't break.
+*   beginning of an id.
+*   'legacy': Behave the way the old HTML 4-based ID escaping worked.
 * @return string
 */
static function escapeId( $id, $options = [] ) {
-   global $wgExperimentalHtmlIds;
$options = (array)$options;
 
$id = Sanitizer::decodeCharReferences( $id );
-
-   if ( $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) 
) {
-   $id = preg_replace( '/[ \t\n\r\f_\'"

[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Add phpcs and make pass

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

Change subject: Add phpcs and make pass
..


Add phpcs and make pass

Short array syntax will be used in follow ups
to keep this patch set small

Change-Id: If146bed12e73da08727290636fe53146917bc59d
---
M api/ApiFeedLQTThreads.php
M api/ApiQueryLQTThreads.php
M api/ApiThreadAction.php
M composer.json
M i18n/LiquidThreads.magic.php
M i18n/Lqt.alias.php
M i18n/Lqt.namespaces.php
M pages/NewUserMessagesView.php
M pages/SpecialMergeThread.php
M pages/SpecialMoveThread.php
M pages/SpecialSplitThread.php
M pages/TalkpageHistoryView.php
M pages/TalkpageView.php
M pages/ThreadActionPage.php
M pages/ThreadHistoricalRevisionView.php
A phpcs.xml
16 files changed, 67 insertions(+), 39 deletions(-)

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



diff --git a/api/ApiFeedLQTThreads.php b/api/ApiFeedLQTThreads.php
index d7a00e1..beddbb5 100644
--- a/api/ApiFeedLQTThreads.php
+++ b/api/ApiFeedLQTThreads.php
@@ -87,7 +87,6 @@
$user = $thread->author()->getName();
$linkRenderer = 
MediaWikiServices::getInstance()->getLinkRenderer();
 
-
// Prefix content with a quick description
$userLink = Linker::userLink( $thread->author()->getId(), $user 
);
$talkpageLink = $linkRenderer->makeLink( $thread->getTitle() );
@@ -224,26 +223,26 @@
public function getAllowedParams() {
global $wgFeedClasses;
$feedFormatNames = array_keys( $wgFeedClasses );
-   return array (
-   'feedformat' => array (
+   return array(
+   'feedformat' => array(
ApiBase :: PARAM_DFLT => 'rss',
ApiBase :: PARAM_TYPE => $feedFormatNames
),
-   'days' => array (
+   'days' => array(
ApiBase :: PARAM_DFLT => 7,
ApiBase :: PARAM_TYPE => 'integer',
ApiBase :: PARAM_MIN => 1,
ApiBase :: PARAM_MAX => 30,
),
-   'type' => array (
+   'type' => array(
ApiBase :: PARAM_DFLT => 'newthreads',
ApiBase :: PARAM_TYPE => array( 'replies', 
'newthreads' ),
ApiBase :: PARAM_ISMULTI => true,
),
-   'talkpage' => array (
+   'talkpage' => array(
ApiBase :: PARAM_ISMULTI => true,
),
-   'thread' => array (
+   'thread' => array(
ApiBase :: PARAM_ISMULTI => true,
),
);
diff --git a/api/ApiQueryLQTThreads.php b/api/ApiQueryLQTThreads.php
index 14bf7d0..b4275bc 100644
--- a/api/ApiQueryLQTThreads.php
+++ b/api/ApiQueryLQTThreads.php
@@ -187,7 +187,7 @@
__METHOD__
);
 
-   foreach( $res as $row ) {
+   foreach ( $res as $row ) {
$output = $handleRow( $row );
 
$path = array(
@@ -223,7 +223,7 @@
$title = $article->getTitle();
$user = $this->getUser();
$request = $this->getRequest();
-   $view = new LqtView( $out, $article, $title, $user , $request );
+   $view = new LqtView( $out, $article, $title, $user, $request );
 
// Parameters
$view->threadNestingLevel = $params['renderlevel'];
@@ -343,7 +343,7 @@
}
 
public function getAllowedParams() {
-   return array (
+   return array(
'startid' => array(
ApiBase :: PARAM_TYPE => 'integer'
),
diff --git a/api/ApiThreadAction.php b/api/ApiThreadAction.php
index 109da28..ba2f25d 100644
--- a/api/ApiThreadAction.php
+++ b/api/ApiThreadAction.php
@@ -117,7 +117,6 @@
);
}
 
-
$this->getResult()->setIndexedTagName( $result, 'thread' );
$this->getResult()->addValue( null, 'threadaction', $result );
}
@@ -714,7 +713,7 @@
$title = $article->getTitle();
$user = $this->getUser();
$request = $this->getRequest();
-   $view = new LqtView( $out, $article, $title, $user , $request );
+   $view = new LqtView( $out, $article, $title, $user, $request );
 
$view->showThread( $thread );
 
diff --git a/composer.json b/composer.json
index 545b4f7..929c225 

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Implement pywikibot support for adding thanks to normal revi...

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

Change subject: Implement pywikibot support for adding thanks to normal 
revisions
..


Implement pywikibot support for adding thanks to normal revisions

Add methods and tests which enable pywikibot support for thanking
normal revisions.

Bug: T135409
Change-Id: I087f669d7de4ce705c9a6947c82e8b2d51aea09c
---
M pywikibot/page.py
M pywikibot/site.py
A tests/thanks_tests.py
3 files changed, 96 insertions(+), 0 deletions(-)

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



diff --git a/pywikibot/page.py b/pywikibot/page.py
index 4c5d56f..0c8fb44 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -3462,6 +3462,23 @@
item.pageid() > 0
)
 
+@property
+def is_thankable(self):
+"""
+Determine if the user has thanks notifications enabled.
+
+NOTE: This doesn't accurately determine if thanks is enabled for user.
+  Privacy of thanks preferences is under discussion, please see
+  https://phabricator.wikimedia.org/T57401#2216861, and
+  https://phabricator.wikimedia.org/T120753#1863894
+
+@rtype: bool
+"""
+if self.isAnonymous():
+return False
+
+return True
+
 
 class WikibasePage(BasePage):
 
@@ -5167,6 +5184,17 @@
 return Revision.FullHistEntry(self.revid, self.timestamp, self.user,
   self.text, self.rollbacktoken)
 
+@staticmethod
+def _thank(revid, site, source='pywikibot'):
+"""Thank a user for this revision.
+
+@param site: The Site object for this revision.
+@type site: Site
+@param source: An optional source to pass to the API.
+@type source: str
+"""
+site.thank_revision(revid, source)
+
 
 class FileInfo(DotReadableDict):
 
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 7c778c9..48a8877 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -6774,6 +6774,25 @@
 comparison = data['compare']['*']
 return comparison
 
+@need_extension('Thanks')
+def thank_revision(self, revid, source=None):
+"""Corresponding method to the 'action=thank' API action.
+
+@param revid: Revision ID for the revision to be thanked.
+@type revid: int
+@param source: A source for the thanking operation.
+@type source: str
+@raise APIError: On thanking oneself or other API errors.
+@return: The API response.
+"""
+token = self.tokens['csrf']
+req = self._simple_request(action='thank', rev=revid, token=token,
+   source=source)
+data = req.submit()
+if data['result']['success'] != 1:
+raise api.APIError('Thanking unsuccessful')
+return data
+
 # Flow API calls
 @need_extension('Flow')
 def load_board(self, page):
diff --git a/tests/thanks_tests.py b/tests/thanks_tests.py
new file mode 100644
index 000..cab6cb3
--- /dev/null
+++ b/tests/thanks_tests.py
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+"""Tests for thanks-related code."""
+#
+# (C) Pywikibot team, 2016-17
+#
+# Distributed under the terms of the MIT license.
+#
+from __future__ import absolute_import, unicode_literals
+
+from pywikibot.page import Revision, User
+
+from tests.aspects import TestCase
+
+
+class TestThankRevision(TestCase):
+
+"""Test thanks for revisions."""
+
+family = 'test'
+code = 'test'
+
+write = True
+
+def test_thank_revision(self):
+"""Test thanks for normal revisions.
+
+NOTE: This test relies on activity in recentchanges, and
+  there must make edits made before reruns of this test.
+  Please see https://phabricator.wikimedia.org/T137836.
+"""
+found_log = can_thank = False
+site = self.get_site()
+data = site.recentchanges(total=50, reverse=True)
+for i in data:
+revid = i['revid']
+username = i['user']
+user = User(site, username)
+if user.is_thankable:
+can_thank = True
+break
+if not can_thank:
+self.skipTest('There is no recent change which can be test 
thanked.')
+before_time = site.getcurrenttimestamp()
+Revision._thank(revid, site, source='pywikibot test')
+log_entries = site.logevents(logtype='thanks', total=5, 
start=before_time, page=user)
+for __ in log_entries:
+found_log = True
+break
+self.assertTrue(found_log)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I087f669d7de4ce705c9a6947c82e8b2d51aea09c

[MediaWiki-commits] [Gerrit] mediawiki...OpenGraphMeta[master]: Version 0.5.0 -- extension registration support and more

2017-06-08 Thread Jack Phoenix (Code Review)
Jack Phoenix has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357961 )

Change subject: Version 0.5.0 -- extension registration support and more
..

Version 0.5.0 -- extension registration support and more

* Moved PHP code into a new, separate class & file
* Added extension.json for extension registration support
* Added version number to extension credits

MediaWiki 1.25 or newer is now required

Change-Id: Ied8476ee5e0143d78f291d986c7e79abe3c3b1ce
---
A OpenGraphMeta.class.php
M OpenGraphMeta.php
A extension.json
3 files changed, 149 insertions(+), 99 deletions(-)


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

diff --git a/OpenGraphMeta.class.php b/OpenGraphMeta.class.php
new file mode 100644
index 000..1ed31bc
--- /dev/null
+++ b/OpenGraphMeta.class.php
@@ -0,0 +1,101 @@
+http://danf.ca/mw/)
+ * @license https://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
+ * @link https://www.mediawiki.org/wiki/Extension:OpenGraphMeta Documentation
+ */
+
+class OpenGraphMeta {
+
+   public static function onParserFirstCallInit( $parser ) {
+   $parser->setFunctionHook( 'setmainimage', array( __CLASS__, 
'setMainImagePF' ) );
+   return true;
+   }
+
+   public static function setMainImagePF( $parser, $mainImage ) {
+   $parserOutput = $parser->getOutput();
+   if ( isset( $parserOutput->eHasMainImageAlready ) && 
$parserOutput->eHasMainImageAlready ) {
+   return $mainImage;
+   }
+   $file = Title::newFromText( $mainImage, NS_FILE );
+   $parserOutput->addOutputHook( 'setmainimage', array( 'dbkey' => 
$file->getDBkey() ) );
+   $parserOutput->eHasMainImageAlready = true;
+
+   return $mainImage;
+   }
+
+   public static function setMainImagePH( $out, $parserOutput, $data ) {
+   $out->mMainImage = wfFindFile( Title::newFromDBkey( 
$data['dbkey'], NS_FILE ) );
+   }
+
+   public static function onBeforePageDisplay( &$out, &$sk ) {
+   global $wgLogo, $wgSitename, $wgXhtmlNamespaces, 
$egFacebookAppId, $egFacebookAdmins;
+
+   $wgXhtmlNamespaces['og'] = 
'http://opengraphprotocol.org/schema/';
+   $title = $out->getTitle();
+   $isMainpage = $title->isMainPage();
+
+   $meta = array();
+
+   if ( $isMainpage ) {
+   $meta['og:type'] = 'website';
+   $meta['og:title'] = $wgSitename;
+   } else {
+   $meta['og:type'] = 'article';
+   $meta['og:site_name'] = $wgSitename;
+   // Try to chose the most appropriate title for showing 
in news feeds.
+   if (
+   ( defined( 'NS_BLOG_ARTICLE' ) && 
$title->getNamespace() == NS_BLOG_ARTICLE ) ||
+   ( defined( 'NS_BLOG_ARTICLE_TALK' ) && 
$title->getNamespace() == NS_BLOG_ARTICLE_TALK )
+   ) {
+   $meta['og:title'] = $title->getSubpageText();
+   } else {
+   $meta['og:title'] = $title->getText();
+   }
+   }
+
+   if ( isset( $out->mMainImage ) && ( $out->mMainImage !== false 
) ) {
+   if( is_object( $out->mMainImage ) ) {
+   $meta['og:image'] = wfExpandUrl( 
$out->mMainImage->createThumb( 100 * 3, 100 ) );
+   } else {
+   // In some edge-cases we won't have defined an 
object but rather a full URL.
+   $meta['og:image'] = $out->mMainImage;
+   }
+   } elseif ( $isMainpage ) {
+   $meta['og:image'] = wfExpandUrl( $wgLogo );
+   }
+   if ( isset( $out->mDescription ) ) { // set by Description2 
extension, install it if you want proper og:description support
+   $meta['og:description'] = $out->mDescription;
+   }
+   $meta['og:url'] = $title->getFullURL();
+   if ( $egFacebookAppId ) {
+   $meta['fb:app_id'] = $egFacebookAppId;
+   }
+   if ( $egFacebookAdmins ) {
+   $meta['fb:admins'] = $egFacebookAdmins;
+   }
+
+   foreach( $meta as $property => $value ) {
+   if ( $value ) {
+   if ( isset( OutputPage::$metaAttrPrefixes ) && 
isset( OutputPage::$metaAttrPrefixes['property'] ) ) {
+   $out->addMeta( "property:$property", 
$value );
+   } else {
+   

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove unused key in WANObjectCache::newEmpty()

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

Change subject: Remove unused key in WANObjectCache::newEmpty()
..


Remove unused key in WANObjectCache::newEmpty()

Change-Id: I5d11736b95fbba1debcf80f80cbdb4753caf15f7
---
M includes/libs/objectcache/WANObjectCache.php
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/includes/libs/objectcache/WANObjectCache.php 
b/includes/libs/objectcache/WANObjectCache.php
index 423d43ef..6fbe898 100644
--- a/includes/libs/objectcache/WANObjectCache.php
+++ b/includes/libs/objectcache/WANObjectCache.php
@@ -202,8 +202,7 @@
public static function newEmpty() {
return new self( [
'cache'   => new EmptyBagOStuff(),
-   'pool'=> 'empty',
-   'relayer' => new EventRelayerNull( [] )
+   'pool'=> 'empty'
] );
}
 

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: system::role: remove leading 'role::' to avoid role-role

2017-06-08 Thread Dzahn (Code Review)
Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357960 )

Change subject: system::role: remove leading 'role::' to avoid role-role
..

system::role: remove leading 'role::' to avoid role-role

system::role already adds "role-" to the title but we have many
cases where system::role is used with titles like "role::foo",
and then we end up with "role-role::foo".

In I43a208fdc616e4d3e all these are fixed but as suggested there
by Alex, we are additionally adding this regsubst line to avoid
getting them again in the future.

Change-Id: I5ad03fb1322e88f7a404b022d6da83fbc70796da
---
M modules/system/manifests/role.pp
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/60/357960/1

diff --git a/modules/system/manifests/role.pp b/modules/system/manifests/role.pp
index c2cc496..34bf5d4 100644
--- a/modules/system/manifests/role.pp
+++ b/modules/system/manifests/role.pp
@@ -26,7 +26,9 @@
 default => "${::hostname} is a ${description} (${title})",
 }
 
-motd::script { "role-${title}":
+$role_title = regsubst($title, '^role::', '')
+
+motd::script { "role-${role_title}":
 ensure   => $ensure,
 priority => 05,
 content  => "#!/bin/sh\necho '${message}'\n",

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

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

Change subject: Merge branch 'master' into deployment
..


Merge branch 'master' into deployment

6e734b83d Fix dumbness of last commit

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

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




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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

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

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

6e734b83d Fix dumbness of last commit

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


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


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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: labstore: Fix data interface require clause

2017-06-08 Thread Faidon Liambotis (Code Review)
Faidon Liambotis has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/357958 )

Change subject: labstore: Fix data interface require clause
..


labstore: Fix data interface require clause

Change-Id: Ie67e44b9f5d4f352c609cff96fd5815a3f118d4e
---
M modules/role/manifests/labs/nfs/secondary.pp
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/role/manifests/labs/nfs/secondary.pp 
b/modules/role/manifests/labs/nfs/secondary.pp
index 90bc994..16ca98d 100644
--- a/modules/role/manifests/labs/nfs/secondary.pp
+++ b/modules/role/manifests/labs/nfs/secondary.pp
@@ -29,7 +29,7 @@
 interface => $data_iface,
 address   => '192.168.0.2',
 prefixlen => '30',
-require   => Interface::Manual[$data_iface],
+require   => Interface::Manual['data'],
 }
 }
 
@@ -41,7 +41,7 @@
 interface => $data_iface,
 address   => '192.168.0.1',
 prefixlen => '30',
-require   => Interface::Manual[$data_iface],
+require   => Interface::Manual['data'],
 }
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie67e44b9f5d4f352c609cff96fd5815a3f118d4e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Madhuvishy 
Gerrit-Reviewer: Faidon Liambotis 
Gerrit-Reviewer: Giuseppe Lavagetto 
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]: labstore: Fix data interface require clause

2017-06-08 Thread Madhuvishy (Code Review)
Madhuvishy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357958 )

Change subject: labstore: Fix data interface require clause
..

labstore: Fix data interface require clause

Change-Id: Ie67e44b9f5d4f352c609cff96fd5815a3f118d4e
---
M modules/role/manifests/labs/nfs/secondary.pp
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/modules/role/manifests/labs/nfs/secondary.pp 
b/modules/role/manifests/labs/nfs/secondary.pp
index 90bc994..16ca98d 100644
--- a/modules/role/manifests/labs/nfs/secondary.pp
+++ b/modules/role/manifests/labs/nfs/secondary.pp
@@ -29,7 +29,7 @@
 interface => $data_iface,
 address   => '192.168.0.2',
 prefixlen => '30',
-require   => Interface::Manual[$data_iface],
+require   => Interface::Manual['data'],
 }
 }
 
@@ -41,7 +41,7 @@
 interface => $data_iface,
 address   => '192.168.0.1',
 prefixlen => '30',
-require   => Interface::Manual[$data_iface],
+require   => Interface::Manual['data'],
 }
 }
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: ChangesList: Expose basic properties of lines as data attrib...

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

Change subject: ChangesList: Expose basic properties of lines as data attributes
..


ChangesList: Expose basic properties of lines as data attributes

We have several types of change lists (old RC/watchlist/related
changes, enhanced RC/watchlist, history) with slightly different
HTML, each with their own idiosyncracies. JavaScript code trying
to identify lines by log ID / revision ID has to jump through all
kinds of hoops to work with that.

To simplify the lives of frontend / gadget maintainers and provide
something approaching an API for these pages, we now expose the basic
attributes of each change line (revision ID for edits, log type/action
and ID for log events) as data attributes.

The OldChangesListRecentChangesLine, EnhancedChangesListModifyLineData,
EnhancedChangesListModifyBlockLineData, PageHistoryLine,
ContributionsLineEnding and DeletedContributionsLineEnding hooks
are updated accordingly. New hooks (LogEventsListLineEnding and
NewPagesLineEnding) are added for the change list pages which did
not yet have them.

Change-Id: I6dd006d0b1b0fd35c0020f0f9eea9113eca30b35
---
M RELEASE-NOTES-1.30
M docs/hooks.txt
M includes/GlobalFunctions.php
M includes/Sanitizer.php
M includes/actions/HistoryAction.php
M includes/changes/ChangesList.php
M includes/changes/EnhancedChangesList.php
M includes/changes/OldChangesList.php
M includes/logging/LogEventsList.php
M includes/specials/SpecialNewpages.php
M includes/specials/pagers/ContribsPager.php
M includes/specials/pagers/DeletedContribsPager.php
M includes/templates/EnhancedChangesListGroup.mustache
A tests/phpunit/includes/GlobalFunctions/wfArrayFilterTest.php
M tests/phpunit/includes/SanitizerTest.php
M tests/phpunit/includes/changes/EnhancedChangesListTest.php
M tests/phpunit/includes/changes/OldChangesListTest.php
17 files changed, 262 insertions(+), 32 deletions(-)

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



diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30
index 343c296..cd800da 100644
--- a/RELEASE-NOTES-1.30
+++ b/RELEASE-NOTES-1.30
@@ -99,6 +99,13 @@
   or wikilinks.
 * (T163966) Page moves are now counted as edits for the purposes of
   autopromotion, i.e., they increment the user_editcount field in the database.
+* Two new hooks, LogEventsListLineEnding and NewPagesLineEnding were added for
+  manipulating Special:Log and Special:NewPages lines.
+* The OldChangesListRecentChangesLine, EnhancedChangesListModifyLineData,
+  PageHistoryLineEnding, ContributionsLineEnding and 
DeletedContributionsLineEnding
+  hooks have an additional parameter, for manipulating HTML data attributes of
+  RC/history lines. EnhancedChangesListModifyBlockLineData can do that via the
+  $data['attribs'] subarray.
 
 == Compatibility ==
 MediaWiki 1.30 requires PHP 5.5.9 or later. There is experimental support for
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 0e8b508..3d310c3 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -1155,6 +1155,9 @@
 &$ret: the HTML line
 $row: the DB row for this line
 &$classes: the classes to add to the surrounding 
+&$attribs: associative array of other HTML attributes for the  element.
+  Currently only data attributes reserved to MediaWiki are allowed
+  (see Sanitizer::isReservedDataAttribute).
 
 'ContributionsToolLinks': Change tool links above Special:Contributions
 $id: User identifier
@@ -1200,6 +1203,9 @@
 &$ret: the HTML line
 $row: the DB row for this line
 &$classes: the classes to add to the surrounding 
+&$attribs: associative array of other HTML attributes for the  element.
+  Currently only data attributes reserved to MediaWiki are allowed
+  (see Sanitizer::isReservedDataAttribute).
 
 'DifferenceEngineAfterLoadNewText': called in DifferenceEngine::loadNewText()
 after the new revision's content has been loaded into the class member variable
@@ -1512,6 +1518,9 @@
 $block: An array of RecentChange objects in that block
 $rc: The RecentChange object for this line
 &$classes: An array of classes to change
+&$attribs: associative array of other HTML attributes for the  element.
+  Currently only data attributes reserved to MediaWiki are allowed
+  (see Sanitizer::isReservedDataAttribute).
 
 'EnhancedChangesListModifyBlockLineData': to alter data used to build
 a non-grouped recent change line in EnhancedChangesList.
@@ -1999,6 +2008,16 @@
 &$attribs: the attributes to be applied
 &$ret: the value to return if your hook returns false
 
+'LogEventsListLineEnding': Called before a Special:Log line is finished
+$page: the LogEventsList object
+&$ret: the HTML line
+$entry: the DatabaseLogEntry object for this row
+&$classes: the classes to add to the surrounding 
+&$attribs: associative array of other HTML attributes for the  element.
+  Currently only data attributes reserved to MediaWiki are allowed
+  (see 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: labstore: avoid the hardcoding of eth0/eth1

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

Change subject: labstore: avoid the hardcoding of eth0/eth1
..


labstore: avoid the hardcoding of eth0/eth1

Instead of hardcoding eth0 and eth1 in a bunch of places, use
$monitor_iface (for eth0) and $data_iface (eth1) as parameters to
role::labs::nfs::secondary and pass them to included classes as needed.

We could use $facts['interface_primary'] for $monitor_iface (instead of
eth0), but since we have to hardcode the value for $data_iface, that
would be of limited value.

Change-Id: I761da8f8d2e07e596c2d81a69d48543dc88ece2a
---
M modules/labstore/files/monitor/check_drbd_cluster_ip
M modules/labstore/manifests/monitoring/secondary.pp
M modules/role/manifests/labs/nfs/secondary.pp
M modules/role/templates/labs/nfs/nfs-manage.sh.erb
4 files changed, 30 insertions(+), 22 deletions(-)

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



diff --git a/modules/labstore/files/monitor/check_drbd_cluster_ip 
b/modules/labstore/files/monitor/check_drbd_cluster_ip
index 47b4f5f..51a6fad 100644
--- a/modules/labstore/files/monitor/check_drbd_cluster_ip
+++ b/modules/labstore/files/monitor/check_drbd_cluster_ip
@@ -4,18 +4,17 @@
 import sys
 
 
-def check_cluster_ip(node, role, ip):
+def check_cluster_ip(node, role, interface, ip):
 """
-If role is primary, check that cluster ip is assigned to the eth0 
interface,
+If role is primary, check that cluster IP is assigned to the interface,
 else make sure it is not.
 :param node: string
 :param role: string
 :param ip: string
 :returns: boolean
 """
-# Check if the ip string is present in the list of ipv4 IPs assigned to the
-# eth0 interface
-ip_assigned = ip in str(subprocess.check_output(['/bin/ip', '-4', 'a', 
'list', 'eth0']))
+# Check if the ip is present in the list of IPv4 IPs assigned to interface
+ip_assigned = ip in str(subprocess.check_output(['/bin/ip', '-4', 'a', 
'list', interface]))
 if (role == 'primary' and ip_assigned) or \
 (role == 'secondary' and not ip_assigned):
 print('Cluster IP assignment OK')
@@ -32,10 +31,11 @@
  to DRBD primary')
 parser.add_argument('node', help='Hostname of node being checked')
 parser.add_argument('role', help='Expected drbd role, primary|secondary')
+parser.add_argument('interface', help='Interface with an IP assigned')
 parser.add_argument('ip', help='Cluster IP assigned to primary node')
 args = parser.parse_args()
 
-if not check_cluster_ip(args.node, args.role, args.ip):
+if not check_cluster_ip(args.node, args.role, args.interface, args.ip):
 sys.exit(1)
 
 
diff --git a/modules/labstore/manifests/monitoring/secondary.pp 
b/modules/labstore/manifests/monitoring/secondary.pp
index c58c0b5..035f350 100644
--- a/modules/labstore/manifests/monitoring/secondary.pp
+++ b/modules/labstore/manifests/monitoring/secondary.pp
@@ -7,7 +7,7 @@
 # - check that cluster ip is assigned to DRBD primary
 # - NFS is being served over cluster IP
 
-class labstore::monitoring::secondary($drbd_role, $cluster_ip, $resource = 
'all') {
+class labstore::monitoring::secondary($drbd_role, $cluster_iface, $cluster_ip, 
$resource = 'all') {
 
 sudo::user { 'nagios_check_drbd':
 user   => 'nagios',
@@ -54,7 +54,7 @@
 
 nrpe::monitor_service { 'check_drbd_cluster_ip':
 description  => 'DRBD Cluster IP assignment',
-nrpe_command => "/usr/bin/sudo /usr/local/sbin/check_drbd_cluster_ip 
${::hostname} ${drbd_role} ${cluster_ip}",
+nrpe_command => "/usr/bin/sudo /usr/local/sbin/check_drbd_cluster_ip 
${::hostname} ${drbd_role} ${cluster_iface} ${cluster_ip}",
 require  => File['/usr/local/sbin/check_drbd_cluster_ip'],
 }
 
diff --git a/modules/role/manifests/labs/nfs/secondary.pp 
b/modules/role/manifests/labs/nfs/secondary.pp
index 2c102f9..90bc994 100644
--- a/modules/role/manifests/labs/nfs/secondary.pp
+++ b/modules/role/manifests/labs/nfs/secondary.pp
@@ -1,4 +1,7 @@
-class role::labs::nfs::secondary($monitor = 'eth0') {
+class role::labs::nfs::secondary(
+  $monitor_iface = 'eth0',
+  $data_iface= 'eth1',
+) {
 
 system::role { 'role::labs::nfs::secondary':
 description => 'NFS secondary share cluster',
@@ -10,10 +13,12 @@
 include role::labs::db::maintain_dbusers
 
 # Enable RPS to balance IRQs over CPUs
-interface::rps { $monitor: }
+interface::rps { 'monitor':
+interface => $monitor_iface,
+}
 
-interface::manual{ 'eth1':
-interface => 'eth1',
+interface::manual{ 'data':
+interface => $data_iface,
 }
 
 if $::hostname == 'labstore1005' {
@@ -21,10 +26,10 @@
 $drbd_role = 'primary'
 
 interface::ip { 'drbd-replication':
-interface => 'eth1',
+

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Swapping wikipedias to wmf.4

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

Change subject: Swapping wikipedias to wmf.4
..


Swapping wikipedias to wmf.4

Change-Id: I1eba5bdbd3a34044fdbe121747cf1cc169ab1c8f
---
M wikiversions.json
1 file changed, 301 insertions(+), 301 deletions(-)

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



diff --git a/wikiversions.json b/wikiversions.json
index 2b0de22..fa4f528 100644
--- a/wikiversions.json
+++ b/wikiversions.json
@@ -1,40 +1,40 @@
 {
-"aawiki": "php-1.30.0-wmf.2",
+"aawiki": "php-1.30.0-wmf.4",
 "aawikibooks": "php-1.30.0-wmf.4",
 "aawiktionary": "php-1.30.0-wmf.4",
-"abwiki": "php-1.30.0-wmf.2",
+"abwiki": "php-1.30.0-wmf.4",
 "abwiktionary": "php-1.30.0-wmf.4",
-"acewiki": "php-1.30.0-wmf.2",
+"acewiki": "php-1.30.0-wmf.4",
 "advisorywiki": "php-1.30.0-wmf.4",
-"adywiki": "php-1.30.0-wmf.2",
-"afwiki": "php-1.30.0-wmf.2",
+"adywiki": "php-1.30.0-wmf.4",
+"afwiki": "php-1.30.0-wmf.4",
 "afwikibooks": "php-1.30.0-wmf.4",
 "afwikiquote": "php-1.30.0-wmf.4",
 "afwiktionary": "php-1.30.0-wmf.4",
-"akwiki": "php-1.30.0-wmf.2",
+"akwiki": "php-1.30.0-wmf.4",
 "akwikibooks": "php-1.30.0-wmf.4",
 "akwiktionary": "php-1.30.0-wmf.4",
-"alswiki": "php-1.30.0-wmf.2",
+"alswiki": "php-1.30.0-wmf.4",
 "alswikibooks": "php-1.30.0-wmf.4",
 "alswikiquote": "php-1.30.0-wmf.4",
 "alswiktionary": "php-1.30.0-wmf.4",
-"amwiki": "php-1.30.0-wmf.2",
+"amwiki": "php-1.30.0-wmf.4",
 "amwikiquote": "php-1.30.0-wmf.4",
 "amwiktionary": "php-1.30.0-wmf.4",
-"angwiki": "php-1.30.0-wmf.2",
+"angwiki": "php-1.30.0-wmf.4",
 "angwikibooks": "php-1.30.0-wmf.4",
 "angwikiquote": "php-1.30.0-wmf.4",
 "angwikisource": "php-1.30.0-wmf.4",
 "angwiktionary": "php-1.30.0-wmf.4",
-"anwiki": "php-1.30.0-wmf.2",
+"anwiki": "php-1.30.0-wmf.4",
 "anwiktionary": "php-1.30.0-wmf.4",
-"arbcom_cswiki": "php-1.30.0-wmf.2",
-"arbcom_dewiki": "php-1.30.0-wmf.2",
-"arbcom_enwiki": "php-1.30.0-wmf.2",
-"arbcom_fiwiki": "php-1.30.0-wmf.2",
-"arbcom_nlwiki": "php-1.30.0-wmf.2",
-"arcwiki": "php-1.30.0-wmf.2",
-"arwiki": "php-1.30.0-wmf.2",
+"arbcom_cswiki": "php-1.30.0-wmf.4",
+"arbcom_dewiki": "php-1.30.0-wmf.4",
+"arbcom_enwiki": "php-1.30.0-wmf.4",
+"arbcom_fiwiki": "php-1.30.0-wmf.4",
+"arbcom_nlwiki": "php-1.30.0-wmf.4",
+"arcwiki": "php-1.30.0-wmf.4",
+"arwiki": "php-1.30.0-wmf.4",
 "arwikibooks": "php-1.30.0-wmf.4",
 "arwikimedia": "php-1.30.0-wmf.4",
 "arwikinews": "php-1.30.0-wmf.4",
@@ -42,80 +42,80 @@
 "arwikisource": "php-1.30.0-wmf.4",
 "arwikiversity": "php-1.30.0-wmf.4",
 "arwiktionary": "php-1.30.0-wmf.4",
-"arzwiki": "php-1.30.0-wmf.2",
-"astwiki": "php-1.30.0-wmf.2",
+"arzwiki": "php-1.30.0-wmf.4",
+"astwiki": "php-1.30.0-wmf.4",
 "astwikibooks": "php-1.30.0-wmf.4",
 "astwikiquote": "php-1.30.0-wmf.4",
 "astwiktionary": "php-1.30.0-wmf.4",
-"aswiki": "php-1.30.0-wmf.2",
+"aswiki": "php-1.30.0-wmf.4",
 "aswikibooks": "php-1.30.0-wmf.4",
 "aswikisource": "php-1.30.0-wmf.4",
 "aswiktionary": "php-1.30.0-wmf.4",
 "auditcomwiki": "php-1.30.0-wmf.4",
-"avwiki": "php-1.30.0-wmf.2",
+"avwiki": "php-1.30.0-wmf.4",
 "avwiktionary": "php-1.30.0-wmf.4",
-"aywiki": "php-1.30.0-wmf.2",
+"aywiki": "php-1.30.0-wmf.4",
 "aywikibooks": "php-1.30.0-wmf.4",
 "aywiktionary": "php-1.30.0-wmf.4",
-"azbwiki": "php-1.30.0-wmf.2",
-"azwiki": "php-1.30.0-wmf.2",
+"azbwiki": "php-1.30.0-wmf.4",
+"azwiki": "php-1.30.0-wmf.4",
 "azwikibooks": "php-1.30.0-wmf.4",
 "azwikiquote": "php-1.30.0-wmf.4",
 "azwikisource": "php-1.30.0-wmf.4",
 "azwiktionary": "php-1.30.0-wmf.4",
-"barwiki": "php-1.30.0-wmf.2",
-"bat_smgwiki": "php-1.30.0-wmf.2",
-"bawiki": "php-1.30.0-wmf.2",
+"barwiki": "php-1.30.0-wmf.4",
+"bat_smgwiki": "php-1.30.0-wmf.4",
+"bawiki": "php-1.30.0-wmf.4",
 "bawikibooks": "php-1.30.0-wmf.4",
-"bclwiki": "php-1.30.0-wmf.2",
+"bclwiki": "php-1.30.0-wmf.4",
 "bdwikimedia": "php-1.30.0-wmf.4",
-"be_x_oldwiki": "php-1.30.0-wmf.2",
+"be_x_oldwiki": "php-1.30.0-wmf.4",
 "betawikiversity": "php-1.30.0-wmf.4",
-"bewiki": "php-1.30.0-wmf.2",
+"bewiki": "php-1.30.0-wmf.4",
 "bewikibooks": "php-1.30.0-wmf.4",
 "bewikimedia": "php-1.30.0-wmf.4",
 "bewikiquote": "php-1.30.0-wmf.4",
 "bewikisource": "php-1.30.0-wmf.4",
 "bewiktionary": "php-1.30.0-wmf.4",
-"bgwiki": "php-1.30.0-wmf.2",
+"bgwiki": "php-1.30.0-wmf.4",
 "bgwikibooks": "php-1.30.0-wmf.4",
 "bgwikinews": "php-1.30.0-wmf.4",
 "bgwikiquote": "php-1.30.0-wmf.4",
 "bgwikisource": "php-1.30.0-wmf.4",
 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: labstore: use /sbin/tc, not $PATH/tc

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

Change subject: labstore: use /sbin/tc, not $PATH/tc
..


labstore: use /sbin/tc, not $PATH/tc

As this script may (but probably shouldn't!) run interactively and users
may have a $PATH that has a directory in which a different tc is
present. It also makes this consistent with the rest of the script that
uses /sbin/ip etc.

Change-Id: I4e680469b3c6cd4cdf990cbf26e1664fcd0e5cb8
---
M modules/labstore/templates/tc-setup.sh.erb
1 file changed, 29 insertions(+), 29 deletions(-)

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



diff --git a/modules/labstore/templates/tc-setup.sh.erb 
b/modules/labstore/templates/tc-setup.sh.erb
index 3e702a3..76e2dc3 100644
--- a/modules/labstore/templates/tc-setup.sh.erb
+++ b/modules/labstore/templates/tc-setup.sh.erb
@@ -7,7 +7,7 @@
 
 # intended as idempotent
 
-# tc -s qdisc show
+# /sbin/tc -s qdisc show
 # http://lartc.org/manpages/tc.txt
 
 modules='act_mirr ifb'
@@ -18,12 +18,12 @@
 iface='<%= @interface %>'
 
 function clean_ingress {
-tc qdisc del dev $iface handle : ingress
-tc qdisc del dev ifb0 root
+/sbin/tc qdisc del dev $iface handle : ingress
+/sbin/tc qdisc del dev ifb0 root
 }
 
 function clean_egress {
-tc qdisc del dev $iface root
+/sbin/tc qdisc del dev $iface root
 }
 
 function ensure_mod {
@@ -50,34 +50,34 @@
 
 clean_egress
 
-tc qdisc add dev $iface root handle 1: htb default 100
+/sbin/tc qdisc add dev $iface root handle 1: htb default 100
 
-tc class add dev $iface parent 1: classid 1:1 htb rate $nfs_write
+/sbin/tc class add dev $iface parent 1: classid 1:1 htb rate $nfs_write
 
-tc class add dev $iface parent 1: classid 1:2 htb rate $nfs_write
+/sbin/tc class add dev $iface parent 1: classid 1:2 htb rate $nfs_write
 
-tc class add dev $iface parent 1: classid 1:3 htb rate $nfs_write
+/sbin/tc class add dev $iface parent 1: classid 1:3 htb rate $nfs_write
 
-tc class add dev $iface parent 1: classid 1:4 htb rate $nfs_write
+/sbin/tc class add dev $iface parent 1: classid 1:4 htb rate $nfs_write
 
-tc class add dev $iface parent 1: classid 1:5 htb rate $nfs_write
+/sbin/tc class add dev $iface parent 1: classid 1:5 htb rate $nfs_write
 
-tc class add dev $iface parent 1: classid 1:100 htb rate $egress
+/sbin/tc class add dev $iface parent 1: classid 1:100 htb rate $egress
 
-tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
+/sbin/tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.6 flowid 1:1
 
-tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
+/sbin/tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.7 flowid 1:2
 
-tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
+/sbin/tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.10 flowid 1:3
 
 # scratch is on labstore1003 for now
-tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
+/sbin/tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.4.10 flowid 1:4
 
-tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
+/sbin/tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.18 flowid 1:5
 
 #-
@@ -85,7 +85,7 @@
 clean_ingress
 
 # Create ingress on external interface
-tc qdisc add dev $iface handle : ingress
+/sbin/tc qdisc add dev $iface handle : ingress
 
 # this link has to come up for ingress shaping
 /sbin/ip link set dev ifb0 up
@@ -98,32 +98,32 @@
 fi
 
 # pass engress traffic through ifb0
-tc filter add dev $iface parent : protocol all u32 \
+/sbin/tc filter add dev $iface parent : protocol all u32 \
 match u32 0 0 action mirred egress redirect dev ifb0
 
-tc qdisc add dev ifb0 root handle 1: htb
+/sbin/tc qdisc add dev ifb0 root handle 1: htb
 
-tc class add dev ifb0 parent 1: classid 1:1 htb rate $nfs_read
+/sbin/tc class add dev ifb0 parent 1: classid 1:1 htb rate $nfs_read
 
-tc class add dev ifb0 parent 1: classid 1:2 htb rate $nfs_read
+/sbin/tc class add dev ifb0 parent 1: classid 1:2 htb rate $nfs_read
 
-tc class add dev ifb0 parent 1: classid 1:3 htb rate $nfs_read
+/sbin/tc class add dev ifb0 parent 1: classid 1:3 htb rate $nfs_read
 
-tc class add dev ifb0 parent 1: classid 1:4 htb rate $nfs_dumps_read
+/sbin/tc class add dev ifb0 parent 1: classid 1:4 htb rate $nfs_dumps_read
 
-tc class add dev ifb0 parent 1: classid 1:5 htb rate $nfs_read
+/sbin/tc class add dev ifb0 parent 1: classid 1:5 htb rate $nfs_read
 
-tc filter add dev ifb0 parent 1: protocol ip prio 0 u32 \
+/sbin/tc filter add dev ifb0 parent 1: protocol ip prio 0 u32 \
   match ip src 10.64.37.6 flowid 1:1
 
-tc filter add dev ifb0 parent 1: protocol ip prio 0 u32 \
+/sbin/tc filter add dev ifb0 parent 1: 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add skipping to nth page option/ability for dump importing p...

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

Change subject: Add skipping to nth page option/ability for dump importing 
process
..


Add skipping to nth page option/ability for dump importing process

Usage: php importDump.php --skip-to 271500 /path_to/dumpfile.xml.gz

When importing a database dump and the import process crashes
(for random reasons) after a certain number of pages, the
"--skip-to" parameter allows restarting the import process at
a certain page instead of starting the import from scratch.

Change-Id: Ib36063b69d6846fc197800bba44287493b0632c0
---
M includes/import/WikiImporter.php
M maintenance/importDump.php
2 files changed, 27 insertions(+), 0 deletions(-)

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



diff --git a/includes/import/WikiImporter.php b/includes/import/WikiImporter.php
index 06b579a..2fc9f5e 100644
--- a/includes/import/WikiImporter.php
+++ b/includes/import/WikiImporter.php
@@ -39,6 +39,7 @@
private $mNoticeCallback, $mDebug;
private $mImportUploads, $mImageBasePath;
private $mNoUpdates = false;
+   private $pageOffset = 0;
/** @var Config */
private $config;
/** @var ImportTitleFactory */
@@ -144,6 +145,16 @@
 */
function setNoUpdates( $noupdates ) {
$this->mNoUpdates = $noupdates;
+   }
+
+   /**
+* Sets 'pageOffset' value. So it will skip the first n-1 pages
+* and start from the nth page. It's 1-based indexing.
+* @param int $nthPage
+* @since 1.29
+*/
+   function setPageOffset( $nthPage ) {
+   $this->pageOffset = $nthPage;
}
 
/**
@@ -562,9 +573,19 @@
$keepReading = $this->reader->read();
$skip = false;
$rethrow = null;
+   $pageCount = 0;
try {
while ( $keepReading ) {
$tag = $this->reader->localName;
+   if ( $this->pageOffset ) {
+   if ( $tag === 'page' ) {
+   $pageCount++;
+   }
+   if ( $pageCount < $this->pageOffset ) {
+   $keepReading = 
$this->reader->next();
+   continue;
+   }
+   }
$type = $this->reader->nodeType;
 
if ( !Hooks::run( 'ImportHandleToplevelXMLTag', 
[ $this ] ) ) {
diff --git a/maintenance/importDump.php b/maintenance/importDump.php
index 6717a8e..802619e 100644
--- a/maintenance/importDump.php
+++ b/maintenance/importDump.php
@@ -80,6 +80,7 @@
'Disable link table updates. Is faster but leaves the 
wiki in an inconsistent state'
);
$this->addOption( 'image-base-path', 'Import files from a 
specified path', false, true );
+   $this->addOption( 'skip-to', 'Start from nth page by skipping 
first n-1 pages', false, true );
$this->addArg( 'file', 'Dump file to import [else use stdin]', 
false );
}
 
@@ -301,6 +302,11 @@
return false;
}
}
+   if ( $this->hasOption( 'skip-to' ) ) {
+   $nthPage = (int)$this->getOption( 'skip-to' );
+   $importer->setPageOffset( $nthPage );
+   $this->pageCount = $nthPage - 1;
+   }
$importer->setPageCallback( [ $this, 'reportPage' ] );
$this->importCallback = $importer->setRevisionCallback(
[ $this, 'handleRevision' ] );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib36063b69d6846fc197800bba44287493b0632c0
Gerrit-PatchSet: 10
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mertyildiran 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Aklapper 
Gerrit-Reviewer: ArielGlenn 
Gerrit-Reviewer: Gergő Tisza 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Mertyildiran 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: Reedy 
Gerrit-Reviewer: TTO 
Gerrit-Reviewer: Zppix 
Gerrit-Reviewer: jenkins-bot <>

___

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [WIP] Add on to pywikibot support for thanking normal revisions

2017-06-08 Thread Happy5214 (Code Review)
Happy5214 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357957 )

Change subject: [WIP] Add on to pywikibot support for thanking normal revisions
..

[WIP] Add on to pywikibot support for thanking normal revisions

This second commit:
 - Renames thankable to isThankable to match existing convention.

Bug: T135409
Change-Id: Ib3a35fea2442099fb685ddf0097e6c4003a69fd7
---
M pywikibot/page.py
M tests/thanks_tests.py
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/57/357957/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 450da57..506 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -3463,7 +3463,7 @@
)
 
 @property
-def thankable(self):
+def isThankable(self):
 """
 Determine if the user has thanks notifications enabled.
 
@@ -3474,7 +3474,7 @@
 
 @rtype: bool
 """
-return not self.isAnonymous()
+return not (self.isAnonymous() or 'bot' in self.groups())
 
 
 class WikibasePage(BasePage):
diff --git a/tests/thanks_tests.py b/tests/thanks_tests.py
index aeeb297..5c45bc4 100644
--- a/tests/thanks_tests.py
+++ b/tests/thanks_tests.py
@@ -35,7 +35,7 @@
 revid = i['revid']
 username = i['user']
 user = User(site, username)
-if user.thankable:
+if user.isThankable:
 can_thank = True
 break
 if not can_thank:

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Fix dumbness of last commit

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

Change subject: Fix dumbness of last commit
..


Fix dumbness of last commit

Change-Id: I1455922834c7ba99b52b3d26a6cf1f6db682b49d
---
M sites/all/modules/wmf_audit/BaseAuditProcessor.php
1 file changed, 9 insertions(+), 8 deletions(-)

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



diff --git a/sites/all/modules/wmf_audit/BaseAuditProcessor.php 
b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
index 700b127..b8154a3 100644
--- a/sites/all/modules/wmf_audit/BaseAuditProcessor.php
+++ b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
@@ -666,7 +666,7 @@

'Could not get an order id for the following transaction ' . print_r( 
$transaction, true )
);
}
-   $data = 
$this->get_log_data_by_order_id( $order_id, $log, $data );
+   $data = 
$this->get_log_data_by_order_id( $order_id, $log, $transaction );
 
if ( !$data ) {
//no 
data found in this log, which is expected and normal and not a problem.
@@ -677,12 +677,6 @@
//if we have 
data at this point, it means we have a match in the logs
$found += 1;
 
-   if ( 
!$this->check_consistency( $data, $transaction ) ) {
-   throw 
new WmfException(
-   
'DATA_INCONSISTENT',
-   
'Inconsistent data. Skipping the following: ' . print_r( $transaction, true ) . 
"\n" . print_r( $data, true )
-   );
-   }
$all_data = 
$this->merge_data( $data, $transaction );
//lookup 
contribution_tracking data, and fill it in with audit markers if there's 
nothing there.

$contribution_tracking_data = wmf_audit_get_contribution_tracking_data( 
$all_data );
@@ -1058,7 +1052,8 @@
 * If this log doesn't contain data for the order_id in question, 
return false.
 * @param string $order_id The order id (transaction id) of the missing 
payment
 * @param string $log The full path to the log we want to search
-* @return array|boolean The data we sent to the gateway for that order 
id, or
+* @param $audit_data array the data from the audit file.
+* @return array|bool The data we sent to the gateway for that order 
id, or
 * false if we can't find it there.
 */
protected function get_log_data_by_order_id( $order_id, $log, 
$audit_data ) {
@@ -1078,6 +1073,7 @@
if ( count( $ret ) > 1 ) {
wmf_audit_echo( "Odd: More than one logline 
returned for $order_id. Investigation Required." );
}
+   $raw_data = array();
 
// Get a log line that is consistent with the data from 
the audit file
// Count backwards, because we used to only take the 
last one.
@@ -1101,6 +1097,11 @@
return $raw_data;
}
}
+   // We have log data, but nothing matches. This is too 
weird.
+   throw new WmfException(
+   'DATA_INCONSISTENT',
+   'Inconsistent data. Skipping the following: ' . 
print_r( $audit_data, true ) . "\n" . print_r( $raw_data, true )
+   );
}
return false; //no big deal, it just wasn't there. This will 
happen most of the time.
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1455922834c7ba99b52b3d26a6cf1f6db682b49d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg 
Gerrit-Reviewer: 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: labstore: use the interface_primary fact, not eth0

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

Change subject: labstore: use the interface_primary fact, not eth0
..


labstore: use the interface_primary fact, not eth0

Don't hardcode eth0 in the traffic shaping script , but use the
interface_primary fact instead.

Change-Id: Ie34376044316acdf85fc26e3633c80a37f1c315c
---
M modules/labstore/manifests/traffic_shaping.pp
M modules/labstore/templates/tc-setup.sh.erb
2 files changed, 20 insertions(+), 18 deletions(-)

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



diff --git a/modules/labstore/manifests/traffic_shaping.pp 
b/modules/labstore/manifests/traffic_shaping.pp
index 742c152..ac94d88 100644
--- a/modules/labstore/manifests/traffic_shaping.pp
+++ b/modules/labstore/manifests/traffic_shaping.pp
@@ -2,7 +2,8 @@
 $nfs_write = '8500kbps',
 $nfs_read = '1000kbps',
 $nfs_dumps_read = '15000kbps',
-$eth0_egress = '3kbps',
+$egress = '3kbps',
+$interface = $facts['interface_primary'],
 ) {
 
 file { '/usr/local/sbin/tc-setup':
diff --git a/modules/labstore/templates/tc-setup.sh.erb 
b/modules/labstore/templates/tc-setup.sh.erb
index dc9ca63..3e702a3 100644
--- a/modules/labstore/templates/tc-setup.sh.erb
+++ b/modules/labstore/templates/tc-setup.sh.erb
@@ -14,15 +14,16 @@
 nfs_write='<%= @nfs_write %>'
 nfs_read='<%= @nfs_read %>'
 nfs_dumps_read='<%= @nfs_dumps_read %>'
-eth0_egress='<%= @eth0_egress %>'
+egress='<%= @egress %>'
+iface='<%= @interface %>'
 
 function clean_ingress {
-tc qdisc del dev eth0 handle : ingress
+tc qdisc del dev $iface handle : ingress
 tc qdisc del dev ifb0 root
 }
 
 function clean_egress {
-tc qdisc del dev eth0 root
+tc qdisc del dev $iface root
 }
 
 function ensure_mod {
@@ -49,34 +50,34 @@
 
 clean_egress
 
-tc qdisc add dev eth0 root handle 1: htb default 100
+tc qdisc add dev $iface root handle 1: htb default 100
 
-tc class add dev eth0 parent 1: classid 1:1 htb rate $nfs_write
+tc class add dev $iface parent 1: classid 1:1 htb rate $nfs_write
 
-tc class add dev eth0 parent 1: classid 1:2 htb rate $nfs_write
+tc class add dev $iface parent 1: classid 1:2 htb rate $nfs_write
 
-tc class add dev eth0 parent 1: classid 1:3 htb rate $nfs_write
+tc class add dev $iface parent 1: classid 1:3 htb rate $nfs_write
 
-tc class add dev eth0 parent 1: classid 1:4 htb rate $nfs_write
+tc class add dev $iface parent 1: classid 1:4 htb rate $nfs_write
 
-tc class add dev eth0 parent 1: classid 1:5 htb rate $nfs_write
+tc class add dev $iface parent 1: classid 1:5 htb rate $nfs_write
 
-tc class add dev eth0 parent 1: classid 1:100 htb rate $eth0_egress
+tc class add dev $iface parent 1: classid 1:100 htb rate $egress
 
-tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.6 flowid 1:1
 
-tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.7 flowid 1:2
 
-tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.10 flowid 1:3
 
 # scratch is on labstore1003 for now
-tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.4.10 flowid 1:4
 
-tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev $iface parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.18 flowid 1:5
 
 #-
@@ -84,7 +85,7 @@
 clean_ingress
 
 # Create ingress on external interface
-tc qdisc add dev eth0 handle : ingress
+tc qdisc add dev $iface handle : ingress
 
 # this link has to come up for ingress shaping
 /sbin/ip link set dev ifb0 up
@@ -97,7 +98,7 @@
 fi
 
 # pass engress traffic through ifb0
-tc filter add dev eth0 parent : protocol all u32 \
+tc filter add dev $iface parent : protocol all u32 \
 match u32 0 0 action mirred egress redirect dev ifb0
 
 tc qdisc add dev ifb0 root handle 1: htb

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie34376044316acdf85fc26e3633c80a37f1c315c
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: Madhuvishy 
Gerrit-Reviewer: Rush 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[wmf/1.30.0-wmf.4]: Fix T167473 - should use object access, not array, for selec...

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

Change subject: Fix T167473 - should use object access, not array, for select 
results.
..


Fix T167473 - should use object access, not array, for select results.

Bug: T167473
Change-Id: Ia2b4ddfd63fc45d9967996f63798abb78aba73d3
---
M includes/Job/DeleteArchive.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/Job/DeleteArchive.php b/includes/Job/DeleteArchive.php
index fb9560b..061c884 100644
--- a/includes/Job/DeleteArchive.php
+++ b/includes/Job/DeleteArchive.php
@@ -23,7 +23,7 @@
 
// Remove page IDs that still have archived revs
foreach ( $archive->listRevisions() as $rev ) {
-   unset( $docs[$rev['ar_page_id']] );
+   unset( $docs[$rev->ar_page_id] );
}
 
if ( empty( $docs ) ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia2b4ddfd63fc45d9967996f63798abb78aba73d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: wmf/1.30.0-wmf.4
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Tjones 
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]: updating recipe for 80% of lvm

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

Change subject: updating recipe for 80% of lvm
..


updating recipe for 80% of lvm

also adding in auto confirmation like other recipes have to match

Change-Id: I52b6810c68a23b1b52797d2f8a19af8228eb91fd
---
M modules/install_server/files/autoinstall/partman/lvm-ext-srv.cfg
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/modules/install_server/files/autoinstall/partman/lvm-ext-srv.cfg 
b/modules/install_server/files/autoinstall/partman/lvm-ext-srv.cfg
index 083c233..0ccae2a 100644
--- a/modules/install_server/files/autoinstall/partman/lvm-ext-srv.cfg
+++ b/modules/install_server/files/autoinstall/partman/lvm-ext-srv.cfg
@@ -48,8 +48,9 @@
mountpoint{ /srv }  \
.
 
-d-ipartman-auto-lvm/guided_sizestring  75%
-
+d-i partman-auto-lvm/guided_size   string  80%
+d-i partman-lvm/confirmboolean true
+d-i partman-lvm/confirm_nooverwrite boolean true
 d-ipartman-auto/choose_recipe  es
 partman-basicfilesystems partman-basicfilesystems/no_swap boolean false
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I52b6810c68a23b1b52797d2f8a19af8228eb91fd
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: RobH 
Gerrit-Reviewer: RobH 
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...GeoData[wmf/1.30.0-wmf.4]: Temp hax to point GeoData at codfw DC

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

Change subject: Temp hax to point GeoData at codfw DC
..


Temp hax to point GeoData at codfw DC

The eqiad elasticsearch cluster is currently running a mixed version
cluster, having both versions 5.1.2 and 5.3.2. While elasticsearch is
supposed to guarnatee that mixed clusters of the same major version will
work fine, it seems they made a mistake and there is an enum related to
geo search that was changed. This basically means requests from one
version to the other fail because the enum's get interpreted wrong.

This will fix itself as the cluster upgrade is completed. Pushing only
to wmf.4 (and already in wmf.2) so prevent errors as this sees 5 or 10k
uses per hour.

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

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



diff --git a/includes/Searcher.php b/includes/Searcher.php
index 852feb6..4220024 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -18,7 +18,7 @@
/** @var SearchConfig $config */
$config = ConfigFactory::getDefaultInstance()->makeConfig( 
'CirrusSearch' );
/** @suppress PhanTypeMismatchArgument */
-   $connection = new \CirrusSearch\Connection( $config );
+   $connection = new \CirrusSearch\Connection( $config, 'codfw' );
 
parent::__construct( $connection, $user, 0 );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe32c3f1a15e03583edbd42c1b53704b467ffe9b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: wmf/1.30.0-wmf.4
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: updating recipe for 80% of lvm

2017-06-08 Thread RobH (Code Review)
RobH has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357956 )

Change subject: updating recipe for 80% of lvm
..

updating recipe for 80% of lvm

also adding in auto confirmation like other recipes have to match

Change-Id: I52b6810c68a23b1b52797d2f8a19af8228eb91fd
---
M modules/install_server/files/autoinstall/partman/lvm-ext-srv.cfg
1 file changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/modules/install_server/files/autoinstall/partman/lvm-ext-srv.cfg 
b/modules/install_server/files/autoinstall/partman/lvm-ext-srv.cfg
index 083c233..0ccae2a 100644
--- a/modules/install_server/files/autoinstall/partman/lvm-ext-srv.cfg
+++ b/modules/install_server/files/autoinstall/partman/lvm-ext-srv.cfg
@@ -48,8 +48,9 @@
mountpoint{ /srv }  \
.
 
-d-ipartman-auto-lvm/guided_sizestring  75%
-
+d-i partman-auto-lvm/guided_size   string  80%
+d-i partman-lvm/confirmboolean true
+d-i partman-lvm/confirm_nooverwrite boolean true
 d-ipartman-auto/choose_recipe  es
 partman-basicfilesystems partman-basicfilesystems/no_swap boolean false
 

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Swapping wikipedias to wmf.4

2017-06-08 Thread Chad (Code Review)
Chad has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357955 )

Change subject: Swapping wikipedias to wmf.4
..

Swapping wikipedias to wmf.4

Change-Id: I1eba5bdbd3a34044fdbe121747cf1cc169ab1c8f
---
M wikiversions.json
1 file changed, 301 insertions(+), 301 deletions(-)


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

diff --git a/wikiversions.json b/wikiversions.json
index 2b0de22..fa4f528 100644
--- a/wikiversions.json
+++ b/wikiversions.json
@@ -1,40 +1,40 @@
 {
-"aawiki": "php-1.30.0-wmf.2",
+"aawiki": "php-1.30.0-wmf.4",
 "aawikibooks": "php-1.30.0-wmf.4",
 "aawiktionary": "php-1.30.0-wmf.4",
-"abwiki": "php-1.30.0-wmf.2",
+"abwiki": "php-1.30.0-wmf.4",
 "abwiktionary": "php-1.30.0-wmf.4",
-"acewiki": "php-1.30.0-wmf.2",
+"acewiki": "php-1.30.0-wmf.4",
 "advisorywiki": "php-1.30.0-wmf.4",
-"adywiki": "php-1.30.0-wmf.2",
-"afwiki": "php-1.30.0-wmf.2",
+"adywiki": "php-1.30.0-wmf.4",
+"afwiki": "php-1.30.0-wmf.4",
 "afwikibooks": "php-1.30.0-wmf.4",
 "afwikiquote": "php-1.30.0-wmf.4",
 "afwiktionary": "php-1.30.0-wmf.4",
-"akwiki": "php-1.30.0-wmf.2",
+"akwiki": "php-1.30.0-wmf.4",
 "akwikibooks": "php-1.30.0-wmf.4",
 "akwiktionary": "php-1.30.0-wmf.4",
-"alswiki": "php-1.30.0-wmf.2",
+"alswiki": "php-1.30.0-wmf.4",
 "alswikibooks": "php-1.30.0-wmf.4",
 "alswikiquote": "php-1.30.0-wmf.4",
 "alswiktionary": "php-1.30.0-wmf.4",
-"amwiki": "php-1.30.0-wmf.2",
+"amwiki": "php-1.30.0-wmf.4",
 "amwikiquote": "php-1.30.0-wmf.4",
 "amwiktionary": "php-1.30.0-wmf.4",
-"angwiki": "php-1.30.0-wmf.2",
+"angwiki": "php-1.30.0-wmf.4",
 "angwikibooks": "php-1.30.0-wmf.4",
 "angwikiquote": "php-1.30.0-wmf.4",
 "angwikisource": "php-1.30.0-wmf.4",
 "angwiktionary": "php-1.30.0-wmf.4",
-"anwiki": "php-1.30.0-wmf.2",
+"anwiki": "php-1.30.0-wmf.4",
 "anwiktionary": "php-1.30.0-wmf.4",
-"arbcom_cswiki": "php-1.30.0-wmf.2",
-"arbcom_dewiki": "php-1.30.0-wmf.2",
-"arbcom_enwiki": "php-1.30.0-wmf.2",
-"arbcom_fiwiki": "php-1.30.0-wmf.2",
-"arbcom_nlwiki": "php-1.30.0-wmf.2",
-"arcwiki": "php-1.30.0-wmf.2",
-"arwiki": "php-1.30.0-wmf.2",
+"arbcom_cswiki": "php-1.30.0-wmf.4",
+"arbcom_dewiki": "php-1.30.0-wmf.4",
+"arbcom_enwiki": "php-1.30.0-wmf.4",
+"arbcom_fiwiki": "php-1.30.0-wmf.4",
+"arbcom_nlwiki": "php-1.30.0-wmf.4",
+"arcwiki": "php-1.30.0-wmf.4",
+"arwiki": "php-1.30.0-wmf.4",
 "arwikibooks": "php-1.30.0-wmf.4",
 "arwikimedia": "php-1.30.0-wmf.4",
 "arwikinews": "php-1.30.0-wmf.4",
@@ -42,80 +42,80 @@
 "arwikisource": "php-1.30.0-wmf.4",
 "arwikiversity": "php-1.30.0-wmf.4",
 "arwiktionary": "php-1.30.0-wmf.4",
-"arzwiki": "php-1.30.0-wmf.2",
-"astwiki": "php-1.30.0-wmf.2",
+"arzwiki": "php-1.30.0-wmf.4",
+"astwiki": "php-1.30.0-wmf.4",
 "astwikibooks": "php-1.30.0-wmf.4",
 "astwikiquote": "php-1.30.0-wmf.4",
 "astwiktionary": "php-1.30.0-wmf.4",
-"aswiki": "php-1.30.0-wmf.2",
+"aswiki": "php-1.30.0-wmf.4",
 "aswikibooks": "php-1.30.0-wmf.4",
 "aswikisource": "php-1.30.0-wmf.4",
 "aswiktionary": "php-1.30.0-wmf.4",
 "auditcomwiki": "php-1.30.0-wmf.4",
-"avwiki": "php-1.30.0-wmf.2",
+"avwiki": "php-1.30.0-wmf.4",
 "avwiktionary": "php-1.30.0-wmf.4",
-"aywiki": "php-1.30.0-wmf.2",
+"aywiki": "php-1.30.0-wmf.4",
 "aywikibooks": "php-1.30.0-wmf.4",
 "aywiktionary": "php-1.30.0-wmf.4",
-"azbwiki": "php-1.30.0-wmf.2",
-"azwiki": "php-1.30.0-wmf.2",
+"azbwiki": "php-1.30.0-wmf.4",
+"azwiki": "php-1.30.0-wmf.4",
 "azwikibooks": "php-1.30.0-wmf.4",
 "azwikiquote": "php-1.30.0-wmf.4",
 "azwikisource": "php-1.30.0-wmf.4",
 "azwiktionary": "php-1.30.0-wmf.4",
-"barwiki": "php-1.30.0-wmf.2",
-"bat_smgwiki": "php-1.30.0-wmf.2",
-"bawiki": "php-1.30.0-wmf.2",
+"barwiki": "php-1.30.0-wmf.4",
+"bat_smgwiki": "php-1.30.0-wmf.4",
+"bawiki": "php-1.30.0-wmf.4",
 "bawikibooks": "php-1.30.0-wmf.4",
-"bclwiki": "php-1.30.0-wmf.2",
+"bclwiki": "php-1.30.0-wmf.4",
 "bdwikimedia": "php-1.30.0-wmf.4",
-"be_x_oldwiki": "php-1.30.0-wmf.2",
+"be_x_oldwiki": "php-1.30.0-wmf.4",
 "betawikiversity": "php-1.30.0-wmf.4",
-"bewiki": "php-1.30.0-wmf.2",
+"bewiki": "php-1.30.0-wmf.4",
 "bewikibooks": "php-1.30.0-wmf.4",
 "bewikimedia": "php-1.30.0-wmf.4",
 "bewikiquote": "php-1.30.0-wmf.4",
 "bewikisource": "php-1.30.0-wmf.4",
 "bewiktionary": "php-1.30.0-wmf.4",
-"bgwiki": "php-1.30.0-wmf.2",
+"bgwiki": "php-1.30.0-wmf.4",
 "bgwikibooks": "php-1.30.0-wmf.4",
 "bgwikinews": "php-1.30.0-wmf.4",
 "bgwikiquote": "php-1.30.0-wmf.4",
 "bgwikisource": "php-1.30.0-wmf.4",
 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Fix T167473 - should use object access, not array, for selec...

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

Change subject: Fix T167473 - should use object access, not array, for select 
results.
..


Fix T167473 - should use object access, not array, for select results.

Bug: T167473
Change-Id: Ia2b4ddfd63fc45d9967996f63798abb78aba73d3
---
M includes/Job/DeleteArchive.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/includes/Job/DeleteArchive.php b/includes/Job/DeleteArchive.php
index fb9560b..061c884 100644
--- a/includes/Job/DeleteArchive.php
+++ b/includes/Job/DeleteArchive.php
@@ -23,7 +23,7 @@
 
// Remove page IDs that still have archived revs
foreach ( $archive->listRevisions() as $rev ) {
-   unset( $docs[$rev['ar_page_id']] );
+   unset( $docs[$rev->ar_page_id] );
}
 
if ( empty( $docs ) ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia2b4ddfd63fc45d9967996f63798abb78aba73d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Smalyshev 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Cindy-the-browser-test-bot 
Gerrit-Reviewer: DCausse 
Gerrit-Reviewer: EBernhardson 
Gerrit-Reviewer: Gehel 
Gerrit-Reviewer: Tjones 
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...Refreshed[master]: Fix positioning of user icon on mobile

2017-06-08 Thread SamanthaNguyen (Code Review)
SamanthaNguyen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357954 )

Change subject: Fix positioning of user icon on mobile
..

Fix positioning of user icon on mobile

Bug: T167474
Change-Id: I59551aadf256bf5f12b7240920191e4cb75d8726
---
M refreshed/styles/screen/small.css
M skin.json
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Refreshed 
refs/changes/54/357954/1

diff --git a/refreshed/styles/screen/small.css 
b/refreshed/styles/screen/small.css
index ad2b753..f18b12b 100644
--- a/refreshed/styles/screen/small.css
+++ b/refreshed/styles/screen/small.css
@@ -168,7 +168,7 @@
 }
 
 .avatar {
-   margin-top: 7px; /* avatar has height of 30px, header has height of 
2.75em or 44px; to center, margin-top = (44px - 30px) / 2 = 7px */
+   margin-top: 0 .25em 0 0;
 }
 
 #user-info .header-menu {
diff --git a/skin.json b/skin.json
index 8323aba..d3794be 100644
--- a/skin.json
+++ b/skin.json
@@ -1,6 +1,6 @@
 {
"name": "Refreshed",
-   "version": "3.2.4",
+   "version": "3.2.5",
"author": [
"Adam Carter",
"Drew1200",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I59551aadf256bf5f12b7240920191e4cb75d8726
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Refreshed
Gerrit-Branch: master
Gerrit-Owner: SamanthaNguyen 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: labstore: remove TC=$(which tc)

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

Change subject: labstore: remove TC=$(which tc)
..


labstore: remove TC=$(which tc)

There is some point in doing TC=/sbin/tc and then using $TC (that is, to
avoid using the invoking user's $PATH), but little point in doing
TC=$(which tc). Remove that and refer to "tc" directly, as it's cleaner.

Change-Id: Iec93b4c3f7def911da8e5160f5a9a167907f8e04
---
M modules/labstore/templates/tc-setup.sh.erb
1 file changed, 28 insertions(+), 30 deletions(-)

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



diff --git a/modules/labstore/templates/tc-setup.sh.erb 
b/modules/labstore/templates/tc-setup.sh.erb
index 35550fc..dc9ca63 100644
--- a/modules/labstore/templates/tc-setup.sh.erb
+++ b/modules/labstore/templates/tc-setup.sh.erb
@@ -16,15 +16,13 @@
 nfs_dumps_read='<%= @nfs_dumps_read %>'
 eth0_egress='<%= @eth0_egress %>'
 
-TC=$(which tc)
-
 function clean_ingress {
-$TC qdisc del dev eth0 handle : ingress
-$TC qdisc del dev ifb0 root
+tc qdisc del dev eth0 handle : ingress
+tc qdisc del dev ifb0 root
 }
 
 function clean_egress {
-$TC qdisc del dev eth0 root
+tc qdisc del dev eth0 root
 }
 
 function ensure_mod {
@@ -51,34 +49,34 @@
 
 clean_egress
 
-$TC qdisc add dev eth0 root handle 1: htb default 100
+tc qdisc add dev eth0 root handle 1: htb default 100
 
-$TC class add dev eth0 parent 1: classid 1:1 htb rate $nfs_write
+tc class add dev eth0 parent 1: classid 1:1 htb rate $nfs_write
 
-$TC class add dev eth0 parent 1: classid 1:2 htb rate $nfs_write
+tc class add dev eth0 parent 1: classid 1:2 htb rate $nfs_write
 
-$TC class add dev eth0 parent 1: classid 1:3 htb rate $nfs_write
+tc class add dev eth0 parent 1: classid 1:3 htb rate $nfs_write
 
-$TC class add dev eth0 parent 1: classid 1:4 htb rate $nfs_write
+tc class add dev eth0 parent 1: classid 1:4 htb rate $nfs_write
 
-$TC class add dev eth0 parent 1: classid 1:5 htb rate $nfs_write
+tc class add dev eth0 parent 1: classid 1:5 htb rate $nfs_write
 
-$TC class add dev eth0 parent 1: classid 1:100 htb rate $eth0_egress
+tc class add dev eth0 parent 1: classid 1:100 htb rate $eth0_egress
 
-$TC filter add dev eth0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.6 flowid 1:1
 
-$TC filter add dev eth0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.7 flowid 1:2
 
-$TC filter add dev eth0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.10 flowid 1:3
 
 # scratch is on labstore1003 for now
-$TC filter add dev eth0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.4.10 flowid 1:4
 
-$TC filter add dev eth0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev eth0 parent 1: protocol ip prio 0 u32 \
   match ip dst 10.64.37.18 flowid 1:5
 
 #-
@@ -86,7 +84,7 @@
 clean_ingress
 
 # Create ingress on external interface
-$TC qdisc add dev eth0 handle : ingress
+tc qdisc add dev eth0 handle : ingress
 
 # this link has to come up for ingress shaping
 /sbin/ip link set dev ifb0 up
@@ -99,32 +97,32 @@
 fi
 
 # pass engress traffic through ifb0
-$TC filter add dev eth0 parent : protocol all u32 \
+tc filter add dev eth0 parent : protocol all u32 \
 match u32 0 0 action mirred egress redirect dev ifb0
 
-$TC qdisc add dev ifb0 root handle 1: htb
+tc qdisc add dev ifb0 root handle 1: htb
 
-$TC class add dev ifb0 parent 1: classid 1:1 htb rate $nfs_read
+tc class add dev ifb0 parent 1: classid 1:1 htb rate $nfs_read
 
-$TC class add dev ifb0 parent 1: classid 1:2 htb rate $nfs_read
+tc class add dev ifb0 parent 1: classid 1:2 htb rate $nfs_read
 
-$TC class add dev ifb0 parent 1: classid 1:3 htb rate $nfs_read
+tc class add dev ifb0 parent 1: classid 1:3 htb rate $nfs_read
 
-$TC class add dev ifb0 parent 1: classid 1:4 htb rate $nfs_dumps_read
+tc class add dev ifb0 parent 1: classid 1:4 htb rate $nfs_dumps_read
 
-$TC class add dev ifb0 parent 1: classid 1:5 htb rate $nfs_read
+tc class add dev ifb0 parent 1: classid 1:5 htb rate $nfs_read
 
-$TC filter add dev ifb0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev ifb0 parent 1: protocol ip prio 0 u32 \
   match ip src 10.64.37.6 flowid 1:1
 
-$TC filter add dev ifb0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev ifb0 parent 1: protocol ip prio 0 u32 \
   match ip src 10.64.37.7 flowid 1:2
 
-$TC filter add dev ifb0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev ifb0 parent 1: protocol ip prio 0 u32 \
   match ip src 10.64.37.10 flowid 1:3
 
-$TC filter add dev ifb0 parent 1: protocol ip prio 0 u32 \
+tc filter add dev 

[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[wmf/1.30.0-wmf.4]: Fix T167473 - should use object access, not array, for selec...

2017-06-08 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357953 )

Change subject: Fix T167473 - should use object access, not array, for select 
results.
..

Fix T167473 - should use object access, not array, for select results.

Bug: T167473
Change-Id: Ia2b4ddfd63fc45d9967996f63798abb78aba73d3
---
M includes/Job/DeleteArchive.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/Job/DeleteArchive.php b/includes/Job/DeleteArchive.php
index fb9560b..061c884 100644
--- a/includes/Job/DeleteArchive.php
+++ b/includes/Job/DeleteArchive.php
@@ -23,7 +23,7 @@
 
// Remove page IDs that still have archived revs
foreach ( $archive->listRevisions() as $rev ) {
-   unset( $docs[$rev['ar_page_id']] );
+   unset( $docs[$rev->ar_page_id] );
}
 
if ( empty( $docs ) ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2b4ddfd63fc45d9967996f63798abb78aba73d3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: wmf/1.30.0-wmf.4
Gerrit-Owner: Smalyshev 

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


[MediaWiki-commits] [Gerrit] mediawiki...GeoData[wmf/1.30.0-wmf.4]: Temp hax to point GeoData at codfw DC

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

Change subject: Temp hax to point GeoData at codfw DC
..

Temp hax to point GeoData at codfw DC

The eqiad elasticsearch cluster is currently running a mixed version
cluster, having both versions 5.1.2 and 5.3.2. While elasticsearch is
supposed to guarnatee that mixed clusters of the same major version will
work fine, it seems they made a mistake and there is an enum related to
geo search that was changed. This basically means requests from one
version to the other fail because the enum's get interpreted wrong.

This will fix itself as the cluster upgrade is completed. Pushing only
to wmf.4 (and already in wmf.2) so prevent errors as this sees 5 or 10k
uses per hour.

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


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

diff --git a/includes/Searcher.php b/includes/Searcher.php
index 852feb6..4220024 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -18,7 +18,7 @@
/** @var SearchConfig $config */
$config = ConfigFactory::getDefaultInstance()->makeConfig( 
'CirrusSearch' );
/** @suppress PhanTypeMismatchArgument */
-   $connection = new \CirrusSearch\Connection( $config );
+   $connection = new \CirrusSearch\Connection( $config, 'codfw' );
 
parent::__construct( $connection, $user, 0 );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe32c3f1a15e03583edbd42c1b53704b467ffe9b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: wmf/1.30.0-wmf.4
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: EBernhardson 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Change Persian Wikis from uca-fa to xx-uca-fa

2017-06-08 Thread Ladsgroup (Code Review)
Ladsgroup has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357951 )

Change subject: Change Persian Wikis from uca-fa to xx-uca-fa
..

Change Persian Wikis from uca-fa to xx-uca-fa

Bug: T139110
Change-Id: I0a95fe06bc9c429224640336eae7de55a50e1863
---
M wmf-config/InitialiseSettings.php
1 file changed, 6 insertions(+), 6 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 7605c12..15cb952 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -14720,12 +14720,12 @@
'etwikiquote' => 'xx-uca-et', // T56168
'etwikisource' => 'xx-uca-et', // T56168
'etwiktionary' => 'xx-uca-et', // T56168
-   'fawiki' => 'uca-fa', // T52311
-   'fawikisource' => 'uca-fa', // T52311
-   'fawiktionary' => 'uca-fa', // T52311
-   'fawikibooks' => 'uca-fa', // T52311
-   'fawikinews' => 'uca-fa', // T52311
-   'fawikiquote' => 'uca-fa', // T52311
+   'fawiki' => 'xx-uca-fa', // T139110
+   'fawikisource' => 'xx-uca-fa', // T139110
+   'fawiktionary' => 'xx-uca-fa', // T139110
+   'fawikibooks' => 'xx-uca-fa', // T139110
+   'fawikinews' => 'xx-uca-fa', // T139110
+   'fawikiquote' => 'xx-uca-fa', // T139110
'fiwiki' => 'uca-fi', // T48330
'fiwikibooks' => 'uca-fi', // T48330
'fiwikimedia' => 'uca-fi', // T48330

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...GeoData[master]: Temp hax to point GeoData at codfw DC

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

Change subject: Temp hax to point GeoData at codfw DC
..

Temp hax to point GeoData at codfw DC

The eqiad elasticsearch cluster is currently running a mixed version
cluster, having both versions 5.1.2 and 5.3.2. While elasticsearch is
supposed to guarnatee that mixed clusters of the same major version will
work fine, it seems they made a mistake and there is an enum related to
geo search that was changed. This basically means requests from one
version to the other fail because the enum's get interpreted wrong.

This will fix itself as the cluster upgrade is completed. Pushing only
to wmf.4 (and already in wmf.2) so prevent errors as this sees 5 or 10k
uses per hour.

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


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

diff --git a/includes/Searcher.php b/includes/Searcher.php
index 852feb6..4220024 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -18,7 +18,7 @@
/** @var SearchConfig $config */
$config = ConfigFactory::getDefaultInstance()->makeConfig( 
'CirrusSearch' );
/** @suppress PhanTypeMismatchArgument */
-   $connection = new \CirrusSearch\Connection( $config );
+   $connection = new \CirrusSearch\Connection( $config, 'codfw' );
 
parent::__construct( $connection, $user, 0 );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe32c3f1a15e03583edbd42c1b53704b467ffe9b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GeoData
Gerrit-Branch: master
Gerrit-Owner: EBernhardson 

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


[MediaWiki-commits] [Gerrit] mediawiki...grabbers[master]: Improvements to text grabbers

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

Change subject: Improvements to text grabbers
..


Improvements to text grabbers

grabNewText:
- Added handling of tags (ported from grabText)
- Added handling of content model (untested due to using 1.19 as source wiki)
- Added handling of revdeleted entries (ported from grabText)
- Added handling of external storage on destination wiki
- Check of previous revision for inserting the same text ID has been
  simplified to select only the previous adjacent revision of the page
  so it limits the quantity of rows it needs to query

grabText:
- Overall rewrite to mimick grabNewText good practices: Use member variables
  instead of globals, and methods from processPage to the end have been copied
  from grabNewText.php (with minor cleanup of unused parameters in grabText.php)
- Added namespaces parameter to limit which namespaces to grab
- Added start parameter to resume a grab from a given page
- Added handling of content model (untested due to using 1.19 as source wiki)
- Added handling of external storage on destination wiki

mediawikibot:
- Using an array for retry times instead of a dirty nested if, for ease of 
expanding
- Better error handling. Don't assume an array with the given query key will be
  returned, since this is not true when using generators that can return empty 
sets,
  which was causing such responses being marked as errors and retried.
- Documented that login returns null if succeeded (lol) and better handle 
errors there.

Change-Id: Id8ad5a991823fcb19b4779eaaa6528f8cdc27a9b
---
M grabNewText.php
M grabText.php
M mediawikibot.class.php
3 files changed, 807 insertions(+), 445 deletions(-)

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



diff --git a/grabNewText.php b/grabNewText.php
index 41fd0c0..2ec2c6b 100755
--- a/grabNewText.php
+++ b/grabNewText.php
@@ -195,6 +195,7 @@
$this->processRecentLogs();
$this->processRecentChanges();
 
+   $this->output( "\nDone.\n" );
# Done.
}
 
@@ -415,6 +416,8 @@
 * revisions that should be already in the database
 */
function processPage( $page, $start = null, $skipPrevious = true ) {
+   global $wgContentHandlerUseDB;
+
$pageID = $page['pageid'];
$pageTitle = null;
$pageDesignation = "id $pageID";
@@ -429,7 +432,7 @@
$params = array(
'prop' => 'info|revisions',
'rvlimit' => 'max',
-   'rvprop' => 
'ids|flags|timestamp|user|userid|comment|content',
+   'rvprop' => 
'ids|flags|timestamp|user|userid|comment|content|tags',
'rvdir' => 'newer',
'rvend' => wfTimestamp( TS_ISO_8601, $this->endDate )
);
@@ -444,6 +447,9 @@
}
if ( $page['protection'] ) {
$params['inprop'] = 'protection';
+   }
+   if ( $wgContentHandlerUseDB ) {
+   $params['rvprop'] = $params['rvprop'] . '|contentmodel';
}
 
$result = $this->bot->query( $params );
@@ -482,6 +488,7 @@
'random' => wfRandom(),
'touched' => wfTimestampNow(),
'len' => 0,
+   'content_model' => null
);
# Trim and convert displayed title to database page title
# Get it from the returned value from api
@@ -494,6 +501,17 @@
$page_e['len'] = $info_pages[0]['length'];
$page_e['counter'] = ( isset( $info_pages[0]['counter'] ) ? 
$info_pages[0]['counter'] : 0 );
$page_e['latest'] = $info_pages[0]['lastrevid'];
+   $defaultModel = null;
+   if ( $wgContentHandlerUseDB && isset( 
$info_pages[0]['contentmodel'] ) ) {
+   # This would be the most accurate way of getting the 
content model for a page.
+   # However it calls hooks and can be incredibly slow or 
cause errors
+   #$defaultModel = ContentHandler::getDefaultModelFor( 
Title:makeTitle( $page_e['namespace'], $page_e['title'] ) );
+   $defaultModel = MWNamespace::getNamespaceContentModel( 
$info_pages[0]['ns'] ) || CONTENT_MODEL_WIKITEXT;
+   # Set only if not the default content model
+   if ( $defaultModel != $info_pages[0]['contentmodel'] ) {
+   $page_e['content_model'] = 
$info_pages[0]['contentmodel'];
+   }
+   }
 
# Check if page is present
$pageIsPresent = false;
@@ -556,7 +574,7 @@
while ( true ) {
  

[MediaWiki-commits] [Gerrit] operations/puppet[production]: adding in dumpsdata00[12] install params

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

Change subject: adding in dumpsdata00[12] install params
..


adding in dumpsdata00[12] install params

setting dhcp and partitioning scheme
system has hw raid, not sw raid

Bug:T165173
Change-Id: I2312edd55fdef3fb869c4d9207e2e31d07a5fbb4
---
M modules/install_server/files/autoinstall/netboot.cfg
M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
2 files changed, 11 insertions(+), 1 deletion(-)

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



diff --git a/modules/install_server/files/autoinstall/netboot.cfg 
b/modules/install_server/files/autoinstall/netboot.cfg
index 900a731..42de62d 100755
--- a/modules/install_server/files/autoinstall/netboot.cfg
+++ b/modules/install_server/files/autoinstall/netboot.cfg
@@ -132,7 +132,7 @@
 labservices1001|labservices1002|radium|silver|uranium) echo 
partman/raid1.cfg ;; \
 osm-cp*) echo partman/mw.cfg ;; \
 ores200[1-9]) echo partman/raid1-lvm-ext4-srv-noswap.cfg;; \
-oresrdb2001) echo partman/lvm-ext-srv.cfg virtual.cfg;; \
+oresrdb2001|dumpsdata100[12]) echo partman/lvm-ext-srv.cfg 
virtual.cfg;; \
 pc100[4-6]|pc200[4-6]) echo partman/raid0-lvm-srv.cfg ;; \
 poolcounter1001) echo partman/flat.cfg virtual.cfg ;; \
 poolcounter1002) echo partman/raid1-lvm-ext4-srv.cfg ;; \
diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 
b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
index 5e08ca8..3a400ed 100644
--- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
+++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
@@ -1825,6 +1825,16 @@
 fixed-address druid1003.eqiad.wmnet;
 }
 
+host dumpsdata1001 {
+hardware ethernet 18:66:DA:FA:5E:A0;
+fixed-address dumpsdata1001.eqiad.wmnet;
+}
+
+host dumpsdata1002 {
+hardware ethernet 18:66:DA:FA:5E:A8;
+fixed-address dumpsdata1002.eqiad.wmnet;
+}
+
 host eeden {
 hardware ethernet a4:ba:db:30:d8:80;
 fixed-address eeden.wikimedia.org;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2312edd55fdef3fb869c4d9207e2e31d07a5fbb4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: RobH 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: RobH 
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]: adding in dumpsdata00[12] install params

2017-06-08 Thread RobH (Code Review)
RobH has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357949 )

Change subject: adding in dumpsdata00[12] install params
..

adding in dumpsdata00[12] install params

setting dhcp and partitioning scheme
system has hw raid, not sw raid

Bug:T165173
Change-Id: I2312edd55fdef3fb869c4d9207e2e31d07a5fbb4
---
M modules/install_server/files/autoinstall/netboot.cfg
M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
2 files changed, 11 insertions(+), 1 deletion(-)


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

diff --git a/modules/install_server/files/autoinstall/netboot.cfg 
b/modules/install_server/files/autoinstall/netboot.cfg
index 900a731..42de62d 100755
--- a/modules/install_server/files/autoinstall/netboot.cfg
+++ b/modules/install_server/files/autoinstall/netboot.cfg
@@ -132,7 +132,7 @@
 labservices1001|labservices1002|radium|silver|uranium) echo 
partman/raid1.cfg ;; \
 osm-cp*) echo partman/mw.cfg ;; \
 ores200[1-9]) echo partman/raid1-lvm-ext4-srv-noswap.cfg;; \
-oresrdb2001) echo partman/lvm-ext-srv.cfg virtual.cfg;; \
+oresrdb2001|dumpsdata100[12]) echo partman/lvm-ext-srv.cfg 
virtual.cfg;; \
 pc100[4-6]|pc200[4-6]) echo partman/raid0-lvm-srv.cfg ;; \
 poolcounter1001) echo partman/flat.cfg virtual.cfg ;; \
 poolcounter1002) echo partman/raid1-lvm-ext4-srv.cfg ;; \
diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 
b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
index 5e08ca8..3a400ed 100644
--- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
+++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200
@@ -1825,6 +1825,16 @@
 fixed-address druid1003.eqiad.wmnet;
 }
 
+host dumpsdata1001 {
+hardware ethernet 18:66:DA:FA:5E:A0;
+fixed-address dumpsdata1001.eqiad.wmnet;
+}
+
+host dumpsdata1002 {
+hardware ethernet 18:66:DA:FA:5E:A8;
+fixed-address dumpsdata1002.eqiad.wmnet;
+}
+
 host eeden {
 hardware ethernet a4:ba:db:30:d8:80;
 fixed-address eeden.wikimedia.org;

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Fix dumbness of last commit

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

Change subject: Fix dumbness of last commit
..

Fix dumbness of last commit

Change-Id: I1455922834c7ba99b52b3d26a6cf1f6db682b49d
---
M sites/all/modules/wmf_audit/BaseAuditProcessor.php
1 file changed, 9 insertions(+), 8 deletions(-)


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

diff --git a/sites/all/modules/wmf_audit/BaseAuditProcessor.php 
b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
index 700b127..b8154a3 100644
--- a/sites/all/modules/wmf_audit/BaseAuditProcessor.php
+++ b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
@@ -666,7 +666,7 @@

'Could not get an order id for the following transaction ' . print_r( 
$transaction, true )
);
}
-   $data = 
$this->get_log_data_by_order_id( $order_id, $log, $data );
+   $data = 
$this->get_log_data_by_order_id( $order_id, $log, $transaction );
 
if ( !$data ) {
//no 
data found in this log, which is expected and normal and not a problem.
@@ -677,12 +677,6 @@
//if we have 
data at this point, it means we have a match in the logs
$found += 1;
 
-   if ( 
!$this->check_consistency( $data, $transaction ) ) {
-   throw 
new WmfException(
-   
'DATA_INCONSISTENT',
-   
'Inconsistent data. Skipping the following: ' . print_r( $transaction, true ) . 
"\n" . print_r( $data, true )
-   );
-   }
$all_data = 
$this->merge_data( $data, $transaction );
//lookup 
contribution_tracking data, and fill it in with audit markers if there's 
nothing there.

$contribution_tracking_data = wmf_audit_get_contribution_tracking_data( 
$all_data );
@@ -1058,7 +1052,8 @@
 * If this log doesn't contain data for the order_id in question, 
return false.
 * @param string $order_id The order id (transaction id) of the missing 
payment
 * @param string $log The full path to the log we want to search
-* @return array|boolean The data we sent to the gateway for that order 
id, or
+* @param $audit_data array the data from the audit file.
+* @return array|bool The data we sent to the gateway for that order 
id, or
 * false if we can't find it there.
 */
protected function get_log_data_by_order_id( $order_id, $log, 
$audit_data ) {
@@ -1078,6 +1073,7 @@
if ( count( $ret ) > 1 ) {
wmf_audit_echo( "Odd: More than one logline 
returned for $order_id. Investigation Required." );
}
+   $raw_data = array();
 
// Get a log line that is consistent with the data from 
the audit file
// Count backwards, because we used to only take the 
last one.
@@ -1101,6 +1097,11 @@
return $raw_data;
}
}
+   // We have log data, but nothing matches. This is too 
weird.
+   throw new WmfException(
+   'DATA_INCONSISTENT',
+   'Inconsistent data. Skipping the following: ' . 
print_r( $audit_data, true ) . "\n" . print_r( $raw_data, true )
+   );
}
return false; //no big deal, it just wasn't there. This will 
happen most of the time.
}

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: Fix T167473 - should use object access, not array, for selec...

2017-06-08 Thread Smalyshev (Code Review)
Smalyshev has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357947 )

Change subject: Fix T167473 - should use object access, not array, for select 
results.
..

Fix T167473 - should use object access, not array, for select results.

Bug: T167473
Change-Id: Ia2b4ddfd63fc45d9967996f63798abb78aba73d3
---
M includes/Job/DeleteArchive.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/Job/DeleteArchive.php b/includes/Job/DeleteArchive.php
index fb9560b..061c884 100644
--- a/includes/Job/DeleteArchive.php
+++ b/includes/Job/DeleteArchive.php
@@ -23,7 +23,7 @@
 
// Remove page IDs that still have archived revs
foreach ( $archive->listRevisions() as $rev ) {
-   unset( $docs[$rev['ar_page_id']] );
+   unset( $docs[$rev->ar_page_id] );
}
 
if ( empty( $docs ) ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...RevisionSlider[wmf/1.30.0-wmf.4]: Also drop Revision typehint from $oldRev

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

Change subject: Also drop Revision typehint from $oldRev
..


Also drop Revision typehint from $oldRev

Already did this in $oldRev, this follows up I4c483d7

Bug: T167359
Change-Id: I8b74932caf1188005155b4cbd8a1ff76066b1604
(cherry picked from commit 0687de3fbdc321f2f66f6ed2f7f075733b9687b8)
---
M src/RevisionSliderHooks.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/RevisionSliderHooks.php b/src/RevisionSliderHooks.php
index c89b0ec..a46ef36 100644
--- a/src/RevisionSliderHooks.php
+++ b/src/RevisionSliderHooks.php
@@ -29,7 +29,7 @@
return self::$config;
}
 
-   public static function onDiffViewHeader( DifferenceEngine $diff, 
Revision $oldRev, $newRev ) {
+   public static function onDiffViewHeader( DifferenceEngine $diff, 
$oldRev, $newRev ) {
// sometimes $oldRev can be null (e.g. missing rev), and 
perhaps also $newRev (T167359)
if ( !( $oldRev instanceof Revision ) || !( $newRev instanceof 
Revision ) ) {
return true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8b74932caf1188005155b4cbd8a1ff76066b1604
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: wmf/1.30.0-wmf.4
Gerrit-Owner: Chad 
Gerrit-Reviewer: Chad 
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...RevisionSlider[wmf/1.30.0-wmf.4]: Also drop Revision typehint from $oldRev

2017-06-08 Thread Chad (Code Review)
Chad has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357946 )

Change subject: Also drop Revision typehint from $oldRev
..

Also drop Revision typehint from $oldRev

Already did this in $oldRev, this follows up I4c483d7

Bug: T167359
Change-Id: I8b74932caf1188005155b4cbd8a1ff76066b1604
(cherry picked from commit 0687de3fbdc321f2f66f6ed2f7f075733b9687b8)
---
M src/RevisionSliderHooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/RevisionSliderHooks.php b/src/RevisionSliderHooks.php
index c89b0ec..a46ef36 100644
--- a/src/RevisionSliderHooks.php
+++ b/src/RevisionSliderHooks.php
@@ -29,7 +29,7 @@
return self::$config;
}
 
-   public static function onDiffViewHeader( DifferenceEngine $diff, 
Revision $oldRev, $newRev ) {
+   public static function onDiffViewHeader( DifferenceEngine $diff, 
$oldRev, $newRev ) {
// sometimes $oldRev can be null (e.g. missing rev), and 
perhaps also $newRev (T167359)
if ( !( $oldRev instanceof Revision ) || !( $newRev instanceof 
Revision ) ) {
return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b74932caf1188005155b4cbd8a1ff76066b1604
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: wmf/1.30.0-wmf.4
Gerrit-Owner: Chad 

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


[MediaWiki-commits] [Gerrit] mediawiki...RevisionSlider[master]: Also drop Revision typehint from $oldRev

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

Change subject: Also drop Revision typehint from $oldRev
..


Also drop Revision typehint from $oldRev

Already did this in $oldRev, this follows up I4c483d7

Bug: T167359
Change-Id: I8b74932caf1188005155b4cbd8a1ff76066b1604
---
M src/RevisionSliderHooks.php
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/RevisionSliderHooks.php b/src/RevisionSliderHooks.php
index c89b0ec..a46ef36 100644
--- a/src/RevisionSliderHooks.php
+++ b/src/RevisionSliderHooks.php
@@ -29,7 +29,7 @@
return self::$config;
}
 
-   public static function onDiffViewHeader( DifferenceEngine $diff, 
Revision $oldRev, $newRev ) {
+   public static function onDiffViewHeader( DifferenceEngine $diff, 
$oldRev, $newRev ) {
// sometimes $oldRev can be null (e.g. missing rev), and 
perhaps also $newRev (T167359)
if ( !( $oldRev instanceof Revision ) || !( $newRev instanceof 
Revision ) ) {
return true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8b74932caf1188005155b4cbd8a1ff76066b1604
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: master
Gerrit-Owner: Chad 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Tobias Gritschacher 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

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

Change subject: Merge branch 'master' into deployment
..


Merge branch 'master' into deployment

25e944bd3 For multiple matching log lines, pick a consistent one

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

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




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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...RevisionSlider[master]: Also drop Revision typehint from $oldRev

2017-06-08 Thread Chad (Code Review)
Chad has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357945 )

Change subject: Also drop Revision typehint from $oldRev
..

Also drop Revision typehint from $oldRev

Already did this in $oldRev, this follows up I4c483d7

Bug: T167359
Change-Id: I8b74932caf1188005155b4cbd8a1ff76066b1604
---
M src/RevisionSliderHooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/RevisionSliderHooks.php b/src/RevisionSliderHooks.php
index c89b0ec..a46ef36 100644
--- a/src/RevisionSliderHooks.php
+++ b/src/RevisionSliderHooks.php
@@ -29,7 +29,7 @@
return self::$config;
}
 
-   public static function onDiffViewHeader( DifferenceEngine $diff, 
Revision $oldRev, $newRev ) {
+   public static function onDiffViewHeader( DifferenceEngine $diff, 
$oldRev, $newRev ) {
// sometimes $oldRev can be null (e.g. missing rev), and 
perhaps also $newRev (T167359)
if ( !( $oldRev instanceof Revision ) || !( $newRev instanceof 
Revision ) ) {
return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b74932caf1188005155b4cbd8a1ff76066b1604
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: master
Gerrit-Owner: Chad 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment

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

Change subject: Merge branch 'master' into deployment
..

Merge branch 'master' into deployment

25e944bd3 For multiple matching log lines, pick a consistent one

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


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/44/357944/1


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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: For multiple matching log lines, pick a consistent one

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

Change subject: For multiple matching log lines, pick a consistent one
..


For multiple matching log lines, pick a consistent one

Instead of arbitrarily taking the last matching line, take the one
that has currency and amount consistent with the audit data.

Bug: T167380
Change-Id: I71b7eadbf28ac539b09d318beaec8d2c8f22a9ea
---
M sites/all/modules/wmf_audit/BaseAuditProcessor.php
1 file changed, 21 insertions(+), 16 deletions(-)

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



diff --git a/sites/all/modules/wmf_audit/BaseAuditProcessor.php 
b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
index 8b75fc7..700b127 100644
--- a/sites/all/modules/wmf_audit/BaseAuditProcessor.php
+++ b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
@@ -666,7 +666,7 @@

'Could not get an order id for the following transaction ' . print_r( 
$transaction, true )
);
}
-   $data = 
$this->get_log_data_by_order_id( $order_id, $log );
+   $data = 
$this->get_log_data_by_order_id( $order_id, $log, $data );
 
if ( !$data ) {
//no 
data found in this log, which is expected and normal and not a problem.
@@ -1061,7 +1061,7 @@
 * @return array|boolean The data we sent to the gateway for that order 
id, or
 * false if we can't find it there.
 */
-   protected function get_log_data_by_order_id( $order_id, $log ) {
+   protected function get_log_data_by_order_id( $order_id, $log, 
$audit_data ) {
if ( !$order_id ) {
return false;
}
@@ -1079,22 +1079,27 @@
wmf_audit_echo( "Odd: More than one logline 
returned for $order_id. Investigation Required." );
}
 
-   //just take the last one, just in case somebody did 
manage to do a duplicate.
-   $line = $ret[count( $ret ) - 1];
-   // $linedata for *everything* from payments goes Month, 
day, time, box, bucket, CTID:OID, absolute madness with lots of unpredictable 
spaces.
-   // Hack: logs space-pad single digit days, so we 
collapse all repeated spaces
-   $unspaced = preg_replace( '/ +/', ' ', $line );
-   $linedata = explode( ' ', $unspaced );
-   $contribution_id = explode( ':', $linedata[5] );
-   $contribution_id = $contribution_id[0];
+   // Get a log line that is consistent with the data from 
the audit file
+   // Count backwards, because we used to only take the 
last one.
+   foreach( array_reverse( $ret ) as $line ) {
+   // $linedata for *everything* from payments 
goes Month, day, time, box, bucket, CTID:OID, absolute madness with lots of 
unpredictable spaces.
+   // Hack: logs space-pad single digit days, so 
we collapse all repeated spaces
+   $unspaced = preg_replace( '/ +/', ' ', $line );
+   $linedata = explode( ' ', $unspaced );
+   $contribution_id = explode( ':', $linedata[5] );
+   $contribution_id = $contribution_id[0];
 
-   $raw_data = $this->parse_log_line( $line );
+   $raw_data = $this->parse_log_line( $line );
 
-   if ( !empty( $raw_data ) ) {
-   $raw_data['contribution_tracking_id'] = 
$contribution_id;
-   return $raw_data;
-   } else {
-   wmf_audit_log_error( "We found a transaction in 
the logs for $order_id, but there's nothing left after we tried to grab its 
data. Investigation required.", 'DATA_WEIRD' );
+   if ( empty( $raw_data ) ) {
+   wmf_audit_log_error(
+   "We found a transaction in the 
logs for $order_id, but there's nothing left after we tried to grab its data. 
Investigation required.",
+   'DATA_WEIRD'
+   );
+   } else if ( $this->check_consistency( 
$raw_data, $audit_data ) ) {
+

[MediaWiki-commits] [Gerrit] mediawiki...CentralNotice[master]: Always use braces after if

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

Change subject: Always use braces after if
..


Always use braces after if

Makes if blocks more readable

Change-Id: I9883d46de2a71efdc02ccad19f67ae7c93854611
---
M CentralNoticePageLogPager.php
M maintenance/CleanCNTranslateMetadata.php
2 files changed, 6 insertions(+), 2 deletions(-)

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



diff --git a/CentralNoticePageLogPager.php b/CentralNoticePageLogPager.php
index 2d46dd7..8a2ddb9 100644
--- a/CentralNoticePageLogPager.php
+++ b/CentralNoticePageLogPager.php
@@ -80,7 +80,9 @@
// Split the title into banner, message, and language
$titlePieces = explode( "/", $row->rc_title, 2 );
$titleBase = $titlePieces[0];
-   if ( array_key_exists( 1, $titlePieces ) ) $language = 
$titlePieces[1];
+   if ( array_key_exists( 1, $titlePieces ) ) {
+   $language = $titlePieces[1];
+   }
$pattern = '/Centralnotice-([^-]*)-(.*)/';
preg_match( $pattern, $titleBase, $matches );
$banner = $matches[1];
diff --git a/maintenance/CleanCNTranslateMetadata.php 
b/maintenance/CleanCNTranslateMetadata.php
index 11479b2..2cd538f 100644
--- a/maintenance/CleanCNTranslateMetadata.php
+++ b/maintenance/CleanCNTranslateMetadata.php
@@ -56,7 +56,9 @@
);
 
foreach ( $res as $row ) {
-   if ( (int)$row->count === 1 ) continue;
+   if ( (int)$row->count === 1 ) {
+   continue;
+   }
 
$db->delete(
'revtag',

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: phabricator: move hiera lookups to parameters

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

Change subject: phabricator: move hiera lookups to parameters
..


phabricator: move hiera lookups to parameters

Change-Id: If2b2e5b2c3895d55fd56859915b5be53b2338054
---
M modules/profile/manifests/phabricator/main.pp
1 file changed, 17 insertions(+), 23 deletions(-)

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



diff --git a/modules/profile/manifests/phabricator/main.pp 
b/modules/profile/manifests/phabricator/main.pp
index 881b2bf..22bfed5 100644
--- a/modules/profile/manifests/phabricator/main.pp
+++ b/modules/profile/manifests/phabricator/main.pp
@@ -1,7 +1,23 @@
 # phabricator instance
 #
 # filtertags: labs-project-deployment-prep labs-project-phabricator
-class profile::phabricator::main {
+class profile::phabricator::main (
+$cache_misc_nodes = hiera('cache::misc::nodes', []),
+$domain = hiera('phabricator_domain', 'phabricator.wikimedia.org'),
+$altdom = hiera('phabricator_altdomain', 'phab.wmfusercontent.org'),
+$mysql_host = hiera('phabricator::mysql::master', 'localhost'),
+$mysql_slave = hiera('phabricator::mysql::slave', 'localhost'),
+$phab_root_dir = '/srv/phab',
+$deploy_target = 'phabricator/deployment',
+$phab_app_user = hiera('phabricator_app_user', undef),
+$phab_app_pass = hiera('phabricator_app_pass', undef),
+$phab_daemons_user = hiera('phabricator_daemons_user', undef),
+$phab_daemons_pass = hiera('phabricator_daemons_pass', undef),
+$phab_mysql_admin_user = hiera('phabricator_admin_user', undef),
+$phab_mysql_admin_pass = hiera('phabricator_admin_pass', undef),
+$phab_diffusion_ssh_host = hiera('phabricator_diffusion_ssh_host', 
'git-ssh.wikimedia.org'),
+$cluster_search = hiera('phabricator_cluster_search'),
+){
 
 mailalias { 'root':
 recipient => 'r...@wikimedia.org',
@@ -9,16 +25,6 @@
 
 include passwords::phabricator
 include passwords::mysql::phabricator
-
-# this site's misc-lb caching proxies hostnames
-$cache_misc_nodes = hiera('cache::misc::nodes', [])
-$domain = hiera('phabricator_domain', 'phabricator.wikimedia.org')
-$altdom = hiera('phabricator_altdomain', 'phab.wmfusercontent.org')
-
-$mysql_host = hiera('phabricator::mysql::master', 'localhost')
-$mysql_slave = hiera('phabricator::mysql::slave', 'localhost')
-$phab_root_dir = '/srv/phab'
-$deploy_target = 'phabricator/deployment'
 
 # logmail and dumps are only enabled on the active server set in Hiera
 $phabricator_active_server = hiera('phabricator_active_server')
@@ -31,11 +37,6 @@
 $dump_rsync_ensure ='absent'
 $dump_enabled = false
 }
-
-$phab_app_user = hiera('phabricator_app_user', undef)
-$phab_app_pass = hiera('phabricator_app_pass', undef)
-$phab_daemons_user = hiera('phabricator_daemons_user', undef)
-$phab_daemons_pass = hiera('phabricator_daemons_pass', undef)
 
 # todo: change the password for app_user
 if $phab_app_user == undef {
@@ -104,9 +105,6 @@
 },
 }
 
-$phab_mysql_admin_user = hiera('phabricator_admin_user', undef)
-$phab_mysql_admin_pass = hiera('phabricator_admin_pass', undef)
-
 if $phab_mysql_admin_user == undef {
 $mysql_admin_user = $passwords::mysql::phabricator::admin_user
 } else {
@@ -118,10 +116,6 @@
 } else {
 $mysql_admin_pass = $phab_mysql_admin_pass
 }
-
-$phab_diffusion_ssh_host = hiera('phabricator_diffusion_ssh_host', 
'git-ssh.wikimedia.org')
-
-$cluster_search = hiera('phabricator_cluster_search')
 
 # lint:ignore:arrow_alignment
 class { '::phabricator':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If2b2e5b2c3895d55fd56859915b5be53b2338054
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: 20after4 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Giuseppe Lavagetto 
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...CentralNotice[master]: Put static after visibility in functions

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

Change subject: Put static after visibility in functions
..


Put static after visibility in functions

This order is usually used

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

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



diff --git a/includes/Banner.php b/includes/Banner.php
index b09caab..49e36fe 100644
--- a/includes/Banner.php
+++ b/includes/Banner.php
@@ -1144,7 +1144,7 @@
 * @param integer $pageId ID of the MediaWiki page for the banner
 * @throws Exception
 */
-   static protected function removeTag( $tag, $pageId ) {
+   protected static function removeTag( $tag, $pageId ) {
$dbw = CNDatabase::getDb();
 
$conds = array(

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[wmf/1.30.0-wmf.4]: Ensure mDiffEngine is always available

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

Change subject: Ensure mDiffEngine is always available
..


Ensure mDiffEngine is always available

The methods have been renamed to make it clearer what the purpose
of these methods are.

They are also made private to make it clear they should not be
used out of context.

addMobileDiff should only be called if InlineDifferenceEngine is
used as getWarningMessageText is not a method of DifferenceEngine

This is a follow up to
I68cf50f5dd339f34802d70df1f32d2c3390944a3

Bug: T167461
Change-Id: Ia59d76769960630859c9666acc5a28317e9272b7
(cherry picked from commit 833d3f44f796b09016f15dc63e9361908f99)
---
M includes/specials/SpecialMobileDiff.php
1 file changed, 19 insertions(+), 16 deletions(-)

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



diff --git a/includes/specials/SpecialMobileDiff.php 
b/includes/specials/SpecialMobileDiff.php
index 1933dd8..89521a5 100644
--- a/includes/specials/SpecialMobileDiff.php
+++ b/includes/specials/SpecialMobileDiff.php
@@ -133,9 +133,7 @@
 
$output->addHtml( '' );
 
-   $this->setupDifferenceEngine();
-   $this->showHeader();
-   $this->showDiff();
+   $this->displayMobileDiff();
$output->addHtml( '' );
 
$this->showFooter( $ctx );
@@ -155,15 +153,16 @@
}
 
/**
-* Setups the DifferenceEngine.
+* Setups the mobile DifferenceEngine and displays a mobile optimised 
diff.
 */
-   protected function setupDifferenceEngine() {
+   protected function displayMobileDiff() {
+   $useMobileMode = false;
$contentHandler = $this->rev->getContentHandler();
-   $de = $contentHandler->createDifferenceEngine( 
$this->getContext(), $this->getPrevId(),
-   $this->revId );
-   // HACK:
-   if ( get_class( $de ) == 'DifferenceEngine' ) {
-   $de = new $this->diffClass(
+   $this->mDiffEngine = $contentHandler->createDifferenceEngine( 
$this->getContext(),
+   $this->getPrevId(), $this->revId );
+
+   if ( get_class( $this->mDiffEngine ) == 'DifferenceEngine' ) {
+   $this->mDiffEngine = new $this->diffClass(
$this->getContext(),
$this->getPrevId(),
$this->revId,
@@ -171,11 +170,15 @@
false,
(bool)$this->getRequest()->getVal( 'unhide' )
);
-   } else {
-   $de->showDiffPage();
-   return;
+   $useMobileMode = true;
}
-   $this->mDiffEngine = $de;
+
+   $this->showHeader();
+   if ( $useMobileMode ) {
+   $this->addMobileDiff();
+   } else {
+   $this->mDiffEngine->showDiffPage();
+   }
}
 
/**
@@ -185,7 +188,7 @@
 * Day and time of edit
 * Edit Comment
 */
-   function showHeader() {
+   private function showHeader() {
$title = $this->targetTitle;
 
if ( $this->prevRev ) {
@@ -257,7 +260,7 @@
 * Render the inline difference between two revisions
 * using InlineDiffEngine
 */
-   function showDiff() {
+   private function addMobileDiff() {
$output = $this->getOutput();
 
$prevId = $this->getPrevId();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia59d76769960630859c9666acc5a28317e9272b7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: wmf/1.30.0-wmf.4
Gerrit-Owner: Chad 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Jdlrobson 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update change-propagation to 39d2d44

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

Change subject: Update change-propagation to 39d2d44
..


Update change-propagation to 39d2d44

List of changes:
b9e1e86 Hack: tell the monitoring script not to monitor the limiter

Change-Id: I4023c62b8e60267de91b577d211c769bee5cd264
---
M src
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src b/src
index baf0d33..39d2d44 16
--- a/src
+++ b/src
@@ -1 +1 @@
-Subproject commit baf0d330c5d4b82dfa35db953ced8cbf2d5bedb0
+Subproject commit 39d2d440a84526654465a7e18d34b301bb205631

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4023c62b8e60267de91b577d211c769bee5cd264
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/change-propagation/deploy
Gerrit-Branch: master
Gerrit-Owner: Mobrovac 
Gerrit-Reviewer: Mobrovac 

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


[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update change-propagation to 39d2d44

2017-06-08 Thread Mobrovac (Code Review)
Mobrovac has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357943 )

Change subject: Update change-propagation to 39d2d44
..

Update change-propagation to 39d2d44

List of changes:
b9e1e86 Hack: tell the monitoring script not to monitor the limiter

Change-Id: I4023c62b8e60267de91b577d211c769bee5cd264
---
M src
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/services/change-propagation/deploy 
refs/changes/43/357943/1

diff --git a/src b/src
index baf0d33..39d2d44 16
--- a/src
+++ b/src
@@ -1 +1 @@
-Subproject commit baf0d330c5d4b82dfa35db953ced8cbf2d5bedb0
+Subproject commit 39d2d440a84526654465a7e18d34b301bb205631

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4023c62b8e60267de91b577d211c769bee5cd264
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/change-propagation/deploy
Gerrit-Branch: master
Gerrit-Owner: Mobrovac 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[wmf/1.30.0-wmf.4]: Ensure mDiffEngine is always available

2017-06-08 Thread Chad (Code Review)
Chad has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357942 )

Change subject: Ensure mDiffEngine is always available
..

Ensure mDiffEngine is always available

The methods have been renamed to make it clearer what the purpose
of these methods are.

They are also made private to make it clear they should not be
used out of context.

addMobileDiff should only be called if InlineDifferenceEngine is
used as getWarningMessageText is not a method of DifferenceEngine

This is a follow up to
I68cf50f5dd339f34802d70df1f32d2c3390944a3

Bug: T167461
Change-Id: Ia59d76769960630859c9666acc5a28317e9272b7
(cherry picked from commit 833d3f44f796b09016f15dc63e9361908f99)
---
M includes/specials/SpecialMobileDiff.php
1 file changed, 19 insertions(+), 16 deletions(-)


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

diff --git a/includes/specials/SpecialMobileDiff.php 
b/includes/specials/SpecialMobileDiff.php
index 1933dd8..89521a5 100644
--- a/includes/specials/SpecialMobileDiff.php
+++ b/includes/specials/SpecialMobileDiff.php
@@ -133,9 +133,7 @@
 
$output->addHtml( '' );
 
-   $this->setupDifferenceEngine();
-   $this->showHeader();
-   $this->showDiff();
+   $this->displayMobileDiff();
$output->addHtml( '' );
 
$this->showFooter( $ctx );
@@ -155,15 +153,16 @@
}
 
/**
-* Setups the DifferenceEngine.
+* Setups the mobile DifferenceEngine and displays a mobile optimised 
diff.
 */
-   protected function setupDifferenceEngine() {
+   protected function displayMobileDiff() {
+   $useMobileMode = false;
$contentHandler = $this->rev->getContentHandler();
-   $de = $contentHandler->createDifferenceEngine( 
$this->getContext(), $this->getPrevId(),
-   $this->revId );
-   // HACK:
-   if ( get_class( $de ) == 'DifferenceEngine' ) {
-   $de = new $this->diffClass(
+   $this->mDiffEngine = $contentHandler->createDifferenceEngine( 
$this->getContext(),
+   $this->getPrevId(), $this->revId );
+
+   if ( get_class( $this->mDiffEngine ) == 'DifferenceEngine' ) {
+   $this->mDiffEngine = new $this->diffClass(
$this->getContext(),
$this->getPrevId(),
$this->revId,
@@ -171,11 +170,15 @@
false,
(bool)$this->getRequest()->getVal( 'unhide' )
);
-   } else {
-   $de->showDiffPage();
-   return;
+   $useMobileMode = true;
}
-   $this->mDiffEngine = $de;
+
+   $this->showHeader();
+   if ( $useMobileMode ) {
+   $this->addMobileDiff();
+   } else {
+   $this->mDiffEngine->showDiffPage();
+   }
}
 
/**
@@ -185,7 +188,7 @@
 * Day and time of edit
 * Edit Comment
 */
-   function showHeader() {
+   private function showHeader() {
$title = $this->targetTitle;
 
if ( $this->prevRev ) {
@@ -257,7 +260,7 @@
 * Render the inline difference between two revisions
 * using InlineDiffEngine
 */
-   function showDiff() {
+   private function addMobileDiff() {
$output = $this->getOutput();
 
$prevId = $this->getPrevId();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia59d76769960630859c9666acc5a28317e9272b7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: wmf/1.30.0-wmf.4
Gerrit-Owner: Chad 
Gerrit-Reviewer: Jdlrobson 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Refactor mobile diff code

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

Change subject: Hygiene: Refactor mobile diff code
..

Hygiene: Refactor mobile diff code

Implement InlineDifferenceEngine::showDiffPage rather than
making it a method of SpecialMobileDiff. This will make it easier
to upstream to core and avoid methods unique to
InlineDifferenceEngine being called on DifferenceEngine classes

Change-Id: I04d7c150cee24a4a079aeba6eebedc3b696ed7a7
---
M includes/diff/InlineDifferenceEngine.php
M includes/specials/SpecialMobileDiff.php
2 files changed, 64 insertions(+), 70 deletions(-)


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

diff --git a/includes/diff/InlineDifferenceEngine.php 
b/includes/diff/InlineDifferenceEngine.php
index 7ce5599..324cc90 100644
--- a/includes/diff/InlineDifferenceEngine.php
+++ b/includes/diff/InlineDifferenceEngine.php
@@ -49,6 +49,69 @@
}
 
/**
+* Render the inline difference between two revisions
+* using InlineDiffEngine
+*/
+   public function showDiffPage( $diffOnly = false ) {
+   $output = $this->getOutput();
+
+   $prevId = $this->getOldid();
+   $unhide = (bool)$this->getRequest()->getVal( 'unhide' );
+   $diff = $this->getDiffBody();
+
+   $rev = Revision::newFromId( $this->getNewid() );
+
+   if ( !$prevId ) {
+   $audience = $unhide ? Revision::FOR_THIS_USER : 
Revision::FOR_PUBLIC;
+   $diff = ''
+   . nl2br(
+   htmlspecialchars(
+   ContentHandler::getContentText( 
$rev->getContent( $audience ) )
+   )
+   )
+   . '';
+   }
+
+   $warnings = $this->getWarningMessageText();
+   if ( $warnings ) {
+   $warnings = MobileUI::warningBox( $warnings );
+   }
+   $output->addHtml(
+   $warnings .
+   '' .
+   $diff .
+   ''
+   );
+   $prev = $rev->getPrevious();
+   $next = $rev->getNext();
+   if ( $prev || $next ) {
+   $history = Html::openElement( 'ul', [ 'class' => 'hlist 
revision-history-links' ] );
+   if ( $prev ) {
+   $history .= Html::openElement( 'li' ) .
+   Html::element( 'a', [
+   'href' => 
SpecialPage::getTitleFor( 'MobileDiff', $prev->getId() )->getLocalUrl()
+   ], $this->msg( 'previousdiff' ) ) . 
Html::closeElement( 'li' );
+   }
+   if ( $next ) {
+   $history .= Html::openElement( 'li' ) .
+   Html::element( 'a', [
+   'href' => 
SpecialPage::getTitleFor( 'MobileDiff', $next->getId() )->getLocalUrl()
+   ], $this->msg( 'nextdiff' ) ) . 
Html::closeElement( 'li' );
+   }
+   $history .= Html::closeElement( 'ul' );
+   $output->addHtml( $history );
+   }
+
+   $output->addHtml( Html::rawElement(
+   'div',
+   [
+   'class' => 'patrollink'
+   ],
+   $this->getPatrolledLink()
+   ) );
+   }
+
+   /**
 * Checks whether the diff should be hidden from the current user
 * This is based on whether the user is allowed to see it and whether
 * the flag unhide is set to allow viewing deleted revisions.
diff --git a/includes/specials/SpecialMobileDiff.php 
b/includes/specials/SpecialMobileDiff.php
index 54fa5b6..bacaaa6 100644
--- a/includes/specials/SpecialMobileDiff.php
+++ b/includes/specials/SpecialMobileDiff.php
@@ -157,7 +157,6 @@
 * Setups the mobile DifferenceEngine and displays a mobile optimised 
diff.
 */
protected function displayMobileDiff() {
-   $useMobileMode = false;
$contentHandler = $this->rev->getContentHandler();
$this->mDiffEngine = $contentHandler->createDifferenceEngine( 
$this->getContext(),
$this->getPrevId(), $this->revId );
@@ -171,15 +170,10 @@
false,
(bool)$this->getRequest()->getVal( 'unhide' )
);
-   $useMobileMode = true;
  

[MediaWiki-commits] [Gerrit] operations/dns[master]: DNS: Add mgmt and production DNS for labtestneutron2002 and ...

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

Change subject: DNS: Add mgmt and production DNS for labtestneutron2002 and 
labtestnet2002
..


DNS: Add mgmt and production DNS for labtestneutron2002 and labtestnet2002

Bug:T167159
Bug:T167160
Change-Id: Ib450a2f0dcc5a08490ba5ad36cf3e5ea96a6954b
---
M templates/10.in-addr.arpa
M templates/wmnet
2 files changed, 12 insertions(+), 1 deletion(-)

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



diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa
index c9cc2fb..dd2c229 100644
--- a/templates/10.in-addr.arpa
+++ b/templates/10.in-addr.arpa
@@ -3119,6 +3119,8 @@
 6   1H IN PTR   labtestvirt2001.codfw.wmnet.
 7   1H IN PTR   labtestvirt2002.codfw.wmnet.
 8   1H IN PTR   labtestvirt2003.codfw.wmnet.
+9   1H IN PTR   labtestnet2002.codfw.wmnet.
+10  1H IN PTR   labtestneutron2002.codfw.wmnet.
 
 ; 10.192.21.0/24 - labs-support1-b-codfw
 $ORIGIN 21.192.{{ zonename }}.
@@ -3572,7 +3574,10 @@
 32  1H IN PTR  wmf5820.mgmt.codfw.wmnet.
 33  1H IN PTR  labtestvirt2003.mgmt.codfw.wmnet.
 33  1H IN PTR  wmf6571.mgmt.codfw.wmnet.
-
+34  1H IN PTR  labtestnet2002.mgmt.codfw.wmnet.
+34  1H IN PTR  wmf6573.mgmt.codfw.wmnet.
+35  1H IN PTR  labtestneutron2002.mgmt.codfw.wmnet.
+35  1H IN PTR  wmf6574.mgmt.codfw.wmnet.
 36  1H IN PTR  labtestpuppetmaster2001.mgmt.codfw.wmnet.
 36  1H IN PTR  wmf6572.mgmt.codfw.wmnet.
 37  1H IN PTR  ms-be2001.mgmt.codfw.wmnet.
diff --git a/templates/wmnet b/templates/wmnet
index 8392a5e..5fbaa10 100644
--- a/templates/wmnet
+++ b/templates/wmnet
@@ -2672,7 +2672,9 @@
 labstore20041H  IN A10.192.21.8
 labtestpuppetmaster2001  1H  IN A10.192.48.91
 labtestneutron2001  1H  IN A10.192.20.4
+labtestneutron2002  1H  IN A10.192.20.10
 labtestnet2001  1H  IN A10.192.20.5
+labtestnet2002  1H  IN A10.192.20.9
 labtestvirt2001 1H  IN A10.192.20.6
 labtestvirt2002 1H  IN A10.192.20.7
 labtestvirt2003 1H  IN A10.192.20.8
@@ -3400,6 +3402,8 @@
 labtestnet20011H  IN A10.193.2.2
 labtestpuppetmaster20011H  IN A10.193.1.36
 labtestneutron20011H  IN A10.193.1.20
+labtestnet20021H  IN A10.193.1.34
+labtestneutron20021H  IN A10.193.1.35
 labtestservices2001   1H  IN A10.193.1.21
 labtestvirt2001   1H  IN A10.193.1.19
 labtestvirt2003   1H  IN A10.193.1.33
@@ -4231,6 +4235,8 @@
 wmf6570 1H  IN A10.193.2.136
 wmf6571 1H  IN A10.193.1.33
 wmf6572 1H  IN A10.193.1.36
+wmf6573 1H  IN A10.193.1.34
+wmf6574 1H  IN A10.193.1.35
 
 ;
 ; ESAMS

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib450a2f0dcc5a08490ba5ad36cf3e5ea96a6954b
Gerrit-PatchSet: 3
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Papaul 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: RobH 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Ensure mDiffEngine is always available

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

Change subject: Ensure mDiffEngine is always available
..


Ensure mDiffEngine is always available

The methods have been renamed to make it clearer what the purpose
of these methods are.

They are also made private to make it clear they should not be
used out of context.

addMobileDiff should only be called if InlineDifferenceEngine is
used as getWarningMessageText is not a method of DifferenceEngine

This is a follow up to
I68cf50f5dd339f34802d70df1f32d2c3390944a3

Bug: T167461
Change-Id: Ia59d76769960630859c9666acc5a28317e9272b7
---
M includes/specials/SpecialMobileDiff.php
1 file changed, 19 insertions(+), 16 deletions(-)

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



diff --git a/includes/specials/SpecialMobileDiff.php 
b/includes/specials/SpecialMobileDiff.php
index e2c9b80..54fa5b6 100644
--- a/includes/specials/SpecialMobileDiff.php
+++ b/includes/specials/SpecialMobileDiff.php
@@ -134,9 +134,7 @@
 
$output->addHtml( '' );
 
-   $this->setupDifferenceEngine();
-   $this->showHeader();
-   $this->showDiff();
+   $this->displayMobileDiff();
$output->addHtml( '' );
 
$this->showFooter( $ctx );
@@ -156,15 +154,16 @@
}
 
/**
-* Setups the DifferenceEngine.
+* Setups the mobile DifferenceEngine and displays a mobile optimised 
diff.
 */
-   protected function setupDifferenceEngine() {
+   protected function displayMobileDiff() {
+   $useMobileMode = false;
$contentHandler = $this->rev->getContentHandler();
-   $de = $contentHandler->createDifferenceEngine( 
$this->getContext(), $this->getPrevId(),
-   $this->revId );
-   // HACK:
-   if ( get_class( $de ) == 'DifferenceEngine' ) {
-   $de = new $this->diffClass(
+   $this->mDiffEngine = $contentHandler->createDifferenceEngine( 
$this->getContext(),
+   $this->getPrevId(), $this->revId );
+
+   if ( get_class( $this->mDiffEngine ) == 'DifferenceEngine' ) {
+   $this->mDiffEngine = new $this->diffClass(
$this->getContext(),
$this->getPrevId(),
$this->revId,
@@ -172,11 +171,15 @@
false,
(bool)$this->getRequest()->getVal( 'unhide' )
);
-   } else {
-   $de->showDiffPage();
-   return;
+   $useMobileMode = true;
}
-   $this->mDiffEngine = $de;
+
+   $this->showHeader();
+   if ( $useMobileMode ) {
+   $this->addMobileDiff();
+   } else {
+   $this->mDiffEngine->showDiffPage();
+   }
}
 
/**
@@ -186,7 +189,7 @@
 * Day and time of edit
 * Edit Comment
 */
-   function showHeader() {
+   private function showHeader() {
$title = $this->targetTitle;
 
if ( $this->prevRev ) {
@@ -259,7 +262,7 @@
 * Render the inline difference between two revisions
 * using InlineDiffEngine
 */
-   function showDiff() {
+   private function addMobileDiff() {
$output = $this->getOutput();
 
$prevId = $this->getPrevId();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia59d76769960630859c9666acc5a28317e9272b7
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson 
Gerrit-Reviewer: Pmiazga 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Enable WebP uploads for Thumbor role

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

Change subject: Enable WebP uploads for Thumbor role
..


Enable WebP uploads for Thumbor role

Bug: T167462
Change-Id: I67f55af39bd8e0a23269253a15cda79e6ddecc21
---
M puppet/modules/role/manifests/thumbor.pp
M puppet/modules/role/templates/thumbor/local_repo.php.erb
M puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
3 files changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/puppet/modules/role/manifests/thumbor.pp 
b/puppet/modules/role/manifests/thumbor.pp
index 6641714..2018992 100644
--- a/puppet/modules/role/manifests/thumbor.pp
+++ b/puppet/modules/role/manifests/thumbor.pp
@@ -59,6 +59,7 @@
 'pdf',
 'tiff',
 'tif',
+'webp',
 ],
 },
 }
diff --git a/puppet/modules/role/templates/thumbor/local_repo.php.erb 
b/puppet/modules/role/templates/thumbor/local_repo.php.erb
index fa72ed4..7dc45d4 100644
--- a/puppet/modules/role/templates/thumbor/local_repo.php.erb
+++ b/puppet/modules/role/templates/thumbor/local_repo.php.erb
@@ -21,6 +21,7 @@
 'djvu' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 'pdf' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 'tif' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
+'webp' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 ),
 ),
 ),
diff --git a/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb 
b/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
index acd2253..88ab086 100644
--- a/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
+++ b/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
@@ -52,7 +52,7 @@
 ('wikimedia_thumbor.engine.vips', ['tiff', 'png']),
 ('wikimedia_thumbor.engine.tiff', ['tiff']),
 ('wikimedia_thumbor.engine.ghostscript', ['pdf']),
-('wikimedia_thumbor.engine.imagemagick', ['jpg', 'png']),
+('wikimedia_thumbor.engine.imagemagick', ['jpg', 'png', 'webp']),
 ]
 
 PROXY_LOADER_LOADERS = [

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Enable WebP uploads for Thumbor role

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

Change subject: Enable WebP uploads for Thumbor role
..

Enable WebP uploads for Thumbor role

Bug: T167462
Change-Id: I67f55af39bd8e0a23269253a15cda79e6ddecc21
---
M puppet/modules/role/manifests/thumbor.pp
M puppet/modules/role/templates/thumbor/local_repo.php.erb
M puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
3 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/40/357940/1

diff --git a/puppet/modules/role/manifests/thumbor.pp 
b/puppet/modules/role/manifests/thumbor.pp
index 6641714..2018992 100644
--- a/puppet/modules/role/manifests/thumbor.pp
+++ b/puppet/modules/role/manifests/thumbor.pp
@@ -59,6 +59,7 @@
 'pdf',
 'tiff',
 'tif',
+'webp',
 ],
 },
 }
diff --git a/puppet/modules/role/templates/thumbor/local_repo.php.erb 
b/puppet/modules/role/templates/thumbor/local_repo.php.erb
index fa72ed4..7dc45d4 100644
--- a/puppet/modules/role/templates/thumbor/local_repo.php.erb
+++ b/puppet/modules/role/templates/thumbor/local_repo.php.erb
@@ -21,6 +21,7 @@
 'djvu' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 'pdf' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 'tif' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
+'webp' => 'http://127.0.0.1:6081' . $wgUploadPath . '/thumb',
 ),
 ),
 ),
diff --git a/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb 
b/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
index acd2253..88ab086 100644
--- a/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
+++ b/puppet/modules/thumbor/templates/20-thumbor-wikimedia.conf.erb
@@ -52,7 +52,7 @@
 ('wikimedia_thumbor.engine.vips', ['tiff', 'png']),
 ('wikimedia_thumbor.engine.tiff', ['tiff']),
 ('wikimedia_thumbor.engine.ghostscript', ['pdf']),
-('wikimedia_thumbor.engine.imagemagick', ['jpg', 'png']),
+('wikimedia_thumbor.engine.imagemagick', ['jpg', 'png', 'webp']),
 ]
 
 PROXY_LOADER_LOADERS = [

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Use Cassandra version that corresponds to what is being tested

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

Change subject: Use Cassandra version that corresponds to what is being tested
..


Use Cassandra version that corresponds to what is being tested

We are now testing 3.11.0 (not 3.7.3-instaclustr); This will allow us to
reenable Puppet and clear the warnings.

Bug: T160570
Change-Id: I2cc594d7a1a814c99c5212ee74f89ccaba2aa410
---
M hieradata/role/common/restbase/dev_cluster.yaml
M modules/cassandra/manifests/init.pp
M modules/cassandra/manifests/instance.pp
R modules/cassandra/templates/cassandra-env.sh-3.x.erb
R modules/cassandra/templates/cassandra.yaml-3.x.erb
R modules/cassandra/templates/jvm.options-3.x.erb
R modules/cassandra/templates/logback.xml-3.x.erb
7 files changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/hieradata/role/common/restbase/dev_cluster.yaml 
b/hieradata/role/common/restbase/dev_cluster.yaml
index fc07654..3cbda43 100644
--- a/hieradata/role/common/restbase/dev_cluster.yaml
+++ b/hieradata/role/common/restbase/dev_cluster.yaml
@@ -111,7 +111,7 @@
   cluster_name: "services-dev"
   application_username: restb
   application_password: "%{passwords::cassandra::restbase}"
-  target_version: '3.7'
+  target_version: '3.x'
   permissions_validity_in_ms: 60
   trickle_fsync: false
   extra_classpath:
diff --git a/modules/cassandra/manifests/init.pp 
b/modules/cassandra/manifests/init.pp
index 2c44428..1c40774 100644
--- a/modules/cassandra/manifests/init.pp
+++ b/modules/cassandra/manifests/init.pp
@@ -253,7 +253,7 @@
 #   Default: true
 #
 # [*target_version*]
-#   The Cassandra version to configure for.  Valid choices are '2.1', '2.2', 
and '3.7'.
+#   The Cassandra version to configure for.  Valid choices are '2.1', '2.2', 
and '3.x'.
 #   Default: 2.1
 
 class cassandra(
@@ -381,7 +381,7 @@
 fail('data_file_directories must not be empty')
 }
 
-if (!($target_version in ['2.1', '2.2', '3.7'])) {
+if (!($target_version in ['2.1', '2.2', '3.x'])) {
 fail("${target_version} is not a valid Cassandra target version!")
 }
 
@@ -415,7 +415,7 @@
 $package_version = $target_version ? {
 '2.1' => hiera('cassandra::version', '2.1.13'),
 '2.2' => hiera('cassandra::version', '2.2.6-wmf1'),
-'3.7' => hiera('cassandra::version', '3.7.3-instaclustr')
+'3.x' => hiera('cassandra::version', '3.11.0')
 }
 package { 'cassandra':
 ensure  => $package_version,
diff --git a/modules/cassandra/manifests/instance.pp 
b/modules/cassandra/manifests/instance.pp
index 2a76fea..78c94e6 100644
--- a/modules/cassandra/manifests/instance.pp
+++ b/modules/cassandra/manifests/instance.pp
@@ -237,7 +237,7 @@
 require => File['/etc/cassandra-instances.d'],
 }
 
-if ($target_version >= '3.7') {
+if ($target_version == '3.x') {
 file { "${config_directory}/jvm.options":
 ensure  => present,
 content => 
template("${module_name}/jvm.options-${target_version}.erb"),
diff --git a/modules/cassandra/templates/cassandra-env.sh-3.7.erb 
b/modules/cassandra/templates/cassandra-env.sh-3.x.erb
similarity index 100%
rename from modules/cassandra/templates/cassandra-env.sh-3.7.erb
rename to modules/cassandra/templates/cassandra-env.sh-3.x.erb
diff --git a/modules/cassandra/templates/cassandra.yaml-3.7.erb 
b/modules/cassandra/templates/cassandra.yaml-3.x.erb
similarity index 100%
rename from modules/cassandra/templates/cassandra.yaml-3.7.erb
rename to modules/cassandra/templates/cassandra.yaml-3.x.erb
diff --git a/modules/cassandra/templates/jvm.options-3.7.erb 
b/modules/cassandra/templates/jvm.options-3.x.erb
similarity index 100%
rename from modules/cassandra/templates/jvm.options-3.7.erb
rename to modules/cassandra/templates/jvm.options-3.x.erb
diff --git a/modules/cassandra/templates/logback.xml-3.7.erb 
b/modules/cassandra/templates/logback.xml-3.x.erb
similarity index 100%
rename from modules/cassandra/templates/logback.xml-3.7.erb
rename to modules/cassandra/templates/logback.xml-3.x.erb

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2cc594d7a1a814c99c5212ee74f89ccaba2aa410
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Eevans 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Eevans 
Gerrit-Reviewer: Elukey 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: jenkins-bot <>

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

[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Beta: Add section header to scap.cfg

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

Change subject: Beta: Add section header to scap.cfg
..


Beta: Add section header to scap.cfg

Change-Id: Iebdc50e0f3f827529f2aa716897e498b71306d05
---
M scap/environments/beta/scap.cfg
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/scap/environments/beta/scap.cfg b/scap/environments/beta/scap.cfg
index 59d122d..323d650 100644
--- a/scap/environments/beta/scap.cfg
+++ b/scap/environments/beta/scap.cfg
@@ -1,2 +1,3 @@
+[deployment-prep.eqiad.wmflabs]
 server_groups: default
 dsh_targets: betacluster

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iebdc50e0f3f827529f2aa716897e498b71306d05
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/change-propagation/deploy
Gerrit-Branch: master
Gerrit-Owner: Mobrovac 
Gerrit-Reviewer: Mobrovac 

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


[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Beta: Add section header to scap.cfg

2017-06-08 Thread Mobrovac (Code Review)
Mobrovac has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357939 )

Change subject: Beta: Add section header to scap.cfg
..

Beta: Add section header to scap.cfg

Change-Id: Iebdc50e0f3f827529f2aa716897e498b71306d05
---
M scap/environments/beta/scap.cfg
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/services/change-propagation/deploy 
refs/changes/39/357939/1

diff --git a/scap/environments/beta/scap.cfg b/scap/environments/beta/scap.cfg
index 59d122d..323d650 100644
--- a/scap/environments/beta/scap.cfg
+++ b/scap/environments/beta/scap.cfg
@@ -1,2 +1,3 @@
+[deployment-prep.eqiad.wmflabs]
 server_groups: default
 dsh_targets: betacluster

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iebdc50e0f3f827529f2aa716897e498b71306d05
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/change-propagation/deploy
Gerrit-Branch: master
Gerrit-Owner: Mobrovac 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Ensure mDiffEngine is available inside showDiff

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

Change subject: Ensure mDiffEngine is available inside showDiff
..

Ensure mDiffEngine is available inside showDiff

To be defensive against this in future a RuntimeException is now
thrown.

The methods have been renamed to make it clearer what the purpose
of these methods are.

addMobileDiff should only be called if InlineDifferenceEngine is
used as getWarningMessageText is not a method of DifferenceEngine

Bug: T167461
Change-Id: Ia59d76769960630859c9666acc5a28317e9272b7
---
M includes/specials/SpecialMobileDiff.php
1 file changed, 13 insertions(+), 8 deletions(-)


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

diff --git a/includes/specials/SpecialMobileDiff.php 
b/includes/specials/SpecialMobileDiff.php
index e2c9b80..8eb89af 100644
--- a/includes/specials/SpecialMobileDiff.php
+++ b/includes/specials/SpecialMobileDiff.php
@@ -134,9 +134,7 @@
 
$output->addHtml( '' );
 
-   $this->setupDifferenceEngine();
-   $this->showHeader();
-   $this->showDiff();
+   $this->displayMobileDiff();
$output->addHtml( '' );
 
$this->showFooter( $ctx );
@@ -156,12 +154,14 @@
}
 
/**
-* Setups the DifferenceEngine.
+* Setups the mobile DifferenceEngine and displays a mobile optimised 
diff.
 */
-   protected function setupDifferenceEngine() {
+   protected function displayMobileDiff() {
+   $this->showHeader();
$contentHandler = $this->rev->getContentHandler();
$de = $contentHandler->createDifferenceEngine( 
$this->getContext(), $this->getPrevId(),
$this->revId );
+
// HACK:
if ( get_class( $de ) == 'DifferenceEngine' ) {
$de = new $this->diffClass(
@@ -172,11 +172,11 @@
false,
(bool)$this->getRequest()->getVal( 'unhide' )
);
+   $this->mDiffEngine = $de;
+   $this->addMobileDiff();
} else {
$de->showDiffPage();
-   return;
}
-   $this->mDiffEngine = $de;
}
 
/**
@@ -259,12 +259,17 @@
 * Render the inline difference between two revisions
 * using InlineDiffEngine
 */
-   function showDiff() {
+   private function addMobileDiff() {
$output = $this->getOutput();
 
$prevId = $this->getPrevId();
$unhide = (bool)$this->getRequest()->getVal( 'unhide' );
$de = $this->mDiffEngine;
+   // This must always be available! (T167461)
+   if ( !$de ) {
+   throw new \RuntimeException(
+   "addMobileDiff was called on an incompatible 
diff engine." );
+   }
$diff = $de->getDiffBody();
if ( !$prevId ) {
$audience = $unhide ? Revision::FOR_THIS_USER : 
Revision::FOR_PUBLIC;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: T127421: Hoist redirect to the top of the wikitext

2017-06-08 Thread Arlolra (Code Review)
Arlolra has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357917 )

Change subject: T127421: Hoist redirect to the top of the wikitext
..

T127421: Hoist redirect to the top of the wikitext

Change-Id: I457490fdd69947c7a6319174618ef898f44ee4c7
---
M lib/html2wt/DOMHandlers.js
M lib/html2wt/LinkHandler.js
M lib/html2wt/SerializerState.js
M lib/html2wt/WTSUtils.js
M lib/html2wt/WikitextSerializer.js
M lib/utils/DOMUtils.js
M tests/parserTests.txt
7 files changed, 27 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/17/357917/1

diff --git a/lib/html2wt/DOMHandlers.js b/lib/html2wt/DOMHandlers.js
index 0916281..d2fa76b 100644
--- a/lib/html2wt/DOMHandlers.js
+++ b/lib/html2wt/DOMHandlers.js
@@ -1333,7 +1333,7 @@
// sol-transparent link nodes are the only 
thing on their line.
// But, don't force separators wrt to its 
parent (body, p, list, td, etc.)
if (otherNode !== node.parentNode &&
-   DU.isSolTransparentLink(node) &&
+   DU.isSolTransparentLink(node) && 
!DU.isRedirectLink(node) &&
!DU.isEncapsulationWrapper(node)) {
return { min: 1 };
} else {
@@ -1344,7 +1344,7 @@
// sol-transparent link nodes are the only 
thing on their line
// But, don't force separators wrt to its 
parent (body, p, list, td, etc.)
if (otherNode !== node.parentNode &&
-   DU.isSolTransparentLink(node) &&
+   DU.isSolTransparentLink(node) && 
!DU.isRedirectLink(node) &&
!DU.isEncapsulationWrapper(node)) {
return { min: 1 };
} else {
diff --git a/lib/html2wt/LinkHandler.js b/lib/html2wt/LinkHandler.js
index 3af2446..f4c3dd8 100644
--- a/lib/html2wt/LinkHandler.js
+++ b/lib/html2wt/LinkHandler.js
@@ -568,6 +568,13 @@
return;
}
 
+   if (linkData.isRedirect) {
+   if (state.redirectText === null) {  // Otherwise, we 
drop it
+   state.redirectText = linkData.prefix + '[[' + 
linkTarget + ']]\n';
+   }
+   return;
+   }
+
var pipedText;
if (escapedTgt && escapedTgt.invalidLink) {
// If the link target was invalid, instead of emitting 
an invalid link,
diff --git a/lib/html2wt/SerializerState.js b/lib/html2wt/SerializerState.js
index 9025066..eb93757 100644
--- a/lib/html2wt/SerializerState.js
+++ b/lib/html2wt/SerializerState.js
@@ -83,6 +83,9 @@
  *
  * singleLineContext
  *Stack used to enforce single-line context
+ *
+ * redirectText
+ *Text to be emitted at the start of file, for redirects
  * * */
 
 var initialState = {
@@ -98,6 +101,7 @@
hasSelfClosingNowikis: false,
hasQuoteNowikis: false,
hasHeadingEscapes: false,
+   redirectText: null,
wikiTableNesting: 0,
wteHandlerStack: [],
// XXX: replace with output buffering per line
diff --git a/lib/html2wt/WTSUtils.js b/lib/html2wt/WTSUtils.js
index 186c695..0b711fa 100644
--- a/lib/html2wt/WTSUtils.js
+++ b/lib/html2wt/WTSUtils.js
@@ -69,7 +69,9 @@
 WTSUtils.origSrcValidInEditedContext = function(env, node) {
var prev;
 
-   if (node.nodeName === 'TH' || node.nodeName === 'TD') {
+   if (DU.isRedirectLink(node)) {
+   return DU.isBody(node.parentNode) && !node.previousSibling;
+   } else if (node.nodeName === 'TH' || node.nodeName === 'TD') {
// The wikitext representation for them is dependent
// on cell position (first cell is always single char).
 
diff --git a/lib/html2wt/WikitextSerializer.js 
b/lib/html2wt/WikitextSerializer.js
index 0c3dd2f..7a6877e 100644
--- a/lib/html2wt/WikitextSerializer.js
+++ b/lib/html2wt/WikitextSerializer.js
@@ -1359,6 +1359,10 @@
}).join('\n');
}
 
+   if (state.redirectText !== null) {
+   state.out = state.redirectText + state.out;
+   }
+
return state.out;
}.bind(this));
 });
diff --git a/lib/utils/DOMUtils.js b/lib/utils/DOMUtils.js
index d2d..47bfa5d 100644
--- a/lib/utils/DOMUtils.js
+++ b/lib/utils/DOMUtils.js
@@ -905,6 +905,10 @@
}
},
 
+   isRedirectLink: function(node) {
+   return 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Bug: T166621 : HTMLSelectOrOtherField - no toggle with defau...

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

Change subject: Bug: T166621 : HTMLSelectOrOtherField - no toggle with default 
option - https://phabricator.wikimedia.org/T166621
..

Bug: T166621 : HTMLSelectOrOtherField - no toggle with default option - 
https://phabricator.wikimedia.org/T166621

Change-Id: I3921651585dd8b382afc99eca18a927eba1ebe47
---
M resources/src/mediawiki/htmlform/selectorother.js
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/resources/src/mediawiki/htmlform/selectorother.js 
b/resources/src/mediawiki/htmlform/selectorother.js
index 66879e9..f3afc17 100644
--- a/resources/src/mediawiki/htmlform/selectorother.js
+++ b/resources/src/mediawiki/htmlform/selectorother.js
@@ -51,9 +51,9 @@
}
}
 
-   $root
-   .on( 'change', '.mw-htmlform-select-or-other', 
handleSelectOrOther )
+   $root.find('.mw-htmlform-select-or-other')
.each( function () {
+   $( this ).on( 'change', handleSelectOrOther );
handleSelectOrOther.call( this, true );
} );
} );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: FIX T166483 : Allow CategoryPageView to set $mCategoryViewer...

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

Change subject: FIX T166483 : Allow CategoryPageView to set 
$mCategoryViewerClass
..

FIX T166483 : Allow CategoryPageView to set $mCategoryViewerClass

Change-Id: I9937148dd8114e7167d6a581e64bfed5fdcc568e
---
M includes/page/CategoryPage.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/99/357899/1

diff --git a/includes/page/CategoryPage.php b/includes/page/CategoryPage.php
index ccc50f7..7dea271 100644
--- a/includes/page/CategoryPage.php
+++ b/includes/page/CategoryPage.php
@@ -27,7 +27,7 @@
  */
 class CategoryPage extends Article {
# Subclasses can change this to override the viewer class.
-   protected $mCategoryViewerClass = 'CategoryViewer';
+   public $mCategoryViewerClass = 'CategoryViewer';
 
/**
 * @var WikiCategoryPage

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Remove X-Content-Dimensions header

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

Change subject:  Remove X-Content-Dimensions header
..

Remove X-Content-Dimensions header

Bug: T150741
Bug: T167034
Change-Id: I74951eee68862f64eb4fdec95fab06d317fe96a9
---
M handlers/OggHandler/OggHandler.php
1 file changed, 2 insertions(+), 13 deletions(-)


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

diff --git a/handlers/OggHandler/OggHandler.php 
b/handlers/OggHandler/OggHandler.php
index 2ec88f5..1485a59 100644
--- a/handlers/OggHandler/OggHandler.php
+++ b/handlers/OggHandler/OggHandler.php
@@ -261,12 +261,10 @@
/**
* Get useful response headers for GET/HEAD requests for a file with the 
given metadata
* @param $metadata Array Contains this handler's unserialized 
getMetadata() for a file
-   * @param $fallbackWidth int|null Width to fall back to if metadata 
doesn't have any
-   * @param $fallbackHeight int|null Height to fall back to if metadata 
doesn't have any
* @return Array
* @since 1.30
*/
-   public function getContentHeaders( $metadata, $fallbackWidth = null, 
$fallbackHeight = null ) {
+   public function getContentHeaders( $metadata ) {
$packedMetadata = $metadata;
$result = [];
$metadata = $this->unpackMetadata( $metadata, false );
@@ -275,16 +273,7 @@
$result = [ 'X-Content-Duration' => floatval( 
$metadata[ 'length' ] ) ];
}
 
-   $dimensions = $this->getImageSize( null, null, $packedMetadata 
);
-
-   if ( !$dimensions || is_null( $fallbackWidth ) || is_null( 
$fallbackHeight ) ) {
-   $dimensionsHeaders = [];
-   } else {
-   $dimensionsMetadata = [ 'width' => $fallbackWidth, 
'height' => $fallbackHeight ];
-   $dimensionsHeaders = parent::getContentHeaders( 
$dimensionsMetadata );
-   }
-
-   return array_merge( $result, $dimensionsHeaders );
+   return $result;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74951eee68862f64eb4fdec95fab06d317fe96a9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: Gilles 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: Rename GetDescriptionsClient -> DescriptionClient

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

Change subject: Hygiene: Rename GetDescriptionsClient -> DescriptionClient
..


Hygiene: Rename GetDescriptionsClient -> DescriptionClient

no functional changes intended

Change-Id: I4f1f218e5b695c1ee7ce046682f63ca42738bb01
---
M app/src/main/java/org/wikipedia/page/DisambigListAdapter.java
R app/src/main/java/org/wikipedia/wikidata/DescriptionClient.java
R app/src/test/java/org/wikipedia/wikidata/DescriptionClientTest.java
3 files changed, 12 insertions(+), 12 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/page/DisambigListAdapter.java 
b/app/src/main/java/org/wikipedia/page/DisambigListAdapter.java
index 8b85605..f1b10d0 100644
--- a/app/src/main/java/org/wikipedia/page/DisambigListAdapter.java
+++ b/app/src/main/java/org/wikipedia/page/DisambigListAdapter.java
@@ -21,7 +21,7 @@
 import org.wikipedia.pageimages.PageImagesClient;
 import org.wikipedia.views.GoneIfEmptyTextView;
 import org.wikipedia.views.ViewUtil;
-import org.wikipedia.wikidata.GetDescriptionsClient;
+import org.wikipedia.wikidata.DescriptionClient;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -89,7 +89,7 @@
 return;
 }
 
-new GetDescriptionsClient().request(wiki, titleList, new 
GetDescriptionsClient.Callback() {
+new DescriptionClient().request(wiki, titleList, new 
DescriptionClient.Callback() {
 @Override public void success(@NonNull 
Call call,
   @NonNull List results) {
 for (MwQueryPage page : results) {
diff --git 
a/app/src/main/java/org/wikipedia/wikidata/GetDescriptionsClient.java 
b/app/src/main/java/org/wikipedia/wikidata/DescriptionClient.java
similarity index 98%
rename from app/src/main/java/org/wikipedia/wikidata/GetDescriptionsClient.java
rename to app/src/main/java/org/wikipedia/wikidata/DescriptionClient.java
index 7927f08..433fe49 100644
--- a/app/src/main/java/org/wikipedia/wikidata/GetDescriptionsClient.java
+++ b/app/src/main/java/org/wikipedia/wikidata/DescriptionClient.java
@@ -19,7 +19,7 @@
 import retrofit2.http.GET;
 import retrofit2.http.Query;
 
-public class GetDescriptionsClient {
+public class DescriptionClient {
 @NonNull private MwCachedService cachedService = new 
MwCachedService<>(Service.class);
 
 public interface Callback {
diff --git 
a/app/src/test/java/org/wikipedia/wikidata/GetDescriptionClientTest.java 
b/app/src/test/java/org/wikipedia/wikidata/DescriptionClientTest.java
similarity index 82%
rename from 
app/src/test/java/org/wikipedia/wikidata/GetDescriptionClientTest.java
rename to app/src/test/java/org/wikipedia/wikidata/DescriptionClientTest.java
index c181167..d14ffbe 100644
--- a/app/src/test/java/org/wikipedia/wikidata/GetDescriptionClientTest.java
+++ b/app/src/test/java/org/wikipedia/wikidata/DescriptionClientTest.java
@@ -28,17 +28,17 @@
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
 
-public class GetDescriptionClientTest extends MockWebServerTest {
+public class DescriptionClientTest extends MockWebServerTest {
 private static final WikiSite WIKISITE_TEST = 
WikiSite.forLanguageCode("test");
 private static final PageTitle PAGE_TITLE_BIDEN = new PageTitle("Joe 
Biden", WIKISITE_TEST);
 private static final PageTitle PAGE_TITLE_OBAMA = new PageTitle("Barack 
Obama", WIKISITE_TEST);
 
-@NonNull private final GetDescriptionsClient subject = new 
GetDescriptionsClient();
+@NonNull private final DescriptionClient subject = new DescriptionClient();
 
 @Test public void testRequestSuccess() throws Throwable {
 enqueueFromFile("reading_list_page_info.json");
 
-GetDescriptionsClient.Callback cb = 
mock(GetDescriptionsClient.Callback.class);
+DescriptionClient.Callback cb = mock(DescriptionClient.Callback.class);
 Call call = request(cb);
 
 server().takeRequest();
@@ -60,7 +60,7 @@
 @Test public void testRequestResponseApiError() throws Throwable {
 enqueueFromFile("api_error.json");
 
-GetDescriptionsClient.Callback cb = 
mock(GetDescriptionsClient.Callback.class);
+DescriptionClient.Callback cb = mock(DescriptionClient.Callback.class);
 Call call = request(cb);
 
 server().takeRequest();
@@ -70,7 +70,7 @@
 @Test public void testRequestResponseFailure() throws Throwable {
 enqueue404();
 
-GetDescriptionsClient.Callback cb = 
mock(GetDescriptionsClient.Callback.class);
+DescriptionClient.Callback cb = mock(DescriptionClient.Callback.class);
 Call call = request(cb);
 
 server().takeRequest();
@@ -80,7 +80,7 @@
 @Test public void 

[MediaWiki-commits] [Gerrit] mediawiki...PagedTiffHandler[master]: Remove X-Content-Dimensions header

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

Change subject:  Remove X-Content-Dimensions header
..

Remove X-Content-Dimensions header

Bug: T150741
Bug: T167034
Change-Id: I1f4ee39d2328c89f77f4678c7bc9265fddc8dfe9
---
M PagedTiffHandler_body.php
1 file changed, 0 insertions(+), 29 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PagedTiffHandler 
refs/changes/97/357897/1

diff --git a/PagedTiffHandler_body.php b/PagedTiffHandler_body.php
index 287d77a..bcace82 100644
--- a/PagedTiffHandler_body.php
+++ b/PagedTiffHandler_body.php
@@ -842,33 +842,4 @@
$files[] = __DIR__ . '/tests/PagedTiffHandlerTest.php';
return true;
}
-
-/**
-   * Get useful response headers for GET/HEAD requests for a file with the 
given metadata
-   * @param $metadata Array Contains this handler's unserialized 
getMetadata() for a file
-   * @param $fallbackWidth int|null Width to fall back to if metadata 
doesn't have any
-   * @param $fallbackHeight int|null Height to fall back to if metadata 
doesn't have any
-   * @return Array
-   * @since 1.30
-   */
-   public function getContentHeaders( $metadata, $fallbackWidth = null, 
$fallbackHeight = null ) {
-   $pagesByDimensions = [];
-   $count = intval( $metadata['page_count'] );
-
-   for ( $i = 1; $i <= $count; $i++ ) {
-   $dimensions = PagedTiffImage::getPageSize( $metadata, 
$i );
-
-   $dimensionString = $dimensions['width'] . 'x' . 
$dimensions['height'];
-
-   if ( isset ( $pagesByDimensions[ $dimensionString ] ) ) 
{
-   $pagesByDimensions[ $dimensionString ][] = $i;
-   } else {
-   $pagesByDimensions[ $dimensionString ] = [ $i ];
-   }
-   }
-
-   $pageRangesByDimensions = 
MediaHandler::getPageRangesByDimensions( $pagesByDimensions );
-
-   return [ 'X-Content-Dimensions' => $pageRangesByDimensions ];
-   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f4ee39d2328c89f77f4678c7bc9265fddc8dfe9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PagedTiffHandler
Gerrit-Branch: master
Gerrit-Owner: Gilles 

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


[MediaWiki-commits] [Gerrit] mediawiki...PdfHandler[master]: Remove X-Content-Dimensions header

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

Change subject:  Remove X-Content-Dimensions header
..

Remove X-Content-Dimensions header

Bug: T150741
Bug: T167034
Change-Id: Idaed687ddd09ac50748d6f80cdbb63c11078fb22
---
M PdfHandler_body.php
1 file changed, 0 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PdfHandler 
refs/changes/96/357896/1

diff --git a/PdfHandler_body.php b/PdfHandler_body.php
index 9ab5f09..c31aa2e 100644
--- a/PdfHandler_body.php
+++ b/PdfHandler_body.php
@@ -437,31 +437,4 @@
'messages' => array_values( self::$messages ),
] );
}
-
-   /**
-   * Get useful response headers for GET/HEAD requests for a file with the 
given metadata
-   * @param $metadata Array Contains this handler's unserialized 
getMetadata() for a file
-   * @param $fallbackWidth int|null Width to fall back to if metadata 
doesn't have any
-   * @param $fallbackHeight int|null Height to fall back to if metadata 
doesn't have any
-   * @return Array
-   * @since 1.30
-   */
-   public function getContentHeaders( $metadata, $fallbackWidth = null, 
$fallbackHeight = null ) {
-   $pagesByDimensions = [];
-   $count = intval( $metadata['Pages'] );
-   for ( $i = 1; $i <= $count; $i++ ) {
-   $dimensions = PdfImage::getPageSize( $metadata, $i );
-   $dimensionString = $dimensions['width'] . 'x' . 
$dimensions['height'];
-
-   if ( isset ( $pagesByDimensions[ $dimensionString ] ) ) 
{
-   $pagesByDimensions[ $dimensionString ][] = $i;
-   } else {
-   $pagesByDimensions[ $dimensionString ] = [ $i ];
-   }
-   }
-
-   $pageRangesByDimensions = 
MediaHandler::getPageRangesByDimensions( $pagesByDimensions );
-
-   return [ 'X-Content-Dimensions' => $pageRangesByDimensions ];
-   }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idaed687ddd09ac50748d6f80cdbb63c11078fb22
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PdfHandler
Gerrit-Branch: master
Gerrit-Owner: Gilles 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove X-Content-Dimensions header

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

Change subject: Remove X-Content-Dimensions header
..

Remove X-Content-Dimensions header

Bug: T150741
Bug: T167034
Change-Id: I39cfcf2cb231b6dfef569968fba6f473da258916
---
M RELEASE-NOTES-1.30
M includes/filerepo/file/File.php
M includes/filerepo/file/LocalFile.php
M includes/libs/filebackend/FileBackendStore.php
M includes/media/DjVu.php
M includes/media/MediaHandler.php
M maintenance/importImages.php
M tests/phpunit/includes/media/MediaHandlerTest.php
D tests/phpunit/includes/media/XContentDimensionsTest.php
9 files changed, 6 insertions(+), 128 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/95/357895/1

diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30
index 343c296..7595d23 100644
--- a/RELEASE-NOTES-1.30
+++ b/RELEASE-NOTES-1.30
@@ -34,9 +34,6 @@
   ParserOptions::setWrapOutputClass().
 * Added 'ChangeTagsAllowedAdd' hook, enabling extensions to allow software-
   specific tags to be added by users.
-* File storage backends that supports headers (eg. Swift) now store an
-  X-Content-Dimensions header for originals that contain the media's dimensions
-  as page ranges keyed by dimensions.
 * Added a 'ParserOptionsRegister' hook to allow extensions to register
   additional parser options.
 
diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php
index 53211fe..9aa2b18 100644
--- a/includes/filerepo/file/File.php
+++ b/includes/filerepo/file/File.php
@@ -2173,7 +2173,7 @@
$metadata = [];
}
 
-   return $handler->getContentHeaders( $metadata, 
$this->getWidth(), $this->getHeight() );
+   return $handler->getContentHeaders( $metadata );
}
 
return [];
diff --git a/includes/filerepo/file/LocalFile.php 
b/includes/filerepo/file/LocalFile.php
index a90156f..8d715e8 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -1206,9 +1206,7 @@
$metadata = [];
}
 
-   $options['headers'] = $handler->getContentHeaders(
-   $metadata, $props['width'], $props['height']
-   );
+   $options['headers'] = $handler->getContentHeaders( 
$metadata );
} else {
$options['headers'] = [];
}
diff --git a/includes/libs/filebackend/FileBackendStore.php 
b/includes/libs/filebackend/FileBackendStore.php
index e2f7886..039bd42 100644
--- a/includes/libs/filebackend/FileBackendStore.php
+++ b/includes/libs/filebackend/FileBackendStore.php
@@ -1250,7 +1250,7 @@
 * @return array
 */
protected function sanitizeOpHeaders( array $op ) {
-   static $longs = [ 'content-disposition', 'x-content-dimensions' 
];
+   static $longs = [ 'content-disposition' ];
 
if ( isset( $op['headers'] ) ) { // op sets HTTP headers
$newHeaders = [];
diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php
index f260850a..aae66d3 100644
--- a/includes/media/DjVu.php
+++ b/includes/media/DjVu.php
@@ -461,43 +461,4 @@
return false;
}
}
-
-   /**
-   * Get useful response headers for GET/HEAD requests for a file with the 
given metadata
-   * @param $metadata Array Contains this handler's unserialized 
getMetadata() for a file
-   * @param $fallbackWidth int|null Width to fall back to if metadata 
doesn't have any
-   * @param $fallbackHeight int|null Height to fall back to if metadata 
doesn't have any
-   * @return Array
-   * @since 1.30
-   */
-   public function getContentHeaders( $metadata, $fallbackWidth = null, 
$fallbackHeight = null ) {
-   if ( !isset( $metadata['xml'] ) ) {
-   return [];
-   }
-
-   $trees = $this->extractTreesFromMetadata( $metadata['xml'] );
-   $dimensionInfo = $this->getDimensionInfoFromMetaTree( 
$trees['MetaTree'] );
-
-   if ( !$dimensionInfo ) {
-   return [];
-   }
-
-   $pagesByDimensions = [];
-   $count = $dimensionInfo['pageCount'];
-
-   for ( $i = 1; $i <= $count; $i++ ) {
-   $dimensions = $dimensionInfo['dimensionsByPage'][ $i - 
1 ];
-   $dimensionString = $dimensions['width'] . 'x' . 
$dimensions['height'];
-
-   if ( isset ( $pagesByDimensions[ $dimensionString ] ) ) 
{
-   $pagesByDimensions[ $dimensionString ][] = $i;
-   } else {
-   $pagesByDimensions[ $dimensionString ] = [ 

  1   2   3   4   >