[MediaWiki-commits] [Gerrit] operations/puppet[production]: xenon: pass --mindwidth to flamegraph.pl

2017-11-13 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/390645 )

Change subject: xenon: pass --mindwidth to flamegraph.pl
..


xenon: pass --mindwidth to flamegraph.pl

The flame graphs are currently slow to download and slow to render
because the weight threshold for plotting a function is very low.
Increasing the threshold (via --mindwidth=2) causes flamegraph.pl to
omit leaf functions that have a tiny footprint. The resultant flame
graph still contains anything anyone would reasonably care about, but is
more than ten times smaller (600k -> 50k) and renders instantly.

Change-Id: I0a01c694374799718662e16a974decfaf0589ca1
---
M modules/xenon/files/xenon-generate-svgs
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/xenon/files/xenon-generate-svgs 
b/modules/xenon/files/xenon-generate-svgs
index f2ad376..8b40f07 100755
--- a/modules/xenon/files/xenon-generate-svgs
+++ b/modules/xenon/files/xenon-generate-svgs
@@ -11,11 +11,11 @@
 mkdir -m0755 -p "$(dirname $svg)"
 [ ! -f "$svg" -o "$svg" -ot "$log" ] && {
 echo "Generating ${svg}..."
-nice /usr/local/bin/flamegraph.pl --title="$title" "$log" | gzip -9 > 
"$svg"
+nice /usr/local/bin/flamegraph.pl --minwidth=2 --title="$title" "$log" 
| gzip -9 > "$svg"
 }
 [ ! -f "$rsvg" -o "$rsvg" -ot "$log" ] && {
 echo "Generating ${rsvg}..."
-nice /usr/local/bin/flamegraph.pl --reverse --colors=blue 
--title="$title - reversed" "$log" | gzip -9 > "$rsvg"
+nice /usr/local/bin/flamegraph.pl --minwidth=2 --reverse --colors=blue 
--title="$title - reversed" "$log" | gzip -9 > "$rsvg"
 }
 done
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a01c694374799718662e16a974decfaf0589ca1
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: xenon: pass --mindwidth to flamegraph.pl

2017-11-11 Thread Ori.livneh (Code Review)
Hello Aaron Schulz, Krinkle,

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

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

to review the following change.


Change subject: xenon: pass --mindwidth to flamegraph.pl
..

xenon: pass --mindwidth to flamegraph.pl

The flame graphs are currently slow to download and slow to render
because the weight threshold for plotting a function is very low.
Increasing the threshold (via --mindwidth=2) causes flamegraph.pl to
omit leaf functions that have a tiny footprint. The resultant flame
graph still contains anything anyone would reasonably care about, but is
more than ten times smaller (600k -> 50k) and renders instantly.

Change-Id: I0a01c694374799718662e16a974decfaf0589ca1
---
M modules/xenon/files/xenon-generate-svgs
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/modules/xenon/files/xenon-generate-svgs 
b/modules/xenon/files/xenon-generate-svgs
index f2ad376..8b40f07 100755
--- a/modules/xenon/files/xenon-generate-svgs
+++ b/modules/xenon/files/xenon-generate-svgs
@@ -11,11 +11,11 @@
 mkdir -m0755 -p "$(dirname $svg)"
 [ ! -f "$svg" -o "$svg" -ot "$log" ] && {
 echo "Generating ${svg}..."
-nice /usr/local/bin/flamegraph.pl --title="$title" "$log" | gzip -9 > 
"$svg"
+nice /usr/local/bin/flamegraph.pl --minwidth=2 --title="$title" "$log" 
| gzip -9 > "$svg"
 }
 [ ! -f "$rsvg" -o "$rsvg" -ot "$log" ] && {
 echo "Generating ${rsvg}..."
-nice /usr/local/bin/flamegraph.pl --reverse --colors=blue 
--title="$title - reversed" "$log" | gzip -9 > "$rsvg"
+nice /usr/local/bin/flamegraph.pl --minwidth=2 --reverse --colors=blue 
--title="$title - reversed" "$log" | gzip -9 > "$rsvg"
 }
 done
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a01c694374799718662e16a974decfaf0589ca1
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: xenon: encode the request method as a virtual stack frame

2017-11-08 Thread Ori.livneh (Code Review)
Hello Aaron Schulz, Krinkle,

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

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

to review the following change.


Change subject: xenon: encode the request method as a virtual stack frame
..

xenon: encode the request method as a virtual stack frame

The workloads for handling GET and POST requests are pretty distinct,
but the current xenon setup lumps them together. This change will
prepend the request method as the bottommost frame of each stack trace.

In other words, if before you had:

  +--+
  | f3() |
  +--+--+---+
  | f1()| f2()  |
  +-+---+--+
  | caller_function()  |
  ++

Now you'll have:

  +--+
  | f3() |
  ++--+
  | f1()   | f2() |
  ++--++-...
  | caller_function()  |
  ++---...
  | {POST} | {GET}
  ++-...

An alternative solution would be to combine the request method with
entry point (i.e., going from 'api.php' to 'api.php_GET', 'api.php_POST').
I think the approach taken here is neater.

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


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

diff --git a/wmf-config/StartProfiler.php b/wmf-config/StartProfiler.php
index a3edd97..14dc53d 100644
--- a/wmf-config/StartProfiler.php
+++ b/wmf-config/StartProfiler.php
@@ -83,6 +83,7 @@
}
 
$entryPoint = basename( $_SERVER['SCRIPT_NAME'] );
+   $reqMethod = '{' . $_SERVER['REQUEST_METHOD'] . '}';
 
// Collate stack samples and fold into single lines.
// This is the format expected by FlameGraph.
@@ -120,6 +121,7 @@
if ( strpos( end( $stack ), $entryPoint ) !== 
false ) {
array_pop( $stack );
}
+   $stack[] = $reqMethod;
$stack[] = $entryPoint;
 
$strStack = implode( ';', array_reverse( $stack 
) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49cb3a9653a6ebc0e3093674a3aad68a437a8056
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Update my (ori) keys

2017-10-30 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387301 )

Change subject: Update my (ori) keys
..

Update my (ori) keys

One of my YKs got damaged, and the other is unrecoverable due to my
having exceeded the PIN retry limit.

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

This is to confirm that I am the owner of this key:
256 SHA256:LwL4wiRLTNwVMy/bD7sLzfiNBDyZ/oW2SWbw+ptXorc ori@mbp (ED25519)
-BEGIN PGP SIGNATURE-

iQEzBAEBCAAdFiEEGcl6KelLR+uKsFl/5wq9rqidWgcFAln3YrgACgkQ5wq9rqid
WgcAIQgAjn7J+rsCpBp4kwwX4/VGCgSZ27gZ8AMrwPTobNvpni6EgZIre8wZvvx4
jTNwRziDp6rjmqQHTKKMwGQpJapnRTv/lfXxj7BfIg+zs0v7OAEsNvAfUEovoFv4
QoOk3dpKyUwnj0GM0l+0rScePVTCbffP+km3DbTLsqYJmRgQ4sxc3gZWAePyBR6O
tfmWJriSOTE26YZWyfSjZHP5FC7NeDtZuKMkUzdLNIPqTmCdObFk1Of8wi99fH7Y
23eOuv6hM5Bgw2jVt7bkaBiohs+GXaoPpr8fiM8Q1rVVWHtbfRu/f04tJkDNn/GG
Y3mnf2UJr63TItWIa7jMsrnAO++ysA==
=9sKw
-END PGP SIGNATURE-

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


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/01/387301/1

diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index 029e4c4..6a628a7 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -1484,8 +1484,7 @@
 name: ori
 realname: Ori Livneh
 ssh_keys:
-  - ssh-rsa 
B3NzaC1yc2EDAQABAAABAQCwniGVe6HpYxdbN9IQl+Lb0n0tJE1/KfywrHP0x+7FwK6piUP+sj3IsoZXrxS2TGOQ1pJ6FFaHUDskt5coGX5QmAQXJjsGVU3cQkuARvQGZ3Y3SvUSqJ5Sn3s5fVTPWWbQfNkhE4ARuA2GhiJMyGRGvy5SFKwcim+cUSt95vy+rKWi+Qptb25gGC2SMbaaZX97N6LWj7JOVoodgeyG2S8t3lxIi2U7fUKRShVmZWFSfD3KnspFN9TsTYskQjzizDVYUyw5qpDDL/u/ycGGXwgcI7c8ZD5LvtE8rzkG+a+79xdT1xkhWXavO4OWN6iIB/GpoFkFW+G2ldh3sNnhvgM9
 wmf
-  - ssh-rsa 
B3NzaC1yc2EDAQABAAABAQCaDwtmxgjrgNp4cp9ArJmQagmkAr5GXEwwpDgtH2wVqDCCB7DiMcdd8cxjQnf548ZuVpR2OL1R4n7duH+J1HK9rNoqlKE/Zjx+FT+yKVqVdPH6ZmXOcuVPEmSyuHhpI0Faw9JWlTzx67wIXM3DLWbacA1PEcRxNaFtJ9qc/47poVvNqL73jHoQI+MQvAyu+0wqwiE2RdqWb4Sr+iAd3ioGQQtwQqrHuCUInaxPHu1i9t1R2ENb2Ek/TD2BgGke8ljyKkeLy9bf/xHI1CgLmt5RwJ6vRFj6G0gof4GXEC0wqJAxMtQMqU4Xl2jQhP0Evs82Qoxz/hPzPCMSEmb5GDd9
 nano
+  - ssh-ed25519 
C3NzaC1lZDI1NTE5IHkD0ImOND0E9x7bUV7AntCGmaHBUGGJVal/IEGFEPcM ori@mbp
 uid: 2220
 email: ori.liv...@gmail.com
   jkrauska:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I024805ad57b1d8f3772d80a9c2cc76a79b82899f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

___
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 $wgAutoloadAttemptLowercase to false

2017-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/386384 )

Change subject: Set $wgAutoloadAttemptLowercase to false
..

Set $wgAutoloadAttemptLowercase to false

No autoloader.log entries since Monday.

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 4e3ef43..62c49f6 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19661,6 +19661,11 @@
'default' => [ 'DISPLAY' => ':99' ],
 ],
 
+// T166759
+'wgAutoloadAttemptLowercase' => [
+   'default' => false,
+],
+
 ];
 
 ### WMF Labs override #

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26c3e7d72b68ef4de7c2a2ee9cbbf765fd963602
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: labs: Set $wgAutoloadAttemptLowercase to false

2017-10-23 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385978 )

Change subject: labs: Set $wgAutoloadAttemptLowercase to false
..

labs: Set $wgAutoloadAttemptLowercase to false

In preparation for setting the same value for prod. It's already set in
MW-Vagrant and Jenkins.

Bug: T166759
Change-Id: I3278c74055427f95a0ea3920e70254b069522d73
---
M wmf-config/InitialiseSettings-labs.php
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings-labs.php 
b/wmf-config/InitialiseSettings-labs.php
index 6d234ef..33e315c 100644
--- a/wmf-config/InitialiseSettings-labs.php
+++ b/wmf-config/InitialiseSettings-labs.php
@@ -674,5 +674,9 @@
'wgOresDraftQualityNS' => [
'enwiki' => [ 0 => true, 118 => true ],
],
+
+   'wgAutoloadAttemptLowercase' => [
+   'default' => false,
+   ],
];
 } # wmflLabsSettings()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3278c74055427f95a0ea3920e70254b069522d73
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] integration/jenkins[master]: Add $wgAutoloadAttemptLowercase = false to dev settings

2017-10-20 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385405 )

Change subject: Add $wgAutoloadAttemptLowercase = false to dev settings
..

Add $wgAutoloadAttemptLowercase = false to dev settings

$wgAutoloadAttemptLowercase was really only meant to accomodate
references to classes that were forcibly lowercased by PHP4
serialization in old database entries. Having it on by default masks
programming errors, which Jenkins should be surfacing instead.

Change-Id: Ifb11b4e20942437e2a223daaa8eda7fb5c590433
---
M mediawiki/conf.d/00_dev_settings.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins 
refs/changes/05/385405/1

diff --git a/mediawiki/conf.d/00_dev_settings.php 
b/mediawiki/conf.d/00_dev_settings.php
index 064303d..edb2883 100644
--- a/mediawiki/conf.d/00_dev_settings.php
+++ b/mediawiki/conf.d/00_dev_settings.php
@@ -44,3 +44,6 @@
 $wgDebugLogGroups['error'] = "$wmgMwLogDir/mw-error.log";
 // Back-compat
 $wgRateLimitLog = $wgDebugLogGroups['ratelimit'];
+
+// Be strict about class name letter-case.
+$wgAutoloadAttemptLowercase = false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb11b4e20942437e2a223daaa8eda7fb5c590433
Gerrit-PatchSet: 1
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[wmf/1.31.0-wmf.4]: Fix class name letter-case

2017-10-19 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385311 )

Change subject: Fix class name letter-case
..

Fix class name letter-case

Change-Id: Ifbbe537e8cac8b022793e4398c30dfdd148b4bfe
---
M special/SpecialOATHEnable.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/11/385311/1

diff --git a/special/SpecialOATHEnable.php b/special/SpecialOATHEnable.php
index fac981f..330e19f 100644
--- a/special/SpecialOATHEnable.php
+++ b/special/SpecialOATHEnable.php
@@ -184,7 +184,7 @@
private function createResourceList( $resources ) {
$resourceList = '';
foreach ( $resources as $resource ) {
-   $resourceList .= Html::rawElement( 'li', [], 
HTML::rawElement( 'kbd', [], $resource ) );
+   $resourceList .= Html::rawElement( 'li', [], 
Html::rawElement( 'kbd', [], $resource ) );
}
return Html::rawElement( 'ul', [], $resourceList );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifbbe537e8cac8b022793e4398c30dfdd148b4bfe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: wmf/1.31.0-wmf.4
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki...TwoColConflict[wmf/1.31.0-wmf.4]: Fix class name letter-case

2017-10-19 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385310 )

Change subject: Fix class name letter-case
..

Fix class name letter-case

Change-Id: I1bccc8a72e0fe33939c7db4a60a80bc12b8fb6ff
---
M includes/SpecialConflictTestPage/TwoColConflictTestPage.php
M includes/TwoColConflictPage.php
2 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwoColConflict 
refs/changes/10/385310/1

diff --git a/includes/SpecialConflictTestPage/TwoColConflictTestPage.php 
b/includes/SpecialConflictTestPage/TwoColConflictTestPage.php
index 1b30b9a..a2b75de 100644
--- a/includes/SpecialConflictTestPage/TwoColConflictTestPage.php
+++ b/includes/SpecialConflictTestPage/TwoColConflictTestPage.php
@@ -92,8 +92,8 @@
$editableYourVersionText = $this->toEditText( $this->textbox1 );
$editableCurrentVersionText = $this->conflictingTestText;
 
-   return HTML::input( 'mw-twocolconflict-your-text', 
$editableYourVersionText, 'hidden' ) .
-   HTML::input( 'mw-twocolconflict-current-text', 
$editableCurrentVersionText, 'hidden' );
+   return Html::input( 'mw-twocolconflict-your-text', 
$editableYourVersionText, 'hidden' ) .
+   Html::input( 'mw-twocolconflict-current-text', 
$editableCurrentVersionText, 'hidden' );
}
 
/**
diff --git a/includes/TwoColConflictPage.php b/includes/TwoColConflictPage.php
index 864c874..f950a45 100644
--- a/includes/TwoColConflictPage.php
+++ b/includes/TwoColConflictPage.php
@@ -74,8 +74,8 @@
 * @return string
 */
private function addEditFormBeforeContent() {
-   $out = HTML::input( 'mw-twocolconflict-submit', 'true', 
'hidden' );
-   $out = HTML::input( 'mw-twocolconflict-title', 
$this->getTitle()->getText(), 'hidden' );
+   $out = Html::input( 'mw-twocolconflict-submit', 'true', 
'hidden' );
+   $out = Html::input( 'mw-twocolconflict-title', 
$this->getTitle()->getText(), 'hidden' );
$out .= $this->buildConflictPageChangesCol();
 
$editorClass = '';
@@ -332,8 +332,8 @@
$editableYourVersionText = $this->toEditText( $this->textbox1 );
$editableCurrentVersionText = $this->toEditText( 
$this->getCurrentContent() );
 
-   return HTML::input( 'mw-twocolconflict-your-text', 
$editableYourVersionText, 'hidden' ) .
-   HTML::input( 'mw-twocolconflict-current-text', 
$editableCurrentVersionText, 'hidden' );
+   return Html::input( 'mw-twocolconflict-your-text', 
$editableYourVersionText, 'hidden' ) .
+   Html::input( 'mw-twocolconflict-current-text', 
$editableCurrentVersionText, 'hidden' );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bccc8a72e0fe33939c7db4a60a80bc12b8fb6ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TwoColConflict
Gerrit-Branch: wmf/1.31.0-wmf.4
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki...TwoColConflict[master]: Fix class name letter-case

2017-10-19 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385276 )

Change subject: Fix class name letter-case
..

Fix class name letter-case

Change-Id: I1bccc8a72e0fe33939c7db4a60a80bc12b8fb6ff
---
M includes/SpecialConflictTestPage/TwoColConflictTestPage.php
M includes/TwoColConflictPage.php
2 files changed, 6 insertions(+), 6 deletions(-)


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

diff --git a/includes/SpecialConflictTestPage/TwoColConflictTestPage.php 
b/includes/SpecialConflictTestPage/TwoColConflictTestPage.php
index 1b30b9a..a2b75de 100644
--- a/includes/SpecialConflictTestPage/TwoColConflictTestPage.php
+++ b/includes/SpecialConflictTestPage/TwoColConflictTestPage.php
@@ -92,8 +92,8 @@
$editableYourVersionText = $this->toEditText( $this->textbox1 );
$editableCurrentVersionText = $this->conflictingTestText;
 
-   return HTML::input( 'mw-twocolconflict-your-text', 
$editableYourVersionText, 'hidden' ) .
-   HTML::input( 'mw-twocolconflict-current-text', 
$editableCurrentVersionText, 'hidden' );
+   return Html::input( 'mw-twocolconflict-your-text', 
$editableYourVersionText, 'hidden' ) .
+   Html::input( 'mw-twocolconflict-current-text', 
$editableCurrentVersionText, 'hidden' );
}
 
/**
diff --git a/includes/TwoColConflictPage.php b/includes/TwoColConflictPage.php
index 864c874..f950a45 100644
--- a/includes/TwoColConflictPage.php
+++ b/includes/TwoColConflictPage.php
@@ -74,8 +74,8 @@
 * @return string
 */
private function addEditFormBeforeContent() {
-   $out = HTML::input( 'mw-twocolconflict-submit', 'true', 
'hidden' );
-   $out = HTML::input( 'mw-twocolconflict-title', 
$this->getTitle()->getText(), 'hidden' );
+   $out = Html::input( 'mw-twocolconflict-submit', 'true', 
'hidden' );
+   $out = Html::input( 'mw-twocolconflict-title', 
$this->getTitle()->getText(), 'hidden' );
$out .= $this->buildConflictPageChangesCol();
 
$editorClass = '';
@@ -332,8 +332,8 @@
$editableYourVersionText = $this->toEditText( $this->textbox1 );
$editableCurrentVersionText = $this->toEditText( 
$this->getCurrentContent() );
 
-   return HTML::input( 'mw-twocolconflict-your-text', 
$editableYourVersionText, 'hidden' ) .
-   HTML::input( 'mw-twocolconflict-current-text', 
$editableCurrentVersionText, 'hidden' );
+   return Html::input( 'mw-twocolconflict-your-text', 
$editableYourVersionText, 'hidden' ) .
+   Html::input( 'mw-twocolconflict-current-text', 
$editableCurrentVersionText, 'hidden' );
}
 
/**

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Fix class name letter-case

2017-10-19 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/385274 )

Change subject: Fix class name letter-case
..

Fix class name letter-case

Change-Id: Ifbbe537e8cac8b022793e4398c30dfdd148b4bfe
---
M special/SpecialOATHEnable.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/special/SpecialOATHEnable.php b/special/SpecialOATHEnable.php
index fac981f..330e19f 100644
--- a/special/SpecialOATHEnable.php
+++ b/special/SpecialOATHEnable.php
@@ -184,7 +184,7 @@
private function createResourceList( $resources ) {
$resourceList = '';
foreach ( $resources as $resource ) {
-   $resourceList .= Html::rawElement( 'li', [], 
HTML::rawElement( 'kbd', [], $resource ) );
+   $resourceList .= Html::rawElement( 'li', [], 
Html::rawElement( 'kbd', [], $resource ) );
}
return Html::rawElement( 'ul', [], $resourceList );
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Set $wgAutoloadAttemptLowercase to false

2017-10-17 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384654 )

Change subject: Set $wgAutoloadAttemptLowercase to false
..

Set $wgAutoloadAttemptLowercase to false

As a prelude to Wikimedia turning it off in production, and (one can
hope) it becoming the default in MediaWiki one day.

Change-Id: I3a0383eb232a6398b05fcf5a3297861d395a297f
---
M LocalSettings.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/54/384654/1

diff --git a/LocalSettings.php b/LocalSettings.php
index 85c32f2..9711744 100644
--- a/LocalSettings.php
+++ b/LocalSettings.php
@@ -128,3 +128,6 @@
 MediaWiki\Logger\LoggerFactory::registerProvider(
ObjectFactory::getObjectFromSpec( $wgMWLoggerDefaultSpi )
 );
+
+// Don't gloss over errors in class name letter-case.
+$wgAutoloadAttemptLowercase = false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a0383eb232a6398b05fcf5a3297861d395a297f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki...MassMessage[master]: Fix letter-case of class name

2017-10-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384310 )

Change subject: Fix letter-case of class name
..

Fix letter-case of class name

Bug: T166759
Change-Id: I55521054bd811700442a82ad233572faa207b062
---
M includes/SpecialMassMessage.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MassMessage 
refs/changes/10/384310/1

diff --git a/includes/SpecialMassMessage.php b/includes/SpecialMassMessage.php
index 73d90d6..9ab37e7 100644
--- a/includes/SpecialMassMessage.php
+++ b/includes/SpecialMassMessage.php
@@ -60,7 +60,7 @@
$this->state = 'form';
}
 
-   $form = new HtmlForm( $this->createForm(), $context );
+   $form = new HTMLForm( $this->createForm(), $context );
$form->setId( 'mw-massmessage-form' );
$form->setDisplayFormat( 'div' );
if ( $this->state === 'form' ) {

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...UploadWizard[master]: Fix letter-case of class name

2017-10-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384309 )

Change subject: Fix letter-case of class name
..

Fix letter-case of class name

Bug: T166759
Change-Id: Ida0074d45823baa0e8e4fbe558a4f96b53e88205
---
M includes/UploadWizardFlickrBlacklist.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/includes/UploadWizardFlickrBlacklist.php 
b/includes/UploadWizardFlickrBlacklist.php
index 35991df..8bcc872 100644
--- a/includes/UploadWizardFlickrBlacklist.php
+++ b/includes/UploadWizardFlickrBlacklist.php
@@ -133,7 +133,7 @@
'nojsoncallback' => 1,
],
];
-   $response = HTTP::post( $this->flickrApiUrl, $params );
+   $response = Http::post( $this->flickrApiUrl, $params );
if ( $response !== false ) {
$response = json_decode( $response, true );
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...PageAssessments[master]: Fix class name letter-case

2017-10-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384308 )

Change subject: Fix class name letter-case
..

Fix class name letter-case

Bug: T166759
Change-Id: If5d3ba520e625ca6e00943306b5381af25e512df
---
M src/SpecialPage.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/src/SpecialPage.php b/src/SpecialPage.php
index 619fdab..603bd12 100644
--- a/src/SpecialPage.php
+++ b/src/SpecialPage.php
@@ -129,8 +129,8 @@
break;
}
}
-   $html .= HTML::closeElement( 'tbody' )
-   . HTML::closeElement( 'table' );
+   $html .= Html::closeElement( 'tbody' )
+   . Html::closeElement( 'table' );
$out->addHTML( $html );
return true;
}

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix letter-case of XML

2017-10-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384303 )

Change subject: Fix letter-case of XML
..

Fix letter-case of XML

Bug: T166759
Change-Id: Ief6834016add694d2ce11974b5ae21562fd9bd33
---
M repo/includes/Modules/PropertyValueExpertsModule.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/repo/includes/Modules/PropertyValueExpertsModule.php 
b/repo/includes/Modules/PropertyValueExpertsModule.php
index 063c9a5..928af32 100644
--- a/repo/includes/Modules/PropertyValueExpertsModule.php
+++ b/repo/includes/Modules/PropertyValueExpertsModule.php
@@ -22,7 +22,7 @@
}
 
public function getScript( ResourceLoaderContext $context ) {
-   $expertModuleMap = \XML::encodeJsVar( 
$this->dataTypeDefinitions->getExpertModules() );
+   $expertModuleMap = \Xml::encodeJsVar( 
$this->dataTypeDefinitions->getExpertModules() );
 
$js = <

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix letter-case of several namespace and class names

2017-10-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384301 )

Change subject: Fix letter-case of several namespace and class names
..

Fix letter-case of several namespace and class names

'Mediawiki\Widget\SelectWithInputWidget' is the only one that shows up
in the logs, but I tidied up a few others I came across.

Change-Id: I700dec858007a8013e6d7b9e37ddf518f223d8b7
---
M includes/Preferences.php
M includes/htmlform/fields/HTMLSelectAndOtherField.php
M includes/htmlform/fields/HTMLSelectOrOtherField.php
M includes/specials/SpecialExport.php
M includes/specials/SpecialPreferences.php
M includes/specials/pagers/NewPagesPager.php
6 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/01/384301/1

diff --git a/includes/Preferences.php b/includes/Preferences.php
index ba90121..94854fa 100644
--- a/includes/Preferences.php
+++ b/includes/Preferences.php
@@ -1350,7 +1350,7 @@
 * @param IContextSource $context
 * @param string $formClass
 * @param array $remove Array of items to remove
-* @return PreferencesForm|HtmlForm
+* @return PreferencesForm|HTMLForm
 */
