[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Fix PsySH permission issues

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

Change subject: Fix PsySH permission issues
..


Fix PsySH permission issues

PsySH is run via `mwscript shell.php`, so it will run under the
www-data user, while $HOME points to /home/vagrant, which causes
problems as PsySH tries to store the readline log in the home
directory. The patch changes directory permissions and ownership
to fix the problem.

Change-Id: I7de1cd0a4f2f16d6c7ba94e55c44556fb77e258e
---
M puppet/modules/mediawiki/manifests/init.pp
A puppet/modules/mediawiki/manifests/psysh.pp
2 files changed, 22 insertions(+), 0 deletions(-)

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



diff --git a/puppet/modules/mediawiki/manifests/init.pp 
b/puppet/modules/mediawiki/manifests/init.pp
index f51401f..c719c77 100644
--- a/puppet/modules/mediawiki/manifests/init.pp
+++ b/puppet/modules/mediawiki/manifests/init.pp
@@ -79,6 +79,7 @@
 include ::mediawiki::multiwiki
 include ::mediawiki::mwrepl
 include ::mediawiki::ready_service
+include ::mediawiki::psysh
 
 require_package('parallel')
 
diff --git a/puppet/modules/mediawiki/manifests/psysh.pp 
b/puppet/modules/mediawiki/manifests/psysh.pp
new file mode 100644
index 000..9996e3f
--- /dev/null
+++ b/puppet/modules/mediawiki/manifests/psysh.pp
@@ -0,0 +1,21 @@
+# == Class: mediawiki::psysh
+#
+# Configures the system so that PsySH (an interactive PHP shell,
+# included with MediaWiki) works well.
+#
+class mediawiki::psysh {
+# make sure PsySH can write the history file
+file { '/home/vagrant/.config':
+ensure => directory,
+mode   => 'a+rx',
+owner  => 'vagrant',
+group  => 'vagrant',
+}
+file { '/home/vagrant/.config/psysh':
+ensure => directory,
+mode   => 'a+rx',
+owner  => 'www-data',
+group  => 'www-data',
+}
+}
+

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7de1cd0a4f2f16d6c7ba94e55c44556fb77e258e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: Dduvall 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Mattflaschen 
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]: Revert "Revert "Releases: Proxy jenkins to main apache insta...

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

Change subject: Revert "Revert "Releases: Proxy jenkins to main apache 
instance""
..


Revert "Revert "Releases: Proxy jenkins to main apache instance""

Should be possible now after I6a380219325313e9.

This reverts commit dac450ae46b6656e3639354c85ebb640f315acec.

Change-Id: I8713d72e6d27c17f55e84f45c7d695d15c95f552
---
M modules/releases/templates/apache.conf.erb
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/modules/releases/templates/apache.conf.erb 
b/modules/releases/templates/apache.conf.erb
index ca4715f..664022d 100644
--- a/modules/releases/templates/apache.conf.erb
+++ b/modules/releases/templates/apache.conf.erb
@@ -22,6 +22,11 @@
 HeaderName ./releases-header-mw.html
 
 
+ProxyRequests Off
+ProxyVia Off
+ProxyPreserveHost On
+ProxyPass /ci/ http://127.0.0.1:8080/ci/ retry=0 nocanon
+
 ErrorLog /var/log/apache2/<%= @sitename %>.error.log
 
 LogLevel warn

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8713d72e6d27c17f55e84f45c7d695d15c95f552
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Revert "Revert "Releases: Proxy jenkins to main apache insta...

2017-08-25 Thread Dzahn (Code Review)
Hello Chad, jenkins-bot,

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

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

to review the following change.


Change subject: Revert "Revert "Releases: Proxy jenkins to main apache 
instance""
..

Revert "Revert "Releases: Proxy jenkins to main apache instance""

Should be possible now after I6a380219325313e9.

This reverts commit dac450ae46b6656e3639354c85ebb640f315acec.

Change-Id: I8713d72e6d27c17f55e84f45c7d695d15c95f552
---
M modules/releases/templates/apache.conf.erb
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/98/373998/1

diff --git a/modules/releases/templates/apache.conf.erb 
b/modules/releases/templates/apache.conf.erb
index ca4715f..664022d 100644
--- a/modules/releases/templates/apache.conf.erb
+++ b/modules/releases/templates/apache.conf.erb
@@ -22,6 +22,11 @@
 HeaderName ./releases-header-mw.html
 
 
+ProxyRequests Off
+ProxyVia Off
+ProxyPreserveHost On
+ProxyPass /ci/ http://127.0.0.1:8080/ci/ retry=0 nocanon
+
 ErrorLog /var/log/apache2/<%= @sitename %>.error.log
 
 LogLevel warn

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8713d72e6d27c17f55e84f45c7d695d15c95f552
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
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] operations/puppet[production]: releases: load Apache mod_proxy/mod_proxy_http

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

Change subject: releases: load Apache mod_proxy/mod_proxy_http
..


releases: load Apache mod_proxy/mod_proxy_http

mod_proxy/mod_proxy_http are required for proxy'ing
Jenkins in I17c4602adf4e410082d which failed without this.

Change-Id: I6a380219325313e9e5fb77917e2e907f2105dd69
---
M modules/releases/manifests/init.pp
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/modules/releases/manifests/init.pp 
b/modules/releases/manifests/init.pp
index ba804a3..973ebb2 100644
--- a/modules/releases/manifests/init.pp
+++ b/modules/releases/manifests/init.pp
@@ -48,6 +48,8 @@
 
 include ::apache::mod::rewrite
 include ::apache::mod::headers
+include ::apache::mod::proxy
+include ::apache::mod::proxy_http
 
 apache::site { $sitename:
 content => template('releases/apache.conf.erb'),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6a380219325313e9e5fb77917e2e907f2105dd69
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: releases: load Apache mod_proxy/mod_proxy_http

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

Change subject: releases: load Apache mod_proxy/mod_proxy_http
..

releases: load Apache mod_proxy/mod_proxy_http

mod_proxy/mod_proxy_http are required for proxy'ing
Jenkins in I17c4602adf4e410082d which failed without this.

Change-Id: I6a380219325313e9e5fb77917e2e907f2105dd69
---
M modules/releases/manifests/init.pp
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/97/373997/1

diff --git a/modules/releases/manifests/init.pp 
b/modules/releases/manifests/init.pp
index ba804a3..6158174 100644
--- a/modules/releases/manifests/init.pp
+++ b/modules/releases/manifests/init.pp
@@ -48,6 +48,7 @@
 
 include ::apache::mod::rewrite
 include ::apache::mod::headers
+include ::apache::mod::proxy
 
 apache::site { $sitename:
 content => template('releases/apache.conf.erb'),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a380219325313e9e5fb77917e2e907f2105dd69
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] operations/puppet[production]: Revert "Releases: Proxy jenkins to main apache instance"

2017-08-25 Thread Dzahn (Code Review)
Hello Chad, jenkins-bot,

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

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

to review the following change.


Change subject: Revert "Releases: Proxy jenkins to main apache instance"
..

Revert "Releases: Proxy jenkins to main apache instance"

This reverts commit 8463b8d89a1c7d1b753a745e18de06dadaf1801a.

Change-Id: I8d2eda6bea2688d12607508f868d6c4557654b0b
---
M modules/releases/templates/apache.conf.erb
1 file changed, 0 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/96/373996/1

diff --git a/modules/releases/templates/apache.conf.erb 
b/modules/releases/templates/apache.conf.erb
index 664022d..ca4715f 100644
--- a/modules/releases/templates/apache.conf.erb
+++ b/modules/releases/templates/apache.conf.erb
@@ -22,11 +22,6 @@
 HeaderName ./releases-header-mw.html
 
 
-ProxyRequests Off
-ProxyVia Off
-ProxyPreserveHost On
-ProxyPass /ci/ http://127.0.0.1:8080/ci/ retry=0 nocanon
-
 ErrorLog /var/log/apache2/<%= @sitename %>.error.log
 
 LogLevel warn

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d2eda6bea2688d12607508f868d6c4557654b0b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
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] operations/puppet[production]: Revert "Releases: Proxy jenkins to main apache instance"

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

Change subject: Revert "Releases: Proxy jenkins to main apache instance"
..


Revert "Releases: Proxy jenkins to main apache instance"

This reverts commit 8463b8d89a1c7d1b753a745e18de06dadaf1801a.

Change-Id: I8d2eda6bea2688d12607508f868d6c4557654b0b
---
M modules/releases/templates/apache.conf.erb
1 file changed, 0 insertions(+), 5 deletions(-)

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



diff --git a/modules/releases/templates/apache.conf.erb 
b/modules/releases/templates/apache.conf.erb
index 664022d..ca4715f 100644
--- a/modules/releases/templates/apache.conf.erb
+++ b/modules/releases/templates/apache.conf.erb
@@ -22,11 +22,6 @@
 HeaderName ./releases-header-mw.html
 
 
-ProxyRequests Off
-ProxyVia Off
-ProxyPreserveHost On
-ProxyPass /ci/ http://127.0.0.1:8080/ci/ retry=0 nocanon
-
 ErrorLog /var/log/apache2/<%= @sitename %>.error.log
 
 LogLevel warn

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8d2eda6bea2688d12607508f868d6c4557654b0b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Releases: Proxy jenkins to main apache instance

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

Change subject: Releases: Proxy jenkins to main apache instance
..


Releases: Proxy jenkins to main apache instance

Change-Id: I17c4602adf4e410082d210cd4838b57c2f614988
---
M modules/releases/templates/apache.conf.erb
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/modules/releases/templates/apache.conf.erb 
b/modules/releases/templates/apache.conf.erb
index ca4715f..664022d 100644
--- a/modules/releases/templates/apache.conf.erb
+++ b/modules/releases/templates/apache.conf.erb
@@ -22,6 +22,11 @@
 HeaderName ./releases-header-mw.html
 
 
+ProxyRequests Off
+ProxyVia Off
+ProxyPreserveHost On
+ProxyPass /ci/ http://127.0.0.1:8080/ci/ retry=0 nocanon
+
 ErrorLog /var/log/apache2/<%= @sitename %>.error.log
 
 LogLevel warn

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I17c4602adf4e410082d210cd4838b57c2f614988
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Chad 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: icinga/base: add sudo privileges for screen process check

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

Change subject: icinga/base: add sudo privileges for screen process check
..


icinga/base: add sudo privileges for screen process check

Bug: T165348
Change-Id: I04e4227225c89cbfb9591efe029d66fa001156ce
---
M modules/base/manifests/monitoring/host.pp
1 file changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/modules/base/manifests/monitoring/host.pp 
b/modules/base/manifests/monitoring/host.pp
index 81dbe30..a7bd6c5 100644
--- a/modules/base/manifests/monitoring/host.pp
+++ b/modules/base/manifests/monitoring/host.pp
@@ -158,9 +158,14 @@
 mode   => '0555',
 }
 
+::sudo::user { 'nagios_long_procs':
+user   => 'nagios',
+privileges => ['ALL = NOPASSWD: 
/usr/local/lib/nagios/plugins/check_long_procs'],
+}
+
 ::nrpe::monitor_service { 'check_long_procs':
 description  => 'Long running screen/tmux',
-nrpe_command => '/usr/local/lib/nagios/plugins/check_long_procs -w 
1 -c ',
+nrpe_command => '/usr/bin/sudo 
/usr/local/lib/nagios/plugins/check_long_procs -w 1 -c 3',
 }
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I04e4227225c89cbfb9591efe029d66fa001156ce
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Gehel 
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]: icinga/base: add sudo privileges for screen process check

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

Change subject: icinga/base: add sudo privileges for screen process check
..

icinga/base: add sudo privileges for screen process check

Bug: T165348
Change-Id: I04e4227225c89cbfb9591efe029d66fa001156ce
---
M modules/base/manifests/monitoring/host.pp
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/94/373994/1

diff --git a/modules/base/manifests/monitoring/host.pp 
b/modules/base/manifests/monitoring/host.pp
index 81dbe30..2993fde 100644
--- a/modules/base/manifests/monitoring/host.pp
+++ b/modules/base/manifests/monitoring/host.pp
@@ -158,9 +158,14 @@
 mode   => '0555',
 }
 
+::sudo::user { 'nagios_long_procs':
+user   => 'nagios',
+privileges => ['ALL = NOPASSWD: 
/usr/local/lib/nagios/plugins/check_long_procs'],
+}
+
 ::nrpe::monitor_service { 'check_long_procs':
 description  => 'Long running screen/tmux',
-nrpe_command => '/usr/local/lib/nagios/plugins/check_long_procs -w 
1 -c ',
+nrpe_command => '/usr/local/lib/nagios/plugins/check_long_procs -w 
1 -c 3',
 }
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I04e4227225c89cbfb9591efe029d66fa001156ce
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] operations/puppet[production]: icinga/base: add screen-monitoring, whitelist hosts

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

Change subject: icinga/base: add screen-monitoring, whitelist hosts
..


icinga/base: add screen-monitoring, whitelist hosts

Add monitoring for long-running screen/tmux processses.

But for now wrap it in a  Hiera override and just whitelist
a single host to confirm. Then enable on more hosts.

Move plugin from Icinga module into base module.

Bug: T165348
Change-Id: Ia39b3f7daeab49b07cb9501fa27e78ab8b6c264b
---
M hieradata/hosts/netmon2001.yaml
R modules/base/files/monitoring/check_long_procs
M modules/base/manifests/monitoring/host.pp
3 files changed, 17 insertions(+), 0 deletions(-)

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



diff --git a/hieradata/hosts/netmon2001.yaml b/hieradata/hosts/netmon2001.yaml
index 370806d..f9409f6 100644
--- a/hieradata/hosts/netmon2001.yaml
+++ b/hieradata/hosts/netmon2001.yaml
@@ -1 +1,2 @@
 do_acme: false
+monitor_screens: true
diff --git a/modules/icinga/files/check_long_procs 
b/modules/base/files/monitoring/check_long_procs
similarity index 100%
rename from modules/icinga/files/check_long_procs
rename to modules/base/files/monitoring/check_long_procs
diff --git a/modules/base/manifests/monitoring/host.pp 
b/modules/base/manifests/monitoring/host.pp
index da50f50..81dbe30 100644
--- a/modules/base/manifests/monitoring/host.pp
+++ b/modules/base/manifests/monitoring/host.pp
@@ -147,4 +147,20 @@
 nrpe_command => '/usr/local/lib/nagios/plugins/check_cpufreq 600',
 }
 }
+
+if hiera('monitor_screens', false) {
+
+file { '/usr/local/lib/nagios/plugins/check_long_procs':
+ensure => present,
+source => 'puppet:///modules/base/monitoring/check_long_procs',
+owner  => 'root',
+group  => 'root',
+mode   => '0555',
+}
+
+::nrpe::monitor_service { 'check_long_procs':
+description  => 'Long running screen/tmux',
+nrpe_command => '/usr/local/lib/nagios/plugins/check_long_procs -w 
1 -c ',
+}
+}
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia39b3f7daeab49b07cb9501fa27e78ab8b6c264b
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Gehel 
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]: icinga/base: add screen-monitoring, whitelist hosts

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

Change subject: icinga/base: add screen-monitoring, whitelist hosts
..

icinga/base: add screen-monitoring, whitelist hosts

Add monitoring for long-running screen/tmux processses.

But for now wrap it in a  Hiera override and just whitelist
a single host to confirm. Then enable on more hosts.

Move plugin from Icinga module into base module.

Bug: T165348
Change-Id: Ia39b3f7daeab49b07cb9501fa27e78ab8b6c264b
---
M hieradata/hosts/netmon2001.yaml
R modules/base/files/monitoring/check_long_procs
M modules/base/manifests/monitoring/host.pp
3 files changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/92/373992/1

diff --git a/hieradata/hosts/netmon2001.yaml b/hieradata/hosts/netmon2001.yaml
index 370806d..f9409f6 100644
--- a/hieradata/hosts/netmon2001.yaml
+++ b/hieradata/hosts/netmon2001.yaml
@@ -1 +1,2 @@
 do_acme: false
+monitor_screens: true
diff --git a/modules/icinga/files/check_long_procs 
b/modules/base/files/monitoring/check_long_procs
similarity index 100%
rename from modules/icinga/files/check_long_procs
rename to modules/base/files/monitoring/check_long_procs
diff --git a/modules/base/manifests/monitoring/host.pp 
b/modules/base/manifests/monitoring/host.pp
index da50f50..17cb193 100644
--- a/modules/base/manifests/monitoring/host.pp
+++ b/modules/base/manifests/monitoring/host.pp
@@ -147,4 +147,20 @@
 nrpe_command => '/usr/local/lib/nagios/plugins/check_cpufreq 600',
 }
 }
+
+if hiera('monitor_screens', true) {
+
+file { '/usr/local/lib/nagios/plugins/check_long_procs':
+ensure => present,
+source => 'puppet:///modules/base/monitoring/check_long_procs',
+owner  => 'root',
+group  => 'root',
+mode   => '0555',
+}
+
+::nrpe::monitor_service { 'check_long_procs':
+description  => 'Long running screen/tmux',
+nrpe_command => '/usr/local/lib/nagios/plugins/check_long_procs -w 
1 -c ',
+}
+}
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia39b3f7daeab49b07cb9501fa27e78ab8b6c264b
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] mediawiki/core[master]: RCFilters: Adjust highlight for seen/unseen states in Watchlist

2017-08-25 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373991 )

Change subject: RCFilters: Adjust highlight for seen/unseen states in Watchlist
..

RCFilters: Adjust highlight for seen/unseen states in Watchlist

Bug: T171235
Change-Id: I33d059d2be83e4730e6dc82f689f49a514286874
---
M includes/specials/SpecialWatchlist.php
M resources/Resources.php
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
A 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less
M 
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.less
M resources/src/mediawiki.rcfilters/styles/mw.rcfilters.variables.less
M 
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.ChangesListWrapperWidget.js
7 files changed, 90 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/91/373991/1

diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index cecc182..412a195 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -96,7 +96,10 @@
 
parent::execute( $subpage );
 
+
if ( $this->isStructuredFilterUiEnabled() ) {
+   $output->addModuleStyles( [ 
'mediawiki.rcfilters.highlightCircles.seenunseen.styles' ] );
+
$output->addJsConfigVars( 
'wgStructuredChangeFiltersLiveUpdateSupported', false );
$output->addJsConfigVars(

'wgStructuredChangeFiltersSavedQueriesPreferenceName',
diff --git a/resources/Resources.php b/resources/Resources.php
index 4a7f3e4..7b0a75e 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1748,6 +1748,11 @@

'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less',
],
],
+   'mediawiki.rcfilters.highlightCircles.seenunseen.styles' => [
+   'styles' => [
+   
'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less',
+   ],
+   ],
'mediawiki.rcfilters.filters.dm' => [
'scripts' => [
'resources/src/mediawiki.rcfilters/mw.rcfilters.js',
diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
index 5a885ec..27acd75 100644
--- a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
+++ b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.mixins.less
@@ -8,8 +8,7 @@
 }
 
 // This is a general mixin for a color circle
-.mw-rcfilters-mixin-circle( @color: #fff, @diameter: 2em, @padding: 0.5em, 
@border: false ) {
-   background-color: @color;
+.mw-rcfilters-mixin-circle( @color: #fff, @diameter: 2em, @padding: 0.5em, 
@border: false, @borderColor: #54595d, @emptyBackground: false ) {
.box-sizing( border-box );
min-width: @diameter;
width: @diameter;
@@ -18,8 +17,15 @@
margin: @padding;
border-radius: 50%;
 
+   & when ( @emptyBackground = false ) {
+   background-color: @color;
+   }
+   & when ( @emptyBackground = true ) {
+   background-color: @highlight-none;
+   }
+
& when ( @border = true ) {
-   border: 1px solid #54595d;
+   border: 1px solid @borderColor;
}
 }
 
diff --git 
a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less
 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less
new file mode 100644
index 000..f4ca717
--- /dev/null
+++ 
b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.ChangesListWrapperWidget.highlightCircles.seenunseen.less
@@ -0,0 +1,66 @@
+@import 'mw.rcfilters.mixins';
+
+.mw-rcfilters-ui-changesListWrapperWidget {
+   ul {
+   list-style: none;
+
+   li {
+   list-style: none;
+   }
+   }
+
+   // Make more specific for the overrides
+   div&-highlights {
+   display: inline-block;
+
+   &-color {
+   &-none {
+   display: inline-block;
+   li.mw-changeslist-watchedseen & {
+   
.mw-rcfilters-ui-changesListWrapperWidget.mw-rcfilters-ui-changesListWrapperWidget-highlighted
 & {
+   .mw-rcfilters-mixin-circle( 
@highlight-none, @result-circle-diameter, 0, true, @highlight-grey, true );
+   }
+
+   

[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Added documentation for sql parameter in replace.py script

2017-08-25 Thread Zoranzoki21 (Code Review)
Zoranzoki21 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373990 )

Change subject: Added documentation for sql parameter in replace.py script
..

Added documentation for sql parameter in replace.py script

Bug: T124869
Change-Id: I15d6fc39554adde25570379e7f5baf2d6969d23f
---
M scripts/replace.py
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/90/373990/2

diff --git a/scripts/replace.py b/scripts/replace.py
index c1e7bcb..c9ee98c 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -12,6 +12,9 @@
 
 Furthermore, the following command line parameters are supported:
 
+-sql  Retrieve information from a local SQL dump downloaded from
+  https://dumps.wikimedia.org
+  
 -xml  Retrieve information from a local XML dump (pages-articles
   or pages-meta-current, see https://download.wikimedia.org).
   Argument can also be given as "-xml:filename".

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I15d6fc39554adde25570379e7f5baf2d6969d23f
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Zoranzoki21 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: icinga: enhance check for screen sessions, also detect tmux

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

Change subject: icinga: enhance check for screen sessions, also detect tmux
..


icinga: enhance check for screen sessions, also detect tmux

Enhance the plugin script to not just detect SCREEN but also
tmux sessions. Use a more generic function to check processes
to make it easy to add others when needed.

Consider different types of OK (none running vs running but
not longer than crit/warn time thresholds).

Bug: T165348
Change-Id: I44ae0a6fedab4075353c73319eb5f4a4fc1f8d76
---
A modules/icinga/files/check_long_procs
D modules/icinga/files/check_long_screens
2 files changed, 143 insertions(+), 64 deletions(-)

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



diff --git a/modules/icinga/files/check_long_procs 
b/modules/icinga/files/check_long_procs
new file mode 100755
index 000..20fe11b
--- /dev/null
+++ b/modules/icinga/files/check_long_procs
@@ -0,0 +1,143 @@
+#!/bin/bash
+# icinga/nagios plugin to detect long-running (screen and tmux) processes
+#
+# https://phabricator.wikimedia.org/T165348
+#
+# Daniel Zahn () - Wikimedia Foundation Inc.
+#
+set -eu
+debug=false
+
+# warn and crit time in hours ./check_long_procs -w  -c 
+usage() { echo "Usage: $0 -w  -c " 1>&2; exit 1; }
+declare -i warn_hours=0
+declare -i crit_hours=0
+
+while getopts "w:c:" o; do
+case "${o}" in
+w)
+   warn_hours=${OPTARG}
+   ;;
+c)
+   crit_hours=${OPTARG}
+   ;;
+*)
+   usage
+   ;;
+esac
+done
+
+if [ $warn_hours == 0 ] || [ $crit_hours == 0 ]; then
+usage
+fi
+
+if [ $crit_hours -le $warn_hours ]; then
+echo "Error. The value for CRIT must be higher than the value for WARN."
+exit 1
+fi
+
+let "warn_seconds = $warn_hours*3600"
+let "crit_seconds = $crit_hours*3600"
+
+# generic function to check for long running processes
+# checkprocess 
+# example: checkprocess SCREEN
+# possible results:
+# 0 = no process (pattern) found (OK)
+# 1 = process found and running longer than warn_seconds, but not longer than 
crit_seconds (WARN)
+# 2 = process found and running longer than crit_seconds (CRIT)
+# 4 = process found but not running longer than warn_seconds (OK)
+function checkprocess {
+
+pattern=$1
+check_pid=""
+run_time=0
+declare -A result
+
+if /usr/bin/pgrep -fc $pattern > /dev/null; then
+for check_pid in $(/usr/bin/pgrep -f ${pattern}) ; do
+run_time=$(/bin/ps -o etimes= -p ${check_pid} | /usr/bin/xargs)
+if [ $run_time -gt $warn_seconds ]; then
+result[$pattern]=1
+fi
+if [ $run_time -gt $crit_seconds ]; then
+result[$pattern]=2
+fi
+if [ $run_time -le $warn_seconds ] && [ $run_time -le 
$crit_seconds ] ; then
+result[$pattern]=4
+fi
+done
+else
+result[$pattern]=0
+fi
+
+echo "${result["${pattern}"]},${check_pid},${run_time}"
+
+}
+
+# main
+result_screen=$(checkprocess SCREEN)
+result_tmux=$(checkprocess tmux)
+
+if [ "$debug" = true ]; then
+echo "result_screen: ${result_screen} (result,PID,runtime)"
+echo "result_tmux: $result_tmux (result,PID,runtime)"
+fi
+
+return_code_screen=$(echo $result_screen | cut -d, -f1)
+pid_screen=$(echo $result_screen | cut -d, -f2)
+run_time_screen=$(echo $result_screen | cut -d, -f3)
+
+return_code_tmux=$(echo $result_tmux | cut -d, -f1)
+pid_tmux=$(echo $result_tmux | cut -d, -f2)
+run_time_tmux=$(echo $result_tmux | cut -d, -f3)
+
+if [ $return_code_screen -eq 2 ]; then
+echo "CRIT: Long running SCREEN process. (PID: ${pid_screen}, 
${run_time_screen}s > ${crit_seconds}s)."
+exit 2
+fi
+
+if [ $return_code_tmux -eq 2 ]; then
+echo "CRIT: Long running tmux process. (PID: ${pid_tmux}, 
${run_time_tmux}s > ${crit_seconds}s)."
+exit 2
+fi
+
+if [ $return_code_screen -eq 1 ]; then
+echo "WARN: Long running SCREEN process. (PID: ${pid_screen}, 
${run_time_screen}s > ${warn_seconds}s)."
+exit 1
+fi
+
+if [ $return_code_tmux -eq 1 ]; then
+echo "WARN: Long running tmux process. (PID: ${pid_tmux}, 
${run_time_tmux}s > ${warn_seconds}s)."
+exit 1
+fi
+
+return_code_global="${return_code_screen}${return_code_tmux}"
+
+if [ "$debug" = true ]; then
+echo "return_code_global: $return_code_global"
+echo "warn_seconds: ${warn_seconds}"
+echo "crit_seconds: ${crit_seconds}"
+fi
+
+case "$return_code_global" in
+00)
+echo "OK: No SCREEN or tmux processes detected."
+exit 0
+;;
+04) echo "OK: Tmux detected but not long running."
+exit 0
+;;
+40) echo "OK: SCREEN detected but not long running."
+exit 0
+;;
+44) echo "OK: SCREEN and tmux detected but not long running."
+exit 0
+;;
+ *) echo "UNKNOWN: This should not happen. check 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix RestbaseVirtualRESTService URL standardization

2017-08-25 Thread Code Review
Gergő Tisza has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373989 )

Change subject: Fix RestbaseVirtualRESTService URL standardization
..

Fix RestbaseVirtualRESTService URL standardization

The regex /?$ will add a second slash to URLs which already end
in a slash (since it will match both the trailing slash and the
empty position after it), which is enough to trip up HyperSwitch.

Change-Id: I675f8252a2496ace4d6c364a869776dff604df59
---
M includes/libs/virtualrest/RestbaseVirtualRESTService.php
1 file changed, 3 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/373989/1

diff --git a/includes/libs/virtualrest/RestbaseVirtualRESTService.php 
b/includes/libs/virtualrest/RestbaseVirtualRESTService.php
index 35c45de..90865ff 100644
--- a/includes/libs/virtualrest/RestbaseVirtualRESTService.php
+++ b/includes/libs/virtualrest/RestbaseVirtualRESTService.php
@@ -61,11 +61,9 @@
'fixedUrl' => false,
], $params );
// Ensure that the url parameter has a trailing slash.
-   $mparams['url'] = preg_replace(
-   '#/?$#',
-   '/',
-   $mparams['url']
-   );
+   if ( substr( $mparams['url'], -1 ) !== '/' ) {
+   $mparams['url'] .= '/';
+   }
// Ensure the correct domain format: strip protocol, port,
// and trailing slash if present.  This lets us use
// $wgCanonicalServer as a default value, which is very 
convenient.

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

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

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: [DEPRECATING CHANGE] icons: Move 'signature' to 'editing-core'

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

Change subject: [DEPRECATING CHANGE] icons: Move 'signature' to 'editing-core'
..

[DEPRECATING CHANGE] icons: Move 'signature' to 'editing-core'

The 'signature' icon is moved from the
'alerts' icon pack to 'editing-core'.

Bug: T145163
Change-Id: I79ec4a853c9e18dae848d69f90b3aef32bbd2343
---
M demos/pages/icons.js
M src/themes/apex/icons-alerts.json
M src/themes/apex/icons-editing-core.json
M src/themes/wikimediaui/icons-alerts.json
M src/themes/wikimediaui/icons-editing-core.json
5 files changed, 14 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/88/373988/1