static function getFormObject(
$user,
diff --git a/includes/htmlform/fields/HTMLSelectAndOtherField.php 
b/includes/htmlform/fields/HTMLSelectAndOtherField.php
index 910a053..cdb8f5b 100644
--- a/includes/htmlform/fields/HTMLSelectAndOtherField.php
+++ b/includes/htmlform/fields/HTMLSelectAndOtherField.php
@@ -126,7 +126,7 @@
}
 
public function getInputWidget( $params ) {
-   return new Mediawiki\Widget\SelectWithInputWidget( $params );
+   return new MediaWiki\Widget\SelectWithInputWidget( $params );
}
 
/**
diff --git a/includes/htmlform/fields/HTMLSelectOrOtherField.php 
b/includes/htmlform/fields/HTMLSelectOrOtherField.php
index f6c0b07..fb133f2 100644
--- a/includes/htmlform/fields/HTMLSelectOrOtherField.php
+++ b/includes/htmlform/fields/HTMLSelectOrOtherField.php
@@ -136,7 +136,7 @@
}
 
public function getInputWidget( $params ) {
-   return new Mediawiki\Widget\SelectWithInputWidget( $params );
+   return new MediaWiki\Widget\SelectWithInputWidget( $params );
}
 
/**
diff --git a/includes/specials/SpecialExport.php 
b/includes/specials/SpecialExport.php
index 8e6c446..eb7be51 100644
--- a/includes/specials/SpecialExport.php
+++ b/includes/specials/SpecialExport.php
@@ -23,7 +23,7 @@
  * @ingroup SpecialPage
  */
 
-use Mediawiki\MediaWikiServices;
+use MediaWiki\MediaWikiServices;
 
 /**
  * A special page that allows users to export pages in a XML file
diff --git a/includes/specials/SpecialPreferences.php 
b/includes/specials/SpecialPreferences.php
index ba5a57e..7c55e5c 100644
--- a/includes/specials/SpecialPreferences.php
+++ b/includes/specials/SpecialPreferences.php
@@ -121,7 +121,7 @@
 * Get the preferences form to use.
 * @param User $user The user.
 * @param IContextSource $context The context.
-* @return PreferencesForm|HtmlForm
+* @return PreferencesForm|HTMLForm
 */
protected function getFormObject( $user, IContextSource $context ) {
return Preferences::getFormObject( $user, $context );
diff --git a/includes/specials/pagers/NewPagesPager.php 
b/includes/specials/pagers/NewPagesPager.php
index 53362d9..a87bbb7 100644
--- a/includes/specials/pagers/NewPagesPager.php
+++ b/includes/specials/pagers/NewPagesPager.php
@@ -28,7 +28,7 @@
protected $opts;
 
/**
-* @var HtmlForm
+* @var HTMLForm
 */
protected $mForm;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I700dec858007a8013e6d7b9e37ddf518f223d8b7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add lowercase variants to the autoloader for legacy history ...

2017-10-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384288 )

Change subject: Add lowercase variants to the autoloader for legacy history 
blob classes
..

Add lowercase variants to the autoloader for legacy history blob classes

Blobs in the text table created by MediaWiki <1.5 running on PHP 4 had class
names coerced to lowercase. In order to succcessfully resolve these class
names, the autoloader creates a copy of the autoload class array with
lowercased keys, which is pretty inefficient. So instead, make sure the
auto-generated autoload map contains lowercase variants for these specific
classes.

Bug: T166759
Change-Id: I6d751ef516e936e04c056d70a1ecd17960a39ceb
---
M autoload.php
M includes/HistoryBlob.php
2 files changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/88/384288/1

diff --git a/autoload.php b/autoload.php
index a489b8b..83f2519 100644
--- a/autoload.php
+++ b/autoload.php
@@ -1706,5 +1706,8 @@
'ZhConverter' => __DIR__ . '/languages/classes/LanguageZh.php',
'ZipDirectoryReader' => __DIR__ . 
'/includes/utils/ZipDirectoryReader.php',
'ZipDirectoryReaderError' => __DIR__ . 
'/includes/utils/ZipDirectoryReaderError.php',
+   'concatenatedgziphistoryblob' => __DIR__ . '/includes/HistoryBlob.php',
+   'historyblobcurstub' => __DIR__ . '/includes/HistoryBlob.php',
+   'historyblobstub' => __DIR__ . '/includes/HistoryBlob.php',
'profile_point' => __DIR__ . '/profileinfo.php',
 ];
diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php
index 51bd7a9..61646ae 100644
--- a/includes/HistoryBlob.php
+++ b/includes/HistoryBlob.php
@@ -699,3 +699,14 @@
}
 
 }
+
+if ( false ) {
+   // Blobs generated by MediaWiki < 1.5 on PHP 4 were serialized with the
+   // class name coerced to lowercase. We can improve efficiency by adding
+   // autoload entries for the lowercase variants of these classes. The 
code
+   // below is never executed, but it is picked up by the AutoloadGenerator
+   // parser, which scans for class_alias() calls.
+   class_alias( 'ConcatenatedGzipHistoryBlob', 
'concatenatedgziphistoryblob' );
+   class_alias( 'HistoryBlobCurStub', 'historyblobcurstub' );
+   class_alias( 'HistoryBlobStub', 'historyblobstub' );
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d751ef516e936e04c056d70a1ecd17960a39ceb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] performance/docroot[master]: Minor language tweak

2017-06-05 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357329 )

Change subject: Minor language tweak
..

Minor language tweak

Change-Id: If5f584c7c976492e8ab94c9d5ee690d3cea59c74
---
M public_html/index.html
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/performance/docroot 
refs/changes/29/357329/1

diff --git a/public_html/index.html b/public_html/index.html
index 2509769..cc4baf6 100644
--- a/public_html/index.html
+++ b/public_html/index.html
@@ -63,7 +63,7 @@
   Wikimedia Performance
   
   
-We continuously monitor the performance of https://www.wikipedia.org/;>Wikipedia. These graphs are sampled 
measurements from 1 of 1000 requests. If you want to dig deeper into our 
metrics you should checkout our https://grafana.wikimedia.org/dashboard/db/performance-metrics;>Grafana 
graphs.
+We monitor the performance of https://www.wikipedia.org/;>Wikipedia continuously. These graphs are 
sampled measurements from 1 of 1000 requests. If you want to dig deeper into 
our metrics, you should check out our https://grafana.wikimedia.org/dashboard/db/performance-metrics;>Grafana 
graphs.
   
   
 https://www.mediawiki.org/wiki/Wikimedia_Performance_Team;>– 
Wikimedia Performance Team

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5f584c7c976492e8ab94c9d5ee690d3cea59c74
Gerrit-PatchSet: 1
Gerrit-Project: performance/docroot
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Capture messages on 'autoloader' debug log channel

2017-06-02 Thread Ori.livneh (Code Review)
Hello Aaron Schulz, Krinkle,

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

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

to review the following change.


Change subject: Capture messages on 'autoloader' debug log channel
..

Capture messages on 'autoloader' debug log channel

To help determine whether $wgAutoloadAttemptLowercase is still needed.

BUG: T166759
Change-Id: Ia7ef9e90aea077754386f9263b37240a7ab3a634
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index d6f1409..63d3723 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -4884,6 +4884,7 @@
'buffer' => true,
],
'authentication' => 'info',
+   'autoloader' => 'debug',  // ori, for T166759 (2017-06-02)
'badpass' => 'debug',
'BounceHandler' => 'debug',
'Bug58676' => 'debug', # Invalid message parameter

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7ef9e90aea077754386f9263b37240a7ab3a634
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Add X-Wikimedia-Debug config

2016-11-21 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Add X-Wikimedia-Debug config
..

Add X-Wikimedia-Debug config

Add ./debug.json, which holds configuration data for the
X-Wikimedia-Debug browser extensions. The extensions will fetch this
from  and use it to configure
themselves.

Change-Id: If2e88633b1ad70b2eb483f4bba7858f173236ed7
---
M README
A debug.json
A docroot/noc/conf/debug.json
M docroot/noc/createTxtFileSymlinks.sh
4 files changed, 15 insertions(+), 0 deletions(-)


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

diff --git a/README b/README
index aaea9ba..0d070e2 100644
--- a/README
+++ b/README
@@ -16,6 +16,11 @@
 running multiversion/refreshWikiversions. To vary by realm, add a suffix
 before the extension, e.g. "wikiversions-labs.json".
 
+debug.json
+ Configuration for X-Wikimedia-Debug. The browser extensions use this to
+ determine which app servers are available to use as X-Wikimedia-Debug
+ backends. See .
+
 docroot/
  The Apache document root for several of our VirtualHosts.
 
diff --git a/debug.json b/debug.json
new file mode 100644
index 000..d6ba6be
--- /dev/null
+++ b/debug.json
@@ -0,0 +1,8 @@
+{
+  "backends": [
+"mw1017.eqiad.wmnet",
+"mw1099.eqiad.wmnet",
+"mw2017.codfw.wmnet",
+"mw2099.codfw.wmnet"
+  ]
+}
diff --git a/docroot/noc/conf/debug.json b/docroot/noc/conf/debug.json
new file mode 12
index 000..50322bc
--- /dev/null
+++ b/docroot/noc/conf/debug.json
@@ -0,0 +1 @@
+../../../debug.json
\ No newline at end of file
diff --git a/docroot/noc/createTxtFileSymlinks.sh 
b/docroot/noc/createTxtFileSymlinks.sh
index 30a7724..1e5be37 100755
--- a/docroot/noc/createTxtFileSymlinks.sh
+++ b/docroot/noc/createTxtFileSymlinks.sh
@@ -53,6 +53,7 @@
 # raw views should use txt for consistent behaviour in browsers
 # (not triggering a download instead of a view, and rendering as plain text).
 mwconfig_files=(
+   debug.json
fc-list
langlist
wikiversions.json

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2e88633b1ad70b2eb483f4bba7858f173236ed7
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Changes to coal-web.py should refresh the coal webapp

2016-11-21 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Changes to coal-web.py should refresh the coal webapp
..


Changes to coal-web.py should refresh the coal webapp

Bug: T131820
Change-Id: Icd2c68ecc84515d975cfb92d06d1dc49d7964e76
---
M modules/coal/manifests/init.pp
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/coal/manifests/init.pp b/modules/coal/manifests/init.pp
index 450b1a2..bd9e82d 100644
--- a/modules/coal/manifests/init.pp
+++ b/modules/coal/manifests/init.pp
@@ -47,7 +47,7 @@
 owner  => 'root',
 group  => 'root',
 mode   => '0555',
-notify => Service['coal'],
+notify => Service['uwsgi-coal'],
 }
 
 file { '/usr/local/bin/coal':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icd2c68ecc84515d975cfb92d06d1dc49d7964e76
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...wikihiero[master]: Revert "Remove obsolete hiphop code"

2016-11-18 Thread Ori.livneh (Code Review)
Hello Krinkle, MaxSem, Mkoch,

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

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

to review the following change.

Change subject: Revert "Remove obsolete hiphop code"
..

Revert "Remove obsolete hiphop code"

This reverts commit 045c0a9553 / change I35a7ca501820. Under HHVM,
loading the PHP file is indeed more efficient than loading serialized
data and unserializing it.

Bug: T127780
Change-Id: I256c66d35d43296af8d64f831f44d9c6fdf0e041
---
M wikihiero.body.php
1 file changed, 15 insertions(+), 9 deletions(-)


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

diff --git a/wikihiero.body.php b/wikihiero.body.php
index cc83062..1348dfa 100644
--- a/wikihiero.body.php
+++ b/wikihiero.body.php
@@ -51,16 +51,22 @@
if ( self::$phonemes ) {
return;
}
-
-   $fileName = dirname( __FILE__ ) . '/data/tables.ser';
-   $stream = file_get_contents( $fileName );
-   if ( !$stream ) {
-   throw new MWException( "Cannot open serialized 
hieroglyph data file $fileName!" );
+   if ( wfIsHHVM() ) {
+   require_once __DIR__ . '/data/tables.php';
+   self::$phonemes = $wh_phonemes;
+   self::$prefabs = $wh_prefabs;
+   self::$files = $wh_files;
+   } else {
+   $fileName = __DIR__ . '/data/tables.ser';
+   $stream = file_get_contents( $fileName );
+   if ( !$stream ) {
+   throw new MWException( "Cannot open serialized 
hieroglyph data file $fileName!" );
+   }
+   $data = unserialize( $stream );
+   self::$phonemes = $data['wh_phonemes'];
+   self::$prefabs = $data['wh_prefabs'];
+   self::$files = $data['wh_files'];
}
-   $data = unserialize( $stream );
-   self::$phonemes = $data['wh_phonemes'];
-   self::$prefabs = $data['wh_prefabs'];
-   self::$files = $data['wh_files'];
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I256c66d35d43296af8d64f831f44d9c6fdf0e041
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/wikihiero
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: MaxSem 
Gerrit-Reviewer: Mkoch 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Revert "Don't use AbuseFilterCachingParser on bgwiki"

2016-11-18 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Revert "Don't use AbuseFilterCachingParser on bgwiki"
..

Revert "Don't use AbuseFilterCachingParser on bgwiki"

This reverts commit 7eb0e979e58, which is no longer needed, since a
bgwiki admin refactored the problematic rule. See the linked bug for
details.

Bug: T148660
Change-Id: If3b80b1a4bf0a1b0849021761cc5d90655ef4a7c
---
M wmf-config/InitialiseSettings.php
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 9886561..b8a90b0 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12266,7 +12266,6 @@
 
 'wgAbuseFilterParserClass' => [
'default' => 'AbuseFilterCachingParser',
-   'bgwiki' => 'AbuseFilterParser',
 ],
 # @}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3b80b1a4bf0a1b0849021761cc5d90655ef4a7c
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki...NavigationTiming[wmf/1.29.0-wmf.2]: Don't report stats when page visibility changes during page ...

2016-11-17 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Don't report stats when page visibility changes during page load
..

Don't report stats when page visibility changes during page load

Browsers sometime defer or deprioritize painting or executing code on
pages that load in the background (for example, in an inactive browser
tab). We don't want to report metrics in these cases, because a slow
page load is not necessarily a bad thing if it is invisible to the user
and if the slowdown is in service of making some operation that is
user-facing quicker.

Bug: T146510
Change-Id: I8e8ec96fc99f1e38d254f421c5f48cb313ba36e5
(cherry picked from commit 9532593ecc78b6415d4a014850e1c4d5a05b6c73)
---
M modules/ext.navigationTiming.js
1 file changed, 29 insertions(+), 2 deletions(-)


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

diff --git a/modules/ext.navigationTiming.js b/modules/ext.navigationTiming.js
index 5c45e64..3baf459 100644
--- a/modules/ext.navigationTiming.js
+++ b/modules/ext.navigationTiming.js
@@ -8,12 +8,39 @@
 ( function ( mw, $ ) {
'use strict';
 
-   var timing, navigation, mediaWikiLoadEnd,
+   var timing, navigation, mediaWikiLoadEnd, hiddenProp, visibilityEvent,
+   visibilityChanged = false,
TYPE_NAVIGATE = 0;
 
if ( window.performance ) {
timing = performance.timing;
navigation = performance.navigation;
+   }
+
+   // Don't report measurements for pages that have loaded in the 
background.
+   // Browsers defer or deprioritize loading background pages, causing 
them to
+   // take longer to load, which throws off our measurements.
+   // See  for more 
details.
+   if ( typeof document.hidden !== 'undefined' ) {
+   hiddenProp = 'hidden';
+   visibilityEvent = 'visibilitychange';
+   } else if ( typeof document.mozHidden !== 'undefined' ) {
+   hiddenProp = 'mozHidden';
+   visibilityEvent = 'mozvisibilitychange';
+   } else if ( typeof document.msHidden !== 'undefined' ) {
+   hiddenProp = 'msHidden';
+   visibilityEvent = 'msvisibilitychange';
+   } else if ( typeof document.webkitHidden !== 'undefined' ) {
+   hiddenProp = 'webkitHidden';
+   visibilityEvent = 'webkitvisibilitychange';
+   }
+   if ( hiddenProp ) {
+   $( document ).one( visibilityEvent, function () {
+   visibilityChanged = true;
+   } );
+   if ( document[ hiddenProp ] ) {
+   visibilityChanged = true;
+   }
}
 
function inSample() {
@@ -234,7 +261,7 @@
 
// Ensure we run after loadEventEnd.
onLoadComplete( function () {
-   if ( inSample() ) {
+   if ( inSample() && !visibilityChanged ) {
emitNavigationTiming();
}
mw.hook( 'postEdit' ).add( emitSaveTiming );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e8ec96fc99f1e38d254f421c5f48cb313ba36e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/NavigationTiming
Gerrit-Branch: wmf/1.29.0-wmf.2
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki...NavigationTiming[wmf/1.29.0-wmf.3]: Don't report stats when page visibility changes during page ...

2016-11-17 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Don't report stats when page visibility changes during page load
..

Don't report stats when page visibility changes during page load

Browsers sometime defer or deprioritize painting or executing code on
pages that load in the background (for example, in an inactive browser
tab). We don't want to report metrics in these cases, because a slow
page load is not necessarily a bad thing if it is invisible to the user
and if the slowdown is in service of making some operation that is
user-facing quicker.

Bug: T146510
Change-Id: I8e8ec96fc99f1e38d254f421c5f48cb313ba36e5
(cherry picked from commit 9532593ecc78b6415d4a014850e1c4d5a05b6c73)
---
M modules/ext.navigationTiming.js
1 file changed, 29 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NavigationTiming 
refs/changes/96/322096/1

diff --git a/modules/ext.navigationTiming.js b/modules/ext.navigationTiming.js
index 5c45e64..3baf459 100644
--- a/modules/ext.navigationTiming.js
+++ b/modules/ext.navigationTiming.js
@@ -8,12 +8,39 @@
 ( function ( mw, $ ) {
'use strict';
 
-   var timing, navigation, mediaWikiLoadEnd,
+   var timing, navigation, mediaWikiLoadEnd, hiddenProp, visibilityEvent,
+   visibilityChanged = false,
TYPE_NAVIGATE = 0;
 
if ( window.performance ) {
timing = performance.timing;
navigation = performance.navigation;
+   }
+
+   // Don't report measurements for pages that have loaded in the 
background.
+   // Browsers defer or deprioritize loading background pages, causing 
them to
+   // take longer to load, which throws off our measurements.
+   // See  for more 
details.
+   if ( typeof document.hidden !== 'undefined' ) {
+   hiddenProp = 'hidden';
+   visibilityEvent = 'visibilitychange';
+   } else if ( typeof document.mozHidden !== 'undefined' ) {
+   hiddenProp = 'mozHidden';
+   visibilityEvent = 'mozvisibilitychange';
+   } else if ( typeof document.msHidden !== 'undefined' ) {
+   hiddenProp = 'msHidden';
+   visibilityEvent = 'msvisibilitychange';
+   } else if ( typeof document.webkitHidden !== 'undefined' ) {
+   hiddenProp = 'webkitHidden';
+   visibilityEvent = 'webkitvisibilitychange';
+   }
+   if ( hiddenProp ) {
+   $( document ).one( visibilityEvent, function () {
+   visibilityChanged = true;
+   } );
+   if ( document[ hiddenProp ] ) {
+   visibilityChanged = true;
+   }
}
 
function inSample() {
@@ -234,7 +261,7 @@
 
// Ensure we run after loadEventEnd.
onLoadComplete( function () {
-   if ( inSample() ) {
+   if ( inSample() && !visibilityChanged ) {
emitNavigationTiming();
}
mw.hook( 'postEdit' ).add( emitSaveTiming );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e8ec96fc99f1e38d254f421c5f48cb313ba36e5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/NavigationTiming
Gerrit-Branch: wmf/1.29.0-wmf.3
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Don't use AbuseFilterCachingParser on bgwiki

2016-11-16 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Don't use AbuseFilterCachingParser on bgwiki
..

Don't use AbuseFilterCachingParser on bgwiki

Bug: T148660
Change-Id: I506f17f664acb9f13b04fb20466a986ca58fbb08
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index d8d4ae0..ab37d80 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12259,6 +12259,7 @@
 
 'wgAbuseFilterParserClass' => [
'default' => 'AbuseFilterCachingParser',
+   'bgwiki' => 'AbuseFilterParser',
 ],
 # @}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I506f17f664acb9f13b04fb20466a986ca58fbb08
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Re-enable AbuseFilterCachingParser everywhere

2016-11-15 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Re-enable AbuseFilterCachingParser everywhere
..

Re-enable AbuseFilterCachingParser everywhere

With T148673 fixed, I think we can enable this again.

Change-Id: I968050af3f751ee6d03cbc2dcc04954a8e0718b0
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 5 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 32180eb..d8d4ae0 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12258,11 +12258,7 @@
 ],
 
 'wgAbuseFilterParserClass' => [
-   'default' => 'AbuseFilterParser',
-   'mediawikiwiki' => 'AbuseFilterCachingParser',
-   'metawiki' => 'AbuseFilterCachingParser',
-   'commonswiki' => 'AbuseFilterCachingParser',
-   'testwiki' => 'AbuseFilterCachingParser',
+   'default' => 'AbuseFilterCachingParser',
 ],
 # @}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I968050af3f751ee6d03cbc2dcc04954a8e0718b0
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] analytics/statsv[master]: Use systemd's process watchdog to trigger restarts

2016-11-14 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Use systemd's process watchdog to trigger restarts
..


Use systemd's process watchdog to trigger restarts

I3ad8bb49ce was supposed to take care of the problem of statsv getting
stuck and not receiving incoming messages, but it didn't. The traceback
in T150359 makes it clear that there is a bug in pykafka that makes it
handle Kafka restarts poorly.

So instead, rely on systemd's process watchdog functionality to make
sure statsv is terminated (and restarted) if no messages are received in
some span of time, determined by the value of 'WatchdogSec=' in the
service unit's file.

See
https://www.freedesktop.org/software/systemd/man/systemd.service.html#WatchdogSec=
and
https://www.freedesktop.org/software/systemd/man/sd_notify.html#
for more info.

Bug: T150359
Change-Id: Ie471fa762b6f52f6114aec36a89094ddc76eb77c
---
M statsv.py
1 file changed, 52 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/statsv.py b/statsv.py
index 1917bfa..4f409b0 100644
--- a/statsv.py
+++ b/statsv.py
@@ -26,6 +26,7 @@
 import json
 import logging
 import multiprocessing
+import os
 import re
 import socket
 import urlparse
@@ -48,6 +49,53 @@
 'kafka1020.eqiad.wmnet:9092',
 'kafka1022.eqiad.wmnet:9092',
 )))
+
+SOCK_CLOEXEC = getattr(socket, 'SOCK_CLOEXEC', 0x8)
+
+
+class Watchdog:
+"""
+Simple notifier for systemd's process watchdog.
+
+You can use this in message- or request-processing scripts that are
+managed by systemd and that are under constant load, where the
+absence of work is an abnormal condition.
+
+Make sure the unit file contains `WatchdogSec=1` (or some other
+value) and `Restart=always`. Then you can write something like:
+
+watchdog = Watchdog()
+while 1:
+handle_request()
+watchdog.notify()
+
+This way, if the script spends a full second without handling a
+request, systemd will restart it.
+
+See 
https://www.freedesktop.org/software/systemd/man/systemd.service.html#WatchdogSec=
+for more details about systemd's watchdog capabilities.
+"""
+
+def __init__(self):
+# Get and clear NOTIFY_SOCKET from the environment to prevent
+# subprocesses from inheriting it.
+self.addr = os.environ.pop('NOTIFY_SOCKET', None)
+if not self.addr:
+self.sock = None
+return
+
+# If the first character of NOTIFY_SOCKET is "@", the string is
+# understood as an abstract socket address.
+if self.addr.startswith('@'):
+self.addr = '\0' + self.addr[1:]
+
+self.sock = socket.socket(
+socket.AF_UNIX, socket.SOCK_DGRAM | SOCK_CLOEXEC)
+
+def notify(self):
+if not self.sock:
+return
+self.sock.sendto(b'WATCHDOG=1', self.addr)
 
 
 def process_queue(q):
@@ -87,9 +135,13 @@
 consumer = topic.get_simple_consumer(
 auto_offset_reset=OffsetType.LATEST,
 consumer_timeout_ms=TIMEOUT_SECONDS * 1000)
+
+watchdog = Watchdog()
+
 for message in consumer:
 if message is not None:
 queue.put(message.value)
+watchdog.notify()
 
 # If we reach this line, TIMEOUT_SECONDS elapsed with no events received.
 queue.close()

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie471fa762b6f52f6114aec36a89094ddc76eb77c
Gerrit-PatchSet: 3
Gerrit-Project: analytics/statsv
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Elukey 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: Ottomata 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: statsv: use systemd's process watchdog

2016-11-13 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: statsv: use systemd's process watchdog
..

statsv: use systemd's process watchdog

This is the companion change to Ie471fa762b.
It should be deployed after that change.

Change-Id: I01b0e885d371dc019f4d60346feed41aae773e46
---
M modules/webperf/files/statsv.service
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/31/321231/1

diff --git a/modules/webperf/files/statsv.service 
b/modules/webperf/files/statsv.service
index 356d056..20300e0 100644
--- a/modules/webperf/files/statsv.service
+++ b/modules/webperf/files/statsv.service
@@ -7,6 +7,7 @@
 ExecStart=/usr/bin/python /srv/deployment/statsv/statsv/statsv.py
 User=nobody
 Restart=always
+WatchdogSec=5
 
 [Install]
 WantedBy=multi-user.target

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I01b0e885d371dc019f4d60346feed41aae773e46
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] analytics/statsv[master]: Use systemd's process watchdog to trigger restarts

2016-11-13 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Use systemd's process watchdog to trigger restarts
..

Use systemd's process watchdog to trigger restarts

I3ad8bb49ce was supposed to take care of the problem of statsv getting
stuck and not receiving incoming messages, but it didn't. The traceback
in T150359 makes it clear that there is a bug in pykafka that makes it
handle Kafka restarts poorly.

So instead, rely on systemd's process watchdog functionality to make
sure statsv is terminated (and restarted) if no messages are received in
some span of time, determined by the value of 'WatchdogSec=' in the
service unit's file.

See
https://www.freedesktop.org/software/systemd/man/systemd.service.html#WatchdogSec=
and
https://www.freedesktop.org/software/systemd/man/sd_notify.html#
for more info.

Change-Id: Ie471fa762b6f52f6114aec36a89094ddc76eb77c
---
M statsv.py
1 file changed, 49 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/statsv 
refs/changes/30/321230/1

diff --git a/statsv.py b/statsv.py
index 1917bfa..969b9ee 100644
--- a/statsv.py
+++ b/statsv.py
@@ -26,6 +26,7 @@
 import json
 import logging
 import multiprocessing
+import os
 import re
 import socket
 import urlparse
@@ -48,6 +49,53 @@
 'kafka1020.eqiad.wmnet:9092',
 'kafka1022.eqiad.wmnet:9092',
 )))
+
+SOCK_CLOEXEC = getattr(socket, 'SOCK_CLOEXEC', 0x8)
+
+
+class Watchdog:
+"""
+Simple notifier for systemd's process watchdog.
+
+You can use this in message- or request-processing scripts that are
+managed by systemd and that are under constant load, where the
+absence of work is an abnormal condition.
+
+Make sure the unit file contains `WatchdogSec=1` (or some other
+value) and `Restart=always`. Then you can write something like:
+
+watchdog = Watchdog()
+while 1:
+handle_request()
+watchdog.notify()
+
+This way, if the script spends a full second without handling a
+request, systemd will restart it.
+
+See 
https://www.freedesktop.org/software/systemd/man/systemd.service.html#WatchdogSec=
+for more details about systemd's watchdog capabilities.
+"""
+
+def __init__(self):
+# Get and clear NOTIFY_SOCKET from the environment to prevent
+# subprocesses from inheriting it.
+self.addr = os.environ.pop('NOTIFY_SOCKET', None)
+if not self.addr:
+self.sock = None
+return
+
+# If the first character of NOTIFY_SOCKET is "@", the string is
+# understood as an abstract socket address.
+if self.addr.startswith('@'):
+self.addr = '\0' + self.addr[1:]
+
+self.sock = socket.socket(
+socket.AF_UNIX, socket.SOCK_DGRAM | SOCK_CLOEXEC)
+
+def notify(self):
+if not self.sock:
+return
+self.sock.sendto(b'WATCHDOG=1', self.addr)
 
 
 def process_queue(q):
@@ -90,6 +138,7 @@
 for message in consumer:
 if message is not None:
 queue.put(message.value)
+watchdog.notify()
 
 # If we reach this line, TIMEOUT_SECONDS elapsed with no events received.
 queue.close()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie471fa762b6f52f6114aec36a89094ddc76eb77c
Gerrit-PatchSet: 1
Gerrit-Project: analytics/statsv
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Add an Icinga check for Graphite metric freshness

2016-11-06 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Add an Icinga check for Graphite metric freshness
..


Add an Icinga check for Graphite metric freshness

Checks a Graphite metric and generates WARNING or CRITICAL states if the most
recent datapoint is older than the required freshness threshold.

Change-Id: I2dcb8b08f2aa70108ead46c9510cfcb521abe158
---
A modules/monitoring/manifests/graphite_freshness.pp
A modules/nagios_common/files/check_commands/check_graphite_freshness
A modules/nagios_common/files/check_commands/check_graphite_freshness.cfg
M modules/nagios_common/manifests/commands.pp
4 files changed, 141 insertions(+), 0 deletions(-)

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



diff --git a/modules/monitoring/manifests/graphite_freshness.pp 
b/modules/monitoring/manifests/graphite_freshness.pp
new file mode 100644
index 000..60baa43
--- /dev/null
+++ b/modules/monitoring/manifests/graphite_freshness.pp
@@ -0,0 +1,53 @@
+# == Define: monitoring::graphite_freshness
+#
+# Provisions an Icinga check that ensures a Graphite metric is 'fresh':
+# that is, continuing to receive updates.
+#
+# === Parameters
+#
+# [*metric*]
+#   Graphite metric name. For example: 'reqstats.500'.
+#   Defaults to the resource title.
+#
+# [*warning*]
+#   Warn if most recent datapoint is older than this value.
+#   Value suffix may be one of 's', 'm', 'h' or 'd' for seconds,
+#   minutes, hours, or days, respectively.
+#
+# [*critical*]
+#   Crit if most recent datapoint is older than this value.
+#   Value suffix may be one of 's', 'm', 'h' or 'd' for seconds,
+#   minutes, hours, or days, respectively.
+#
+# [*graphite_url*]
+#   URL of Graphite's render API endpoint.
+#   Defaults to 'https://graphite.wikimedia.org/render'.
+#
+# [*contact_group*]
+#   Icinga contact group that should receive alerts.
+#   Defaults to 'admins'.
+#
+# === Examples
+#
+#  # Emit a warning if most recent datapoint for metric 'reqerror.500'
+#  # is older than 5 minutes, and a critical alert if older than 10.
+#  monitoring::graphite_freshness { 'reqerror.500':
+#warning  => '5m',
+#critical => '10m',
+#  }
+#
+define monitoring::graphite_freshness(
+$warning,
+$critical,
+$metric= $title,
+$ensure= present,
+$graphite_url  = 'https://graphite.wikimedia.org/render',
+$contact_group = 'admins'
+) {
+monitoring::service { $title:
+ensure=> $ensure,
+description   => "'${metric}' Graphite freshness",
+check_command => 
"check_graphite_freshness!${metric}!${graphite_url}!${warning}!${critical}",
+contact_group => $contact_group,
+}
+}
diff --git 
a/modules/nagios_common/files/check_commands/check_graphite_freshness 
b/modules/nagios_common/files/check_commands/check_graphite_freshness
new file mode 100755
index 000..bc6fb7e
--- /dev/null
+++ b/modules/nagios_common/files/check_commands/check_graphite_freshness
@@ -0,0 +1,83 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+  check_graphite_freshness
+  
+
+  Checks a Graphite metric and generates WARNING or CRITICAL states if
+  the most recent datapoint is older than the required freshness threshold.
+
+  Usage:
+check_graphite_freshness [-w THRESHOLD] [-c THRESHOLD] METRIC RENDER_URL
+
+  Positional arguments:
+METRICmetric name
+RENDER_URLURL of graphite's render API
+
+  Optional arguments:
+-w THRESHOLD, --warning THRESHOLD   warn if most recent datapoint
+is older than this value
+-c THRESHOLD, --critical THRESHOLD  alert if most recent datapoint
+is older than this value
+
+"""
+from __future__ import print_function
+
+import sys
+reload(sys)
+sys.setdefaultencoding("utf-8")
+
+import argparse
+import datetime
+import json
+import time
+import urllib2
+
+
+def time_spec(spec_string):
+"""Parse a time specification string consisting of a number
+followed by an optional letter specifying the unit."""
+units = {'s': 'seconds', 'm': 'minutes', 'h': 'hours', 'd': 'days'}
+if spec_string[-1].isalpha():
+unit = units[spec_string[-1]]
+count = int(spec_string[:-1])
+else:
+unit = 'seconds'
+count = int(spec_string)
+return datetime.timedelta(**{unit: count})
+
+
+ap = argparse.ArgumentParser(description='Graphite staleness alert')
+ap.add_argument('metric', help='metric name')
+ap.add_argument('render_url', help="URL of graphite's render API")
+ap.add_argument('-w', '--warning', type=time_spec, metavar='THRESHOLD',
+help='warn if most recent datapoint is older than this value')
+ap.add_argument('-c', '--critical', type=time_spec, metavar='THRESHOLD',
+help='alert if most recent datapoint is older than this value')
+args = 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix-up for Ia07b03f12b

2016-11-04 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Fix-up for Ia07b03f12b
..


Fix-up for Ia07b03f12b

Get the right field name.

Change-Id: Ib2329d08579ca938584035f290a17bacdcd893d8
---
M modules/webperf/files/navtiming.py
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/modules/webperf/files/navtiming.py 
b/modules/webperf/files/navtiming.py
index 5701554..3a88470 100755
--- a/modules/webperf/files/navtiming.py
+++ b/modules/webperf/files/navtiming.py
@@ -206,9 +206,11 @@
 @handles('SaveTiming')
 def handle_save_timing(meta):
 event = meta['event']
-duration = event.get('duration')
+duration = event.get('saveTiming')
 version = event.get('mediaWikiVersion')
-if is_sane(duration):
+if duration is None:
+duration = event.get('duration')
+if duration and is_sane(duration):
 dispatch_stat('mw.performance.save', duration)
 if version:
 dispatch_stat('mw.performance.save_by_version',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib2329d08579ca938584035f290a17bacdcd893d8
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: Volans 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix-up for Ia07b03f12b

2016-11-04 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Fix-up for Ia07b03f12b
..

Fix-up for Ia07b03f12b

Get the right field name.

Change-Id: Ib2329d08579ca938584035f290a17bacdcd893d8
---
M modules/webperf/files/navtiming.py
1 file changed, 4 insertions(+), 3 deletions(-)


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

diff --git a/modules/webperf/files/navtiming.py 
b/modules/webperf/files/navtiming.py
index 5701554..a31a093 100755
--- a/modules/webperf/files/navtiming.py
+++ b/modules/webperf/files/navtiming.py
@@ -206,9 +206,10 @@
 @handles('SaveTiming')
 def handle_save_timing(meta):
 event = meta['event']
-duration = event.get('duration')
-version = event.get('mediaWikiVersion')
-if is_sane(duration):
+duration = event.get('saveTiming')
+if duration is None:
+duration = event.get('duration')
+if duration and is_sane(duration):
 dispatch_stat('mw.performance.save', duration)
 if version:
 dispatch_stat('mw.performance.save_by_version',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2329d08579ca938584035f290a17bacdcd893d8
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Report save timing by MediaWiki version

2016-11-04 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Report save timing by MediaWiki version
..


Report save timing by MediaWiki version

Add a 'mw.performance.save_by_version' key namespace which includes a
normalized $wgVersion as part of the key name. This should allow us to compare
performance across branches and catch performance regressions.

Bug: T112557
Change-Id: Ia07b03f12b1bd146a6935d27d08b6360fa351e62
---
M modules/webperf/files/navtiming.py
1 file changed, 6 insertions(+), 8 deletions(-)

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



diff --git a/modules/webperf/files/navtiming.py 
b/modules/webperf/files/navtiming.py
index 5d46d99..5701554 100755
--- a/modules/webperf/files/navtiming.py
+++ b/modules/webperf/files/navtiming.py
@@ -206,15 +206,13 @@
 @handles('SaveTiming')
 def handle_save_timing(meta):
 event = meta['event']
-duration = event.get('saveTiming')
-if duration is None:
-duration = event.get('duration')
-if duration and is_sane(duration):
+duration = event.get('duration')
+version = event.get('mediaWikiVersion')
+if is_sane(duration):
 dispatch_stat('mw.performance.save', duration)
-
-# Ori, for T126700 -- 17-Feb-2016
-if meta.get('wiki', '') == 'mediawikiwiki':
-dispatch_stat('tmp.performance.save', duration)
+if version:
+dispatch_stat('mw.performance.save_by_version',
+  version.replace('.', '_'), duration)
 
 
 @handles('NavigationTiming')

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia07b03f12b1bd146a6935d27d08b6360fa351e62
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Gilles 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...NavigationTiming[master]: Don't report stats when page visibility changes during page ...

2016-11-04 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Don't report stats when page visibility changes during page load
..

Don't report stats when page visibility changes during page load

Browsers sometime defer or deprioritize painting or executing code on
pages that load in the background (for example, in an inactive browser
tab). We don't want to report metrics in these cases, because a slow
page load is not necessarily a bad thing if it is invisible to the user
and if the slowdown is in service of making some operation that is
user-facing quicker.

I don't want to worry about vendor prefixes or visibility changes that
may happen before NavigationTiming has the chance to bind the handler.
The code in this patch should catch the common case, and we should be
able to tell from its impact (or lack thereof) on our metrics whether it
is worth the extra effort to control for visibility changes in all
possible cases.

Change-Id: I8e8ec96fc99f1e38d254f421c5f48cb313ba36e5
---
M modules/ext.navigationTiming.js
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NavigationTiming 
refs/changes/02/319902/1

diff --git a/modules/ext.navigationTiming.js b/modules/ext.navigationTiming.js
index 5c45e64..42908a9 100644
--- a/modules/ext.navigationTiming.js
+++ b/modules/ext.navigationTiming.js
@@ -9,12 +9,21 @@
'use strict';
 
var timing, navigation, mediaWikiLoadEnd,
+   visibilityChanged = false,
TYPE_NAVIGATE = 0;
+
 
if ( window.performance ) {
timing = performance.timing;
navigation = performance.navigation;
}
+
+   // Don't report measurements for pages that have loaded in the 
background.
+   // Browsers defer or deprioritize loading background pages, causing 
them to
+   // take longer to load, which throws off our measurements.
+   $( document ).one( 'visibilitychange', function () {
+   visibilityChanged = true;
+   } );
 
function inSample() {
var factor = mw.config.get( 'wgNavigationTimingSamplingFactor' 
);
@@ -234,7 +243,7 @@
 
// Ensure we run after loadEventEnd.
onLoadComplete( function () {
-   if ( inSample() ) {
+   if ( inSample() && !visibilityChanged ) {
emitNavigationTiming();
}
mw.hook( 'postEdit' ).add( emitSaveTiming );

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Module storage: count modules which fail to execute, too

2016-11-02 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Module storage: count modules which fail to execute, too
..

Module storage: count modules which fail to execute, too

"Failed" will probably always be either zero or one, because it is
unlikely the asyncEval error callback can ever be called more than once.
But the stats will let us verify this, and will give us an indication of
how often errors happen in general.

Change-Id: I6dea28d84bbca0f02ad8c5bf9a8e9d976622d815
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 6280c95..da4c769 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1782,6 +1782,7 @@
// Depending on how 
corrupt the string is, it is likely that some
// modules' implement() 
succeeded while the ones after the error will
// never run and leave 
their modules in the 'loading' state forever.
+   
mw.loader.store.stats.failed++;
 
// Since this is an 
error not caused by an individual module but by
// something that 
infected the implement call itself, don't take any
@@ -2184,7 +2185,7 @@
items: {},
 
// Cache hit stats
-   stats: { hits: 0, misses: 0, expired: 0 
},
+   stats: { hits: 0, misses: 0, expired: 
0, failed: 0 },
 
/**
 * Construct a JSON-serializable object 
representing the content of the store.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6dea28d84bbca0f02ad8c5bf9a8e9d976622d815
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix-up for Iff996299

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Fix-up for Iff996299
..


Fix-up for Iff996299

Change-Id: I4c6e3859917c7b34d76c23eb0628402a188f60a2
---
M modules/coal/files/coal
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/coal/files/coal b/modules/coal/files/coal
index 25bb523..0ecd30c 100755
--- a/modules/coal/files/coal
+++ b/modules/coal/files/coal
@@ -28,11 +28,11 @@
 import collections
 import errno
 import fcntl
+import logging
 import os
 import os.path
 import select
 import signal
-import syslog
 
 import whisper
 import zmq

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4c6e3859917c7b34d76c23eb0628402a188f60a2
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Fix-up for Iff996299

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Fix-up for Iff996299
..

Fix-up for Iff996299

Change-Id: I4c6e3859917c7b34d76c23eb0628402a188f60a2
---
M modules/coal/files/coal
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/coal/files/coal b/modules/coal/files/coal
index 25bb523..0ecd30c 100755
--- a/modules/coal/files/coal
+++ b/modules/coal/files/coal
@@ -28,11 +28,11 @@
 import collections
 import errno
 import fcntl
+import logging
 import os
 import os.path
 import select
 import signal
-import syslog
 
 import whisper
 import zmq

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c6e3859917c7b34d76c23eb0628402a188f60a2
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] analytics/statsv[master]: Die if no metrics received in one minute

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Die if no metrics received in one minute
..


Die if no metrics received in one minute

If no message is received in TIMEOUT_SECONDS (hard-coded to 60), die
(allowing init to restart the process). This should be made
configurable (or adaptive) in the future.

Change-Id: I3ad8bb49ceae76f2ae68ab0d67cf002b8db24a9e
---
M statsv.py
1 file changed, 12 insertions(+), 4 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/statsv.py b/statsv.py
index ab51059..1917bfa 100644
--- a/statsv.py
+++ b/statsv.py
@@ -34,6 +34,7 @@
 from pykafka.common import OffsetType
 
 
+TIMEOUT_SECONDS = 60 * 1000
 logging.basicConfig(stream=sys.stderr, level=logging.INFO,
 format='%(asctime)s %(message)s')
 supported_metric_types = ('c', 'g', 'ms')
@@ -60,14 +61,15 @@
 try:
 query_string = data['uri_query'].lstrip('?')
 for metric_name, value in urlparse.parse_qsl(query_string):
-metric_value, metric_type = re.search('^(\d+)([a-z]+)$', 
value).groups()
+metric_value, metric_type = re.search(
+'^(\d+)([a-z]+)$', value).groups()
 assert metric_type in supported_metric_types
-statsd_message = '%s:%s|%s' % (metric_name, metric_value, 
metric_type)
+statsd_message = '%s:%s|%s' % (
+metric_name, metric_value, metric_type)
 sock.sendto(statsd_message.encode('utf-8'), statsd_addr)
 logging.debug(statsd_message)
 except (AssertionError, AttributeError, KeyError):
 pass
-
 
 
 queue = multiprocessing.Queue()
@@ -82,7 +84,13 @@
 worker.start()
 
 topic = kafka.topics['statsv']
-consumer = topic.get_simple_consumer(auto_offset_reset=OffsetType.LATEST)
+consumer = topic.get_simple_consumer(
+auto_offset_reset=OffsetType.LATEST,
+consumer_timeout_ms=TIMEOUT_SECONDS * 1000)
 for message in consumer:
 if message is not None:
 queue.put(message.value)
+
+# If we reach this line, TIMEOUT_SECONDS elapsed with no events received.
+queue.close()
+raise RuntimeError('No messages received in %d seconds.' % TIMEOUT_SECONDS)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3ad8bb49ceae76f2ae68ab0d67cf002b8db24a9e
Gerrit-PatchSet: 3
Gerrit-Project: analytics/statsv
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] analytics/statsv[master]: Use ^ and $ while spliting metric value and type

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Use ^ and $ while spliting metric value and type
..


Use ^ and $ while spliting metric value and type

If stats are sent to the enpoint using jsonp then
a jquery callback URL parameter is included.

With the current regex this would make it all the way throguh
and get sent to graphite in many cases as somewhere in the value
there will be a digit followed by a non digit..

Instead the regex should make sure the value is actually a
value exactly as graphite would expect it!

Change-Id: I8f194570fbdb34205b54310e0da73685ea7472c5
---
M statsv.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved
  Jonas Kress (WMDE): Looks good to me, but someone else must approve
  Thiemo Mättig (WMDE): Looks good to me, but someone else must approve



diff --git a/statsv.py b/statsv.py
index 0d17db0..ab51059 100644
--- a/statsv.py
+++ b/statsv.py
@@ -60,7 +60,7 @@
 try:
 query_string = data['uri_query'].lstrip('?')
 for metric_name, value in urlparse.parse_qsl(query_string):
-metric_value, metric_type = re.search('(\d+)(\D+)', 
value).groups()
+metric_value, metric_type = re.search('^(\d+)([a-z]+)$', 
value).groups()
 assert metric_type in supported_metric_types
 statsd_message = '%s:%s|%s' % (metric_name, metric_value, 
metric_type)
 sock.sendto(statsd_message.encode('utf-8'), statsd_addr)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f194570fbdb34205b54310e0da73685ea7472c5
Gerrit-PatchSet: 3
Gerrit-Project: analytics/statsv
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Jonas Kress (WMDE) 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: Ottomata 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 

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


[MediaWiki-commits] [Gerrit] analytics/statsv[master]: Die if no metrics received in one minute

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Die if no metrics received in one minute
..

Die if no metrics received in one minute

Change-Id: I3ad8bb49ceae76f2ae68ab0d67cf002b8db24a9e
---
M statsv.py
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/statsv 
refs/changes/47/317847/1

diff --git a/statsv.py b/statsv.py
index 0d17db0..30e6728 100644
--- a/statsv.py
+++ b/statsv.py
@@ -34,6 +34,7 @@
 from pykafka.common import OffsetType
 
 
+TIMEOUT = 60 * 1000
 logging.basicConfig(stream=sys.stderr, level=logging.INFO,
 format='%(asctime)s %(message)s')
 supported_metric_types = ('c', 'g', 'ms')
@@ -82,7 +83,13 @@
 worker.start()
 
 topic = kafka.topics['statsv']
-consumer = topic.get_simple_consumer(auto_offset_reset=OffsetType.LATEST)
+consumer = topic.get_simple_consumer(
+auto_offset_reset=OffsetType.LATEST,
+consumer_timeout_ms=TIMEOUT)
 for message in consumer:
 if message is not None:
 queue.put(message.value)
+
+# If we reach this line, TIMEOUT elapsed with no events received.
+queue.close()
+raise RuntimeError('No messages received in %d seconds.' % TIMEOUT)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ad8bb49ceae76f2ae68ab0d67cf002b8db24a9e
Gerrit-PatchSet: 1
Gerrit-Project: analytics/statsv
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: coal: using stdlib's logging

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: coal: using stdlib's logging
..


coal: using stdlib's logging

Using syslog.syslog() is fine, except exception info doesn't end up
there. We could use logging.handlers.sysLogHandler, but let's just log
to stderr and let systemd manage the output.

Change-Id: Iff9962998211edba9f94cf3662ccd18c6856
---
M modules/coal/files/coal
1 file changed, 10 insertions(+), 4 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/coal/files/coal b/modules/coal/files/coal
index 9863f12..25bb523 100755
--- a/modules/coal/files/coal
+++ b/modules/coal/files/coal
@@ -111,7 +111,7 @@
 def __init__(self):
 self.args = self.arg_parser.parse_args()
 self.windows = collections.defaultdict(collections.deque)
-syslog.openlog('coal', syslog.LOG_PERROR, syslog.LOG_DAEMON)
+self.log = logging.getLogger(__name__)
 
 def get_whisper_file(self, metric):
 return os.path.join(self.args.whisper_dir, metric + '.wsp')
@@ -126,7 +126,7 @@
 def run(self):
 self.create_whisper_files()
 
-syslog.syslog('Connecting to %s.' % self.args.endpoint)
+self.log.info('Connecting to %s.', self.args.endpoint)
 socket = zmq.Context().socket(zmq.SUB)
 socket.connect(self.args.endpoint)
 socket.subscribe = b''
@@ -139,7 +139,7 @@
 poll.register(socket.fd, select.EPOLLIN)
 poll.register(timer_fd, select.EPOLLIN)
 
-syslog.syslog('Entering main loop.')
+self.log.info('Entering main loop.')
 
 intervals_since_last_event = 0
 
@@ -160,6 +160,7 @@
 self.handle_event(meta)
 except IOError as e:
 if e.errno != errno.EINTR:
+self.log.exception('Error in main loop:')
 raise
 
 def handle_event(self, meta):
@@ -179,9 +180,14 @@
 window.popleft()
 current_value = median(value for timestamp, value in window)
 whisper.update(self.get_whisper_file(metric), current_value)
-syslog.syslog('%s: %d' % (metric, current_value))
+self.log.debug('%s: %d' % (metric, current_value))
 
 
 if __name__ == '__main__':
+logger = logging.getLogger(__name__)
+logger.setLevel(logging.DEBUG)
+stderr_handler = logging.StreamHandler(stream=sys.stderr)
+logger.addHandler(stderr_handler)
+
 app = WhisperLogger()
 app.run()

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff9962998211edba9f94cf3662ccd18c6856
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: coal: die if no events in N seconds

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: coal: die if no events in N seconds
..


coal: die if no events in N seconds

Sometimes coal will keep running even when the publisher has stopped
sending it events for whatever reason, and then we have to restart it.
Automate this by dying if three minutes pass with no events.

Change-Id: Ic7b7b601028605afd24144090f49c98e001e2921
---
M modules/coal/files/coal
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/coal/files/coal b/modules/coal/files/coal
index 18ae7bf..9863f12 100755
--- a/modules/coal/files/coal
+++ b/modules/coal/files/coal
@@ -140,15 +140,23 @@
 poll.register(timer_fd, select.EPOLLIN)
 
 syslog.syslog('Entering main loop.')
+
+intervals_since_last_event = 0
+
 while 1:
 try:
 for fd, _ in poll.poll():
 if fd == timer_fd:
 os.read(timer_fd, 1)
 self.flush_data()
+intervals_since_last_event += 1
+if intervals_since_last_event > 2:
+raise RuntimeError('No events in %d seconds.' % (
+UPDATE_INTERVAL * intervals_since_last_event))
 if fd == socket.fd:
 while socket.events & zmq.POLLIN:
 meta = socket.recv_json()
+intervals_since_last_event = 0
 self.handle_event(meta)
 except IOError as e:
 if e.errno != errno.EINTR:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic7b7b601028605afd24144090f49c98e001e2921
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Use correct IP for Vanderbilt 2016-10-25 edit-a-thon throttl...

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Use correct IP for Vanderbilt 2016-10-25 edit-a-thon throttle 
exception
..

Use correct IP for Vanderbilt 2016-10-25 edit-a-thon throttle exception

Bug: T149063
Change-Id: I049bd463ca3d01c5134f680c4caf4750fe5d54ad
---
M wmf-config/throttle.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php
index 59777f3..e986b37 100644
--- a/wmf-config/throttle.php
+++ b/wmf-config/throttle.php
@@ -31,7 +31,7 @@
 $wmgThrottlingExceptions[] = [ // T149063 - Nashville Architecture edit-a-thon 
(Vanderbilt library)
'from'   => '2016-10-25T10:30 -5:00',
'to' => '2016-10-25T16:00 -5:00',
-   'IP' => '129.59.151.133',
+   'IP' => '129.59.122.18',
'dbname' => [ 'enwiki', 'commonswiki' ],
'value'  => 50 // 20 to 30 expected
 ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I049bd463ca3d01c5134f680c4caf4750fe5d54ad
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: coal: using stdlib's logging

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: coal: using stdlib's logging
..

coal: using stdlib's logging

Using syslog.syslog() is fine, except exception info doesn't end up
there. We could use logging.handlers.sysLogHandler, but let's just log
to stderr and let systemd manage the output.

Change-Id: Iff9962998211edba9f94cf3662ccd18c6856
---
M modules/coal/files/coal
1 file changed, 10 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/32/317832/1

diff --git a/modules/coal/files/coal b/modules/coal/files/coal
index 9863f12..25bb523 100755
--- a/modules/coal/files/coal
+++ b/modules/coal/files/coal
@@ -111,7 +111,7 @@
 def __init__(self):
 self.args = self.arg_parser.parse_args()
 self.windows = collections.defaultdict(collections.deque)
-syslog.openlog('coal', syslog.LOG_PERROR, syslog.LOG_DAEMON)
+self.log = logging.getLogger(__name__)
 
 def get_whisper_file(self, metric):
 return os.path.join(self.args.whisper_dir, metric + '.wsp')
@@ -126,7 +126,7 @@
 def run(self):
 self.create_whisper_files()
 
-syslog.syslog('Connecting to %s.' % self.args.endpoint)
+self.log.info('Connecting to %s.', self.args.endpoint)
 socket = zmq.Context().socket(zmq.SUB)
 socket.connect(self.args.endpoint)
 socket.subscribe = b''
@@ -139,7 +139,7 @@
 poll.register(socket.fd, select.EPOLLIN)
 poll.register(timer_fd, select.EPOLLIN)
 
-syslog.syslog('Entering main loop.')
+self.log.info('Entering main loop.')
 
 intervals_since_last_event = 0
 
@@ -160,6 +160,7 @@
 self.handle_event(meta)
 except IOError as e:
 if e.errno != errno.EINTR:
+self.log.exception('Error in main loop:')
 raise
 
 def handle_event(self, meta):
@@ -179,9 +180,14 @@
 window.popleft()
 current_value = median(value for timestamp, value in window)
 whisper.update(self.get_whisper_file(metric), current_value)
-syslog.syslog('%s: %d' % (metric, current_value))
+self.log.debug('%s: %d' % (metric, current_value))
 
 
 if __name__ == '__main__':
+logger = logging.getLogger(__name__)
+logger.setLevel(logging.DEBUG)
+stderr_handler = logging.StreamHandler(stream=sys.stderr)
+logger.addHandler(stderr_handler)
+
 app = WhisperLogger()
 app.run()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff9962998211edba9f94cf3662ccd18c6856
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: coal: die if no events in N seconds

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: coal: die if no events in N seconds
..

coal: die if no events in N seconds

Sometimes coal will keep running even when the publisher has stopped
sending it events for whatever reason, and then we have to restart it.
Automate this by dying if three minutes pass with no events.

Change-Id: Ic7b7b601028605afd24144090f49c98e001e2921
---
M modules/coal/files/coal
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/31/317831/1

diff --git a/modules/coal/files/coal b/modules/coal/files/coal
index 18ae7bf..9863f12 100755
--- a/modules/coal/files/coal
+++ b/modules/coal/files/coal
@@ -140,15 +140,23 @@
 poll.register(timer_fd, select.EPOLLIN)
 
 syslog.syslog('Entering main loop.')
+
+intervals_since_last_event = 0
+
 while 1:
 try:
 for fd, _ in poll.poll():
 if fd == timer_fd:
 os.read(timer_fd, 1)
 self.flush_data()
+intervals_since_last_event += 1
+if intervals_since_last_event > 2:
+raise RuntimeError('No events in %d seconds.' % (
+UPDATE_INTERVAL * intervals_since_last_event))
 if fd == socket.fd:
 while socket.events & zmq.POLLIN:
 meta = socket.recv_json()
+intervals_since_last_event = 0
 self.handle_event(meta)
 except IOError as e:
 if e.errno != errno.EINTR:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic7b7b601028605afd24144090f49c98e001e2921
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations...pybal[master]: Drop support for the legacy configuration format

2016-10-25 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Drop support for the legacy configuration format
..

Drop support for the legacy configuration format

Per Mark, in Ib7e9691cec3b: "I think we should attempt to completely
kill the old syntax ASAP, and just use JSON from now on. There are few
if any external users to worry about, so why introduce more tech debt?
Let's keep it clean and simple and consistent now we still can."

Change-Id: I304669e8dcbbf2cd3fa6e87746e16298cf873a46
---
M TODO
M pybal/config.py
M pybal/test/test_config.py
3 files changed, 4 insertions(+), 60 deletions(-)


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

diff --git a/TODO b/TODO
index 6acfaa1..e0f81b4 100644
--- a/TODO
+++ b/TODO
@@ -12,6 +12,5 @@
   from the realservers, e.g. for computing the weight of a realserver
 * Reimplement IPVSManager using Netlink once the IPVS Netlink interface
   has entered the kernel
-* Revisit the whole config parsing wrt consistency and security
 * Syntax errors in server lists cause unhandled Deferreds, and appear
-  to stop any further config rereads - this needs to be fixed.
\ No newline at end of file
+  to stop any further config rereads - this needs to be fixed.
diff --git a/pybal/config.py b/pybal/config.py
index 3c5b167..a00f81a 100644
--- a/pybal/config.py
+++ b/pybal/config.py
@@ -87,35 +87,9 @@
 if not self.reloadTask.running:
 self.startObserving()
 
-def parseLegacyConfig(self, rawConfig):
-"""Parse a legacy (eval) configuration file."""
-config = {}
-for line in rawConfig.split('\n'):
-try:
-line = line.strip()
-if not line or line.startswith('#'):
-continue
-server = ast.literal_eval(line)
-host = server.pop('host')
-config[host] = {'enabled': server['enabled'],
-'weight': server['weight']}
-except (KeyError, SyntaxError, TypeError, ValueError) as ex:
-# We catch exceptions here (rather than simply allow them to
-# bubble up to FileConfigurationObserver.logError) because we
-# want to try and parse as much of the file as we can.
-log.err(ex, 'Bad configuration line: %s' % line)
-continue
-return config
-
-def parseJsonConfig(self, rawConfig):
+def parseConfig(self, rawConfig):
 """Parse a JSON pool configuration file."""
 return json.loads(rawConfig)
-
-def parseConfig(self, rawConfig):
-if self.configUrl.endswith('.json'):
-return self.parseJsonConfig(rawConfig)
-else:
-return self.parseLegacyConfig(rawConfig)
 
 def reloadConfig(self):
 """If the configuration file has changed, re-read it. If the parsed
diff --git a/pybal/test/test_config.py b/pybal/test/test_config.py
index d3930f8..bef147a 100644
--- a/pybal/test/test_config.py
+++ b/pybal/test/test_config.py
@@ -75,16 +75,6 @@
 
 def testParseConfig(self):
 """Test `FileConfigurationObserver.parseConfig`"""
-self.observer.parseLegacyConfig = 
mock.MagicMock(return_value='legacy_config')
-self.observer.parseJsonConfig = 
mock.MagicMock(return_value='json_config')
-self.assertEquals(self.observer.parseConfig("I am legacy"), 
'legacy_config')
-self.observer.parseLegacyConfig.assert_called_with("I am legacy")
-self.observer.configUrl += '.json'
-self.assertEquals(self.observer.parseConfig("I am json"), 
'json_config')
-self.observer.parseJsonConfig.assert_called_with("I am json")
-
-def testParseJsonConfig(self):
-"""Test `FileConfigurationObserver.parseJsonConfig`"""
 json_config = """
 {
   "mw1200": { "enabled": true, "weight": 10 },
@@ -95,30 +85,11 @@
 'mw1200': {'enabled': True, 'weight': 10},
 'mw1201': {'enabled': False, 'weight': 1},
 }
-self.assertEquals(self.observer.parseJsonConfig(json_config),
+self.assertEquals(self.observer.parseConfig(json_config),
   expected_config)
 invalid_config = "{[]"
-self.assertRaises(Exception, self.observer.parseJsonConfig,
+self.assertRaises(Exception, self.observer.parseConfig,
   invalid_config)
-
-def testParseLegacyConfig(self):
-"""Test `FileConfigurationObserver.parseLegacyConfig`"""
-legacy_config = '\n'.join((
-"{'host': 'mw1200', 'weight': 10, 'enabled': True }",
-"{'host': 'mw1201', 'weight': 1, 'enabled': False }",
-))
-expected_config = {
-'mw1200': {'enabled': True, 'weight': 10},
-'mw1201': {'enabled': False, 'weight': 1},
-}
-   

[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.22]: mw.loader: Fix off-by-one error in splitModuleKey()

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

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

Change subject: mw.loader: Fix off-by-one error in splitModuleKey()
..

mw.loader: Fix off-by-one error in splitModuleKey()

Follows-up 45bec76. This caused most localStorage cache entries from
mw.loader.store to be ignored because it'd store tje source code with
a version string that wrongly started with an "@".

As such, on the next page view, when comparing against the version
string from the startup manifest, it would mismatch and eventually
be pruned by mw.loader.store.

Change-Id: If14c80989c0bb28b7b209abe89f83d585c563987
---
M resources/src/mediawiki/mediawiki.js
M tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/43/317743/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 6b23439..484930a 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1725,7 +1725,7 @@
}
return {
name: key.slice( 0, index ),
-   version: key.slice( index )
+   version: key.slice( index + 1 )
};
}
 
diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js 
b/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
index bfac513..7233a2e 100644
--- a/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
+++ b/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js
@@ -639,6 +639,8 @@
return mw.loader.using( 'test.stale' )
.then( function () {
assert.strictEqual( count, 1 );
+   // After implementing, registry contains 
version as implemented by the response.
+   assert.strictEqual( mw.loader.getVersion( 
'test.stale' ), 'v1', 'Override version' );
assert.strictEqual( mw.loader.getState( 
'test.stale' ), 'ready' );
assert.ok( mw.loader.store.get( 'test.stale' ), 
'In store' );
} )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If14c80989c0bb28b7b209abe89f83d585c563987
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.22
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Krinkle 

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Disable AbuseFilterCachingParser on bgwiki

2016-10-19 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Disable AbuseFilterCachingParser on bgwiki
..

Disable AbuseFilterCachingParser on bgwiki

After enabling AbuseFilterCachingParser on bgwiki, we started seeing
stack overflow fatals in the logs.

Bug: T148660
Change-Id: I6d28e53404e608c9ea1146be03eafe3186a2b62d
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index ab4b380..bf0bbc7 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12224,6 +12224,7 @@
 
 'wgAbuseFilterParserClass' => [
'default' => 'AbuseFilterCachingParser',
+   'bgwiki' => 'AbuseFilterParser',
 ],
 # @}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d28e53404e608c9ea1146be03eafe3186a2b62d
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Remove ~ori/.hushlogin

2016-10-18 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Remove ~ori/.hushlogin
..


Remove ~ori/.hushlogin

Hiding the MOTD banners isn't optimal when they are used to signal
things like the active deployment server.

Change-Id: I400c4c26fc87dc35886afed92307821a212f17dd
---
D modules/admin/files/home/ori/.hushlogin
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/modules/admin/files/home/ori/.hushlogin 
b/modules/admin/files/home/ori/.hushlogin
deleted file mode 100644
index e69de29..000
--- a/modules/admin/files/home/ori/.hushlogin
+++ /dev/null

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I400c4c26fc87dc35886afed92307821a212f17dd
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: Muehlenhoff 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable AbuseFilterCachingParser by default

2016-10-17 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Enable AbuseFilterCachingParser by default
..

Enable AbuseFilterCachingParser by default

Set AbuseFilterParserClass to 'AbuseFilterCachingParser' by default. This
parser implementation was introduced in I4aea5f00 and is slotted to replace the
default implementation. Follows If794eb2a, I8f6eb9f6, and I8562f8e1.

Change-Id: Ieb8cdab9bd1f07e52cb6196e9e62b7680112f8c9
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 5 deletions(-)


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 7e37ecf..247ea7a 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12218,11 +12218,7 @@
 ],
 
 'wgAbuseFilterParserClass' => [
-   'default' => 'AbuseFilterParser',
-   'mediawikiwiki' => 'AbuseFilterCachingParser',
-   'metawiki' => 'AbuseFilterCachingParser',
-   'commonswiki' => 'AbuseFilterCachingParser',
-   'testwiki' => 'AbuseFilterCachingParser',
+   'default' => 'AbuseFilterCachingParser',
 ],
 # @}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb8cdab9bd1f07e52cb6196e9e62b7680112f8c9
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki...EducationProgram[wmf/1.28.0-wmf.22]: Fix-up for Ia3d767e86

2016-10-17 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Fix-up for Ia3d767e86
..

Fix-up for Ia3d767e86

Add 'use ContentHandler' statement to avoid having references to
ContentHandler throw a class not found exception because they are
interpreted as being relative to the local namespace.

Change-Id: Id02366ef8d32e287cdf4632cb894cec047e64eb7
---
M includes/Events/EditEventCreator.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/includes/Events/EditEventCreator.php 
b/includes/Events/EditEventCreator.php
index 7473632..bdf185d 100644
--- a/includes/Events/EditEventCreator.php
+++ b/includes/Events/EditEventCreator.php
@@ -12,6 +12,7 @@
 use MWNamespace;
 use Diff;
 use DiffOp;
+use ContentHandler;
 
 /**
  * Class that generates edit based events by handling new edits.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id02366ef8d32e287cdf4632cb894cec047e64eb7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: wmf/1.28.0-wmf.22
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki...EducationProgram[master]: Fix-up for Ia3d767e86

2016-10-17 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Fix-up for Ia3d767e86
..

Fix-up for Ia3d767e86

Add 'use ContentHandler' statement to avoid having references to
ContentHandler throw a class not found exception because they are
interpreted as being relative to the local namespace.

Change-Id: Id02366ef8d32e287cdf4632cb894cec047e64eb7
---
M includes/Events/EditEventCreator.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/includes/Events/EditEventCreator.php 
b/includes/Events/EditEventCreator.php
index 7473632..bdf185d 100644
--- a/includes/Events/EditEventCreator.php
+++ b/includes/Events/EditEventCreator.php
@@ -12,6 +12,7 @@
 use MWNamespace;
 use Diff;
 use DiffOp;
+use ContentHandler;
 
 /**
  * Class that generates edit based events by handling new edits.

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

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

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable AbuseFilterCachingParser on metawiki and commonswiki

2016-10-17 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Enable AbuseFilterCachingParser on metawiki and commonswiki
..

Enable AbuseFilterCachingParser on metawiki and commonswiki

Set AbuseFilterParserClass to 'AbuseFilterCachingParser' on metawiki and
commonswiki. This parser implementation was introduced in I4aea5f00 and is
slotted to replace the default implementation. Follows If794eb2a and I8f6eb9f6,
which enabled the parser on Labs and then on mediawiki.org and testwiki.

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 3bf427d..7e37ecf 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12220,6 +12220,8 @@
 'wgAbuseFilterParserClass' => [
'default' => 'AbuseFilterParser',
'mediawikiwiki' => 'AbuseFilterCachingParser',
+   'metawiki' => 'AbuseFilterCachingParser',
+   'commonswiki' => 'AbuseFilterCachingParser',
'testwiki' => 'AbuseFilterCachingParser',
 ],
 # @}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8562f8e176b7ffb1386bd8520c9653195090afda
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: ori: update personal dot files

2016-10-14 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: ori: update personal dot files
..


ori: update personal dot files

- iron isn't the ops/root bastion anymore, we all use bast*
- palladium isn't the puppetmaster anymore, puppetmaster* instead

Bug: T147320
Change-Id: Iae93c020c301fcdac12ec0aab728ff5d040a941b
---
A modules/admin/files/home/ori/.hosts/bast1001
D modules/admin/files/home/ori/.hosts/iron
R modules/admin/files/home/ori/.hosts/puppetmaster1001
3 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/admin/files/home/ori/.hosts/bast1001 
b/modules/admin/files/home/ori/.hosts/bast1001
new file mode 100755
index 000..225fa15
--- /dev/null
+++ b/modules/admin/files/home/ori/.hosts/bast1001
@@ -0,0 +1,4 @@
+#!/bin/bash
+puppet-merge() {
+ssh puppetmaster1001 -t -- 'sudo puppet-merge'
+}
diff --git a/modules/admin/files/home/ori/.hosts/iron 
b/modules/admin/files/home/ori/.hosts/iron
deleted file mode 100755
index b35886e..000
--- a/modules/admin/files/home/ori/.hosts/iron
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-puppet-merge() {
-ssh palladium -t -- 'sudo puppet-merge'
-}
diff --git a/modules/admin/files/home/ori/.hosts/palladium 
b/modules/admin/files/home/ori/.hosts/puppetmaster1001
similarity index 100%
rename from modules/admin/files/home/ori/.hosts/palladium
rename to modules/admin/files/home/ori/.hosts/puppetmaster1001

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iae93c020c301fcdac12ec0aab728ff5d040a941b
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable AbuseFilterCachingParser on testwiki and mediawikiwiki

2016-10-13 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Enable AbuseFilterCachingParser on testwiki and mediawikiwiki
..

Enable AbuseFilterCachingParser on testwiki and mediawikiwiki

Set AbuseFilterParserClass to 'AbuseFilterCachingParser' on testwiki and
mediawiki.org. This parser implementation was introduced in I4aea5f00 and is
slotted to replace the default implementation. Follows If794eb, which enabled
the parser on Labs.

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


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

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 65f8f63..bf14539 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12207,6 +12207,12 @@
'default' => 86400,
],
 ],
+
+'wgAbuseFilterParserClass' => [
+   'default' => 'AbuseFilterParser',
+   'mediawikiwiki' => 'AbuseFilterCachingParser',
+   'testwiki' => 'AbuseFilterCachingParser',
+],
 # @}
 
 'wgThumbLimits' => [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f6eb9f6afec8f1f6b4a3109e653aba7dd58c56c
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: Module and role for Recommendation API

2016-10-12 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Module and role for Recommendation API
..


Module and role for Recommendation API

The Wikimedia Recommendation API is a JSON API that provides personalized
recommendations of wiki content (to discover, edit, translate, etc.).
It is a Flask webapp running under uWSGI.

See  for more info.

Bug: T116102
Change-Id: If5db926def3c5d1933ea0d284d540a9e99e18613
---
A manifests/role/recommendation_api.pp
A modules/recommendation_api/manifests/init.pp
A modules/role/templates/apache/sites/recommendation_api.erb
3 files changed, 98 insertions(+), 0 deletions(-)

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



diff --git a/manifests/role/recommendation_api.pp 
b/manifests/role/recommendation_api.pp
new file mode 100644
index 000..70d7a9c
--- /dev/null
+++ b/manifests/role/recommendation_api.pp
@@ -0,0 +1,18 @@
+# == Class: role::recommendation_api
+#
+# Provisions a JSON API for personalized recommendations.
+#
+class role::recommendation_api {
+include ::recommendation_api
+
+include ::apache::mod::uwsgi
+
+apache::site { 'recommendation_api':
+content => template('role/apache/sites/recommendation_api.erb'),
+}
+
+ferm::service { 'recommendation_api_http':
+proto => 'tcp',
+port  => '80',
+}
+}
diff --git a/modules/recommendation_api/manifests/init.pp 
b/modules/recommendation_api/manifests/init.pp
new file mode 100644
index 000..7c0439b
--- /dev/null
+++ b/modules/recommendation_api/manifests/init.pp
@@ -0,0 +1,75 @@
+# == Class: recommendation_api
+#
+# The Wikimedia Recommendation API is a JSON API that provides personalized
+# recommendations of wiki content (to discover, edit, translate, etc.).
+# It is a Flask webapp running under uWSGI.
+#
+# See  for more info.
+#
+class recommendation_api {
+requires_os('debian >= jessie')
+
+require_package(
+'python3-bs4',
+'python3-dateutil',
+'python3-flask',
+'python3-numpy',
+'python3-pip',
+'python3-requests',
+'python3-simplejson',
+'python3-wheel',
+'python3-yaml',
+)
+
+$base_dir   = '/srv/recommendation-api'  # top-level dir for app
+$core_dir   = "${base_dir}/core" # source code
+$wheels_dir = "${base_dir}/wheels"   # *.whl files
+$lib_dir= "${base_dir}/lib"  # dependencies (installed from 
*.whl)
+
+file { [ $base_dir, $lib_dir ]:
+ensure => directory,
+owner  => 'root',
+group  => 'root',
+mode   => '0755',
+}
+
+git::clone { 'research/recommendation-api/wheels':
+ensure=> 'latest',
+directory => $wheels_dir,
+branch=> 'master',
+}
+
+git::clone { 'research/recommendation-api':
+ensure=> 'latest',
+directory => $core_dir,
+branch=> 'master',
+}
+
+exec { 'pip_install_wheels':
+command => "/usr/bin/pip3 install --target=${lib_dir} --no-deps 
${wheels_dir}/wheels/*.whl",
+require => File[$lib_dir],
+user=> 'root',
+group   => 'root',
+subscribe   => Git::Clone['research/recommendation-api/wheels'],
+refreshonly => true,
+}
+
+uwsgi::app { 'recommendation_api':
+settings => {
+uwsgi => {
+'plugin'  => 'python3',
+'wsgi-file'   => 
"${core_dir}/recommendation/data/recommendation.wsgi",
+'master'  => true,
+'chdir'   => $core_dir,
+'http-socket' => '0.0.0.0:8080',
+'socket'  => '/run/uwsgi/recommendation_api.sock',
+'pythonpath'  => $lib_dir,
+'processes'   => inline_template('<%= @processorcount.to_i 
%>'),
+}
+},
+require  => [
+Exec['pip_install_wheels'],
+Git::Clone['research/recommendation-api'],
+],
+}
+}
diff --git a/modules/role/templates/apache/sites/recommendation_api.erb 
b/modules/role/templates/apache/sites/recommendation_api.erb
new file mode 100644
index 000..4793140
--- /dev/null
+++ b/modules/role/templates/apache/sites/recommendation_api.erb
@@ -0,0 +1,5 @@
+
+ServerName recommendation-api
+uWSGIsocket /run/uwsgi/recommendation_api.sock
+SetHandler uwsgi-handler
+

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If5db926def3c5d1933ea0d284d540a9e99e18613
Gerrit-PatchSet: 7
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Nschaaf 
Gerrit-Reviewer: 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: CachingSiteStore: store site list using global key

2016-10-05 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: CachingSiteStore: store site list using global key
..

CachingSiteStore: store site list using global key

As best as I can determine, the site list does not vary by anything
wiki-specific, so it can be made global, to save space in APC.

Change-Id: Ifd76fbe7d7cca625277026b4cd6e0dafb2004159
---
M includes/site/CachingSiteStore.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/includes/site/CachingSiteStore.php 
b/includes/site/CachingSiteStore.php
index a2f43f3..c873933 100644
--- a/includes/site/CachingSiteStore.php
+++ b/includes/site/CachingSiteStore.php
@@ -89,8 +89,8 @@
 */
private function getCacheKey() {
if ( $this->cacheKey === null ) {
-   $type = 'SiteList#' . SiteList::getSerialVersionId();
-   $this->cacheKey = wfMemcKey( "sites/$type" );
+   $this->cacheKey = $this->cache->makeGlobalKey(
+   'SiteList', SiteList::getSerialVersionId() );
}
 
return $this->cacheKey;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd76fbe7d7cca625277026b4cd6e0dafb2004159
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Keep counts of login errors by type

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

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

Change subject: Keep counts of login errors by type
..

Keep counts of login errors by type

For obvious reasons: to catch bugs and estimate their impact.
Use the message key as a proxy for error type.

Change-Id: I927e334f19845d0c49ce5870b3e0ff93b06c687b
---
M includes/specials/SpecialCentralLogin.php
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/includes/specials/SpecialCentralLogin.php 
b/includes/specials/SpecialCentralLogin.php
index da1d70a..80e3031 100644
--- a/includes/specials/SpecialCentralLogin.php
+++ b/includes/specials/SpecialCentralLogin.php
@@ -307,6 +307,8 @@
 
protected function showError( /* varargs */ ) {
$args = func_get_args();
+   RequestContext::getMain()->getStats()->increment(
+   'centralauth.login_errors.' . $args[0] );
$this->getOutput()->wrapWikiMsg( '$1', 
$args );
$this->getOutput()->addHtml( '' ); // JS only
}

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: [WIP] Module for Recommendation API

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

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

Change subject: [WIP] Module for Recommendation API
..

[WIP] Module for Recommendation API

Change-Id: If5db926def3c5d1933ea0d284d540a9e99e18613
---
M hieradata/common/scap/server.yaml
A modules/recommendation_api/manifests/init.pp
2 files changed, 35 insertions(+), 0 deletions(-)


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

diff --git a/hieradata/common/scap/server.yaml 
b/hieradata/common/scap/server.yaml
index eb21642..a34f4c8 100644
--- a/hieradata/common/scap/server.yaml
+++ b/hieradata/common/scap/server.yaml
@@ -46,6 +46,10 @@
   phabricator/deployment:
 repository: phabricator/deployment
 
+  research/recommendation-api:
+repository: research/recommendation-api
+scap_repository: research/recommendation-api/scap
+
   # Source code for taking XML dumps and snapshots of Mediawiki.
   dumps/dumps:
 repository: operations/dumps
diff --git a/modules/recommendation_api/manifests/init.pp 
b/modules/recommendation_api/manifests/init.pp
new file mode 100644
index 000..632e0bf
--- /dev/null
+++ b/modules/recommendation_api/manifests/init.pp
@@ -0,0 +1,31 @@
+# == Class: recommendation_api
+#
+class recommendation_api {
+require_package(
+'python3-flask',
+'python3-numpy',
+'python3-requests',
+'python3-yaml',
+)
+
+scap::target { 'research/recommendation-api':
+service_name => 'recommendation-api',
+deploy_user  => 'deploy-service',
+manage_user  => true,
+}
+
+uwsgi::app { 'recommendation_api':
+settings => {
+uwsgi => {
+plugins => 'python',
+'wsgi-file' => 'fix/me.py',
+callable=> 'app',
+master  => true,
+chdir   => 'source/path/fixme',
+http-socket => '0.0.0.0:8080',
+venv=> 'venv/path/fixme',
+processes   => inline_template('<%= @processorcount.to_i %>'),
+}
+}
+}
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5db926def3c5d1933ea0d284d540a9e99e18613
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] research/recommendation-api[master]: Add .gitreview

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

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

Change subject: Add .gitreview
..

Add .gitreview

Change-Id: Ifcd49ca5a1a9301c0fc23b8240b4bbcd63291a0d
---
A .gitreview
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/research/recommendation-api 
refs/changes/68/311468/1

diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..50a15cd
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=research/recommendation-api.git
+defaultbranch=master
+defaultrebase=0

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifcd49ca5a1a9301c0fc23b8240b4bbcd63291a0d
Gerrit-PatchSet: 1
Gerrit-Project: research/recommendation-api
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Memoize isWideScreen()

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

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

Change subject: Memoize isWideScreen()
..

Memoize isWideScreen()

It is called multiple times, and each call triggers a reflow.

Change-Id: Id39ed25a854fa95fad074e985afb67ab5d49a3db
---
M resources/mobile.browser/browser.js
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/resources/mobile.browser/browser.js 
b/resources/mobile.browser/browser.js
index 1da3cce..b6ec417 100644
--- a/resources/mobile.browser/browser.js
+++ b/resources/mobile.browser/browser.js
@@ -108,11 +108,11 @@
 * @method
 * @return {Boolean}
 */
-   isWideScreen: function () {
+   isWideScreen: memoize( function () {
var val = parseInt( mw.config.get( 
'wgMFDeviceWidthTablet' ), 10 );
// Check portrait and landscape mode to be consistent
return window.innerWidth >= val || window.innerHeight 
>= val;
-   },
+   } ),
/**
 * Checks browser support for a given CSS property
 * @param {String} [property] the name of the property being 
tested

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

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

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


[MediaWiki-commits] [Gerrit] mediawiki...PerformanceInspector[master]: Handle string input in humanSize()

2016-08-25 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Handle string input in humanSize()
..

Handle string input in humanSize()

The $.isNumeric( bytes ) in humanSize() is not enough to ensure that bytes is a
number, because $.isNumeric() (by design) returns true for string
representation of numbers, like '14.2'. Fix this by casting strings to number.
Also remove the special-casing of 0 -- it's OK to just let it fall through.
(The alternative would be to check for either 0 or '0').

Change-Id: I7547a8534d6c496d6e68da8a91a62c4f02098714
---
M modules/collectors/ext.PerformanceInspector.imagesize.js
M modules/collectors/ext.PerformanceInspector.modulessize.js
2 files changed, 12 insertions(+), 2 deletions(-)


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

diff --git a/modules/collectors/ext.PerformanceInspector.imagesize.js 
b/modules/collectors/ext.PerformanceInspector.imagesize.js
index c696d4f..3df17d2 100644
--- a/modules/collectors/ext.PerformanceInspector.imagesize.js
+++ b/modules/collectors/ext.PerformanceInspector.imagesize.js
@@ -20,9 +20,14 @@
var i = 0,
units = [ '', ' KiB', ' MiB', ' GiB', ' TiB', ' 
PiB' ];
 
-   if ( !$.isNumeric( bytes ) || bytes === 0 ) {
+   if ( !$.isNumeric( bytes ) ) {
return bytes;
}
+
+   if ( typeof bytes === 'string' ) {
+   bytes = parseFloat( bytes );
+   }
+
for ( ; bytes >= 1024; bytes /= 1024 ) {
i++;
}
diff --git a/modules/collectors/ext.PerformanceInspector.modulessize.js 
b/modules/collectors/ext.PerformanceInspector.modulessize.js
index de0699c..815ad6d 100644
--- a/modules/collectors/ext.PerformanceInspector.modulessize.js
+++ b/modules/collectors/ext.PerformanceInspector.modulessize.js
@@ -9,9 +9,14 @@
var i = 0,
units = [ '', ' KiB', ' MiB', ' GiB', ' TiB', ' 
PiB' ];
 
-   if ( !$.isNumeric( bytes ) || bytes === 0 ) {
+   if ( !$.isNumeric( bytes ) ) {
return bytes;
}
+
+   if ( typeof bytes === 'string' ) {
+   bytes = parseFloat( bytes );
+   }
+
for ( ; bytes >= 1024; bytes /= 1024 ) {
i++;
}

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

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

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


[MediaWiki-commits] [Gerrit] operations/puppet[production]: graphite: Set xFilesFactor to 0 for sum/count.

2016-08-09 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: graphite: Set xFilesFactor to 0 for sum/count.
..


graphite: Set xFilesFactor to 0 for sum/count.

Carbon uses xFilesFactor to decide whether to aggregate Whisper
data from one window to another (e.g. summarise the last 7days in
the 30d+ range).

Follows-up 2e1a45c0, which lowered it from 0.1 to 0.01 for most
properties. But, it changed 'count' and 'sum' from 0 to 0.01.

Per the original dc005cb9 settings, set these back to 0. Sum and
count are expected to be more-or-less reliable totals. Otherwise
even high numbers may disappear if they were reported at slow
intervals.

Change-Id: I3e3db984c19334b84d239429deaf6aee1d223cac
---
M modules/role/manifests/graphite/base.pp
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/role/manifests/graphite/base.pp 
b/modules/role/manifests/graphite/base.pp
index 17e6d74..65a3077 100644
--- a/modules/role/manifests/graphite/base.pp
+++ b/modules/role/manifests/graphite/base.pp
@@ -66,12 +66,12 @@
 },
 'count'   => {
 pattern   => '\.count$',
-xFilesFactor  => 0.01,
+xFilesFactor  => 0,
 aggregationMethod => 'sum',
 },
 'sum' => {
 pattern   => '\.sum$',
-xFilesFactor  => 0.01,
+xFilesFactor  => 0,
 aggregationMethod => 'sum',
 },
 # statsite extended counters

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3e3db984c19334b84d239429deaf6aee1d223cac
Gerrit-PatchSet: 6
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Krinkle 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: Giuseppe Lavagetto 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Support reading/writing data to/from a static PHP array - change (mediawiki...TrustedXFF)

2016-07-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Support reading/writing data to/from a static PHP array
..

Support reading/writing data to/from a static PHP array

If $wgTrustedXffFile ends with '.php', assume it is a PHP file that returns a
static associative array. This is to provide a nominal performance improvement
on HHVM, which caches the bytecode of PHP files, making relying on them more
efficient than hitting the disk for the cdb file each time.

Bug: T141120
Change-Id: Ia1976b91a897f7fd80f3ddf5a142d441ac0e88aa
---
M TrustedXFF.body.php
M generate.php
2 files changed, 41 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TrustedXFF 
refs/changes/87/300587/1

diff --git a/TrustedXFF.body.php b/TrustedXFF.body.php
index 02031d8..245c3ff 100644
--- a/TrustedXFF.body.php
+++ b/TrustedXFF.body.php
@@ -34,10 +34,16 @@
}
 
function getCdbHandle() {
+   global $wgTrustedXffFile;
+
if ( !$this->cdb ) {
-   global $wgTrustedXffFile;
-   $this->cdb = CdbReader::open( $wgTrustedXffFile );
+   if ( pathinfo( $wgTrustedXffFile, PATHINFO_EXTENSION ) 
=== 'php' ) {
+   $this->cdb = new CdbReader\Hash( include( 
$wgTrustedXffFile ) );
+   } else {
+   $this->cdb = CdbReader::open( $wgTrustedXffFile 
);
+   }
}
+
return $this->cdb;
}
 
diff --git a/generate.php b/generate.php
index 778d691..149c460 100644
--- a/generate.php
+++ b/generate.php
@@ -10,6 +10,34 @@
 use Cdb\Exception as CdbException;
 use Cdb\Writer as CdbWriter;
 
+/**
+ * Emulates Cdb\Writer, but generates a PHP file that returns
+ * an associated array, instead.
+ */
+class StaticArrayWriter {
+   public function __construct( $filename ) {
+   $this->filename = $filename;
+   $this->data = [];
+   }
+
+   public static function open( $filename ) {
+   return new self( $filename );
+   }
+
+   public function set( $key, $value ) {
+   $this->data[ $key ] = $value;
+   }
+
+   public function close() {
+   $header = sprintf( "data, true ) 
. ";\n";
+   $code = preg_replace( '/(\d+ \=\>| (?=\())/i', '', $code );
+   $code = preg_replace( "/^ +/m", "\t", $code );
+   file_put_contents( $this->filename, $code );
+   }
+}
+
 $inFileName = 'trusted-hosts.txt';
 
 $inFile = fopen( $inFileName, 'r' );
@@ -27,7 +55,9 @@
exit( 1 );
 }
 try {
-   $outFile = CdbWriter::open( $target );
+   $outFile = pathinfo( $target, PATHINFO_EXTENSION ) === 'php'
+   ? StaticArrayWriter::open( $target )
+   : CdbWriter::open( $target );
 } catch ( CdbException $e ) {
echo "Unable to open output file \"$target\"\n";
exit( 1 );
@@ -90,7 +120,7 @@
 
if ( $start === $end ) {
// Single host
-   $outFile->set( $start, '1' );
+   $outFile->set( $start, true );
$numHosts++;
showProgress( $i, count( $ranges ) );
continue;
@@ -123,7 +153,7 @@
for ( $j = $startNum; $j <= $endNum; $j++ ) {
$hex = strtoupper( base_convert( $j, 10, 16 ) );
$hex = str_pad( $hex, $suffixLength, '0', STR_PAD_LEFT );
-   $outFile->set( $prefix . $hex, '1' );
+   $outFile->set( $prefix . $hex, true );
$numHosts++;
}
showProgress( $i, count( $ranges ) );

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

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

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


[MediaWiki-commits] [Gerrit] Add alerting for MediaWiki exceptions and fatals - change (operations/puppet)

2016-07-21 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Add alerting for MediaWiki exceptions and fatals
..


Add alerting for MediaWiki exceptions and fatals

Watch the rate per minute of MediaWiki exceptions and fatals. Warn if it
exceeds 25; panic if it exceeds 50. I hope we can gradually make these numbers
lower, but for now we need to make sure we're not too noisy or we'll
inadvertantly train people to ignore the alert.

Bug: T140942
Change-Id: I638d270e52a559a5b6bc0f68788172869ca2d888
---
M modules/role/manifests/graphite/alerts.pp
1 file changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/modules/role/manifests/graphite/alerts.pp 
b/modules/role/manifests/graphite/alerts.pp
index c3031ca..c1c9f93 100644
--- a/modules/role/manifests/graphite/alerts.pp
+++ b/modules/role/manifests/graphite/alerts.pp
@@ -46,5 +46,13 @@
 percentage  => 40,
 }
 
+# Monitor MediaWiki fatals and exceptions.
+monitoring::graphite_threshold { 'mediawiki_error_rate':
+description => 'MediaWiki exceptions and fatals per minute',
+metric  => 
'transformNull(sumSeries(logstash.rate.mediawiki.fatal.ERROR.sum, 
logstash.rate.mediawiki.exception.ERROR.sum), 0)',
+warning => 25,
+critical=> 50,
+from=> '5min',
+}
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I638d270e52a559a5b6bc0f68788172869ca2d888
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Chad 
Gerrit-Reviewer: Greg Grossmeier 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add alerting for MediaWiki exceptions and fatals - change (operations/puppet)

2016-07-21 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Add alerting for MediaWiki exceptions and fatals
..

Add alerting for MediaWiki exceptions and fatals

Watch the rate per minute of MediaWiki exceptions and fatals. Warn if it
exceeds 15; panic if it exceeds 25. I hope we can gradually make these numbers
lower.

Bug: T140942
Change-Id: I638d270e52a559a5b6bc0f68788172869ca2d888
---
M modules/role/manifests/graphite/alerts.pp
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/27/300327/1

diff --git a/modules/role/manifests/graphite/alerts.pp 
b/modules/role/manifests/graphite/alerts.pp
index c3031ca..c643d0d 100644
--- a/modules/role/manifests/graphite/alerts.pp
+++ b/modules/role/manifests/graphite/alerts.pp
@@ -46,5 +46,13 @@
 percentage  => 40,
 }
 
+# Monitor MediaWiki fatals and exceptions.
+monitoring::graphite_threshold { 'mediawiki_error_rate':
+description => 'MediaWiki exceptions and fatals per minute',
+metric  => 
'transformNull(sumSeries(logstash.rate.mediawiki.fatal.ERROR.sum, 
logstash.rate.mediawiki.exception.ERROR.sum), 0)',
+warning  => 15,
+critical => 25,
+from=> '5min',
+}
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I638d270e52a559a5b6bc0f68788172869ca2d888
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Fix-up for I39d2d7db576: move log_format directive to top level - change (operations/puppet)

2016-07-19 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Fix-up for I39d2d7db576: move log_format directive to top level
..


Fix-up for I39d2d7db576: move log_format directive to top level

Change-Id: I05c4f1f42cc7c118d5a9c8a1f4066cff78c74c71
---
M modules/rcstream/templates/rcstream.nginx.erb
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/rcstream/templates/rcstream.nginx.erb 
b/modules/rcstream/templates/rcstream.nginx.erb
index e6a72f1..74de9d2 100644
--- a/modules/rcstream/templates/rcstream.nginx.erb
+++ b/modules/rcstream/templates/rcstream.nginx.erb
@@ -9,6 +9,11 @@
 server <%= if backend.to_s.include?(':') then backend else 
"127.0.0.1:#{backend}" end %>;
 <%- end -%>
 }
+
+log_format combined_with_proto '$remote_addr - $remote_user [$time_local] '
+   '"$request" $status $body_bytes_sent '
+   '"$http_referer" "$http_user_agent" '
+   '"$http_x_forwarded_proto"';
 <%- end -%>
 
 server {
@@ -17,10 +22,6 @@
 <%- end -%>
 server_name  <%= @server_name %>;
 
-log_format combined_with_proto '$remote_addr - $remote_user [$time_local] '
-   '"$request" $status $body_bytes_sent '
-   '"$http_referer" "$http_user_agent" '
-   '"$http_x_forwarded_proto"';
 
 access_log   /var/log/nginx/rcstream_<%= 'ssl_' if @use_ssl %>access.log 
combined_with_proto;
 error_log/var/log/nginx/rcstream_<%= 'ssl_' if @use_ssl %>error.log;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I05c4f1f42cc7c118d5a9c8a1f4066cff78c74c71
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Fix-up for I39d2d7db576: move log_format directive to top level - change (operations/puppet)

2016-07-19 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Fix-up for I39d2d7db576: move log_format directive to top level
..

Fix-up for I39d2d7db576: move log_format directive to top level

Change-Id: I05c4f1f42cc7c118d5a9c8a1f4066cff78c74c71
---
M modules/rcstream/templates/rcstream.nginx.erb
1 file changed, 5 insertions(+), 4 deletions(-)


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

diff --git a/modules/rcstream/templates/rcstream.nginx.erb 
b/modules/rcstream/templates/rcstream.nginx.erb
index e6a72f1..74de9d2 100644
--- a/modules/rcstream/templates/rcstream.nginx.erb
+++ b/modules/rcstream/templates/rcstream.nginx.erb
@@ -9,6 +9,11 @@
 server <%= if backend.to_s.include?(':') then backend else 
"127.0.0.1:#{backend}" end %>;
 <%- end -%>
 }
+
+log_format combined_with_proto '$remote_addr - $remote_user [$time_local] '
+   '"$request" $status $body_bytes_sent '
+   '"$http_referer" "$http_user_agent" '
+   '"$http_x_forwarded_proto"';
 <%- end -%>
 
 server {
@@ -17,10 +22,6 @@
 <%- end -%>
 server_name  <%= @server_name %>;
 
-log_format combined_with_proto '$remote_addr - $remote_user [$time_local] '
-   '"$request" $status $body_bytes_sent '
-   '"$http_referer" "$http_user_agent" '
-   '"$http_x_forwarded_proto"';
 
 access_log   /var/log/nginx/rcstream_<%= 'ssl_' if @use_ssl %>access.log 
combined_with_proto;
 error_log/var/log/nginx/rcstream_<%= 'ssl_' if @use_ssl %>error.log;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05c4f1f42cc7c118d5a9c8a1f4066cff78c74c71
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] rcstream: log X-Forwarded-Proto - change (operations/puppet)

2016-07-19 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: rcstream: log X-Forwarded-Proto
..


rcstream: log X-Forwarded-Proto

Right now the Nginx logs on rcs hosts are useless for determining which
clients are using HTTPS because TLS termination is done on the Varnishes.
So declare a log format that is identical to 'common' except it includes
X-Forwarded-Proto as an additional field.

Bug: T140128
Change-Id: I39d2d7db5767995ee66dd6481cc57ed891bff274
---
M modules/rcstream/templates/rcstream.nginx.erb
1 file changed, 7 insertions(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/rcstream/templates/rcstream.nginx.erb 
b/modules/rcstream/templates/rcstream.nginx.erb
index 6d14a72..e6a72f1 100644
--- a/modules/rcstream/templates/rcstream.nginx.erb
+++ b/modules/rcstream/templates/rcstream.nginx.erb
@@ -16,7 +16,13 @@
 listen   <%= bind %><%= ' ssl' if @use_ssl %>;
 <%- end -%>
 server_name  <%= @server_name %>;
-access_log   /var/log/nginx/rcstream_<%= 'ssl_' if @use_ssl %>access.log;
+
+log_format combined_with_proto '$remote_addr - $remote_user [$time_local] '
+   '"$request" $status $body_bytes_sent '
+   '"$http_referer" "$http_user_agent" '
+   '"$http_x_forwarded_proto"';
+
+access_log   /var/log/nginx/rcstream_<%= 'ssl_' if @use_ssl %>access.log 
combined_with_proto;
 error_log/var/log/nginx/rcstream_<%= 'ssl_' if @use_ssl %>error.log;
 
 <%- if @use_ssl -%>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I39d2d7db5767995ee66dd6481cc57ed891bff274
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] rcstream: log X-Forwarded-Proto - change (operations/puppet)

2016-07-19 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: rcstream: log X-Forwarded-Proto
..

rcstream: log X-Forwarded-Proto

Right now the Nginx logs on rcs hosts are useless for determining which
clients are using HTTPS because TLS termination is done on the Varnishes.
So declare a log format that is identical to 'common' except it includes
X-Forwarded-Proto as an additional field.

Bug: T140128
Change-Id: I39d2d7db5767995ee66dd6481cc57ed891bff274
---
M modules/rcstream/templates/rcstream.nginx.erb
1 file changed, 7 insertions(+), 1 deletion(-)


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

diff --git a/modules/rcstream/templates/rcstream.nginx.erb 
b/modules/rcstream/templates/rcstream.nginx.erb
index 6d14a72..e6a72f1 100644
--- a/modules/rcstream/templates/rcstream.nginx.erb
+++ b/modules/rcstream/templates/rcstream.nginx.erb
@@ -16,7 +16,13 @@
 listen   <%= bind %><%= ' ssl' if @use_ssl %>;
 <%- end -%>
 server_name  <%= @server_name %>;
-access_log   /var/log/nginx/rcstream_<%= 'ssl_' if @use_ssl %>access.log;
+
+log_format combined_with_proto '$remote_addr - $remote_user [$time_local] '
+   '"$request" $status $body_bytes_sent '
+   '"$http_referer" "$http_user_agent" '
+   '"$http_x_forwarded_proto"';
+
+access_log   /var/log/nginx/rcstream_<%= 'ssl_' if @use_ssl %>access.log 
combined_with_proto;
 error_log/var/log/nginx/rcstream_<%= 'ssl_' if @use_ssl %>error.log;
 
 <%- if @use_ssl -%>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39d2d7db5767995ee66dd6481cc57ed891bff274
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Add Http::sendBeacon() - change (mediawiki/core)

2016-07-15 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Add Http::sendBeacon()
..

Add Http::sendBeacon()

Add a PHP implementation of `navigator.sendBeacon`, part of the JavaScript
Beacon web API. Http::sendBeacon() matches it in signature and behavior,
sending a POST request to the specified URL with the specified payload and
doing so asyncronously, after processing the request.

The intended use-case is for sending a pingback to mediawiki.org post-install
(with the user's consent). That will be implemented in a follow-up commit.

Change-Id: I4de23b1154056b6578aeb79fc5460462135deb91
---
M includes/HttpFunctions.php
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/299203/1

diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php
index b12f49f..3509384 100644
--- a/includes/HttpFunctions.php
+++ b/includes/HttpFunctions.php
@@ -212,6 +212,29 @@
 
return "";
}
+
+   /**
+* Asynchronously transfer small HTTP data from the User Agent to a web 
server.
+*
+* This method closely matches navigator.sendBeacon(), which is part of 
the
+* Beacon web API. See 

+* and 
.
+*
+* If you need to pass advanced options to Http::post, call it directly.
+*
+* @param string $url the URL where the data is to be transmitted.
+* @param mixed $data (optional) data to be transmitted as an array of
+*   key-value pairs or as URL-encoded form data.
+* @return true
+*/
+   public static function sendBeacon( $url, array $data = [] ) {
+   $options = $data ? [ 'postData' => $data ] : [];
+   DeferredUpdates::addCallableUpdate( function () use ( $url, 
$options ) {
+   Http::post( $url, $options );
+   } );
+
+   return true;
+   }
 }
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4de23b1154056b6578aeb79fc5460462135deb91
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Update expected length of module version hash - change (mediawiki/core)

2016-07-13 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Update expected length of module version hash
..

Update expected length of module version hash

It's 7, not 8, as of I1e4fb08d179.

Change-Id: I882bf7075292ff849f2bc3af61217f7e38a4ec5f
---
M includes/resourceloader/ResourceLoaderStartUpModule.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/95/298895/1

diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php 
b/includes/resourceloader/ResourceLoaderStartUpModule.php
index 34866f3..7b2d532 100644
--- a/includes/resourceloader/ResourceLoaderStartUpModule.php
+++ b/includes/resourceloader/ResourceLoaderStartUpModule.php
@@ -217,7 +217,7 @@
}
 
$versionHash = $module->getVersionHash( $context );
-   if ( strlen( $versionHash ) !== 8 ) {
+   if ( strlen( $versionHash ) !== 7 ) {
$context->getLogger()->warning(
"Module '{module}' produced an invalid 
version hash: '{version}'.",
[

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I882bf7075292ff849f2bc3af61217f7e38a4ec5f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.10
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Update expected length of module version hash - change (mediawiki/core)

2016-07-13 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Update expected length of module version hash
..

Update expected length of module version hash

It's 7, not 8, as of I1e4fb08d179.

Change-Id: I882bf7075292ff849f2bc3af61217f7e38a4ec5f
---
M includes/resourceloader/ResourceLoaderStartUpModule.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/298892/1

diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php 
b/includes/resourceloader/ResourceLoaderStartUpModule.php
index 34866f3..7b2d532 100644
--- a/includes/resourceloader/ResourceLoaderStartUpModule.php
+++ b/includes/resourceloader/ResourceLoaderStartUpModule.php
@@ -217,7 +217,7 @@
}
 
$versionHash = $module->getVersionHash( $context );
-   if ( strlen( $versionHash ) !== 8 ) {
+   if ( strlen( $versionHash ) !== 7 ) {
$context->getLogger()->warning(
"Module '{module}' produced an invalid 
version hash: '{version}'.",
[

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I882bf7075292ff849f2bc3af61217f7e38a4ec5f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] All wikis back to 1.28.0-wmf8 - change (operations/mediawiki-config)

2016-07-11 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: All wikis back to 1.28.0-wmf8
..

All wikis back to 1.28.0-wmf8

Due to T115198:

 $ zgrep -c 'local user data' exception.log-201607*
 exception.log-20160701.gz:420
 exception.log-20160702.gz:352
 exception.log-20160703.gz:196
 exception.log-20160704.gz:246
 exception.log-20160705.gz:298
 exception.log-20160706.gz:872
 exception.log-20160707.gz:3284
 exception.log-20160708.gz:4056
 exception.log-20160709.gz:4686
 exception.log-20160710.gz:4084
 exception.log-20160711.gz:4730

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


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

diff --git a/wikiversions.json b/wikiversions.json
index 682d58e..efdbccf 100644
--- a/wikiversions.json
+++ b/wikiversions.json
@@ -1,898 +1,898 @@
 {
-"aawiki": "php-1.28.0-wmf.9",
-"aawikibooks": "php-1.28.0-wmf.9",
-"aawiktionary": "php-1.28.0-wmf.9",
-"abwiki": "php-1.28.0-wmf.9",
-"abwiktionary": "php-1.28.0-wmf.9",
-"acewiki": "php-1.28.0-wmf.9",
-"advisorywiki": "php-1.28.0-wmf.9",
-"adywiki": "php-1.28.0-wmf.9",
-"afwiki": "php-1.28.0-wmf.9",
-"afwikibooks": "php-1.28.0-wmf.9",
-"afwikiquote": "php-1.28.0-wmf.9",
-"afwiktionary": "php-1.28.0-wmf.9",
-"akwiki": "php-1.28.0-wmf.9",
-"akwikibooks": "php-1.28.0-wmf.9",
-"akwiktionary": "php-1.28.0-wmf.9",
-"alswiki": "php-1.28.0-wmf.9",
-"alswikibooks": "php-1.28.0-wmf.9",
-"alswikiquote": "php-1.28.0-wmf.9",
-"alswiktionary": "php-1.28.0-wmf.9",
-"amwiki": "php-1.28.0-wmf.9",
-"amwikiquote": "php-1.28.0-wmf.9",
-"amwiktionary": "php-1.28.0-wmf.9",
-"angwiki": "php-1.28.0-wmf.9",
-"angwikibooks": "php-1.28.0-wmf.9",
-"angwikiquote": "php-1.28.0-wmf.9",
-"angwikisource": "php-1.28.0-wmf.9",
-"angwiktionary": "php-1.28.0-wmf.9",
-"anwiki": "php-1.28.0-wmf.9",
-"anwiktionary": "php-1.28.0-wmf.9",
-"arbcom_dewiki": "php-1.28.0-wmf.9",
-"arbcom_enwiki": "php-1.28.0-wmf.9",
-"arbcom_fiwiki": "php-1.28.0-wmf.9",
-"arbcom_nlwiki": "php-1.28.0-wmf.9",
-"arcwiki": "php-1.28.0-wmf.9",
-"arwiki": "php-1.28.0-wmf.9",
-"arwikibooks": "php-1.28.0-wmf.9",
-"arwikimedia": "php-1.28.0-wmf.9",
-"arwikinews": "php-1.28.0-wmf.9",
-"arwikiquote": "php-1.28.0-wmf.9",
-"arwikisource": "php-1.28.0-wmf.9",
-"arwikiversity": "php-1.28.0-wmf.9",
-"arwiktionary": "php-1.28.0-wmf.9",
-"arzwiki": "php-1.28.0-wmf.9",
-"astwiki": "php-1.28.0-wmf.9",
-"astwikibooks": "php-1.28.0-wmf.9",
-"astwikiquote": "php-1.28.0-wmf.9",
-"astwiktionary": "php-1.28.0-wmf.9",
-"aswiki": "php-1.28.0-wmf.9",
-"aswikibooks": "php-1.28.0-wmf.9",
-"aswikisource": "php-1.28.0-wmf.9",
-"aswiktionary": "php-1.28.0-wmf.9",
-"auditcomwiki": "php-1.28.0-wmf.9",
-"avwiki": "php-1.28.0-wmf.9",
-"avwiktionary": "php-1.28.0-wmf.9",
-"aywiki": "php-1.28.0-wmf.9",
-"aywikibooks": "php-1.28.0-wmf.9",
-"aywiktionary": "php-1.28.0-wmf.9",
-"azbwiki": "php-1.28.0-wmf.9",
-"azwiki": "php-1.28.0-wmf.9",
-"azwikibooks": "php-1.28.0-wmf.9",
-"azwikiquote": "php-1.28.0-wmf.9",
-"azwikisource": "php-1.28.0-wmf.9",
-"azwiktionary": "php-1.28.0-wmf.9",
-"barwiki": "php-1.28.0-wmf.9",
-"bat_smgwiki": "php-1.28.0-wmf.9",
-"bawiki": "php-1.28.0-wmf.9",
-"bawikibooks": "php-1.28.0-wmf.9",
-"bclwiki": "php-1.28.0-wmf.9",
-"bdwikimedia": "php-1.28.0-wmf.9",
-"be_x_oldwiki": "php-1.28.0-wmf.9",
-"betawikiversity": "php-1.28.0-wmf.9",
-"bewiki": "php-1.28.0-wmf.9",
-"bewikibooks": "php-1.28.0-wmf.9",
-"bewikimedia": "php-1.28.0-wmf.9",
-"bewikiquote": "php-1.28.0-wmf.9",
-"bewikisource": "php-1.28.0-wmf.9",
-"bewiktionary": "php-1.28.0-wmf.9",
-"bgwiki": "php-1.28.0-wmf.9",
-"bgwikibooks": "php-1.28.0-wmf.9",
-"bgwikinews": "php-1.28.0-wmf.9",
-"bgwikiquote": "php-1.28.0-wmf.9",
-"bgwikisource": "php-1.28.0-wmf.9",
-"bgwiktionary": "php-1.28.0-wmf.9",
-"bhwiki": "php-1.28.0-wmf.9",
-"bhwiktionary": "php-1.28.0-wmf.9",
-"biwiki": "php-1.28.0-wmf.9",
-"biwikibooks": "php-1.28.0-wmf.9",
-"biwiktionary": "php-1.28.0-wmf.9",
-"bjnwiki": "php-1.28.0-wmf.9",
-"bmwiki": "php-1.28.0-wmf.9",
-"bmwikibooks": "php-1.28.0-wmf.9",
-"bmwikiquote": "php-1.28.0-wmf.9",
-"bmwiktionary": "php-1.28.0-wmf.9",
-"bnwiki": "php-1.28.0-wmf.9",
-"bnwikibooks": "php-1.28.0-wmf.9",
-"bnwikisource": "php-1.28.0-wmf.9",
-"bnwiktionary": "php-1.28.0-wmf.9",
-"boardgovcomwiki": "php-1.28.0-wmf.9",
-"boardwiki": "php-1.28.0-wmf.9",
-"bowiki": "php-1.28.0-wmf.9",
-"bowikibooks": "php-1.28.0-wmf.9",
-

[MediaWiki-commits] [Gerrit] PCC: Fix success/failure detection - change (operations/puppet)

2016-07-11 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: PCC: Fix success/failure detection
..


PCC: Fix success/failure detection

Puppet always sets a nonzero exit code, so resort to cruder means of testing
for success or failure.

Change-Id: I5da84a5feb9da3080938d587abac6c86d849ad10
---
M utils/pcc
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/utils/pcc b/utils/pcc
index 883034b..7a7bf69 100755
--- a/utils/pcc
+++ b/utils/pcc
@@ -150,7 +150,8 @@
 
 # Puppet's exit code is not always meaningful, so we grep the output
 # for failures before declaring victory.
-ok = build.is_good() and not re.search(r'[1-9]\d* FAIL', output)
+ok = ('Run finished' in output and not
+  re.search(r'[1-9]\d* (ERROR|FAIL)', output))
 if ok:
 print green('SUCCESS')
 sys.exit(0)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5da84a5feb9da3080938d587abac6c86d849ad10
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] PCC: Fix success/failure detection - change (operations/puppet)

2016-07-11 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: PCC: Fix success/failure detection
..

PCC: Fix success/failure detection

Puppet always sets a nonzero exit code, so resort to cruder means of testing
for success or failure.

Change-Id: I5da84a5feb9da3080938d587abac6c86d849ad10
---
M utils/pcc
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/utils/pcc b/utils/pcc
index 883034b..7a7bf69 100755
--- a/utils/pcc
+++ b/utils/pcc
@@ -150,7 +150,8 @@
 
 # Puppet's exit code is not always meaningful, so we grep the output
 # for failures before declaring victory.
-ok = build.is_good() and not re.search(r'[1-9]\d* FAIL', output)
+ok = ('Run finished' in output and not
+  re.search(r'[1-9]\d* (ERROR|FAIL)', output))
 if ok:
 print green('SUCCESS')
 sys.exit(0)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5da84a5feb9da3080938d587abac6c86d849ad10
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Bump $wgResourceLoaderMaxQueryLength to 4, 000 - change (operations/mediawiki-config)

2016-07-01 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Bump $wgResourceLoaderMaxQueryLength to 4,000
..

Bump $wgResourceLoaderMaxQueryLength to 4,000

See if this eliminates the remaining stragglers. Follows I3a8057a8.

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


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index bd1c189..dc57cee 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -260,7 +260,7 @@
 // Deprecated
 $wgIncludeLegacyJavaScript = true;
 
-$wgResourceLoaderMaxQueryLength = 3000;
+$wgResourceLoaderMaxQueryLength = 4000;
 
 if ( $wmgReduceStartupExpiry ) {
$wgResourceLoaderMaxage['unversioned'] = [ 'server' => 30, 'client' => 
30 ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6eb0ae671b94673f899ee3e4874094f6601a2637
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] explicitly specify identity for EL legacy zmq forwarder - change (operations/puppet)

2016-07-01 Thread Ori.livneh (Code Review)
Hello Nuria,

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

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

to review the following change.

Change subject: explicitly specify identity for EL legacy zmq forwarder
..

explicitly specify identity for EL legacy zmq forwarder

We are seeing consumers of the ZeroMQ stream stop receiving events when the
forwarder is restarted. My theory is that this has to do with the fact that the
identity of the subscriber is not stable across restarts unless explicitly
specified. So, specify it explicitly.

Change-Id: I7ced5658ecb8d63bd5fbe049bdd1ac2f286d9c5b
---
M manifests/role/eventlogging.pp
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/manifests/role/eventlogging.pp b/manifests/role/eventlogging.pp
index 30a29e1..4cd12bf 100644
--- a/manifests/role/eventlogging.pp
+++ b/manifests/role/eventlogging.pp
@@ -127,7 +127,7 @@
 # This forwards the kafka eventlogging-valid-mixed topic to
 # ZMQ port 8600 for backwards compatibility.
 eventlogging::service::forwarder { 'legacy-zmq':
-input   => 
"${kafka_mixed_uri}_connect=${kafka_zookeeper_url}_commit_enable=False_offset_reset=-1",
+input   => 
"${kafka_mixed_uri}_connect=${kafka_zookeeper_url}_commit_enable=False_offset_reset=-1=legacy_zmq",
 outputs => ["tcp://${eventlogging_host}:8600"],
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ced5658ecb8d63bd5fbe049bdd1ac2f286d9c5b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Nuria 

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


[MediaWiki-commits] [Gerrit] Bump $wgResourceLoaderStorageEnabled to 3, 000 - change (operations/mediawiki-config)

2016-06-30 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Bump $wgResourceLoaderStorageEnabled to 3,000
..

Bump $wgResourceLoaderStorageEnabled to 3,000

The strictest URL length limit among browsers we still support is ~5,000, for
IE 9.

Change-Id: I3a8057a8af0e2dac9db69cf655e08c2111e12c59
---
M wmf-config/CommonSettings.php
1 file changed, 1 insertion(+), 3 deletions(-)


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

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index dd4e52c..bd1c189 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -260,9 +260,7 @@
 // Deprecated
 $wgIncludeLegacyJavaScript = true;
 
-if ( gethostname() === 'osmium' ) {
-   $wgResourceLoaderStorageEnabled = false;
-}
+$wgResourceLoaderMaxQueryLength = 3000;
 
 if ( $wmgReduceStartupExpiry ) {
$wgResourceLoaderMaxage['unversioned'] = [ 'server' => 30, 'client' => 
30 ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a8057a8af0e2dac9db69cf655e08c2111e12c59
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Drop check for mbstring in copyFileBackend maintenance script - change (mediawiki/core)

2016-06-30 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Drop check for mbstring in copyFileBackend maintenance script
..

Drop check for mbstring in copyFileBackend maintenance script

Already checked in PHPVersionCheck.php as of 41d1fa1c3a.

Change-Id: I35e55b63378f1768076be0c45392fdc5d48168bf
---
M maintenance/copyFileBackend.php
1 file changed, 0 insertions(+), 4 deletions(-)


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

diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php
index 7b92f89..4f625fc 100644
--- a/maintenance/copyFileBackend.php
+++ b/maintenance/copyFileBackend.php
@@ -62,10 +62,6 @@
 
$rateFile = $this->getOption( 'ratefile' );
 
-   if ( $this->hasOption( 'utf8only' ) && !extension_loaded( 
'mbstring' ) ) {
-   $this->error( "Cannot check for UTF-8, mbstring 
extension missing.", 1 ); // die
-   }
-
foreach ( $containers as $container ) {
if ( $subDir != '' ) {
$backendRel = "$container/$subDir";

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35e55b63378f1768076be0c45392fdc5d48168bf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] For discussion: add installer option to share env data with WMF - change (mediawiki/core)

2016-06-30 Thread Ori.livneh (Code Review)
Hello Tim Starling, Krinkle, Brion VIBBER, MaxSem,

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

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

to review the following change.

Change subject: For discussion: add installer option to share env data with WMF
..

For discussion: add installer option to share env data with WMF

Log an event containing basic information about MediaWiki's environment if the
user agrees to share data with MediaWiki developers.

The option is checked by default. I think it is innocuous and I'm skeptical
that we'd get good data otherwise.

Change-Id: Ie43a6b46a07ebd9ccc1b9c3001f2ea02435d826b
---
M includes/installer/Installer.php
M includes/installer/WebInstallerName.php
M includes/installer/i18n/en.json
M includes/installer/i18n/qqq.json
4 files changed, 57 insertions(+), 1 deletion(-)


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

diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index 4d5aa7a..9f0b32b 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -1617,10 +1617,56 @@
$this->subscribeToMediaWikiAnnounce( $status );
}
 
+   if ( $this->getVar( '_Pingback' ) ) {
+   try {
+   $this->sendPingback();
+   } catch ( Exception $e ) { }
+   }
+
return $status;
}
 
/**
+* Send information about this MediaWiki instance to MediaWiki.org.
+*
+* The data is structured and serialized to match the expectations of
+* EventLogging, a software suite used by the Wikimedia Foundation for
+* logging and processing analytic data.
+*
+* Compare:
+* 
+*
+* The schema for the data is located at:
+* 
+*/
+   private function sendPingback() {
+   global $wgVersion;
+
+   $event = [
+   'schema'   => 'MediaWikiInstallPingback',
+   'revision' => 15732959,
+   'wiki' => 'Installer',
+   'event'=> [
+   'database'  => $this->getVar( 'wgDBtype' ),
+   'MediaWiki' => $wgVersion,
+   'PHP'   => PHP_VERSION,
+   'OS'=> PHP_OS . ' ' . php_uname( 'r' ),
+   'arch'  => PHP_INT_SIZE === 8 ? 64 : 32,
+   'curl'  => extension_loaded( 'curl' ),
+   'machine'   => php_uname( 'm' ),
+   'webServer' => isset( 
$_SERVER['SERVER_SOFTWARE'] )
+   ?  $_SERVER['SERVER_SOFTWARE']
+   : PHP_SAPI,
+   ],
+   ];
+   $json = str_replace( ' ', '\u0020', FormatJson::encode( $event 
) );
+   $url = 'https://www.mediawiki.org/beacon/event?' . 
rawurlencode( $json ) . ';';
+
+   Http::post( $url );
+   }
+
+   /**
 * @param Status $s
 */
private function subscribeToMediaWikiAnnounce( Status $s ) {
diff --git a/includes/installer/WebInstallerName.php 
b/includes/installer/WebInstallerName.php
index dcd30cf..b6de1fc 100644
--- a/includes/installer/WebInstallerName.php
+++ b/includes/installer/WebInstallerName.php
@@ -100,6 +100,12 @@
'label' => 'config-subscribe',
'help' => $this->parent->getHelpBox( 
'config-subscribe-help' )
] ) .
+   $this->parent->getCheckBox( [
+   'var' => '_Pingback',
+   'label' => 'config-pingback',
+   'help' => $this->parent->getHelpBox( 
'config-pingback-help' ),
+   'value' => true,
+   ] ) .
$this->getFieldsetEnd() .
$this->parent->getInfoBox( wfMessage( 
'config-almost-done' )->text() ) .
// getRadioSet() builds a set of labeled radio buttons.
@@ -129,7 +135,7 @@
$retVal = true;
$this->parent->setVarsFromRequest( [ 'wgSitename', 
'_NamespaceType',
'_AdminName', '_AdminPassword', 
'_AdminPasswordConfirm', '_AdminEmail',
-   '_Subscribe', '_SkipOptional', 'wgMetaNamespace' ] );
+   '_Pingback', '_Subscribe', '_SkipOptional', 

[MediaWiki-commits] [Gerrit] Don't show the banner on action=edit - change (mediawiki...CentralNotice)

2016-06-27 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Don't show the banner on action=edit
..

Don't show the banner on action=edit

* It's a nice gesture to contributors.
* Edit pages represent a small fraction of site traffic.
* On submitting an edit, the user is taken to the article view.
* We have editnotice for targetting edit pages specifically.

Bug: T138177
Change-Id: I4b83e344464258c4d7f9bbd95015e5eae5e48c05
---
M CentralNotice.hooks.php
1 file changed, 5 insertions(+), 1 deletion(-)


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

diff --git a/CentralNotice.hooks.php b/CentralNotice.hooks.php
index 21c0efc..f209b49 100644
--- a/CentralNotice.hooks.php
+++ b/CentralNotice.hooks.php
@@ -213,7 +213,11 @@
  * @return bool
  */
 function efCentralNoticeLoader( $out, $skin ) {
-   global $wgCentralHost, $wgServer;
+   global $wgCentralHost, $wgServer, $wgRequest;
+
+   if ( $wgRequest->getText( 'action' ) === 'edit' ) {
+   return true;  // bail
+   }
 
// Insert DNS prefetch for banner loading
if ( $wgCentralHost && $wgCentralHost !== $wgServer ) {

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

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

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


[MediaWiki-commits] [Gerrit] Remove ResourceLoaderModule methods that were deprecated in ... - change (mediawiki/core)

2016-06-26 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Remove ResourceLoaderModule methods that were deprecated in 1.26
..

Remove ResourceLoaderModule methods that were deprecated in 1.26

Removed:
- ResourceLoaderModule::getModifiedTime
- ResourceLoaderModule::getModifiedHash
- ResourceLoaderModule::getHashMtime
- ResourceLoaderModule::getDefinitionMtime

No usage @wikimedia on GitHub.

Change-Id: I1dd0b8892b5896c147f81ec5ffb41f5f0dc7ae4c
---
M includes/resourceloader/ResourceLoaderModule.php
1 file changed, 0 insertions(+), 57 deletions(-)


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

diff --git a/includes/resourceloader/ResourceLoaderModule.php 
b/includes/resourceloader/ResourceLoaderModule.php
index 121a6c9..3091279 100644
--- a/includes/resourceloader/ResourceLoaderModule.php
+++ b/includes/resourceloader/ResourceLoaderModule.php
@@ -782,63 +782,6 @@
}
 
/**
-* Get this module's last modification timestamp for a given context.
-*
-* @deprecated since 1.26 Use getDefinitionSummary() instead
-* @param ResourceLoaderContext $context Context object
-* @return int|null UNIX timestamp
-*/
-   public function getModifiedTime( ResourceLoaderContext $context ) {
-   return null;
-   }
-
-   /**
-* Helper method for providing a version hash to getVersionHash().
-*
-* @deprecated since 1.26 Use getDefinitionSummary() instead
-* @param ResourceLoaderContext $context
-* @return string|null Hash
-*/
-   public function getModifiedHash( ResourceLoaderContext $context ) {
-   return null;
-   }
-
-   /**
-* Back-compat dummy for old subclass implementations of 
getModifiedTime().
-*
-* This method used to use ObjectCache to track when a hash was first 
seen. That principle
-* stems from a time that ResourceLoader could only identify module 
versions by timestamp.
-* That is no longer the case. Use getDefinitionSummary() directly.
-*
-* @deprecated since 1.26 Superseded by getVersionHash()
-* @param ResourceLoaderContext $context
-* @return int UNIX timestamp
-*/
-   public function getHashMtime( ResourceLoaderContext $context ) {
-   if ( !is_string( $this->getModifiedHash( $context ) ) ) {
-   return 1;
-   }
-   // Dummy that is > 1
-   return 2;
-   }
-
-   /**
-* Back-compat dummy for old subclass implementations of 
getModifiedTime().
-*
-* @since 1.23
-* @deprecated since 1.26 Superseded by getVersionHash()
-* @param ResourceLoaderContext $context
-* @return int UNIX timestamp
-*/
-   public function getDefinitionMtime( ResourceLoaderContext $context ) {
-   if ( $this->getDefinitionSummary( $context ) === null ) {
-   return 1;
-   }
-   // Dummy that is > 1
-   return 2;
-   }
-
-   /**
 * Check whether this module is known to be empty. If a child class
 * has an easy and cheap way to determine that this module is
 * definitely going to be empty, it should override this method to

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1dd0b8892b5896c147f81ec5ffb41f5f0dc7ae4c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Use hashes instead of names in module strings - change (mediawiki/core)

2016-06-26 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Use hashes instead of names in module strings
..

Use hashes instead of names in module strings

The code that enforces $wgResourceLoaderMaxQueryLength is a good contender for
being the nastiest piece of JavaScript in ResourceLoader. It forces the code
that partitions the list of module dependencies into logical batches to predict
how the modules will eventually be packed in a query string, so that it can
avoid calling doRequest() with input that would cause it to produce a URL that
would exceed the limit. This requires that the caller of doRequest() know
absurdly specific things about the behavior of downstream code, such as the
fact that $.param() will inflate the length of the separator characters used by
buildModuleString() because they will need to be percent-encoded.

This patch blows away all of this cruft by defining a compact scheme for
packing module requirements into a query string. Instead of identifying each
module by name, each module name is converted into an 8-character hash, and the
hashes are concatenated together. PHP code is able to resolve these hashes by
iterating on all known module names and building a reverse-lookup table.

There are no collisions (two distinct module names that hash to the same value)
in the 3,727 module names I could discover by iterating through Wikimedia
wikis. The risk of collisions is very remote, but it does exist, so the code
handles it gracefully.  In case of collision, the backend will not be able to
determine which module the frontend intended to request. The solution is to
simply send both, and let the frontend pick the right one.

Notes:

* The module hash is sent as the value of the 'hash' query parameter. It
  replaces the old 'modules' parameter, except in debug mode. Support for the
  'modules' parameter (and its peculiar encoding) is retained so as to preserve
  backward-compatibility and to make the migration process smooth.
* Since even the default (paranoid) value of 512 for 
suhosin.get.max_value_length
  is enough to accomodate 60 modules, we don't have to check it in the 
installer.

Change-Id: If60f264e9c31fa8a6e24d9faa7e035734a5abb0e
---
M includes/DefaultSettings.php
M includes/OutputPage.php
M includes/Setup.php
M includes/installer/Installer.php
M includes/installer/i18n/en.json
M includes/installer/i18n/qqq.json
M includes/resourceloader/ResourceLoader.php
M includes/resourceloader/ResourceLoaderContext.php
M includes/resourceloader/ResourceLoaderStartUpModule.php
M resources/src/mediawiki/mediawiki.js
M tests/phpunit/includes/OutputPageTest.php
M tests/phpunit/includes/resourceloader/ResourceLoaderTest.php
12 files changed, 70 insertions(+), 140 deletions(-)


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

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index f176556..1e29e69 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -3669,21 +3669,6 @@
 $wgLegacyJavaScriptGlobals = true;
 
 /**
- * If set to a positive number, ResourceLoader will not generate URLs whose
- * query string is more than this many characters long, and will instead use
- * multiple requests with shorter query strings. This degrades performance,
- * but may be needed if your web server has a low (less than, say 1024)
- * query string length limit or a low value for suhosin.get.max_value_length
- * that you can't increase.
- *
- * If set to a negative number, ResourceLoader will assume there is no query
- * string length limit.
- *
- * Defaults to a value based on php configuration.
- */
-$wgResourceLoaderMaxQueryLength = false;
-
-/**
  * If set to true, JavaScript modules loaded from wiki pages will be parsed
  * prior to minification to validate it.
  *
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 53c70d8..1f42b63 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2875,7 +2875,7 @@
$query['version'] = 
$resourceLoader->getCombinedVersion( $context, array_keys( $grpModules ) );
}
 
-   $query['modules'] = 
ResourceLoader::makePackedModulesString( array_keys( $grpModules ) );
+   $query['hash'] = 
ResourceLoader::makePackedModulesString( array_keys( $grpModules ) );
$moduleContext = new ResourceLoaderContext( 
$resourceLoader, new FauxRequest( $query ) );
$url = $resourceLoader->createLoaderURL( 
$source, $moduleContext, $extraQuery );
 
diff --git a/includes/Setup.php b/includes/Setup.php
index 5877932..c1eb7ae 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -349,17 +349,6 @@
$wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
 }
 
-// Default 

[MediaWiki-commits] [Gerrit] Replace SHA1 with 32-bit FNV-1 as ResourceLoader's hash func... - change (mediawiki/core)

2016-06-26 Thread Ori.livneh (Code Review)
Hello Krinkle,

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

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

to review the following change.

Change subject: Replace SHA1 with 32-bit FNV-1 as ResourceLoader's hash function
..

Replace SHA1 with 32-bit FNV-1 as ResourceLoader's hash function

SHA-1 is not secure enough to be used as a cryptographic hash function, and its
implementation in JavaScript is too long and too slow for it to be a good
general-purpose hash function. And we currently throw away most of the work:
SHA-1 produces 160-bit hash values, of which we keep 48.

Although the JavaScript implementation is not exported, SHA-1 is a well-known
hash function, and I'm willing to bet that sooner or later someone will move to
make it accessible to other modules, at which point usage will start to spread.

For ResourceLoader, the qualities we're looking for in a hash function are:

* Already implemented in PHP
* Easy to implement in JavaScript
* Fast
* Collision-resistant

The requirement that hashes be cheap to compute in JavaScript narrows the field
to 32-bit hash functions, because in JavaScript bitwise operators treat their
operands as 32 bits, and arithmetic uses double-precision floats, which have a
total precision of 53 bits. It's possible to work around these limitations, but
it's a lot of extra work.

The best match I found is the 32-bit variant of FNV-1, which is available in
PHP as of version 5.4 (as 'fnv132'). The JavaScript implementation is around
ten times faster and eight times shorter.

Change-Id: I1e4fb08d17948538d96f241b2464d594fdc14578
---
M includes/resourceloader/ResourceLoader.php
M resources/Resources.php
D resources/lib/phpjs-sha1/sha1.js
M resources/src/mediawiki/mediawiki.js
M tests/phpunit/includes/resourceloader/ResourceLoaderStartUpModuleTest.php
5 files changed, 30 insertions(+), 158 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/76/296176/1

diff --git a/includes/resourceloader/ResourceLoader.php 
b/includes/resourceloader/ResourceLoader.php
index 09535b7..633cd49 100644
--- a/includes/resourceloader/ResourceLoader.php
+++ b/includes/resourceloader/ResourceLoader.php
@@ -601,10 +601,7 @@
 * @return string Hash
 */
public static function makeHash( $value ) {
-   // Use base64 to output more entropy in a more compact string 
(default hex is only base16).
-   // The first 8 chars of a base64 encoded digest represent the 
same binary as
-   // the first 12 chars of a hex encoded digest.
-   return substr( base64_encode( sha1( $value, true ) ), 0, 8 );
+   return hash( 'fnv132', $value );
}
 
/**
diff --git a/resources/Resources.php b/resources/Resources.php
index e31e77e..7601e3a 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -841,7 +841,6 @@
'class' => 'ResourceLoaderRawFileModule',
// Keep in sync with maintenance/jsduck/eg-iframe.html
'scripts' => [
-   'resources/lib/phpjs-sha1/sha1.js',
'resources/src/mediawiki/mediawiki.js',

'resources/src/mediawiki/mediawiki.requestIdleCallback.js',
'resources/src/mediawiki/mediawiki.errorLogger.js',
diff --git a/resources/lib/phpjs-sha1/sha1.js b/resources/lib/phpjs-sha1/sha1.js
deleted file mode 100644
index 93c533d..000
--- a/resources/lib/phpjs-sha1/sha1.js
+++ /dev/null
@@ -1,147 +0,0 @@
-function sha1(str) {
-  //  discuss at: http://phpjs.org/functions/sha1/
-  // original by: Webtoolkit.info (http://www.webtoolkit.info/)
-  // improved by: Michael White (http://getsprink.com)
-  // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
-  //input by: Brett Zamir (http://brett-zamir.me)
-  //   example 1: sha1('Kevin van Zonneveld');
-  //   returns 1: '54916d2e62f65b3afa6e192e6a601cdbe5cb5897'
-
-  var rotate_left = function (n, s) {
-var t4 = (n << s) | (n >>> (32 - s));
-return t4;
-  };
-
-  /*var lsb_hex = function (val) {
-   // Not in use; needed?
-var str="";
-var i;
-var vh;
-var vl;
-
-for ( i=0; i<=6; i+=2 ) {
-  vh = (val>>>(i*4+4))&0x0f;
-  vl = (val>>>(i*4))&0x0f;
-  str += vh.toString(16) + vl.toString(16);
-}
-return str;
-  };*/
-
-  var cvt_hex = function (val) {
-var str = '';
-var i;
-var v;
-
-for (i = 7; i >= 0; i--) {
-  v = (val >>> (i * 4)) & 0x0f;
-  str += v.toString(16);
-}
-return str;
-  };
-
-  var blockstart;
-  var i, j;
-  var W = new Array(80);
-  var H0 = 0x67452301;
-  var H1 = 0xEFCDAB89;
-  var H2 = 0x98BADCFE;
-  var H3 = 0x10325476;
-  var H4 = 0xC3D2E1F0;
-  var A, B, C, D, E;
-  var temp;
-
-  // utf8_encode
-  str = unescape(encodeURIComponent(str));
-  var str_len = str.length;
-
-  var word_array = [];
-  for (i = 0; i < 

[MediaWiki-commits] [Gerrit] [NOT FOR MERGING] hack maintain-replicas.pl for adywiki/jamwiki - change (operations/software)

2016-06-22 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: [NOT FOR MERGING] hack maintain-replicas.pl for adywiki/jamwiki
..

[NOT FOR MERGING] hack maintain-replicas.pl for adywiki/jamwiki

- Get credentials from DB_USER and DB_PASS envvars instead of trying to parse
  (incorrectly) ~/.my.cnf.
- Don't process any wikis except adywiki and jamwiki
- Print SQL statements on STDERR, so they can be captured and replayed.
- Replace the labs dbs with localhost. Undo this hack to run on labs dbs.

Bug: T135029
Change-Id: Ib5c28e4d9ccfbf5b76223d667eb43a7b1121efc2
---
M maintain-replicas/maintain-replicas.pl
1 file changed, 10 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software 
refs/changes/64/295564/1

diff --git a/maintain-replicas/maintain-replicas.pl 
b/maintain-replicas/maintain-replicas.pl
index c38d77a..f97702a 100755
--- a/maintain-replicas/maintain-replicas.pl
+++ b/maintain-replicas/maintain-replicas.pl
@@ -54,9 +54,10 @@
 }
 
 my %slices = (
-'c1' => [ 'labsdb1001.eqiad.wmnet', 3306 ],
-'c2' => [ 'labsdb1002.eqiad.wmnet', 3306 ],
-'c3' => [ 'labsdb1003.eqiad.wmnet', 3306 ],
+'c1' => [ 'localhost', 3306 ],
+# 'c1' => [ 'labsdb1001.eqiad.wmnet', 3306 ],
+# 'c2' => [ 'labsdb1002.eqiad.wmnet', 3306 ],
+# 'c3' => [ 'labsdb1003.eqiad.wmnet', 3306 ],
 );
 
 my @fullviews = (
@@ -335,24 +336,8 @@
 'group'  => 'wl_namespace, wl_title having wl_count >= 30', },
 );
 
-my $dbuser;
-my $dbpassword;
-my $mycnf = $ENV{'HOME'} . "/.my.cnf";
-if(open MYCNF, "<$mycnf") {
-my $client = 0;
-while() {
-if(m/^\[client\]\s*$/) {
-$client = 1;
-next;
-}
-$client = 0 if m/^\[/;
-next unless $client;
-$dbuser = $1 if m/^\s*user\s*=\s*'(.*)'\s*$/;
-$dbpassword = $1 if m/^\s*password\s*=\s*'(.*)'\s*$/;
-}
-close MYCNF;
-}
-die "No credentials for connecting to databases.\n" unless defined $dbuser and 
defined $dbpassword;
+my $dbuser = $ENV{'DB_USER'};
+my $dbpassword = $ENV{'DB_PASS'};
 
 chdir "mediawiki-config";
 
@@ -360,12 +345,8 @@
 
 my %db;
 
-open ALL, ") {
-chomp;
-$db{$_} = {};
-}
-close ALL;
+$db{'adywiki'} = {};
+$db{'jamwiki'} = {};
 
 sub dbprop($$$) {
 my($list, $prop, $val) = @_;
@@ -401,7 +382,6 @@
 # exposed through the API so we have to hardcode it here to match
 # what is in InitialiseSettings.php
 dbprop "wiktionary", "sensitive", 1;
-$db{'jbowiki'}->{'sensitive'} = 1;
 
 open IS, "{'deleted'};
 next if defined $db->{'private'};
 my $canon = $canonical{$dbk};
@@ -473,6 +454,7 @@
 
 sub sql($) {
 my ($query) = @_;
+print STDERR "$query\n";
 return $dbh->do($query);
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5c28e4d9ccfbf5b76223d667eb43a7b1121efc2
Gerrit-PatchSet: 1
Gerrit-Project: operations/software
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Optimize mobile static images - change (operations/mediawiki-config)

2016-06-21 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Optimize mobile static images
..

Optimize mobile static images

Each file was converted to PNG8+alpha with ImageAlpha (https://pngmini.com/)
and had its palette reduced as far as possible without visibly degrading
quality. Then each file was further processed with zopflipng:

   zopflipng --iterations=100 --filters=01234mepb --lossy_transparent

The mean reduction in file size is 76%.

   file before   after   %diff
   ---
   W.png 1115b   1034b -8%
   commons.png   2003b983b-68%
   mediawiki.png31040b   9782b   -104%
   meta.png  6916b   2552b-92%
   wikibooks.png 3403b914b   -115%
   wikidata.png   447b369b-19%
   wikimedia.png 2003b914b-75%
   wikinews.png  4464b   1920b-80%
   wikipedia-wordmark-en.png 2516b956b-90%
   wikiquote.png 2306b   1016b-78%
   wikisource.png6708b   2354b-96%
   wikispecies.png  10291b   3260b   -104%
   wikiversity.png   2082b   1757b-17%
   wikivoyage.png1531b585b-89%
   wiktionary.png9717b   3480b-95%

Change-Id: I8f09e82529da0ce2aa210a2b14ee5ccf0bb52f94
---
M static/images/mobile/W.png
M static/images/mobile/commons.png
M static/images/mobile/mediawiki.png
M static/images/mobile/meta.png
M static/images/mobile/wikibooks.png
M static/images/mobile/wikidata.png
M static/images/mobile/wikimedia.png
M static/images/mobile/wikinews.png
M static/images/mobile/wikipedia-wordmark-en.png
M static/images/mobile/wikiquote.png
M static/images/mobile/wikisource.png
M static/images/mobile/wikispecies.png
M static/images/mobile/wikiversity.png
M static/images/mobile/wikivoyage.png
M static/images/mobile/wiktionary.png
15 files changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/static/images/mobile/W.png b/static/images/mobile/W.png
index c253240..6e89a88 100644
--- a/static/images/mobile/W.png
+++ b/static/images/mobile/W.png
Binary files differ
diff --git a/static/images/mobile/commons.png b/static/images/mobile/commons.png
index 80b5776..be9f7aa 100644
--- a/static/images/mobile/commons.png
+++ b/static/images/mobile/commons.png
Binary files differ
diff --git a/static/images/mobile/mediawiki.png 
b/static/images/mobile/mediawiki.png
index a398c4e..64da935 100644
--- a/static/images/mobile/mediawiki.png
+++ b/static/images/mobile/mediawiki.png
Binary files differ
diff --git a/static/images/mobile/meta.png b/static/images/mobile/meta.png
index 1229122..df5f206 100644
--- a/static/images/mobile/meta.png
+++ b/static/images/mobile/meta.png
Binary files differ
diff --git a/static/images/mobile/wikibooks.png 
b/static/images/mobile/wikibooks.png
index 6c9b8cb..f54c86e 100644
--- a/static/images/mobile/wikibooks.png
+++ b/static/images/mobile/wikibooks.png
Binary files differ
diff --git a/static/images/mobile/wikidata.png 
b/static/images/mobile/wikidata.png
index 4ca38af..c2df49d 100644
--- a/static/images/mobile/wikidata.png
+++ b/static/images/mobile/wikidata.png
Binary files differ
diff --git a/static/images/mobile/wikimedia.png 
b/static/images/mobile/wikimedia.png
index 7eb3745..675e279 100644
--- a/static/images/mobile/wikimedia.png
+++ b/static/images/mobile/wikimedia.png
Binary files differ
diff --git a/static/images/mobile/wikinews.png 
b/static/images/mobile/wikinews.png
index aa56893..320cb66 100644
--- a/static/images/mobile/wikinews.png
+++ b/static/images/mobile/wikinews.png
Binary files differ
diff --git a/static/images/mobile/wikipedia-wordmark-en.png 
b/static/images/mobile/wikipedia-wordmark-en.png
index 22a4c11..27acc03 100644
--- a/static/images/mobile/wikipedia-wordmark-en.png
+++ b/static/images/mobile/wikipedia-wordmark-en.png
Binary files differ
diff --git a/static/images/mobile/wikiquote.png 
b/static/images/mobile/wikiquote.png
index dfe53fa..a24dbfb 100644
--- a/static/images/mobile/wikiquote.png
+++ b/static/images/mobile/wikiquote.png
Binary files differ
diff --git a/static/images/mobile/wikisource.png 
b/static/images/mobile/wikisource.png
index cba8854..3a0e653 100644
--- a/static/images/mobile/wikisource.png
+++ b/static/images/mobile/wikisource.png
Binary files differ
diff --git a/static/images/mobile/wikispecies.png 
b/static/images/mobile/wikispecies.png
index 89d8add..0ae65b2 100644
--- a/static/images/mobile/wikispecies.png
+++ b/static/images/mobile/wikispecies.png
Binary files differ
diff --git a/static/images/mobile/wikiversity.png 
b/static/images/mobile/wikiversity.png
index 49b9138..11aebf8 100644
--- 

[MediaWiki-commits] [Gerrit] Provision a "staging" microsite for the transparency report - change (operations/puppet)

2016-06-20 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Provision a "staging" microsite for the transparency report
..


Provision a "staging" microsite for the transparency report

Provision a private microsite of the transparency report, served under /private
from files in the private transparency report Gerrit repository.

Bug: T138197
Change-Id: If35ba69c2c295c29b24b81f023e8954ae29e4e89
---
M modules/role/manifests/microsites/transparency.pp
M templates/apache/sites/transparency.wikimedia.org.erb
2 files changed, 43 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/role/manifests/microsites/transparency.pp 
b/modules/role/manifests/microsites/transparency.pp
index e031b8a..221ab5a 100644
--- a/modules/role/manifests/microsites/transparency.pp
+++ b/modules/role/manifests/microsites/transparency.pp
@@ -5,18 +5,48 @@
 #
 class role::microsites::transparency {
 include ::apache
+include ::apache::mod::authnz_ldap
 include ::apache::mod::rewrite
 include ::apache::mod::headers
+
+include ::passwords::misc::private_static_site
+include ::passwords::ldap::production
+
 include base::firewall
 
 $repo_dir = '/srv/org/wikimedia/TransparencyReport'
 $docroot  = "${repo_dir}/build"
 
+$private_repo_dir = "${repo_dir}-private"
+$private_docroot = "${private_repo_dir}/build"
+
 git::clone { 'wikimedia/TransparencyReport':
 ensure=> latest,
 directory => $repo_dir,
 }
 
+$user = $passwords::misc::private_static_site::user
+$pass = $passwords::misc::private_static_site::pass
+
+git::clone { 'wikimedia/TransparencyReport-private':
+ensure=> latest,
+origin=> 
"https://${user}:${pass}@gerrit.wikimedia.org/r/wikimedia/TransparencyReport-private;,
+directory => $private_repo_dir,
+}
+
+# LDAP configuration. Interpolated into the Apache site template
+# to provide mod_authnz_ldap-based user authentication.
+$auth_ldap = {
+name  => 'ops/wmf',
+bind_dn   => 'cn=proxyagent,ou=profile,dc=wikimedia,dc=org',
+bind_password => $passwords::ldap::production::proxypass,
+url   => 'ldaps://ldap-labs.eqiad.wikimedia.org 
ldap-labs.codfw.wikimedia.org/ou=people,dc=wikimedia,dc=org?cn',
+groups=> [
+'cn=ops,ou=groups,dc=wikimedia,dc=org',
+'cn=wmf,ou=groups,dc=wikimedia,dc=org',
+],
+}
+
 apache::site { 'transparency.wikimedia.org':
 content => template('apache/sites/transparency.wikimedia.org.erb'),
 }
diff --git a/templates/apache/sites/transparency.wikimedia.org.erb 
b/templates/apache/sites/transparency.wikimedia.org.erb
index b733ee2..ad38f28 100644
--- a/templates/apache/sites/transparency.wikimedia.org.erb
+++ b/templates/apache/sites/transparency.wikimedia.org.erb
@@ -4,8 +4,21 @@
 
 ServerName transparency.wikimedia.org
 DocumentRoot <%= @docroot %>
+Alias /private <%= @private_docroot %>
 
 >
 Require all granted
 
+
+>
+  AuthName "<%= @auth_ldap['name'] %>"
+  AuthType Basic
+  AuthBasicProvider ldap
+  AuthLDAPBindDN <%= @auth_ldap['bind_dn'] %>
+  AuthLDAPBindPassword <%= @auth_ldap['bind_password'] %>
+  AuthLDAPURL "<%= @auth_ldap['url'] %>"
+  <% @auth_ldap['groups'].each do |group| -%>
+  Require ldap-group <%= group %>
+  <% end -%>
+
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If35ba69c2c295c29b24b81f023e8954ae29e4e89
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add passwords::misc::private_static_site - change (labs/private)

2016-06-20 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Add passwords::misc::private_static_site
..


Add passwords::misc::private_static_site

Change-Id: Ifb52d0c19ce1181150a96c243c0cf841ca1c77db
---
M modules/passwords/manifests/init.pp
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/modules/passwords/manifests/init.pp 
b/modules/passwords/manifests/init.pp
index 4b6c0a8..fef33d2 100644
--- a/modules/passwords/manifests/init.pp
+++ b/modules/passwords/manifests/init.pp
@@ -178,6 +178,11 @@
 $rt_mysql_pass = 'fakertpassword'
 }
 
+class passwords::misc::private_static_site {
+$user = "fakeuser"
+$pass = "fakepass"
+}
+
 class passwords::tendril {
 $db_user = "fakeuser"
 $db_pass = "fakepass"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb52d0c19ce1181150a96c243c0cf841ca1c77db
Gerrit-PatchSet: 1
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Add passwords::misc::private_static_site - change (labs/private)

2016-06-20 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Add passwords::misc::private_static_site
..

Add passwords::misc::private_static_site

Change-Id: Ifb52d0c19ce1181150a96c243c0cf841ca1c77db
---
M modules/passwords/manifests/init.pp
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/private 
refs/changes/93/295193/1

diff --git a/modules/passwords/manifests/init.pp 
b/modules/passwords/manifests/init.pp
index 4b6c0a8..fef33d2 100644
--- a/modules/passwords/manifests/init.pp
+++ b/modules/passwords/manifests/init.pp
@@ -178,6 +178,11 @@
 $rt_mysql_pass = 'fakertpassword'
 }
 
+class passwords::misc::private_static_site {
+$user = "fakeuser"
+$pass = "fakepass"
+}
+
 class passwords::tendril {
 $db_user = "fakeuser"
 $db_pass = "fakepass"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb52d0c19ce1181150a96c243c0cf841ca1c77db
Gerrit-PatchSet: 1
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Provision a "staging" microsite for the transparency report - change (operations/puppet)

2016-06-20 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Provision a "staging" microsite for the transparency report
..

Provision a "staging" microsite for the transparency report

Provision a private microsite of the transparency report, served under /private
from files in the private transparency report Gerrit repository.

Bug: T138197
Change-Id: If35ba69c2c295c29b24b81f023e8954ae29e4e89
---
M modules/role/manifests/microsites/transparency.pp
M templates/apache/sites/transparency.wikimedia.org.erb
2 files changed, 43 insertions(+), 0 deletions(-)


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

diff --git a/modules/role/manifests/microsites/transparency.pp 
b/modules/role/manifests/microsites/transparency.pp
index e031b8a..221ab5a 100644
--- a/modules/role/manifests/microsites/transparency.pp
+++ b/modules/role/manifests/microsites/transparency.pp
@@ -5,18 +5,48 @@
 #
 class role::microsites::transparency {
 include ::apache
+include ::apache::mod::authnz_ldap
 include ::apache::mod::rewrite
 include ::apache::mod::headers
+
+include ::passwords::misc::private_static_site
+include ::passwords::ldap::production
+
 include base::firewall
 
 $repo_dir = '/srv/org/wikimedia/TransparencyReport'
 $docroot  = "${repo_dir}/build"
 
+$private_repo_dir = "${repo_dir}-private"
+$private_docroot = "${private_repo_dir}/build"
+
 git::clone { 'wikimedia/TransparencyReport':
 ensure=> latest,
 directory => $repo_dir,
 }
 
+$user = $passwords::misc::private_static_site::user
+$pass = $passwords::misc::private_static_site::pass
+
+git::clone { 'wikimedia/TransparencyReport-private':
+ensure=> latest,
+origin=> 
"https://${user}:${pass}@gerrit.wikimedia.org/r/wikimedia/TransparencyReport-private;,
+directory => $private_repo_dir,
+}
+
+# LDAP configuration. Interpolated into the Apache site template
+# to provide mod_authnz_ldap-based user authentication.
+$auth_ldap = {
+name  => 'ops/wmf',
+bind_dn   => 'cn=proxyagent,ou=profile,dc=wikimedia,dc=org',
+bind_password => $passwords::ldap::production::proxypass,
+url   => 'ldaps://ldap-labs.eqiad.wikimedia.org 
ldap-labs.codfw.wikimedia.org/ou=people,dc=wikimedia,dc=org?cn',
+groups=> [
+'cn=ops,ou=groups,dc=wikimedia,dc=org',
+'cn=wmf,ou=groups,dc=wikimedia,dc=org',
+],
+}
+
 apache::site { 'transparency.wikimedia.org':
 content => template('apache/sites/transparency.wikimedia.org.erb'),
 }
diff --git a/templates/apache/sites/transparency.wikimedia.org.erb 
b/templates/apache/sites/transparency.wikimedia.org.erb
index b733ee2..3978d1b 100644
--- a/templates/apache/sites/transparency.wikimedia.org.erb
+++ b/templates/apache/sites/transparency.wikimedia.org.erb
@@ -4,8 +4,21 @@
 
 ServerName transparency.wikimedia.org
 DocumentRoot <%= @docroot %>
+Alias /private <%= @docroot_private %>
 
 >
 Require all granted
 
+
+>
+  AuthName "<%= @auth_ldap['name'] %>"
+  AuthType Basic
+  AuthBasicProvider ldap
+  AuthLDAPBindDN <%= @auth_ldap['bind_dn'] %>
+  AuthLDAPBindPassword <%= @auth_ldap['bind_password'] %>
+  AuthLDAPURL "<%= @auth_ldap['url'] %>"
+  <% @auth_ldap['groups'].each do |group| -%>
+  Require ldap-group <%= group %>
+  <% end -%>
+
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If35ba69c2c295c29b24b81f023e8954ae29e4e89
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Better cache headers for 'Powered by MediaWiki' badge - change (operations/mediawiki-config)

2016-06-19 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Better cache headers for 'Powered by MediaWiki' badge
..

Better cache headers for 'Powered by MediaWiki' badge

Serve poweredby_mediawiki_*.png badge from /static/images instead of
$wgResourceBasePath/assets. This will make us go from:

  cache-control: public, s-maxage=300, must-revalidate, max-age=86400

To:

  cache-control: max-age=31536000

So: cached for one year instead of one day, and no 304 if cache hit.
Pretty nice, considering this is served on every page.

Change-Id: Id5804a80c7dbb46571dd11263dec326679da1d83
---
A static/images/poweredby_mediawiki_132x47.png
A static/images/poweredby_mediawiki_176x62.png
A static/images/poweredby_mediawiki_88x31.png
M wmf-config/CommonSettings.php
4 files changed, 8 insertions(+), 1 deletion(-)


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

diff --git a/static/images/poweredby_mediawiki_132x47.png 
b/static/images/poweredby_mediawiki_132x47.png
new file mode 100644
index 000..9f48612
--- /dev/null
+++ b/static/images/poweredby_mediawiki_132x47.png
Binary files differ
diff --git a/static/images/poweredby_mediawiki_176x62.png 
b/static/images/poweredby_mediawiki_176x62.png
new file mode 100644
index 000..a5a1612
--- /dev/null
+++ b/static/images/poweredby_mediawiki_176x62.png
Binary files differ
diff --git a/static/images/poweredby_mediawiki_88x31.png 
b/static/images/poweredby_mediawiki_88x31.png
new file mode 100644
index 000..07c0573
--- /dev/null
+++ b/static/images/poweredby_mediawiki_88x31.png
Binary files differ
diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index ba0b8b1..77f6b6c 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -2338,7 +2338,14 @@
include( "$IP/extensions/SubPageList3/SubPageList3.php" );
 }
 
-$wgFooterIcons["poweredby"]["mediawiki"]["url"] = "//www.mediawiki.org/";
+// Serve 'Powered by MediaWiki' badge from /static/images instead of
+// $wgResourceBasePath so we can set far-future expires.
+$wgFooterIcons['poweredby']['mediawiki']['src'] =
+   '/static/images/poweredby_mediawiki_88x31.png';
+$wgFooterIcons['poweredby']['mediawiki']['srcset'] =
+   '/static/images/poweredby_mediawiki_132x47.png 1.5x, ' .
+   '/static/images/poweredby_mediawiki_176x62.png 2x';
+
 if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) {
$wgCookieSecure = true;
$_SERVER['HTTPS'] = 'on'; // Fake this so MW goes into HTTPS mode

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5804a80c7dbb46571dd11263dec326679da1d83
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] mediawiki.js: remove type-checks - change (mediawiki/core)

2016-06-18 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: mediawiki.js: remove type-checks
..

mediawiki.js: remove type-checks

I searched Google and could not find any indication that anyone has encountered
these error messages in the wild since their introduction, half a decade go.
In my opinion they hurt readability substantially by displacing the main body
of the function away from its declaration.

Change-Id: Ifd33974b0c63f3d7ea44f1b0728de4b8b8dde099
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 0 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/08/295108/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 30b5f76..51f0849 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -1744,10 +1744,6 @@
}
return;
}
-   // Validate input
-   if ( typeof module !== 'string' ) {
-   throw new Error( 'module must 
be a string, not a ' + typeof module );
-   }
if ( hasOwn.call( registry, module ) ) {
throw new Error( 'module 
already registered: ' + module );
}
@@ -1801,22 +1797,6 @@
 * @param {Object} [templates] List of 
key/value pairs to be added to mw#templates.
 */
implement: function ( module, script, style, 
messages, templates ) {
-   // Validate input
-   if ( typeof module !== 'string' ) {
-   throw new Error( 'module must 
be of type string, not ' + typeof module );
-   }
-   if ( script && !$.isFunction( script ) 
&& !$.isArray( script ) && typeof script !== 'string' ) {
-   throw new Error( 'script must 
be of type function, array, or script; not ' + typeof script );
-   }
-   if ( style && !$.isPlainObject( style ) 
) {
-   throw new Error( 'style must be 
of type object, not ' + typeof style );
-   }
-   if ( messages && !$.isPlainObject( 
messages ) ) {
-   throw new Error( 'messages must 
be of type object, not a ' + typeof messages );
-   }
-   if ( templates && !$.isPlainObject( 
templates ) ) {
-   throw new Error( 'templates 
must be of type object, not a ' + typeof templates );
-   }
// Automatically register module
if ( !hasOwn.call( registry, module ) ) 
{
mw.loader.register( module );
@@ -1861,9 +1841,6 @@
// Allow calling with a single 
dependency as a string
if ( typeof dependencies === 'string' ) 
{
dependencies = [ dependencies ];
-   } else if ( !$.isArray( dependencies ) 
) {
-   // Invalid input
-   throw new Error( 'Dependencies 
must be a string or an array' );
}
 
if ( ready ) {
@@ -1904,10 +1881,6 @@
load: function ( modules, type ) {
var filtered, l;
 
-   // Validate input
-   if ( typeof modules !== 'object' && 
typeof modules !== 'string' ) {
-   throw new Error( 'modules must 
be a string or an array, not a ' + typeof modules );
-   }
// Allow calling with a url or single 
dependency as a string
if ( typeof modules === 'string' ) {
// "https://example.org/x.js;, 
"http://example.org/x.js;, 

[MediaWiki-commits] [Gerrit] Simplify dynamic CSS loading by removing IE8-specific hacks - change (mediawiki/core)

2016-06-18 Thread Ori.livneh (Code Review)
Hello Krinkle,

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

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

to review the following change.

Change subject: Simplify dynamic CSS loading by removing IE8-specific hacks
..

Simplify dynamic CSS loading by removing IE8-specific hacks

* Remove 'isIEto9'. Since we blacklist anything before 9, isIE9 is enough.
* Set the content of style tags and the href attribute of link tags before
  inserting them into the DOM. Previously, we did DOM insertion first, due
  to T35305. I verified that IE9 is not affected.
* Use document.head instead of document.getElementsByTagName( 'head' )[ 0 ].
* Set / extend the contents of link tags via
  node.appendChild( document.createTextNode( ... ) ) this works in IE9, and
  adding CSS in this way does not strip @media queries in the way that
  repeat node.styleSheet.cssText += '...' operations will. This means the
  workarounds put in place to mitigate T108727 can be removed.
  quirksmode confirms that document.createTextNode() is supported in IE9,
  and mentions the issue with style tags as IE8-specific:
  http://quirksmode.org/dom/core/#t01

I created a test page with all the behaviors here:
https://people.wikimedia.org/~ori/If51f8303b/index.html

It loads correctly in IE9:
https://people.wikimedia.org/~ori/If51f8303b/screenshot.png

Change-Id: If51f8303b74fdc8001cfa20ea8b016fdc210b1b1
---
M resources/src/mediawiki/mediawiki.js
1 file changed, 11 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/295100/1

diff --git a/resources/src/mediawiki/mediawiki.js 
b/resources/src/mediawiki/mediawiki.js
index 1203b6a..5b0f367 100644
--- a/resources/src/mediawiki/mediawiki.js
+++ b/resources/src/mediawiki/mediawiki.js
@@ -803,7 +803,6 @@
cssBuffer = '',
cssBufferTimer = null,
cssCallbacks = $.Callbacks(),
-   isIEto9 = 'documentMode' in document && 
document.documentMode <= 9,
isIE9 = document.documentMode === 9;
 
function getMarker() {
@@ -829,21 +828,14 @@
 */
function newStyleTag( text, nextNode ) {
var s = document.createElement( 'style' );
-   // Support: IE
-   // Must attach style element to the document 
before setting cssText (T35305)
+
+   s.appendChild( document.createTextNode( text ) 
);
if ( nextNode && nextNode.parentNode ) {
nextNode.parentNode.insertBefore( s, 
nextNode );
} else {
-   document.getElementsByTagName( 'head' 
)[ 0 ].appendChild( s );
+   document.head.appendChild( s );
}
-   if ( s.styleSheet ) {
-   // Support: IE6-10
-   // Old IE ignores appended text nodes, 
access stylesheet directly.
-   s.styleSheet.cssText = text;
-   } else {
-   // Standard behaviour
-   s.appendChild( document.createTextNode( 
text ) );
-   }
+
return s;
}
 
@@ -908,32 +900,13 @@
//
// Support: IE 6-9
// Try to re-use existing 

[MediaWiki-commits] [Gerrit] Make edit preview detection less expensive - change (mediawiki...Scribunto)

2016-06-15 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Make edit preview detection less expensive
..

Make edit preview detection less expensive

Checking if frame:preprocess("{{REVISIONID}}") == '' is a popular trick for
determining whether the current parse operation is for an edit preview, in
which case modules often want to add debug info to the HTML. It's not pretty
and we don't sanction it, but we can at least make it cheap.

Change-Id: I5aa3b29e5913e73cc09bbf7795c55786e67628fe
---
M engines/LuaCommon/LuaCommon.php
1 file changed, 9 insertions(+), 0 deletions(-)


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

diff --git a/engines/LuaCommon/LuaCommon.php b/engines/LuaCommon/LuaCommon.php
index dd1f996..066e6cc 100644
--- a/engines/LuaCommon/LuaCommon.php
+++ b/engines/LuaCommon/LuaCommon.php
@@ -769,6 +769,15 @@
throw new Scribunto_LuaError( 'attempt to call 
mw.preprocess with no frame' );
}
 
+   // Checking if frame:preprocess("{{REVISIONID}}") == '' is a 
popular
+   // trick for determining whether the current parse operation is 
for
+   // an edit preview, in which case modules often want to add 
debug
+   // info to the HTML. It's not pretty and we don't sanction it, 
but
+   // we can at least make it cheap.
+   if ( $text === '{{REVISIONID}}' ) {
+   return array( $this->getParser()->getRevisionId() );
+   }
+
// Don't count the time for expanding all the frame arguments 
against
// the Lua time limit.
$this->getInterpreter()->pauseUsageTimer();

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

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

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


[MediaWiki-commits] [Gerrit] Improve client-side edit stash change detection - change (mediawiki/core)

2016-06-14 Thread Ori.livneh (Code Review)
Ori.livneh has submitted this change and it was merged.

Change subject: Improve client-side edit stash change detection
..


Improve client-side edit stash change detection

The keypress event does not fire for backspace or delete in IE, Chrome, or
Safari, which means we are missing out on stash opportunities when the last
action is to delete some text. Fix that by listening for the keyup event
instead.

Also add an isChanged() check before calling pending.abort(), because there are
a lot of special keys that don't modify the text, and not all of them are coded
consistently on different platforms (think volume up/down, mute, function keys,
etc.), so we can't be exhaustive, and should instead fall back to actually
checking for changes. Otherwise we risk aborting stash requests when the user
has not changed the text.

Lastly, rename 'onTextChanged' to 'onEditorIdle', which is more accurate.
On undo / rollback, onTextChanged will return true the first time it is called,
even though the text had not changed in that case.

Useful sources:

* Key codes of keydown and keyup events:
  http://www.javascripter.net/faq/keycodes.htm
* Quirksmode: detecting keystrokes
  http://www.quirksmode.org/js/keys.html
* Why isn't backspace being detected using jquery keypress event?
  http://stackoverflow.com/q/4418562

Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
(cherry picked from commit eca800c7f02023030a8e97bfc611d222f0edcdb3)
(cherry picked from commit 3e48c0ff370819a560f90b00f72b45c62ca2adf0)
---
M resources/src/mediawiki.action/mediawiki.action.edit.stash.js
1 file changed, 9 insertions(+), 12 deletions(-)

Approvals:
  Ori.livneh: Verified; Looks good to me, approved



diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js 
b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
index d354fc2..3288e1a 100644
--- a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
+++ b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
@@ -45,7 +45,7 @@
return newText !== data.wpTextbox1;
}
 
-   function onTextChanged() {
+   function onEditorIdle() {
if ( !isChanged() ) {
return;
}
@@ -53,20 +53,17 @@
stashEdit();
}
 
-   function onTextKeyPress( e ) {
+   function onTextKeyUp( e ) {
// Ignore keystrokes that don't modify text, like 
cursor movements.
-   // See .
-   if ( e.which === 0 ) {
+   // See  
and
+   // . We don't 
have to be
+   // exhaustive, because the cost of misfiring is low.
+   if ( ( e.which >= 33 && e.which <= 40 ) || ( e.which >= 
16 && e.which <= 18 ) ) {
return;
}
 
clearTimeout( timer );
-
-   if ( pending ) {
-   pending.abort();
-   }
-
-   timer = setTimeout( onTextChanged, idleTimeout );
+   timer = setTimeout( onEditorIdle, idleTimeout );
}
 
function onFormLoaded() {
@@ -84,8 +81,8 @@
return;
}
 
-   $text.on( { change: onTextChanged, keypress: onTextKeyPress } );
-   $summary.on( { focus: onTextChanged } );
+   $text.on( { change: onEditorIdle, keyup: onTextKeyUp } );
+   $summary.on( { focus: onEditorIdle } );
onFormLoaded();
 
} );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.5
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Edokter 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Improve client-side edit stash change detection - change (mediawiki/core)

2016-06-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Improve client-side edit stash change detection
..

Improve client-side edit stash change detection

The keypress event does not fire for backspace or delete in IE, Chrome, or
Safari, which means we are missing out on stash opportunities when the last
action is to delete some text. Fix that by listening for the keyup event
instead.

Also add an isChanged() check before calling pending.abort(), because there are
a lot of special keys that don't modify the text, and not all of them are coded
consistently on different platforms (think volume up/down, mute, function keys,
etc.), so we can't be exhaustive, and should instead fall back to actually
checking for changes. Otherwise we risk aborting stash requests when the user
has not changed the text.

Lastly, rename 'onTextChanged' to 'onEditorIdle', which is more accurate.
On undo / rollback, onTextChanged will return true the first time it is called,
even though the text had not changed in that case.

Useful sources:

* Key codes of keydown and keyup events:
  http://www.javascripter.net/faq/keycodes.htm
* Quirksmode: detecting keystrokes
  http://www.quirksmode.org/js/keys.html
* Why isn't backspace being detected using jquery keypress event?
  http://stackoverflow.com/q/4418562

Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
(cherry picked from commit eca800c7f02023030a8e97bfc611d222f0edcdb3)
(cherry picked from commit 3e48c0ff370819a560f90b00f72b45c62ca2adf0)
---
M resources/src/mediawiki.action/mediawiki.action.edit.stash.js
1 file changed, 9 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/18/294418/1

diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js 
b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
index d354fc2..3288e1a 100644
--- a/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
+++ b/resources/src/mediawiki.action/mediawiki.action.edit.stash.js
@@ -45,7 +45,7 @@
return newText !== data.wpTextbox1;
}
 
-   function onTextChanged() {
+   function onEditorIdle() {
if ( !isChanged() ) {
return;
}
@@ -53,20 +53,17 @@
stashEdit();
}
 
-   function onTextKeyPress( e ) {
+   function onTextKeyUp( e ) {
// Ignore keystrokes that don't modify text, like 
cursor movements.
-   // See .
-   if ( e.which === 0 ) {
+   // See  
and
+   // . We don't 
have to be
+   // exhaustive, because the cost of misfiring is low.
+   if ( ( e.which >= 33 && e.which <= 40 ) || ( e.which >= 
16 && e.which <= 18 ) ) {
return;
}
 
clearTimeout( timer );
-
-   if ( pending ) {
-   pending.abort();
-   }
-
-   timer = setTimeout( onTextChanged, idleTimeout );
+   timer = setTimeout( onEditorIdle, idleTimeout );
}
 
function onFormLoaded() {
@@ -84,8 +81,8 @@
return;
}
 
-   $text.on( { change: onTextChanged, keypress: onTextKeyPress } );
-   $summary.on( { focus: onTextChanged } );
+   $text.on( { change: onEditorIdle, keyup: onTextKeyUp } );
+   $summary.on( { focus: onEditorIdle } );
onFormLoaded();
 
} );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idfad8407c8e905d8de80bc54379545f1b586fc88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.28.0-wmf.5
Gerrit-Owner: Ori.livneh 

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


[MediaWiki-commits] [Gerrit] Revert "Make sure AntiSpoof mappings are mapping in the corr... - change (mediawiki...AntiSpoof)

2016-06-14 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

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

Change subject: Revert "Make sure AntiSpoof mappings are mapping in the correct 
direction."
..

Revert "Make sure AntiSpoof mappings are mapping in the correct direction."

Breaks AbuseFilter normalization tests.

This reverts commit 5435e6313181cc8ef6f0bd4fd6d8061bb00aa494.

Change-Id: I2e407a3ac8b74e77bf88b1e34c1519f4dea63b80
---
M equivset.php
M equivset.ser
M maintenance/equivset.in
M maintenance/equivset.txt
M maintenance/generateEquivset.php
5 files changed, 94 insertions(+), 130 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AntiSpoof 
refs/changes/02/294402/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e407a3ac8b74e77bf88b1e34c1519f4dea63b80
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AntiSpoof
Gerrit-Branch: wmf/1.28.0-wmf.6
Gerrit-Owner: Ori.livneh 
Gerrit-Reviewer: Aaron Schulz 

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


  1   2   3   4   5   6   7   8   9   10   >