diff --git a/demos/pages/icons.js b/demos/pages/icons.js
index ae462c8..7c88bdd 100644
--- a/demos/pages/icons.js
+++ b/demos/pages/icons.js
@@ -41,7 +41,6 @@
'comment',
'message',
'notice',
-   'signature',
'speechBubble',
'speechBubbleAdd',
'speechBubbles',
@@ -97,7 +96,8 @@
'linkExternal',
'linkSecure',
'redo',
-   'undo'
+   'undo',
+   'signature'
],
'editing-styling': [
'bigger',
diff --git a/src/themes/apex/icons-alerts.json 
b/src/themes/apex/icons-alerts.json
index 099da22..312eed2 100644
--- a/src/themes/apex/icons-alerts.json
+++ b/src/themes/apex/icons-alerts.json
@@ -25,7 +25,8 @@
"signature": { "file": {
"ltr": "images/icons/signature-ltr.svg",
"rtl": "images/icons/signature-rtl.svg"
-   } },
+   },
+   "deprecated": "Replaced since v0.23.0, use 'signature' 
from the 'editing-core' pack instead." },
"speechBubble": { "file": {
"ltr": "images/icons/speechBubble-ltr.svg",
"rtl": "images/icons/speechBubble-rtl.svg"
diff --git a/src/themes/apex/icons-editing-core.json 
b/src/themes/apex/icons-editing-core.json
index b303071..ff6cd7b 100644
--- a/src/themes/apex/icons-editing-core.json
+++ b/src/themes/apex/icons-editing-core.json
@@ -27,6 +27,10 @@
"undo": { "file": {
"ltr": "images/icons/arched-arrow-rtl.svg",
"rtl": "images/icons/arched-arrow-ltr.svg"
+   } },
+   "signature": { "file": {
+   "ltr": "images/icons/signature-ltr.svg",
+   "rtl": "images/icons/signature-rtl.svg"
} }
}
 }
diff --git a/src/themes/wikimediaui/icons-alerts.json 
b/src/themes/wikimediaui/icons-alerts.json
index 4f7a427..62d8c3a 100644
--- a/src/themes/wikimediaui/icons-alerts.json
+++ b/src/themes/wikimediaui/icons-alerts.json
@@ -45,7 +45,8 @@
"signature": { "file": {
"ltr": "images/icons/signature-ltr.svg",
"rtl": "images/icons/signature-rtl.svg"
-   } },
+   },
+   "deprecated": "Replaced since v0.23.0, use 'signature' 
from the 'editing-core' pack instead." },
"speechBubble": { "file": {
"ltr": "images/icons/speechBubble-ltr.svg",
"rtl": "images/icons/speechBubble-rtl.svg"
diff --git a/src/themes/wikimediaui/icons-editing-core.json 
b/src/themes/wikimediaui/icons-editing-core.json
index 4515405..11c8e8d 100644
--- a/src/themes/wikimediaui/icons-editing-core.json
+++ b/src/themes/wikimediaui/icons-editing-core.json
@@ -50,6 +50,10 @@
"undo": { "file": {
"ltr": "images/icons/arched-arrow-rtl.svg",
"rtl": "images/icons/arched-arrow-ltr.svg"
+   } },
+   "signature": { "file": {
+   "ltr": "images/icons/signature-ltr.svg",
+   "rtl": "images/icons/signature-rtl.svg"
} }
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable jQuery 3 on nlwiki, svwiki, plwiki

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

Change subject: Enable jQuery 3 on nlwiki, svwiki, plwiki
..

Enable jQuery 3 on nlwiki, svwiki, plwiki

* svwiki: Confirmed by @Nirmox on T124742.
* plwiki: Confirmed by MatmaRex on IRC.
* nlwiki: (Myself).

Bug: T124742
Change-Id: I1c9c9c0ebf9d0bb2a1b5b7dec36016e3572c8344
---
M wmf-config/InitialiseSettings.php
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 8013276..6d29d0f 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -14935,6 +14935,11 @@
'test2wiki' => true,
'testwikidatawiki' => true,
'mediawikiwiki' => true,
+
+   // opt-in (T124742)
+   'nlwiki' => true, // @Krinkle
+   'plwiki' => true, // @MatmaRex
+   'svwiki' => true, // @Nirmos
 ],
 
 'wgCiteResponsiveReferences' => [

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix old regression in HTMLCacheUpdate de-duplication

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

Change subject: Fix old regression in HTMLCacheUpdate de-duplication
..


Fix old regression in HTMLCacheUpdate de-duplication

* The condition timestamp should be the root job timestamp,
  as the comments imply, though that was not the case. Only
  the SET timestamp should be the current timestamp. As it
  was, jobs effectively did not "see" each other since each
  one would be expecting newer than the ones that ran prior.
  The page_touched condition for the UPDATE query was mostly
  useless, since it was always the current timestamp.
* This problem was a regression from f598ca81e3f40166.

Change-Id: I1398366e87c959be1c98e4db959c41309b0ac1b8
---
M includes/jobqueue/jobs/HTMLCacheUpdateJob.php
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php 
b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
index 9d0f87c..4c16d7f 100644
--- a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
+++ b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
@@ -113,6 +113,10 @@
// before the link jobs, so using the current timestamp instead 
of the root timestamp is
// not expected to invalidate these cache entries too often.
$touchTimestamp = wfTimestampNow();
+   // If page_touched is higher than this, then something else 
already bumped it after enqueue
+   $condTimestamp = isset( $this->params['rootJobTimestamp'] )
+   ? $this->params['rootJobTimestamp']
+   : $touchTimestamp;
 
$dbw = wfGetDB( DB_MASTER );
$factory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
@@ -126,7 +130,7 @@
[ 'page_touched' => $dbw->timestamp( 
$touchTimestamp ) ],
[ 'page_id' => $batch,
// don't invalidated pages that were 
already invalidated
-   "page_touched < " . $dbw->addQuotes( 
$dbw->timestamp( $touchTimestamp ) )
+   "page_touched < " . $dbw->addQuotes( 
$dbw->timestamp( $condTimestamp ) )
],
__METHOD__
);

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Fix exception on some combination of quotes

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

Change subject: Fix exception on some combination of quotes
..


Fix exception on some combination of quotes

Bug: T174060
Change-Id: Ie53b7260a98519f45d38d2a705b900142c77c801
---
M resources/mode/mediawiki/mediawiki.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/resources/mode/mediawiki/mediawiki.js 
b/resources/mode/mediawiki/mediawiki.js
index ddc68da..d7b2541 100644
--- a/resources/mode/mediawiki/mediawiki.js
+++ b/resources/mode/mediawiki/mediawiki.js
@@ -925,7 +925,7 @@
firstmultiletterword = undefined;
firstspace = undefined;
if ( readyTokens.length > 0 ) { // it 
contains tickets before the point of rollback
-   readyTokens[ readyTokens.length 
].pos++; // add one apostrophe, next token will be italic (two apostrophes)
+   readyTokens[ readyTokens.length 
- 1 ].pos++; // add one apostrophe, next token will be italic (two apostrophes)
mTokens = readyTokens; // for 
sending tokens till the point of rollback
} else { // there are no tikets before 
the point of rollback
stream.pos = tmpTokens[ 0 ].pos 
- 2; // eat( '\'')

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie53b7260a98519f45d38d2a705b900142c77c801
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Dark Mode : Change card colors for dark mode

2017-08-25 Thread Sharvaniharan (Code Review)
Sharvaniharan has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373986 )

Change subject: Dark Mode : Change card colors for dark mode
..

Dark Mode : Change card colors for dark mode

- Changed Search bar style to a custom search background of base12 [ Exosphere 
Gray] instead of the android defined 'selectable items gray'
- Changed CardView backgrounds to base14 [Thermosphere Gray] instead of default 
material standard of #424242 for dark mode. Light mode is still material 
default.
- Found background to be base10 [Darkest Gray] as required. No changes to that.

Screenshots for change : 
https://drive.google.com/open?id=0B_maM54cPModWkNGY1E5dmZXdms

Bug : T173302

Change-Id: If8c21e6b3375163a7bf06057aac3254345e10135
---
M app/src/main/res/layout/view_search_bar.xml
M app/src/main/res/values/attrs.xml
M app/src/main/res/values/styles_dark.xml
M app/src/main/res/values/styles_light.xml
4 files changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/app/src/main/res/layout/view_search_bar.xml 
b/app/src/main/res/layout/view_search_bar.xml
index a2f4288..b7c1843 100644
--- a/app/src/main/res/layout/view_search_bar.xml
+++ b/app/src/main/res/layout/view_search_bar.xml
@@ -4,7 +4,7 @@
 android:id="@+id/search_container"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
-android:background="?attr/selectableItemBackground"
+android:background="?attr/searchItemBackground"
 android:clickable="true">
 
 
 
+
+
 
 
 
diff --git a/app/src/main/res/values/styles_dark.xml 
b/app/src/main/res/values/styles_dark.xml
index 2b1906b..072eeca 100644
--- a/app/src/main/res/values/styles_dark.xml
+++ b/app/src/main/res/values/styles_dark.xml
@@ -74,6 +74,8 @@
 @color/feed_text_primary_dark
 @color/feed_text_secondary_dark
 @color/feed_text_tertiary_dark
+@color/base12
+@color/base14
 
 
 
diff --git a/app/src/main/res/values/styles_light.xml 
b/app/src/main/res/values/styles_light.xml
index e842397..39b8c8a 100644
--- a/app/src/main/res/values/styles_light.xml
+++ b/app/src/main/res/values/styles_light.xml
@@ -74,6 +74,7 @@
 @color/feed_text_primary_light
 @color/feed_text_secondary_light
 @color/feed_text_tertiary_light
+@color/base100
 
 
 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Populate metadata for downloadable ZIM files from Kiwix

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

Change subject: Populate metadata for downloadable ZIM files from Kiwix
..

Populate metadata for downloadable ZIM files from Kiwix

Notes:
* Dates are currently approximate based on mm- combinations from the
  Kiwix download site, but it looks like we have the true timestamps on
  dumps.  These can be updated later.

* The image assets for the OR Wikipedia full collection with no media
  don't seem to have been uploaded; those are empty.

Bug: T164760
Change-Id: I657e9eb37c5ccd2b3ca8ea994e57f838a4441edf
---
M app/build.gradle
A app/src/main/assets/zims.tsv
M app/src/main/java/org/wikipedia/offline/Compilation.java
M app/src/main/java/org/wikipedia/offline/CompilationClient.java
M app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
M app/src/main/java/org/wikipedia/offline/RemoteCompilationsFragment.java
6 files changed, 122 insertions(+), 93 deletions(-)


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

diff --git a/app/build.gradle b/app/build.gradle
index afd312d..661ac4b 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -194,6 +194,7 @@
 }
 compile 'net.hockeyapp.android:HockeySDK:4.1.3'
 compile 'org.apache.commons:commons-lang3:3.5'
+compile "commons-io:commons-io:2.5"
 compile 'org.jsoup:jsoup:1.10.2'
 compile 'com.dmitrybrant:zimdroid:0.0.11'
 
@@ -213,7 +214,6 @@
 testCompile mockitoCore
 testCompile 'org.robolectric:robolectric:3.3.2'
 testCompile "com.squareup.okhttp3:mockwebserver:$okHttpVersion"
-testCompile "commons-io:commons-io:2.5"
 
 androidTestCompile mockitoCore
 androidTestApk 'com.crittercism.dexmaker:dexmaker:1.4'
diff --git a/app/src/main/assets/zims.tsv b/app/src/main/assets/zims.tsv
new file mode 100644
index 000..51412b2
--- /dev/null
+++ b/app/src/main/assets/zims.tsv
@@ -0,0 +1,72 @@
+Medical Wiki AR/العربية
http://download.kiwix.org/zim/wikipedia_ar_medicine.zim ar  This is a 
complete collection of all health care, anatomy, and medication related topics 
from Wikipedia.ALL 
https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Wiki_Project_Med_Foundation_logo.svg/320px-Wiki_Project_Med_Foundation_logo.svg.png
   
https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/WikiMedicine-Large_image-EN%404x.png/640px-WikiMedicine-Large_image-EN%404x.png
   1043986445  1501545600
+Medical Wiki BN/বাংলা  http://download.kiwix.org/zim/wikipedia_bn_medicine.zim 
bn  This is a complete collection of all health care, anatomy, and 
medication related topics from Wikipedia in an offline format.   ALL
 
https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Wiki_Project_Med_Foundation_logo.svg/320px-Wiki_Project_Med_Foundation_logo.svg.png
   
https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/WikiMedicine-Large_image-EN%404x.png/640px-WikiMedicine-Large_image-EN%404x.png
   177557471   1501545600
+Medical Wiki DE/Deutsch
http://download.kiwix.org/zim/wikipedia_de_medicine.zim de  This is a 
complete collection of all health care, anatomy, and medication related topics 
from Wikipedia in an offline format.   ALL 
https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Wiki_Project_Med_Foundation_logo.svg/320px-Wiki_Project_Med_Foundation_logo.svg.png
   
https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/WikiMedicine-Large_image-EN%404x.png/640px-WikiMedicine-Large_image-EN%404x.png
   1015686289  1501545600
+Medical Wiki EN/English
http://download.kiwix.org/zim/wikipedia_en_medicine.zim en  With 51,000+ 
medical articles, Wikimed is the largest and most comprehensive collection of 
health-related articles available. It includes content on diseases, 
medications, anatomy, and sanitation. As an encyclopedic medical dictionary, 
Wikimed is perfect for practicing physicians, as well as medicine and other 
healthcare students.If you are in the developing world without access to 
the Internet or on a boat in the middle of nowhere you can now access one of 
the foremost and up-to-date medical dictionaries, for free.   ALL 
https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Wiki_Project_Med_Foundation_logo.svg/320px-Wiki_Project_Med_Foundation_logo.svg.png
   
https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/WikiMedicine-Large_image-EN%404x.png/640px-WikiMedicine-Large_image-EN%404x.png
   4627268005  1501545600
+Medical Wiki ES/Español
http://download.kiwix.org/zim/wikipedia_es_medicine.zim es  This is a 
complete collection of all health care, anatomy, and medication related topics 
from Wikipedia.ALL 

[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: DiffElement: Fix insert/delete-to-end loops

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

Change subject: DiffElement: Fix insert/delete-to-end loops
..


DiffElement: Fix insert/delete-to-end loops

Bug: T173860
Change-Id: Ic1c2d997e3295d0cc4d5445c2ef10daa0e9abd54
---
M src/ui/elements/ve.ui.DiffElement.js
M tests/ui/ve.ui.DiffElement.test.js
2 files changed, 37 insertions(+), 7 deletions(-)

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



diff --git a/src/ui/elements/ve.ui.DiffElement.js 
b/src/ui/elements/ve.ui.DiffElement.js
index 3a877e7..ea6a12e 100644
--- a/src/ui/elements/ve.ui.DiffElement.js
+++ b/src/ui/elements/ve.ui.DiffElement.js
@@ -194,7 +194,7 @@
  * Render the diff
  */
 ve.ui.DiffElement.prototype.renderDiff = function () {
-   var i, j, k, ilen, jlen, klen, nodes, move, documentSpacerNode, 
internalListSpacerNode, li, groupName,
+   var i, j, ilen, jlen, move, documentSpacerNode, internalListSpacerNode, 
li, groupName,
noChanges, group, headingNode, names, category, 
internalListGroup,
internalListDiffDiv, anyInternalListChanges, internalListItem,
documentNode = this.$document[ 0 ],
@@ -306,17 +306,17 @@
if ( this.oldDocChildren[ i ] === undefined ) {
 
// Everything else in the new doc is an insert
-   nodes = this.newDocChildren.slice( j );
-   for ( k = 0, klen = nodes.length; k < klen; k++ ) {
-   diffQueue.push( [ 'getNodeElements', nodes[ k 
], 'insert' ] );
+   while ( j < this.newDocChildren.length ) {
+   diffQueue.push( [ 'getNodeElements', 
this.newDocChildren[ j ], 'insert' ] );
+   j++;
}
 
} else if ( this.newDocChildren[ j ] === undefined ) {
 
// Everything else in the old doc is a remove
-   nodes = this.oldDocChildren.slice( i );
-   for ( k = 0, klen = nodes.length; k < klen; k++ ) {
-   diffQueue.push( [ 'getNodeElements', nodes[ k 
], 'remove' ] );
+   while ( i < this.oldDocChildren.length ) {
+   diffQueue.push( [ 'getNodeElements', 
this.oldDocChildren[ i ], 'remove' ] );
+   i++;
}
 
} else if ( this.remove.indexOf( i ) !== -1 ) {
diff --git a/tests/ui/ve.ui.DiffElement.test.js 
b/tests/ui/ve.ui.DiffElement.test.js
index befa3d3..d3e66dc 100644
--- a/tests/ui/ve.ui.DiffElement.test.js
+++ b/tests/ui/ve.ui.DiffElement.test.js
@@ -191,6 +191,36 @@
''
},
{
+   msg: 'Multi-node insert',
+   oldDoc: '',
+   newDoc: 'foobar',
+   expected:
+   '' +
+   '' +
+   '' +
+   '' +
+   'foo' +
+   '' +
+   '' +
+   'bar' +
+   ''
+   },
+   {
+   msg: 'Multi-node remove',
+   oldDoc: 'foobar',
+   newDoc: '',
+   expected:
+   '' +
+   'foo' +
+   '' +
+   '' +
+   'bar' +
+   '' +
+   '' +
+   '' +
+   ''
+   },
+   {
msg: 'Inline node inserted',
oldDoc: 'foo bar baz quux',
newDoc: 'foo bar  baz quux',

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

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

___
MediaWiki-commits mailing list

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.15]: Disable rebound CDN purges for backlinks in HTMLCacheUpdateJob

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

Change subject: Disable rebound CDN purges for backlinks in HTMLCacheUpdateJob
..

Disable rebound CDN purges for backlinks in HTMLCacheUpdateJob

These are there to handle regeneration race conditions due to
replication lag. If there happens to already be a huge amount
of purges, the cost of this can be too high. Also, if the queue
is backlogged, then it is already delayed, so extra delayed jobs
do not help and just add to the backlog in that scenario.

Bug: T173710
Change-Id: Ida0bf44233072e1356a9fe63866d522e4bb2d0ca
(cherry picked from commit 6898d06f8fec29a6b1f0a5957d860c0675c57985)
---
M includes/jobqueue/jobs/HTMLCacheUpdateJob.php
1 file changed, 7 insertions(+), 3 deletions(-)


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

diff --git a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php 
b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
index 07d68e7..9d0f87c 100644
--- a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
+++ b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
@@ -139,9 +139,13 @@
__METHOD__
) );
 
-   // Update CDN
-   $u = CdnCacheUpdate::newFromTitles( $titleArray );
-   $u->doUpdate();
+   // Update CDN; call purge() directly so as to not bother with 
secondary purges
+   $urls = [];
+   foreach ( $titleArray as $title ) {
+   /** @var Title $title */
+   $urls = array_merge( $urls, $title->getCdnUrls() );
+   }
+   CdnCacheUpdate::purge( $urls );
 
// Update file cache
if ( $wgUseFileCache ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida0bf44233072e1356a9fe63866d522e4bb2d0ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.30.0-wmf.15
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.15]: Fix old regression in HTMLCacheUpdate de-duplication

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

Change subject: Fix old regression in HTMLCacheUpdate de-duplication
..

Fix old regression in HTMLCacheUpdate de-duplication

* The condition timestamp should be the root job timestamp,
  as the comments imply, though that was not the case. Only
  the SET timestamp should be the current timestamp. As it
  was, jobs effectively did not "see" each other since each
  one would be expecting newer than the ones that ran prior.
  The page_touched condition for the UPDATE query was mostly
  useless, since it was always the current timestamp.
* This problem was a regression from f598ca81e3f40166.

Change-Id: I1398366e87c959be1c98e4db959c41309b0ac1b8
---
M includes/jobqueue/jobs/HTMLCacheUpdateJob.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/83/373983/1

diff --git a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php 
b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
index 07d68e7..feefeda 100644
--- a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
+++ b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
@@ -113,6 +113,10 @@
// before the link jobs, so using the current timestamp instead 
of the root timestamp is
// not expected to invalidate these cache entries too often.
$touchTimestamp = wfTimestampNow();
+   // If page_touched is higher than this, then something else 
already bumped it after enqueue
+   $condTimestamp = isset( $this->params['rootJobTimestamp'] )
+   ? $this->params['rootJobTimestamp']
+   : $touchTimestamp;
 
$dbw = wfGetDB( DB_MASTER );
$factory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
@@ -126,7 +130,7 @@
[ 'page_touched' => $dbw->timestamp( 
$touchTimestamp ) ],
[ 'page_id' => $batch,
// don't invalidated pages that were 
already invalidated
-   "page_touched < " . $dbw->addQuotes( 
$dbw->timestamp( $touchTimestamp ) )
+   "page_touched < " . $dbw->addQuotes( 
$dbw->timestamp( $condTimestamp ) )
],
__METHOD__
);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1398366e87c959be1c98e4db959c41309b0ac1b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.30.0-wmf.15
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Aaron Schulz 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid preemptive DB replication waits for farm cross-wiki re...

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

Change subject: Avoid preemptive DB replication waits for farm cross-wiki 
redirects
..


Avoid preemptive DB replication waits for farm cross-wiki redirects

This previously only worked if $wgLocalVirtualHosts was set, which
was too specific to check and not used by WMF. Use the more generic
WikiMap class.

Two methods have been added there to do the work of enumerating
canonical wiki farm URLs and checking them against a given URL.

Bug: T172357
Change-Id: Id2415bab5d7f5a08b9f536858c32d329138384a2
---
M includes/DefaultSettings.php
M includes/MediaWiki.php
M includes/WikiMap.php
M tests/phpunit/includes/WikiMapTest.php
4 files changed, 134 insertions(+), 33 deletions(-)

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



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 2613889..d525816 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2053,8 +2053,8 @@
 $wgDBOracleDRCP = false;
 
 /**
- * Other wikis on this site, can be administered from a single developer
- * account.
+ * Other wikis on this site, can be administered from a single developer 
account.
+ *
  * Array numeric key => database name
  */
 $wgLocalDatabases = [];
@@ -8308,8 +8308,6 @@
  *   subdomain thereof, then no proxy will be used.
  *   Command-line scripts are not affected by this setting and will always use
  *   the proxy if it is configured.
- * - ChronologyProtector: Decide to shutdown LBFactory asynchronously instead
- *   synchronously if the current response redirects to a local virtual host.
  *
  * @since 1.25
  */
diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php
index 10b9e2b..7b59ee9 100644
--- a/includes/MediaWiki.php
+++ b/includes/MediaWiki.php
@@ -607,7 +607,7 @@
$request->wasPosted() &&
$output->getRedirect() &&
$lbFactory->hasOrMadeRecentMasterChanges( INF )
-   ) ? self::getUrlDomainDistance( $output->getRedirect(), 
$context ) : false;
+   ) ? self::getUrlDomainDistance( $output->getRedirect() ) : 
false;
 
$allowHeaders = !( $output->isDisabled() || headers_sent() );
if ( $urlDomainDistance === 'local' || $urlDomainDistance === 
'remote' ) {
@@ -676,34 +676,14 @@
 
/**
 * @param string $url
-* @param IContextSource $context
 * @return string Either "local", "remote" if in the farm, "external" 
otherwise
 */
-   private static function getUrlDomainDistance( $url, IContextSource 
$context ) {
-   static $relevantKeys = [ 'host' => true, 'port' => true ];
-
-   $infoCandidate = wfParseUrl( $url );
-   if ( $infoCandidate === false ) {
-   return 'external';
-   }
-
-   $infoCandidate = array_intersect_key( $infoCandidate, 
$relevantKeys );
-   $clusterHosts = array_merge(
-   // Local wiki host (the most common case)
-   [ $context->getConfig()->get( 'CanonicalServer' ) ],
-   // Any local/remote wiki virtual hosts for this wiki 
farm
-   $context->getConfig()->get( 'LocalVirtualHosts' )
-   );
-
-   foreach ( $clusterHosts as $i => $clusterHost ) {
-   $parseUrl = wfParseUrl( $clusterHost );
-   if ( !$parseUrl ) {
-   continue;
-   }
-   $infoHost = array_intersect_key( $parseUrl, 
$relevantKeys );
-   if ( $infoCandidate === $infoHost ) {
-   return ( $i === 0 ) ? 'local' : 'remote';
-   }
+   private static function getUrlDomainDistance( $url ) {
+   $clusterWiki = WikiMap::getWikiFromUrl( $url );
+   if ( $clusterWiki === wfWikiID() ) {
+   return 'local'; // the current wiki
+   } elseif ( $clusterWiki !== false ) {
+   return 'remote'; // another wiki in this cluster/farm
}
 
return 'external';
diff --git a/includes/WikiMap.php b/includes/WikiMap.php
index 6a532e5..4f3c461 100644
--- a/includes/WikiMap.php
+++ b/includes/WikiMap.php
@@ -20,8 +20,10 @@
  * @file
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
- * Helper tools for dealing with other wikis.
+ * Helper tools for dealing with other locally-hosted wikis.
  */
 class WikiMap {
 
@@ -81,7 +83,7 @@
 * @return WikiReference|null WikiReference object or null if the wiki 
was not found
 */
private static function getWikiWikiReferenceFromSites( $wikiID ) {
-   $siteLookup = 

[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Docs: Fix typo in Grafana link label

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

Change subject: Docs: Fix typo in Grafana link label
..


Docs: Fix typo in Grafana link label

Change-Id: I35d984b9fd5d8dc39cb17d2ff1e69e58a4e699c4
---
M doc/instrumentation.md
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/doc/instrumentation.md b/doc/instrumentation.md
index 5af409c..65b1dbd 100644
--- a/doc/instrumentation.md
+++ b/doc/instrumentation.md
@@ -1,6 +1,6 @@
 # Instrumentation
 
-Page Previews is thoroughly instrumented. Currently, there's one [Event 
Logging](https://www.mediawiki.org/wiki/Extension:EventLogging) ("EL") schema 
that captures all of the data that we record about a user's interactions with 
the Page Previews extension, the 
[Schema:Popups](https://meta.wikimedia.org/wiki/Schema:Popups) schema. There is 
also a statsv instrumentation, which is visualized as a [Graphana 
dashboard](https://grafana.wikimedia.org/dashboard/db/reading-web-page-previews).
 The primary purpose of the statsv instrumentation is to monitor the 
performance of PagePreviews in production.
+Page Previews is thoroughly instrumented. Currently, there's one [Event 
Logging](https://www.mediawiki.org/wiki/Extension:EventLogging) ("EL") schema 
that captures all of the data that we record about a user's interactions with 
the Page Previews extension, the 
[Schema:Popups](https://meta.wikimedia.org/wiki/Schema:Popups) schema. There is 
also a statsv instrumentation, which is visualized as a [Grafana 
dashboard](https://grafana.wikimedia.org/dashboard/db/reading-web-page-previews).
 The primary purpose of the statsv instrumentation is to monitor the 
performance of PagePreviews in production.
 
 Tilman Bayer captured the high level state and user action's that should 
trigger an event to be logged via EL 
[here](https://www.mediawiki.org/wiki/File:State_diagram_for_Schema-Popups_(Hovercards_instrumentation).svg)
 – indeed, this diagram was a catalyst for rewriting the Page Previews 
application as a large finite state machine.
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I35d984b9fd5d8dc39cb17d2ff1e69e58a4e699c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Legoktm 
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...MobileFrontend[master]: Fixes to typos

2017-08-25 Thread D3r1ck01 (Code Review)
D3r1ck01 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373982 )

Change subject: Fixes to typos
..

Fixes to typos

Found some typos in MF files. Fixed!

Change-Id: Ia03d7bf7797e7525a9ae4a3220f88a36ae72c57a
---
M includes/MobileFrontend.hooks.php
M tests/phpunit/MobileFrontend.hooksTest.php
2 files changed, 4 insertions(+), 4 deletions(-)


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

diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 787a00d..412a159 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -15,7 +15,7 @@
  * For intance, the hook handler for the 'RequestContextCreateSkin' would be 
called:
  * onRequestContextCreateSkin()
  *
- * If you're hook changes the behaviour of the Minerva skin you are in the 
wrong place.
+ * If your hook changes the behaviour of the Minerva skin, you are in the 
wrong place.
  * Any changes relating to Minerva should go into Minerva.hooks.php
  */
 class MobileFrontendHooks {
@@ -117,7 +117,7 @@
if ( $userSkin ) {
// Normalize the key in case the user is passing 
gibberish or has old preferences
$normalizedSkin = Skin::normalizeKey( $userSkin );
-   // If the skin has been normalized and is different 
from user input use it
+   // If the skin has been normalized and is different 
from user input, use it
if ( $normalizedSkin === $userSkin ) {
$skin = $normalizedSkin;
return false;
@@ -780,7 +780,7 @@
);
}
 
-   // In mobile mode 
MediaWiki:Common.css/MediaWiki:Common.js is not loaded.
+   // In mobile mode, 
MediaWiki:Common.css/MediaWiki:Common.js is not loaded.
// We load MediaWiki:Mobile.css/js instead
$out->addModules( [ 'mobile.site' ] );
 
diff --git a/tests/phpunit/MobileFrontend.hooksTest.php 
b/tests/phpunit/MobileFrontend.hooksTest.php
index c5bd185..75084cd 100644
--- a/tests/phpunit/MobileFrontend.hooksTest.php
+++ b/tests/phpunit/MobileFrontend.hooksTest.php
@@ -252,7 +252,7 @@
$thumbnail = new ThumbnailImage(
$file,
 
-   // The following is stub data that stops 
`ThumbnailImage#__construct`
+   // The following is stub data that stops 
`ThumbnailImage#__construct`,
// triggering a warning.
'/foo.svg',
false,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Docs: Fix typo in Grafana link label

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

Change subject: Docs: Fix typo in Grafana link label
..

Docs: Fix typo in Grafana link label

Change-Id: I35d984b9fd5d8dc39cb17d2ff1e69e58a4e699c4
---
M doc/instrumentation.md
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/81/373981/1

diff --git a/doc/instrumentation.md b/doc/instrumentation.md
index 5af409c..65b1dbd 100644
--- a/doc/instrumentation.md
+++ b/doc/instrumentation.md
@@ -1,6 +1,6 @@
 # Instrumentation
 
-Page Previews is thoroughly instrumented. Currently, there's one [Event 
Logging](https://www.mediawiki.org/wiki/Extension:EventLogging) ("EL") schema 
that captures all of the data that we record about a user's interactions with 
the Page Previews extension, the 
[Schema:Popups](https://meta.wikimedia.org/wiki/Schema:Popups) schema. There is 
also a statsv instrumentation, which is visualized as a [Graphana 
dashboard](https://grafana.wikimedia.org/dashboard/db/reading-web-page-previews).
 The primary purpose of the statsv instrumentation is to monitor the 
performance of PagePreviews in production.
+Page Previews is thoroughly instrumented. Currently, there's one [Event 
Logging](https://www.mediawiki.org/wiki/Extension:EventLogging) ("EL") schema 
that captures all of the data that we record about a user's interactions with 
the Page Previews extension, the 
[Schema:Popups](https://meta.wikimedia.org/wiki/Schema:Popups) schema. There is 
also a statsv instrumentation, which is visualized as a [Grafana 
dashboard](https://grafana.wikimedia.org/dashboard/db/reading-web-page-previews).
 The primary purpose of the statsv instrumentation is to monitor the 
performance of PagePreviews in production.
 
 Tilman Bayer captured the high level state and user action's that should 
trigger an event to be logged via EL 
[here](https://www.mediawiki.org/wiki/File:State_diagram_for_Schema-Popups_(Hovercards_instrumentation).svg)
 – indeed, this diagram was a catalyst for rewriting the Page Previews 
application as a large finite state machine.
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Fix exception on some combination of quotes

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

Change subject: Fix exception on some combination of quotes
..

Fix exception on some combination of quotes

Bug: T174060
Change-Id: Ie53b7260a98519f45d38d2a705b900142c77c801
---
M resources/mode/mediawiki/mediawiki.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/resources/mode/mediawiki/mediawiki.js 
b/resources/mode/mediawiki/mediawiki.js
index ddc68da..d7b2541 100644
--- a/resources/mode/mediawiki/mediawiki.js
+++ b/resources/mode/mediawiki/mediawiki.js
@@ -925,7 +925,7 @@
firstmultiletterword = undefined;
firstspace = undefined;
if ( readyTokens.length > 0 ) { // it 
contains tickets before the point of rollback
-   readyTokens[ readyTokens.length 
].pos++; // add one apostrophe, next token will be italic (two apostrophes)
+   readyTokens[ readyTokens.length 
- 1 ].pos++; // add one apostrophe, next token will be italic (two apostrophes)
mTokens = readyTokens; // for 
sending tokens till the point of rollback
} else { // there are no tikets before 
the point of rollback
stream.pos = tmpTokens[ 0 ].pos 
- 2; // eat( '\'')

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix old regression in HTMLCacheUpdate de-duplication

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

Change subject: Fix old regression in HTMLCacheUpdate de-duplication
..

Fix old regression in HTMLCacheUpdate de-duplication

* The condition timestamp should be the root job timestamp,
  as the comments imply, though that was not the case. Only
  the SET timestamp should be the current timestamp. As it
  was, jobs effectively did not "see" each other since each
  one would be expecting newer than the ones that ran prior.
  The page_touched condition for the UPDATE query was mostly
  useless, since it was always the current timestamp.
* This problem was a regression from f598ca81e3f40166.

Change-Id: I1398366e87c959be1c98e4db959c41309b0ac1b8
---
M includes/jobqueue/jobs/HTMLCacheUpdateJob.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/79/373979/1

diff --git a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php 
b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
index 9d0f87c..4c16d7f 100644
--- a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
+++ b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
@@ -113,6 +113,10 @@
// before the link jobs, so using the current timestamp instead 
of the root timestamp is
// not expected to invalidate these cache entries too often.
$touchTimestamp = wfTimestampNow();
+   // If page_touched is higher than this, then something else 
already bumped it after enqueue
+   $condTimestamp = isset( $this->params['rootJobTimestamp'] )
+   ? $this->params['rootJobTimestamp']
+   : $touchTimestamp;
 
$dbw = wfGetDB( DB_MASTER );
$factory = 
MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
@@ -126,7 +130,7 @@
[ 'page_touched' => $dbw->timestamp( 
$touchTimestamp ) ],
[ 'page_id' => $batch,
// don't invalidated pages that were 
already invalidated
-   "page_touched < " . $dbw->addQuotes( 
$dbw->timestamp( $touchTimestamp ) )
+   "page_touched < " . $dbw->addQuotes( 
$dbw->timestamp( $condTimestamp ) )
],
__METHOD__
);

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

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

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


[MediaWiki-commits] [Gerrit] labs...deploy[master]: Bump striker submodule

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

Change subject: Bump striker submodule
..


Bump striker submodule

Various bug fixes following 2017-08-23 deployment.

Change-Id: I52d4212f18f89ad1873d7061921c2dab96aa8835
---
M striker
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/striker b/striker
index 09bab78..497f17a 16
--- a/striker
+++ b/striker
@@ -1 +1 @@
-Subproject commit 09bab78a4a3eba225d2f7e0e3e1e4bc8e4097b8d
+Subproject commit 497f17a1aca9b80ec8a511d8a3c5c5ea5e36ffe5

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I52d4212f18f89ad1873d7061921c2dab96aa8835
Gerrit-PatchSet: 1
Gerrit-Project: labs/striker/deploy
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] labs...deploy[master]: Bump striker submodule

2017-08-25 Thread BryanDavis (Code Review)
BryanDavis has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373978 )

Change subject: Bump striker submodule
..

Bump striker submodule

Various bug fixes following 2017-08-23 deployment.

Change-Id: I52d4212f18f89ad1873d7061921c2dab96aa8835
---
M striker
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/striker/deploy 
refs/changes/78/373978/1

diff --git a/striker b/striker
index 09bab78..497f17a 16
--- a/striker
+++ b/striker
@@ -1 +1 @@
-Subproject commit 09bab78a4a3eba225d2f7e0e3e1e4bc8e4097b8d
+Subproject commit 497f17a1aca9b80ec8a511d8a3c5c5ea5e36ffe5

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Delete half-baked Silverpop import code

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

Change subject: Delete half-baked Silverpop import code
..

Delete half-baked Silverpop import code

Eileen's solution is up and running in production and actually useful
for other organizations.

Change-Id: Id284406cb4fcafdf6c764e88d643d9b0813a7b3e
---
D sites/all/modules/wmf_communication/Silverpop/SilverpopImporter.php
D sites/all/modules/wmf_communication/Silverpop/lib/Engage.php
D sites/all/modules/wmf_communication/Silverpop/lib/Validation.php
D sites/all/modules/wmf_communication/tests/phpunit/SilverpopImporterTest.php
D sites/all/modules/wmf_communication/wmf_communication.drush.inc
M sites/all/modules/wmf_communication/wmf_communication.info
M sites/all/modules/wmf_communication/wmf_communication.module
7 files changed, 0 insertions(+), 766 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/77/373977/1

diff --git 
a/sites/all/modules/wmf_communication/Silverpop/SilverpopImporter.php 
b/sites/all/modules/wmf_communication/Silverpop/SilverpopImporter.php
deleted file mode 100644
index d8216f3..000
--- a/sites/all/modules/wmf_communication/Silverpop/SilverpopImporter.php
+++ /dev/null
@@ -1,295 +0,0 @@
-engage = $options['engage'];
-   $this->username = $options['username'];
-   $this->password = $options['password'];
-   $this->civimailstore = $options['civimailstore'];
-   $this->sftp = $options['sftp'];
-   $this->zipper = $options['zipper'];
-   }
-
-   function import( $days ) {
-   $this->engage->login( $this->username, $this->password );
-   $sentMailings = $this->getSentMailings( $days );
-   $mailings = array();
-   foreach ( $sentMailings->Mailing as $mailing ) {
-   $alreadyImported = false;
-   try {
-   $civiMailing = 
$this->civimailstore->getMailing( 'Silverpop', $mailing->MailingId );
-   // If it exists, check the status to see if 
we're trying to re-import one that failed
-   $alreadyImported = ( 
$civiMailing->getJobStatus() === 'Complete' );
-   } catch ( CiviMailingMissingException $ex ) {
-   // If the mailing record is missing, we 
definitely still need to import it
-   }
-   if ( $alreadyImported ) {
-   continue;
-   }
-   $mailingId = (string)$mailing->MailingId;
-   $mailings[$mailingId] = array(
-   'id' => $mailing->MailingId,
-   'sent' => $mailing->SentTS,
-   'count' => $mailing->NumSent,
-   'subject' => $mailing->Subject,
-   'body' => $this->screenScrapeMailing( 
$mailingId ),
-   'export' => $this->requestRawExport( $mailing ),
-   'imported' => false,
-   );
-   }
-   $tempDir = file_directory_temp();
-   $this->downloadExports( $mailings, $tempDir );
-   $this->processExports( $mailings, $tempDir );
-   return $mailings;
-   }
-
-   function makeXmlRequest( $parentElement, $childElements ) {
-   $xml = new SimpleXMLElement('');
-   $body = $xml->addChild('Body');
-   $parent = $body->addChild($parentElement);
-   $this->addXmlChildren( $childElements, $parent );
-   return $xml;
-   }
-
-   /**
-* @param array $childElements
-* @param SimpleXMLElement $xml
-*/
-   function addXmlChildren( $childElements, $xml ) {
-   foreach( $childElements as $nodeName => $value ) {
-   if ( is_array ( $value ) ) {
-   if ( is_numeric( $nodeName ) ) {
-   $this->addXmlChildren( $value, $xml );
-   } else {
-   $newNode = $xml->addChild( $nodeName );
-   $this->addXmlChildren ( $value, 
$newNode );
-   }
-   } else {
-   $xml->addChild( $nodeName, $value );
-   }
-   }
-   }
-
-   function getSentMailings( $days ) {
-   $startDate = gmdate( self::DATE_FORMAT, strtotime( "-$days 
days" ) );
-   $endDate = gmdate( self::DATE_FORMAT );
-   $xml = $this->makeXmlRequest(
-   'GetSentMailingsForOrg',
-   array(
-   

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Delete wmf_communication\Job stuff

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

Change subject: Delete wmf_communication\Job stuff
..

Delete wmf_communication\Job stuff

Totally re-inventing the wheel, now that CiviCRM's mailing batch features
are more accessible via API.

Also, was only used in the one-offs script to send 'sorry' letters

Change-Id: Ie7a48b938ebae6f5f3330133c547e047686408ae
---
D sites/all/modules/wmf_communication/Job.php
D sites/all/modules/wmf_communication/MailingTemplate.php
D sites/all/modules/wmf_communication/Recipient.php
D sites/all/modules/wmf_communication/tests/Job.test
D sites/all/modules/wmf_communication/tests/TestThankyouTemplate.php
D 
sites/all/modules/wmf_communication/tests/templates/subject/thank_you.it.subject
D sites/all/modules/wmf_communication/tests/wmf_communication_tests.info
D sites/all/modules/wmf_communication/tests/wmf_communication_tests.module
M sites/all/modules/wmf_communication/wmf_communication.drush.inc
M sites/all/modules/wmf_communication/wmf_communication.info
D sites/all/modules/wmf_communication/wmf_communication.install
M sites/all/modules/wmf_communication/wmf_communication.module
12 files changed, 0 insertions(+), 630 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/76/373976/1

diff --git a/sites/all/modules/wmf_communication/Job.php 
b/sites/all/modules/wmf_communication/Job.php
deleted file mode 100644
index 74aeebc..000
--- a/sites/all/modules/wmf_communication/Job.php
+++ /dev/null
@@ -1,150 +0,0 @@
- $email ) {
- * $job
- * // Trigger the batch run.  Execution 
- * $job->run();
- */
-class Job {
-protected $id;
-protected $template;
-
-/**
- * Pull a job from the database.
- *
- * @param integer $id  The job's database ID
- */
-static function getJob( $id ) {
-$job = new Job();
-$job->id = $id;
-
-watchdog( 'wmf_communication',
-"Retrieving mailing job :id from the database.",
-array( ':id' => $id ),
-WATCHDOG_INFO
-);
-$row = db_select( 'wmf_communication_job' )
-->fields( 'wmf_communication_job' )
-->condition( 'id', $id )
-->execute()
-->fetchAssoc();
-
-if ( !$row ) {
-throw new Exception( 'No such job found: ' . $id );
-}
-
-$templateClass = $row['template_class'];
-if ( !class_exists( $templateClass ) ) {
-throw new Exception( 'Could not find mailing template class: ' . 
$templateClass );
-}
-$job->template = new $templateClass;
-if ( !( $job->template instanceof IMailingTemplate ) ) {
-throw new Exception( 'Mailing template class must implement 
IMailingTemplate' );
-}
-
-return $job;
-}
-
-/**
- * Reserve an empty Job record and sequence number.
- *
- * @param string $templateClass mailing template classname
- *
- * TODO: other job-wide parameters and generic storage
- */
-static function create( $templateClass ) {
-$jobId = db_insert( 'wmf_communication_job' )
-->fields( array(
-'template_class' => $templateClass,
-) )
-->execute();
-
-watchdog( 'wmf_communication',
-"Created a new job id :id, of type :template_class.",
-array(
-':id' => $jobId,
-':template_class' => $templateClass,
-),
-WATCHDOG_INFO
-);
-return Job::getJob( $jobId );
-}
-
-/**
- * Find all queued recipients and send letters.
- */
-function run() {
-watchdog( 'wmf_communication',
-"Running mailing job ID :id...",
-array( ':id' => $this->id ),
-WATCHDOG_INFO
-);
-
-$mailer = Mailer::getDefault();
-$successful = 0;
-$failed = 0;
-
-while ( $recipients = Recipient::getQueuedBatch( $this->id ) ) {
-foreach ( $recipients as $recipient ) {
-$bodyTemplate = $this->template->getBodyTemplate( $recipient );
-
-$email = array(
-'from_name' => $this->template->getFromName(),
-'from_address' => $this->template->getFromAddress(),
-'reply_to' => $this->template->getFromAddress(),
-'to_name' => $recipient->getName(),
-'to_address' => $recipient->getEmail(),
-'subject' => $this->template->getSubject( $recipient ),
-'plaintext' => $bodyTemplate->render( 'txt' ),
-'html' => $bodyTemplate->render( 'html' ),
-);
-
-$success = $mailer->send( $email );
-
-if ( $success ) {
-$successful++;
-

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Delete 'oneoffs' module

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

Change subject: Delete 'oneoffs' module
..

Delete 'oneoffs' module

We've been running this sort of thing as db updates in wmf_civicrm

Change-Id: I682f113f3eb01c27256a61672dfc15521e5fea61
---
D sites/all/modules/oneoffs/201305_paypal_recurring/SorryRecurringTemplate.php
D 
sites/all/modules/oneoffs/201305_paypal_recurring/sorry_may2013_paypal_recurring.php
D 
sites/all/modules/oneoffs/201305_paypal_recurring/templates/html/sorry_may2013.en.html
D 
sites/all/modules/oneoffs/201305_paypal_recurring/templates/subject/sorry_may2013.en.subject
D 
sites/all/modules/oneoffs/201305_paypal_recurring/templates/txt/sorry_may2013.en.txt
D sites/all/modules/oneoffs/oneoffs.drush.inc
D sites/all/modules/oneoffs/oneoffs.info
D sites/all/modules/oneoffs/oneoffs.module
M sites/default/enabled_modules
9 files changed, 0 insertions(+), 207 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/75/373975/1

diff --git 
a/sites/all/modules/oneoffs/201305_paypal_recurring/SorryRecurringTemplate.php 
b/sites/all/modules/oneoffs/201305_paypal_recurring/SorryRecurringTemplate.php
deleted file mode 100644
index 436cb1a..000
--- 
a/sites/all/modules/oneoffs/201305_paypal_recurring/SorryRecurringTemplate.php
+++ /dev/null
@@ -1,13 +0,0 @@
-https://mingle.corp.wikimedia.org/projects/fundraiser_2012/cards/986
- */
-function sorry_may2013_paypal_recurring_build_job() {
-$dbs = module_invoke( 'wmf_civicrm', 'get_dbs' );
-
-// Find all contributions affected by this screwup
-$dbs->push( 'civicrm' );
-$result = db_query( "
-SELECT
-cc.id AS contribution_id,
-cc.source AS amount,
-cc.receive_date AS date,
-cc.contact_id,
-ce.email
-FROM civicrm_contribution cc
-LEFT JOIN civicrm_email ce ON ce.contact_id = cc.contact_id
-LEFT JOIN civicrm_address ca ON ca.contact_id = cc.contact_id
-LEFT JOIN civicrm_country cco ON ca.country_id = cco.id
-WHERE
-cc.thankyou_date IS NULL
-AND cc.trxn_id LIKE 'RECURRING PAYPAL%'
-AND cco.iso_code = 'US'
-AND cc.receive_date BETWEEN '2013-02-01' AND '2013-05-01'
-AND ce.is_primary
-GROUP BY
-cc.id
-ORDER BY
-cc.receive_date ASC
-;
-" );
-$contributions = $result->fetchAllAssoc( 'contribution_id', 
PDO::FETCH_ASSOC );
-
-if ( !$contributions ) {
-drush_print( "No matching records found! Aborting." );
-return;
-}
-
-$byContact = array();
-foreach ( $contributions as $row ) {
-$byContact[$row['email']][] = $row;
-}
-
-$dbs->push( 'default' );
-
-$job = Job::create( 'SorryRecurringTemplate' );
-
-foreach ( $byContact as $contactId => $contributions ) {
-Recipient::create(
-$job->getId(),
-$contributions[0]['contact_id'],
-array(
-'contributions' => $contributions,
-)
-);
-}
-
-drush_print( "Built mailing job. Run using 'drush wmf-send-letters 
{$job->getId()}'" );
-}
-
-function sorry_may2013_paypal_recurring_mark_thanked() {
-$job_ran_date = '2013-08-14 00:00:00';
-
-// TODO function Job::getAllRecipientsForStatus or Recipient:getQueued... 
to do exactly this
-$query = db_select( 'wmf_communication_recipient', 'r' );
-$query->join( 'wmf_communication_job', 'j', 'r.job_id = j.id' );
-$query->addField( 'r', 'vars' );
-$query->condition( 'j.template_class', 'SorryRecurringTemplate' )
-->condition( 'r.status', 'successful' );
-$result = $query->execute();
-
-$civi = civicrm_api_classapi();
-
-while ( $vars = json_decode( $result->fetchField() ) ) {
-foreach ( $vars->contributions as $contribution ) {
-$success = $civi->Contribution->Create( array(
-'id' => $contribution->contribution_id,
-'thankyou_date' => $job_ran_date,
-
-'version' => '3',
-) );
-if ( !$success ) {
-throw new Exception( "Failed to update contribution: " . 
$civi->errorMsg() );
-}
-}
-}
-}
diff --git 
a/sites/all/modules/oneoffs/201305_paypal_recurring/templates/html/sorry_may2013.en.html
 
b/sites/all/modules/oneoffs/201305_paypal_recurring/templates/html/sorry_may2013.en.html
deleted file mode 100644
index 56d9641..000
--- 
a/sites/all/modules/oneoffs/201305_paypal_recurring/templates/html/sorry_may2013.en.html
+++ /dev/null
@@ -1,31 +0,0 @@
-Dear {{ first_name }},
-
-Thank you for donating to the Wikimedia Foundation. You are wonderful!
- 
-It's easy to ignore our fundraising banners, and I'm really glad you 
didn't. This is how Wikipedia pays its bills  people like you giving us 
money, so we can keep the site freely available for everyone around the 
world.
- 
-People tell me they donate to Wikipedia because they find it useful, and 
they trust it because 

[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Add test for Templating

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

Change subject: Add test for Templating
..

Add test for Templating

Change-Id: I6416785dda02fff63353216cba5542f62f6e421b
---
A sites/all/modules/wmf_communication/tests/phpunit/TemplatingTest.php
M sites/all/modules/wmf_communication/tests/templates/html/thank_you.it.html
2 files changed, 57 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/74/373974/1

diff --git 
a/sites/all/modules/wmf_communication/tests/phpunit/TemplatingTest.php 
b/sites/all/modules/wmf_communication/tests/phpunit/TemplatingTest.php
new file mode 100644
index 000..8457858
--- /dev/null
+++ b/sites/all/modules/wmf_communication/tests/phpunit/TemplatingTest.php
@@ -0,0 +1,56 @@
+ 'it',
+   'name' => 'Test Donor',
+   'receive_date' => 'Smarch 13th',
+   'currency' => 'EUR',
+   'amount' => 55.22
+   );
+   }
+
+   protected static $expected = "Caro Test Donor,
+
+Grazie per la tua donazione alla Wikimedia Foundation. È stata davvero 
apprezzata di
+cuore!
+
+Per le tue registrazioni: La tua donazione il Smarch 13th è stata
+€ 55,22.
+";
+
+   public function testRender() {
+   $params = $this->getParams();
+   $template = new Templating(
+   __DIR__ . DIRECTORY_SEPARATOR . '../templates',
+   'thank_you',
+   $params['locale'],
+   $params
+   );
+
+   $rendered = $template->render( 'html' );
+   $this->assertEquals( self::$expected, $rendered );
+   }
+
+   public function testRenderWithFallback() {
+   $params = $this->getParams();
+   $params['locale'] = 'it_FR';
+   $template = new Templating(
+   __DIR__ . DIRECTORY_SEPARATOR . '../templates',
+   'thank_you',
+   $params['locale'],
+   $params
+   );
+
+   $rendered = $template->render( 'html' );
+   $this->assertEquals( self::$expected, $rendered );
+   }
+}
diff --git 
a/sites/all/modules/wmf_communication/tests/templates/html/thank_you.it.html 
b/sites/all/modules/wmf_communication/tests/templates/html/thank_you.it.html
index 980508d..b695ead 100644
--- a/sites/all/modules/wmf_communication/tests/templates/html/thank_you.it.html
+++ b/sites/all/modules/wmf_communication/tests/templates/html/thank_you.it.html
@@ -4,4 +4,4 @@
 cuore!
 
 Per le tue registrazioni: La tua donazione il {{receive_date}} è stata
-{{amount|l10n_currency(locale)}}.
+{{ (currency ~ " " ~ amount) | l10n_currency(locale) }}.

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

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

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


[MediaWiki-commits] [Gerrit] oojs/ui[master]: [DEPRECATING CHANGE] icons: Move 'eye'/'eyeClosed' to 'acces...

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

Change subject: [DEPRECATING CHANGE] icons: Move 'eye'/'eyeClosed' to 
'accessibility'
..

[DEPRECATING CHANGE] icons: Move 'eye'/'eyeClosed' to 'accessibility'

The 'eye'/'eyeClosed' are moved from the
'alerts' icon pack to 'accessibility', which is also added to
Apex theme.

Bug: T145163
Change-Id: Idaeb6831d0c480c67c11d0ff487bb12c74ab262e
---
M demos/demo.js
M demos/demos.php
M demos/pages/icons.js
M src/themes/apex/icons-alerts.json
M src/themes/wikimediaui/icons-accessibility.json
M src/themes/wikimediaui/icons-alerts.json
6 files changed, 24 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/73/373973/1

diff --git a/demos/demo.js b/demos/demo.js
index f8905b8..c41e6c0 100644
--- a/demos/demo.js
+++ b/demos/demo.js
@@ -169,7 +169,8 @@
'-icons-editing-advanced',
'-icons-media',
'-icons-user',
-   '-icons-layout'
+   '-icons-layout',
+   '-icons-accessibility'
]
 };
 
diff --git a/demos/demos.php b/demos/demos.php
index a401081..00eaca4 100644
--- a/demos/demos.php
+++ b/demos/demos.php
@@ -65,7 +65,8 @@
'-icons-editing-advanced',
'-icons-media',
'-icons-user',
-   '-icons-layout'
+   '-icons-layout',
+   '-icons-accessibility'
]
];
// Stylesheets to load
diff --git a/demos/pages/icons.js b/demos/pages/icons.js
index 876dc35..ae462c8 100644
--- a/demos/pages/icons.js
+++ b/demos/pages/icons.js
@@ -39,8 +39,6 @@
'bell',
'bellOn',
'comment',
-   'eye',
-   'eyeClosed',
'message',
'notice',
'signature',
@@ -185,6 +183,8 @@
'bright',
'halfBright',
'notBright',
+   'eye',
+   'eyeClosed',
'moon',
'largerText',
'smallerText',
diff --git a/src/themes/apex/icons-alerts.json 
b/src/themes/apex/icons-alerts.json
index c3977eb..099da22 100644
--- a/src/themes/apex/icons-alerts.json
+++ b/src/themes/apex/icons-alerts.json
@@ -9,8 +9,14 @@
"rtl": "images/icons/bellOn-rtl.svg"
} },
"comment": { "file": "images/icons/comment.svg" },
-   "eye": { "file": "images/icons/eye.svg" },
-   "eyeClosed": { "file": "images/icons/eyeClosed.svg" },
+   "eye": {
+   "file": "images/icons/eye.svg",
+   "deprecated": "Replaced since v0.23.0, use 'eye' from 
the 'accessibility' pack instead."
+   },
+   "eyeClosed": {
+   "file": "images/icons/eyeClosed.svg",
+   "deprecated": "Replaced since v0.23.0, use 'eyeClosed' 
from the 'accessibility' pack instead."
+   },
"message": { "file": {
"ltr": "images/icons/message-ltr.svg",
"rtl": "images/icons/message-rtl.svg"
diff --git a/src/themes/wikimediaui/icons-accessibility.json 
b/src/themes/wikimediaui/icons-accessibility.json
index 4db45f4..656e321 100644
--- a/src/themes/wikimediaui/icons-accessibility.json
+++ b/src/themes/wikimediaui/icons-accessibility.json
@@ -12,6 +12,8 @@
"bright": { "file": "images/icons/bright.svg" },
"halfBright": { "file": "images/icons/halfBright.svg" },
"notBright": { "file": "images/icons/notBright.svg" },
+   "eye": { "file": "images/icons/eye.svg" },
+   "eyeClosed": { "file": "images/icons/eyeClosed.svg" },
"moon": { "file": "images/icons/moon.svg" },
"largerText": { "file": {
"ltr": "images/icons/largerText-ltr.svg",
diff --git a/src/themes/wikimediaui/icons-alerts.json 
b/src/themes/wikimediaui/icons-alerts.json
index c169b56..4f7a427 100644
--- a/src/themes/wikimediaui/icons-alerts.json
+++ b/src/themes/wikimediaui/icons-alerts.json
@@ -29,8 +29,14 @@
"rtl": "images/icons/bellOn-rtl.svg"
} },
"comment": { "file": "images/icons/comment.svg" },
-   "eye": { "file": "images/icons/eye.svg" },
-   "eyeClosed": { "file": "images/icons/eyeClosed.svg" },
+   "eye": {
+   "file": "images/icons/eye.svg",
+   

[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Make hierarchy additional parameter order insensitive

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

Change subject: Make hierarchy additional parameter order insensitive
..


Make hierarchy additional parameter order insensitive

Change-Id: I0e54dc07804523f3ffc8c58f8a7674a7dfe884a8
---
M CargoFieldDescription.php
1 file changed, 42 insertions(+), 35 deletions(-)

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



diff --git a/CargoFieldDescription.php b/CargoFieldDescription.php
index acf356c..5d261e7 100644
--- a/CargoFieldDescription.php
+++ b/CargoFieldDescription.php
@@ -42,6 +42,7 @@
// There may be additional parameters, in/ parentheses.
$matches = array();
$foundMatch2 = preg_match( '/([^(]*)\s*\((.*)\)/s', 
$fieldDescriptionStr, $matches );
+   $allowedValuesParam = "";
if ( $foundMatch2 ) {
$fieldDescriptionStr = trim( $matches[1] );
$extraParamsString = $matches[2];
@@ -58,41 +59,9 @@
$paramKey = trim( $extraParamParts[0] );
$paramValue = trim( $extraParamParts[1] 
);
if ( $paramKey == 'allowed values' ) {
-   // Replace the comma/delimiter
-   // substitution with a character
-   // that has no chance of being
-   // included in the values list -
-   // namely, the ASCII beep.
-
-   // The delimiter can't be a
-   // semicolon, because that's
-   // already used to separate
-   // "extra parameters", so just
-   // hardcode it to a semicolon.
-   $allowedValuesArray = array();
-   if( 
$fieldDescription->mIsHierarchy == true ) {
-   // $paramValue contains 
"*" hierarchy structure
-   
CargoUtils::validateHierarchyStructure( trim( $paramValue ) );
-   
$fieldDescription->mHierarchyStructure = trim( $paramValue );
-   // now make the allowed 
values param similar to the syntax
-   // used by other fields
-   $hierarchyNodesArray = 
explode( "\n", $paramValue );
-   foreach ( 
$hierarchyNodesArray as $node ) {
-   // Remove 
prefix of multiple "*"
-   
$allowedValuesArray[] = preg_replace( '/^[*]* ?/', '', $node );
-   }
-   } else {
-   $delimiter = ',';
-   $allowedValuesStr = 
str_replace( "\\$delimiter", "\a", $paramValue );
-   $allowedValuesTempArray 
= explode( $delimiter, $allowedValuesStr );
-   foreach ( 
$allowedValuesTempArray as $i => $value ) {
-   if ( $value == 
'' ) continue;
-   // Replace beep 
back with delimiter, trim.
-   $value = 
str_replace( "\a", $delimiter, trim( $value ) );
-   
$allowedValuesArray[] = $value;
-   }
-   }
-   
$fieldDescription->mAllowedValues = $allowedValuesArray;
+   // we do not assign allowed 
values to fieldDescription here,
+   // because we don't know yet if 
it's a hierarchy or an enumeration
+   $allowedValuesParam = 
$paramValue;
} elseif ( $paramKey == 'size' ) {
$fieldDescription->mSize = 
$paramValue;

[MediaWiki-commits] [Gerrit] mediawiki...SendGrid[master]: Remove unused package / dependency

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

Change subject: Remove unused package / dependency
..


Remove unused package / dependency

Removing "php-console-highlighter" package / dependency
as it's not used by the extension and thus irrelevant.

Bug: T174209
Change-Id: If763bdd8a13d38aa89ec593b225b17d22d91a442
---
M composer.json
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/composer.json b/composer.json
index bda334e..ed04a14 100644
--- a/composer.json
+++ b/composer.json
@@ -7,8 +7,7 @@
 },
 "require-dev": {
 "phpunit/phpunit": "4.*",
-"squizlabs/php_codesniffer": "2.*",
-"jakub-onderka/php-console-highlighter": "0.3.2"
+"squizlabs/php_codesniffer": "2.*"
 },
 "scripts": {
 "test": [

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If763bdd8a13d38aa89ec593b225b17d22d91a442
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SendGrid
Gerrit-Branch: master
Gerrit-Owner: Rosalieper 
Gerrit-Reviewer: D3r1ck01 
Gerrit-Reviewer: Legoktm 

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Check spacing after type in @return

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

Change subject: Check spacing after type in @return
..

Check spacing after type in @return

The return type should followed by one space

Change-Id: I377beda4ff352c795952d2a9ff14db20626e2576
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
M MediaWiki/Tests/files/Commenting/commenting_function.php
M MediaWiki/Tests/files/Commenting/commenting_function.php.expect
M MediaWiki/Tests/files/generic_pass.php
4 files changed, 37 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/72/373972/1

diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index 51fe0c9..d4460bf 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -227,6 +227,7 @@
// The first word of the return type is the actual type
$exploded = explode( ' ', $content, 2 );
$type = $exploded[0];
+   $comment = isset( $exploded[1] ) ? $exploded[1] : null;
$fixType = false;
// Check for unneeded punctation
$matches = [];
@@ -267,9 +268,30 @@
}
}
}
+   // Check spacing after type
+   if ( $comment !== null ) {
+   $expectedSpaces = 1;
+   $currentSpaces = strspn( $comment, ' ' ) + 1;
+   if ( $currentSpaces !== $expectedSpaces ) {
+   $data = [
+   $expectedSpaces,
+   $currentSpaces,
+   ];
+   $fix = $phpcsFile->addFixableError(
+   'Expected %s spaces after 
return type; %s found',
+   $retType,
+   'SpacingAfterReturnType',
+   $data
+   );
+   if ( $fix ) {
+   $fixType = true;
+   $comment = substr( $comment, 
$currentSpaces - 1 );
+   }
+   }
+   }
if ( $fixType ) {
$phpcsFile->fixer->replaceToken(
-   $retType, implode( '|', $explodedType ) 
. ( isset( $exploded[1] ) ? ' ' . $exploded[1] : '' )
+   $retType, implode( '|', $explodedType ) 
. ( $comment !== null ? ' ' . $comment : '' )
);
}
} else {
diff --git a/MediaWiki/Tests/files/Commenting/commenting_function.php 
b/MediaWiki/Tests/files/Commenting/commenting_function.php
index 1474dc1..02e8854 100644
--- a/MediaWiki/Tests/files/Commenting/commenting_function.php
+++ b/MediaWiki/Tests/files/Commenting/commenting_function.php
@@ -75,9 +75,9 @@
}
 
/**
-* @param  bool $aBool A bool
-* @paramint $anInt An int
-* @returnbool And some text
+* @param  bool$aBoolA bool
+* @paramint$anIntAn int
+* @returnboolAnd some text
 */
public function testTypesSpacing( $aBool, $anInt ) {
return $aBool;
diff --git a/MediaWiki/Tests/files/Commenting/commenting_function.php.expect 
b/MediaWiki/Tests/files/Commenting/commenting_function.php.expect
index 5d832be..65ce1a1 100644
--- a/MediaWiki/Tests/files/Commenting/commenting_function.php.expect
+++ b/MediaWiki/Tests/files/Commenting/commenting_function.php.expect
@@ -47,10 +47,20 @@
  |   | (MediaWiki.Commenting.FunctionComment.NotShortIntReturn)
   78 | ERROR | [x] Expected 1 spaces before parameter type; 2 found
  |   | 
(MediaWiki.Commenting.FunctionComment.SpacingBeforeParamType)
+  78 | ERROR | [x] Expected 1 spaces after parameter type; 4 found
+ |   | (MediaWiki.Commenting.FunctionComment.SpacingAfterParamType)
+  78 | ERROR | [x] Expected 1 spaces after parameter name; 4 found
+ |   | (MediaWiki.Commenting.FunctionComment.SpacingAfterParamName)
   79 | ERROR | [x] Expected 1 spaces before parameter type; 4 found
  |   | 
(MediaWiki.Commenting.FunctionComment.SpacingBeforeParamType)
+  79 | ERROR | [x] Expected 1 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Skin: Make skins aware of their registered skin name

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

Change subject: Skin: Make skins aware of their registered skin name
..

Skin: Make skins aware of their registered skin name

Remove the need for skin classes to have a hardcoded skinname
property value. This creates the possibility for the value
to not match the skinname in the SkinFactory registry, which
creates confusing situations where message keys and load.php
urls are crafted with the internal skinname, but all other
handling (useskin, preferences, hooks, SkinFactory, ResourceLoader,
etc.) operate on the names in the registry.

We could enforce the matching by requiring a 1:1 relationship between
skinnames and Skin sub classes, but that is not backwards-compatible
with the 1:many map that wgValidSkinNames provides, and not compatible
SkinFactory either, which supports a factory function to return an
object. This makes a lot of sense and allows Skin-classees to be
re-used and composed with injection. If we do want to enforce 1:1,
we could validate it with a structure PHPUnit test, but instead,
I'm recommending with this change that we instead inject the
self-name through a setter-method (similar to how ResourceLoader
does with ResourceLoaderModule::setName).

The added unit test shows the new behaviour. Before this change,
getSkinName() on SkinFallback would always return 'fallback',
whereas now each instance of the class adheres to the registered
name (if it differs from the default).

Update the two direct uses of protected $skin->skinname to use
$skin->getSkinName() instead to enable sub-classes to optionally
implement an alternate source for the self-name (or to hardcode
it there as before).

Change-Id: I4383dcc3094da6e3c9ac12dc6c9311128db9db6e
---
M includes/skins/Skin.php
M includes/skins/SkinFactory.php
M includes/skins/SkinTemplate.php
M tests/phpunit/includes/skins/SkinFactoryTest.php
4 files changed, 11 insertions(+), 2 deletions(-)


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

diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php
index e1d0034..0efd9cf 100644
--- a/includes/skins/Skin.php
+++ b/includes/skins/Skin.php
@@ -141,6 +141,13 @@
}
 
/**
+* @param string Skin name
+*/
+   public function setSkinName( $skinname ) {
+   $this->skinname = $skinname;
+   }
+
+   /**
 * @param OutputPage $out
 */
public function initPage( OutputPage $out ) {
diff --git a/includes/skins/SkinFactory.php b/includes/skins/SkinFactory.php
index cc993aa..e6536c1 100644
--- a/includes/skins/SkinFactory.php
+++ b/includes/skins/SkinFactory.php
@@ -95,6 +95,7 @@
}
$skin = call_user_func( $this->factoryFunctions[$name], $name );
if ( $skin instanceof Skin ) {
+   $skin->setSkinName( $name );
return $skin;
} else {
throw new UnexpectedValueException( "The builder for 
$name returned a non-Skin object." );
diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index 180a6df..ef57707 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -345,7 +345,7 @@
$tpl->set( 'jsmimetype', $wgJsMimeType );
$tpl->set( 'charset', 'UTF-8' );
$tpl->set( 'wgScript', $wgScript );
-   $tpl->set( 'skinname', $this->skinname );
+   $tpl->set( 'skinname', $this->getSkinName() );
$tpl->set( 'skinclass', static::class );
$tpl->set( 'skin', $this );
$tpl->set( 'stylename', $this->stylename );
@@ -902,7 +902,7 @@
$talkId = "{$subjectId}_talk";
}
 
-   $skname = $this->skinname;
+   $skname = $this->getSkinName();
 
// Adds namespace links
$subjectMsg = [ "nstab-$subjectId" ];
diff --git a/tests/phpunit/includes/skins/SkinFactoryTest.php 
b/tests/phpunit/includes/skins/SkinFactoryTest.php
index d3663c8..c63a7c0 100644
--- a/tests/phpunit/includes/skins/SkinFactoryTest.php
+++ b/tests/phpunit/includes/skins/SkinFactoryTest.php
@@ -48,6 +48,7 @@
$skin = $factory->makeSkin( 'testfallback' );
$this->assertInstanceOf( 'Skin', $skin );
$this->assertInstanceOf( 'SkinFallback', $skin );
+   $this->assertEquals( 'testfallback', $skin->getSkinName() );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4383dcc3094da6e3c9ac12dc6c9311128db9db6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master

[MediaWiki-commits] [Gerrit] mediawiki...SendGrid[master]: Remove unused package from SendGrid extension

2017-08-25 Thread Rosalieper (Code Review)
Rosalieper has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373970 )

Change subject: Remove unused package from SendGrid extension
..

Remove unused package from SendGrid extension

Remove unused package / dependency

Bug:T174209
Change-Id: If763bdd8a13d38aa89ec593b225b17d22d91a442
---
M composer.json
1 file changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/composer.json b/composer.json
index bda334e..ed04a14 100644
--- a/composer.json
+++ b/composer.json
@@ -7,8 +7,7 @@
 },
 "require-dev": {
 "phpunit/phpunit": "4.*",
-"squizlabs/php_codesniffer": "2.*",
-"jakub-onderka/php-console-highlighter": "0.3.2"
+"squizlabs/php_codesniffer": "2.*"
 },
 "scripts": {
 "test": [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If763bdd8a13d38aa89ec593b225b17d22d91a442
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SendGrid
Gerrit-Branch: master
Gerrit-Owner: Rosalieper 

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


[MediaWiki-commits] [Gerrit] mediawiki...ArticleCreationWorkflow[master]: Add config.txt mentioned in extension.json

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

Change subject: Add config.txt mentioned in extension.json
..


Add config.txt mentioned in extension.json

Was completely forgotten!

Bug: T173619
Change-Id: Iff83d4a1919b19b75c4ca7241aa5201b8f7f390c
---
A doc/config.txt
1 file changed, 29 insertions(+), 0 deletions(-)

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



diff --git a/doc/config.txt b/doc/config.txt
new file mode 100644
index 000..e5370ff
--- /dev/null
+++ b/doc/config.txt
@@ -0,0 +1,29 @@
+== $wgArticleCreationWorkflows ==
+
+Lists conditions when attempts to create a page should be redirected to
+Special:CreatePage. Any condition matching is enough to redirect.
+
+Format:
+[
+   condition 1,
+   condition 2,
+   . . .
+]
+
+Condition format:
+[
+   'namespaces' => [ namespace 1, namespace 2, ... ],
+   'excludeRight' => 'some right',
+]
+
+* 'namespaces' (required) - namespaces you want to redirect from.
+* 'excludeRight' (optional) - don't redirect users with this right.
+
+Example configuration:
+
+   $wgArticleCreationWorkflows = [
+   [
+   'namespaces' => [ NS_MAIN ],
+   'excludeRight' => 'autoconfirmed',
+   ],
+   ];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff83d4a1919b19b75c4ca7241aa5201b8f7f390c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleCreationWorkflow
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Kaldari 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageAssessments[master]: PageAssessments has Invalid composer.json

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

Change subject: PageAssessments has Invalid composer.json
..


PageAssessments has Invalid composer.json

Added license to composer.json.

Bug: T167329
Change-Id: I66d53a6d001c3a11ed8526dbd494b9ab67d8c733
---
M composer.json
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/composer.json b/composer.json
index 747582d..32b5280 100644
--- a/composer.json
+++ b/composer.json
@@ -2,6 +2,7 @@
"name": "mediawiki/page-assessments",
"type": "mediawiki-extension",
"description": "This extension adds a parser function which can be used 
for storing article assessments in a database table.",
+   "license": "GPL-2.0+",
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"mediawiki/mediawiki-codesniffer": "0.11.0",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I66d53a6d001c3a11ed8526dbd494b9ab67d8c733
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/PageAssessments
Gerrit-Branch: master
Gerrit-Owner: Rosalieper 
Gerrit-Reviewer: D3r1ck01 
Gerrit-Reviewer: Dbarratt 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Niharika29 
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...Cargo[master]: Perform true "drilldown" in the applied filter line for hier...

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

Change subject: Perform true "drilldown" in the applied filter line for 
hierarchy field
..


Perform true "drilldown" in the applied filter line for hierarchy field

Change-Id: I4eff3f1660538cb75930123543940192e62b24ba
---
M drilldown/CargoDrilldownHierarchy.php
M drilldown/CargoFilter.php
M drilldown/CargoSpecialDrilldown.php
3 files changed, 77 insertions(+), 13 deletions(-)

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



diff --git a/drilldown/CargoDrilldownHierarchy.php 
b/drilldown/CargoDrilldownHierarchy.php
index 07f889b..9eba211 100644
--- a/drilldown/CargoDrilldownHierarchy.php
+++ b/drilldown/CargoDrilldownHierarchy.php
@@ -16,9 +16,13 @@
if ( $f->fieldDescription->mIsList ) {
$countArg = "_rowID";
$fieldTableName = $f->tableName . '__' . $f->name;
-   $tableNames[] = $fieldTableName;
+   if ( !in_array( $fieldTableName, $tableNames ) ) {
+   $tableNames[] = $fieldTableName;
+   }
$fieldName = '_value';
-   $joinConds[$fieldTableName] = 
CargoUtils::joinOfMainAndFieldTable( $cdb, $f->tableName, $fieldTableName );
+   if ( !array_key_exists( $fieldTableName, $joinConds ) ) 
{
+   $joinConds[$fieldTableName] = 
CargoUtils::joinOfMainAndFieldTable( $cdb, $f->tableName, $fieldTableName );
+   }
} else {
$countArg = "_ID";
$fieldName = $f->name;
@@ -28,17 +32,19 @@
$countClause = "COUNT(DISTINCT($countArg)) AS total";
 
$hierarchyTableName = $f->tableName . '__' . $f->name . 
'__hierarchy';
-   $tableNames[] = $hierarchyTableName;
+   if ( !in_array( $hierarchyTableName, $tableNames ) ) {
+   $tableNames[] = $hierarchyTableName;
+   }
 
-   $joinConds[$hierarchyTableName] = 
CargoUtils::joinOfSingleFieldAndHierarchyTable( $cdb,
-   $fieldTableName, $fieldName, $hierarchyTableName );
-
+   if ( !array_key_exists( $hierarchyTableName, $joinConds ) ) {
+   $joinConds[$hierarchyTableName] = 
CargoUtils::joinOfSingleFieldAndHierarchyTable( $cdb,
+   $fieldTableName, $fieldName, 
$hierarchyTableName );
+   }
$withinTreeHierarchyConds = array();
$exactRootHierarchyConds = array();
$withinTreeHierarchyConds[] = "_left >= $node->mLeft";
$withinTreeHierarchyConds[] = "_right <= $node->mRight";
$exactRootHierarchyConds[] = "_left = $node->mLeft";
-
// within hierarchy tree value count
$res = $cdb->select( $tableNames, array( $countClause ), 
array_merge( $conds, $withinTreeHierarchyConds ),
null, null, $joinConds );
diff --git a/drilldown/CargoFilter.php b/drilldown/CargoFilter.php
index 14cf062..760dc89 100644
--- a/drilldown/CargoFilter.php
+++ b/drilldown/CargoFilter.php
@@ -113,10 +113,19 @@
 
foreach ( $appliedFilters as $af ) {
$conds[] = $af->checkSQL();
+   $fieldTableName = $this->tableName;
+   $columnName = $af->filter->name;
if ( $af->filter->fieldDescription->mIsList ) {
$fieldTableName = $this->tableName . '__' . 
$af->filter->name;
$tableNames[] = $fieldTableName;
$joinConds[$fieldTableName] = 
CargoUtils::joinOfMainAndFieldTable( $cdb, $this->tableName, $fieldTableName );
+   $columnName = '_value';
+   }
+   if ( $af->filter->fieldDescription->mIsHierarchy ) {
+   $hierarchyTableName = $this->tableName . '__' . 
$af->filter->name . '__hierarchy';
+   $tableNames[] = $hierarchyTableName;
+   $joinConds[$hierarchyTableName] = 
CargoUtils::joinOfSingleFieldAndHierarchyTable( $cdb,
+   $fieldTableName, $columnName, 
$hierarchyTableName );
}
}
return array( $tableNames, $conds, $joinConds );
diff --git a/drilldown/CargoSpecialDrilldown.php 
b/drilldown/CargoSpecialDrilldown.php
index f7ff850..414c940 100644
--- a/drilldown/CargoSpecialDrilldown.php
+++ b/drilldown/CargoSpecialDrilldown.php
@@ -413,6 +413,9 @@
 * at least one value set
 */
function printAppliedFilterLine( $af ) {
+   if 

[MediaWiki-commits] [Gerrit] wikimedia/portals[master]: Fix typeahead on first character

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

Change subject: Fix typeahead on first character
..


Fix typeahead on first character

Fixes the typeahead on the search input when
entering the first character of a search query.

Bug: T173885
Change-Id: I7a2ca6e6fd702546dbdb54c28b68bd6f43a9b8cf
---
M dev/wikipedia.org/assets/js/wm-typeahead.js
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/dev/wikipedia.org/assets/js/wm-typeahead.js 
b/dev/wikipedia.org/assets/js/wm-typeahead.js
index 7eaf9d7..e69f6f0 100644
--- a/dev/wikipedia.org/assets/js/wm-typeahead.js
+++ b/dev/wikipedia.org/assets/js/wm-typeahead.js
@@ -156,7 +156,7 @@
function loadQueryScript( string, lang ) {
var script = document.getElementById( 'api_opensearch' ),
docHead = document.getElementsByTagName( 'head' )[ 0 ],
-   hostname = '//' + searchLang + 
'.wikipedia.org/w/api.php?',
+   hostname,
callbackIndex,
searchQuery;
 
@@ -168,6 +168,8 @@
return;
}
 
+   hostname = '//' + searchLang + '.wikipedia.org/w/api.php?';
+
// If script already exists, remove it.
if ( script ) {
docHead.removeChild( script );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a2ca6e6fd702546dbdb54c28b68bd6f43a9b8cf
Gerrit-PatchSet: 2
Gerrit-Project: wikimedia/portals
Gerrit-Branch: master
Gerrit-Owner: Jdrewniak 
Gerrit-Reviewer: Jdrewniak 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Mxn 
Gerrit-Reviewer: VolkerE 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Check for unneeded punctation in @param and @return

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

Change subject: Check for unneeded punctation in @param and @return
..

Check for unneeded punctation in @param and @return

After a return type there should be no colon or other punctation.
The same is for the variable name after @param.

Change-Id: Ie555ec1c0648fe09990c403853ea9548a4919531
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
M MediaWiki/Tests/files/Commenting/commenting_function.php
M MediaWiki/Tests/files/Commenting/commenting_function.php.expect
M MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
4 files changed, 68 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/69/373969/1

diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index 51b9345..2be52b7 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -226,8 +226,24 @@
}
// The first word of the return type is the actual type
$exploded = explode( ' ', $content, 2 );
-   $explodedType = explode( '|', $exploded[0] );
+   $type = $exploded[0];
$fixType = false;
+   // Check for unneeded punctation
+   $matches = [];
+   if ( preg_match( '/^(.*)(\p{P}+)$/', $type, $matches ) 
) {
+   $fix = $phpcsFile->addFixableError(
+   'Return type should not end with 
punctuation "%s"',
+   $retType,
+   'NotPunctuationReturn',
+   [ $matches[2] ]
+   );
+   $type = $matches[1];
+   if ( $fix ) {
+   $fixType = true;
+   }
+   }
+   // Check the type
+   $explodedType = explode( '|', $type );
foreach ( $explodedType as $index => $type ) {
if ( $type === 'boolean' ) {
$fix = $phpcsFile->addFixableError(
@@ -401,7 +417,6 @@
if ( $param['var'] === '' ) {
continue;
}
-   $foundParams[] = $param['var'];
// Check number of spaces before type (after @param)
$spaces = 1;
if ( $param['param_space'] !== $spaces ) {
@@ -433,28 +448,48 @@
);
}
}
+   $var = $param['var'];
+   // Check for unneeded punctation
+   $matches = [];
+   if ( preg_match( '/^(.*?)(\p{P}+)(?addFixableError(
+   'Param name should not end with 
punctuation "%s"',
+   $param['tag'],
+   'NotPunctuationParam',
+   [ $matches[2] ]
+   );
+   $var = $matches[1];
+   if ( $fix ) {
+   $this->replaceParamComment(
+   $phpcsFile,
+   $param,
+   [ 'var' => $var ]
+   );
+   }
+   }
// Make sure the param name is correct.
if ( isset( $realParams[$pos] ) === true ) {
$realName = $realParams[$pos]['name'];
-   if ( $realName !== $param['var'] ) {
+   if ( $realName !== $var ) {
$code = 'ParamNameNoMatch';
$data = [
-   $param['var'],
+   $var,
$realName,
];
$error = 'Doc comment for parameter %s 
does not match ';
-   if ( strtolower( $param['var'] ) === 
strtolower( $realName ) ) {
+   if ( strtolower( $var ) === strtolower( 
$realName ) ) {
  

[MediaWiki-commits] [Gerrit] mediawiki...ArticleCreationWorkflow[master]: Add config.txt mentioned in extension.json

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

Change subject: Add config.txt mentioned in extension.json
..

Add config.txt mentioned in extension.json

Was completely forgotten!

Bug: T173619
Change-Id: Iff83d4a1919b19b75c4ca7241aa5201b8f7f390c
---
A doc/config.txt
1 file changed, 29 insertions(+), 0 deletions(-)


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

diff --git a/doc/config.txt b/doc/config.txt
new file mode 100644
index 000..e5370ff
--- /dev/null
+++ b/doc/config.txt
@@ -0,0 +1,29 @@
+== $wgArticleCreationWorkflows ==
+
+Lists conditions when attempts to create a page should be redirected to
+Special:CreatePage. Any condition matching is enough to redirect.
+
+Format:
+[
+   condition 1,
+   condition 2,
+   . . .
+]
+
+Condition format:
+[
+   'namespaces' => [ namespace 1, namespace 2, ... ],
+   'excludeRight' => 'some right',
+]
+
+* 'namespaces' (required) - namespaces you want to redirect from.
+* 'excludeRight' (optional) - don't redirect users with this right.
+
+Example configuration:
+
+   $wgArticleCreationWorkflows = [
+   [
+   'namespaces' => [ NS_MAIN ],
+   'excludeRight' => 'autoconfirmed',
+   ],
+   ];

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

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

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


[MediaWiki-commits] [Gerrit] analytics/wikimetrics[master]: Clear connections between report executions

2017-08-25 Thread Mforns (Code Review)
Mforns has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373967 )

Change subject: Clear connections between report executions
..

Clear connections between report executions

The max connections per user in labsdb databases is 10 for the
Wikimetrics user. This prevents some centralauth-expanded cohorts
to be executed. Because Wikimetrics tries to connect to each
database with a different connection to the same host.

This patch clears the connections after each report node has finished
executing. This allows report on 'wide' centralauth-expanded cohorts
to be run.

This is not the ideal behavior of Wikimetrics database connections.
However, given that the report tree is already executed sequentially,
the connections do not need to last for longer.

Bug: T173585
Change-Id: I69d38cab9103e2a69f070471a0af662829a66eba
---
M wikimetrics/models/report_nodes/report.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikimetrics 
refs/changes/67/373967/1

diff --git a/wikimetrics/models/report_nodes/report.py 
b/wikimetrics/models/report_nodes/report.py
index 10c709e..03f9802 100644
--- a/wikimetrics/models/report_nodes/report.py
+++ b/wikimetrics/models/report_nodes/report.py
@@ -170,7 +170,11 @@
 results = []
 if self.children:
 try:
-child_results = [child.run() for child in self.children]
+child_results = []
+for child in self.children:
+child_results.append(child.run())
+for project, session in db.mediawiki_sessions.items():
+session.remove()
 results = self.finish(child_results)
 except SoftTimeLimitExceeded:
 self.set_status(celery.states.FAILURE)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I69d38cab9103e2a69f070471a0af662829a66eba
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikimetrics
Gerrit-Branch: master
Gerrit-Owner: Mforns 

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


[MediaWiki-commits] [Gerrit] mediawiki...LoginNotify[master]: Lazy initialize salt

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

Change subject: Lazy initialize salt
..

Lazy initialize salt

No need to get into cryptography when the salt is needed at most in 50% of
cases.

Change-Id: I3efd7332970005fdd32e47c6177e2e62e2f94a5c
---
M includes/LoginNotify.php
1 file changed, 17 insertions(+), 5 deletions(-)


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

diff --git a/includes/LoginNotify.php b/includes/LoginNotify.php
index aa59964..9994d75 100644
--- a/includes/LoginNotify.php
+++ b/includes/LoginNotify.php
@@ -53,8 +53,8 @@
private $config;
/** @var LoggerInterface Usually instance of LoginNotify log */
private $log;
-   /** @var string|bool Salt for cookie hash */
-   private $gSalt;
+   /** @var string Salt for cookie hash. DON'T USE DIRECTLY, use getSalt() 
*/
+   private $salt;
/** @var string */
private $secret;
/** @var IBufferingStatsdDataFactory */
@@ -75,8 +75,6 @@
}
$this->cache = $cache;
$this->config = $cfg;
-   // Generate salt just once to avoid duplicate cookies
-   $this->gSalt = \Wikimedia\base_convert( 
MWCryptRand::generateHex( 8 ), 16, 36 );
 
if ( $this->config->get( 'LoginNotifySecretKey' ) !== null ) {
$this->secret = $this->config->get( 
'LoginNotifySecretKey' );
@@ -123,6 +121,20 @@
throw new Exception( __METHOD__ . " Regex failed on 
'$ip'!?" );
}
return $prefix;
+   }
+
+   /**
+* Returns lazy-initialized salt
+*
+* @return string
+*/
+   private function getSalt() {
+   // Generate salt just once to avoid duplicate cookies
+   if ( $this->salt === null ) {
+   $this->salt = \Wikimedia\base_convert( 
MWCryptRand::generateHex( 8 ), 16, 36 );
+   }
+
+   return $this->salt;
}
 
/**
@@ -607,7 +619,7 @@
}
 
if ( $salt === false ) {
-   $salt = $this->gSalt;
+   $salt = $this->getSalt();
}
 
// FIXME Maybe shorten, e.g. User only half the hash?

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...SendGrid[master]: Add @link to point to extension documentation

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

Change subject: Add @link to point to extension documentation
..


Add @link to point to extension documentation

Added the link to the documentation of the extension
in the codes.

Change-Id: I7abf43c941787b1106eaf1808cf756b680515d8d
---
M SendGridHooks.php
1 file changed, 2 insertions(+), 0 deletions(-)

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



diff --git a/SendGridHooks.php b/SendGridHooks.php
index 312c6b6..1b3947a 100644
--- a/SendGridHooks.php
+++ b/SendGridHooks.php
@@ -20,6 +20,8 @@
  * @file
  * @author Alangi Derick 
  * @license GPL-2.0+
+ *
+ * @link https://www.mediawiki.org/wiki/Extension:SendGrid Documentation
  * @ingroup Extensions
 */
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7abf43c941787b1106eaf1808cf756b680515d8d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SendGrid
Gerrit-Branch: master
Gerrit-Owner: D3r1ck01 
Gerrit-Reviewer: D3r1ck01 

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


[MediaWiki-commits] [Gerrit] mediawiki...SendGrid[master]: Add @link to point to extension documentation

2017-08-25 Thread D3r1ck01 (Code Review)
D3r1ck01 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373965 )

Change subject: Add @link to point to extension documentation
..

Add @link to point to extension documentation

Added the link to the documentation of the extension
in the codes.

Change-Id: I7abf43c941787b1106eaf1808cf756b680515d8d
---
M SendGridHooks.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SendGrid 
refs/changes/65/373965/1

diff --git a/SendGridHooks.php b/SendGridHooks.php
index 312c6b6..1b3947a 100644
--- a/SendGridHooks.php
+++ b/SendGridHooks.php
@@ -20,6 +20,8 @@
  * @file
  * @author Alangi Derick 
  * @license GPL-2.0+
+ *
+ * @link https://www.mediawiki.org/wiki/Extension:SendGrid Documentation
  * @ingroup Extensions
 */
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7abf43c941787b1106eaf1808cf756b680515d8d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SendGrid
Gerrit-Branch: master
Gerrit-Owner: D3r1ck01 

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


[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Title::getSquidURLs() is deprecated

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

Change subject: Title::getSquidURLs() is deprecated
..

Title::getSquidURLs() is deprecated

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


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

diff --git a/Hooks.php b/Hooks.php
index c1b7529..c08af51 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -1337,7 +1337,7 @@
}
$urls = array_merge(
$urls,
-   $workflow->getOwnerTitle()->getSquidURLs()
+   $workflow->getOwnerTitle()->getCdnUrls()
);
 
return true;

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...golden[master]: Breakdown search API requests by referer class and use GetSe...

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

Change subject: Breakdown search API requests by referer class and use 
GetSearchRequestTypeUDF
..


Breakdown search API requests by referer class and use GetSearchRequestTypeUDF

Please do not merge this patch since the new UDF hasn’t been released to 
production.

Bug: T172452
Change-Id: Ia4aa5260fe243abeced91c67de8f44bdc9be859b
---
M modules/metrics/search/search_api_usage
1 file changed, 4 insertions(+), 3 deletions(-)

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



diff --git a/modules/metrics/search/search_api_usage 
b/modules/metrics/search/search_api_usage
index a0b1b7c..f9de476 100755
--- a/modules/metrics/search/search_api_usage
+++ b/modules/metrics/search/search_api_usage
@@ -1,11 +1,12 @@
 #!/bin/bash
 
 hive -S -e "ADD JAR hdfs:///wmf/refinery/current/artifacts/refinery-hive.jar;
-CREATE TEMPORARY FUNCTION search_classify AS 
'org.wikimedia.analytics.refinery.hive.SearchClassifierUDF';
+CREATE TEMPORARY FUNCTION search_classify AS 
'org.wikimedia.analytics.refinery.hive.GetSearchRequestTypeUDF';
 USE wmf;
 SELECT
   '$1' AS date,
   search_classify(uri_path, uri_query) AS api,
+  referer_class,
   COUNT(*) AS calls
 FROM webrequest
 WHERE
@@ -13,6 +14,6 @@
   AND CONCAT(year, '-', LPAD(month, 2, '0'), '-', LPAD(day, 2, '0')) >= '$1'
   AND CONCAT(year, '-', LPAD(month, 2, '0'), '-', LPAD(day, 2, '0')) < '$2'
   AND http_status = '200'
-  AND search_classify(uri_path, uri_query) IN('language', 'cirrus', 'prefix', 
'geo', 'open')
-GROUP BY '$1', search_classify(uri_path, uri_query);
+  AND search_classify(uri_path, uri_query) IN('language', 'cirrus', 'cirrus 
(more like)', 'prefix', 'geo', 'open')
+GROUP BY '$1', search_classify(uri_path, uri_query), referer_class;
 " 2> /dev/null | grep -v parquet.hadoop | grep -v WARN:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia4aa5260fe243abeced91c67de8f44bdc9be859b
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/discovery/golden
Gerrit-Branch: master
Gerrit-Owner: Chelsyx 
Gerrit-Reviewer: Bearloga 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix error text color in dark mode

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

Change subject: Fix error text color in dark mode
..


Fix error text color in dark mode

In this update
 - Add Red75-Sunset Red to colors.xml
 - Add two "textColorError" items for light mode and dark mode theme

Bug: T173091
Change-Id: I3d5030f4fe173e0e50904a5ec771e876082a5e57
---
M app/src/main/res/values/colors.xml
M app/src/main/res/values/styles.xml
M app/src/main/res/values/styles_dark.xml
M app/src/main/res/values/styles_light.xml
4 files changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/app/src/main/res/values/colors.xml 
b/app/src/main/res/values/colors.xml
index 07b569f..9072c79 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -22,6 +22,7 @@
 #2a4b8d 
 #223966
 #fee7e6 
+#FF6E6E 
 #d33 
 #b32424 
 
diff --git a/app/src/main/res/values/styles.xml 
b/app/src/main/res/values/styles.xml
index fa75205..769a58f 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -255,4 +255,5 @@
 @dimen/popup_menu_drop_down_horizontal_offset
 @dimen/popup_menu_drop_down_vertical_offset
 
+
 
diff --git a/app/src/main/res/values/styles_dark.xml 
b/app/src/main/res/values/styles_dark.xml
index c519670..2b1906b 100644
--- a/app/src/main/res/values/styles_dark.xml
+++ b/app/src/main/res/values/styles_dark.xml
@@ -15,6 +15,7 @@
 
 

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Use Function.bind in favor of $.proxy

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

Change subject: Use Function.bind in favor of $.proxy
..

Use Function.bind in favor of $.proxy

\$\.proxy\( ([^\,]*)\, \'([^\)\,\']*)\'? \)
is replaced with
$1.$2.bind( $1 )

There is one remaining usage left in View, which is
fine, given View's heavy dependency on jQuery

Bug: T173981
Change-Id: I2508cda296ee66136156799182a60dbcb0fe885f
---
M resources/mobile.categories.overlays/CategoryOverlay.js
M resources/mobile.editor.api/EditorGateway.js
M resources/mobile.gallery/PhotoList.js
M resources/mobile.gallery/PhotoListGateway.js
M resources/mobile.infiniteScroll/InfiniteScroll.js
M resources/mobile.mediaViewer/ImageOverlay.js
M resources/mobile.pagelist.scripts/WatchstarPageList.js
M resources/mobile.pointerOverlay/PointerOverlay.js
M resources/mobile.references/ReferencesDrawer.js
M resources/mobile.special.mobileoptions.scripts/mobileoptions.js
M resources/mobile.startup/Drawer.js
M resources/mobile.startup/Overlay.js
M resources/mobile.startup/OverlayManager.js
M resources/mobile.startup/PageGateway.js
M resources/mobile.startup/Skin.js
M resources/mobile.startup/View.js
M resources/mobile.talk.overlays/TalkOverlay.js
M resources/mobile.watchlist/WatchList.js
18 files changed, 49 insertions(+), 39 deletions(-)


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

diff --git a/resources/mobile.categories.overlays/CategoryOverlay.js 
b/resources/mobile.categories.overlays/CategoryOverlay.js
index 85a0325..19715a7 100644
--- a/resources/mobile.categories.overlays/CategoryOverlay.js
+++ b/resources/mobile.categories.overlays/CategoryOverlay.js
@@ -15,7 +15,7 @@
 */
function CategoryOverlay( options ) {
this.infiniteScroll = new InfiniteScroll();
-   this.infiniteScroll.on( 'load', $.proxy( this, 
'_loadCategories' ) );
+   this.infiniteScroll.on( 'load', this._loadCategories.bind( this 
) );
this.gateway = new CategoryGateway( options.api );
Overlay.apply( this, arguments );
}
@@ -70,7 +70,7 @@
if ( !this.options.items ) {
this._loadCategories();
}
-   M.off( 'category-added' ).on( 'category-added', 
$.proxy( this, '_loadCategories' ) );
+   M.off( 'category-added' ).on( 'category-added', 
this._loadCategories.bind( this ) );
},
 
/**
diff --git a/resources/mobile.editor.api/EditorGateway.js 
b/resources/mobile.editor.api/EditorGateway.js
index 40f73fe..fb0fb8a 100644
--- a/resources/mobile.editor.api/EditorGateway.js
+++ b/resources/mobile.editor.api/EditorGateway.js
@@ -213,10 +213,12 @@
details: 'unknown'
} );
}
-   } ).fail( $.proxy( result, 'reject', {
-   type: 'error',
-   details: 'http'
-   } ) );
+   } ).fail( function () {
+   result.reject( {
+   type: 'error',
+   details: 'http'
+   } );
+   } );
}
 
saveContent();
@@ -271,7 +273,7 @@
} else {
result.reject();
}
-   } ).fail( $.proxy( result, 'reject' ) );
+   } ).fail( result.reject.bind( result ) );
 
return result;
}
diff --git a/resources/mobile.gallery/PhotoList.js 
b/resources/mobile.gallery/PhotoList.js
index 5e7cdcc..3305795 100644
--- a/resources/mobile.gallery/PhotoList.js
+++ b/resources/mobile.gallery/PhotoList.js
@@ -29,7 +29,7 @@
this.gateway = new PhotoListGateway( gatewayOptions );
// Set up infinite scroll
this.infiniteScroll = new InfiniteScroll( 1000 );
-   this.infiniteScroll.on( 'load', $.proxy( this, '_loadPhotos' ) 
);
+   this.infiniteScroll.on( 'load', this._loadPhotos.bind( this ) );
View.call( this, options );
}
 
diff --git a/resources/mobile.gallery/PhotoListGateway.js 
b/resources/mobile.gallery/PhotoListGateway.js
index 9b316ed..9809cd6 100644
--- a/resources/mobile.gallery/PhotoListGateway.js
+++ b/resources/mobile.gallery/PhotoListGateway.js
@@ -129,7 +129,7 @@
} else {
  

[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Control use of $.Deferred

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

Change subject: Control use of $.Deferred
..

Control use of $.Deferred

Avoid using $.Deferred unless truly necessary.
We have a tendency to create $.Deferred rather than returning
the results of things which already return $.Deferred

For cases where we need to resolve something without doing
an already async event (e.g. ajax call) we will use a base
class Gateway - that has 2 methods - resolve and reject.

TODO:
* Test!!!

Change-Id: Ibf8bbc54a3d0a2500a827c1f942bb0e5dfc095e0
---
M extension.json
M resources/mobile.editor.api/EditorGateway.js
M resources/mobile.gallery/PhotoListGateway.js
M resources/mobile.mediaViewer/ImageGateway.js
M resources/mobile.nearby/Nearby.js
M resources/mobile.nearby/NearbyGateway.js
M resources/mobile.references.gateway/ReferencesGateway.js
M resources/mobile.references.gateway/ReferencesHtmlScraperGateway.js
M resources/mobile.references.gateway/ReferencesMobileViewGateway.js
M resources/mobile.search.api/SearchGateway.js
A resources/mobile.startup/Gateway.js
M resources/mobile.startup/PageGateway.js
M resources/mobile.talk.overlays/TalkSectionAddOverlay.js
M resources/mobile.watchlist/WatchListGateway.js
M resources/mobile.watchstar/WatchstarGateway.js
15 files changed, 151 insertions(+), 149 deletions(-)


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

diff --git a/extension.json b/extension.json
index 585f996..c106dd8 100644
--- a/extension.json
+++ b/extension.json
@@ -358,6 +358,7 @@
"resources/mobile.startup/context.js",
"resources/mobile.startup/user.js",
"resources/mobile.startup/util.js",
+   "resources/mobile.startup/Gateway.js",
"resources/mobile.startup/PageGateway.js",
"resources/mobile.startup/Anchor.js",
"resources/mobile.startup/Button.js",
diff --git a/resources/mobile.editor.api/EditorGateway.js 
b/resources/mobile.editor.api/EditorGateway.js
index fb0fb8a..01a93b6 100644
--- a/resources/mobile.editor.api/EditorGateway.js
+++ b/resources/mobile.editor.api/EditorGateway.js
@@ -1,4 +1,6 @@
 ( function ( M, $ ) {
+   var Gateway = M.require( 'mobile.startup/Gateway' );
+
/**
 * API that helps save and retrieve page content
 * @class EditorGateway
@@ -21,7 +23,7 @@
this.hasChanged = false;
}
 
-   EditorGateway.prototype = {
+   OO.mfExtend( EditorGateway, Gateway, {
/**
 * Get the content of a page.
 * @method
@@ -29,11 +31,10 @@
 */
getContent: function () {
var options,
-   self = this,
-   result = $.Deferred();
+   self = this;
 
if ( this.content !== undefined ) {
-   result.resolve( this.content );
+   return this.resolve( this.content );
} else {
options = {
action: 'query',
@@ -53,12 +54,11 @@
if ( $.isNumeric( this.sectionId ) ) {
options.rvsection = this.sectionId;
}
-   this.api.get( options ).done( function ( resp ) 
{
+   return this.api.get( options ).done( function ( 
resp ) {
var revision, pageObj;
 
if ( resp.error ) {
-   result.reject( resp.error.code 
);
-   return;
+   throw new Error( 
resp.error.code );
}
 
pageObj = resp.query.pages[0];
@@ -73,11 +73,9 @@
// save content a second time to be 
able to check for changes
self.originalContent = self.content;
 
-   result.resolve( self.content, 
resp.query.userinfo );
+   return [ self.content, 
resp.query.userinfo ];
} );
}
-
-   return result;
},
 
/**
@@ -120,14 +118,14 @@
 * of error, `details` can be any object (usually error 
message).
 */
save: function ( options ) {
-   

[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: remove duplicate key in RWStore props

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

Change subject: remove duplicate key in RWStore props
..


remove duplicate key in RWStore props

Change-Id: I4f5a581a497f846e2addb492dcafb5a19e0ef83e
---
M dist/src/script/RWStore.properties
1 file changed, 0 insertions(+), 2 deletions(-)

Approvals:
  Smalyshev: Verified; Looks good to me, approved
  Lucas Werkmeister (WMDE): Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/dist/src/script/RWStore.properties 
b/dist/src/script/RWStore.properties
index 2a44870..c76cde1 100644
--- a/dist/src/script/RWStore.properties
+++ b/dist/src/script/RWStore.properties
@@ -2,8 +2,6 @@
 com.bigdata.journal.AbstractJournal.file=wikidata.jnl
 com.bigdata.journal.AbstractJournal.bufferMode=DiskRW
 com.bigdata.service.AbstractTransactionService.minReleaseAge=1
-com.bigdata.btree.writeRetentionQueue.capacity=4000
-com.bigdata.btree.BTree.branchingFactor=128
 
 com.bigdata.rdf.store.AbstractTripleStore.quads=false
 com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers=false

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4f5a581a497f846e2addb492dcafb5a19e0ef83e
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/rdf
Gerrit-Branch: master
Gerrit-Owner: Yurik 
Gerrit-Reviewer: Lucas Werkmeister (WMDE) 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Tag refunds and chargebacks with correct paypal gateway

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

Change subject: Tag refunds and chargebacks with correct paypal gateway
..


Tag refunds and chargebacks with correct paypal gateway

Wow, these are crappy ways to tell the difference! Really should have
put the gateway code in one of those tracking fields.

Bug: T171351
Change-Id: I49da156eb72933d44bb299d92072c551c02798ad
---
M PaymentProviders/PayPal/RefundMessage.php
M PaymentProviders/PayPal/Tests/Data/chargeback_settlement.json
A PaymentProviders/PayPal/Tests/Data/chargeback_settlement_ec.json
A PaymentProviders/PayPal/Tests/Data/chargeback_settlement_ec_transformed.json
A PaymentProviders/PayPal/Tests/Data/chargeback_settlement_transformed.json
M PaymentProviders/PayPal/Tests/phpunit/CaptureIncomingMessageTest.php
6 files changed, 79 insertions(+), 28 deletions(-)

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



diff --git a/PaymentProviders/PayPal/RefundMessage.php 
b/PaymentProviders/PayPal/RefundMessage.php
index 98227a6..1520594 100644
--- a/PaymentProviders/PayPal/RefundMessage.php
+++ b/PaymentProviders/PayPal/RefundMessage.php
@@ -7,20 +7,25 @@
public static function normalizeMessage( &$message, $ipnMessage ) {
$message['gateway_refund_id'] = $ipnMessage['txn_id'];
$message['gross_currency'] = $ipnMessage['mc_currency'];
-   if ( isset( $message['type'] ) &&
-   $message['type'] === 'chargeback_settlement' ) {
+   if ( isset( $message['txn_type'] ) && $message['txn_type'] === 
'adjustment' ) {
$message['type'] = 'chargeback';
-   } else {
+
+   // For chargebacks, express checkout sets the 'invoice' 
field
+   if ( isset( $ipnMessage['invoice'] ) ) {
+   $message['gateway'] = 'paypal_ec';
+   } else {
+   $message['gateway'] = 'paypal';
+   }
+   } elseif ( isset( $ipnMessage['reason_code'] ) && 
$ipnMessage['reason_code'] === 'refund' ) {
$message['type'] = 'refund';
-   }
 
-   // Express checkout puts a description in transaction_subject, 
Legacy puts a contribution
-   // tracking ID there. Chargebacks don't set the field at all.
-   if ( isset( $ipnMessage['transaction_subject'] ) && 
!is_numeric( $ipnMessage['transaction_subject'] ) ) {
-   $message['gateway'] = 'paypal_ec';
-   } else {
-   $message['gateway'] = 'paypal';
+   // For refunds, express checkout puts a description in 
transaction_subject,
+   // but legacy puts a contribution tracking ID there.
+   if ( isset( $ipnMessage['transaction_subject'] ) && 
!is_numeric( $ipnMessage['transaction_subject'] ) ) {
+   $message['gateway'] = 'paypal_ec';
+   } else {
+   $message['gateway'] = 'paypal';
+   }
}
-
}
 }
diff --git a/PaymentProviders/PayPal/Tests/Data/chargeback_settlement.json 
b/PaymentProviders/PayPal/Tests/Data/chargeback_settlement.json
index d96bde3..bfdbb40 100644
--- a/PaymentProviders/PayPal/Tests/Data/chargeback_settlement.json
+++ b/PaymentProviders/PayPal/Tests/Data/chargeback_settlement.json
@@ -1,22 +1,18 @@
 {
-   "payment_date": "11:55:22 Sep 28, 2016 PDT",
+   "payment_date": "05:32:08 Jun 30, 2017 PDT",
+   "txn_id": "91N12345TB8654321",
"payment_status": "Completed",
-   "txn_type": "adjustment",
-   "parent_txn_id": "X",
-   "txn_id": "Y",
"mc_currency": "USD",
-   "reason_code": "chargeback_settlement",
-   "email": "a...@wikimedia.org",
-   "mc_gross": "-10.00",
-   "gateway": "paypal",
-   "notify_version": "3.8",
-   "payment_gross": "-10.00",
+   "parent_txn_id": "2JP12345X654321V",
+   "notify_version": 3.8,
+   "custom": 47470083,
+   "txn_type": "adjustment",
+   "charset": "UTF-8",
+   "mc_gross": -1.00,
+   "payment_gross": -1.00,
+   "payer_email": "recipi...@wikimedia.org",
+   "verify_sign": 
"AZfnGop49sf6bIkvk-UIIwAT3vE6AqUlokuReG4Znr85ICxgRDn1rO8s",
+   "payer_id": "AA987ASDFGHUW8",
"payer_status": "verified",
-   "payment_fee": "-20.00",
-   "source_name": "SmashPig",
-   "source_type": "listener",
-   "source_host": "secrethost",
-   "source_run_id": "12423",
-   "source_version": "",
-   "source_enqueued_time": "1476796977"
+   "ipn_track_id": "28eec9b3c7857"
 }
diff --git 

[MediaWiki-commits] [Gerrit] mediawiki...SendGrid[master]: Hook enhancement for clarity

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

Change subject: Hook enhancement for clarity
..


Hook enhancement for clarity

* Changing $sg variable in the Hook file to $sendgrid
  for more clarity of what the object does.

* Adding comment to know where the variable $sendgridAPIKey
  is gotten from in the codes.

* Updates to license in the Hook file.

* Fixes to SendGrid.php for readability

Change-Id: I960ec0a66c14bdcbdbf7e067d327197ba9a3aa1a
---
M SendGrid.php
M SendGridHooks.php
2 files changed, 5 insertions(+), 3 deletions(-)

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



diff --git a/SendGrid.php b/SendGrid.php
index 462dd58..a11fe97 100644
--- a/SendGrid.php
+++ b/SendGrid.php
@@ -1,6 +1,7 @@
 getConfig();
 
+   // Value gotten from "wgSendGridAPIKey" variable from 
LocalSettings.php
$sendgridAPIKey = $conf->get( 'SendGridAPIKey' );
 
if ( $sendgridAPIKey == "" ) {
@@ -58,10 +59,10 @@
$to = new SendGrid\Email( null, $to[0]->address );
$body = new SendGrid\Content( "text/plain", $body );
$mail = new SendGrid\Mail( $from, $subject, $to, $body );
-   $sg = new \SendGrid( $sendgridAPIKey );
+   $sendgrid = new \SendGrid( $sendgridAPIKey );
 
try {
-   $sg->client->mail()->send()->post( $mail );
+   $sendgrid->client->mail()->send()->post( $mail );
} catch ( Exception $e ) {
return $e->getMessage();
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I960ec0a66c14bdcbdbf7e067d327197ba9a3aa1a
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/SendGrid
Gerrit-Branch: master
Gerrit-Owner: D3r1ck01 
Gerrit-Reviewer: D3r1ck01 

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


[MediaWiki-commits] [Gerrit] analytics/aqs[master]: [WIP] Add wikistats endpoint with edits metric

2017-08-25 Thread Joal (Code Review)
Joal has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373961 )

Change subject: [WIP] Add wikistats endpoint with edits metric
..

[WIP] Add wikistats endpoint with edits metric

This endpoint is using druid as a backend.

Bug: T174174
Change-Id: If9923cdbcaf1a3c3293c61f9d74246481d1bab2a
---
M config.example.wikimedia.yaml
M config.test.yaml
M lib/aqsUtil.js
M projects/aqs_default.yaml
A sys/wikistats.js
A sys/wikistats.yaml
A v1/wikistats.yaml
7 files changed, 366 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aqs 
refs/changes/61/373961/1

diff --git a/config.example.wikimedia.yaml b/config.example.wikimedia.yaml
index ee31b22..3415e90 100644
--- a/config.example.wikimedia.yaml
+++ b/config.example.wikimedia.yaml
@@ -13,6 +13,11 @@
 storage_groups:
   - name: default.group.local
 domains: /./
+  druid:
+hosts: [ druid1001.eqiad.wmnet, druid1002.eqiad.wmnet, 
druid1003.eqiad.wmnet ]
+port: 8082
+query_path: /druid/v2/
+datasource: test-wks2-metrics
 
 # Swagger spec root.
 spec: _root
diff --git a/config.test.yaml b/config.test.yaml
index f89f281..80ae22c 100644
--- a/config.test.yaml
+++ b/config.test.yaml
@@ -15,6 +15,11 @@
   - name: test.group.local
 domains: /./
 dbname: test.db.sqlite3 # ignored in cassandra, but useful in 
SQLite testing
+  druid:
+hosts: [ druid1001.eqiad.wmnet, druid1002.eqiad.wmnet, 
druid1003.eqiad.wmnet ]
+port: 8082
+query_path: /druid/v2/
+datasource: test-wks2-metrics
 
 spec_root: _root
   title: "The Analytics Query Service root"
diff --git a/lib/aqsUtil.js b/lib/aqsUtil.js
index 831e439..4a58e6a 100644
--- a/lib/aqsUtil.js
+++ b/lib/aqsUtil.js
@@ -142,6 +142,15 @@
 rp.start += '00';
 rp.end += '00';
 }
+if (opts.isoDateFormat) {
+rp.start = 
aqsUtil.convertTimestampToDate(rp.start).toISOString().slice(0, 10);
+rp.end = aqsUtil.convertTimestampToDate(rp.end).toISOString().slice(0, 
10);
+}
+if (opts.isoDateTimeFormat) {
+rp.start = aqsUtil.convertTimestampToDate(rp.start).toISOString();
+rp.end = aqsUtil.convertTimestampToDate(rp.end).toISOString();
+}
+
 };
 
 aqsUtil.validateYearMonthDay = function(rp) {
@@ -202,4 +211,24 @@
 }
 };
 
+aqsUtil.validateGranularityForDruid = function(rp) {
+var errors = [];
+
+if (rp.granularity) {
+if (rp.granularity === 'daily') {
+rp.granularity = 'day';
+} else if (rp.granularity === 'monthly') {
+rp.granularity = 'month';
+} else if (rp.granularity === 'yearly') {
+rp.granularity = 'year';
+} else {
+errors += 'Granularity should be daily, monthly or yearly';
+}
+} else {
+errors += 'Granularity should be daily, monthly or yearly';
+}
+
+throwIfNeeded(errors);
+};
+
 module.exports = aqsUtil;
diff --git a/projects/aqs_default.yaml b/projects/aqs_default.yaml
index 3445e7d..68d3a8a 100644
--- a/projects/aqs_default.yaml
+++ b/projects/aqs_default.yaml
@@ -19,6 +19,8 @@
 - path: v1/legacy/pagecounts.yaml
   /unique-devices:
 - path: v1/unique-devices.yaml
+  /wikistats:
+- path: v1/wikistats.yaml
 
   /{api:sys}:
 swagger: 2.0
@@ -36,3 +38,7 @@
 - path: sys/legacy/pagecounts.js
   /unique-devices:
 - path: sys/unique-devices.js
+  /wikistats:
+- path: sys/wikistats.js
+  options:
+druid:  '{{options.druid}}'
diff --git a/sys/wikistats.js b/sys/wikistats.js
new file mode 100644
index 000..ae44e86
--- /dev/null
+++ b/sys/wikistats.js
@@ -0,0 +1,150 @@
+'use strict';
+
+/**
+ * Wikistats API module
+ *
+ * This API serves pre-aggregated wikistats metrics from Druid
+ */
+
+var HyperSwitch = require('hyperswitch');
+var path = require('path');
+var URI = HyperSwitch.URI;
+
+var aqsUtil = require('../lib/aqsUtil');
+
+var spec = HyperSwitch.utils.loadSpec(path.join(__dirname, 'wikistats.yaml'));
+
+// Wikistats Service
+function WKSS(options) {
+this.options = options;
+this.druid = options.druid;
+}
+
+var roundRobinHostIndex = 0;
+var requestURI = function(druid) {
+var host = druid.hosts[roundRobinHostIndex % druid.hosts.length];
+roundRobinHostIndex++;
+return 'http://' + host + ':' + druid.port + druid.query_path;
+};
+
+var editorTypeFilters = function(rp) {
+
+if (rp['editor-type'] === 'anonymous') {
+return [
+{ type: 'selector', dimension: 'event_user_is_anonymous', value: 
'1' }
+];
+}
+
+if (rp['editor-type'] === 'group-bot') {
+return [
+{ type: 'selector', dimension: 'event_user_is_anonymous', value: 
'0' },
+{ type: 'selector', dimension: 

[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: removed duplicate xsd: namespace

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

Change subject: removed duplicate xsd: namespace
..


removed duplicate xsd: namespace

Change-Id: I1e92ca233d4a60862dccf7fbb18b15738fbabd58
---
M dist/src/script/ldf-config.json
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/dist/src/script/ldf-config.json b/dist/src/script/ldf-config.json
index 62c72ea..b59801b 100644
--- a/dist/src/script/ldf-config.json
+++ b/dist/src/script/ldf-config.json
@@ -15,7 +15,6 @@
   "prefixes": {
 "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#;,
 "rdfs":"http://www.w3.org/2000/01/rdf-schema#;,
-"xsd": "http://www.w3.org/2001/XMLSchema#;,
 "dc":  "http://purl.org/dc/terms/;,
 "foaf":"http://xmlns.com/foaf/0.1/;,
 "void":"http://rdfs.org/ns/void#;,

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Align SVGs to color palette and optimize

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

Change subject: Align SVGs to color palette and optimize
..

Align SVGs to color palette and optimize

Aligning remaining SVGs to WikimediaUI color palette.
Also:
 - Aligning markup to each other, among others adding XML declaration
   throughout or removing unnecessary `standalone=no` attribute.
 - Optimizing with SVGO without prettified markup. Savings of up to
   17% of file size.

Bug: T146799
Bug: T172850
Change-Id: I54a21932fd5df64b7716ac66a90de5af73776c23
---
M resources/skins.minerva.base.styles/magnifying-glass.svg
M resources/skins.minerva.content.styles/images/external-link-ltr-icon.svg
M resources/skins.minerva.content.styles/images/external-link-rtl-icon.svg
M resources/skins.minerva.icons.images.scripts/userAnonymous.svg
M resources/skins.minerva.icons.images.scripts/userNormal.svg
M resources/skins.minerva.icons.images.scripts/watch.svg
M resources/skins.minerva.icons.images.scripts/watched.svg
M resources/skins.minerva.icons.images.variants/arrow.svg
M resources/skins.minerva.icons.images.variants/clock.svg
M resources/skins.minerva.icons.images/bell.svg
M resources/skins.minerva.icons.images/edit.svg
M resources/skins.minerva.icons.images/editLocked.svg
M resources/skins.minerva.icons.images/hamburger.svg
M resources/skins.minerva.icons.images/languageSwitcher.svg
M resources/skins.minerva.icons.images/magnifying-glass.svg
M resources/skins.minerva.mainMenu.icons/anonymous.svg
M resources/skins.minerva.mainMenu.icons/contributions.svg
M resources/skins.minerva.mainMenu.icons/home.svg
M resources/skins.minerva.mainMenu.icons/logout.svg
M resources/skins.minerva.mainMenu.icons/nearby.svg
M resources/skins.minerva.mainMenu.icons/profile.svg
M resources/skins.minerva.mainMenu.icons/random.svg
M resources/skins.minerva.mainMenu.icons/settings.svg
M resources/skins.minerva.mainMenu.icons/watchlist.svg
M resources/skins.minerva.userpage.icons/talk.svg
M resources/skins.minerva.userpage.icons/userpage.svg
M skinStyles/mobile.startup/images/error.svg
27 files changed, 27 insertions(+), 27 deletions(-)


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

diff --git a/resources/skins.minerva.base.styles/magnifying-glass.svg 
b/resources/skins.minerva.base.styles/magnifying-glass.svg
index e1403ce..7103adb 100644
--- a/resources/skins.minerva.base.styles/magnifying-glass.svg
+++ b/resources/skins.minerva.base.styles/magnifying-glass.svg
@@ -1 +1 @@
-http://www.w3.org/2000/svg; viewBox="0 0 24 24">
\ No newline at end of file
+http://www.w3.org/2000/svg; 
viewBox="0 0 24 24">
\ No newline at end of file
diff --git 
a/resources/skins.minerva.content.styles/images/external-link-ltr-icon.svg 
b/resources/skins.minerva.content.styles/images/external-link-ltr-icon.svg
index b72456d..499dc22 100644
--- a/resources/skins.minerva.content.styles/images/external-link-ltr-icon.svg
+++ b/resources/skins.minerva.content.styles/images/external-link-ltr-icon.svg
@@ -1 +1 @@
-http://www.w3.org/2000/svg; width="10" height="10">
\ No newline at end of file
+http://www.w3.org/2000/svg; 
width="10" height="10">
\ No newline at end of file
diff --git 
a/resources/skins.minerva.content.styles/images/external-link-rtl-icon.svg 
b/resources/skins.minerva.content.styles/images/external-link-rtl-icon.svg
index 0c17220..2577607 100644
--- a/resources/skins.minerva.content.styles/images/external-link-rtl-icon.svg
+++ b/resources/skins.minerva.content.styles/images/external-link-rtl-icon.svg
@@ -1 +1 @@
-http://www.w3.org/2000/svg; width="10" height="10">
\ No newline at end of file
+http://www.w3.org/2000/svg; 
width="10" height="10">
\ No newline at end of file
diff --git a/resources/skins.minerva.icons.images.scripts/userAnonymous.svg 
b/resources/skins.minerva.icons.images.scripts/userAnonymous.svg
index 9cc3c56..cccd4de 100644
--- a/resources/skins.minerva.icons.images.scripts/userAnonymous.svg
+++ b/resources/skins.minerva.icons.images.scripts/userAnonymous.svg
@@ -1 +1 @@
-http://www.w3.org/2000/svg; viewBox="0 0 16 16">
\ No newline at end of file
+http://www.w3.org/2000/svg; 
viewBox="0 0 16 16">
\ No newline at end of file
diff --git a/resources/skins.minerva.icons.images.scripts/userNormal.svg 
b/resources/skins.minerva.icons.images.scripts/userNormal.svg
index 5f14d62..36883d3 100644
--- a/resources/skins.minerva.icons.images.scripts/userNormal.svg
+++ b/resources/skins.minerva.icons.images.scripts/userNormal.svg
@@ -1 +1 @@
-http://www.w3.org/2000/svg; viewBox="271.5 72.8 16 16">
\ No newline at end of file
+http://www.w3.org/2000/svg; 
viewBox="271.5 72.8 16 16">
\ No newline at end of file
diff --git a/resources/skins.minerva.icons.images.scripts/watch.svg 
b/resources/skins.minerva.icons.images.scripts/watch.svg
index a98603d..c474153 100644
--- a/resources/skins.minerva.icons.images.scripts/watch.svg
+++ 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: WLFilters: Fix seen/unseen filters

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

Change subject: WLFilters: Fix seen/unseen filters
..


WLFilters: Fix seen/unseen filters

Handle the fact that wl_notificationtimestamp
can be null.

Always join with 'page' table to support highlight.

Bug: T171127
Change-Id: I150a41b131d64163e06bfa56bddbd762bb636655
---
M includes/specials/SpecialWatchlist.php
1 file changed, 15 insertions(+), 19 deletions(-)

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



diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index b20b331..a17f118 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -157,7 +157,7 @@
'isRowApplicableCallable' => function ( 
$ctx, $rc ) {
$changeTs = $rc->getAttribute( 
'rc_timestamp' );
$lastVisitTs = 
$rc->getAttribute( 'wl_notificationtimestamp' );
-   return $changeTs >= 
$lastVisitTs;
+   return $lastVisitTs !== null && 
$changeTs >= $lastVisitTs;
},
],
[
@@ -168,7 +168,7 @@
'isRowApplicableCallable' => function ( 
$ctx, $rc ) {
$changeTs = $rc->getAttribute( 
'rc_timestamp' );
$lastVisitTs = 
$rc->getAttribute( 'wl_notificationtimestamp' );
-   return $changeTs < $lastVisitTs;
+   return $lastVisitTs === null || 
$changeTs < $lastVisitTs;
}
],
],
@@ -176,9 +176,15 @@
'queryCallable' => function ( $specialPageClassName, 
$context, $dbr,

  &$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedValues ) 
{
if ( $selectedValues === [ 'seen' ] ) {
-   $conds[] = 'rc_timestamp < 
wl_notificationtimestamp';
+   $conds[] = $dbr->makeList( [
+   'wl_notificationtimestamp IS 
NULL',
+   'rc_timestamp < 
wl_notificationtimestamp'
+   ], LIST_OR );
} elseif ( $selectedValues === [ 'unseen' ] ) {
-   $conds[] = 'rc_timestamp >= 
wl_notificationtimestamp';
+   $conds[] = $dbr->makeList( [
+   'wl_notificationtimestamp IS 
NOT NULL',
+   'rc_timestamp >= 
wl_notificationtimestamp'
+   ], LIST_AND );
}
}
] ) );
@@ -336,9 +342,7 @@
$user = $this->getUser();
 
# Toggle watchlist content (all recent edits or just the latest)
-   if ( $opts['extended'] ) {
-   $usePage = false;
-   } else {
+   if ( !$opts['extended'] ) {
# Top log Ids for a page are not stored
$nonRevisionTypes = [ RC_LOG ];
Hooks::run( 'SpecialWatchlistGetNonRevisionTypes', [ 
&$nonRevisionTypes ] );
@@ -351,7 +355,6 @@
LIST_OR
);
}
-   $usePage = true;
}
 
$tables = array_merge( [ 'recentchanges', 'watchlist' ], 
$tables );
@@ -375,18 +378,11 @@
$join_conds
);
 
-   if ( $this->getConfig()->get( 'ShowUpdatedMarker' ) ) {
-   $fields[] = 'wl_notificationtimestamp';
-   }
+   $tables[] = 'page';
+   $fields[] = 'page_latest';
+   $join_conds['page'] = [ 'LEFT JOIN', 'rc_cur_id=page_id' ];
 
-   $rollbacker = $user->isAllowed( 'rollback' );
-   if ( $usePage || $rollbacker ) {
-   $tables[] = 'page';
-   $join_conds['page'] = [ 'LEFT JOIN', 
'rc_cur_id=page_id' ];
-   if ( $rollbacker ) {
-   $fields[] = 'page_latest';
-   }
-   }
+   $fields[] = 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Improve some timeout docs

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

Change subject: Improve some timeout docs
..


Improve some timeout docs

Change-Id: I799ea1e647d4d67a3c7d0e8dfddff893aef32736
---
M includes/DefaultSettings.php
M includes/http/MWHttpRequest.php
2 files changed, 8 insertions(+), 1 deletion(-)

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



diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 610df45..1f3b5e3 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -755,6 +755,8 @@
  * timeout longer than the default $wgHTTPTimeout. False means fallback
  * to default.
  *
+ * @var int|bool
+ *
  * @since 1.22
  */
 $wgCopyUploadTimeout = false;
@@ -8279,6 +8281,7 @@
 
 /**
  * Timeout for HTTP requests done internally, in seconds.
+ * @var int
  */
 $wgHTTPTimeout = 25;
 
diff --git a/includes/http/MWHttpRequest.php b/includes/http/MWHttpRequest.php
index 88cc510..0f0118c 100644
--- a/includes/http/MWHttpRequest.php
+++ b/includes/http/MWHttpRequest.php
@@ -33,8 +33,12 @@
 class MWHttpRequest implements LoggerAwareInterface {
const SUPPORTS_FILE_POSTS = false;
 
-   protected $content;
+   /**
+* @var int|string
+*/
protected $timeout = 'default';
+
+   protected $content;
protected $headersOnly = null;
protected $postData = null;
protected $proxy = null;

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...SendGrid[master]: Hook enhancement for clarity

2017-08-25 Thread D3r1ck01 (Code Review)
D3r1ck01 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373959 )

Change subject: Hook enhancement for clarity
..

Hook enhancement for clarity

* Changing $sg variable in the Hook file to $sendgrid
  for more clarity of what the object does.

* Adding comment to know where the variable $sendgridAPIKey
  is gotten from in the codes.

* Updates to license in the Hook file.

* Fixes to SendGrid.php for readability

Change-Id: I960ec0a66c14bdcbdbf7e067d327197ba9a3aa1a
---
M SendGrid.php
M SendGridHooks.php
2 files changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SendGrid 
refs/changes/59/373959/1

diff --git a/SendGrid.php b/SendGrid.php
index 462dd58..7adc377 100644
--- a/SendGrid.php
+++ b/SendGrid.php
@@ -1,8 +1,10 @@
 https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
diff --git a/SendGridHooks.php b/SendGridHooks.php
index 6755eaa..312c6b6 100644
--- a/SendGridHooks.php
+++ b/SendGridHooks.php
@@ -1,6 +1,6 @@
 getConfig();
 
+   // Value gotten from "wgSendGridAPIKey" variable from 
LocalSettings.php
$sendgridAPIKey = $conf->get( 'SendGridAPIKey' );
 
if ( $sendgridAPIKey == "" ) {
@@ -58,10 +59,10 @@
$to = new SendGrid\Email( null, $to[0]->address );
$body = new SendGrid\Content( "text/plain", $body );
$mail = new SendGrid\Mail( $from, $subject, $to, $body );
-   $sg = new \SendGrid( $sendgridAPIKey );
+   $sendgrid = new \SendGrid( $sendgridAPIKey );
 
try {
-   $sg->client->mail()->send()->post( $mail );
+   $sendgrid->client->mail()->send()->post( $mail );
} catch ( Exception $e ) {
return $e->getMessage();
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I960ec0a66c14bdcbdbf7e067d327197ba9a3aa1a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SendGrid
Gerrit-Branch: master
Gerrit-Owner: D3r1ck01 

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


[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Deal with sparse refund records in WX files

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

Change subject: Deal with sparse refund records in WX files
..

Deal with sparse refund records in WX files

Bug: T173875
Change-Id: I2b1f3b077c6013406f8e2fbff762b55293fdb54b
Depends-on: I0b27295a245f50eb96356c33d16173a4559a9566
---
M sites/all/modules/wmf_audit/BaseAuditProcessor.php
M sites/all/modules/wmf_audit/tests/IngenicoAuditTest.php
A 
sites/all/modules/wmf_audit/tests/data/Ingenico/sparseRefund/wx1.00123420170828.010226.xml.gz
3 files changed, 85 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/58/373958/1

diff --git a/sites/all/modules/wmf_audit/BaseAuditProcessor.php 
b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
index 568f573..d8054df 100644
--- a/sites/all/modules/wmf_audit/BaseAuditProcessor.php
+++ b/sites/all/modules/wmf_audit/BaseAuditProcessor.php
@@ -248,16 +248,29 @@
} else {
$send_message['gateway'] = $this->name;
}
-   // for now, just don't try to normalize if it's already normal
-   if ( isset( $record['gateway_refund_id'] ) ) {
-   $send_message['gateway_refund_id'] = 
$record['gateway_refund_id'];
-   } elseif ( isset( $record['gateway_txn_id'] ) ) {
-   $send_message['gateway_refund_id'] = 
$record['gateway_txn_id']; //Notes from a previous version: "after intense 
deliberation, we don't actually care what this is at all."
+
+   // We get woefully sparse records from some audit files.
+   // Try to reconstruct missing/false-y gateway_parent_id from 
ct_id
+   if (
+   empty( $record['gateway_parent_id'] ) &&
+   empty( $record['gateway_txn_id'] ) &&
+   !empty( $record['contribution_tracking_id'] )
+   ) {
+   $record['gateway_parent_id'] = 
$this->getGatewayIdFromTracking( $record );
}
if ( isset( $record['gateway_parent_id'] ) ) {
$send_message['gateway_parent_id'] = 
$record['gateway_parent_id'];
} else {
$send_message['gateway_parent_id'] = 
$record['gateway_txn_id'];
+   }
+   if ( isset( $record['gateway_refund_id'] ) ) {
+   $send_message['gateway_refund_id'] = 
$record['gateway_refund_id'];
+   } elseif ( isset( $record['gateway_txn_id'] ) ) {
+   $send_message['gateway_refund_id'] = 
$record['gateway_txn_id']; //Notes from a previous version: "after intense 
deliberation, we don't actually care what this is at all."
+   } else {
+   // This stinks, but some processors don't assign a 
unique ID to the
+   // refund. We'll prepend an 'RFD' in the trxn_id column 
later.
+   $send_message['gateway_refund_id'] = 
$send_message['gateway_parent_id'];
}
if ( isset( $record['gross_currency'] ) ) {
$send_message['gross_currency'] = 
$record['gross_currency'];
@@ -414,9 +427,9 @@
 
if ( array_key_exists( 'negative', $total_missing ) && !empty( 
$total_missing['negative'] ) ) {
foreach ( $total_missing['negative'] as $record ) {
-   //check to see if the parent exists. If it 
does, normalize and send.
+   $normal = $this->normalize_negative( $record );
+   // check to see if the parent exists. If it 
does send it.
if ( $this->main_transaction_exists_in_civi( 
$record ) ) {
-   $normal = $this->normalize_negative( 
$record );
wmf_audit_send_transaction( $normal, 
'negative' );
$neg_count += 1;
wmf_audit_echo( '!' );
@@ -1224,4 +1237,18 @@
}
return false;
}
+
+   protected function getGatewayIdFromTracking( $record = array() ) {
+   $tracking = wmf_civicrm_get_contribution_tracking( $record );
+   if ( empty( $tracking['contribution_id'] ) ) {
+   return null;
+   }
+   $contributions = 
wmf_civicrm_get_contributions_from_contribution_id(
+   $tracking['contribution_id']
+   );
+   if ( empty( $contributions ) ) {
+   return null;
+   }
+   return $contributions[0]['gateway_txn_id'];
+   }
 }
diff --git a/sites/all/modules/wmf_audit/tests/IngenicoAuditTest.php 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Ignore npm-debug.log

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

Change subject: Ignore npm-debug.log
..


Ignore npm-debug.log

Change-Id: Ia984f7baa2aa94e00b7be712d5dc4846d29ede85
---
M .gitignore
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index 388f354..b991e11 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,6 +42,7 @@
 /StartProfiler.php
 
 # Building & testing
+npm-debug.log
 node_modules/
 /tests/phpunit/phpunit.phar
 

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ThrottleOverride[master]: Remove space from name in extension.json

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

Change subject: Remove space from name in extension.json
..


Remove space from name in extension.json

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

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



diff --git a/extension.json b/extension.json
index 2b0e2e2..df3740a 100644
--- a/extension.json
+++ b/extension.json
@@ -1,5 +1,5 @@
 {
-   "name": "Throttle Override",
+   "name": "ThrottleOverride",
"version": "0.6.0",
"author": "Tyler Romeo",
"url": "https://www.mediawiki.org/wiki/Extension:ThrottleOverride;,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I79f4f3f6634dd0c91caf94e5fb407f4806857804
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ThrottleOverride
Gerrit-Branch: master
Gerrit-Owner: Reedy 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Make font in language selector smaller

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

Change subject: Make font in language selector smaller
..


Make font in language selector smaller

- Change font size for language names in language selector,
making it smaller, from 18px to 16px.
- Fix overlap of the red border over the glass icon on invalid input,
on both embedded and modal source selector input dialogs.
- Reorder some properties to adhere to LESS property order proposal.

Bug: T173403
Change-Id: Ide4b1f5912c2d07ca98e4895c33f832370360485
---
M modules/dashboard/styles/ext.cx.dashboard.less
M modules/dashboard/styles/ext.cx.lists.common.less
M modules/dashboard/styles/ext.cx.suggestionlist.less
M modules/source/styles/ext.cx.source.selector.less
4 files changed, 217 insertions(+), 191 deletions(-)

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



diff --git a/modules/dashboard/styles/ext.cx.dashboard.less 
b/modules/dashboard/styles/ext.cx.dashboard.less
index 7706a46..12190b2 100644
--- a/modules/dashboard/styles/ext.cx.dashboard.less
+++ b/modules/dashboard/styles/ext.cx.dashboard.less
@@ -97,16 +97,6 @@
background-color: @colorGray14;
 }
 
-.translation-source-language-filter,
-.translation-target-language-filter {
-   background-color: @colorGray15;
-   font-size: 1em;
-
-   option {
-   font-size: 1em;
-   }
-}
-
 .translation-filter {
.mw-ui-one-whole;
 
diff --git a/modules/dashboard/styles/ext.cx.lists.common.less 
b/modules/dashboard/styles/ext.cx.lists.common.less
index 0b69ba7..08a3dbf 100644
--- a/modules/dashboard/styles/ext.cx.lists.common.less
+++ b/modules/dashboard/styles/ext.cx.lists.common.less
@@ -3,10 +3,13 @@
 .cx-tlitem,
 .cx-slitem {
.mw-ui-one-whole;
-   padding: 16px;
+
background-color: #fff;
-   border-top: 1px solid #ddd;
+   border-top: 1px solid @colorGray12;
+   padding: 16px;
+
cursor: pointer;
+   transition: 1s ease;
 
&:hover {
background-color: #eff3fb;
@@ -18,9 +21,8 @@
}
 
&:last-child {
-   border-top: 1px solid #ddd;
+   border-top: 1px solid @colorGray12;
}
-   transition: 1s ease;
 }
 
 .cx-suggestionlist__header,
@@ -35,27 +37,28 @@
line-height: 1;
 
.flex-display( box ); // Support 2009 syntax
-   .flex-display();
-   .flex();
+   .flex-display;
+   .flex;
-webkit-justify-content: space-between; // Support Safari 6.1-8, iOS 
7.1-8.4, Opera 15-16
-ms-flex-align: center; // Support IE10
-webkit-box-align: center; // Support 2011 syntax
-   -webkit-align-items: center; // Support Vendor specific
+   -webkit-align-items: center; // Support vendor specific
align-items: center; // Modern syntax
 
.translation-language-filter {
background-color: @colorGray15;
+   box-sizing: border-box;
max-width: 33.33%;
+   max-height: 34px;
border: 1px solid #9d9d9d;
border-radius: @borderRadius;
padding: 0;
 
-   .flex-display( box ); // 2009 syntax support
-   .flex-display();
+   .flex-display( box ); // Support 2009 syntax
+   .flex-display;
 
.translation-language-source-container,
.translation-language-target-container {
-   float: left;
position: relative;
box-sizing: border-box;
cursor: pointer;
@@ -81,8 +84,9 @@
 
.translation-source-language-filter,
.translation-target-language-filter {
-   max-height: 34px;
+   background-color: @colorGray15;
padding: 8px;
+   font-size: 16px;
line-height: 1;
 
overflow: hidden;
@@ -92,37 +96,39 @@
 
.translation-language-arrow {
position: relative;
-   float: left;
width: 0;
-   height: 34px;
+   height: 32px;
margin-right: 16px;
}
 
.translation-language-arrow:after,
.translation-language-arrow:before {
-   left: 100%;
-   top: 50%;
-   border: solid transparent;
content: ' ';
+
+   position: absolute;
+   top: 50%;
+   left: 100%;
+
height: 0;
width: 0;
-   position: absolute;
+   border: solid transparent;
+
 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: SpecialPageLanguage: Show current page language in the dropdown

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

Change subject: SpecialPageLanguage: Show current page language in the dropdown
..


SpecialPageLanguage: Show current page language in the dropdown

Also show canonical page title form while we're at it.

Bug: T74966
Change-Id: I52c19a0a018d76a4282c61c009b40b2f7e56b3d2
---
M includes/specials/SpecialPageLanguage.php
1 file changed, 13 insertions(+), 3 deletions(-)

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



diff --git a/includes/specials/SpecialPageLanguage.php 
b/includes/specials/SpecialPageLanguage.php
index 78a453e..a68f08f 100644
--- a/includes/specials/SpecialPageLanguage.php
+++ b/includes/specials/SpecialPageLanguage.php
@@ -49,12 +49,20 @@
protected function getFormFields() {
// Get default from the subpage of Special page
$defaultName = $this->par;
+   $title = $defaultName ? Title::newFromText( $defaultName ) : 
null;
+   if ( $title ) {
+   $defaultPageLanguage =
+   ContentHandler::getForTitle( $title 
)->getPageLanguage( $title );
+   $hasCustomLanguageSet = !$defaultPageLanguage->equals( 
$title->getPageLanguage() );
+   } else {
+   $hasCustomLanguageSet = false;
+   }
 
$page = [];
$page['pagename'] = [
'type' => 'title',
'label-message' => 'pagelang-name',
-   'default' => $defaultName,
+   'default' => $title ? $title->getPrefixedText() : 
$defaultName,
'autofocus' => $defaultName === null,
'exists' => true,
];
@@ -68,7 +76,7 @@
'id' => 'mw-pl-options',
'type' => 'radio',
'options' => $selectoptions,
-   'default' => 1
+   'default' => $hasCustomLanguageSet ? 2 : 1
];
 
// Building a language selector
@@ -86,7 +94,9 @@
'type' => 'select',
'options' => $options,
'label-message' => 'pagelang-language',
-   'default' => $this->getConfig()->get( 'LanguageCode' ),
+   'default' => $title ?
+   $title->getPageLanguage()->getCode() :
+   $this->getConfig()->get( 'LanguageCode' ),
];
 
// Allow user to enter a comment explaining the change

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I52c19a0a018d76a4282c61c009b40b2f7e56b3d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Florianschmidtwelzow 
Gerrit-Reviewer: Fomafix 
Gerrit-Reviewer: Nikerabbit 
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]: Ignore npm-debug.log

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

Change subject: Ignore npm-debug.log
..

Ignore npm-debug.log

Change-Id: Ia984f7baa2aa94e00b7be712d5dc4846d29ede85
---
M .gitignore
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/.gitignore b/.gitignore
index 388f354..b991e11 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,6 +42,7 @@
 /StartProfiler.php
 
 # Building & testing
+npm-debug.log
 node_modules/
 /tests/phpunit/phpunit.phar
 

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

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

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


[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: allow unit tests to override store props

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

Change subject: allow unit tests to override store props
..


allow unit tests to override store props

Change-Id: I21219c91bf475b6721a5254f79f91c23b1c7992c
---
M 
blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/AbstractRandomizedBlazegraphStorageTestCase.java
1 file changed, 14 insertions(+), 3 deletions(-)

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



diff --git 
a/blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/AbstractRandomizedBlazegraphStorageTestCase.java
 
b/blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/AbstractRandomizedBlazegraphStorageTestCase.java
index 230d7f4..4e45155 100644
--- 
a/blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/AbstractRandomizedBlazegraphStorageTestCase.java
+++ 
b/blazegraph/src/test/java/org/wikidata/query/rdf/blazegraph/AbstractRandomizedBlazegraphStorageTestCase.java
@@ -75,7 +75,18 @@
 if (store != null) {
 return store;
 }
-Properties properties = new Properties();
+Properties properties = initStoreProperties(new Properties());
+store = new TempTripleStore(temporaryStore(), properties, null);
+return store;
+}
+
+/**
+ * Initialize store properties.
+ * Allows property override by either updating properties object, or 
returning a new one.
+ * @param properties Properties that have been set so far
+ * @return Properties object after updating it
+ */
+protected Properties initStoreProperties(Properties properties) {
 
properties.setProperty("com.bigdata.rdf.store.AbstractTripleStore.vocabularyClass",
 WikibaseVocabulary.VOCABULARY_CLASS.getName());
 
properties.setProperty("com.bigdata.rdf.store.AbstractTripleStore.inlineURIFactory",
@@ -94,8 +105,8 @@
 + "{ \"valueType\": \"DOUBLE\", \"multiplier\": 
\"10\", \"serviceMapping\": \"LATITUDE\" }, "
 + "{ \"valueType\": \"LONG\", 
\"multiplier\":\"1\",\"minValue\":\"0\", \"serviceMapping\": \"COORD_SYSTEM\" } 
"
 + "]}}");
-store = new TempTripleStore(temporaryStore(), properties, null);
-return store;
+
+return properties;
 }
 
 /**

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Set up a new logo on zh-classical.m.wikipedia

2017-08-25 Thread Samtar (Code Review)
Samtar has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373956 )

Change subject: Set up a new logo on zh-classical.m.wikipedia
..

Set up a new logo on zh-classical.m.wikipedia

After Ic1868eb468111d38d98aa95b6887c1232999e8d9 has been merged (logo upload), 
this will add the image to wgMinervaCustomLogos for zh_classicalwiki

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 8013276..ca6226a 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -15561,6 +15561,12 @@
'copyright-width' => 105,
'copyright-height' => 18,
],
+'zh_classicalwiki' => [ // T173408
+   'copyright' => 
'/static/images/mobile/copyright/wikipedia-wordmark-zh-c.svg',
+   'copyright-width' => 80,
+   'copyright-height' => 18,
+   ],
+
 ],
 'wgMFPhotoUploadEndpoint' => [
'default' => '//commons.m.wikimedia.org/w/api.php',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Split out utilitary functions into dedicated classes

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

Change subject: Split out utilitary functions into dedicated classes
..


Split out utilitary functions into dedicated classes

This reduces the complexity of the main class (CRAP from 253 to 202) and make
possible the use of these functions without creating the main object. In
particular I need the function readFile for the “list wikis” feature, but
don’t need the main object.

By the way, the function dedicated to read YAML files is enclosed in a class,
so that it is a general design to have utils functions in classes.

Small thing: I remove the @author given there will be many authors in the
long term (and Git history lists the authors), and it removes one publication
on the Web of my email address, hence a source of information for spammers.

Change-Id: Id9a47bf64061ab6d292e338c750d311f96be0e32
---
M extension.json
M src/MediaWikiFarm.php
M src/MediaWikiFarmConfiguration.php
A src/Utils.php
A src/Utils5_3.php
D src/Yaml.php
M src/bin/MediaWikiFarmScriptComposer.php
M tests/phpunit/ConfigurationTest.php
M tests/phpunit/ConstructionTest.php
M tests/phpunit/FunctionsTest.php
M tests/phpunit/InstallationIndependantTest.php
M tests/phpunit/LoadingTest.php
M tests/phpunit/LoggingTest.php
M tests/phpunit/MonoversionInstallationTest.php
M tests/phpunit/MultiversionInstallationTest.php
M tests/phpunit/bin/MediaWikiFarmScriptComposerTest.php
M tests/phpunit/bin/MediaWikiFarmScriptTest.php
17 files changed, 423 insertions(+), 333 deletions(-)

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



diff --git a/extension.json b/extension.json
index 5a44c0f..2b317ab 100644
--- a/extension.json
+++ b/extension.json
@@ -32,6 +32,8 @@
"MediaWikiFarmConfiguration": 
"src/MediaWikiFarmConfiguration.php",
"AbstractMediaWikiFarmScript": 
"src/bin/AbstractMediaWikiFarmScript.php",
"MediaWikiFarmScript": "src/bin/MediaWikiFarmScript.php",
+   "MediaWikiFarmUtils": "src/Utils.php",
+   "MediaWikiFarmUtils5_3": "src/Utils5_3.php",
"MediaWikiFarmHooks": "src/Hooks.php",
"MWFConfigurationException": "src/MediaWikiFarm.php"
},
diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php
index 56c47be..3492211 100644
--- a/src/MediaWikiFarm.php
+++ b/src/MediaWikiFarm.php
@@ -3,7 +3,6 @@
  * Classes MediaWikiFarm and MWFConfigurationException.
  *
  * @package MediaWikiFarm
- * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
  *
@@ -12,6 +11,7 @@
  */
 
 // @codeCoverageIgnoreStart
+require_once dirname( __FILE__ ) . '/Utils.php';
 require_once dirname( __FILE__ ) . '/MediaWikiFarmConfiguration.php';
 // @codeCoverageIgnoreEnd
 
@@ -381,7 +381,7 @@
$variables = $this->variables;
$variables['$CORECONFIG'] = 
$this->farmConfig['coreconfig'];
$variables['$CONFIG'] = $this->farmConfig['config'];
-   self::cacheFile( $variables, 
$this->variables['$SERVER'] . '.php', $this->cacheDir . '/wikis' );
+   MediaWikiFarmUtils::cacheFile( $variables, 
$this->variables['$SERVER'] . '.php', $this->cacheDir . '/wikis' );
}
 
return true;
@@ -426,7 +426,7 @@
 
# Save Composer key if available
if( $this->cacheDir && !array_key_exists( 
'unreadable-file', $this->log ) ) {
-   self::cacheFile( $this->getConfiguration( 
'composer' ),
+   MediaWikiFarmUtils::cacheFile( 
$this->getConfiguration( 'composer' ),
$this->variables['$SERVER'] . '.php',
$this->cacheDir . '/composer'
);
@@ -444,7 +444,7 @@
 
# Create the final LocalSettings.php
if( $this->cacheDir && !array_key_exists( 
'unreadable-file', $this->log ) ) {
-   self::cacheFile( 
MediaWikiFarmConfiguration::createLocalSettings( $this->getConfiguration(), 
(bool) $this->codeDir ),
+   MediaWikiFarmUtils::cacheFile( 
MediaWikiFarmConfiguration::createLocalSettings( $this->getConfiguration(), 
(bool) $this->codeDir ),
$this->variables['$SERVER'] . '.php',
$this->cacheDir . '/LocalSettings'
);
@@ -490,7 +490,7 @@
if( !array_key_exists( $setting, $GLOBALS ) ) {
$GLOBALS[$setting] = array();
}
- 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Allow user to navigate to Main Page of article pack from Det...

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

Change subject: Allow user to navigate to Main Page of article pack from Detail 
screen.
..


Allow user to navigate to Main Page of article pack from Detail screen.

..., she said.

Change-Id: I03ac0dda83f52812431ec0d05686ea86397c249f
---
M app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
M app/src/main/java/org/wikipedia/offline/OfflineManager.java
M app/src/main/res/layout/fragment_compilation_detail.xml
3 files changed, 33 insertions(+), 4 deletions(-)

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



diff --git 
a/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java 
b/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
index 983af45..714b7a1 100644
--- a/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
+++ b/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
@@ -13,12 +13,21 @@
 import android.widget.TextView;
 
 import org.wikipedia.R;
+import org.wikipedia.WikipediaApp;
 import org.wikipedia.gallery.MediaDownloadReceiver;
+import org.wikipedia.history.HistoryEntry;
 import org.wikipedia.json.GsonMarshaller;
 import org.wikipedia.json.GsonUnmarshaller;
+import org.wikipedia.page.PageActivity;
+import org.wikipedia.page.PageTitle;
+import org.wikipedia.staticdata.MainPageNameData;
+import org.wikipedia.util.FeedbackUtil;
 import org.wikipedia.util.GradientUtil;
+import org.wikipedia.util.log.L;
 import org.wikipedia.views.FaceAndColorDetectImageView;
 import org.wikipedia.views.ViewUtil;
+
+import java.io.IOException;
 
 import butterknife.BindView;
 import butterknife.ButterKnife;
@@ -38,6 +47,7 @@
 @BindView(R.id.view_compilation_info_summary) TextView summaryView;
 @BindView(R.id.view_compilation_info_description) TextView descriptionView;
 @BindView(R.id.button_compilation_detail_download) TextView downloadButton;
+@BindView(R.id.button_compilation_detail_main_page) TextView 
mainPageButton;
 @BindView(R.id.compilation_detail_downloaded_buttons_container) View 
downloadedContainerView;
 @BindView(R.id.view_compilation_detail_download_control) 
CompilationDownloadControlView controls;
 
@@ -85,6 +95,7 @@
 }
 });
 
+
mainPageButton.setText(MainPageNameData.valueFor(WikipediaApp.getInstance().getAppLanguageCode()));
 updateDownloadState(true, null);
 return view;
 }
@@ -104,8 +115,17 @@
 }
 }
 
-@OnClick(R.id.button_compilation_detail_view_compilations) void 
onMyCompilationsClick() {
-getAppCompatActivity().finish();
+@OnClick(R.id.button_compilation_detail_main_page) void onMainPageClick() {
+try {
+PageTitle title = new 
PageTitle(OfflineManager.instance().getMainPageTitle(compilation),
+WikipediaApp.getInstance().getWikiSite());
+
+HistoryEntry entry = new HistoryEntry(title, 
HistoryEntry.SOURCE_MAIN_PAGE);
+startActivity(PageActivity.newIntent(getContext(), entry, 
entry.getTitle()));
+} catch (IOException e) {
+L.e(e);
+FeedbackUtil.showError(getActivity(), e);
+}
 }
 
 @OnClick(R.id.button_compilation_detail_remove) void onRemoveClick() {
diff --git a/app/src/main/java/org/wikipedia/offline/OfflineManager.java 
b/app/src/main/java/org/wikipedia/offline/OfflineManager.java
index 40c205c..de9a46d 100644
--- a/app/src/main/java/org/wikipedia/offline/OfflineManager.java
+++ b/app/src/main/java/org/wikipedia/offline/OfflineManager.java
@@ -171,6 +171,15 @@
 return compilations.get(compIndex).getMainPageTitle();
 }
 
+@NonNull public String getMainPageTitle(@NonNull Compilation compilation) 
throws IOException {
+for (Compilation c : compilations) {
+if (c.pathNameMatchesUri(compilation.uri())) {
+return c.getMainPageTitle();
+}
+}
+throw new IOException("No matching compilation found on disk.");
+}
+
 @VisibleForTesting void setCompilations(@NonNull List 
compilations) {
 this.compilations = compilations;
 }
diff --git a/app/src/main/res/layout/fragment_compilation_detail.xml 
b/app/src/main/res/layout/fragment_compilation_detail.xml
index 9fedcc7..875a5df 100644
--- a/app/src/main/res/layout/fragment_compilation_detail.xml
+++ b/app/src/main/res/layout/fragment_compilation_detail.xml
@@ -112,14 +112,14 @@
 
android:text="@string/offline_compilation_detail_button_remove"/>
 
 
+tools:text="Main page"/>
 
 
 https://gerrit.wikimedia.org/r/373940
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I03ac0dda83f52812431ec0d05686ea86397c249f
Gerrit-PatchSet: 4

[MediaWiki-commits] [Gerrit] operations/puppet[production]: discovery analytics - disable report updater cronjob

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

Change subject: discovery analytics - disable report updater cronjob
..


discovery analytics - disable report updater cronjob

Bug: T174110
Change-Id: I2ae9d3f333d364128f82457680508da287f76477
---
M modules/statistics/manifests/discovery.pp
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/modules/statistics/manifests/discovery.pp 
b/modules/statistics/manifests/discovery.pp
index 491ed11..0310483 100644
--- a/modules/statistics/manifests/discovery.pp
+++ b/modules/statistics/manifests/discovery.pp
@@ -69,7 +69,10 @@
 # - Remaining data from previous day is likely to have finished processing.
 # - It's ~9/10p Pacific time, so we're not likely to hinder people's work
 #   on analytics cluster, although we use `nice` & `ionice` as a courtesy.
+
+# Disabled for now until T174110 is resolved
 cron { 'wikimedia-discovery-golden':
+ensure  => absent,
 command => "cd ${dir}/golden && sh main.sh >> 
${log_dir}/golden-daily.log 2>&1",
 hour=> '5',
 minute  => '0',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2ae9d3f333d364128f82457680508da287f76477
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gehel 
Gerrit-Reviewer: Bearloga 
Gerrit-Reviewer: Gehel 
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...codesniffer[master]: Do not mess long function comments on composer fix

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

Change subject: Do not mess long function comments on composer fix
..

Do not mess long function comments on composer fix

A multiline comment is combined into one line and that line was used on
when using phpcbf. This results in repeat of comments.

Also refactor the replacement of @param into new function
replaceParamComment

Change-Id: Iad55d497a1ebf57b4c91705e0a28fa7c8a5aa625
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
M MediaWiki/Tests/files/Commenting/commenting_function.php
M MediaWiki/Tests/files/Commenting/commenting_function.php.expect
M MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
4 files changed, 60 insertions(+), 37 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/53/373953/1

diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index 7dee5a0..fdfbe93 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -296,6 +296,7 @@
$var = '';
$varSpace = 0;
$comment = '';
+   $commentFirst = '';
if ( $tokens[( $tag + 2 )]['code'] === 
T_DOC_COMMENT_STRING ) {
$matches = [];
preg_match( 
'/([^$&.]+)(?:((?:\.\.\.)?(?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/',
@@ -315,7 +316,8 @@
}
if ( isset( $matches[4] ) === true ) {
$varSpace = strlen( $matches[3] 
);
-   $comment = $matches[4];
+   $commentFirst = $matches[4];
+   $comment = $commentFirst;
// Any strings until the next 
tag belong to this comment.
if ( isset( 
$tokens[$commentStart]['comment_tags'][( $pos + 1 )] ) === true ) {
$end = 
$tokens[$commentStart]['comment_tags'][( $pos + 1 )];
@@ -346,6 +348,7 @@
'type' => $type,
'var' => $var,
'comment' => $comment,
+   'comment_first' => $commentFirst,
'type_space' => $typeSpace,
'var_space' => $varSpace,
];
@@ -379,12 +382,11 @@
];
$fix = $phpcsFile->addFixableError( $error, 
$param['tag'], 'SpacingAfterParamType', $data );
if ( $fix === true ) {
-   $content = $param['type'];
-   $content .= str_repeat( ' ', $spaces );
-   $content .= $param['var'];
-   $content .= str_repeat( ' ', 
$param['var_space'] );
-   $content .= $param['comment'];
-   $phpcsFile->fixer->replaceToken( ( 
$param['tag'] + 2 ), $content );
+   $this->replaceParamComment(
+   $phpcsFile,
+   $param,
+   [ 'type_space' => $spaces ]
+   );
}
}
// Make sure the param name is correct.
@@ -418,12 +420,11 @@
'NotShortBoolParam'
);
if ( $fix === true ) {
-   $content  = 'bool';
-   $content .= str_repeat( ' ', 
$param['type_space'] );
-   $content .= $param['var'];
-   $content .= str_repeat( ' ', 
$param['var_space'] );
-   $content .= $param['comment'];
-   $phpcsFile->fixer->replaceToken( ( 
$param['tag'] + 2 ), $content );
+   $this->replaceParamComment(
+   $phpcsFile,
+   $param,
+   [ 'type' => 'bool' ]
+   );
}
} 

[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Enforce "short" type definitions in multi types in function ...

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

Change subject: Enforce "short" type definitions in multi types in function 
comments
..

Enforce "short" type definitions in multi types in function comments

The type of @param can have multi types separated by a pipe.
Check each type in the multi type defintion against integer/boolean

Bug: T145162
Change-Id: I8721d9d05392b941fa93c19952e5ee6725dcd5e9
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
M MediaWiki/Tests/files/Commenting/commenting_function.php
M MediaWiki/Tests/files/Commenting/commenting_function.php.expect
M MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
4 files changed, 90 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/54/373954/1

diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index fdfbe93..f573f5a 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -206,29 +206,35 @@
}
// The first word of the return type is the actual type
$exploded = explode( ' ', $content, 2 );
-   $first = $exploded[0];
-   if ( $first === 'boolean' ) {
-   $fix = $phpcsFile->addFixableError(
-   'Short type of "bool" should be used 
for @return tag',
-   $retType,
-   'NotShortBoolReturn'
-   );
-   if ( $fix === true ) {
-   $phpcsFile->fixer->replaceToken(
-   $retType, 'bool' . ( isset( 
$exploded[1] ) ? ' ' . $exploded[1] : '' )
+   $explodedType = explode( '|', $exploded[0] );
+   $fixType = false;
+   foreach ( $explodedType as $index => $type ) {
+   if ( $type === 'boolean' ) {
+   $fix = $phpcsFile->addFixableError(
+   'Short type of "bool" should be 
used for @return tag',
+   $retType,
+   'NotShortBoolReturn'
);
-   }
-   } elseif ( $first === 'integer' ) {
-   $fix = $phpcsFile->addFixableError(
-   'Short type of "int" should be used for 
@return tag',
-   $retType,
-   'NotShortIntReturn'
-   );
-   if ( $fix === true ) {
-   $phpcsFile->fixer->replaceToken(
-   $retType, 'int' . ( isset( 
$exploded[1] ) ? ' ' . $exploded[1] : '' )
+   if ( $fix === true ) {
+   $explodedType[$index] = 'bool';
+   $fixType = true;
+   }
+   } elseif ( $type === 'integer' ) {
+   $fix = $phpcsFile->addFixableError(
+   'Short type of "int" should be 
used for @return tag',
+   $retType,
+   'NotShortIntReturn'
);
+   if ( $fix === true ) {
+   $explodedType[$index] = 'int';
+   $fixType = true;
+   }
}
+   }
+   if ( $fixType ) {
+   $phpcsFile->fixer->replaceToken(
+   $retType, implode( '|', $explodedType ) 
. ( isset( $exploded[1] ) ? ' ' . $exploded[1] : '' )
+   );
}
} else {
$error = 'Missing @return tag in function comment';
@@ -413,33 +419,38 @@
}
// end if
// Check the short type of boolean and integer
-   if ( $param['type'] === 'boolean' ) {
-   $fix = $phpcsFile->addFixableError(
-   'Short type 

[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Check spacing before type in @param and @return

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

Change subject: Check spacing before type in @param and @return
..

Check spacing before type in @param and @return

There should be one space after a @param or @return

Change-Id: I2e364a90e0439bee2de15fa34b08d273dd8769a1
---
M MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
M MediaWiki/Sniffs/Commenting/IllegalSingleLineCommentSniff.php
M MediaWiki/Sniffs/NamingConventions/LowerCamelFunctionsNameSniff.php
M MediaWiki/Sniffs/Usage/SuperGlobalsUsageSniff.php
M MediaWiki/Sniffs/WhiteSpace/SpaceBeforeClassBraceSniff.php
M MediaWiki/Sniffs/WhiteSpace/SpaceBeforeControlStructureBraceSniff.php
M MediaWiki/Sniffs/WhiteSpace/SpaceyParenthesisSniff.php
M MediaWiki/Tests/MediaWikiStandardTest.php
M MediaWiki/Tests/MediaWikiTestHelper.php
M MediaWiki/Tests/files/Commenting/commenting_function.php
M MediaWiki/Tests/files/Commenting/commenting_function.php.expect
M MediaWiki/Tests/files/Commenting/commenting_function.php.fixed
M MediaWiki/Tests/files/Usage/dir_usage.php
M MediaWiki/Tests/files/Usage/dir_usage.php.fixed
M MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php
M MediaWiki/Tests/files/WhiteSpace/spacey_parenthesis.php.fixed
M MediaWiki/Tests/files/generic_namespace_pass.php
M MediaWiki/Tests/files/generic_pass.php
18 files changed, 110 insertions(+), 48 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer 
refs/changes/55/373955/1

diff --git a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php 
b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
index f573f5a..51b9345 100644
--- a/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
+++ b/MediaWiki/Sniffs/Commenting/FunctionCommentSniff.php
@@ -198,6 +198,26 @@
}
}
if ( $return !== null ) {
+   $retTypeSpacing = $return + 1;
+   if ( $tokens[$retTypeSpacing]['code'] === 
T_DOC_COMMENT_WHITESPACE ) {
+   $expectedSpaces = 1;
+   $currentSpaces = strlen( 
$tokens[$retTypeSpacing]['content'] );
+   if ( $currentSpaces !== $expectedSpaces ) {
+   $data = [
+   $expectedSpaces,
+   $currentSpaces,
+   ];
+   $fix = $phpcsFile->addFixableError(
+   'Expected %s spaces before 
return type; %s found',
+   $retTypeSpacing,
+   'SpacingBeforeReturnType',
+   $data
+   );
+   if ( $fix ) {
+   
$phpcsFile->fixer->replaceToken( $retTypeSpacing, ' ' );
+   }
+   }
+   }
$retType = $return + 2;
$content = $tokens[$retType]['content'];
if ( empty( $content ) === true || 
$tokens[$retType]['code'] !== T_DOC_COMMENT_STRING ) {
@@ -297,12 +317,16 @@
if ( $tokens[$tag]['content'] !== '@param' ) {
continue;
}
+   $paramSpace = 0;
$type = '';
$typeSpace = 0;
$var = '';
$varSpace = 0;
$comment = '';
$commentFirst = '';
+   if ( $tokens[( $tag + 1 )]['code'] === 
T_DOC_COMMENT_WHITESPACE ) {
+   $paramSpace = strlen( $tokens[( $tag + 1 
)]['content'] );
+   }
if ( $tokens[( $tag + 2 )]['code'] === 
T_DOC_COMMENT_STRING ) {
$matches = [];
preg_match( 
'/([^$&.]+)(?:((?:\.\.\.)?(?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/',
@@ -355,6 +379,7 @@
'var' => $var,
'comment' => $comment,
'comment_first' => $commentFirst,
+   'param_space' => $paramSpace,
'type_space' => $typeSpace,
'var_space' => $varSpace,
];
@@ -377,6 +402,19 @@
continue;
}
$foundParams[] = $param['var'];
+   // Check number of spaces before type (after @param)
+   $spaces = 1;
+  

[MediaWiki-commits] [Gerrit] operations/puppet[production]: discovery analytics - disable report updater cronjob

2017-08-25 Thread Gehel (Code Review)
Gehel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373952 )

Change subject: discovery analytics - disable report updater cronjob
..

discovery analytics - disable report updater cronjob

Bug: T174110
Change-Id: I2ae9d3f333d364128f82457680508da287f76477
---
M modules/statistics/manifests/discovery.pp
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/52/373952/1

diff --git a/modules/statistics/manifests/discovery.pp 
b/modules/statistics/manifests/discovery.pp
index 491ed11..0310483 100644
--- a/modules/statistics/manifests/discovery.pp
+++ b/modules/statistics/manifests/discovery.pp
@@ -69,7 +69,10 @@
 # - Remaining data from previous day is likely to have finished processing.
 # - It's ~9/10p Pacific time, so we're not likely to hinder people's work
 #   on analytics cluster, although we use `nice` & `ionice` as a courtesy.
+
+# Disabled for now until T174110 is resolved
 cron { 'wikimedia-discovery-golden':
+ensure  => absent,
 command => "cd ${dir}/golden && sh main.sh >> 
${log_dir}/golden-daily.log 2>&1",
 hour=> '5',
 minute  => '0',

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...ThrottleOverride[master]: Remove space from name in extension.json

2017-08-25 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373950 )

Change subject: Remove space from name in extension.json
..

Remove space from name in extension.json

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


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

diff --git a/extension.json b/extension.json
index 2b0e2e2..df3740a 100644
--- a/extension.json
+++ b/extension.json
@@ -1,5 +1,5 @@
 {
-   "name": "Throttle Override",
+   "name": "ThrottleOverride",
"version": "0.6.0",
"author": "Tyler Romeo",
"url": "https://www.mediawiki.org/wiki/Extension:ThrottleOverride;,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79f4f3f6634dd0c91caf94e5fb407f4806857804
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ThrottleOverride
Gerrit-Branch: master
Gerrit-Owner: Reedy 

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


[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: T173384: Improve handling of tokens in pf targets

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

Change subject: T173384: Improve handling of tokens in pf targets
..

T173384: Improve handling of tokens in pf targets

 * This is still very brittle.

 * Fixes the examples from the task,
   /en.wiktionary.org/v3/page/html/Template%3Apl-decl-noun-f/37101148
   
/de.wikipedia.org/v3/page/html/Wikipedia%3AProjektdiskussion%2FPRD-subst%2Fpre/135590627
   
/pl.wikipedia.org/v3/page/html/Wikiprojekt%3ARocznice%2Fekspozycje%2F03-15/41470292

Change-Id: Id549dcbd5922f43fcec663083a0ced466ea43b98
---
M lib/utils/Util.js
M lib/wt2html/tt/TemplateHandler.js
2 files changed, 45 insertions(+), 12 deletions(-)


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

diff --git a/lib/utils/Util.js b/lib/utils/Util.js
index 755b173..7b055ca 100644
--- a/lib/utils/Util.js
+++ b/lib/utils/Util.js
@@ -661,6 +661,34 @@
token.getAttribute('typeof') === 'mw:Entity';
},
 
+   /**
+* Strip include tags, and the contents of includeonly tags as well.
+*/
+   includeTokens: function(tokens) {
+   var toks = [];
+   var includeOnly = false;
+   for (var i = 0; i < tokens.length; i++) {
+   var tok = tokens[i];
+   switch (tok.constructor) {
+   case pd.TagTk:
+   case pd.EndTagTk:
+   case pd.SelfclosingTagTk:
+   if (['noinclude', 
'onlyinclude'].includes(tok.name)) {
+   continue;
+   } else if (tok.name === 'includeonly') {
+   includeOnly = (tok.constructor 
=== pd.TagTk);
+   continue;
+   }
+   // Fall through
+   default:
+   if (!includeOnly) {
+   toks.push(tok);
+   }
+   }
+   }
+   return toks;
+   },
+
tokensToString: function(tokens, strict, opts) {
var out = '';
if (!opts) {
diff --git a/lib/wt2html/tt/TemplateHandler.js 
b/lib/wt2html/tt/TemplateHandler.js
index 6351962..6ac9282 100644
--- a/lib/wt2html/tt/TemplateHandler.js
+++ b/lib/wt2html/tt/TemplateHandler.js
@@ -365,7 +365,7 @@
var maybeTarget = Util.tokensToString(tokens, true, { 
retainNLs: true });
if (Array.isArray(maybeTarget)) {
var buf = maybeTarget[0];
-   var tgtTokens = maybeTarget[1];
+   var tgtTokens = Util.includeTokens(maybeTarget[1]);
var preNlContent = null;
for (var i = 0, l = tgtTokens.length; i < l; i++) {
var ntt = tgtTokens[i];
@@ -439,7 +439,7 @@
// Retry with a looser attempt to convert tokens to a string.
// This lenience only applies to parser functions.
isTemplate = false;
-   target = Util.tokensToString(targetToks);
+   target = Util.tokensToString(Util.includeTokens(targetToks));
}
 
var normalizeTarget = function(txt) {
@@ -466,15 +466,22 @@
if (canonicalFunctionName !== undefined) {
// Extract toks that make up pfArg
var pfArgToks;
-   var firstTok = targetToks[0];
-   if (typeof firstTok === 'string') {
-   targetToks = targetToks.slice(1);
+   var re = new RegExp(prefix, 'i');
+
+   // Because of the lenient stringifying above, we need to find 
the prefix
+   var i = targetToks.findIndex(function(t) {
+   return typeof t === 'string' && re.test(t);
+   });
+
+   if (i > -1) {
// Strip parser-func / magic-word prefix
-   firstTok = normalizeTarget(firstTok).replace(new 
RegExp("^" + prefix, 'i'), '');
+   var firstTok = 
normalizeTarget(targetToks[i]).replace(re, '');
+   targetToks = targetToks.slice(i + 1);
+
// Strip ":" after skipping empty tokens, if any
if (isPF) {
while (firstTok === '') {
-   firstTok = targetToks[0];
+   firstTok = targetToks[0];  // FIXME: 
Isn't guaranteed to be a string
targetToks = targetToks.slice(1);
  

[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Upload wikipedia-wordmark-zh-c.svg

2017-08-25 Thread Samtar (Code Review)
Samtar has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373948 )

Change subject: Upload wikipedia-wordmark-zh-c.svg
..

Upload wikipedia-wordmark-zh-c.svg

To enable T173408, I need to upload wikipedia-wordmark-zh-c.svg

Bug: T174192
Change-Id: Ic1868eb468111d38d98aa95b6887c1232999e8d9
---
A static/images/mobile/copyright/wikipedia-wordmark-zh-c.svg
1 file changed, 123 insertions(+), 0 deletions(-)


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

diff --git a/static/images/mobile/copyright/wikipedia-wordmark-zh-c.svg 
b/static/images/mobile/copyright/wikipedia-wordmark-zh-c.svg
new file mode 100644
index 000..22be3ca
--- /dev/null
+++ b/static/images/mobile/copyright/wikipedia-wordmark-zh-c.svg
@@ -0,0 +1,123 @@
+
+
+http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
+http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd; 
xmlns:svg="http://www.w3.org/2000/svg; 
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape; 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:cc="http://creativecommons.org/ns#; 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#; 
sodipodi:docname="Wikipedia-logo-v2-zh-classical (updated).svg" 
inkscape:version="0.48.3.1 r9886"
+xmlns="http://www.w3.org/2000/svg; 
xmlns:xlink="http://www.w3.org/1999/xlink; x="0px" y="0px" width="69.545px"
+height="16.014px" viewBox="0 0 69.545 16.014" enable-background="new 0 
0 69.545 16.014" xml:space="preserve">
+
+   
+
+   
+   
+   
+   
+
+

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix redundant results for within drilldown filter

2017-08-25 Thread Fz-29 (Code Review)
Fz-29 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373947 )

Change subject: Fix redundant results for within drilldown filter
..

Fix redundant results for within drilldown filter

Change-Id: I71bbd91947c1bc674e9d5411542a34bdae0907f5
---
M drilldown/CargoSpecialDrilldown.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/drilldown/CargoSpecialDrilldown.php 
b/drilldown/CargoSpecialDrilldown.php
index 414c940..787a397 100644
--- a/drilldown/CargoSpecialDrilldown.php
+++ b/drilldown/CargoSpecialDrilldown.php
@@ -1294,7 +1294,7 @@
}
 
$aliasedFieldNames = array(
-   'title' => CargoUtils::escapedFieldName( $cdb, 
$this->tableName, '_pageName' ),
+   'title' => "DISTINCT(" . CargoUtils::escapedFieldName( 
$cdb, $this->tableName, '_pageName' ) . ")",
'value' => CargoUtils::escapedFieldName( $cdb, 
$this->tableName, '_pageName' ),
'namespace' => CargoUtils::escapedFieldName( $cdb, 
$this->tableName, '_pageNamespace' ),
'ID' => CargoUtils::escapedFieldName( $cdb, 
$this->tableName, '_pageID' )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71bbd91947c1bc674e9d5411542a34bdae0907f5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Fz-29 

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


[MediaWiki-commits] [Gerrit] mediawiki...LoginNotify[master]: Remove unused import

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

Change subject: Remove unused import
..

Remove unused import

Change-Id: I791728d08032c03ebbaa84f4c621c9ccd164c3c0
---
M includes/LoginNotify.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/includes/LoginNotify.php b/includes/LoginNotify.php
index aa59964..828f25f 100644
--- a/includes/LoginNotify.php
+++ b/includes/LoginNotify.php
@@ -23,7 +23,6 @@
 use IP;
 use MediaWiki\Logger\LoggerFactory;
 use MWCryptRand;
-use ObjectCache;
 use Psr\Log\LoggerInterface;
 use Psr\Log\LoggerAwareInterface;
 use RequestContext;

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

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

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


[MediaWiki-commits] [Gerrit] operations/dns[master]: Move pfw3-eqiad from xe-5/1/1 to xe-3/1/7

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

Change subject: Move pfw3-eqiad from xe-5/1/1 to xe-3/1/7
..


Move pfw3-eqiad from xe-5/1/1 to xe-3/1/7

Change-Id: I4dea785781b1b14b2d22dd2261bda9d950b205e8
---
M templates/154.80.208.in-addr.arpa
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/templates/154.80.208.in-addr.arpa 
b/templates/154.80.208.in-addr.arpa
index f9f0969..50036cf 100644
--- a/templates/154.80.208.in-addr.arpa
+++ b/templates/154.80.208.in-addr.arpa
@@ -132,11 +132,11 @@
 199 1H  IN PTR  mr1-eqiad.wikimedia.org.
 
 ; 208.80.154.200/31 (cr1-eqiad <--> pfw3-eqiad)
-200 1H  IN PTR  xe-5-1-1.cr1-eqiad.wikimedia.org.
+200 1H  IN PTR  xe-3-1-7.cr1-eqiad.wikimedia.org.
 201 1H  IN PTR  xe-0-0-16.pfw3-eqiad.wikimedia.org.
 
 ; 208.80.154.202/31 (cr2-eqiad <--> pfw3-eqiad)
-202 1H  IN PTR  xe-5-1-1.cr2-eqiad.wikimedia.org.
+202 1H  IN PTR  xe-3-1-7.cr2-eqiad.wikimedia.org.
 203 1H  IN PTR  xe-7-0-16.pfw3-eqiad.wikimedia.org.
 
 ; 208.80.154.204/31 (cr1-eqiad <--> mr1-eqiad)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4dea785781b1b14b2d22dd2261bda9d950b205e8
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
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/dns[master]: Move pfw3-eqiad from xe-5/1/1 to xe-3/1/7

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

Change subject: Move pfw3-eqiad from xe-5/1/1 to xe-3/1/7
..

Move pfw3-eqiad from xe-5/1/1 to xe-3/1/7

Change-Id: I4dea785781b1b14b2d22dd2261bda9d950b205e8
---
M templates/154.80.208.in-addr.arpa
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/42/373942/1

diff --git a/templates/154.80.208.in-addr.arpa 
b/templates/154.80.208.in-addr.arpa
index f9f0969..50036cf 100644
--- a/templates/154.80.208.in-addr.arpa
+++ b/templates/154.80.208.in-addr.arpa
@@ -132,11 +132,11 @@
 199 1H  IN PTR  mr1-eqiad.wikimedia.org.
 
 ; 208.80.154.200/31 (cr1-eqiad <--> pfw3-eqiad)
-200 1H  IN PTR  xe-5-1-1.cr1-eqiad.wikimedia.org.
+200 1H  IN PTR  xe-3-1-7.cr1-eqiad.wikimedia.org.
 201 1H  IN PTR  xe-0-0-16.pfw3-eqiad.wikimedia.org.
 
 ; 208.80.154.202/31 (cr2-eqiad <--> pfw3-eqiad)
-202 1H  IN PTR  xe-5-1-1.cr2-eqiad.wikimedia.org.
+202 1H  IN PTR  xe-3-1-7.cr2-eqiad.wikimedia.org.
 203 1H  IN PTR  xe-7-0-16.pfw3-eqiad.wikimedia.org.
 
 ; 208.80.154.204/31 (cr1-eqiad <--> mr1-eqiad)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4dea785781b1b14b2d22dd2261bda9d950b205e8
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Ayounsi 

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


[MediaWiki-commits] [Gerrit] mediawiki...MediaWikiFarm[master]: Split out utilitary functions into dedicated classes

2017-08-25 Thread Seb35 (Code Review)
Seb35 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373941 )

Change subject: Split out utilitary functions into dedicated classes
..

Split out utilitary functions into dedicated classes

This reduces the complexity of the main class (CRAP from 253 to 202) and make
possible the use of these functions without creating the main object. In
particular I need the function readFile for the “list wikis” feature, but
don’t need the main object.

By the way, the function dedicated to read YAML files is enclosed in a class,
so that it is a general design to have utils functions in classes.

Small thing: I remove the @author given there will be many authors in the
long term (and Git history lists the authors), and it removes one publication
on the Web of my email address, hence a source of information for spammers.

Change-Id: Id9a47bf64061ab6d292e338c750d311f96be0e32
---
M extension.json
M src/MediaWikiFarm.php
M src/MediaWikiFarmConfiguration.php
A src/Utils.php
A src/Utils5_3.php
D src/Yaml.php
M src/bin/MediaWikiFarmScriptComposer.php
M tests/phpunit/ConfigurationTest.php
M tests/phpunit/ConstructionTest.php
M tests/phpunit/FunctionsTest.php
M tests/phpunit/InstallationIndependantTest.php
M tests/phpunit/LoadingTest.php
M tests/phpunit/LoggingTest.php
M tests/phpunit/MonoversionInstallationTest.php
M tests/phpunit/MultiversionInstallationTest.php
M tests/phpunit/bin/MediaWikiFarmScriptComposerTest.php
M tests/phpunit/bin/MediaWikiFarmScriptTest.php
17 files changed, 423 insertions(+), 333 deletions(-)


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

diff --git a/extension.json b/extension.json
index 5a44c0f..2b317ab 100644
--- a/extension.json
+++ b/extension.json
@@ -32,6 +32,8 @@
"MediaWikiFarmConfiguration": 
"src/MediaWikiFarmConfiguration.php",
"AbstractMediaWikiFarmScript": 
"src/bin/AbstractMediaWikiFarmScript.php",
"MediaWikiFarmScript": "src/bin/MediaWikiFarmScript.php",
+   "MediaWikiFarmUtils": "src/Utils.php",
+   "MediaWikiFarmUtils5_3": "src/Utils5_3.php",
"MediaWikiFarmHooks": "src/Hooks.php",
"MWFConfigurationException": "src/MediaWikiFarm.php"
},
diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php
index 56c47be..3492211 100644
--- a/src/MediaWikiFarm.php
+++ b/src/MediaWikiFarm.php
@@ -3,7 +3,6 @@
  * Classes MediaWikiFarm and MWFConfigurationException.
  *
  * @package MediaWikiFarm
- * @author Sébastien Beyou ~ Seb35 
  * @license GPL-3.0+ GNU General Public License v3.0 ou version ultérieure
  * @license AGPL-3.0+ GNU Affero General Public License v3.0 ou version 
ultérieure
  *
@@ -12,6 +11,7 @@
  */
 
 // @codeCoverageIgnoreStart
+require_once dirname( __FILE__ ) . '/Utils.php';
 require_once dirname( __FILE__ ) . '/MediaWikiFarmConfiguration.php';
 // @codeCoverageIgnoreEnd
 
@@ -381,7 +381,7 @@
$variables = $this->variables;
$variables['$CORECONFIG'] = 
$this->farmConfig['coreconfig'];
$variables['$CONFIG'] = $this->farmConfig['config'];
-   self::cacheFile( $variables, 
$this->variables['$SERVER'] . '.php', $this->cacheDir . '/wikis' );
+   MediaWikiFarmUtils::cacheFile( $variables, 
$this->variables['$SERVER'] . '.php', $this->cacheDir . '/wikis' );
}
 
return true;
@@ -426,7 +426,7 @@
 
# Save Composer key if available
if( $this->cacheDir && !array_key_exists( 
'unreadable-file', $this->log ) ) {
-   self::cacheFile( $this->getConfiguration( 
'composer' ),
+   MediaWikiFarmUtils::cacheFile( 
$this->getConfiguration( 'composer' ),
$this->variables['$SERVER'] . '.php',
$this->cacheDir . '/composer'
);
@@ -444,7 +444,7 @@
 
# Create the final LocalSettings.php
if( $this->cacheDir && !array_key_exists( 
'unreadable-file', $this->log ) ) {
-   self::cacheFile( 
MediaWikiFarmConfiguration::createLocalSettings( $this->getConfiguration(), 
(bool) $this->codeDir ),
+   MediaWikiFarmUtils::cacheFile( 
MediaWikiFarmConfiguration::createLocalSettings( $this->getConfiguration(), 
(bool) $this->codeDir ),
$this->variables['$SERVER'] . '.php',
$this->cacheDir . '/LocalSettings'
);
@@ -490,7 +490,7 @@
if( !array_key_exists( $setting, $GLOBALS ) ) {
$GLOBALS[$setting] = array();
 

[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Remove $wgCodeMirrorEnableFrontend

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

Change subject: Remove $wgCodeMirrorEnableFrontend
..


Remove $wgCodeMirrorEnableFrontend

Not needed/used anymore.

Bug: T172470
Change-Id: I9aa03c97bd775248f3a2cfb316df77eb7ef86457
---
M CodeMirror.hooks.php
M extension.json
2 files changed, 5 insertions(+), 8 deletions(-)

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



diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php
index 90c3eff..84afb94 100644
--- a/CodeMirror.hooks.php
+++ b/CodeMirror.hooks.php
@@ -6,21 +6,19 @@
 * Checks, if CodeMirror should be loaded on this page or not.
 *
 * @param IContextSource $context The current ContextSource object
-* @global bool $wgCodeMirrorEnableFrontend Should CodeMirror be loaded 
on this page
 * @staticvar null|boolean $isEnabled Saves, if CodeMirror should be 
loaded on this page or not
 * @return bool
 */
private static function isCodeMirrorEnabled( IContextSource $context ) {
-   global $wgCodeMirrorEnableFrontend, $wgCodeMirrorBetaFeature;
+   global $wgCodeMirrorBetaFeature;
static $isEnabled = null;
 
// Check, if we already checked, if page action is editing, if 
not, do it now
if ( $isEnabled === null ) {
-   if ( $wgCodeMirrorEnableFrontend && 
!$wgCodeMirrorBetaFeature ) {
+   if ( !$wgCodeMirrorBetaFeature ) {
$isEnabled = in_array( Action::getActionName( 
$context ), [ 'edit', 'submit' ] );
} else {
-   $isEnabled = $wgCodeMirrorEnableFrontend &&
-   in_array( Action::getActionName( 
$context ), [ 'edit', 'submit' ] ) &&
+   $isEnabled = in_array( Action::getActionName( 
$context ), [ 'edit', 'submit' ] ) &&
$wgCodeMirrorBetaFeature &&

ExtensionRegistry::getInstance()->isLoaded( 'BetaFeatures' ) &&
BetaFeatures::isFeatureEnabled(
@@ -69,8 +67,8 @@
 * @param array $preferences
 */
public static function onGetBetaFeaturePreferences( User $user, 
&$preferences ) {
-   global $wgCodeMirrorEnableFrontend, $wgCodeMirrorBetaFeature, 
$wgExtensionAssetsPath;
-   if ( $wgCodeMirrorEnableFrontend && $wgCodeMirrorBetaFeature ) {
+   global $wgCodeMirrorBetaFeature, $wgExtensionAssetsPath;
+   if ( $wgCodeMirrorBetaFeature ) {
$preferences['codemirror-syntax-highlight'] = [
'label-message' => 'codemirror-beta-title',
'desc-message' => 'codemirror-beta-desc',
diff --git a/extension.json b/extension.json
index 2fd2286..37abc2a 100644
--- a/extension.json
+++ b/extension.json
@@ -162,7 +162,6 @@
"ext.CodeMirror.visualEditor"
],
"config": {
-   "CodeMirrorEnableFrontend": true,
"CodeMirrorBetaFeature": false
},
"CodeMirrorTagModes": {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9aa03c97bd775248f3a2cfb316df77eb7ef86457
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Add status indication when searching offline library.

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

Change subject: Add status indication when searching offline library.
..


Add status indication when searching offline library.

Bug: T166649
Change-Id: Iea2e85d31fca9383874c46c4759ee8d7d531e57f
---
M app/src/main/java/org/wikipedia/search/SearchFragment.java
M app/src/main/java/org/wikipedia/search/SearchResultsFragment.java
M app/src/main/res/layout/fragment_search.xml
M app/src/main/res/values-qq/strings.xml
M app/src/main/res/values/strings.xml
5 files changed, 39 insertions(+), 4 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/search/SearchFragment.java 
b/app/src/main/java/org/wikipedia/search/SearchFragment.java
index 81d905c..d88679e 100644
--- a/app/src/main/java/org/wikipedia/search/SearchFragment.java
+++ b/app/src/main/java/org/wikipedia/search/SearchFragment.java
@@ -29,6 +29,7 @@
 import org.wikipedia.concurrency.SaneAsyncTask;
 import org.wikipedia.database.contract.SearchHistoryContract;
 import org.wikipedia.history.HistoryEntry;
+import org.wikipedia.offline.OfflineManager;
 import org.wikipedia.page.PageTitle;
 import org.wikipedia.readinglist.AddToReadingListDialog;
 import org.wikipedia.settings.LanguagePreferenceDialog;
@@ -71,6 +72,7 @@
 @BindView(R.id.search_progress_bar) ProgressBar progressBar;
 @BindView(R.id.search_lang_button_container) View langButtonContainer;
 @BindView(R.id.search_lang_button) TextView langButton;
+@BindView(R.id.search_offline_library_state) View offlineLibraryStateView;
 private Unbinder unbinder;
 
 private WikipediaApp app;
@@ -177,6 +179,7 @@
 
 initSearchView();
 initLangButton();
+updateOfflineLibraryState();
 
 if (!TextUtils.isEmpty(query)) {
 showPanel(PANEL_SEARCH_RESULTS);
@@ -321,6 +324,7 @@
 return;
 }
 
+updateOfflineLibraryState();
 searchResultsFragment.startSearch(term, force);
 }
 
@@ -361,6 +365,12 @@
 addRecentSearch(query);
 }
 
+private void updateOfflineLibraryState() {
+offlineLibraryStateView.setVisibility(
+(OfflineManager.hasCompilation() && !DeviceUtil.isOnline())
+? View.VISIBLE : View.GONE);
+}
+
 /**
  * Show a particular panel, which can be one of:
  * - PANEL_RECENT_SEARCHES
diff --git a/app/src/main/java/org/wikipedia/search/SearchResultsFragment.java 
b/app/src/main/java/org/wikipedia/search/SearchResultsFragment.java
index 5feefee..dcb9306 100644
--- a/app/src/main/java/org/wikipedia/search/SearchResultsFragment.java
+++ b/app/src/main/java/org/wikipedia/search/SearchResultsFragment.java
@@ -205,7 +205,7 @@
 return true;
 }
 final String mySearchTerm = (String) msg.obj;
-if (!DeviceUtil.isOnline() && OfflineManager.hasCompilation()) {
+if (OfflineManager.hasCompilation() && !DeviceUtil.isOnline()) {
 doOfflineSearch(mySearchTerm);
 } else {
 doTitlePrefixSearch(mySearchTerm);
diff --git a/app/src/main/res/layout/fragment_search.xml 
b/app/src/main/res/layout/fragment_search.xml
index 15e0ef5..fec28f9 100644
--- a/app/src/main/res/layout/fragment_search.xml
+++ b/app/src/main/res/layout/fragment_search.xml
@@ -81,9 +81,7 @@
 style="@style/Widget.AppCompat.ProgressBar.Horizontal"
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
-android:layout_marginBottom="-6.5dp"
-android:layout_gravity="bottom"
-android:elevation="4dp"
+android:layout_marginTop="-6.5dp"
 android:indeterminate="true"
 android:indeterminateTint="?attr/colorAccent"
 android:progressBackgroundTint="@color/dark_blue"
@@ -93,6 +91,31 @@
 
 
 
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/values-qq/strings.xml 
b/app/src/main/res/values-qq/strings.xml
index 6f50514..3a70d9a 100644
--- a/app/src/main/res/values-qq/strings.xml
+++ b/app/src/main/res/values-qq/strings.xml
@@ -455,6 +455,7 @@
   Message shown when the offline 
library is empty.
   Explanation encouraging the 
user to download an article pack for offline use later.
   Button label for searching the 
list of possible article packs to download.
+  Label informing the user 
that the current search results are from one or more offline article 
packs.
   Button label for 
discovering more about the Offline Library.
   Label for a button for 
the user to confirm that the user is done with the tutorial for the Offline 
Library.
   Title for a 
tutorial screen about the Offline Library feature.
diff --git a/app/src/main/res/values/strings.xml 
b/app/src/main/res/values/strings.xml
index 

[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Allow user to navigate to Main Page of article pack from Det...

2017-08-25 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373940 )

Change subject: Allow user to navigate to Main Page of article pack from Detail 
screen.
..

Allow user to navigate to Main Page of article pack from Detail screen.

..., she said.

Change-Id: I03ac0dda83f52812431ec0d05686ea86397c249f
---
M app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
M app/src/main/java/org/wikipedia/offline/OfflineManager.java
M app/src/main/res/layout/fragment_compilation_detail.xml
3 files changed, 31 insertions(+), 4 deletions(-)


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

diff --git 
a/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java 
b/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
index 983af45..11bd21d 100644
--- a/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
+++ b/app/src/main/java/org/wikipedia/offline/CompilationDetailFragment.java
@@ -13,12 +13,20 @@
 import android.widget.TextView;
 
 import org.wikipedia.R;
+import org.wikipedia.WikipediaApp;
 import org.wikipedia.gallery.MediaDownloadReceiver;
+import org.wikipedia.history.HistoryEntry;
 import org.wikipedia.json.GsonMarshaller;
 import org.wikipedia.json.GsonUnmarshaller;
+import org.wikipedia.page.PageActivity;
+import org.wikipedia.page.PageTitle;
+import org.wikipedia.staticdata.MainPageNameData;
 import org.wikipedia.util.GradientUtil;
+import org.wikipedia.util.log.L;
 import org.wikipedia.views.FaceAndColorDetectImageView;
 import org.wikipedia.views.ViewUtil;
+
+import java.io.IOException;
 
 import butterknife.BindView;
 import butterknife.ButterKnife;
@@ -38,6 +46,7 @@
 @BindView(R.id.view_compilation_info_summary) TextView summaryView;
 @BindView(R.id.view_compilation_info_description) TextView descriptionView;
 @BindView(R.id.button_compilation_detail_download) TextView downloadButton;
+@BindView(R.id.button_compilation_detail_main_page) TextView 
mainPageButton;
 @BindView(R.id.compilation_detail_downloaded_buttons_container) View 
downloadedContainerView;
 @BindView(R.id.view_compilation_detail_download_control) 
CompilationDownloadControlView controls;
 
@@ -85,6 +94,7 @@
 }
 });
 
+
mainPageButton.setText(MainPageNameData.valueFor(WikipediaApp.getInstance().getAppLanguageCode()));
 updateDownloadState(true, null);
 return view;
 }
@@ -104,8 +114,16 @@
 }
 }
 
-@OnClick(R.id.button_compilation_detail_view_compilations) void 
onMyCompilationsClick() {
-getAppCompatActivity().finish();
+@OnClick(R.id.button_compilation_detail_main_page) void onMainPageClick() {
+try {
+PageTitle title = new 
PageTitle(OfflineManager.instance().getMainPageTitle(compilation),
+WikipediaApp.getInstance().getWikiSite());
+
+HistoryEntry entry = new HistoryEntry(title, 
HistoryEntry.SOURCE_MAIN_PAGE);
+startActivity(PageActivity.newIntent(getContext(), entry, 
entry.getTitle()));
+} catch (IOException e) {
+L.e(e);
+}
 }
 
 @OnClick(R.id.button_compilation_detail_remove) void onRemoveClick() {
diff --git a/app/src/main/java/org/wikipedia/offline/OfflineManager.java 
b/app/src/main/java/org/wikipedia/offline/OfflineManager.java
index 40c205c..de9a46d 100644
--- a/app/src/main/java/org/wikipedia/offline/OfflineManager.java
+++ b/app/src/main/java/org/wikipedia/offline/OfflineManager.java
@@ -171,6 +171,15 @@
 return compilations.get(compIndex).getMainPageTitle();
 }
 
+@NonNull public String getMainPageTitle(@NonNull Compilation compilation) 
throws IOException {
+for (Compilation c : compilations) {
+if (c.pathNameMatchesUri(compilation.uri())) {
+return c.getMainPageTitle();
+}
+}
+throw new IOException("No matching compilation found on disk.");
+}
+
 @VisibleForTesting void setCompilations(@NonNull List 
compilations) {
 this.compilations = compilations;
 }
diff --git a/app/src/main/res/layout/fragment_compilation_detail.xml 
b/app/src/main/res/layout/fragment_compilation_detail.xml
index 9fedcc7..875a5df 100644
--- a/app/src/main/res/layout/fragment_compilation_detail.xml
+++ b/app/src/main/res/layout/fragment_compilation_detail.xml
@@ -112,14 +112,14 @@
 
android:text="@string/offline_compilation_detail_button_remove"/>
 
 
+tools:text="Main page"/>
 
 
 https://gerrit.wikimedia.org/r/373940
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

[MediaWiki-commits] [Gerrit] mediawiki...ContactPage[master]: Remove DisplayFormat from README

2017-08-25 Thread Reedy (Code Review)
Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373939 )

Change subject: Remove DisplayFormat from README
..

Remove DisplayFormat from README

Use short arrays

Change-Id: I05f72c5686ca501eaedd8aba30aa6cd859e6ad7e
---
M README
1 file changed, 9 insertions(+), 10 deletions(-)


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

diff --git a/README b/README
index f73016c..bd960ef 100644
--- a/README
+++ b/README
@@ -32,17 +32,16 @@
 As of version 2, all configuration is done by one global variable,
 $wgContactConfig.
 
-  $wgContactConfig['formname'] = array(
+  $wgContactConfig['formname'] = [
'RecipientUser' => 'WikiUser',
'SenderEmail' => 'u...@email.com',
'SenderName' => 'User Email',
'RequireDetails' => true,
'IncludeIP' => true,
-   'AdditionalFields' => array(),
-   'DisplayFormat' => 'table',
-   'RLModules' => array(),
-   'RLStyleModules' => array(),
-  );
+   'AdditionalFields' => [],
+   'RLModules' => [],
+   'RLStyleModules' => [],
+  ];
 
 All contact form keys (in this case 'formname') should be in
 lowercase.
@@ -70,15 +69,15 @@
 
 It should be noted that type 'selectandother' is not currently supported.
 
-  'AdditionalFields' => array(
-   'Text' => array(
+  'AdditionalFields' => [
+   'Text' => [
 'label-message' => 'emailmessage',
 'type' => 'textarea',
 'rows' => 20,
 'cols' => 80,
 'required' => true,
-  ),
-  ),
+  ],
+  ],
 
 RLModules can be used to add ResourceLoader modules (custom CSS and
 JavaScript) to the page.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05f72c5686ca501eaedd8aba30aa6cd859e6ad7e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContactPage
Gerrit-Branch: master
Gerrit-Owner: Reedy 

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


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Allow sharing article packs to more arbitrary apps.

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

Change subject: Allow sharing article packs to more arbitrary apps.
..


Allow sharing article packs to more arbitrary apps.

Change-Id: I40f895cdee56923ae79aea0f4b9c5e3b07b4c45c
---
M app/src/main/java/org/wikipedia/offline/LocalCompilationsFragment.java
1 file changed, 6 insertions(+), 4 deletions(-)

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



diff --git 
a/app/src/main/java/org/wikipedia/offline/LocalCompilationsFragment.java 
b/app/src/main/java/org/wikipedia/offline/LocalCompilationsFragment.java
index 181dc52..e6b06e3 100644
--- a/app/src/main/java/org/wikipedia/offline/LocalCompilationsFragment.java
+++ b/app/src/main/java/org/wikipedia/offline/LocalCompilationsFragment.java
@@ -1,6 +1,7 @@
 package org.wikipedia.offline;
 
 import android.content.DialogInterface;
+import android.content.Intent;
 import android.net.Uri;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
@@ -27,6 +28,7 @@
 import org.wikipedia.history.SearchActionModeCallback;
 import org.wikipedia.util.DimenUtil;
 import org.wikipedia.util.ResourceUtil;
+import org.wikipedia.util.ShareUtil;
 import org.wikipedia.views.DefaultViewHolder;
 import org.wikipedia.views.DrawableItemDecoration;
 import org.wikipedia.views.PageItemView;
@@ -387,11 +389,11 @@
 }
 
 private void share(@NonNull Compilation compilation) {
-ShareCompat.IntentBuilder.from(getActivity())
-.setChooserTitle(R.string.share_via)
-.setType(Compilation.MIME_TYPE)
+Intent intent = ShareCompat.IntentBuilder.from(getActivity())
+.setType("*/*")
 .setStream(Uri.parse("file://" + compilation.path()))
-.startChooser();
+.getIntent();
+startActivity(ShareUtil.createChooserIntent(intent, 
getString(R.string.share_via), getContext()));
 }
 
 private void remove(@NonNull final Compilation compilation) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I40f895cdee56923ae79aea0f4b9c5e3b07b4c45c
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Cooltey 
Gerrit-Reviewer: Dbrant 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Sharvaniharan 
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]: statistics::private: Disable Discovery

2017-08-25 Thread Bearloga (Code Review)
Bearloga has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373938 )

Change subject: statistics::private: Disable Discovery
..

statistics::private: Disable Discovery

Manual to-dos:
- kill reportupdater process that started up last night
- remove the execution of /srv/discovery/golden/main.sh
  from discovery-stats's cron

Bug: T170494
Change-Id: I8b38f8d446d4a542614c4a35b22d20061be4213e
---
M modules/profile/manifests/statistics/private.pp
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/modules/profile/manifests/statistics/private.pp 
b/modules/profile/manifests/statistics/private.pp
index 95cf404..32836f4 100644
--- a/modules/profile/manifests/statistics/private.pp
+++ b/modules/profile/manifests/statistics/private.pp
@@ -60,5 +60,6 @@
 }
 
 # Discovery team statistics scripts and cron jobs
-include ::statistics::discovery
+# Disabled for now until T174110 is resolved
+# include ::statistics::discovery
 }

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

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

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


[MediaWiki-commits] [Gerrit] wikimedia...DjangoBannerStats[master]: Be explicit with imports

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

Change subject: Be explicit with imports
..

Be explicit with imports

Not using the full namespace as might be desired, but avoiding import *

Will help pass flake8

Change-Id: I73fbb1781150715f78216aaec5a61d4fcac21bda
---
M fundraiser/analytics/management/commands/AggregateBannerImpressions.py
M fundraiser/analytics/management/commands/LoadBannerImpressions.py
M fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py
M fundraiser/analytics/management/commands/LoadLPImpressions.py
4 files changed, 10 insertions(+), 14 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools/DjangoBannerStats 
refs/changes/36/373936/1

diff --git 
a/fundraiser/analytics/management/commands/AggregateBannerImpressions.py 
b/fundraiser/analytics/management/commands/AggregateBannerImpressions.py
index 3895efa..352741e 100644
--- a/fundraiser/analytics/management/commands/AggregateBannerImpressions.py
+++ b/fundraiser/analytics/management/commands/AggregateBannerImpressions.py
@@ -9,9 +9,7 @@
 import _mysql_exceptions
 from optparse import make_option
 
-from fundraiser.analytics.functions import *
-from fundraiser.analytics.models import *
-from fundraiser.analytics.regex import *
+from fundraiser.analytics.functions import get_language, get_project, 
roundtime, lookup_project, lookup_language
 
 
 class Command(BaseCommand):
diff --git a/fundraiser/analytics/management/commands/LoadBannerImpressions.py 
b/fundraiser/analytics/management/commands/LoadBannerImpressions.py
index 11d0752..2aaf679 100644
--- a/fundraiser/analytics/management/commands/LoadBannerImpressions.py
+++ b/fundraiser/analytics/management/commands/LoadBannerImpressions.py
@@ -13,9 +13,9 @@
 import os
 import urlparse
 
-from fundraiser.analytics.functions import *
-from fundraiser.analytics.models import *
-from fundraiser.analytics.regex import *
+from fundraiser.analytics.functions import lookup_country, lookup_language, 
lookup_project, lookup_squidhost
+from fundraiser.analytics.models import SquidLog
+from fundraiser.analytics.regex import ignore_uas, phantomJS, sampled, 
squidline
 from django.conf import settings
 
 
diff --git 
a/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py 
b/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py
index f3d2204..c643207 100644
--- 
a/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py
+++ 
b/fundraiser/analytics/management/commands/LoadBannerImpressions2Aggregate.py
@@ -1,6 +1,5 @@
 from django.core.management.base import BaseCommand
 from django.db import connections, transaction, reset_queries
-from django.db.utils import IntegrityError
 
 import gc
 from datetime import datetime, timedelta
@@ -14,10 +13,9 @@
 import os
 import urlparse
 
-# TODO: import NAME instead, so usage includes the full namespace.
-from fundraiser.analytics.functions import *
-from fundraiser.analytics.models import *
-from fundraiser.analytics.regex import *
+from fundraiser.analytics.functions import lookup_country, lookup_project, 
lookup_language, roundtime
+from fundraiser.analytics.models import SquidLog
+from fundraiser.analytics.regex import ignore_uas, phantomJS, sampled, 
squidline
 from django.conf import settings
 
 
diff --git a/fundraiser/analytics/management/commands/LoadLPImpressions.py 
b/fundraiser/analytics/management/commands/LoadLPImpressions.py
index ee25633..1c116c3 100644
--- a/fundraiser/analytics/management/commands/LoadLPImpressions.py
+++ b/fundraiser/analytics/management/commands/LoadLPImpressions.py
@@ -14,9 +14,9 @@
 from urllib import unquote
 import urlparse
 
-from fundraiser.analytics.functions import *
-from fundraiser.analytics.models import *
-from fundraiser.analytics.regex import *
+from fundraiser.analytics.functions import lookup_country, lookup_language, 
lookup_project, lookup_squidhost
+from fundraiser.analytics.models import LandingPageImpression, SquidLog
+from fundraiser.analytics.regex import ignore_uas, landingpages, squidline
 from django.conf import settings
 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73fbb1781150715f78216aaec5a61d4fcac21bda
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools/DjangoBannerStats
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] wikimedia...DjangoBannerStats[master]: Add tox.ini with flake8 config

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

Change subject: Add tox.ini with flake8 config
..

Add tox.ini with flake8 config

Ignoring long line warnings

Change-Id: Iab0aa776ceae8f3cfa4abf755c7aab4e66e732a4
---
M .gitignore
A tox.ini
2 files changed, 17 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools/DjangoBannerStats 
refs/changes/37/373937/1

diff --git a/.gitignore b/.gitignore
index 3675fba..9b171d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,5 @@
 *.pot
 *.pyc
 local_settings.py
-.idea/*
\ No newline at end of file
+.idea/*
+.tox
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000..81612a2
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,15 @@
+[tox]
+skipsdist = True
+envlist = flake8
+
+[testenv:flake8]
+commands = flake8 {posargs}
+deps = flake8
+
+[flake8]
+# E501 line too long (X > 79 characters)
+ignore=E501
+exclude =
+  .tox,
+  fundraiser/settings.py
+builtins = unicode

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab0aa776ceae8f3cfa4abf755c7aab4e66e732a4
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/tools/DjangoBannerStats
Gerrit-Branch: master
Gerrit-Owner: Ejegg 

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


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Remove reference to editfont-default

2017-08-25 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373935 )

Change subject: Remove reference to editfont-default
..

Remove reference to editfont-default

Bug: T170223
Depends-On: I1ace59c980740fc785ccbd500e19cc8b71d46a5b
Change-Id: I2ac04df04b6652b47490dff5202683c041178a2c
---
M modules/ve-mw/ui/ve.ui.MWWikitextSurface.js
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/modules/ve-mw/ui/ve.ui.MWWikitextSurface.js 
b/modules/ve-mw/ui/ve.ui.MWWikitextSurface.js
index c3654c7..759f2f2 100644
--- a/modules/ve-mw/ui/ve.ui.MWWikitextSurface.js
+++ b/modules/ve-mw/ui/ve.ui.MWWikitextSurface.js
@@ -21,7 +21,6 @@
 
// Initialization
// The following classes can be used here:
-   // * mw-editfont-default
// * mw-editfont-monospace
// * mw-editfont-sans-serif
// * mw-editfont-serif

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ac04df04b6652b47490dff5202683c041178a2c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders 

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


[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Remove reference to editfont-default

2017-08-25 Thread Esanders (Code Review)
Esanders has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373934 )

Change subject: Remove reference to editfont-default
..

Remove reference to editfont-default

Bug: T170223
Depends-On: I1ace59c980740fc785ccbd500e19cc8b71d46a5b
Change-Id: I1e0dcab462aaa8c924b49d42f8679359a449a62e
---
M resources/modules/ve-cm/ve.ui.CodeMirrorAction.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/resources/modules/ve-cm/ve.ui.CodeMirrorAction.js 
b/resources/modules/ve-cm/ve.ui.CodeMirrorAction.js
index cf42607..418cca2 100644
--- a/resources/modules/ve-cm/ve.ui.CodeMirrorAction.js
+++ b/resources/modules/ve-cm/ve.ui.CodeMirrorAction.js
@@ -61,7 +61,7 @@
 
// The VE/CM overlay technique only works with monospace fonts 
(as we use width-changing bold as a highlight)
// so revert any editfont user preference
-   surfaceView.$element.removeClass( 'mw-editfont-default 
mw-editfont-sans-serif mw-editfont-serif' ).addClass( 'mw-editfont-monospace' );
+   surfaceView.$element.removeClass( 'mw-editfont-sans-serif 
mw-editfont-serif' ).addClass( 'mw-editfont-monospace' );
 
surfaceView.$documentNode.addClass(
'WebkitTextFillColor' in document.body.style ?

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

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

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


  1   2   3   >