[MediaWiki-commits] [Gerrit] Fix JS error in MT tool: MTControlCard.providers undefined - change (mediawiki...ContentTranslation)

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

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

Change subject: Fix JS error in MT tool: MTControlCard.providers undefined
..

Fix JS error in MT tool: MTControlCard.providers undefined

This issue happens when cxserver/v1/list/mt/source/target returns
{} as a result (no pairs available).

The MT card won't be shown in such cases becaus of JS error.

Bug: T130357
Change-Id: I088cd299758651e3972a25e8feaaa61dadd18713
(cherry picked from commit 62332fef167ed492dee58f3f60109f4a4f376570)
---
M modules/tools/ext.cx.tools.mt.js
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/43/278843/1

diff --git a/modules/tools/ext.cx.tools.mt.js b/modules/tools/ext.cx.tools.mt.js
index 098a52c..bca4ef6 100644
--- a/modules/tools/ext.cx.tools.mt.js
+++ b/modules/tools/ext.cx.tools.mt.js
@@ -433,7 +433,8 @@
};
 
MTControlCard.prototype.buildProvidersMenu = function () {
-   var provider, items, nonDefaultMT, newProvider = false;
+   var provider, items = [],
+   nonDefaultMT, newProvider = false;
 
if ( MTControlCard.providers && MTControlCard.providers.length 
> 1 ) {
nonDefaultMT = true;
@@ -450,7 +451,9 @@
.addClass( 'card__providers-menu' )
.hide();
 
-   items = MTControlCard.providers.slice( 0 ); // Copy values.
+   if ( MTControlCard.providers ) {
+   items = MTControlCard.providers.slice( 0 ); // Copy 
values.
+   }
if ( items.indexOf( sourceMT ) < 0 ) {
items.push( sourceMT );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I088cd299758651e3972a25e8feaaa61dadd18713
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: wmf/1.27.0-wmf.17
Gerrit-Owner: KartikMistry 
Gerrit-Reviewer: Santhosh 

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


[MediaWiki-commits] [Gerrit] Translation list: Replace the elipses text with icon - change (mediawiki...ContentTranslation)

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

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

Change subject: Translation list: Replace the elipses text with icon
..

Translation list: Replace the elipses text with icon

Change-Id: Id209db00dc9bdaed24a0da51af1592741d160d89
---
M modules/dashboard/ext.cx.translationlist.js
A modules/dashboard/images/elipses.png
A modules/dashboard/images/elipses.svg
M modules/dashboard/styles/ext.cx.translationlist.less
4 files changed, 10 insertions(+), 6 deletions(-)


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

diff --git a/modules/dashboard/ext.cx.translationlist.js 
b/modules/dashboard/ext.cx.translationlist.js
index 9977372..3267c7a 100644
--- a/modules/dashboard/ext.cx.translationlist.js
+++ b/modules/dashboard/ext.cx.translationlist.js
@@ -318,8 +318,7 @@
// If the translation is draft, allow deleting it
if ( translation.status === 'draft' ) {
$actionsTrigger = $( '' )
-   .addClass( 
'cx-tlitem__actions__trigger' )
-   .text( '…' );
+   .addClass( 
'cx-tlitem__actions__trigger' );
$deleteTranslation = $( '' )
.addClass( 'cx-discard-translation' )
.text( mw.msg( 'cx-discard-translation' 
) );
diff --git a/modules/dashboard/images/elipses.png 
b/modules/dashboard/images/elipses.png
new file mode 100644
index 000..40d5f98
--- /dev/null
+++ b/modules/dashboard/images/elipses.png
Binary files differ
diff --git a/modules/dashboard/images/elipses.svg 
b/modules/dashboard/images/elipses.svg
new file mode 100644
index 000..98cc53d
--- /dev/null
+++ b/modules/dashboard/images/elipses.svg
@@ -0,0 +1 @@
+http://www.w3.org/2000/svg; viewBox="0 0 24 24">
diff --git a/modules/dashboard/styles/ext.cx.translationlist.less 
b/modules/dashboard/styles/ext.cx.translationlist.less
index 1af370a..fa37514 100644
--- a/modules/dashboard/styles/ext.cx.translationlist.less
+++ b/modules/dashboard/styles/ext.cx.translationlist.less
@@ -17,11 +17,15 @@
z-index: 100;
 
.cx-tlitem__actions__trigger {
-   font-size: larger;
-   font-weight: 800;
-   color: #565656;
cursor: pointer;
-   padding: 0 5px;
+   padding:10px;
+   .background-image-svg('../images/elipses.svg', 
'../images/elipses.png');
+   background-repeat: no-repeat;
+   background-position: center left;
+   background-size: 24px;
+   &:hover {
+   background-color: #eee;
+   }
}
 
ul {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id209db00dc9bdaed24a0da51af1592741d160d89
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh 

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


[MediaWiki-commits] [Gerrit] Flake8 on openstack, part I - change (operations/puppet)

2016-03-21 Thread Andrew Bogott (Code Review)
Andrew Bogott has submitted this change and it was merged.

Change subject: Flake8 on openstack, part I
..


Flake8 on openstack, part I

Change-Id: I20e7184b0cc531088a2d1efb0f8ba97f19a75a0b
---
M modules/openstack/files/kilo/virtscripts/logstat.py
1 file changed, 200 insertions(+), 198 deletions(-)

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



diff --git a/modules/openstack/files/kilo/virtscripts/logstat.py 
b/modules/openstack/files/kilo/virtscripts/logstat.py
index 4337c67..ba60830 100644
--- a/modules/openstack/files/kilo/virtscripts/logstat.py
+++ b/modules/openstack/files/kilo/virtscripts/logstat.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 #
-### THIS FILE IS MANAGED BY PUPPET
-### puppet:///modules/openstack/kilo/virtscripts/logstat.py
+# THIS FILE IS MANAGED BY PUPPET
+# puppet:///modules/openstack/kilo/virtscripts/logstat.py
 #
 # encoding: utf-8
 """
@@ -39,224 +39,226 @@
 import sys
 import getopt
 import re
-import string
 
 help_message = '''
 Usage: logstat.py [options] file [file ...]
 options:
-\t -a SLA : specifies the SLA in milliseconds
-\t -s operation(s) : specifies which operations to compute stat for. 
-\t -o output : specifies the output file, otherwise stdout is used
-\t -r : include replicated operations
-\t -v : verbose mode
+-a SLA : specifies the SLA in milliseconds
+-s operation(s) : specifies which operations to compute stat for.
+-o output : specifies the output file, otherwise stdout is used
+-r : include replicated operations
+-v : verbose mode
 
 '''
 
+
 class OpStat():
-   def __init__(self, type, sla):
-   self.type = type
-   self.count = long(0)
-   self.etime = long(0)
-   self.maxEtime = long(0)
-   self.SLA = sla
-   self.countOverSLA = long(0)
-   self.countOver10SLA = long(0)
-   self.retEntries = long(0)
-   self.count0Entries = long(0)
-   self.count1Entry = long(0)
-   self.maxEntries = long(0)
 
-   def incEtime(self, etime):
-   self.etime += etime
-   self.count += 1
-   if self.maxEtime < etime:
-   self.maxEtime = etime
-   if etime > self.SLA:
-   self.countOverSLA += 1
-   if etime > self.SLA * 10:
-   self.countOver10SLA += 1
+def __init__(self, type, sla):
+self.type = type
+self.count = long(0)
+self.etime = long(0)
+self.maxEtime = long(0)
+self.SLA = sla
+self.countOverSLA = long(0)
+self.countOver10SLA = long(0)
+self.retEntries = long(0)
+self.count0Entries = long(0)
+self.count1Entry = long(0)
+self.maxEntries = long(0)
 
-   def incEntries(self, count):
-   self.retEntries += count
-   if self.maxEntries < count:
-   self.maxEntries = count
-   if count == 0:
-   self.count0Entries += 1
-   if count == 1:
-   self.count1Entry += 1
-   
-   def printStats(self, outfile):
-   if self.count != 0:
-   outfile.write(self.type + ":\t" + str(self.count) + 
"\tAvg: " +
-str(round(float(self.etime) / float(self.count), 3)) +
- " ms\tMax: " + str(self.maxEtime) + " ms\t>" + 
str(self.SLA) +"ms: " +
-  str(self.countOverSLA) + " (" + 
str(self.countOverSLA * 100 / self.count) + "%)\t>" +
-  str(self.SLA * 10) + "ms: " +
-  str(self.countOver10SLA) + " (" + 
str(self.countOver10SLA * 100 / self.count) + "%)\n")
-   if self.retEntries != 0:
-   outfile.write(self.type + ":\tReturned " + 
str(round(float(self.retEntries) / float(self.count), 1)) +
-" entries in average, max: " + str(self.maxEntries) + 
", none: "+ str(self.count0Entries) +
-", single: "+ str(self.count1Entry) +"\n")
+def incEtime(self, etime):
+self.etime += etime
+self.count += 1
+if self.maxEtime < etime:
+self.maxEtime = etime
+if etime > self.SLA:
+self.countOverSLA += 1
+if etime > self.SLA * 10:
+self.countOver10SLA += 1
+
+def incEntries(self, count):
+self.retEntries += count
+if self.maxEntries < count:
+self.maxEntries = count
+if count == 0:
+self.count0Entries += 1
+if count == 1:
+self.count1Entry += 1
+
+def printStats(self, outfile):
+if self.count != 

[MediaWiki-commits] [Gerrit] Flake8 for HHVM - change (operations/puppet)

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

Change subject: Flake8 for HHVM
..


Flake8 for HHVM

Change-Id: I8d2c8b93e15fc2c9065766eb9b15b145fefd5c95
---
M modules/hhvm/files/debug/printers.py
M modules/hhvm/files/monitoring/hhvm_apc.py
2 files changed, 0 insertions(+), 6 deletions(-)

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



diff --git a/modules/hhvm/files/debug/printers.py 
b/modules/hhvm/files/debug/printers.py
index 9f9f6fb..c1723d1 100644
--- a/modules/hhvm/files/debug/printers.py
+++ b/modules/hhvm/files/debug/printers.py
@@ -1041,11 +1041,6 @@
 
 libstdcxx_printer = Printer("libstdc++-v6")
 
-# For _GLIBCXX_BEGIN_NAMESPACE_VERSION.
-vers = '(__7::)?'
-# For _GLIBCXX_BEGIN_NAMESPACE_CONTAINER.
-container = '(__cxx1998::' + vers + ')?'
-
 # libstdc++ objects requiring pretty-printing.
 # In order from:
 # http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01847.html
diff --git a/modules/hhvm/files/monitoring/hhvm_apc.py 
b/modules/hhvm/files/monitoring/hhvm_apc.py
index d75bd7a..1e18664 100644
--- a/modules/hhvm/files/monitoring/hhvm_apc.py
+++ b/modules/hhvm/files/monitoring/hhvm_apc.py
@@ -6,7 +6,6 @@
   Diamond collector for HHVM APC stats.
 
 """
-import json
 import re
 import urllib2
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8d2c8b93e15fc2c9065766eb9b15b145fefd5c95
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ladsgroup 
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] Re-introduce "Templatize Special:Contributions lines" - change (mediawiki/core)

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

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

Change subject: Re-introduce "Templatize Special:Contributions lines"
..

Re-introduce "Templatize Special:Contributions lines"

The original change was 1bce6db10e99840cfbd10fa074c93d8d96d88412
It got reverted in I8f63e002e34a9d13e2597a27e3dd918a687d1e7c
Fixed issues raised

Change-Id: I047038d6164bd6e32909d25bb37002b43bfd3a92
---
M includes/specials/SpecialContributions.php
A includes/templates/SpecialContributionsLine.mustache
2 files changed, 41 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/41/278841/1

diff --git a/includes/specials/SpecialContributions.php 
b/includes/specials/SpecialContributions.php
index 7b8aa4c..decdad0 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -1101,16 +1101,13 @@
$userlink = '';
}
 
+   $flags = [];
if ( $rev->getParentId() === 0 ) {
-   $nflag = ChangesList::flag( 'newpage' );
-   } else {
-   $nflag = '';
+   $flags[] = ChangesList::flag( 'newpage' );
}
 
if ( $rev->isMinor() ) {
-   $mflag = ChangesList::flag( 'minor' );
-   } else {
-   $mflag = '';
+   $flags[] = ChangesList::flag( 'minor' );
}
 
$del = Linker::getRevDeleteLink( $user, $rev, $page );
@@ -1121,15 +1118,6 @@
$diffHistLinks = $this->msg( 'parentheses' )
->rawParams( $difftext . 
$this->messages['pipe-separator'] . $histlink )
->escaped();
-   $ret = "{$del}{$d} 
{$diffHistLinks}{$chardiff}{$nflag}{$mflag} ";
-   $ret .= "{$link}{$userlink} {$comment} {$topmarktext}";
-
-   # Denote if username is redacted for this edit
-   if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
-   $ret .= " " .
-   $this->msg( 'rev-deleted-user-contribs' 
)->escaped() .
-   "";
-   }
 
# Tags, if any.
list( $tagSummary, $newClasses ) = 
ChangeTags::formatSummaryRow(
@@ -1138,20 +1126,47 @@
$this->getContext()
);
$classes = array_merge( $classes, $newClasses );
-   $ret .= " $tagSummary";
+
+   $templateParams = [
+   'del' => $del,
+   'timestamp' => $d,
+   'diffHistLinks' => $diffHistLinks,
+   'charDifference' => $chardiff,
+   'flags' => $flags,
+   'articleLink' => $link,
+   'userlink' => $userlink,
+   'logText' => $comment,
+   'topmarktext' => $topmarktext,
+   'tagSummary' => $tagSummary,
+   ];
+
+   # Denote if username is redacted for this edit
+   if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
+   $templateParams['rev-deleted-user-contribs'] =
+   $this->msg( 'rev-deleted-user-contribs' 
)->escaped();
+   }
+
+   $templateParser = new TemplateParser();
+   $ret = $templateParser->processTemplate(
+   'SpecialContributionsLine',
+   $templateParams
+   );
}
 
// Let extensions add data
Hooks::run( 'ContributionsLineEnding', [ $this, &$ret, $row, 
&$classes ] );
 
+   // TODO: Handle exceptions in the catch block above.  Do any 
extensions rely on
+   // receiving empty rows?
+
if ( $classes === [] && $ret === '' ) {
wfDebug( "Dropping Special:Contribution row that could 
not be formatted\n" );
-   $ret = "\n";
-   } else {
-   $ret = Html::rawElement( 'li', [ 'class' => $classes ], 
$ret ) . "\n";
+   return "\n";
}
 
-   return $ret;
+   // FIXME: The signature of the ContributionsLineEnding hook 
makes it
+   // very awkward to 

[MediaWiki-commits] [Gerrit] Simplified setting of template field for form field - change (mediawiki...SemanticForms)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Simplified setting of template field for form field
..


Simplified setting of template field for form field

Change-Id: I90b1c1d8d0ed74d02ca674e8394e26eddf8f1c47
---
M includes/SF_FormField.php
1 file changed, 22 insertions(+), 26 deletions(-)

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



diff --git a/includes/SF_FormField.php b/includes/SF_FormField.php
index aa06fe9..bda86b9 100644
--- a/includes/SF_FormField.php
+++ b/includes/SF_FormField.php
@@ -146,35 +146,31 @@
static function newFromFormFieldTag( $tag_components, 
$template_in_form, $form_is_disabled ) {
global $wgParser, $wgUser;
 
+   $f = new SFFormField();
+   $f->mFieldArgs = array();
+
$field_name = trim( $tag_components[1] );
+
// See if this field matches one of the fields defined for this
// template - if it does, use all available information about
// that field; if it doesn't, either include it in the form or
// not, depending on whether the template has a 'strict'
// setting in the form definition.
-   $the_field = null;
-   $all_fields = $template_in_form->getAllFields();
-   foreach ( $all_fields as $cur_field ) {
+   $template_fields = $template_in_form->getAllFields();
+   foreach ( $template_fields as $cur_field ) {
if ( $field_name == $cur_field->getFieldName() ) {
-   $the_field = $cur_field;
+   $f->template_field = $cur_field;
break;
}
}
-   if ( $the_field == null ) {
+   if ( $f->template_field == null ) {
if ( $template_in_form->strictParsing() ) {
-   $dummy_ff = new SFFormField();
-   $dummy_ff->template_field = new 
SFTemplateField();
-   $dummy_ff->mIsList = false;
-   return $dummy_ff;
+   $f->template_field = new SFTemplateField();
+   $f->mIsList = false;
+   return $f;
}
-   $the_field = SFTemplateField::create( $field_name, null 
);
+   $f->template_field = SFTemplateField::create( 
$field_name, null );
}
-
-   // Create an SFFormField object, containing this field as well
-   // as settings from the form definition file.
-   $f = new SFFormField();
-   $f->template_field = $the_field;
-   $f->mFieldArgs = array();
 
$semantic_property = null;
$cargo_table = $cargo_field = null;
@@ -412,16 +408,16 @@
}
}
 
-if ( $template_in_form->getTemplateName() == null || 
$template_in_form->getTemplateName() === '' ) {
-$f->mInputName = $field_name;
-} elseif ( $template_in_form->allowsMultiple() ) {
-// 'num' will get replaced by an actual index, either 
in PHP
-// or in Javascript, later on
-$f->mInputName = $template_in_form->getTemplateName() 
. '[num][' . $field_name . ']';
-$f->setFieldArg( 'origName', 
$template_in_form->getTemplateName() . '[' . $field_name . ']' );
-} else {
-$f->mInputName = $template_in_form->getTemplateName() 
. '[' . $field_name . ']';
-}
+   if ( $template_in_form->getTemplateName() == null || 
$template_in_form->getTemplateName() === '' ) {
+   $f->mInputName = $field_name;
+   } elseif ( $template_in_form->allowsMultiple() ) {
+   // 'num' will get replaced by an actual index, either 
in PHP
+   // or in Javascript, later on
+   $f->mInputName = $template_in_form->getTemplateName() . 
'[num][' . $field_name . ']';
+   $f->setFieldArg( 'origName', 
$template_in_form->getTemplateName() . '[' . $field_name . ']' );
+   } else {
+   $f->mInputName = $template_in_form->getTemplateName() . 
'[' . $field_name . ']';
+   }
 
return $f;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I90b1c1d8d0ed74d02ca674e8394e26eddf8f1c47
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: 

[MediaWiki-commits] [Gerrit] Simplified setting of template field for form field - change (mediawiki...SemanticForms)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: Simplified setting of template field for form field
..

Simplified setting of template field for form field

Change-Id: I90b1c1d8d0ed74d02ca674e8394e26eddf8f1c47
---
M includes/SF_FormField.php
1 file changed, 22 insertions(+), 26 deletions(-)


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

diff --git a/includes/SF_FormField.php b/includes/SF_FormField.php
index aa06fe9..bda86b9 100644
--- a/includes/SF_FormField.php
+++ b/includes/SF_FormField.php
@@ -146,35 +146,31 @@
static function newFromFormFieldTag( $tag_components, 
$template_in_form, $form_is_disabled ) {
global $wgParser, $wgUser;
 
+   $f = new SFFormField();
+   $f->mFieldArgs = array();
+
$field_name = trim( $tag_components[1] );
+
// See if this field matches one of the fields defined for this
// template - if it does, use all available information about
// that field; if it doesn't, either include it in the form or
// not, depending on whether the template has a 'strict'
// setting in the form definition.
-   $the_field = null;
-   $all_fields = $template_in_form->getAllFields();
-   foreach ( $all_fields as $cur_field ) {
+   $template_fields = $template_in_form->getAllFields();
+   foreach ( $template_fields as $cur_field ) {
if ( $field_name == $cur_field->getFieldName() ) {
-   $the_field = $cur_field;
+   $f->template_field = $cur_field;
break;
}
}
-   if ( $the_field == null ) {
+   if ( $f->template_field == null ) {
if ( $template_in_form->strictParsing() ) {
-   $dummy_ff = new SFFormField();
-   $dummy_ff->template_field = new 
SFTemplateField();
-   $dummy_ff->mIsList = false;
-   return $dummy_ff;
+   $f->template_field = new SFTemplateField();
+   $f->mIsList = false;
+   return $f;
}
-   $the_field = SFTemplateField::create( $field_name, null 
);
+   $f->template_field = SFTemplateField::create( 
$field_name, null );
}
-
-   // Create an SFFormField object, containing this field as well
-   // as settings from the form definition file.
-   $f = new SFFormField();
-   $f->template_field = $the_field;
-   $f->mFieldArgs = array();
 
$semantic_property = null;
$cargo_table = $cargo_field = null;
@@ -412,16 +408,16 @@
}
}
 
-if ( $template_in_form->getTemplateName() == null || 
$template_in_form->getTemplateName() === '' ) {
-$f->mInputName = $field_name;
-} elseif ( $template_in_form->allowsMultiple() ) {
-// 'num' will get replaced by an actual index, either 
in PHP
-// or in Javascript, later on
-$f->mInputName = $template_in_form->getTemplateName() 
. '[num][' . $field_name . ']';
-$f->setFieldArg( 'origName', 
$template_in_form->getTemplateName() . '[' . $field_name . ']' );
-} else {
-$f->mInputName = $template_in_form->getTemplateName() 
. '[' . $field_name . ']';
-}
+   if ( $template_in_form->getTemplateName() == null || 
$template_in_form->getTemplateName() === '' ) {
+   $f->mInputName = $field_name;
+   } elseif ( $template_in_form->allowsMultiple() ) {
+   // 'num' will get replaced by an actual index, either 
in PHP
+   // or in Javascript, later on
+   $f->mInputName = $template_in_form->getTemplateName() . 
'[num][' . $field_name . ']';
+   $f->setFieldArg( 'origName', 
$template_in_form->getTemplateName() . '[' . $field_name . ']' );
+   } else {
+   $f->mInputName = $template_in_form->getTemplateName() . 
'[' . $field_name . ']';
+   }
 
return $f;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90b1c1d8d0ed74d02ca674e8394e26eddf8f1c47
Gerrit-PatchSet: 1
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] Evaluate globe in coordinates - change (wikidata...gui)

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

Change subject: Evaluate globe in coordinates
..


Evaluate globe in coordinates

When a point comes with a globe. Globe needs to be earth.
Also optimize click handler for result browser.

Bug: T130428
Change-Id: Ic927a138bff130c9044cf02e897f81c1f032a2d6
---
M wikibase/queryService/ui/App.js
M wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
2 files changed, 30 insertions(+), 8 deletions(-)

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



diff --git a/wikibase/queryService/ui/App.js b/wikibase/queryService/ui/App.js
index 18d2bfc..8313678 100644
--- a/wikibase/queryService/ui/App.js
+++ b/wikibase/queryService/ui/App.js
@@ -462,6 +462,8 @@
var self = this;
 
$.each( this._resultBrowsers, function( key, b ){
+   b.$element.off( 'click' );
+
if( b.object.isDrawable() ){
b.$element.css( 'opacity', 1 ).attr( 'href', 
'#' );
b.$element.click( function(){
@@ -476,7 +478,6 @@
return false;
} );
} else {
-   b.$element.off( 'click' );
b.$element.css( 'opacity', 0.5 ).removeAttr( 
'href' );
}
} );
diff --git a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js 
b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
index 9df5271..f7acf97 100644
--- a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
+++ b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
@@ -7,6 +7,7 @@
"use strict";
 
var MAP_DATATYPE = 'http://www.opengis.net/ont/geosparql#wktLiteral';
+   var GLOBE_EARTH = 'Q2';
 
 var TILE_LAYER = {
wikimedia: {
@@ -88,9 +89,7 @@
if( field.datatype === MAP_DATATYPE ){
var longLat = self._extractLongLat( field.value 
);
 
-   // FIXME: if the coordinates are for 
another globe (e.g. Mars),
-   // then the array order is different 
and longLat[0] is NaN.
-   if( !longLat[0] || !longLat[1] || 
isNaN( longLat[0] ) ){
+   if( longLat === null || !longLat[0] || 
!longLat[1]  ){
return true;
}
 
@@ -119,11 +118,30 @@
 * @private
 */
SELF.prototype._extractLongLat = function( point ) {
-   point = point.replace('Point(', '' );
-   point = point.replace( ')', '' );
+
+   var globe = this._extractGlobe( point );
+   if ( globe !== null && globe !== GLOBE_EARTH ){
+   return null;
+   }
+
+   point = point.match(/Point\((.*)\)/).pop();
 
return point.split( ' ' );
};
+
+   /**
+* @private
+*/
+   SELF.prototype._extractGlobe = function( point ) {
+   var globe = null;
+
+   if ( ( globe = 
point.match(//i) ) ){
+   globe = globe.pop();
+   }
+
+   return globe;
+   };
+
 
/**
 * @private
@@ -185,8 +203,11 @@
 */
SELF.prototype._checkCoordinate = function ( value ) {
if( value && value.datatype === MAP_DATATYPE ) {
-   this._drawable = true;
-   return false;
+   var globe = this._extractGlobe( value.value );
+   if ( globe === null || globe === GLOBE_EARTH ){
+   this._drawable = true;
+   return false;
+   }
}
return true;
};

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic927a138bff130c9044cf02e897f81c1f032a2d6
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Improve SPARQL hint - change (wikidata...gui)

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

Change subject: Improve SPARQL hint
..


Improve SPARQL hint

More SPARQL keywords. More places to complete. Auto complete #.

Change-Id: Ib961117f1f3c530b5f445495850cea0295e948dd
---
M wikibase/queryService/ui/editor/Editor.js
M wikibase/queryService/ui/editor/hint/Sparql.js
2 files changed, 25 insertions(+), 5 deletions(-)

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



diff --git a/wikibase/queryService/ui/editor/Editor.js 
b/wikibase/queryService/ui/editor/Editor.js
index fc9d731..44e1bbb 100644
--- a/wikibase/queryService/ui/editor/Editor.js
+++ b/wikibase/queryService/ui/editor/Editor.js
@@ -63,7 +63,8 @@
this._editor.on( 'change', function ( editor, changeObj ) {
self.storeValue( self.getValue() );
self.clearError();
-   if( changeObj.text[0] === '?' ){
+   if( changeObj.text[0] === '?' ||
+   changeObj.text[0] === '#' ){
editor.showHint({closeCharacters: /[\s]/});
}
} );
diff --git a/wikibase/queryService/ui/editor/hint/Sparql.js 
b/wikibase/queryService/ui/editor/hint/Sparql.js
index d1776dd..af56a4a 100755
--- a/wikibase/queryService/ui/editor/hint/Sparql.js
+++ b/wikibase/queryService/ui/editor/hint/Sparql.js
@@ -12,15 +12,34 @@
var SPARQL_KEYWORDS = [
   'SELECT',
   'OPTIONAL',
+  'OPTIONAL {\n\n}',
   'WHERE',
+  'WHERE {\n\n}',
   'ORDER',
   'ORDER BY',
   'DISTINCT',
-  'WHERE {\n\n}',
   'SERVICE',
   'SERVICE wikibase:label {\n bd:serviceParam 
wikibase:language "en" .\n}',
   'BASE', 'PREFIX', 'REDUCED', 'FROM', 'LIMIT', 
'OFFSET', 'HAVING',
   'UNION',
+  'SAMPLE',
+  '(SAMPLE() AS )',
+  'COUNT',
+  '(COUNT() AS )',
+  'DESC',
+  'DESC()',
+  'ASC',
+  'ASC()',
+  'FILTER ()',
+  'FILTER NOT EXISTS',
+  'FILTER NOT EXISTS {\n\n}',
+  'UNION',
+  'UNION {\n\n}',
+  'BIND',
+  'BIND ()',
+  'GROUP_CONCAT',
+  '(GROUP_CONCAT() as )',
+  'ORDER BY',
   '#defaultView:Map', '#defaultView:ImageGrid'
   ];
 
@@ -67,7 +86,7 @@
var list = [];
 
$.each( SPARQL_KEYWORDS, function ( key, keyword ) {
-   if ( keyword.toLowerCase().indexOf( term.toLowerCase() 
) === 0 ) {
+   if ( keyword.toLowerCase().indexOf( term.toLowerCase() 
) >= 0 ) {
list.push( keyword );
}
} );
@@ -119,7 +138,7 @@
pos = 0;
}
 
-   while( line.charAt( pos ) !== ' ' ){
+   while( line.charAt( pos ).match(/[\w?#]/) ){
pos--;
if( pos < 0 ){
break;
@@ -128,7 +147,7 @@
var left = pos + 1;
 
pos = position;
-   while( line.charAt( pos ) !== ' ' ){
+   while( line.charAt( pos ).match(/[\w]/) ){
pos++;
if( pos >= line.length ){
break;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib961117f1f3c530b5f445495850cea0295e948dd
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use https when including thumbs from commons - change (wikidata...gui)

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

Change subject: Use https when including thumbs from commons
..


Use https when including thumbs from commons

Also avoid string concat for creating html with jQuery.

The removed  after  was there by error and
got ignored by jQuery anyway.

Also fixed max-height css.

Change-Id: Id079acce663fec20604d865ce67caa89d2d58dc6
---
M style.css
M wikibase/queryService/ui/resultBrowser/ImageResultBrowser.js
M wikibase/queryService/ui/resultBrowser/helper/FormatterHelper.js
3 files changed, 15 insertions(+), 24 deletions(-)

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



diff --git a/style.css b/style.css
index 5409f06..a9fce4c 100644
--- a/style.css
+++ b/style.css
@@ -272,7 +272,6 @@
 }
 .item > a > img {
width: 100%;
-   max-height: 500px;
display: inline-block;;
 }
 .item {
diff --git a/wikibase/queryService/ui/resultBrowser/ImageResultBrowser.js 
b/wikibase/queryService/ui/resultBrowser/ImageResultBrowser.js
index 6d17020..f3ab46f 100644
--- a/wikibase/queryService/ui/resultBrowser/ImageResultBrowser.js
+++ b/wikibase/queryService/ui/resultBrowser/ImageResultBrowser.js
@@ -6,9 +6,6 @@
 wikibase.queryService.ui.resultBrowser.ImageResultBrowser = ( function( $ ) {
"use strict";
 
-   var COMMONS_FILE_PATH = 
"http://commons.wikimedia.org/wiki/Special:FilePath/;;
-   var COMMONS_SPECIAL_RESIZE = 
"http://commons.wikimedia.org/wiki/Special:FilePath/;;
-
/**
 * A result browser for images
 *
@@ -44,8 +41,7 @@
self.processVisitors( field );
if( self._isCommonsResource( field.value ) ){
var url = field.value,
-   regEx = new RegExp( 
COMMONS_FILE_PATH, "ig" ),
-   fileName = decodeURIComponent( 
url.replace( regEx, '' ) );
+   fileName = 
self._getFormatter().getCommonsResourceFileName( url );
 
self._grid.append( self._getItem( 
self._getThumbnail( url ),
self._getThumbnail( 
url, 1000 ),
@@ -62,10 +58,14 @@
 * @private
 **/
SELF.prototype._getItem = function( thumbnailUrl, url, title, row ) {
-   var $image = $( '' )
+   var $image = $( '' )
.click( this._getFormatter().handleCommonResourceItem )
.attr( 'data-title',  title )
-   .append( $( '' ) ),
+   .attr( 'href', url )
+   .append(
+   $( '' )
+   .attr( 'src', thumbnailUrl )
+   ),
$summary = this._getFormatter().formatRow( row );
 
return $( '' ).append( $image, $summary );
@@ -75,26 +75,14 @@
 * @private
 **/
SELF.prototype._isCommonsResource = function( url ) {
-   return url.toLowerCase().startsWith( 
COMMONS_FILE_PATH.toLowerCase() );
-
+   return this._getFormatter().isCommonsResource( url );
};
 
/**
 * @private
 **/
SELF.prototype._getThumbnail = function( url, width ) {
-   if( !this._isCommonsResource(url) ){
-   return url;
-   }
-   if( !width ){
-   width = 400;
-   }
-
-   var regEx = new RegExp( COMMONS_FILE_PATH, "ig" ),
-   fileName = url.replace( regEx, '' ),
-   thumbnail = COMMONS_SPECIAL_RESIZE + fileName + '?width=' + 
width;
-
-   return thumbnail;
+   return 
this._getFormatter().getCommonsResourceFileNameThumbnail( url, width );
};
 
/**
@@ -111,7 +99,7 @@
 * Check if this value contains an image.
 */
SELF.prototype._checkImage = function ( data ) {
-   if( data && data.value && data.value.startsWith( 
COMMONS_FILE_PATH ) ){
+   if( data && data.value && this._isCommonsResource( data.value ) 
){
this._drawable = true;
return false;
}
diff --git a/wikibase/queryService/ui/resultBrowser/helper/FormatterHelper.js 
b/wikibase/queryService/ui/resultBrowser/helper/FormatterHelper.js
index 45ab17c..32aaeeb 100644
--- a/wikibase/queryService/ui/resultBrowser/helper/FormatterHelper.js
+++ b/wikibase/queryService/ui/resultBrowser/helper/FormatterHelper.js
@@ -117,7 +117,7 @@
SELF.prototype.getCommonsResourceFileName = function ( url ) {
var regExp = new RegExp( COMMONS_FILE_PATH, 'ig' );
 

[MediaWiki-commits] [Gerrit] Trimming leading and trailing spaces in Special:NewItem - change (mediawiki...Wikibase)

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

Change subject: Trimming leading and trailing spaces in Special:NewItem
..


Trimming leading and trailing spaces in Special:NewItem

* hasSufficientArguments() was not trimming 'label' and 'description'
  but now the whitespaces trimming function was called in prepareArguments()
  which trimmed all the arguments from the web request. Trimming now is
  working for label, description and aliases.

* Also, the hasSufficientArguments() has been revised and trimming functions
  removed and transfered to prepareArguments() since it didn't work for label
  and description.

Bug: T130459
Change-Id: I7ff02dbe520dc3328eba7c872eb69e181c3f70da
---
M repo/includes/Specials/SpecialNewEntity.php
1 file changed, 16 insertions(+), 9 deletions(-)

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



diff --git a/repo/includes/Specials/SpecialNewEntity.php 
b/repo/includes/Specials/SpecialNewEntity.php
index bd7a42b..83654d7 100644
--- a/repo/includes/Specials/SpecialNewEntity.php
+++ b/repo/includes/Specials/SpecialNewEntity.php
@@ -164,19 +164,30 @@
/**
 * Tries to extract argument values from web request or of the page's 
sub-page parts
 *
+* Trimming argument values from web request.
+*
 * @since 0.1
 */
protected function prepareArguments() {
-   $this->label = $this->getRequest()->getVal(
+   $label = $this->getRequest()->getVal(
'label',
isset( $this->parts[0] ) ? $this->parts[0] : ''
);
-   $this->description = $this->getRequest()->getVal(
+   $this->label = $this->stringNormalizer->trimToNFC( $label );
+
+   $description = $this->getRequest()->getVal(
'description',
isset( $this->parts[1] ) ? $this->parts[1] : ''
);
+   $this->description = $this->stringNormalizer->trimToNFC( 
$description );
+
$aliases = $this->getRequest()->getVal( 'aliases' );
-   $this->aliases = ( $aliases === null ? array() : explode( '|', 
$aliases ) );
+   $explodedAliases = ( $aliases === null ? array() : explode( 
'|', $aliases ) );
+   foreach ( $explodedAliases as $alias ) {
+   if ( $alias !== '' ) {
+   $this->aliases[] = 
$this->stringNormalizer->trimToNFC( $alias );
+   }
+   }
$this->contentLanguage = Language::factory( 
$this->getRequest()->getVal(
'lang',
$this->getLanguage()->getCode()
@@ -191,12 +202,8 @@
 * @return bool
 */
protected function hasSufficientArguments() {
-   return $this->stringNormalizer->trimWhitespace( $this->label ) 
!== ''
-   || $this->stringNormalizer->trimWhitespace( 
$this->description ) !== ''
-   || implode( '', array_map(
-   array( $this->stringNormalizer, 
'trimWhitespace' ),
-   $this->aliases
-   ) ) !== '';
+   return $this->label !== '' || $this->description !== ''
+   || implode( '', $this->aliases ) !== '';
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7ff02dbe520dc3328eba7c872eb69e181c3f70da
Gerrit-PatchSet: 15
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: D3r1ck01 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Bene 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Let user make hidenondamaging default - change (mediawiki...ORES)

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

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

Change subject: Let user make hidenondamaging default
..

Let user make hidenondamaging default

In recent changes and watchlist

Bug: T130560
Change-Id: Iac1b4b00998ecb3d31e43f1fb3b3142934c11d85
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/Hooks.php
4 files changed, 28 insertions(+), 2 deletions(-)


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

diff --git a/extension.json b/extension.json
index bd0bdc9..3a1a7ed 100644
--- a/extension.json
+++ b/extension.json
@@ -94,7 +94,9 @@
}
},
"DefaultUserOptions": {
-   "oresDamagingPref": "hard"
+   "oresDamagingPref": "hard",
+   "oresRCHideNonDamaging": 0,
+   "oresWatchlistHideNonDamaging": 0
},
"manifest_version": 1
 }
diff --git a/i18n/en.json b/i18n/en.json
index df0a8ba..5701080 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -13,5 +13,7 @@
"ores-damaging-legend": "This edit may be damaging and should be 
reviewed",
"ores-help-damaging-pref": "This threshold determines how sensitive 
ORES is when flagging edits needing review",
"ores-pref-damaging": "ORES sensitivity",
+   "ores-pref-rc-hidenondamaging": "Hide good edits from recent changes",
+   "ores-pref-watchlist-hidenondamaging": "Hide good edits from the 
watchlist",
"prefs-ores" : "ORES"
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index b4ffda7..7d98f84 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -16,5 +16,7 @@
"ores-damaging-legend": "Legend for damaging risk icon.",
"ores-help-damaging-pref": "Help text for \"ORES sensitivity\" in 
preferences",
"ores-pref-damaging": "Part asking for damaging threshold",
+   "ores-pref-rc-hidenondamaging": "Display message for user preferences 
to make hidenondamaging default in recent changes",
+   "ores-pref-watchlist-hidenondamaging": "Display message for user 
preferences to make hidenondamaging default in the watchlist",
"prefs-ores": "{{optional}} \nName of ORES section in preferences"
 }
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 9cea658..1ac9c3c 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -72,9 +72,16 @@
return true;
}
 
+   $default = false;
+   $name = $clsp->getName();
+   if ( $name === 'Watchlist' ) {
+   $default = $clsp->getUser()->getOption( 
'oresWatchlistHideNonDamaging' );
+   } elseif ( $name === 'Recentchanges' ) {
+   $default = $clsp->getUser()->getOption( 
'oresRCHideNonDamaging' );
+   }
$filters['hidenondamaging'] = [
'msg' => 'ores-damaging-filter',
-   'default' => false,
+   'default' => $default,
];
 
return true;
@@ -253,6 +260,7 @@
 
/**
 * GetPreferences hook, adding ORES section, letting people choose a 
threshold
+* Also let people make hidenondamaging default
 */
public static function onGetPreferences( $user, &$preferences ) {
global $wgOresDamagingThresholds;
@@ -272,6 +280,18 @@
'options' => $options,
'help-message' => 'ores-help-damaging-pref',
];
+
+   // Make hidenondamaging default
+   $preferences['oresWatchlistHideNonDamaging'] = [
+   'type' => 'toggle',
+   'section' => 'watchlist/ores',
+   'label-message' => 
'ores-pref-watchlist-hidenondamaging',
+   ];
+   $preferences['oresRCHideNonDamaging'] = [
+   'type' => 'toggle',
+   'section' => 'rc/advancedrc',
+   'label-message' => 'ores-pref-rc-hidenondamaging',
+   ];
return true;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac1b4b00998ecb3d31e43f1fb3b3142934c11d85
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup 

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


[MediaWiki-commits] [Gerrit] flake8 on icinga - change (operations/puppet)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: flake8 on icinga
..


flake8 on icinga

Change-Id: I56e156dff2cfee47fbd875dd8fbb77a6d11cd408
---
M modules/icinga/files/purge-nagios-resources.py
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/modules/icinga/files/purge-nagios-resources.py 
b/modules/icinga/files/purge-nagios-resources.py
index 798eb9f..07f7138 100755
--- a/modules/icinga/files/purge-nagios-resources.py
+++ b/modules/icinga/files/purge-nagios-resources.py
@@ -6,7 +6,6 @@
 # Written on 2010/08/14 by Mark Bergsma 
 
 import os.path
-import stat
 import sys
 import tempfile
 
@@ -55,7 +54,8 @@
 
 if __name__ == '__main__':
 if len(sys.argv) < 3:
-print "\n\tUsage:\n\t\t%s   [ 
 ... ]\n" % sys.argv[0]
+print("\n\tUsage:\n\t\t%s   "
+  "[  ... ]\n" % sys.argv[0])
 sys.exit(0)
 
 hosts = readHostsFile(sys.argv[1])

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I56e156dff2cfee47fbd875dd8fbb77a6d11cd408
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ladsgroup 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: Mark Bergsma 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Add stats recording to dispatchChanges.php - change (mediawiki...Wikibase)

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

Change subject: Add stats recording to dispatchChanges.php
..


Add stats recording to dispatchChanges.php

This will allow us to.
 - How many script runs are happening.
 - How many changes are being dispatched.
 - How long the script is running each time.
 - How many passes are being completed.
 - The number of times there are no changes to go.
 - The number of exceptions encountered.

Change-Id: I641bf5557e61fc85e7858e1b962c04fe921f022d
---
M repo/maintenance/dispatchChanges.php
1 file changed, 15 insertions(+), 3 deletions(-)

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



diff --git a/repo/maintenance/dispatchChanges.php 
b/repo/maintenance/dispatchChanges.php
index eff968e..bfe2442 100644
--- a/repo/maintenance/dispatchChanges.php
+++ b/repo/maintenance/dispatchChanges.php
@@ -5,6 +5,7 @@
 use Exception;
 use Maintenance;
 use MWException;
+use RequestContext;
 use Wikibase\Lib\Reporting\ObservableMessageReporter;
 use Wikibase\Lib\Reporting\ReportingExceptionHandler;
 use Wikibase\Lib\Store\ChangeLookup;
@@ -176,12 +177,15 @@
 
$dispatcher->getDispatchCoordinator()->initState( $clientWikis 
);
 
+   $stats = RequestContext::getMain()->getStats();
+   $stats->increment( 'wikibase.repo.dispatchChanges.start' );
+
$passes = $maxPasses === PHP_INT_MAX ? "unlimited" : $maxPasses;
$time = $maxTime === PHP_INT_MAX ? "unlimited" : $maxTime;
 
$this->log( "Starting loop for $passes passes or $time seconds" 
);
 
-   $startTime = time();
+   $startTime = microtime( true );
$t = 0;
 
// Run passes in a loop, sleeping when idle.
@@ -194,6 +198,7 @@
break;
}
 
+   $runStartTime = microtime( true );
$c++;
 
try {
@@ -201,8 +206,10 @@
$wikiState = $dispatcher->selectClient();
 
if ( $wikiState ) {
-   $dispatcher->dispatchTo( $wikiState );
+   $dispatchedChanges = 
$dispatcher->dispatchTo( $wikiState );
+   $stats->updateCount( 
'wikibase.repo.dispatchChanges.changes', $dispatchedChanges );
} else {
+   $stats->increment( 
'wikibase.repo.dispatchChanges.noclient' );
// Try again later, unless we have 
already reached the limit.
if ( $c < $maxPasses ) {
$this->trace( "Idle: No client 
wiki found in need of dispatching. "
@@ -214,6 +221,7 @@
}
}
} catch ( Exception $ex ) {
+   $stats->increment( 
'wikibase.repo.dispatchChanges.exception' );
if ( $c < $maxPasses ) {
$this->log( "ERROR: $ex; sleeping for 
{$delay} seconds" );
sleep( $delay );
@@ -222,9 +230,13 @@
}
}
 
-   $t = ( time() - $startTime );
+   $t = ( microtime( true ) - $startTime );
+   $stats->timing( 
'wikibase.repo.dispatchChanges.pass-time', ( microtime( true ) - $runStartTime 
) * 1000 );
}
 
+   $stats->timing( 'wikibase.repo.dispatchChanges.execute-time', 
$t * 1000 );
+   $stats->updateCount( 'wikibase.repo.dispatchChanges.passes', $c 
);
+
$this->log( "Done, exiting after $c passes and $t seconds." );
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I641bf5557e61fc85e7858e1b962c04fe921f022d
Gerrit-PatchSet: 11
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: JanZerebecki 
Gerrit-Reviewer: Lydia Pintscher 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use && instead of , - change (mediawiki...TimedMediaHandler)

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

Change subject: Use && instead of ,
..


Use && instead of ,

Follow up to 484347c7d6a6b5dfdaf619d4ab2a3b9bb5d1780e

Change-Id: I9df09c48a3215bfc0bae79e788ab658f768b3b49
---
M MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js 
b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
index 441f4f2..a9aea2b 100644
--- a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
+++ b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
@@ -2644,7 +2644,7 @@
//mw.log( 'EmbedPlayer: updatePlayHead: '+ perc);
if( this.getInterface() ){
var $playHead = this.getInterface().find( 
'.play_head' );
-   if ( !this.useNativePlayerControls() && 
$playHead.length != 0, $.contains( document, $playHead[0] ) ) {
+   if ( !this.useNativePlayerControls() && 
$playHead.length != 0 && $.contains( document, $playHead[0] ) ) {
var val = parseInt( perc * 1000 );
$playHead.slider( 'value', val );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9df09c48a3215bfc0bae79e788ab658f768b3b49
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use && instead of , - change (mediawiki...TimedMediaHandler)

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

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

Change subject: Use && instead of ,
..

Use && instead of ,

Follow up to 484347c7d6a6b5dfdaf619d4ab2a3b9bb5d1780e

Change-Id: I9df09c48a3215bfc0bae79e788ab658f768b3b49
---
M MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js 
b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
index 441f4f2..a9aea2b 100644
--- a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
+++ b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
@@ -2644,7 +2644,7 @@
//mw.log( 'EmbedPlayer: updatePlayHead: '+ perc);
if( this.getInterface() ){
var $playHead = this.getInterface().find( 
'.play_head' );
-   if ( !this.useNativePlayerControls() && 
$playHead.length != 0, $.contains( document, $playHead[0] ) ) {
+   if ( !this.useNativePlayerControls() && 
$playHead.length != 0 && $.contains( document, $playHead[0] ) ) {
var val = parseInt( perc * 1000 );
$playHead.slider( 'value', val );
}

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

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

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


[MediaWiki-commits] [Gerrit] Add ores::redis::password - change (labs/private)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Add ores::redis::password
..


Add ores::redis::password

Puppet compiler needs and possibly useful in labs as well

Change-Id: I629f2667edd383285b8bd2bb91ce94e92032594c
---
A hieradata/role/common/ores/redis.yaml
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Alexandros Kosiaris: Verified; Looks good to me, approved



diff --git a/hieradata/role/common/ores/redis.yaml 
b/hieradata/role/common/ores/redis.yaml
new file mode 100644
index 000..dbf9c79
--- /dev/null
+++ b/hieradata/role/common/ores/redis.yaml
@@ -0,0 +1 @@
+ores::redis::password: apassword

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I629f2667edd383285b8bd2bb91ce94e92032594c
Gerrit-PatchSet: 1
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Alexandros Kosiaris 
Gerrit-Reviewer: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] Add ores::redis::password - change (labs/private)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Add ores::redis::password
..

Add ores::redis::password

Puppet compiler needs and possibly useful in labs as well

Change-Id: I629f2667edd383285b8bd2bb91ce94e92032594c
---
A hieradata/role/common/ores/redis.yaml
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/private 
refs/changes/37/278837/1

diff --git a/hieradata/role/common/ores/redis.yaml 
b/hieradata/role/common/ores/redis.yaml
new file mode 100644
index 000..dbf9c79
--- /dev/null
+++ b/hieradata/role/common/ores/redis.yaml
@@ -0,0 +1 @@
+ores::redis::password: apassword

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I629f2667edd383285b8bd2bb91ce94e92032594c
Gerrit-PatchSet: 1
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] ores: Collapse the redis configs into one stanza - change (operations/puppet)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: ores: Collapse the redis configs into one stanza
..

ores: Collapse the redis configs into one stanza

Since redis::instance allows us to use map to override configs per redis
instance, take advantage of that to collapse the config in order to add
support for replication in an easier fashion. While at it add all the
usual settings we have for a jobqueue redis and for now apply them as is
on the cache as well. That is:

* Use the standard /srv/redis directory
* Name the db filename per instance
* Enable AOF
* Effectively stop RDB by specifying an empty save
* Increase defaults limits for replication
* Apply latency improvents on fsync
* Have slave be able to be used read-write
* Don't stop writes on bgsave error

Bug: T124200
Change-Id: I49f5995363fbc669625af1c8a512c0f43ad9fe9b
---
M modules/ores/manifests/redis.pp
1 file changed, 46 insertions(+), 27 deletions(-)


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

diff --git a/modules/ores/manifests/redis.pp b/modules/ores/manifests/redis.pp
index 713ef35..51bf688 100644
--- a/modules/ores/manifests/redis.pp
+++ b/modules/ores/manifests/redis.pp
@@ -1,37 +1,56 @@
 class ores::redis(
 $queue_maxmemory,
 $cache_maxmemory,
+$password=undef,
+$slaveof=undef,
 ) {
-file { [
-'/srv/redis/queue',
-'/srv/redis/cache'
-]:
-ensure => directory,
-owner  => 'redis',
-group  => 'redis',
-mode   => '0774'
+$common_settings = {
+bind=> '0.0.0.0',
+appendonly  => true,
+auto_aof_rewrite_min_size   => '512mb',
+client_output_buffer_limit  => 'slave 512mb 200mb 60',
+dir => '/srv/redis',
+no_appendfsync_on_rewrite   => true,
+save=> '""',
+stop_writes_on_bgsave_error => false,
+slave_read_only => false,
+tcp_keepalive   => 60,
+}
+$instance_settings = {
+'6379' => {
+maxmemory  => $queue_maxmemory,
+appendfilename => "${::hostname}-6379.aof",
+dbfilename => "${::hostname}-6379.rdb",
+},
+'6380' => {
+maxmemory  => $cache_maxmemory,
+appendfilename => "${::hostname}-6380.aof",
+dbfilename => "${::hostname}-6380.rdb",
+}
 }
 
-# FIXME: Tune the individual redises better for their use case
-# For the queue
-redis::instance { '6379':
-settings => {
-bind  => '0.0.0.0',
-dir   => '/srv/redis/queue',
-maxmemory => $queue_maxmemory,
-tcp_keepalive => 60,
-},
-require  => File['/srv/redis/queue']
+# If we specified a password use it
+if $password {
+$password_settings = {
+masterauth  => $password,
+requirepass => $password,
+}
+} else {
+$password_settings = {}
 }
+$common_settings_real = deep_merge($common_settings, $password_settings)
+# if we specified a slave, use it
+if $slave {
+$slave_settings = {
+slaveof => $slaveof,
+}
+} else {
+$slave_settings = {}
+}
+$instance_settings_real = deep_merge($instance_settings, $slave_settings)
 
-# For the cache
-redis::instance { '6380':
-settings => {
-bind  => '0.0.0.0',
-dir   => '/srv/redis/cache',
-maxmemory => $cache_maxmemory,
-tcp_keepalive => 60,
-},
-require  => File['/srv/redis/cache']
+redis::instance { ['6379', '6389']:
+settings => $common_settings_real,
+map  => $instance_settings_real,
 }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49f5995363fbc669625af1c8a512c0f43ad9fe9b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: eed6125..b6662a6 - change (mediawiki/extensions)

2016-03-21 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has submitted this change and it was merged.

Change subject: Syncronize VisualEditor: eed6125..b6662a6
..


Syncronize VisualEditor: eed6125..b6662a6

Change-Id: Ide065df6e17d259e688aac6ea8ff382a2680a0ae
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)

Approvals:
  Jenkins-mwext-sync: Verified; Looks good to me, approved



diff --git a/VisualEditor b/VisualEditor
index eed6125..b6662a6 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit eed6125ef2b72829df033fa352fc1945e1f81d4a
+Subproject commit b6662a697d6245ec78473816e4b36a96b6be3b18

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ide065df6e17d259e688aac6ea8ff382a2680a0ae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 
Gerrit-Reviewer: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: eed6125..b6662a6 - change (mediawiki/extensions)

2016-03-21 Thread Jenkins-mwext-sync (Code Review)
Jenkins-mwext-sync has uploaded a new change for review.

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

Change subject: Syncronize VisualEditor: eed6125..b6662a6
..

Syncronize VisualEditor: eed6125..b6662a6

Change-Id: Ide065df6e17d259e688aac6ea8ff382a2680a0ae
---
M VisualEditor
1 file changed, 0 insertions(+), 0 deletions(-)


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

diff --git a/VisualEditor b/VisualEditor
index eed6125..b6662a6 16
--- a/VisualEditor
+++ b/VisualEditor
-Subproject commit eed6125ef2b72829df033fa352fc1945e1f81d4a
+Subproject commit b6662a697d6245ec78473816e4b36a96b6be3b18

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide065df6e17d259e688aac6ea8ff382a2680a0ae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions
Gerrit-Branch: master
Gerrit-Owner: Jenkins-mwext-sync 

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


[MediaWiki-commits] [Gerrit] Fix "No tests found in class …." - change (mediawiki...Wikibase)

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

Change subject: Fix "No tests found in class …."
..


Fix "No tests found in class …."

This is a problem since 1dd20e936b1f6dd3efacd155d96d0e0364f66d92 as
PHPUnit_Framework_TestCase doesn't define any tests itself, while
MediaWikiTestCase does.

Change-Id: Ie3a658f254b37e70a06395f8ee7af1c22f71eb28
---
M 
client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
1 file changed, 7 insertions(+), 0 deletions(-)

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



diff --git 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
index b582c70..df71c49 100644
--- 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
+++ 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
@@ -19,6 +19,13 @@
$this->markTestSkipped( 'Scribunto is not available' );
}
 
+   public function testPlaceholder() {
+   $this->assertTrue(
+   false,
+   'PHPunit expects this class to have tests. This 
should never run.'
+   );
+   }
+
}
 
return;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie3a658f254b37e70a06395f8ee7af1c22f71eb28
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man 
Gerrit-Reviewer: Addshore 
Gerrit-Reviewer: Aude 
Gerrit-Reviewer: Bene 
Gerrit-Reviewer: Thiemo Mättig (WMDE) 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] RESTBase: Use backend config option to select sqlite storage. - change (mediawiki/vagrant)

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

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

Change subject: RESTBase: Use backend config option to select sqlite storage.
..

RESTBase: Use backend config option to select sqlite storage.

After https://github.com/wikimedia/restbase/pull/560 we're able
to switch between cassandra and sqlite by a config option. This
patch adds this option to vagrant, so we would be able to delete
vagrant-specific configs from RESTBase codebase.

Change-Id: I8a8fecaeed99fc1b3df55dd0fe9f534e29e2a66c
---
M puppet/modules/restbase/templates/config.yaml.erb
1 file changed, 3 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/64/278764/1

diff --git a/puppet/modules/restbase/templates/config.yaml.erb 
b/puppet/modules/restbase/templates/config.yaml.erb
index d8228ec..81bbb09 100644
--- a/puppet/modules/restbase/templates/config.yaml.erb
+++ b/puppet/modules/restbase/templates/config.yaml.erb
@@ -4,19 +4,11 @@
 # in the root_spec further down.
 default_project: _project
   x-modules:
-- path: projects/wmf_sqlite.yaml
+- path: projects/wmf_default.yaml
   options: _options
 table:
-  hosts: [localhost]
-  keyspace: system
-  username: cassandra
-  password: cassandra
-  defaultConsistency: one # or 'localQuorum' for production
-  storage_groups:
-- name: group.local
-  domains: /./
+  backend: sqlite
   dbname: <%= @dbdir %>/mw-vagrant.sqlite3
-  version: 1
 parsoid:
   host: http://localhost:<%= scope['::mediawiki::parsoid::port'] %>
 action:
@@ -32,7 +24,7 @@
 
 wikimedia.org: 
   x-modules:
-- path: projects/wikimedia.org_sqlite.yaml
+- path: projects/wikimedia.org.yaml
   options:
 <<: *default_options
 pageviews:

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

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

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


[MediaWiki-commits] [Gerrit] flake8 on icinga - change (operations/puppet)

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

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

Change subject: flake8 on icinga
..

flake8 on icinga

Change-Id: I56e156dff2cfee47fbd875dd8fbb77a6d11cd408
---
M modules/icinga/files/purge-nagios-resources.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/63/278763/1

diff --git a/modules/icinga/files/purge-nagios-resources.py 
b/modules/icinga/files/purge-nagios-resources.py
index 798eb9f..07f7138 100755
--- a/modules/icinga/files/purge-nagios-resources.py
+++ b/modules/icinga/files/purge-nagios-resources.py
@@ -6,7 +6,6 @@
 # Written on 2010/08/14 by Mark Bergsma 
 
 import os.path
-import stat
 import sys
 import tempfile
 
@@ -55,7 +54,8 @@
 
 if __name__ == '__main__':
 if len(sys.argv) < 3:
-print "\n\tUsage:\n\t\t%s   [ 
 ... ]\n" % sys.argv[0]
+print("\n\tUsage:\n\t\t%s   "
+  "[  ... ]\n" % sys.argv[0])
 sys.exit(0)
 
 hosts = readHostsFile(sys.argv[1])

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

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

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


[MediaWiki-commits] [Gerrit] Flake8 for HHVM - change (operations/puppet)

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

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

Change subject: Flake8 for HHVM
..

Flake8 for HHVM

Change-Id: I8d2c8b93e15fc2c9065766eb9b15b145fefd5c95
---
M modules/hhvm/files/debug/printers.py
M modules/hhvm/files/monitoring/hhvm_apc.py
2 files changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/62/278762/1

diff --git a/modules/hhvm/files/debug/printers.py 
b/modules/hhvm/files/debug/printers.py
index 9f9f6fb..ac05dbe 100644
--- a/modules/hhvm/files/debug/printers.py
+++ b/modules/hhvm/files/debug/printers.py
@@ -1043,8 +1043,6 @@
 
 # For _GLIBCXX_BEGIN_NAMESPACE_VERSION.
 vers = '(__7::)?'
-# For _GLIBCXX_BEGIN_NAMESPACE_CONTAINER.
-container = '(__cxx1998::' + vers + ')?'
 
 # libstdc++ objects requiring pretty-printing.
 # In order from:
diff --git a/modules/hhvm/files/monitoring/hhvm_apc.py 
b/modules/hhvm/files/monitoring/hhvm_apc.py
index d75bd7a..1e18664 100644
--- a/modules/hhvm/files/monitoring/hhvm_apc.py
+++ b/modules/hhvm/files/monitoring/hhvm_apc.py
@@ -6,7 +6,6 @@
   Diamond collector for HHVM APC stats.
 
 """
-import json
 import re
 import urllib2
 

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

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

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


[MediaWiki-commits] [Gerrit] Flake8 on openstack, part I - change (operations/puppet)

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

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

Change subject: Flake8 on openstack, part I
..

Flake8 on openstack, part I

Change-Id: I20e7184b0cc531088a2d1efb0f8ba97f19a75a0b
---
M modules/openstack/files/kilo/virtscripts/logstat.py
1 file changed, 200 insertions(+), 198 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/61/278761/1

diff --git a/modules/openstack/files/kilo/virtscripts/logstat.py 
b/modules/openstack/files/kilo/virtscripts/logstat.py
index 4337c67..ba60830 100644
--- a/modules/openstack/files/kilo/virtscripts/logstat.py
+++ b/modules/openstack/files/kilo/virtscripts/logstat.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 #
-### THIS FILE IS MANAGED BY PUPPET
-### puppet:///modules/openstack/kilo/virtscripts/logstat.py
+# THIS FILE IS MANAGED BY PUPPET
+# puppet:///modules/openstack/kilo/virtscripts/logstat.py
 #
 # encoding: utf-8
 """
@@ -39,224 +39,226 @@
 import sys
 import getopt
 import re
-import string
 
 help_message = '''
 Usage: logstat.py [options] file [file ...]
 options:
-\t -a SLA : specifies the SLA in milliseconds
-\t -s operation(s) : specifies which operations to compute stat for. 
-\t -o output : specifies the output file, otherwise stdout is used
-\t -r : include replicated operations
-\t -v : verbose mode
+-a SLA : specifies the SLA in milliseconds
+-s operation(s) : specifies which operations to compute stat for.
+-o output : specifies the output file, otherwise stdout is used
+-r : include replicated operations
+-v : verbose mode
 
 '''
 
+
 class OpStat():
-   def __init__(self, type, sla):
-   self.type = type
-   self.count = long(0)
-   self.etime = long(0)
-   self.maxEtime = long(0)
-   self.SLA = sla
-   self.countOverSLA = long(0)
-   self.countOver10SLA = long(0)
-   self.retEntries = long(0)
-   self.count0Entries = long(0)
-   self.count1Entry = long(0)
-   self.maxEntries = long(0)
 
-   def incEtime(self, etime):
-   self.etime += etime
-   self.count += 1
-   if self.maxEtime < etime:
-   self.maxEtime = etime
-   if etime > self.SLA:
-   self.countOverSLA += 1
-   if etime > self.SLA * 10:
-   self.countOver10SLA += 1
+def __init__(self, type, sla):
+self.type = type
+self.count = long(0)
+self.etime = long(0)
+self.maxEtime = long(0)
+self.SLA = sla
+self.countOverSLA = long(0)
+self.countOver10SLA = long(0)
+self.retEntries = long(0)
+self.count0Entries = long(0)
+self.count1Entry = long(0)
+self.maxEntries = long(0)
 
-   def incEntries(self, count):
-   self.retEntries += count
-   if self.maxEntries < count:
-   self.maxEntries = count
-   if count == 0:
-   self.count0Entries += 1
-   if count == 1:
-   self.count1Entry += 1
-   
-   def printStats(self, outfile):
-   if self.count != 0:
-   outfile.write(self.type + ":\t" + str(self.count) + 
"\tAvg: " +
-str(round(float(self.etime) / float(self.count), 3)) +
- " ms\tMax: " + str(self.maxEtime) + " ms\t>" + 
str(self.SLA) +"ms: " +
-  str(self.countOverSLA) + " (" + 
str(self.countOverSLA * 100 / self.count) + "%)\t>" +
-  str(self.SLA * 10) + "ms: " +
-  str(self.countOver10SLA) + " (" + 
str(self.countOver10SLA * 100 / self.count) + "%)\n")
-   if self.retEntries != 0:
-   outfile.write(self.type + ":\tReturned " + 
str(round(float(self.retEntries) / float(self.count), 1)) +
-" entries in average, max: " + str(self.maxEntries) + 
", none: "+ str(self.count0Entries) +
-", single: "+ str(self.count1Entry) +"\n")
+def incEtime(self, etime):
+self.etime += etime
+self.count += 1
+if self.maxEtime < etime:
+self.maxEtime = etime
+if etime > self.SLA:
+self.countOverSLA += 1
+if etime > self.SLA * 10:
+self.countOver10SLA += 1
+
+def incEntries(self, count):
+self.retEntries += count
+if self.maxEntries < count:
+self.maxEntries = count
+if count == 0:
+self.count0Entries += 1
+if count == 1:
+self.count1Entry += 1
+
+def printStats(self, 

[MediaWiki-commits] [Gerrit] Mass switch repositories npm job to Nodepool - change (integration/config)

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

Change subject: Mass switch repositories npm job to Nodepool
..


Mass switch repositories npm job to Nodepool

Change the Zuul 'npm' template to rely on Nodepool based jobs. Mostly
impacts extensions.

Repository that needs Node 0.10 would use the 'npm' job on permanent
slave. That is achieved by using the template 'npm-legacy' introduced in
parent commit.

Kept a few extensions to the Node 0.10 job on permanent slaves since a
mass test run reported them as failing:

ApiExplorer
ApiSandbox
BookManagerv2
Collection/OfflineContentGenerator/bundler
Collection/OfflineContentGenerator/latex_renderer
Collection/OfflineContentGenerator/text_renderer
MobileFrontend
MsUpload
QuickSurveys
SocialProfile
WikiPinger

We will later be able to drop the 'npm-node-4.3' template.

Bug: T119143
Change-Id: Ib3a81587ad60c8cf37d90afa9c2c792f548353a9
---
M zuul/layout.yaml
1 file changed, 13 insertions(+), 15 deletions(-)

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



diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 163255c..bcd08ba 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -1207,10 +1207,8 @@
 
   - name: npm
 test:
-  - npm
+  - npm-node-4.3
 gate-and-submit:
-  - npm
-experimental:
   - npm-node-4.3
 
   - name: npm-legacy
@@ -2394,7 +2392,7 @@
   - name: mediawiki/extensions/ApiSandbox
 template:
   - name: extension-unittests-generic
-  - name: npm
+  - name: npm-legacy
 check:
   - jsonlint
 
@@ -2452,7 +2450,7 @@
   - name: mediawiki/extensions/BookManagerv2
 template:
   - name: extension-unittests-generic
-  - name: npm
+  - name: npm-legacy
 check:
   - jsonlint
   - jshint
@@ -2680,25 +2678,25 @@
 
   - name: mediawiki/extensions/Collection/OfflineContentGenerator
 template:
-  - name: npm
+  - name: npm-legacy
 gate-and-submit:
   - mediawiki-gate
 
   - name: mediawiki/extensions/Collection/OfflineContentGenerator/bundler
 template:
-  - name: npm
+  - name: npm-legacy
 gate-and-submit:
   - mediawiki-gate
 
   - name: 
mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer
 template:
-  - name: npm
+  - name: npm-legacy
 gate-and-submit:
   - mediawiki-gate
 
   - name: mediawiki/extensions/Collection/OfflineContentGenerator/text_renderer
 template:
-  - name: npm
+  - name: npm-legacy
 gate-and-submit:
   - mediawiki-gate
 
@@ -3606,7 +3604,7 @@
   - name: extension-unittests-generic
   - name: rake
   - name: composer-test
-  - name: npm
+  - name: npm-legacy
   - name: extension-selenium
 check:
   - jshint
@@ -4016,7 +4014,7 @@
   - name: mediawiki/extensions/ApiExplorer
 template:
   - name: extension-unittests-generic
-  - name: npm
+  - name: npm-legacy
 check:
   - jsonlint
   - jshint
@@ -4922,7 +4920,7 @@
 template:
   - name: composer-test
   - name: extension-unittests-generic
-  - name: npm
+  - name: npm-legacy
 check:
   - jsonlint
   - jshint
@@ -5311,7 +5309,7 @@
   - name: extension-qunit-generic
   - name: rake
   - name: extension-unittests-generic
-  - name: npm
+  - name: npm-legacy
   - name: extension-selenium
 check:
   - jshint
@@ -5658,7 +5656,7 @@
 template:
   - name: composer-test
   - name: extension-unittests-generic
-  - name: npm
+  - name: npm-legacy
 check:
   - jsonlint
   - jshint
@@ -6103,7 +6101,7 @@
 
   - name: mediawiki/extensions/WikiPinger
 template:
-  - name: npm
+  - name: npm-legacy
   - name: extension-unittests-generic
   - name: composer-test
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3a81587ad60c8cf37d90afa9c2c792f548353a9
Gerrit-PatchSet: 3
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Paladox 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Rename "Wikisource" to "Multilingual Wikisource " in project... - change (mediawiki...WikimediaMessages)

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

Change subject: Rename "Wikisource" to "Multilingual Wikisource " in project 
names
..


Rename "Wikisource" to "Multilingual Wikisource " in project names

Just saying "Wikisource" can be confusing, because the user may think
that it's the Wikisource project in the same language. To disambiguate,
it says "Multilingual Wikisource", which is the usual name that refers
to this site.

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

Approvals:
  Alex Monk: Looks good to me, but someone else must approve
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/wikimediaprojectnames/en.json 
b/i18n/wikimediaprojectnames/en.json
index 2b2e937..063c4e6 100644
--- a/i18n/wikimediaprojectnames/en.json
+++ b/i18n/wikimediaprojectnames/en.json
@@ -862,7 +862,7 @@
"project-localized-name-ruwikimedia": "Wikimedia Russia",
"project-localized-name-sewikimedia": "Wikimedia Sweden",
"project-localized-name-searchcomwiki": "Search Committee",
-   "project-localized-name-sourceswiki": "Wikisource",
+   "project-localized-name-sourceswiki": "Multilingual Wikisource",
"project-localized-name-spcomwiki": "Spcom",
"project-localized-name-specieswiki": "Wikispecies",
"project-localized-name-stewardwiki": "Steward Wiki",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I07bbdc11937dc09a7c264c6c65ae456769907dcd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: Amire80 
Gerrit-Reviewer: Alex Monk 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: Siebrand 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] removed inline JavaScript - change (mediawiki...HierarchyBuilder)

2016-03-21 Thread Kji (Code Review)
Kji has submitted this change and it was merged.

Change subject: removed inline JavaScript
..


removed inline JavaScript

Fixed semantic property retrieval errors.

Change-Id: I4e5a63fcc12cb81245f9b35ae6553bda4e5b4c28
---
M HierarchyBuilder.php
M HierarchyBuilder_body.php
M extension.json
M includes/renderHierarchy.js
M includes/renderHierarchySelected.js
5 files changed, 79 insertions(+), 71 deletions(-)

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



diff --git a/HierarchyBuilder.php b/HierarchyBuilder.php
index f6daafe..716e9be 100644
--- a/HierarchyBuilder.php
+++ b/HierarchyBuilder.php
@@ -56,7 +56,7 @@
' Semantic Forms 2.5.2 or above.' );
 }
 
-define( 'HB_VERSION', '3.2.1' );
+define( 'HB_VERSION', '3.2.2' );
 
 # credits
 $wgExtensionCredits['parserhook'][] = array (
diff --git a/HierarchyBuilder_body.php b/HierarchyBuilder_body.php
index 53bfcc1..aa5869d 100644
--- a/HierarchyBuilder_body.php
+++ b/HierarchyBuilder_body.php
@@ -852,6 +852,8 @@
return $rowsOfDepth;
}
 
+   private static $renderHierarchies = array();
+
/**
 * Renders a wikitext formatted hierarchy on a page.
 *
@@ -875,21 +877,15 @@
self::$m_hierarchy_num++;
 
if ( isset( $attributes[HierarchyBuilder::COLLAPSED] ) ) {
-   $collapsed = htmlspecialchars( 
$attributes[HierarchyBuilder::COLLAPSED] );
-   if ( $collapsed === 'collapsed' ) {
-   $collapsed = 'true';
-   }
+   $collapsed = true;
} else  {
-   $collapsed = 'false';
+   $collapsed = false;
}
 
if ( isset( $attributes[HierarchyBuilder::NUMBERED] ) ) {
-   $numbered = htmlspecialchars( 
$attributes[HierarchyBuilder::NUMBERED] );
-   if ( $numbered === 'numbered' ) {
-   $numbered = 'true';
-   }
+   $numbered = true;
} else {
-   $numbered = 'false';
+   $numbered = false;
}
 
if ( isset( $attributes[HierarchyBuilder::TITLEICONPROPERTY] ) 
) {
@@ -910,8 +906,8 @@
false )->getText();
 
$hierarchy = HierarchyBuilder::parseHierarchy( $input,
-   $titleiconproperty, $dummy,
-   function ( $pageName, $titleiconproperty, $data ) {
+   $titleiconproperty,
+   function ( $pageName, $titleiconproperty ) {
$pageLinkArray = array();
$title = Title::newFromText( $pageName );
if ( $title ) {
@@ -927,19 +923,13 @@
 
$parser->getOutput()->addModules( 'ext.HierarchyBuilder.render' 
);
 
-   $hierarchy = strtr( $hierarchy, array( '"' => "'" ) );
-
-   $script = < $hierarchyName ) 
);
+   self::$renderHierarchies[] = array(
+   'div' => $hierarchyName,
+   'hierarchy' => $hierarchy,
+   'collapsed' => $collapsed,
+   'numbered' => $numbered
+   );
+   $parser->getOutput()->addJsConfigVars( 
'HierarchyBuilderRender', self::$renderHierarchies );
 
$output = Html::element( 'div', array( 'id' => $hierarchyName ) 
);
$parser->disableCache();
@@ -947,40 +937,32 @@
'noparse' => false );
}
 
+   private static $renderHierarchiesSelected = array();
+
public function renderHierarchySelected( $input, $attributes, $parser, 
$frame ) {
$hierarchyName = 'HierarchyDiv' . self::$m_hierarchy_num;
self::$m_hierarchy_num++;
 
if ( isset( $attributes[HierarchyBuilder::COLLAPSED] ) ) {
-   $collapsed = htmlspecialchars( 
$attributes[HierarchyBuilder::COLLAPSED] );
-   if ( $collapsed === 'collapsed' ) {
-   $collapsed = 'true';
-   }
+   $collapsed = true;
} else  {
-   $collapsed = 'false';
+   $collapsed = false;
}
 
if ( isset( $attributes[HierarchyBuilder::NUMBERED] ) ) {
-   $numbered = htmlspecialchars( 
$attributes[HierarchyBuilder::NUMBERED] );
-   if ( $numbered === 'numbered' ) {
-   $numbered = 'true';
-   }
+   $numbered = true;
} 

[MediaWiki-commits] [Gerrit] mw.widgets.CategoryCapsuleItemWidget: Pass the right 'this' - change (mediawiki/core)

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

Change subject: mw.widgets.CategoryCapsuleItemWidget: Pass the right 'this'
..


mw.widgets.CategoryCapsuleItemWidget: Pass the right 'this'

Follow-up to 7b57752e65c3cac62d973f43d1060b6bd0ab2a2f.

Bug: T130544
Change-Id: I89c18be911bcc492f3a70e1c1da3d2fd2bf65a05
---
M resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git 
a/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js 
b/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js
index 29eaaad..5369d35 100644
--- a/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js
+++ b/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js
@@ -55,7 +55,7 @@
var title = new ForeignTitle( page.title 
).getPrefixedText();
this.existenceCache[ title ] = !page.missing;
queue[ title ].resolve( this.existenceCache[ 
title ] );
-   } );
+   }.bind( this ) );
}.bind( this ) );
};
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I89c18be911bcc492f3a70e1c1da3d2fd2bf65a05
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Edokter 
Gerrit-Reviewer: Fomafix
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: MarkTraceur 
Gerrit-Reviewer: Prtksxna 
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 the role::ores::redis class - change (operations/puppet)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Add the role::ores::redis class
..

Add the role::ores::redis class

Used to populate a replicated redis database pair

Change-Id: Ia9d710864e130a6f3b3cf2484897d4a0d5713dc1
---
A modules/role/manifests/ores/redis.pp
1 file changed, 9 insertions(+), 0 deletions(-)


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

diff --git a/modules/role/manifests/ores/redis.pp 
b/modules/role/manifests/ores/redis.pp
new file mode 100644
index 000..210f024
--- /dev/null
+++ b/modules/role/manifests/ores/redis.pp
@@ -0,0 +1,9 @@
+# Setting up ORES Redis database in a replicated way in order to facilitate
+# failover if required
+class role::ores::redis {
+# We rely on hiera for the slaveof parameter
+class { '::ores::redis':
+queue_maxmemory => '512M',
+cache_maxmemory => '3G',
+}
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9d710864e130a6f3b3cf2484897d4a0d5713dc1
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] Add the role::ores::redis class to oresdb100{1, 2} - change (operations/puppet)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Add the role::ores::redis class to oresdb100{1,2}
..

Add the role::ores::redis class to oresdb100{1,2}

Introduce oresdb1001, oresdb1002, assigning the roles::ores::redis class
to them and set via hiera oresdb1002 to be a slaveof oresdb1001

Bug: T125562
Change-Id: I6a34ac7c176309475ca193294abe443836153121
---
A hieradata/hosts/oresdb1002.yaml
M manifests/site.pp
2 files changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/hieradata/hosts/oresdb1002.yaml b/hieradata/hosts/oresdb1002.yaml
new file mode 100644
index 000..780bda5
--- /dev/null
+++ b/hieradata/hosts/oresdb1002.yaml
@@ -0,0 +1 @@
+ores::redis::slaveof: oresdb1001.eqiad.wmnet
diff --git a/manifests/site.pp b/manifests/site.pp
index 54df25e..9ed319b 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -2213,6 +2213,11 @@
 role ocg
 }
 
+node /^oresdb100[12]\.eqiad\.wmnet$/ {
+role ores::redis
+include ::standard
+}
+
 # VisualEditor performance testing rig
 node 'osmium.eqiad.wmnet' {
 role ve

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a34ac7c176309475ca193294abe443836153121
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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


[MediaWiki-commits] [Gerrit] Flake8 for osm - change (operations/puppet)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Flake8 for osm
..


Flake8 for osm

Change-Id: Ia33683e4ed73146b28f3a84aa223d076316102d6
---
M modules/osm/files/ganglia/osm.py
1 file changed, 0 insertions(+), 1 deletion(-)

Approvals:
  Alexandros Kosiaris: Verified; Looks good to me, approved



diff --git a/modules/osm/files/ganglia/osm.py b/modules/osm/files/ganglia/osm.py
index 99b66f9..8527c63 100644
--- a/modules/osm/files/ganglia/osm.py
+++ b/modules/osm/files/ganglia/osm.py
@@ -1,6 +1,5 @@
 #!/bin/env python
 
-import sys
 import os
 import threading
 import time

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia33683e4ed73146b28f3a84aa223d076316102d6
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ladsgroup 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Flake8 and fix bug in phabricator - change (operations/puppet)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Flake8 and fix bug in phabricator
..


Flake8 and fix bug in phabricator

Change-Id: I7d79ec8a38048f727cdb56f85750848f278be745
---
M modules/phabricator/files/phab_epipe.py
1 file changed, 2 insertions(+), 4 deletions(-)

Approvals:
  Alexandros Kosiaris: Verified; Looks good to me, approved



diff --git a/modules/phabricator/files/phab_epipe.py 
b/modules/phabricator/files/phab_epipe.py
index 1f656db..69a2fed 100644
--- a/modules/phabricator/files/phab_epipe.py
+++ b/modules/phabricator/files/phab_epipe.py
@@ -41,7 +41,6 @@
 host= 
 
 """
-import base64
 import os
 import re
 import subprocess
@@ -276,8 +275,8 @@
 else:
 err = 'Unknown email body format: from %s to %s'
 dest = str(dest_addresses)
-raise EmailParsingError(error % (src_address,
- dest))
+raise EmailParsingError(err % (src_address,
+   dest))
 
 else:
 log('attaching file')
@@ -393,7 +392,6 @@
 # email parsing logic.
 userinfo = phab.user.query(emails=[src_addy])
 if userinfo.response:
-from email.mime.image import MIMEImage
 from email.mime.multipart import MIMEMultipart
 from email.mime.text import MIMEText
 body += "\n\n#%s" % (address_routing[route_address],)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d79ec8a38048f727cdb56f85750848f278be745
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ladsgroup 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fix "No tests found in class …." - change (mediawiki...Wikibase)

2016-03-21 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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

Change subject: Fix "No tests found in class …."
..

Fix "No tests found in class …."

This is a problem since 1dd20e936b1f6dd3efacd155d96d0e0364f66d92 as
PHPUnit_Framework_TestCase doesn't define any tests itself, while
MediaWikiTestCase does.

Change-Id: Ie3a658f254b37e70a06395f8ee7af1c22f71eb28
---
M 
client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
index b582c70..904de39 100644
--- 
a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
+++ 
b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
@@ -19,6 +19,12 @@
$this->markTestSkipped( 'Scribunto is not available' );
}
 
+   public function testPlaceholder() {
+   $this->assertTrue(
+   false,
+   'PHPunit expects this class to have tests. This 
should never run.'
+   );
+   }
}
 
return;

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

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

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


[MediaWiki-commits] [Gerrit] Track the number of entities loaded using wbgetentities - change (mediawiki...Wikibase)

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

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

Change subject: Track the number of entities loaded using wbgetentities
..

Track the number of entities loaded using wbgetentities

Change-Id: I57cf70478a4f0b5dbadb1c4a2bd05596b4988db6
---
M repo/includes/Api/GetEntities.php
1 file changed, 3 insertions(+), 0 deletions(-)


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

diff --git a/repo/includes/Api/GetEntities.php 
b/repo/includes/Api/GetEntities.php
index b3aebaf..6d10ebf 100644
--- a/repo/includes/Api/GetEntities.php
+++ b/repo/includes/Api/GetEntities.php
@@ -121,6 +121,9 @@
$resolveRedirects = $params['redirects'] === 'yes';
 
$entityIds = $this->getEntityIdsFromParams( $params );
+
+   $this->getStats()->updateCount( 
'wikibase.repo.api.getentities.items', count( $entityIds ) );
+
$entityRevisions = $this->getEntityRevisionsFromEntityIds( 
$entityIds, $resolveRedirects );
 
foreach ( $entityRevisions as $sourceEntityId => 
$entityRevision ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I57cf70478a4f0b5dbadb1c4a2bd05596b4988db6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore 

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


[MediaWiki-commits] [Gerrit] Flake8 for osm - change (operations/puppet)

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

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

Change subject: Flake8 for osm
..

Flake8 for osm

Change-Id: Ia33683e4ed73146b28f3a84aa223d076316102d6
---
M modules/osm/files/ganglia/osm.py
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/modules/osm/files/ganglia/osm.py b/modules/osm/files/ganglia/osm.py
index 99b66f9..8527c63 100644
--- a/modules/osm/files/ganglia/osm.py
+++ b/modules/osm/files/ganglia/osm.py
@@ -1,6 +1,5 @@
 #!/bin/env python
 
-import sys
 import os
 import threading
 import time

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

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

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


[MediaWiki-commits] [Gerrit] Flake8 and fix bug in phabricator - change (operations/puppet)

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

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

Change subject: Flake8 and fix bug in phabricator
..

Flake8 and fix bug in phabricator

Change-Id: I7d79ec8a38048f727cdb56f85750848f278be745
---
M modules/phabricator/files/phab_epipe.py
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/54/278754/1

diff --git a/modules/phabricator/files/phab_epipe.py 
b/modules/phabricator/files/phab_epipe.py
index 1f656db..69a2fed 100644
--- a/modules/phabricator/files/phab_epipe.py
+++ b/modules/phabricator/files/phab_epipe.py
@@ -41,7 +41,6 @@
 host= 
 
 """
-import base64
 import os
 import re
 import subprocess
@@ -276,8 +275,8 @@
 else:
 err = 'Unknown email body format: from %s to %s'
 dest = str(dest_addresses)
-raise EmailParsingError(error % (src_address,
- dest))
+raise EmailParsingError(err % (src_address,
+   dest))
 
 else:
 log('attaching file')
@@ -393,7 +392,6 @@
 # email parsing logic.
 userinfo = phab.user.query(emails=[src_addy])
 if userinfo.response:
-from email.mime.image import MIMEImage
 from email.mime.multipart import MIMEMultipart
 from email.mime.text import MIMEText
 body += "\n\n#%s" % (address_routing[route_address],)

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

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

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


[MediaWiki-commits] [Gerrit] Flake8 for apt - change (operations/puppet)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Flake8 for apt
..


Flake8 for apt

Change-Id: If827f560d7b56722bd3bc0a8499e961e56d67baa
---
M modules/apt/files/apt2xml.py
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/modules/apt/files/apt2xml.py b/modules/apt/files/apt2xml.py
index 6a3ed14..d746296 100644
--- a/modules/apt/files/apt2xml.py
+++ b/modules/apt/files/apt2xml.py
@@ -19,10 +19,11 @@
 
 from socket import getfqdn
 import warnings
-warnings.filterwarnings('ignore')
 import apt
 from xml.dom.minidom import Document
 
+warnings.filterwarnings('ignore')
+
 
 # shamelessly stolen from /usr/lib/update-notifier/apt_check.py ported/modified
 def isSecurityUpgrade(candidate):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If827f560d7b56722bd3bc0a8499e961e56d67baa
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ladsgroup 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Flake8 for apt - change (operations/puppet)

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

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

Change subject: Flake8 for apt
..

Flake8 for apt

Change-Id: If827f560d7b56722bd3bc0a8499e961e56d67baa
---
M modules/apt/files/apt2xml.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/53/278753/1

diff --git a/modules/apt/files/apt2xml.py b/modules/apt/files/apt2xml.py
index 6a3ed14..d746296 100644
--- a/modules/apt/files/apt2xml.py
+++ b/modules/apt/files/apt2xml.py
@@ -19,10 +19,11 @@
 
 from socket import getfqdn
 import warnings
-warnings.filterwarnings('ignore')
 import apt
 from xml.dom.minidom import Document
 
+warnings.filterwarnings('ignore')
+
 
 # shamelessly stolen from /usr/lib/update-notifier/apt_check.py ported/modified
 def isSecurityUpgrade(candidate):

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

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

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


[MediaWiki-commits] [Gerrit] Flake8 for labstore and wdqs - change (operations/puppet)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Flake8 for labstore and wdqs
..


Flake8 for labstore and wdqs

Removed extraneous module imports.

Change-Id: Ib2edf05eef29aca6db5b100738cc906c68a1b69e
---
M modules/labstore/files/monitor/nfsd.py
M modules/wdqs/files/monitor/wdqs_updater.py
2 files changed, 0 insertions(+), 2 deletions(-)

Approvals:
  Smalyshev: Looks good to me, but someone else must approve
  Tim Landscheidt: Looks good to me, but someone else must approve
  Dereckson: Looks good to me, but someone else must approve
  Alexandros Kosiaris: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/labstore/files/monitor/nfsd.py 
b/modules/labstore/files/monitor/nfsd.py
index ec2fe52..224746e 100644
--- a/modules/labstore/files/monitor/nfsd.py
+++ b/modules/labstore/files/monitor/nfsd.py
@@ -12,7 +12,6 @@
 """
 
 import diamond.collector
-import os
 import subprocess
 
 
diff --git a/modules/wdqs/files/monitor/wdqs_updater.py 
b/modules/wdqs/files/monitor/wdqs_updater.py
index 43304ce..cf54eb6 100644
--- a/modules/wdqs/files/monitor/wdqs_updater.py
+++ b/modules/wdqs/files/monitor/wdqs_updater.py
@@ -9,7 +9,6 @@
 import urllib2
 import json
 import subprocess
-import os
 
 
 class WDQSUpdaterCollector(diamond.collector.Collector):

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib2edf05eef29aca6db5b100738cc906c68a1b69e
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ladsgroup 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: Chasemp 
Gerrit-Reviewer: Dereckson 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: Tim Landscheidt 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Citoid: Switch to the Scap3 deployment method - change (operations/puppet)

2016-03-21 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Citoid: Switch to the Scap3 deployment method
..


Citoid: Switch to the Scap3 deployment method

Bug: T116337
Change-Id: Ia713a539cb825a2fac667fe9d496fbd11e1302dc
---
M modules/citoid/manifests/init.pp
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/modules/citoid/manifests/init.pp b/modules/citoid/manifests/init.pp
index ea02198..30d3aa6 100644
--- a/modules/citoid/manifests/init.pp
+++ b/modules/citoid/manifests/init.pp
@@ -18,5 +18,6 @@
 config  => template('citoid/config.yaml.erb'),
 healthcheck_url => '',
 has_spec=> true,
+deployment  => 'scap3',
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia713a539cb825a2fac667fe9d496fbd11e1302dc
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mobrovac 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: Thcipriani 
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 DC named topics to event bus topic config - change (operations/puppet)

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

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

Change subject: Add DC named topics to event bus topic config
..

Add DC named topics to event bus topic config

Bug: T127718
Change-Id: I6885dec5286e453821a0e38c26848efbdf76e6cb
---
M modules/role/files/eventbus/topics.yaml
1 file changed, 43 insertions(+), 0 deletions(-)


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

diff --git a/modules/role/files/eventbus/topics.yaml 
b/modules/role/files/eventbus/topics.yaml
index cf09bff..eea040e 100644
--- a/modules/role/files/eventbus/topics.yaml
+++ b/modules/role/files/eventbus/topics.yaml
@@ -5,7 +5,50 @@
 # be produced to topics.
 #
 
+# Topics here are prefixd with DCs in order to differentiate
+# the source of events in aggregate Kafka clusters in each DC.
+# That is, the main (local) Kafka cluster in each DC will only have
+# the topics prefixed with that DC, whereas the aggregate clusters
+# will replicate topics from main local and main remote clusters.
+# This allows (with extra effort) consumers to balance themselves between
+# DCs.  For some backround, see:
+# - https://phabricator.wikimedia.org/T127718
+# - https://phabricator.wikimedia.org/T123954
+
+
+eqiad.mediawiki.page_delete:
+  schema_name: page_delete
+codfw.mediawiki.page_delete:
+  schema_name: page_delete
+
+eqiad.mediawiki.page_move:
+  schema_name: page_move
+codfw.mediawiki.page_move:
+  schema_name: page_move
+
+eqiad.mediawiki.page_restore:
+  schema_name: page_restore
+codfw.mediawiki.page_restore:
+  schema_name: page_restore
+
+eqiad.mediawiki.revision_visibility_set:
+  schema_name: revision_visibility_set
+codfw.mediawiki.revision_visibility_set:
+  schema_name: revision_visibility_set
+
+eqiad.mediawiki.revision_create:
+  schema_name: revision_create
+codfw.mediawiki.revision_create:
+  schema_name: revision_create
+
+eqiad.wmf.resource_change:
+  schema_name: resource_change
+codfw.wmf.resource_change:
+  schema_name: resource_change
+
 # TODO: page_edit will be deprecated in favor of revision_create.
+# TODO: Remove these non DC prefixed topic configs when
+#   Mediawiki begins producing to DC named topics.
 mediawiki.page_edit:
   schema_name: page_edit
 

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

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

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


[MediaWiki-commits] [Gerrit] Support wikis when $wgUseRCPatrol = false - change (mediawiki...ORES)

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

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

Change subject: Support wikis when $wgUseRCPatrol = false
..

Support wikis when $wgUseRCPatrol = false

In this case "r" flag sticks there forever

Bug: T130150
Change-Id: I1883f4c82a4acaa35f01caed9f622bee7ce2bc12
---
M includes/Hooks.php
1 file changed, 6 insertions(+), 2 deletions(-)


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

diff --git a/includes/Hooks.php b/includes/Hooks.php
index 9cea658..60a5ced 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -97,6 +97,7 @@
array &$query_options, array &$join_conds, FormOptions $opts
) {
global $wgUser;
+   global $wgUseRCPatrol;
if ( self::oresEnabled( $wgUser ) === false ) {
return true;
}
@@ -128,7 +129,9 @@
$conds['oresc_is_predicted'] = 1;
$conds[] = 'oresc_probability > '
. $dbr->addQuotes( $threshold );
-   $conds['rc_patrolled'] = 0;
+   if ( $wgUseRCPatrol ) {
+   $conds['rc_patrolled'] = 0;
+   }
}
 
return true;
@@ -225,6 +228,7 @@
 */
protected static function getScoreRecentChangesList( $rcObj ) {
 
+   global $wgUseRCPatrol;
$threshold = $rcObj->getAttribute( 'ores_threshold' );
if ( $threshold === null ) {
// FIXME: What is the impact of this
@@ -236,7 +240,7 @@
$score = $rcObj->getAttribute( 'oresc_probability' );
$patrolled = $rcObj->getAttribute( 'rc_patrolled' );
 
-   return $score && $score >= $threshold && !$patrolled;
+   return $score && $score >= $threshold && ( !$patrolled || 
!$wgUseRCPatrol );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1883f4c82a4acaa35f01caed9f622bee7ce2bc12
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup 

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


[MediaWiki-commits] [Gerrit] Fix varnishkafka cronspam due to non existent rsyslog action. - change (operations...varnishkafka)

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

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

Change subject: Fix varnishkafka cronspam due to non existent rsyslog action.
..

Fix varnishkafka cronspam due to non existent rsyslog action.

Bug: T129344
Change-Id: I61fec93c00ef317d57b7fa24f5d90cb2cd444d18
Signed-off-by: elukey 
---
M files/varnishkafka_logrotate
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/files/varnishkafka_logrotate b/files/varnishkafka_logrotate
index 72fef54..0465c7a 100644
--- a/files/varnishkafka_logrotate
+++ b/files/varnishkafka_logrotate
@@ -6,6 +6,6 @@
   compress
   delaycompress
   postrotate
-service rsyslog reload >/dev/null
+invoke-rc.d rsyslog rotate >/dev/null
   endscript
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61fec93c00ef317d57b7fa24f5d90cb2cd444d18
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/varnishkafka
Gerrit-Branch: master
Gerrit-Owner: Elukey 

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


[MediaWiki-commits] [Gerrit] Use msg() from Context instead of global wfMessage() - change (mediawiki...WikimediaIncubator)

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

Change subject: Use msg() from Context instead of global wfMessage()
..


Use msg() from Context instead of global wfMessage()

Change-Id: I763046e38a02c8c6907c1b0a5925acad336bbf01
---
M SpecialSearchWiki.php
M SpecialViewUserLang.php
2 files changed, 25 insertions(+), 23 deletions(-)

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



diff --git a/SpecialSearchWiki.php b/SpecialSearchWiki.php
index 355a47f..1d41c85 100644
--- a/SpecialSearchWiki.php
+++ b/SpecialSearchWiki.php
@@ -6,7 +6,7 @@
}
 
function getDescription() {
-   return wfMessage( 'wminc-searchwiki' )->plain();
+   return $this->msg( 'wminc-searchwiki' )->plain();
}
 
/**
@@ -31,15 +31,15 @@
# Show form
$uselang = $this->getRequest()->getVal( 'uselang' );
$this->getOutput()->addHTML(
-   Xml::fieldset( wfMessage( 'wminc-searchwiki' )->plain(),
+   Xml::fieldset( $this->msg( 'wminc-searchwiki' 
)->plain(),
Html::rawElement( 'form', array( 'method' => 'get', 
'action' => $wgScript, 'id' => 'wminc-searchwiki-form' ),
Html::hidden( 'title', 
SpecialPage::getTitleFor( 'SearchWiki' ) ) .
( $uselang ? Html::hidden( 'uselang', $uselang 
) : '' ) .
-   '' . Xml::label( wfMessage( 
'wminc-searchwiki-selectproject' )->text(), 'wminc-searchproject' ) .
+   '' . Xml::label( $this->msg( 
'wminc-searchwiki-selectproject' )->text(), 'wminc-searchproject' ) .
' ' . $this->makeProjectSelector( 
$projectQuery ) . '' .
-   '' . Xml::inputLabel( wfMessage( 
'wminc-searchwiki-inputlanguage' )->text(), 'searchlanguage',
+   '' . Xml::inputLabel( $this->msg( 
'wminc-searchwiki-inputlanguage' )->text(), 'searchlanguage',
'wminc-searchlanguage', 30, $languageQuery ) . 
' ' .
-   Xml::submitButton( wfMessage( 
'wminc-searchwiki-go' )->text() ) . ''
+   Xml::submitButton( $this->msg( 
'wminc-searchwiki-go' )->text() ) . ''
) )
);
 
@@ -103,10 +103,10 @@
$this->gotoWiki( $matchProject, key( $results ) );
} elseif ( count( $results ) < 1 ) {
$noresult = Html::element( 'p', array( 'class' => 
'error' ),
-   wfMessage( 'wminc-searchwiki-noresults' 
)->text() );
+   $this->msg( 'wminc-searchwiki-noresults' 
)->text() );
return $this->getOutput()->addHTML( $noresult );
} elseif ( count( $results ) > 1 ) {
-   self::showMultipleResults( $matchProject, 
$languageQuery, $results );
+   $this->showMultipleResults( $matchProject, 
$languageQuery, $results );
}
}
 
@@ -127,7 +127,7 @@
 * @param $lang String: Language code
 */
protected function goToWiki( $project, $lang ) {
-   $lang = self::getRootCode( $lang );
+   $lang = $this->getRootCode( $lang );
$dbarray = array( 'project' => $project, 'lang' => $lang, 
'error' => null );
$status = WikimediaIncubator::getDBState( $dbarray );
$infopageParams = array(
@@ -157,7 +157,7 @@
protected function showMultipleResults( $project, $languageQuery, 
$results ) {
$this->getOutput()->addHTML( '' .
Xml::element( 'p', array(),
-   wfMessage( 'wminc-searchwiki-multiplematches' 
)->text() ) .
+   $this->msg( 'wminc-searchwiki-multiplematches' 
)->text() ) .
''
);
foreach ( $results as $resultCode => $resultType ) {
@@ -166,24 +166,24 @@
WikimediaIncubator::displayPrefix( $project, 
$resultCode, true )
);
$linkInfoPage = Linker::linkKnown( $infopage,
-   wfMessage( 'wminc-searchwiki-gotoinfopage' 
)->text()
+   $this->msg( 'wminc-searchwiki-gotoinfopage' 
)->text()
);
# Give grep a chance to find the usages:
# wminc-infopage-title-p, wminc-infopage-title-b, 
wminc-infopage-title-t,
# wminc-infopage-title-q, wminc-infopage-title-n, 
wminc-infopage-title-s,
# wminc-infopage-title-v, wminc-infopage-title-y
$linkMainPage = 

[MediaWiki-commits] [Gerrit] Use HTMLForm on Special:SearchWiki - change (mediawiki...WikimediaIncubator)

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

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

Change subject: Use HTMLForm on Special:SearchWiki
..

Use HTMLForm on Special:SearchWiki

Change-Id: If0dac192be177456091c1b8482fffab61a487de4
---
M SpecialSearchWiki.php
1 file changed, 33 insertions(+), 21 deletions(-)


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

diff --git a/SpecialSearchWiki.php b/SpecialSearchWiki.php
index 0714fae..fc3ac20 100644
--- a/SpecialSearchWiki.php
+++ b/SpecialSearchWiki.php
@@ -28,20 +28,7 @@
$projectQuery = $this->getRequest()->getText( 'searchproject', 
isset( $subpage[0] ) ? $subpage[0] : '' );
$languageQuery = $this->getRequest()->getText( 
'searchlanguage', isset( $subpage[1] ) ? $subpage[1] : '' );
 
-   # Show form
-   $uselang = $this->getRequest()->getVal( 'uselang' );
-   $this->getOutput()->addHTML(
-   Xml::fieldset( wfMessage( 'wminc-searchwiki' )->plain(),
-   Html::rawElement( 'form', [ 'method' => 'get', 'action' 
=> $wgScript, 'id' => 'wminc-searchwiki-form' ],
-   Html::hidden( 'title', 
SpecialPage::getTitleFor( 'SearchWiki' ) ) .
-   ( $uselang ? Html::hidden( 'uselang', $uselang 
) : '' ) .
-   '' . Xml::label( wfMessage( 
'wminc-searchwiki-selectproject' )->text(), 'wminc-searchproject' ) .
-   ' ' . $this->makeProjectSelector( 
$projectQuery ) . '' .
-   '' . Xml::inputLabel( wfMessage( 
'wminc-searchwiki-inputlanguage' )->text(), 'searchlanguage',
-   'wminc-searchlanguage', 30, $languageQuery ) . 
' ' .
-   Xml::submitButton( wfMessage( 
'wminc-searchwiki-go' )->text() ) . ''
-   ) )
-   );
+   $this->showForm( $projectQuery, $languageQuery );
 
# Search
if ( $projectQuery || $languageQuery ) {
@@ -53,14 +40,39 @@
}
 
/**
-* Make a  box with projects (Wikipedia, Wiktionary, ...)
-* @param $selected
-* @return string
+* Output the search form.
+* @param string $project Default value for project field
+* @param string $language Default value for language field
 */
-   protected function makeProjectSelector( $selected ) {
-   $select = new XmlSelect( 'searchproject', 
'wminc-searchproject', $selected );
-   $select->addOptions( array_flip( $this->mProjects ) );
-   return $select->getHTML();
+   protected function showForm( $project, $language ) {
+   $form = HTMLForm::factory(
+   'table',
+   [
+   'Project' => [
+   'type' => 'select',
+   'name' => 'searchproject',
+   'id' => 'wminc-searchproject',
+   'options' => array_flip( 
$this->mProjects ),
+   'label-message' => 
'wminc-searchwiki-selectproject',
+   'default' => $project,
+   ],
+   'Language' => [
+   'type' => 'text',
+   'name' => 'searchlanguage',
+   'id' => 'wminc-searchlanguage',
+   'size' => 30,
+   'label-message' => 
'wminc-searchwiki-inputlanguage',
+   'default' => $language,
+   ],
+   ],
+   $this->getContext()
+   );
+   $form->setMethod( 'get' )
+   ->setWrapperLegendMsg( 'wminc-searchwiki' )
+   ->setSubmitTextMsg( 'wminc-searchwiki-go' )
+   ->setId( 'wminc-searchwiki-form' )
+   ->prepareForm()
+   ->displayForm( false );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0dac192be177456091c1b8482fffab61a487de4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaIncubator
Gerrit-Branch: master
Gerrit-Owner: Glaisher 

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


[MediaWiki-commits] [Gerrit] HDFS Namenode automatic failover support - bug fixes. - change (operations...cdh)

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

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

Change subject: HDFS Namenode automatic failover support - bug fixes.
..

HDFS Namenode automatic failover support - bug fixes.

Added documentation to the README file, resolved an issue with the
zookeeper_hosts variable.

Bug: T129838
Change-Id: I6d716e9dd526835b72f76312bb5e95488d7b458c
---
M README.md
M manifests/hadoop/namenode.pp
2 files changed, 20 insertions(+), 3 deletions(-)


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

diff --git a/README.md b/README.md
index 7b87f00..bf78384 100644
--- a/README.md
+++ b/README.md
@@ -118,8 +118,11 @@
 For detailed documentation, see the
 [CDH5 High Availability 
Guide](http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/latest/CDH5-High-Availability-Guide/cdh5hag_hdfs_ha_config.html).
 
-This puppet module only supports Quorum-based HA storage using JournalNodes.
-It does not support NFS based HA.
+This puppet module supports Quorum-based HA storage using JournalNodes and 
HDFS Namenode
+Automatic failover via Zookeeper.
+
+Namenode Automatic failover is enabled and configured automatically simply 
setting
+```zookeeper_hosts``` and configuring the JournalNodes.
 
 Your JournalNodes will be automatically configured based on the value of
 ```$cdh::hadoop::journalnode_hosts```.  When ```cdh::hadoop``` is included,
@@ -221,6 +224,9 @@
 sudo service hadoop-yarn-resourcemanager stop
 sudo service hadoop-hdfs-namenode stop
 
+# If HDFS Automatic Failover is configured for the Master node:
+sudo service hadoop-hdfs-zkfc stop
+
 # On your hadoop worker nodes:
 sudo service hadoop-hdfs-datanode stop
 sudo service hadoop-yarn-nodemanager stop
@@ -237,6 +243,9 @@
 sudo service hadoop-hdfs-namenode start
 sudo service hadoop-yarn-resourcemanager start
 
+# If HDFS Automatic Failover is configured for the Master node:
+sudo service hadoop-hdfs-zkfc start
+
 # Now that your primary NameNode is back up, and
 # JournalNodes have been initialized, bootstrap
 # your Standby NameNode(s).  Run this command
diff --git a/manifests/hadoop/namenode.pp b/manifests/hadoop/namenode.pp
index bd95758..ea0e75c 100644
--- a/manifests/hadoop/namenode.pp
+++ b/manifests/hadoop/namenode.pp
@@ -64,7 +64,15 @@
 # Create a znode in ZooKeeper inside of which the automatic failover
 # system stores its data. The command will create a znode in ZooKeeper
 # and it needs to be executed only when the znode is not present.
-$zookeeper_hosts_string = join($::cdh::hadoop::zookeper_hosts, ',')
+
+# Catch-all if the zookeeper_hosts is not an array.
+$zookeeper_hosts_string = inline_template('<%= 
Array(@zookeeper_hosts).join(",") %>')
+
+# Zookeeper client required to check znodes.
+file { '/usr/lib/zookeeper/bin/zkCli.sh':
+ensure  => present,
+}
+
 exec { 'hadoop-hdfs-zkfc-init':
 command => '/usr/bin/hdfs zkfc -formatZK',
 user=> 'hdfs',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d716e9dd526835b72f76312bb5e95488d7b458c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/cdh
Gerrit-Branch: master
Gerrit-Owner: Elukey 

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


[MediaWiki-commits] [Gerrit] Use HTMLForm in Special:ViewUserLang - change (mediawiki...WikimediaIncubator)

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

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

Change subject: Use HTMLForm in Special:ViewUserLang
..

Use HTMLForm in Special:ViewUserLang

Change-Id: I3fb44254a7e3d40832f322c8846c4b90cd6a
---
M SpecialViewUserLang.php
1 file changed, 15 insertions(+), 13 deletions(-)


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

diff --git a/SpecialViewUserLang.php b/SpecialViewUserLang.php
index 176736c..3a6f50a 100644
--- a/SpecialViewUserLang.php
+++ b/SpecialViewUserLang.php
@@ -45,20 +45,22 @@
 * @param $target Mixed: user whose language and test wiki we're about 
to look up
 */
function showForm( $target ) {
-   global $wgScript;
-
-   $this->getOutput()->addHTML(
-   Xml::fieldset( wfMessage( 'wminc-viewuserlang' 
)->plain() ) .
-   Xml::openElement( 'form', [ 'method' => 'get', 'action' 
=> $wgScript ] ) .
-   Html::hidden( 'title', 
$this->getPageTitle()->getPrefixedText() ) .
-   "" .
-   Xml::inputLabel( wfMessage( 
'wminc-viewuserlang-user' )->text(), 'target', 'viewuserlang-username', 40, 
$target ) .
-   ' ' .
-   Xml::submitButton( wfMessage( 
'wminc-viewuserlang-go' )->text() ) .
-   "" .
-   Xml::closeElement( 'form' ) .
-   Xml::closeElement( 'fieldset' )
+   $form = HTMLForm::factory( 'table', [
+   'Target' => [
+   'type' => 'user',
+   'name' => 'target',
+   'id' => 'viewuserlang-username',
+   'size' => 40,
+   'label-message' => 'wminc-viewuserlang-user',
+   'default' => $target,
+   ] ],
+   $this->getContext()
);
+   $form->setMethod( 'get' )
+   ->setWrapperLegendMsg( 'wminc-viewuserlang' )
+   ->setSubmitTextMsg( 'wminc-viewuserlang-go' )
+   ->prepareForm()
+   ->displayForm( false );
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fb44254a7e3d40832f322c8846c4b90cd6a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaIncubator
Gerrit-Branch: master
Gerrit-Owner: Glaisher 

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


[MediaWiki-commits] [Gerrit] Improved some comments - change (mediawiki...SemanticForms)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Improved some comments
..


Improved some comments

Change-Id: I153806154c339f5a90b4a1a3a9233044e6f7fa10
---
M includes/SF_FormField.php
1 file changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/includes/SF_FormField.php b/includes/SF_FormField.php
index 70bc180..aa06fe9 100644
--- a/includes/SF_FormField.php
+++ b/includes/SF_FormField.php
@@ -7,9 +7,9 @@
 
 /**
  * This class is distinct from SFTemplateField in that it represents a template
- * field defined in a form definition - it contains a SFTemplateField object
+ * field defined in a form definition - it contains an SFTemplateField object
  * within it (the $template_field variable), along with the other properties
- * for that field that are set within the form
+ * for that field that are set within the form.
  * @ingroup SF
  */
 class SFFormField {
@@ -32,7 +32,7 @@
// somewhat of a hack - these two fields are for a field in a specific
// representation of a form, not the form definition; ideally these
// should be contained in a third 'field' class, called something like
-   // SFFormInstanceField, that holds these fields plus an instance of
+   // SFFormInstanceField, which holds these fields plus an instance of
// SFFormField. Too much work?
private $mInputName;
private $mIsDisabled;
@@ -148,8 +148,8 @@
 
$field_name = trim( $tag_components[1] );
// See if this field matches one of the fields defined for this
-   // template - if it is, use all available information about
-   // that field; if it's not, either include it in the form or
+   // template - if it does, use all available information about
+   // that field; if it doesn't, either include it in the form or
// not, depending on whether the template has a 'strict'
// setting in the form definition.
$the_field = null;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I153806154c339f5a90b4a1a3a9233044e6f7fa10
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Use checkPermissions() in SpecialViewUserLang - change (mediawiki...WikimediaIncubator)

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

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

Change subject: Use checkPermissions() in SpecialViewUserLang
..

Use checkPermissions() in SpecialViewUserLang

Change-Id: I977b8e0bc444c84e993d445c0dccf2f967ce5860
---
M SpecialViewUserLang.php
1 file changed, 1 insertion(+), 5 deletions(-)


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

diff --git a/SpecialViewUserLang.php b/SpecialViewUserLang.php
index 8859614..176736c 100644
--- a/SpecialViewUserLang.php
+++ b/SpecialViewUserLang.php
@@ -29,11 +29,7 @@
 */
public function execute( $subpage ) {
$this->setHeaders();
-
-   if ( !$this->getUser()->isAllowed( 'viewuserlang' ) ) {
-   $this->displayRestrictionError();
-   return;
-   }
+   $this->checkPermissions();
 
$target = $this->getRequest()->getText( 'target', $subpage );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I977b8e0bc444c84e993d445c0dccf2f967ce5860
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaIncubator
Gerrit-Branch: master
Gerrit-Owner: Glaisher 

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


[MediaWiki-commits] [Gerrit] Improved some comments - change (mediawiki...SemanticForms)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: Improved some comments
..

Improved some comments

Change-Id: I153806154c339f5a90b4a1a3a9233044e6f7fa10
---
M includes/SF_FormField.php
1 file changed, 5 insertions(+), 5 deletions(-)


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

diff --git a/includes/SF_FormField.php b/includes/SF_FormField.php
index 70bc180..aa06fe9 100644
--- a/includes/SF_FormField.php
+++ b/includes/SF_FormField.php
@@ -7,9 +7,9 @@
 
 /**
  * This class is distinct from SFTemplateField in that it represents a template
- * field defined in a form definition - it contains a SFTemplateField object
+ * field defined in a form definition - it contains an SFTemplateField object
  * within it (the $template_field variable), along with the other properties
- * for that field that are set within the form
+ * for that field that are set within the form.
  * @ingroup SF
  */
 class SFFormField {
@@ -32,7 +32,7 @@
// somewhat of a hack - these two fields are for a field in a specific
// representation of a form, not the form definition; ideally these
// should be contained in a third 'field' class, called something like
-   // SFFormInstanceField, that holds these fields plus an instance of
+   // SFFormInstanceField, which holds these fields plus an instance of
// SFFormField. Too much work?
private $mInputName;
private $mIsDisabled;
@@ -148,8 +148,8 @@
 
$field_name = trim( $tag_components[1] );
// See if this field matches one of the fields defined for this
-   // template - if it is, use all available information about
-   // that field; if it's not, either include it in the form or
+   // template - if it does, use all available information about
+   // that field; if it doesn't, either include it in the form or
// not, depending on whether the template has a 'strict'
// setting in the form definition.
$the_field = null;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I153806154c339f5a90b4a1a3a9233044e6f7fa10
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] Update code to match current coding conventions - change (mediawiki...WikimediaIncubator)

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

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

Change subject: Update code to match current coding conventions
..

Update code to match current coding conventions

* Run phpcbf with MediaWiki standard
* Run stylize.php

Change-Id: Ib11d92561e0a574f8727b106c963496cd9208a1e
---
M CreateAccountTestWiki.php
M IncubatorUnitTests.php
M InfoPage.php
M ListUsersTestWiki.php
M SpecialIncubatorFirstSteps.php
M SpecialMyMainPage.php
M SpecialRandomByTest.php
M SpecialSearchWiki.php
M SpecialViewUserLang.php
M TestWikiRC.php
M WikimediaIncubator.alias.php
M WikimediaIncubator.class.php
M WikimediaIncubator.i18n.magic.php
M WikimediaIncubator.php
14 files changed, 155 insertions(+), 150 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaIncubator 
refs/changes/43/278743/1

diff --git a/CreateAccountTestWiki.php b/CreateAccountTestWiki.php
index 80fb213..eafb14b 100644
--- a/CreateAccountTestWiki.php
+++ b/CreateAccountTestWiki.php
@@ -23,8 +23,8 @@
$codevalue = strtolower( $wgRequest->getVal( 'testwikicode', '' 
) );
if ( WikimediaIncubator::validateLanguageCode( $codevalue ) && 
isset( $wmincProjects[$projectvalue] ) ) {
$template->set( 'header',
-   Html::hidden('testwiki-project', $projectvalue).
-   Html::hidden('testwiki-code', $codevalue)
+   Html::hidden( 'testwiki-project', $projectvalue 
) .
+   Html::hidden( 'testwiki-code', $codevalue )
);
}
return true;
diff --git a/IncubatorUnitTests.php b/IncubatorUnitTests.php
index b94489c..1f8fd6d 100644
--- a/IncubatorUnitTests.php
+++ b/IncubatorUnitTests.php
@@ -9,14 +9,14 @@
}
 
function testShouldWeShowUnprefixedError() {
-   $testPages = array(
+   $testPages = [
'Bl/urb' => true,
'Talk:Bl/urb' => true,
'Template:Bl/urb' => true,
'Wt/da/Test' => false,
'File:Blurb.png' => false,
-   );
-   foreach( $testPages as $testPage => $outcome ) {
+   ];
+   foreach ( $testPages as $testPage => $outcome ) {
$title = Title::newFromText( $testPage );
$function = $outcome ? 'assertTrue' : 'assertFalse';
$this->$function(
diff --git a/InfoPage.php b/InfoPage.php
index 9b154bd..74194cf 100644
--- a/InfoPage.php
+++ b/InfoPage.php
@@ -37,7 +37,7 @@
$this->mIsSister = array_key_exists( $this->mProjectCode, 
$wmincSisterProjects );
$this->mDBStatus = '';
$this->mSubStatus = '';
-   $this->mThisLangData = array( 'type' => 'valid' ); # For later 
code check feature
+   $this->mThisLangData = [ 'type' => 'valid' ]; # For later code 
check feature
$name = Language::fetchLanguageName( $this->mLangCode, 
$wgLang->getCode(), 'all' );
$this->mLangName = $name ? $name :
Language::fetchLanguageName( $this->mLangCode, 'en', 
'all' );
@@ -63,11 +63,11 @@
 * @param $mul Boolean
 * @return String
 */
-   public function makeLogo( $project, $clickable = true, $params = 
array(), $url = null, $lang = null, $mul = false ) {
+   public function makeLogo( $project, $clickable = true, $params = [], 
$url = null, $lang = null, $mul = false ) {
$lang = $lang ? $lang : $this->mLangCode;
if ( !$mul ) { // for non-multilingual wikis
$getDbStatus = WikimediaIncubator::getDBState(
-   array( 'error' => null, 'lang' => $lang, 
'project' => $project )
+   [ 'error' => null, 'lang' => $lang, 'project' 
=> $project ]
);
$lang = $getDbStatus == 'missing' ? 'en' : $lang;
$params['title'] = WikimediaIncubator::getProject( 
$project, true, true );
@@ -79,7 +79,7 @@
if ( $url === null ) {
$url = WikimediaIncubator::getSubdomain( 'www', 
$project );
}
-   return Html::rawElement( 'a', array( 'href' => $url ), 
$img );
+   return Html::rawElement( 'a', [ 'href' => $url ], $img 
);
}
return $img;
}
@@ -92,10 +92,10 @@
global $wmincProjects, $wmincSisterProjects;
$otherProjects = $wmincProjects + $wmincSisterProjects;
unset( $otherProjects[$this->mProjectCode] );
-   $listOtherProjects = array();
+   

[MediaWiki-commits] [Gerrit] mw.widgets.CategoryCapsuleItemWidget: Pass the right 'this' - change (mediawiki/core)

2016-03-21 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: mw.widgets.CategoryCapsuleItemWidget: Pass the right 'this'
..

mw.widgets.CategoryCapsuleItemWidget: Pass the right 'this'

Bug: T130544
Change-Id: I89c18be911bcc492f3a70e1c1da3d2fd2bf65a05
---
M resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git 
a/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js 
b/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js
index 29eaaad..5369d35 100644
--- a/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js
+++ b/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js
@@ -55,7 +55,7 @@
var title = new ForeignTitle( page.title 
).getPrefixedText();
this.existenceCache[ title ] = !page.missing;
queue[ title ].resolve( this.existenceCache[ 
title ] );
-   } );
+   }.bind( this ) );
}.bind( this ) );
};
 

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

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

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


[MediaWiki-commits] [Gerrit] Introduce the changeprop service - change (mediawiki/vagrant)

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

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

Change subject: Introduce the changeprop service
..

Introduce the changeprop service

The change-propagation service is a service listening to events emitted
to the EventBus Kafka cluster and propagating the events onto
dependencies.

Bug: T126098
Change-Id: I013b4d76a4d8047dce88d7568f1d0b90bb409c75
---
M puppet/hieradata/common.yaml
A puppet/modules/changeprop/manifests/init.pp
A puppet/modules/changeprop/templates/config.yaml.erb
M puppet/modules/role/manifests/eventbus.pp
4 files changed, 38 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/41/278741/1

diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 30c5b2e..da638fa 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -27,6 +27,8 @@
 citoid::port: 1970
 citoid::log_level: info
 
+changeprop::port: 7272
+
 contenttranslation::dir: 
"%{hiera('mediawiki::dir')}/extensions/ContentTranslation"
 contenttranslation::cxserver::dir: "%{hiera('mwv::services_dir')}/cxserver"
 contenttranslation::parsoid_url: 
"http://127.0.0.1:%{::mediawiki::parsoid::port};
diff --git a/puppet/modules/changeprop/manifests/init.pp 
b/puppet/modules/changeprop/manifests/init.pp
new file mode 100644
index 000..fe170bd
--- /dev/null
+++ b/puppet/modules/changeprop/manifests/init.pp
@@ -0,0 +1,26 @@
+# == Class: changeprop
+#
+# Change propagation is a Node.JS service reacting to messages emitted to the
+# EventBus Kafka cluster and propagating them onto declared dependencies.
+#
+# === Parameters
+#
+# [*port*]
+#   Port the service listens on for incoming connections.
+#
+# [*log_level*]
+#   The lowest level to log (trace, debug, info, warn, error, fatal)
+#
+class changeprop(
+$port,
+$log_level = undef,
+) {
+
+service::node { 'changeprop':
+port   => $port,
+log_level  => $log_level,
+git_remote => 'https://github.com/wikimedia/change-propagation.git',
+config => template('changeprop/config.yaml.erb'),
+}
+
+}
diff --git a/puppet/modules/changeprop/templates/config.yaml.erb 
b/puppet/modules/changeprop/templates/config.yaml.erb
new file mode 100644
index 000..488e9b2
--- /dev/null
+++ b/puppet/modules/changeprop/templates/config.yaml.erb
@@ -0,0 +1,9 @@
+spec:
+  title: The Change Propagation root
+  paths:
+/{domain:a}/{api:sys}/queue:
+  x-modules:
+- path: sys/kafka.js
+  options:
+uri: 127.0.0.1:2181
+templates: {}
diff --git a/puppet/modules/role/manifests/eventbus.pp 
b/puppet/modules/role/manifests/eventbus.pp
index af33012..20bbb26 100644
--- a/puppet/modules/role/manifests/eventbus.pp
+++ b/puppet/modules/role/manifests/eventbus.pp
@@ -9,6 +9,7 @@
 require ::kafka
 require ::eventlogging
 require ::eventschemas
+include ::changeprop
 
 mediawiki::extension { 'EventBus':
 priority => $::LOAD_EARLY,

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

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

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


[MediaWiki-commits] [Gerrit] RESTBase: Update config to allow web requests - change (mediawiki/vagrant)

2016-03-21 Thread Mobrovac (Code Review)
Mobrovac has submitted this change and it was merged.

Change subject: RESTBase: Update config to allow web requests
..


RESTBase: Update config to allow web requests

Change-Id: Ie436a18a8653a2ce3fd19f41b2ec9a0db8fce77b
---
M puppet/modules/restbase/templates/config.yaml.erb
1 file changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/puppet/modules/restbase/templates/config.yaml.erb 
b/puppet/modules/restbase/templates/config.yaml.erb
index f38415a..d8228ec 100644
--- a/puppet/modules/restbase/templates/config.yaml.erb
+++ b/puppet/modules/restbase/templates/config.yaml.erb
@@ -44,6 +44,12 @@
 spec:
   title: "The RESTBase root"
   # Some more general RESTBase info
+  x-sub-request-filters:
+- type: default
+  name: http
+  options:
+allow:
+  - pattern: /^https?:\/\//
   paths:
 /{domain:<%= @domain %>}: *default_project
 

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

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

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


[MediaWiki-commits] [Gerrit] RESTBase: Update config to allow web requests - change (mediawiki/vagrant)

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

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

Change subject: RESTBase: Update config to allow web requests
..

RESTBase: Update config to allow web requests

Change-Id: Ie436a18a8653a2ce3fd19f41b2ec9a0db8fce77b
---
M puppet/modules/restbase/templates/config.yaml.erb
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/puppet/modules/restbase/templates/config.yaml.erb 
b/puppet/modules/restbase/templates/config.yaml.erb
index f38415a..d8228ec 100644
--- a/puppet/modules/restbase/templates/config.yaml.erb
+++ b/puppet/modules/restbase/templates/config.yaml.erb
@@ -44,6 +44,12 @@
 spec:
   title: "The RESTBase root"
   # Some more general RESTBase info
+  x-sub-request-filters:
+- type: default
+  name: http
+  options:
+allow:
+  - pattern: /^https?:\/\//
   paths:
 /{domain:<%= @domain %>}: *default_project
 

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

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

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


[MediaWiki-commits] [Gerrit] Test do not merge - change (oojs/ui)

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

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

Change subject: Test do not merge
..

Test do not merge

Change-Id: Ibfad6d4a80845f249596729ba50e5ad06fff4d84
---
M composer.json
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/39/278739/1

diff --git a/composer.json b/composer.json
index e6caa43..541b213 100644
--- a/composer.json
+++ b/composer.json
@@ -69,13 +69,18 @@
"test": [
"parallel-lint . --exclude vendor",
"phpcs -p -s",
-   "phpunit $PHPUNIT_ARGS"
+   "phpunit $PHPUNIT_ARGS",
+   "npm test"
],
"fix": [
"phpcbf"
],
"doc": [
"doxygen"
+   ],
+   "post-update-cmd": [
+   "npm install 4.4.0",
+   "npm install"
]
}
 }

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

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

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


[MediaWiki-commits] [Gerrit] Bump $wgCacheEpoch on Wikidata after Property conversions - change (operations/mediawiki-config)

2016-03-21 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

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

Change subject: Bump $wgCacheEpoch on Wikidata after Property conversions
..

Bump $wgCacheEpoch on Wikidata after Property conversions

I just converted a batch of properties from string to external
identifier. As that changes the html output, we need to bump
the cache epoch.

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


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

diff --git a/wmf-config/Wikibase.php b/wmf-config/Wikibase.php
index 212b023..eaa6e7b 100644
--- a/wmf-config/Wikibase.php
+++ b/wmf-config/Wikibase.php
@@ -104,7 +104,7 @@
// T53637 and T48953
$wgGroupPermissions['*']['property-create'] = ( $wgDBname === 
'testwikidatawiki' );
 
-   $wgCacheEpoch = '20160223225249';
+   $wgCacheEpoch = '20160321152957';
 
$wgWBRepoSettings['dataSquidMaxage'] = 1 * 60 * 60;
$wgWBRepoSettings['sharedCacheDuration'] = 60 * 60 * 24;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibec8c487d8fa7e17585a18eb71e7f840850fcde9
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Hoo man 

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


[MediaWiki-commits] [Gerrit] Switched a DB variable to read-only - change (mediawiki...Cargo)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Switched a DB variable to read-only
..


Switched a DB variable to read-only

Change-Id: I167a56cf288f2cb91a669b56b30071c449d71e9e
---
M specials/CargoDeleteTable.php
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/specials/CargoDeleteTable.php b/specials/CargoDeleteTable.php
index e538d80..7a2c65f 100644
--- a/specials/CargoDeleteTable.php
+++ b/specials/CargoDeleteTable.php
@@ -60,8 +60,8 @@
}
 
// Make sure that this table exists.
-   $dbw = wfGetDB( DB_MASTER );
-   $res = $dbw->select( 'cargo_tables', array( 'main_table', 
'field_tables' ),
+   $dbr = wfGetDB( DB_SLAVE );
+   $res = $dbr->select( 'cargo_tables', array( 'main_table', 
'field_tables' ),
array( 'main_table' => $subpage ) );
if ( $res->numRows() == 0 ) {
$out->addHTML( CargoUtils::formatError( "Error: no 
table found named \"$subpage\"." ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I167a56cf288f2cb91a669b56b30071c449d71e9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Switched a DB variable to read-only - change (mediawiki...Cargo)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: Switched a DB variable to read-only
..

Switched a DB variable to read-only

Change-Id: I167a56cf288f2cb91a669b56b30071c449d71e9e
---
M specials/CargoDeleteTable.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/specials/CargoDeleteTable.php b/specials/CargoDeleteTable.php
index e538d80..7a2c65f 100644
--- a/specials/CargoDeleteTable.php
+++ b/specials/CargoDeleteTable.php
@@ -60,8 +60,8 @@
}
 
// Make sure that this table exists.
-   $dbw = wfGetDB( DB_MASTER );
-   $res = $dbw->select( 'cargo_tables', array( 'main_table', 
'field_tables' ),
+   $dbr = wfGetDB( DB_SLAVE );
+   $res = $dbr->select( 'cargo_tables', array( 'main_table', 
'field_tables' ),
array( 'main_table' => $subpage ) );
if ( $res->numRows() == 0 ) {
$out->addHTML( CargoUtils::formatError( "Error: no 
table found named \"$subpage\"." ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I167a56cf288f2cb91a669b56b30071c449d71e9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] Bump $wgCacheEpoch on Wikidata after Property conversions - change (operations/mediawiki-config)

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

Change subject: Bump $wgCacheEpoch on Wikidata after Property conversions
..


Bump $wgCacheEpoch on Wikidata after Property conversions

I just converted a batch of properties from string to external
identifier. As that changes the html output, we need to bump
the cache epoch.

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

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



diff --git a/wmf-config/Wikibase.php b/wmf-config/Wikibase.php
index 212b023..eaa6e7b 100644
--- a/wmf-config/Wikibase.php
+++ b/wmf-config/Wikibase.php
@@ -104,7 +104,7 @@
// T53637 and T48953
$wgGroupPermissions['*']['property-create'] = ( $wgDBname === 
'testwikidatawiki' );
 
-   $wgCacheEpoch = '20160223225249';
+   $wgCacheEpoch = '20160321152957';
 
$wgWBRepoSettings['dataSquidMaxage'] = 1 * 60 * 60;
$wgWBRepoSettings['sharedCacheDuration'] = 60 * 60 * 24;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibec8c487d8fa7e17585a18eb71e7f840850fcde9
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Hoo man 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Test do not merge - change (mediawiki...Metrolook)

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

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

Change subject: Test do not merge
..

Test do not merge

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Metrolook 
refs/changes/37/278737/1

diff --git a/package.json b/package.json
index 816ebdf..5bc57b0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "scripts": {
-"test": "grunt test"
+"test": "grunt test && php"
   },
   "devDependencies": {
 "grunt": "0.4.5",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I173b5bf2b3438fe41028f870adb55f55f92144db
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Metrolook
Gerrit-Branch: master
Gerrit-Owner: Paladox 

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


[MediaWiki-commits] [Gerrit] Removed ORES -- to be a submodule. - change (research...wheels)

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

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

Change subject: Removed ORES -- to be a submodule.
..

Removed ORES -- to be a submodule.

Change-Id: I913a449f918e045e7d3a630e27b6587dc4a3c519
---
D ores-0.6.4-py2.py3-none-any.whl
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/research/ores/wheels 
refs/changes/35/278735/1

diff --git a/ores-0.6.4-py2.py3-none-any.whl b/ores-0.6.4-py2.py3-none-any.whl
deleted file mode 100644
index 7ee0b1f..000
--- a/ores-0.6.4-py2.py3-none-any.whl
+++ /dev/null
Binary files differ

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I913a449f918e045e7d3a630e27b6587dc4a3c519
Gerrit-PatchSet: 1
Gerrit-Project: research/ores/wheels
Gerrit-Branch: master
Gerrit-Owner: Halfak 

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


[MediaWiki-commits] [Gerrit] Removed ORES -- to be a submodule. - change (research...wheels)

2016-03-21 Thread Ladsgroup (Code Review)
Ladsgroup has submitted this change and it was merged.

Change subject: Removed ORES -- to be a submodule.
..


Removed ORES -- to be a submodule.

Change-Id: I913a449f918e045e7d3a630e27b6587dc4a3c519
---
D ores-0.6.4-py2.py3-none-any.whl
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/ores-0.6.4-py2.py3-none-any.whl b/ores-0.6.4-py2.py3-none-any.whl
deleted file mode 100644
index 7ee0b1f..000
--- a/ores-0.6.4-py2.py3-none-any.whl
+++ /dev/null
Binary files differ

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I913a449f918e045e7d3a630e27b6587dc4a3c519
Gerrit-PatchSet: 1
Gerrit-Project: research/ores/wheels
Gerrit-Branch: master
Gerrit-Owner: Halfak 
Gerrit-Reviewer: Ladsgroup 

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


[MediaWiki-commits] [Gerrit] UploadBase: Set mFileSize, if given, even if mTempPath is un... - change (mediawiki/core)

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

Change subject: UploadBase: Set mFileSize, if given, even if mTempPath is 
unknown
..


UploadBase: Set mFileSize, if given, even if mTempPath is unknown

When uploading a file from stash using the action=upload API, with
async=1, UploadFromStash is initialized without initializing a temp
file. dcb5ec5cbf92b9a07f0776b9c194183a13400193 accidentally made it so
that the given file size is ignored if there's no path. This caused
validity checks to fail (because mFileSize is null) and action=upload
to also fail with cryptic 'emptyfile' warning.

This made it impossible to upload files bigger than 10 MB using
UploadWizard, as it uses the async mode for them.

Bug: T130238
Change-Id: Ie35a66a565a370fe9adc66d5fee0866c4d51470e
(cherry picked from commit 93d65f2968b76c9b7685ee2c44c5297a7a2a78a2)
---
M includes/upload/UploadBase.php
1 file changed, 4 insertions(+), 2 deletions(-)

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



diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php
index fb25249..9d7b294 100644
--- a/includes/upload/UploadBase.php
+++ b/includes/upload/UploadBase.php
@@ -241,12 +241,14 @@
 */
protected function setTempFile( $tempPath, $fileSize = null ) {
$this->mTempPath = $tempPath;
+   $this->mFileSize = $fileSize ?: null;
if ( strlen( $this->mTempPath ) && file_exists( 
$this->mTempPath ) ) {
$this->tempFileObj = new TempFSFile( $this->mTempPath );
-   $this->mFileSize = $fileSize ?: filesize( 
$this->mTempPath );
+   if ( !$fileSize ) {
+   $this->mFileSize = filesize( $this->mTempPath );
+   }
} else {
$this->tempFileObj = null;
-   $this->mFileSize = null;
}
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie35a66a565a370fe9adc66d5fee0866c4d51470e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.17
Gerrit-Owner: Bartosz Dziewoński 
Gerrit-Reviewer: Aaron Schulz 
Gerrit-Reviewer: Thcipriani 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Fix exception on jquery ui slider update - change (mediawiki...TimedMediaHandler)

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

Change subject: Fix exception on jquery ui slider update
..


Fix exception on jquery ui slider update

The jquery ui slider implementation uses $.data to check if the
element is initialized, but this data is cleaned up when the slider
is removed from the dom. The playhead is updated after the slider is
removed from the dom however.

Bug: T126234
Change-Id: Ib3439b405e196dce73e82253832115d153e3eb78
---
M MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js 
b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
index 131302a..441f4f2 100644
--- a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
+++ b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedPlayer.js
@@ -2644,7 +2644,7 @@
//mw.log( 'EmbedPlayer: updatePlayHead: '+ perc);
if( this.getInterface() ){
var $playHead = this.getInterface().find( 
'.play_head' );
-   if ( !this.useNativePlayerControls() && 
$playHead.length != 0 ) {
+   if ( !this.useNativePlayerControls() && 
$playHead.length != 0, $.contains( document, $playHead[0] ) ) {
var val = parseInt( perc * 1000 );
$playHead.slider( 'value', val );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3439b405e196dce73e82253832115d153e3eb78
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 
Gerrit-Reviewer: Bartosz Dziewoński 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Provide license label and other tweaks - change (mediawiki...Arrays)

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

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

Change subject: Provide license label and other tweaks
..

Provide license label and other tweaks

* Add license label to show on "Special:Version"
* Updated link to source code
* Go https

Bug: T123943
Change-Id: I4bef561eb767764afc8625585e5b713ea730773a
---
M Arrays.php
1 file changed, 9 insertions(+), 4 deletions(-)


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

diff --git a/Arrays.php b/Arrays.php
index c4a2565..4465da4 100644
--- a/Arrays.php
+++ b/Arrays.php
@@ -3,9 +3,9 @@
 /**
  * Initialization file for the 'Arrays' (former 'ArrayExtension') extension.
  *
- * Documentation: http://www.mediawiki.org/wiki/Extension:Arrays
- * Support:   http://www.mediawiki.org/wiki/Extension_talk:Arrays
- * Source code:   
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Arrays
+ * Documentation: https://www.mediawiki.org/wiki/Extension:Arrays
+ * Support:   https://www.mediawiki.org/wiki/Extension_talk:Arrays
+ * Source code:   
https://git.wikimedia.org/summary/mediawiki%2Fextensions%2FArrays
  *
  * @file
  * @ingroup Arrays
@@ -24,8 +24,13 @@
'path'   => __FILE__,
'name'   => 'Arrays',
'url'=> 'https://www.mediawiki.org/wiki/Extension:Arrays',
-   'author' => array ( 'Li Ding', 'Jie Bao', 
'[http://www.mediawiki.org/wiki/User:Danwe Daniel Werner]' ),
+   'author' => array(
+   'Li Ding',
+   'Jie Bao',
+   '[https://www.mediawiki.org/wiki/User:Danwe Daniel Werner]'
+   ),
'descriptionmsg' => 'arrays-desc',
+   'license-name'   => 'MIT',
'version'=> ExtArrays::VERSION
 );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4bef561eb767764afc8625585e5b713ea730773a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Arrays
Gerrit-Branch: master
Gerrit-Owner: Kghbln 

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


[MediaWiki-commits] [Gerrit] Upgrade to latest UA-Parser version - change (analytics...source)

2016-03-21 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged.

Change subject: Upgrade to latest UA-Parser version
..


Upgrade to latest UA-Parser version

This patch upgrades refinery source to use the latest version of
UA-Parser (1.3.0-wmf3) - this update includes some upgrades to uap-core
yaml definitions and bug fixes to uap-java. Tests that break in refinery-
source due to the upgrade are also fixed - the breaking tests were due
to the new ua-parser differentiating between Mobile Safari in iOS and
Mobile Safari UIWebview in iOS apps.

Bug: T130399
Change-Id: I83d2686037b7db9d2ba2130cb7468a7c3c8e40e8
---
M pom.xml
M 
refinery-core/src/test/java/org/wikimedia/analytics/refinery/core/TestUAParserUserAgentRecognition.java
M 
refinery-hive/src/test/java/org/wikimedia/analytics/refinery/hive/TestUAParserUDFUserAgentRecognition.java
3 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Mforns: Looks good to me, but someone else must approve
  Ottomata: Verified; Looks good to me, approved



diff --git a/pom.xml b/pom.xml
index 296bfa6..f4f73f9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -133,7 +133,7 @@
   
   ua_parser
   ua-parser
-  1.3.0-wmf2
+  1.3.0-wmf3
   
 
   
diff --git 
a/refinery-core/src/test/java/org/wikimedia/analytics/refinery/core/TestUAParserUserAgentRecognition.java
 
b/refinery-core/src/test/java/org/wikimedia/analytics/refinery/core/TestUAParserUserAgentRecognition.java
index 9dd76dc..5dbfeb8 100644
--- 
a/refinery-core/src/test/java/org/wikimedia/analytics/refinery/core/TestUAParserUserAgentRecognition.java
+++ 
b/refinery-core/src/test/java/org/wikimedia/analytics/refinery/core/TestUAParserUserAgentRecognition.java
@@ -55,7 +55,7 @@
 assertEquals("OS name check", (new String("iOS")),
 evaled.get("os_family").toString());
 
-assertEquals("Browser name check", (new String("Mobile Safari")),
+assertEquals("Browser name check", (new String("Mobile Safari 
UIWebView")),
 evaled.get("browser_family").toString());
 
 
diff --git 
a/refinery-hive/src/test/java/org/wikimedia/analytics/refinery/hive/TestUAParserUDFUserAgentRecognition.java
 
b/refinery-hive/src/test/java/org/wikimedia/analytics/refinery/hive/TestUAParserUDFUserAgentRecognition.java
index 76a387c..7947096 100644
--- 
a/refinery-hive/src/test/java/org/wikimedia/analytics/refinery/hive/TestUAParserUDFUserAgentRecognition.java
+++ 
b/refinery-hive/src/test/java/org/wikimedia/analytics/refinery/hive/TestUAParserUDFUserAgentRecognition.java
@@ -65,7 +65,7 @@
 assertEquals("OS name check", (new String("iOS")),
 evaled.get("os_family").toString());
 
-assertEquals("Browser name check", (new String("Mobile Safari")),
+assertEquals("Browser name check", (new String("Mobile Safari 
UIWebView")),
 evaled.get("browser_family").toString());
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I83d2686037b7db9d2ba2130cb7468a7c3c8e40e8
Gerrit-PatchSet: 2
Gerrit-Project: analytics/refinery/source
Gerrit-Branch: master
Gerrit-Owner: Madhuvishy 
Gerrit-Reviewer: Joal 
Gerrit-Reviewer: Mforns 
Gerrit-Reviewer: Ottomata 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Update mediawiki/event-schemas submodule - change (analytics...source)

2016-03-21 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged.

Change subject: Update mediawiki/event-schemas submodule
..


Update mediawiki/event-schemas submodule

Update mediawiki/event-schemas submodule to include 3dd6ee3 "Rename
ApiRequest to ApiAction".

Bug: T108618
Change-Id: I8d0886f22472c06e9f51fa64e355fdf80c27d36f
---
M refinery-camus/src/main/resources/schema_repo
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/refinery-camus/src/main/resources/schema_repo 
b/refinery-camus/src/main/resources/schema_repo
index c9456af..3dd6ee3 16
--- a/refinery-camus/src/main/resources/schema_repo
+++ b/refinery-camus/src/main/resources/schema_repo
-Subproject commit c9456af43d26a6e20df958530bed68b99898ad7d
+Subproject commit 3dd6ee3860838ae319ca3c29b63aa979211799a1

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8d0886f22472c06e9f51fa64e355fdf80c27d36f
Gerrit-PatchSet: 1
Gerrit-Project: analytics/refinery/source
Gerrit-Branch: master
Gerrit-Owner: BryanDavis 
Gerrit-Reviewer: Joal 
Gerrit-Reviewer: Nuria 
Gerrit-Reviewer: Ottomata 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Allow decoupling of npm-node-4.3 - change (integration/config)

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

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

Change subject: Allow decoupling of npm-node-4.3
..

Allow decoupling of npm-node-4.3

Zuul puts projects in the same merge queue whenever they are sharing a
job. In lot of cases that is really unwanted.

A challenge was to find a way to avoid repeating ourselves between the
generic and variadic job templates.  I did an experment using YAML
merging on https://gerrit.wikimedia.org/r/#/c/243164/ which seems
successful.

Mark 'npm-node-4.3' with a YAML alias.
Create job template '{name}-npm-node-4.3' that merges in the job.
Override the 'name' variable in the template definition.
Reapply 'triggers: - zuul' since JJB strips it in this corner case
usage.

This trick avoid duplication and let us define more specific jobs. Do so
for the wikimedia/portals repository which only triggers npm job and
asked to be decoupled (T129591)

Expand the Zuul project template. We cant pass the full project name
yet, will be possible later with Zuul patch:
  https://review.openstack.org/295237
  Provide 'longname' to project templates

Bug: T107529
Bug: T129591
Change-Id: I66b2a86f506bef757fa9a90ee51f9746a474a79d
---
M jjb/job-templates.yaml
A jjb/wikimedia.yaml
M zuul/layout.yaml
3 files changed, 16 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/33/278733/1

diff --git a/jjb/job-templates.yaml b/jjb/job-templates.yaml
index f316877..cfd12af 100644
--- a/jjb/job-templates.yaml
+++ b/jjb/job-templates.yaml
@@ -99,7 +99,7 @@
 publishers:
  - global-teardown
 
-- job:
+- job: _npm-node-4_3
 name: 'npm-node-4.3'
 node: ci-jessie-wikimedia
 defaults: use-remote-zuul-shallow-clone
@@ -124,6 +124,13 @@
  - archive-log-allow-empty
  - castor-save
 
+- job-template:
+!!merge : *job_npm-node-4_3
+name: '{name}-npm-node-4.3'
+# Reinject Zuul parameters since JJB strip for some reason
+triggers:
+ - zuul
+
 - job:
 name: 'npm-run-doc'
 node: contintLabsSlave && UbuntuTrusty
diff --git a/jjb/wikimedia.yaml b/jjb/wikimedia.yaml
new file mode 100644
index 000..f01d5cb
--- /dev/null
+++ b/jjb/wikimedia.yaml
@@ -0,0 +1,4 @@
+- project:
+name: wikimedia-portals
+jobs:
+- '{name}-npm-node-4.3'
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 0b30cc4..163255c 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -7856,8 +7856,10 @@
   - phpunit-coverage-publish
 
   - name: wikimedia/portals
-template:
-  - name: npm-node-4.3
+test:
+  - wikimedia-portals-npm-node-4.3
+gate-and-submit:
+  - wikimedia-portals-npm-node-4.3
 
   - name: search/extra
 test:

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

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

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


[MediaWiki-commits] [Gerrit] Allow decoupling of npm-node-4.3 - change (integration/config)

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

Change subject: Allow decoupling of npm-node-4.3
..


Allow decoupling of npm-node-4.3

Zuul puts projects in the same merge queue whenever they are sharing a
job. In lot of cases that is really unwanted.

A challenge was to find a way to avoid repeating ourselves between the
generic and variadic job templates.  I did an experment using YAML
merging on https://gerrit.wikimedia.org/r/#/c/243164/ which seems
successful.

Mark 'npm-node-4.3' with a YAML alias.
Create job template '{name}-npm-node-4.3' that merges in the job.
Override the 'name' variable in the template definition.
Reapply 'triggers: - zuul' since JJB strips it in this corner case
usage.

This trick avoid duplication and let us define more specific jobs. Do so
for the wikimedia/portals repository which only triggers npm job and
asked to be decoupled (T129591)

Expand the Zuul project template. We cant pass the full project name
yet, will be possible later with Zuul patch:
  https://review.openstack.org/295237
  Provide 'longname' to project templates

Bug: T107529
Bug: T129591
Change-Id: I66b2a86f506bef757fa9a90ee51f9746a474a79d
---
M jjb/job-templates.yaml
A jjb/wikimedia.yaml
M zuul/layout.yaml
3 files changed, 16 insertions(+), 3 deletions(-)

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



diff --git a/jjb/job-templates.yaml b/jjb/job-templates.yaml
index f316877..cfd12af 100644
--- a/jjb/job-templates.yaml
+++ b/jjb/job-templates.yaml
@@ -99,7 +99,7 @@
 publishers:
  - global-teardown
 
-- job:
+- job: _npm-node-4_3
 name: 'npm-node-4.3'
 node: ci-jessie-wikimedia
 defaults: use-remote-zuul-shallow-clone
@@ -124,6 +124,13 @@
  - archive-log-allow-empty
  - castor-save
 
+- job-template:
+!!merge : *job_npm-node-4_3
+name: '{name}-npm-node-4.3'
+# Reinject Zuul parameters since JJB strip for some reason
+triggers:
+ - zuul
+
 - job:
 name: 'npm-run-doc'
 node: contintLabsSlave && UbuntuTrusty
diff --git a/jjb/wikimedia.yaml b/jjb/wikimedia.yaml
new file mode 100644
index 000..f01d5cb
--- /dev/null
+++ b/jjb/wikimedia.yaml
@@ -0,0 +1,4 @@
+- project:
+name: wikimedia-portals
+jobs:
+- '{name}-npm-node-4.3'
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 0b30cc4..163255c 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -7856,8 +7856,10 @@
   - phpunit-coverage-publish
 
   - name: wikimedia/portals
-template:
-  - name: npm-node-4.3
+test:
+  - wikimedia-portals-npm-node-4.3
+gate-and-submit:
+  - wikimedia-portals-npm-node-4.3
 
   - name: search/extra
 test:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I66b2a86f506bef757fa9a90ee51f9746a474a79d
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Added "delete" option for setCargoPageData.php - change (mediawiki...Cargo)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: Added "delete" option for setCargoPageData.php
..

Added "delete" option for setCargoPageData.php

Change-Id: I76a5b625dbf235b1f514e39f02350b35b8cd2aed
---
M maintenance/setCargoPageData.php
1 file changed, 12 insertions(+), 1 deletion(-)


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

diff --git a/maintenance/setCargoPageData.php b/maintenance/setCargoPageData.php
index 31ad4f1..eebf5b3 100644
--- a/maintenance/setCargoPageData.php
+++ b/maintenance/setCargoPageData.php
@@ -5,7 +5,7 @@
  * auxiliary tables) for all pages in the wiki.
  *
  * Usage:
- *  no parameters
+ *  php setCargoPageData.php --delete
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@
parent::__construct();
 
$this->mDescription = "Stores a set of data each page in the 
wiki in one or more database tables, for use within Cargo queries.";
+
+   $this->addOption( "delete", "Delete the page data DB table(s)", 
false, false );
}
 
public function execute() {
@@ -52,6 +54,15 @@
CargoDeleteCargoTable::deleteTable( '_pageData', 
$fieldTables );
}
 
+   if ( $this->getOption( "delete" ) ) {
+   if ( $numRows > 0 ) {
+   $this->output( "\n Deleted page data 
table(s).\n" );
+   } else {
+   $this->output( "\n No page data tables found; 
exiting.\n" );
+   }
+   return;
+   }
+
$tableSchema = CargoPageData::getTableSchema();
$tableSchemaString = $tableSchema->toDBString();
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76a5b625dbf235b1f514e39f02350b35b8cd2aed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] Added "delete" option for setCargoPageData.php - change (mediawiki...Cargo)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Added "delete" option for setCargoPageData.php
..


Added "delete" option for setCargoPageData.php

Change-Id: I76a5b625dbf235b1f514e39f02350b35b8cd2aed
---
M maintenance/setCargoPageData.php
1 file changed, 12 insertions(+), 1 deletion(-)

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



diff --git a/maintenance/setCargoPageData.php b/maintenance/setCargoPageData.php
index 31ad4f1..eebf5b3 100644
--- a/maintenance/setCargoPageData.php
+++ b/maintenance/setCargoPageData.php
@@ -5,7 +5,7 @@
  * auxiliary tables) for all pages in the wiki.
  *
  * Usage:
- *  no parameters
+ *  php setCargoPageData.php --delete
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@
parent::__construct();
 
$this->mDescription = "Stores a set of data each page in the 
wiki in one or more database tables, for use within Cargo queries.";
+
+   $this->addOption( "delete", "Delete the page data DB table(s)", 
false, false );
}
 
public function execute() {
@@ -52,6 +54,15 @@
CargoDeleteCargoTable::deleteTable( '_pageData', 
$fieldTables );
}
 
+   if ( $this->getOption( "delete" ) ) {
+   if ( $numRows > 0 ) {
+   $this->output( "\n Deleted page data 
table(s).\n" );
+   } else {
+   $this->output( "\n No page data tables found; 
exiting.\n" );
+   }
+   return;
+   }
+
$tableSchema = CargoPageData::getTableSchema();
$tableSchemaString = $tableSchema->toDBString();
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I76a5b625dbf235b1f514e39f02350b35b8cd2aed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Thumbor needs the format filter - change (mediawiki/vagrant)

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

Change subject: Thumbor needs the format filter
..


Thumbor needs the format filter

For formats that require a target format other than the default, like
SVG, the custom router uses the format filter to tell the engine what
to produce.

Change-Id: Ia330e90fd50f7aa966fbfda4327f0adaa3ec5d51
---
M puppet/modules/thumbor/templates/thumbor.conf.erb
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/puppet/modules/thumbor/templates/thumbor.conf.erb 
b/puppet/modules/thumbor/templates/thumbor.conf.erb
index fde8cf3..249aef3 100644
--- a/puppet/modules/thumbor/templates/thumbor.conf.erb
+++ b/puppet/modules/thumbor/templates/thumbor.conf.erb
@@ -457,6 +457,7 @@
 FILTERS = [
 'wikimedia_thumbor.filter.conditional_sharpen',
 'wikimedia_thumbor.filter.page',
+'thumbor.filters.format',
 'thumbor.filters.quality'
 ]
 

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

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

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


[MediaWiki-commits] [Gerrit] Increase number of map tasks for camus webrequest to 72 - change (operations/puppet)

2016-03-21 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged.

Change subject: Increase number of map tasks for camus webrequest to 72
..


Increase number of map tasks for camus webrequest to 72

Bug: T127351
Change-Id: I53ca51cea69c6c32c4d6b7cc2aef57abc42fa60a
---
M modules/camus/templates/webrequest.erb
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Ottomata: Verified; Looks good to me, approved
  Joal: Looks good to me, but someone else must approve



diff --git a/modules/camus/templates/webrequest.erb 
b/modules/camus/templates/webrequest.erb
index 5258823..5c87a03 100644
--- a/modules/camus/templates/webrequest.erb
+++ b/modules/camus/templates/webrequest.erb
@@ -44,9 +44,9 @@
 
etl.record.writer.provider.class=com.linkedin.camus.etl.kafka.common.SequenceFileRecordWriterProvider
 
 # Max hadoop tasks to use, each task can pull multiple topic partitions.
-# Currently 5 topics, each with 12 partitions.  Setting
-# map.tasks to 5*12.
-mapred.map.tasks=60
+# Currently 4 topics, 2 with 24 partitions, 2 with 12.
+# 2 * 24 + 2 * 12 == 72
+mapred.map.tasks=72
 
 # Connection parameters.
 kafka.brokers=<%= Array(@kafka_brokers).join(',') %>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I53ca51cea69c6c32c4d6b7cc2aef57abc42fa60a
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata 
Gerrit-Reviewer: Joal 
Gerrit-Reviewer: Ottomata 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Thumbor needs the format filter - change (mediawiki/vagrant)

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

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

Change subject: Thumbor needs the format filter
..

Thumbor needs the format filter

For formats that require a target format other than the default, like
SVG, the custom router uses the format filter to tell the engine what
to produce.

Change-Id: Ia330e90fd50f7aa966fbfda4327f0adaa3ec5d51
---
M puppet/modules/thumbor/templates/thumbor.conf.erb
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/31/278731/1

diff --git a/puppet/modules/thumbor/templates/thumbor.conf.erb 
b/puppet/modules/thumbor/templates/thumbor.conf.erb
index fde8cf3..249aef3 100644
--- a/puppet/modules/thumbor/templates/thumbor.conf.erb
+++ b/puppet/modules/thumbor/templates/thumbor.conf.erb
@@ -457,6 +457,7 @@
 FILTERS = [
 'wikimedia_thumbor.filter.conditional_sharpen',
 'wikimedia_thumbor.filter.page',
+'thumbor.filters.format',
 'thumbor.filters.quality'
 ]
 

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

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

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


[MediaWiki-commits] [Gerrit] Removed "input type" field from SFTemplateField class - change (mediawiki...SemanticForms)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Removed "input type" field from SFTemplateField class
..


Removed "input type" field from SFTemplateField class

Change-Id: I74736f9461d6b31762fe1707f1cea778aa63aee7
---
M includes/SF_FormField.php
M includes/SF_TemplateField.php
M specials/SF_CreateForm.php
3 files changed, 5 insertions(+), 19 deletions(-)

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



diff --git a/includes/SF_FormField.php b/includes/SF_FormField.php
index 1130aa6..70bc180 100644
--- a/includes/SF_FormField.php
+++ b/includes/SF_FormField.php
@@ -634,15 +634,10 @@
 
if ( ! $part_of_multiple ) { $text .= "| "; }
$text .= "{{{field|" . $this->template_field->getFieldName();
-   // TODO - why is there an input type field in both the form
-   // field and the template field? One of them should probably
-   // be removed.
if ( $this->mIsHidden ) {
$text .= "|hidden";
} elseif ( !is_null( $this->getInputType() ) ) {
$text .= "|input type=" . $this->getInputType();
-   } elseif ( $this->template_field->getInputType() != '' ) {
-   $text .= "|input type=" . 
$this->template_field->getInputType();
}
foreach ( $this->mFieldArgs as $arg => $value ) {
if ( $value === true ) {
diff --git a/includes/SF_TemplateField.php b/includes/SF_TemplateField.php
index 63f7b89..de9dc52 100644
--- a/includes/SF_TemplateField.php
+++ b/includes/SF_TemplateField.php
@@ -27,7 +27,6 @@
private $mIsList;
private $mDelimiter;
private $mDisplay;
-   private $mInputType;
private $mNamespace;
 
static function create( $name, $label, $semanticProperty = null, 
$isList = null, $delimiter = null, $display = null ) {
@@ -191,10 +190,6 @@
return $this->mDisplay;
}
 
-   function getInputType() {
-   return $this->mInputType;
-   }
-
function getNamespace() {
return $this->mNamespace;
}
@@ -205,10 +200,6 @@
 
function setLabel( $label ) {
$this->mLabel = $label;
-   }
-
-   function setInputType( $inputType ) {
-   $this->mInputType = $inputType;
}
 
function setNamespace( $namespace ) {
diff --git a/specials/SF_CreateForm.php b/specials/SF_CreateForm.php
index ef81d28..3409c9a 100644
--- a/specials/SF_CreateForm.php
+++ b/specials/SF_CreateForm.php
@@ -200,13 +200,13 @@
} elseif ( $paramName == 'input 
type' ) {
$input_type = 
$req->getVal( "input_type_" . $old_i . "_" . $j );
if ( $input_type == 
'hidden' ) {
-   
$field->template_field->setInputType( $input_type );
+   
$field->setInputType( $input_type );

$field->setIsHidden( true );
} elseif ( substr( 
$input_type, 0, 1 ) == '.' ) {
// It's the 
default input type -
// don't do 
anything.
} else {
-   
$field->template_field->setInputType( $input_type );
+   
$field->setInputType( $input_type );
}
} else {
if ( ! empty( $value ) 
) {
@@ -533,10 +533,10 @@
$default_input_type = null;
$possible_input_types = 
$sfgFormPrinter->getAllInputTypes();
}
-   $text .= $this->inputTypeDropdownHTML( $field_form_text, 
$default_input_type, $possible_input_types, $template_field->getInputType() );
+   $text .= $this->inputTypeDropdownHTML( $field_form_text, 
$default_input_type, $possible_input_types, $field->getInputType() );
 
-   if ( !is_null( $template_field->getInputType() ) ) {
-   $cur_input_type = $template_field->getInputType();
+   if ( !is_null( $field->getInputType() ) ) {
+   $cur_input_type = $field->getInputType();
} elseif ( !is_null( $default_input_type ) ) {
$cur_input_type = 

[MediaWiki-commits] [Gerrit] Removed "input type" field from SFTemplateField class - change (mediawiki...SemanticForms)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: Removed "input type" field from SFTemplateField class
..

Removed "input type" field from SFTemplateField class

Change-Id: I74736f9461d6b31762fe1707f1cea778aa63aee7
---
M includes/SF_FormField.php
M includes/SF_TemplateField.php
M specials/SF_CreateForm.php
3 files changed, 5 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/30/278730/1

diff --git a/includes/SF_FormField.php b/includes/SF_FormField.php
index 1130aa6..70bc180 100644
--- a/includes/SF_FormField.php
+++ b/includes/SF_FormField.php
@@ -634,15 +634,10 @@
 
if ( ! $part_of_multiple ) { $text .= "| "; }
$text .= "{{{field|" . $this->template_field->getFieldName();
-   // TODO - why is there an input type field in both the form
-   // field and the template field? One of them should probably
-   // be removed.
if ( $this->mIsHidden ) {
$text .= "|hidden";
} elseif ( !is_null( $this->getInputType() ) ) {
$text .= "|input type=" . $this->getInputType();
-   } elseif ( $this->template_field->getInputType() != '' ) {
-   $text .= "|input type=" . 
$this->template_field->getInputType();
}
foreach ( $this->mFieldArgs as $arg => $value ) {
if ( $value === true ) {
diff --git a/includes/SF_TemplateField.php b/includes/SF_TemplateField.php
index 63f7b89..de9dc52 100644
--- a/includes/SF_TemplateField.php
+++ b/includes/SF_TemplateField.php
@@ -27,7 +27,6 @@
private $mIsList;
private $mDelimiter;
private $mDisplay;
-   private $mInputType;
private $mNamespace;
 
static function create( $name, $label, $semanticProperty = null, 
$isList = null, $delimiter = null, $display = null ) {
@@ -191,10 +190,6 @@
return $this->mDisplay;
}
 
-   function getInputType() {
-   return $this->mInputType;
-   }
-
function getNamespace() {
return $this->mNamespace;
}
@@ -205,10 +200,6 @@
 
function setLabel( $label ) {
$this->mLabel = $label;
-   }
-
-   function setInputType( $inputType ) {
-   $this->mInputType = $inputType;
}
 
function setNamespace( $namespace ) {
diff --git a/specials/SF_CreateForm.php b/specials/SF_CreateForm.php
index ef81d28..3409c9a 100644
--- a/specials/SF_CreateForm.php
+++ b/specials/SF_CreateForm.php
@@ -200,13 +200,13 @@
} elseif ( $paramName == 'input 
type' ) {
$input_type = 
$req->getVal( "input_type_" . $old_i . "_" . $j );
if ( $input_type == 
'hidden' ) {
-   
$field->template_field->setInputType( $input_type );
+   
$field->setInputType( $input_type );

$field->setIsHidden( true );
} elseif ( substr( 
$input_type, 0, 1 ) == '.' ) {
// It's the 
default input type -
// don't do 
anything.
} else {
-   
$field->template_field->setInputType( $input_type );
+   
$field->setInputType( $input_type );
}
} else {
if ( ! empty( $value ) 
) {
@@ -533,10 +533,10 @@
$default_input_type = null;
$possible_input_types = 
$sfgFormPrinter->getAllInputTypes();
}
-   $text .= $this->inputTypeDropdownHTML( $field_form_text, 
$default_input_type, $possible_input_types, $template_field->getInputType() );
+   $text .= $this->inputTypeDropdownHTML( $field_form_text, 
$default_input_type, $possible_input_types, $field->getInputType() );
 
-   if ( !is_null( $template_field->getInputType() ) ) {
-   $cur_input_type = $template_field->getInputType();
+   if ( !is_null( $field->getInputType() ) ) {
+   $cur_input_type = $field->getInputType();
} elseif ( !is_null( $default_input_type ) ) {
   

[MediaWiki-commits] [Gerrit] Don't parse URL to manipulate query parameters - change (mediawiki...MobileFrontend)

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

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

Change subject: Don't parse URL to manipulate query parameters
..

Don't parse URL to manipulate query parameters

... in MobileContext::doToggling.

If the current request is a FauxRequest, then an exception is thrown
when trying to access the request URL via FauxRequest#getFullRequestURL
or #getRequestURL. While this is a violation of Liskov's Substitution
Principle, which should be addressed, it's also true that
MobileContext::doToggling shouldn't need to parse the current URL in
order to manipulate its query parameters in order to redirect the UA.

Include @jdlrobson's follow-on change, which makes the desktop to mobile
to desktop view switching integration tests only run in the integration
environment [0].

[0]: I3c1b2eade8adf38ebf27660a436e2df43cd3e09d

Bug: T129600
Change-Id: I0a10706f31966f2ac9f5c1056b3cbebd70788478
Co-Author: jdlrobson 
---
M includes/MobileContext.php
A tests/browser/features/step_definitions/switch_views.rb
A tests/browser/features/step_definitions/switch_views_bug_t129600.rb
A tests/browser/features/support/pages/page.rb
A tests/browser/features/switch_views.feature
5 files changed, 56 insertions(+), 3 deletions(-)


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

diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index d972cd3..6c7c134 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -963,9 +963,7 @@
return;
}
 
-   $url = $this->getRequest()->getFullRequestURL();
-   $parsed = wfParseUrl( $url );
-   $query = isset( $parsed['query'] ) ? wfCgiToArray( 
$parsed['query'] ) : array();
+   $query = $this->getRequest()->getQueryValues();
unset( $query['mobileaction'] );
unset( $query['useformat'] );
unset( $query['title'] );
diff --git a/tests/browser/features/step_definitions/switch_views.rb 
b/tests/browser/features/step_definitions/switch_views.rb
new file mode 100644
index 000..5f289dc
--- /dev/null
+++ b/tests/browser/features/step_definitions/switch_views.rb
@@ -0,0 +1,15 @@
+Given(/^I toggle the mobile view$/) do
+  on(Page).toggle_mobile_view
+end
+
+Then(/^I should see the mobile view$/) do
+  expect(on(Page).toggle_view_desktop_element).to be_visible
+end
+
+Given(/^I toggle the desktop view$/) do
+  on(Page).toggle_desktop_view
+end
+
+Then(/^I should see the desktop view$/) do
+  expect(on(Page).toggle_view_mobile_element).to be_visible
+end
diff --git 
a/tests/browser/features/step_definitions/switch_views_bug_t129600.rb 
b/tests/browser/features/step_definitions/switch_views_bug_t129600.rb
new file mode 100644
index 000..9fb87a6
--- /dev/null
+++ b/tests/browser/features/step_definitions/switch_views_bug_t129600.rb
@@ -0,0 +1,5 @@
+Given(/^I am on a page that transcludes content from a special page$/) do
+  api.create_page 'T129600', '{{Special:PrefixIndex/User:Admin/}}'
+
+  step 'I am on the "T129600" page'
+end
diff --git a/tests/browser/features/support/pages/page.rb 
b/tests/browser/features/support/pages/page.rb
new file mode 100644
index 000..8dc9a6c
--- /dev/null
+++ b/tests/browser/features/support/pages/page.rb
@@ -0,0 +1,14 @@
+class Page
+  include PageObject
+
+  a(:toggle_view_mobile, css: '.stopMobileRedirectToggle')
+  a(:toggle_view_desktop, id: 'mw-mf-display-toggle')
+
+  def toggle_mobile_view
+toggle_view_mobile_element.click
+  end
+
+  def toggle_desktop_view
+toggle_view_desktop_element.click
+  end
+end
diff --git a/tests/browser/features/switch_views.feature 
b/tests/browser/features/switch_views.feature
new file mode 100644
index 000..bb4dc4d
--- /dev/null
+++ b/tests/browser/features/switch_views.feature
@@ -0,0 +1,21 @@
+@chrome @firefox @vagrant
+Feature: Switch between mobile and desktop views
+
+  @integration
+  Scenario: Switching from desktop view to mobile view
+Given I am on the "Main Page" page
+And I toggle the mobile view
+Then I should see the mobile view
+
+  @integration
+  Scenario: Switching from mobile view to desktop view
+Given I am using the mobile site
+And I am on the "Main Page" page
+And I toggle the desktop view
+Then I should see the desktop view
+
+  Scenario: Bug: T129600
+Given I am on the desktop site
+And I am on a page that transcludes content from a special page
+And I toggle the mobile view
+Then I should see the mobile view

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

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

[MediaWiki-commits] [Gerrit] New Wikdiata build - 2016-03-21 - change (mediawiki...Wikidata)

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

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

Change subject: New Wikdiata build - 2016-03-21
..

New Wikdiata build - 2016-03-21

Change-Id: Ib40e6167d2ad3335441f6c3cc43f5c347b9e85bd
---
M composer.lock
M extensions/ArticlePlaceholder/i18n/zh-hant.json
M extensions/Constraints/composer.json
M extensions/ExternalValidation/composer.json
A extensions/MediaInfo/WikibaseMediaInfo.entitytypes.php
M extensions/MediaInfo/composer.json
M extensions/MediaInfo/extension.json
A extensions/MediaInfo/i18n/mk.json
A extensions/MediaInfo/i18n/ru.json
A extensions/MediaInfo/src/Content/MediaInfoContent.php
A extensions/MediaInfo/src/Content/MediaInfoHandler.php
M extensions/MediaInfo/src/View/MediaInfoView.php
M extensions/MediaInfo/src/WikibaseMediaInfoHooks.php
A extensions/MediaInfo/tests/phpunit/mediawiki/Content/MediaInfoContentTest.php
A extensions/MediaInfo/tests/phpunit/mediawiki/Content/MediaInfoHandlerTest.php
A extensions/MediaInfo/tests/phpunit/mediawiki/EntityTypesTest.php
M extensions/MediaInfo/tests/phpunit/mediawiki/View/MediaInfoViewTest.php
M extensions/MediaInfo/tests/phpunit/mediawiki/WikibaseMediaInfoHooksTest.php
M extensions/PropertySuggester/PropertySuggester.php
M extensions/PropertySuggester/README.md
M extensions/PropertySuggester/composer.json
M extensions/Quality/composer.json
M extensions/Wikibase/client/i18n/ast.json
M extensions/Wikibase/client/i18n/bgn.json
M extensions/Wikibase/client/i18n/bs.json
M extensions/Wikibase/client/i18n/eo.json
M extensions/Wikibase/client/i18n/es.json
M extensions/Wikibase/client/i18n/hi.json
M extensions/Wikibase/client/i18n/is.json
M extensions/Wikibase/client/i18n/ja.json
M extensions/Wikibase/client/i18n/mg.json
M extensions/Wikibase/client/i18n/mk.json
M extensions/Wikibase/client/i18n/my.json
M extensions/Wikibase/client/i18n/ps.json
M extensions/Wikibase/client/i18n/sa.json
M extensions/Wikibase/client/i18n/sr-ec.json
M extensions/Wikibase/client/i18n/sr-el.json
M extensions/Wikibase/client/i18n/vi.json
A extensions/Wikibase/client/i18n/wa.json
A extensions/Wikibase/client/i18n/xal.json
M extensions/Wikibase/client/i18n/yi.json
M extensions/Wikibase/client/includes/UpdateRepo/UpdateRepo.php
M extensions/Wikibase/client/includes/WikibaseClient.php
M 
extensions/Wikibase/client/tests/phpunit/includes/Changes/ChangeRunCoalescerTest.php
M 
extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTestCase.php
M 
extensions/Wikibase/client/tests/phpunit/includes/Hooks/DeletePageNoticeCreatorTest.php
M extensions/Wikibase/client/tests/phpunit/includes/Hooks/MovePageNoticeTest.php
M extensions/Wikibase/composer.json
M extensions/Wikibase/docs/ontology.owl
M extensions/Wikibase/lib/i18n/sv.json
M extensions/Wikibase/lib/includes/EntityTypeDefinitions.php
M extensions/Wikibase/lib/includes/LanguageFallbackChainFactory.php
M extensions/Wikibase/lib/includes/changes/EntityChangeFactory.php
M extensions/Wikibase/lib/includes/store/HashSiteLinkStore.php
M 
extensions/Wikibase/lib/includes/store/sql/PrefetchingWikiPageEntityMetaDataAccessor.php
M extensions/Wikibase/lib/includes/store/sql/WikiPageEntityMetaDataAccessor.php
M extensions/Wikibase/lib/includes/store/sql/WikiPageEntityMetaDataLookup.php
M extensions/Wikibase/lib/includes/store/sql/WikiPageEntityRevisionLookup.php
M extensions/Wikibase/lib/maintenance/populateSitesTable.php
M extensions/Wikibase/lib/tests/phpunit/changes/EntityChangeFactoryTest.php
M extensions/Wikibase/lib/tests/phpunit/changes/TestChanges.php
M extensions/Wikibase/lib/tests/phpunit/store/Sql/SiteLinkTableTest.php
M extensions/Wikibase/repo/i18n/ba.json
M extensions/Wikibase/repo/i18n/bgn.json
M extensions/Wikibase/repo/i18n/es.json
M extensions/Wikibase/repo/i18n/ja.json
M extensions/Wikibase/repo/i18n/my.json
M extensions/Wikibase/repo/i18n/ru.json
M extensions/Wikibase/repo/i18n/sr-ec.json
M extensions/Wikibase/repo/i18n/sv.json
A extensions/Wikibase/repo/i18n/wa.json
A extensions/Wikibase/repo/i18n/xal.json
M extensions/Wikibase/repo/includes/Api/ApiHelperFactory.php
M extensions/Wikibase/repo/includes/Api/EditEntity.php
M extensions/Wikibase/repo/includes/Api/QuerySearchEntities.php
M extensions/Wikibase/repo/includes/Api/SearchEntities.php
M extensions/Wikibase/repo/includes/Api/SetAliases.php
M extensions/Wikibase/repo/includes/Api/SetDescription.php
M extensions/Wikibase/repo/includes/Api/SetLabel.php
M extensions/Wikibase/repo/includes/BabelUserLanguageLookup.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpAliases.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpDescription.php
M extensions/Wikibase/repo/includes/ChangeOp/ChangeOpLabel.php
M extensions/Wikibase/repo/includes/Content/EntityContent.php
M extensions/Wikibase/repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.php
M 
extensions/Wikibase/repo/includes/LinkedData/EntityDataSerializationService.php
M 

[MediaWiki-commits] [Gerrit] Removed unused method SFTemplateField::createFromList() - change (mediawiki...SemanticForms)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: Removed unused method SFTemplateField::createFromList()
..


Removed unused method SFTemplateField::createFromList()

Change-Id: I1bf870c744ad16450b3e94c21996e7c3edcf5d5c
---
M includes/SF_TemplateField.php
1 file changed, 0 insertions(+), 26 deletions(-)

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



diff --git a/includes/SF_TemplateField.php b/includes/SF_TemplateField.php
index f379ffa..63f7b89 100644
--- a/includes/SF_TemplateField.php
+++ b/includes/SF_TemplateField.php
@@ -45,32 +45,6 @@
return $f;
}
 
-   /**
-* Create an SFTemplateField object based on the corresponding field
-* in the template definition (which we first have to find)
-*/
-   static function createFromList( $field_name, $all_fields, 
$strict_parsing ) {
-   // See if this field matches one of the fields defined for
-   // the template it's part of - if it is, use all available
-   // information about that field; if it's not, either create
-   // an object for it or not, depending on whether the
-   // template has a 'strict' setting in the form definition.
-   $the_field = null;
-   foreach ( $all_fields as $cur_field ) {
-   if ( $field_name == $cur_field->mFieldName ) {
-   $the_field = $cur_field;
-   break;
-   }
-   }
-   if ( $the_field == null ) {
-   if ( $strict_parsing ) {
-   return null;
-   }
-   $the_field = new SFTemplateField();
-   }
-   return $the_field;
-   }
-
function setTypeAndPossibleValues() {
if ( !defined( 'SMW_NS_PROPERTY' ) ) {
return;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1bf870c744ad16450b3e94c21996e7c3edcf5d5c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Removed unused method SFTemplateField::createFromList() - change (mediawiki...SemanticForms)

2016-03-21 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: Removed unused method SFTemplateField::createFromList()
..

Removed unused method SFTemplateField::createFromList()

Change-Id: I1bf870c744ad16450b3e94c21996e7c3edcf5d5c
---
M includes/SF_TemplateField.php
1 file changed, 0 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/27/278727/1

diff --git a/includes/SF_TemplateField.php b/includes/SF_TemplateField.php
index f379ffa..63f7b89 100644
--- a/includes/SF_TemplateField.php
+++ b/includes/SF_TemplateField.php
@@ -45,32 +45,6 @@
return $f;
}
 
-   /**
-* Create an SFTemplateField object based on the corresponding field
-* in the template definition (which we first have to find)
-*/
-   static function createFromList( $field_name, $all_fields, 
$strict_parsing ) {
-   // See if this field matches one of the fields defined for
-   // the template it's part of - if it is, use all available
-   // information about that field; if it's not, either create
-   // an object for it or not, depending on whether the
-   // template has a 'strict' setting in the form definition.
-   $the_field = null;
-   foreach ( $all_fields as $cur_field ) {
-   if ( $field_name == $cur_field->mFieldName ) {
-   $the_field = $cur_field;
-   break;
-   }
-   }
-   if ( $the_field == null ) {
-   if ( $strict_parsing ) {
-   return null;
-   }
-   $the_field = new SFTemplateField();
-   }
-   return $the_field;
-   }
-
function setTypeAndPossibleValues() {
if ( !defined( 'SMW_NS_PROPERTY' ) ) {
return;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bf870c744ad16450b3e94c21996e7c3edcf5d5c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] Add a parser for the property page - change (mediawiki...Wikibase)

2016-03-21 Thread Lucie Kaffee (Code Review)
Lucie Kaffee has uploaded a new change for review.

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

Change subject: Add a parser for the property page
..

Add a parser for the property page

Parse a list on a wiki page to a PHP array

Bug: T113952
Change-Id: I5139acb8ac1dbb02af3c70af55762da1fab4e01d
---
A lib/includes/store/MediaWikiPagePropertyOrderProvider.php
A lib/includes/store/PropertyOrderProviderException.php
A lib/tests/phpunit/store/MediaWikiPagePropertyOrderProviderTest.php
3 files changed, 171 insertions(+), 0 deletions(-)


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

diff --git a/lib/includes/store/MediaWikiPagePropertyOrderProvider.php 
b/lib/includes/store/MediaWikiPagePropertyOrderProvider.php
new file mode 100644
index 000..5ec0541
--- /dev/null
+++ b/lib/includes/store/MediaWikiPagePropertyOrderProvider.php
@@ -0,0 +1,75 @@
+ [Ordinal number]
+*/
+   public function getPropertyOrder() {
+   $pageContent = $this->getSortedPropertiesPageContent();
+   $parsedList = $this->parseList( $pageContent );
+   return array_flip( $parsedList );
+   }
+
+   /**
+* Get Content of MediaWiki:Wikibase-SortedProperties
+* @return string|null
+* @throws PropertyOrderProviderException
+*/
+   private function getSortedPropertiesPageContent() {
+   $title = Title::newFromText( self::PAGENAME );
+   if ( !$title ) {
+   throw new PropertyOrderProviderException( 'Not able to 
get a title' );
+   }
+   $wikiPage = WikiPage::factory( $title );
+   if ( !$wikiPage ) {
+   throw new PropertyOrderProviderException( 'Not able to 
get the Wikipage' );
+   }
+   $pageContent = $wikiPage->getContent();
+   if ( !$pageContent ) {
+   throw new PropertyOrderProviderException( 'Not able to 
get page content' );
+   }
+   if ( !( $pageContent instanceof TextContent ) ) {
+   throw new PropertyOrderProviderException( 'The page 
content is not TextContent' );
+   }
+
+   return $pageContent->getNativeData();
+   }
+
+   /**
+* @param string $pageContent
+* @return string[]
+*/
+   private function parseList( $pageContent ) {
+   $orderedProperties = array();
+   $orderedPropertiesMatches = array();
+
+   $pageContent = preg_replace( '@@s', '', $pageContent 
);
+   preg_match_all(
+   '@^\*\s*([Pp]\d+)@m',
+   $pageContent,
+   $orderedPropertiesMatches,
+   PREG_PATTERN_ORDER
+   );
+   $orderedProperties = array_map( 'strtoupper', 
$orderedPropertiesMatches[1] );
+
+   return $orderedProperties;
+   }
+
+}
diff --git a/lib/includes/store/PropertyOrderProviderException.php 
b/lib/includes/store/PropertyOrderProviderException.php
new file mode 100644
index 000..a141d48
--- /dev/null
+++ b/lib/includes/store/PropertyOrderProviderException.php
@@ -0,0 +1,21 @@
+ array(
+   "* P1 \n"
+   . "*P133 \n"
+   . "* p5", // Testing for lower case property IDs
+   array( 'P1' => 0, 'P133' => 1, 'P5' => 2 )
+   ),
+   'strip multiline comment' => array(
+   "* P1 \n"
+   . "",
+   array( 'P1' => 0 )
+   ),
+   'muliple comments' => array(
+   "* P1 \n"
+   . " \n"
+   . "* ",
+   array( 'P1' => 0 )
+   ),
+   'bullet point glibberish' => array(
+   "* P1 \n"
+   . "* P133 \n"
+   . "* P5 Unicorns are all \n"
+   . "*  very beautiful!"
+   . "** This is a subheading",
+   array( 'P1' => 0, 'P133' => 1, 'P5' => 2 )
+   ),
+   'additional text' => array(
+   "* P1 \n"
+   . "* P133 \n"
+   . "* P5 Unicorns are all \n"
+   . "very beautiful!",
+   array( 'P1' => 0, 'P133' => 1, 'P5' => 2 )
+   ),
+   );
+   }
+
+   /**
+* @dataProvider provideGetPropertyOrder
+*/
+   public function 

[MediaWiki-commits] [Gerrit] Improve SPARQL hint - change (wikidata...gui)

2016-03-21 Thread Jonas Kress (WMDE) (Code Review)
Jonas Kress (WMDE) has uploaded a new change for review.

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

Change subject: Improve SPARQL hint
..

Improve SPARQL hint

More SPARQL keywords. More places to complete. Auto complete #.

Change-Id: Ib961117f1f3c530b5f445495850cea0295e948dd
---
M wikibase/queryService/ui/editor/Editor.js
M wikibase/queryService/ui/editor/hint/Sparql.js
2 files changed, 25 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui 
refs/changes/25/278725/1

diff --git a/wikibase/queryService/ui/editor/Editor.js 
b/wikibase/queryService/ui/editor/Editor.js
index fc9d731..44e1bbb 100644
--- a/wikibase/queryService/ui/editor/Editor.js
+++ b/wikibase/queryService/ui/editor/Editor.js
@@ -63,7 +63,8 @@
this._editor.on( 'change', function ( editor, changeObj ) {
self.storeValue( self.getValue() );
self.clearError();
-   if( changeObj.text[0] === '?' ){
+   if( changeObj.text[0] === '?' ||
+   changeObj.text[0] === '#' ){
editor.showHint({closeCharacters: /[\s]/});
}
} );
diff --git a/wikibase/queryService/ui/editor/hint/Sparql.js 
b/wikibase/queryService/ui/editor/hint/Sparql.js
index d1776dd..af56a4a 100755
--- a/wikibase/queryService/ui/editor/hint/Sparql.js
+++ b/wikibase/queryService/ui/editor/hint/Sparql.js
@@ -12,15 +12,34 @@
var SPARQL_KEYWORDS = [
   'SELECT',
   'OPTIONAL',
+  'OPTIONAL {\n\n}',
   'WHERE',
+  'WHERE {\n\n}',
   'ORDER',
   'ORDER BY',
   'DISTINCT',
-  'WHERE {\n\n}',
   'SERVICE',
   'SERVICE wikibase:label {\n bd:serviceParam 
wikibase:language "en" .\n}',
   'BASE', 'PREFIX', 'REDUCED', 'FROM', 'LIMIT', 
'OFFSET', 'HAVING',
   'UNION',
+  'SAMPLE',
+  '(SAMPLE() AS )',
+  'COUNT',
+  '(COUNT() AS )',
+  'DESC',
+  'DESC()',
+  'ASC',
+  'ASC()',
+  'FILTER ()',
+  'FILTER NOT EXISTS',
+  'FILTER NOT EXISTS {\n\n}',
+  'UNION',
+  'UNION {\n\n}',
+  'BIND',
+  'BIND ()',
+  'GROUP_CONCAT',
+  '(GROUP_CONCAT() as )',
+  'ORDER BY',
   '#defaultView:Map', '#defaultView:ImageGrid'
   ];
 
@@ -67,7 +86,7 @@
var list = [];
 
$.each( SPARQL_KEYWORDS, function ( key, keyword ) {
-   if ( keyword.toLowerCase().indexOf( term.toLowerCase() 
) === 0 ) {
+   if ( keyword.toLowerCase().indexOf( term.toLowerCase() 
) >= 0 ) {
list.push( keyword );
}
} );
@@ -119,7 +138,7 @@
pos = 0;
}
 
-   while( line.charAt( pos ) !== ' ' ){
+   while( line.charAt( pos ).match(/[\w?#]/) ){
pos--;
if( pos < 0 ){
break;
@@ -128,7 +147,7 @@
var left = pos + 1;
 
pos = position;
-   while( line.charAt( pos ) !== ' ' ){
+   while( line.charAt( pos ).match(/[\w]/) ){
pos++;
if( pos >= line.length ){
break;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib961117f1f3c530b5f445495850cea0295e948dd
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) 

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


[MediaWiki-commits] [Gerrit] UploadBase: Set mFileSize, if given, even if mTempPath is un... - change (mediawiki/core)

2016-03-21 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: UploadBase: Set mFileSize, if given, even if mTempPath is 
unknown
..

UploadBase: Set mFileSize, if given, even if mTempPath is unknown

When uploading a file from stash using the action=upload API, with
async=1, UploadFromStash is initialized without initializing a temp
file. dcb5ec5cbf92b9a07f0776b9c194183a13400193 accidentally made it so
that the given file size is ignored if there's no path. This caused
validity checks to fail (because mFileSize is null) and action=upload
to also fail with cryptic 'emptyfile' warning.

This made it impossible to upload files bigger than 10 MB using
UploadWizard, as it uses the async mode for them.

Bug: T130238
Change-Id: Ie35a66a565a370fe9adc66d5fee0866c4d51470e
(cherry picked from commit 93d65f2968b76c9b7685ee2c44c5297a7a2a78a2)
---
M includes/upload/UploadBase.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/24/278724/1

diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php
index fb25249..9d7b294 100644
--- a/includes/upload/UploadBase.php
+++ b/includes/upload/UploadBase.php
@@ -241,12 +241,14 @@
 */
protected function setTempFile( $tempPath, $fileSize = null ) {
$this->mTempPath = $tempPath;
+   $this->mFileSize = $fileSize ?: null;
if ( strlen( $this->mTempPath ) && file_exists( 
$this->mTempPath ) ) {
$this->tempFileObj = new TempFSFile( $this->mTempPath );
-   $this->mFileSize = $fileSize ?: filesize( 
$this->mTempPath );
+   if ( !$fileSize ) {
+   $this->mFileSize = filesize( $this->mTempPath );
+   }
} else {
$this->tempFileObj = null;
-   $this->mFileSize = null;
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie35a66a565a370fe9adc66d5fee0866c4d51470e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.27.0-wmf.17
Gerrit-Owner: Bartosz Dziewoński 

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


[MediaWiki-commits] [Gerrit] remove redundant wikimedia.org. trailers - change (operations/dns)

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

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

Change subject: remove redundant wikimedia.org. trailers
..

remove redundant wikimedia.org. trailers

Functional no-op.  All hostnames in the wikimedia.org zonefile
which are not fully qualified implicitly end in "wikimedia.org.",
and this normalizes them to their short form (again, for easier
regex operations).

Change-Id: I0f096146e918ebf036744f688791963d144007f2
---
M templates/wikimedia.org
1 file changed, 28 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/23/278723/1

diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index ae4ea57..58c0698 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -1,24 +1,24 @@
 ; vim: set expandtab:smarttab
 $TTL 3600
 $ORIGIN {{ zonename }}.
-@   1D  IN SOA  ns0.wikimedia.org.  hostmaster.wikimedia.org.   (
+@   1D  IN SOA ns0 hostmaster (
 {{ serial }}; serial
 12H ; refresh
 2H  ; retry
 2W  ; expiry
 600 ; negative cache TTL
-)
+)
 
 ; Name servers
 
-1D  IN NS   ns0.wikimedia.org.
-1D  IN NS   ns1.wikimedia.org.
-1D  IN NS   ns2.wikimedia.org.
+1D  IN NS   ns0
+1D  IN NS   ns1
+1D  IN NS   ns2
 
 ; Mail exchangers
 
-1H  IN MX   10  mx1001.wikimedia.org.
-1H  IN MX   50  mx2001.wikimedia.org.
+1H  IN MX   10  mx1001
+1H  IN MX   50  mx2001
 
 ; Canonical names
 600 IN DYNA geoip!text-addrs
@@ -86,8 +86,8 @@
 misc-web-lb 600 DYNA geoip!misc-addrs
 geoiplookup 600 DYNA geoip!geoiplookup-addrs
 donate  600 DYNA geoip!text-addrs
-1H  IN MX   10 mx1001.wikimedia.org.
-1H  IN MX   50 mx2001.wikimedia.org.
+1H  IN MX   10 mx1001
+1H  IN MX   50 mx2001
 
 ; Servers (alphabetic order) << WHAT PART ABOUT THIS IS SO HARD TO UNDERSTAND?
 
@@ -223,8 +223,8 @@
 1H  IN  2620:0:861:ed1a::2:d
 misc-web-lb.eqiad   600 IN DYNA geoip!misc-addrs/eqiad
 donate-lb.eqiad 600 IN DYNA geoip!text-addrs/eqiad
-IN MX 10 mx1001.wikimedia.org.
-IN MX 50 mx2001.wikimedia.org.
+IN MX 10 mx1001
+IN MX 50 mx2001
 ;;; ns0 208.80.154.238
 dns-rec-lb.eqiad1H  IN A208.80.154.239
 1H  IN  2620:0:861:ed1a::3:fe
@@ -258,8 +258,8 @@
 misc-web-lb.ulsfo   600 IN DYNA geoip!misc-addrs/ulsfo
 geoiplookup-lb.ulsfo600 IN DYNA geoip!geoiplookup-addrs/ulsfo
 donate-lb.ulsfo 600 IN DYNA geoip!text-addrs/ulsfo
-1H  IN MX 10mx1001.wikimedia.org.
-1H  IN MX 50mx2001.wikimedia.org.
+1H  IN MX 10mx1001
+1H  IN MX 50mx2001
 
 ;;; codfw
 dns-rec-lb.codfw1H  IN A208.80.153.254
@@ -284,8 +284,8 @@
 misc-web-lb.esams   600 IN DYNA geoip!misc-addrs/esams
 geoiplookup-lb.esams600 IN DYNA geoip!geoiplookup-addrs/esams
 donate-lb.esams 600 IN DYNA geoip!text-addrs/esams
-  1H  IN MX 10mx1001.wikimedia.org.
-  1H  IN MX 50mx2001.wikimedia.org.
+  1H  IN MX 10mx1001
+  1H  IN MX 50mx2001
 dns-rec-lb.esams1H  IN A91.198.174.216
   1H  IN  2620:0:862:ed1a::3:fe
 
@@ -452,8 +452,8 @@
 
 benefactorevents 1H IN CNAMEtrilogytools1.azurewebsites.net.
 benefactors 600 IN DYNA geoip!text-addrs
-1H  IN MX   10 mx1001.wikimedia.org.
-1H  IN MX   50 mx2001.wikimedia.org.
+1H  IN MX   10 mx1001
+1H  IN MX   50 mx2001
 1H  IN TXT  "v=spf1 include:wikimedia.org 
include:jangomail.com ?all"
 benefactors._domainkey.benefactors 1H IN TXT "v=DKIM1; k=rsa; 
p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCu1t0FbSFXbsTxY9T10Lgfx4V0J2L8T6KkIgx3gouCJUinv3+9P32h/JJCgjzFv/wqm6nL2lttPJbC5/FKZ/v3OTPdv4OuQX9EfhIFMetgw1gDyAmhvVEgnSzhTlylLRV3HvZSmQN1AUblyqgBv9fa0wbMTprlgzlyI/oLwhLHwQIDAQAB"
 
@@ -468,17 +468,15 @@
 doc 600 IN DYNA geoip!misc-addrs
 docs600 IN DYNA geoip!text-addrs
 eventdonations  1H  IN CNAME
contrib-wi-10109-10472-20140728-1682402186.us-east-1.elb.amazonaws.com.
-ldap-corp.eqiad 1H  IN CNAMEdubnium.wikimedia.org.
-ldap-corp.codfw 1H  IN CNAMEpollux.wikimedia.org.
-ldap-labs.eqiad 1H  IN CNAMEseaborgium.wikimedia.org.
-ldap-labs.codfw 1H  IN CNAMEserpens.wikimedia.org.
+ldap-corp.eqiad 1H  IN CNAMEdubnium
+ldap-corp.codfw 1H  IN CNAMEpollux
+ldap-labs.eqiad 1H  IN CNAMEseaborgium
+ldap-labs.codfw 1H  IN CNAMEserpens
 
-labs-puppetmaster-eqiad 300 IN 

[MediaWiki-commits] [Gerrit] remove corp ORIGIN statement - change (operations/dns)

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

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

Change subject: remove corp ORIGIN statement
..

remove corp ORIGIN statement

Functional no-op.  Moves the corp subdomain delegation info to a
single block near the top with explicit, short-form hostnames.

Change-Id: Ie078942be1704a2bde8b669e65a283faa130aaff
---
M templates/wikimedia.org
1 file changed, 4 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/22/278722/1

diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index 0083ffc..ae4ea57 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -29,9 +29,10 @@
 ; Delegations
 
 ; Corporate office name server delegation
-
-corp1D  IN NS   ns1.corp.wikimedia.org.
-1D  IN NS   ns2.corp.wikimedia.org.
+corp1D  IN NS   ns1.corp
+1D  IN NS   ns2.corp
+ns1.corp1H  IN A198.73.209.15
+ns2.corp1H  IN A198.73.209.16
 
 ; DKIM policy records & ADSP (also see DMARC below); policy is "some mails 
/may/ be signed"
 _domainkey  1H  IN TXT  "o=~; r=postmas...@wikimedia.org;"
@@ -759,14 +760,6 @@
 links.email.donate  1H  IN CNAME recp.mkt41.net.
 open.email.donate   1H  IN CNAME open.mkt41.net.
 www.email.donate1H  IN CNAME wikimedia.org.
-
-
-; Corp glue records
-
-$ORIGIN corp.{{ zonename }}.
-
-ns1 1H  IN A198.73.209.15
-ns2 1H  IN A198.73.209.16
 
 ; esams Service aliases
 ; FIXME: all 3 of these are suspect, we don't do these per-subdomain 
elsewhere..

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

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

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


[MediaWiki-commits] [Gerrit] remove esams ORIGIN statement - change (operations/dns)

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

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

Change subject: remove esams ORIGIN statement
..

remove esams ORIGIN statement

Functional no-op.

This removes the ORIGIN for esams, placing the subdomain on each
hostname line as it is for the other DCs.

Change-Id: I4825cb09764de577a17a8e5a60e3a6c92e01688a
---
M templates/wikimedia.org
1 file changed, 11 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/21/278721/1

diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index 7a76c64..0083ffc 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -768,21 +768,18 @@
 ns1 1H  IN A198.73.209.15
 ns2 1H  IN A198.73.209.16
 
-; esams cluster
-$ORIGIN esams.{{ zonename }}.
-
-; Service aliases
+; esams Service aliases
 ; FIXME: all 3 of these are suspect, we don't do these per-subdomain 
elsewhere..
-puppet  1H  IN CNAMEpalladium.eqiad.wmnet.
-recursor0   1H  IN A91.198.174.216  ; esams LVS (dns-rec-lb)
-recursor1   1H  IN A208.80.154.239  ; eqiad LVS (dns-rec-lb)
+puppet.esams   1H  IN CNAMEpalladium.eqiad.wmnet.
+recursor0.esams1H  IN A91.198.174.216  ; esams LVS (dns-rec-lb)
+recursor1.esams1H  IN A208.80.154.239  ; eqiad LVS (dns-rec-lb)
 
-; Servers
+; esams Servers
 ; FIXME: these stay under .esams.wikimedia.org until they get reprovisioned
-slauerhoff  1H  IN A91.198.174.108
-slauerhoff-array1H  IN A91.198.174.107
-hooft   1H  IN A91.198.174.113
-1H  IN  2620:0:862:1:91:198:174:113
+slauerhoff.esams   1H  IN A91.198.174.108
+slauerhoff-array.esams 1H  IN A91.198.174.107
+hooft.esams1H  IN A91.198.174.113
+   1H  IN  2620:0:862:1:91:198:174:113
 
-; Management
-scs-oe11-esams  1H  IN A10.21.0.102
+; esams Management
+scs-oe11-esams.esams   1H  IN A10.21.0.102

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

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

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


[MediaWiki-commits] [Gerrit] Update LanguageLibraryTests per changes in core - change (mediawiki...Scribunto)

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

Change subject: Update LanguageLibraryTests per changes in core
..


Update LanguageLibraryTests per changes in core

appears the test depends on kk-cyrl translation of
limitreport-cputime-value, which has changed:

https://gerrit.wikimedia.org/r/#/c/278597/1/languages/i18n/kk-cyrl.json

Change-Id: Iedf847b7dd0dde094ce0c1c2af4f44b71b9c477f
---
M tests/engines/LuaCommon/LanguageLibraryTests.lua
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Bene: Looks good to me, but someone else must approve
  Daniel Kinzler: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/engines/LuaCommon/LanguageLibraryTests.lua 
b/tests/engines/LuaCommon/LanguageLibraryTests.lua
index b0f24a6..2fc2ab6 100644
--- a/tests/engines/LuaCommon/LanguageLibraryTests.lua
+++ b/tests/engines/LuaCommon/LanguageLibraryTests.lua
@@ -263,7 +263,7 @@
  args = { 'formatDuration', 86461 },
  expect = {
  { "1 day, 1 minute and 1 second" },
- { "1 күн, 1 минут ham 1 секунт" },
+ { "1 күн, 1 минут ham 1 секунд" },
  { "۱ روز، ۱ دقیقه و ۱ ثانیه" },
  "language code '[[bogus]]' is invalid",
  }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iedf847b7dd0dde094ce0c1c2af4f44b71b9c477f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: master
Gerrit-Owner: Aude 
Gerrit-Reviewer: Anomie 
Gerrit-Reviewer: Bene 
Gerrit-Reviewer: Daniel Kinzler 
Gerrit-Reviewer: Hoo man 
Gerrit-Reviewer: Jackmcbarn 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] Migrate (un)block logging to new system - change (mediawiki...AbuseFilter)

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

Change subject: Migrate (un)block logging to new system
..


Migrate (un)block logging to new system

Also
* Fix a bug where action-reverts doesn't work for anons
since the userid is always 0 for them, instead use the username.
* Start adding block log flags consistently with core

Bug: T124789
Change-Id: Ic6680dad891e2169b392fcfefc1e313af85bc92f
---
M AbuseFilter.class.php
M Views/AbuseFilterViewRevert.php
2 files changed, 78 insertions(+), 73 deletions(-)

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



diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php
index b2db560..7fd453a 100755
--- a/AbuseFilter.class.php
+++ b/AbuseFilter.class.php
@@ -1193,23 +1193,7 @@
break;
 
case 'block':
-   global $wgUser, $wgAbuseFilterBlockDuration, 
$wgAbuseFilterAnonBlockDuration;
-   $filterUser = AbuseFilter::getFilterUser();
-
-   // Create a block.
-   $block = new Block;
-   $block->setTarget( $wgUser->getName() );
-   $block->setBlocker( $filterUser );
-   $block->mReason = wfMessage(
-   'abusefilter-blockreason',
-   $rule_desc,
-   $rule_number
-   )->inContentLanguage()->text();
-   $block->isHardblock( false );
-   $block->isAutoblocking( true );
-   $block->prevents( 'createaccount', true );
-   $block->prevents( 'editownusertalk', false );
-
+   global $wgAbuseFilterBlockDuration, 
$wgAbuseFilterAnonBlockDuration, $wgUser;
if ( $wgUser->isAnon() && 
$wgAbuseFilterAnonBlockDuration !== null ) {
// The user isn't logged in and the 
anon block duration
// doesn't default to 
$wgAbuseFilterBlockDuration.
@@ -1218,25 +1202,16 @@
$expiry = $wgAbuseFilterBlockDuration;
}
 
-   $block->mExpiry = 
SpecialBlock::parseExpiryInput( $expiry );
-   if ( $block->insert() ) {
-   // Log it if successful
-   # Prepare log parameters
-   $logParams = array();
-   if ( $block->mExpiry == 'infinity' ) {
-   $logParams[] = 'indefinite';
-   } else {
-   $logParams[] = $expiry;
-   }
-   $logParams[] = 'nocreate';
+   self::doAbuseFilterBlock(
+   array(
+   'desc' => $rule_desc,
+   'number' => $rule_number
+   ),
+   $wgUser->getName(),
+   $expiry,
+   true
+   );
 
-   $log = new LogPage( 'block' );
-   $log->addEntry( 'block',
-   Title::makeTitle( NS_USER, 
$wgUser->getName() ),
-   wfMessage( 
'abusefilter-blockreason', $rule_desc, $rule_number 
)->inContentLanguage()->text(),
-   $logParams, 
self::getFilterUser()
-   );
-   }
$message = array(
'abusefilter-blocked-display',
$rule_desc,
@@ -1244,37 +1219,16 @@
);
break;
case 'rangeblock':
-   $filterUser = AbuseFilter::getFilterUser();
+   self::doAbuseFilterBlock(
+   array(
+   'desc' => $rule_desc,
+   'number' => $rule_number
+   ),
+   IP::sanitizeRange( $wgRequest->getIP() 
. '/16' ),
+ 

[MediaWiki-commits] [Gerrit] Remove EntityRevision from MediaInfoView - change (mediawiki...WikibaseMediaInfo)

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

Change subject: Remove EntityRevision from MediaInfoView
..


Remove EntityRevision from MediaInfoView

per changes (I97677b9) in EntityView

Bug: T130511
Depends-On: Iedf847b7dd0dde094ce0c1c2af4f44b71b9c477f
Change-Id: Ic36fc86e97fe6211f7f7566d02a4ed3051267999
---
M src/View/MediaInfoView.php
M tests/phpunit/mediawiki/View/MediaInfoViewTest.php
2 files changed, 14 insertions(+), 31 deletions(-)

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



diff --git a/src/View/MediaInfoView.php b/src/View/MediaInfoView.php
index 4ca6ae7..1d19d1b 100644
--- a/src/View/MediaInfoView.php
+++ b/src/View/MediaInfoView.php
@@ -6,7 +6,6 @@
 use Language;
 use Wikibase\DataModel\Entity\EntityDocument;
 use Wikibase\DataModel\Term\Fingerprint;
-use Wikibase\EntityRevision;
 use Wikibase\MediaInfo\DataModel\MediaInfo;
 use Wikibase\View\EntityTermsView;
 use Wikibase\View\EntityView;
@@ -75,28 +74,26 @@
/**
 * @see EntityView::getMainHtml
 *
-* @param EntityRevision $entityRevision
+* @param EntityDocument $entity
 *
 * @throws InvalidArgumentException
 * @return string HTML
 */
-   protected function getMainHtml( EntityRevision $entityRevision ) {
-   $entity = $entityRevision->getEntity();
-
+   protected function getMainHtml( EntityDocument $entity ) {
if ( !( $entity instanceof MediaInfo ) ) {
throw new InvalidArgumentException( '$entityRevision 
must contain a MediaInfo entity.' );
}
 
-   $fingerprint = $this->getFingerprint( $entity );
-
// FIXME should be $this->getHtmlForTermBox( $id, 
$entityRevision->getRevisionId() )
$entityTermsView = 
$this->entityTermsView->getEntityTermsForLanguageListView(
-   $fingerprint,
+   $entity,
+   $entity,
+   null,
[ $this->languageCode ]
);
 
return $this->entityTermsView->getHtml(
-   $fingerprint,
+   $this->getFingerprint( $entity ),
$entity->getId(),
$entityTermsView,
$this->textInjector
@@ -130,12 +127,11 @@
/**
 * @see EntityView::getTitleHtml
 *
-* @param EntityRevision $entityRevision
+* @param EntityDocument $entity
 *
 * @return string HTML
 */
-   public function getTitleHtml( EntityRevision $entityRevision ) {
-   $entity = $entityRevision->getEntity();
+   public function getTitleHtml( EntityDocument $entity ) {
if ( !( $entity instanceof MediaInfo ) ) {
throw new InvalidArgumentException( '$entityRevision 
must contain a MediaInfo entity.' );
}
diff --git a/tests/phpunit/mediawiki/View/MediaInfoViewTest.php 
b/tests/phpunit/mediawiki/View/MediaInfoViewTest.php
index 33cc163..fa09e46 100644
--- a/tests/phpunit/mediawiki/View/MediaInfoViewTest.php
+++ b/tests/phpunit/mediawiki/View/MediaInfoViewTest.php
@@ -13,7 +13,6 @@
 use Wikibase\DataModel\Term\Fingerprint;
 use Wikibase\DataModel\Term\Term;
 use Wikibase\DataModel\Term\TermList;
-use Wikibase\EntityRevision;
 use Wikibase\MediaInfo\DataModel\MediaInfo;
 use Wikibase\MediaInfo\DataModel\MediaInfoId;
 use Wikibase\MediaInfo\View\MediaInfoView;
@@ -76,12 +75,6 @@
);
}
 
-   private function newEntityRevision( EntityDocument $entity ) {
-   $revId = 0;
-   $timestamp = wfTimestamp( TS_MW );
-   return new EntityRevision( $entity, $revId, $timestamp );
-   }
-
public function testInstantiate() {
$view = $this->newMediaInfoView();
$this->assertInstanceOf( MediaInfoView::class, $view );
@@ -92,10 +85,9 @@
$view = $this->newMediaInfoView();
 
$entity = $this->getMock( EntityDocument::class );
-   $revision = $this->newEntityRevision( $entity );
 
$this->setExpectedException( InvalidArgumentException::class );
-   $view->getHtml( $revision );
+   $view->getHtml( $entity );
}
 
/**
@@ -146,9 +138,7 @@
$statementSectionsView
);
 
-   $revision = $this->newEntityRevision( $entity );
-
-   $result = $view->getHtml( $revision );
+   $result = $view->getHtml( $entity );
$this->assertInternalType( 'string', $result );
$this->assertContains( 'wb-mediainfo', $result );
$this->assertContains( 'entityTermsView->getHtml', $result );
@@ -215,9 +205,7 @@
 

[MediaWiki-commits] [Gerrit] Evaluate globe in coordinates - change (wikidata...gui)

2016-03-21 Thread Jonas Kress (WMDE) (Code Review)
Jonas Kress (WMDE) has uploaded a new change for review.

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

Change subject: Evaluate globe in coordinates
..

Evaluate globe in coordinates

When a point comes with a globe. Globe needs to be earth.
Also optimize click handler for result browser.

Bug: T130428
Change-Id: Ic927a138bff130c9044cf02e897f81c1f032a2d6
---
M wikibase/queryService/ui/App.js
M wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
2 files changed, 30 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui 
refs/changes/20/278720/1

diff --git a/wikibase/queryService/ui/App.js b/wikibase/queryService/ui/App.js
index 18d2bfc..8313678 100644
--- a/wikibase/queryService/ui/App.js
+++ b/wikibase/queryService/ui/App.js
@@ -462,6 +462,8 @@
var self = this;
 
$.each( this._resultBrowsers, function( key, b ){
+   b.$element.off( 'click' );
+
if( b.object.isDrawable() ){
b.$element.css( 'opacity', 1 ).attr( 'href', 
'#' );
b.$element.click( function(){
@@ -476,7 +478,6 @@
return false;
} );
} else {
-   b.$element.off( 'click' );
b.$element.css( 'opacity', 0.5 ).removeAttr( 
'href' );
}
} );
diff --git a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js 
b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
index 9df5271..f7acf97 100644
--- a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
+++ b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
@@ -7,6 +7,7 @@
"use strict";
 
var MAP_DATATYPE = 'http://www.opengis.net/ont/geosparql#wktLiteral';
+   var GLOBE_EARTH = 'Q2';
 
 var TILE_LAYER = {
wikimedia: {
@@ -88,9 +89,7 @@
if( field.datatype === MAP_DATATYPE ){
var longLat = self._extractLongLat( field.value 
);
 
-   // FIXME: if the coordinates are for 
another globe (e.g. Mars),
-   // then the array order is different 
and longLat[0] is NaN.
-   if( !longLat[0] || !longLat[1] || 
isNaN( longLat[0] ) ){
+   if( longLat === null || !longLat[0] || 
!longLat[1]  ){
return true;
}
 
@@ -119,11 +118,30 @@
 * @private
 */
SELF.prototype._extractLongLat = function( point ) {
-   point = point.replace('Point(', '' );
-   point = point.replace( ')', '' );
+
+   var globe = this._extractGlobe( point );
+   if ( globe !== null && globe !== GLOBE_EARTH ){
+   return null;
+   }
+
+   point = point.match(/Point\((.*)\)/).pop();
 
return point.split( ' ' );
};
+
+   /**
+* @private
+*/
+   SELF.prototype._extractGlobe = function( point ) {
+   var globe = null;
+
+   if ( ( globe = 
point.match(//i) ) ){
+   globe = globe.pop();
+   }
+
+   return globe;
+   };
+
 
/**
 * @private
@@ -185,8 +203,11 @@
 */
SELF.prototype._checkCoordinate = function ( value ) {
if( value && value.datatype === MAP_DATATYPE ) {
-   this._drawable = true;
-   return false;
+   var globe = this._extractGlobe( value.value );
+   if ( globe === null || globe === GLOBE_EARTH ){
+   this._drawable = true;
+   return false;
+   }
}
return true;
};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic927a138bff130c9044cf02e897f81c1f032a2d6
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) 

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


[MediaWiki-commits] [Gerrit] Fix minor i18n issues - change (mediawiki...ArticlePlaceholder)

2016-03-21 Thread Lucie Kaffee (Code Review)
Lucie Kaffee has uploaded a new change for review.

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

Change subject: Fix minor i18n issues
..

Fix minor i18n issues

Change-Id: I6d2187c212ad8a3f0ee6e952701982f9b7fecd26
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 5 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder 
refs/changes/19/278719/1

diff --git a/i18n/en.json b/i18n/en.json
index c612e53..4c1fd1f 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -4,16 +4,16 @@
"Lucie-Aimée Kaffee"
]
},
-   "articleplaceholder-desc": "Provides a special page with {{WBREPONAME}} 
information about a certain topic, with invitation to create an article for the 
topic",
+   "articleplaceholder-desc": "Provides a special page with {{WBREPONAME}} 
information about a certain topic, with invitation to create a page for the 
topic",
"articleplaceholder-abouttopic": "About topic",
"articleplaceholder-abouttopic-intro": "This special page generates a 
content page about a certain topic with {{WBREPONAME}} information",
"articleplaceholder-abouttopic-entityid": "Enter an entity id to get an 
auto-generated article placeholder.",
"articleplaceholder-abouttopic-submit": "craft",
"articleplaceholder-abouttopic-no-entity-error": "This is not a valid 
entity id.",
-   "articleplaceholder-abouttopic-create-article": "Create a new article 
with the title",
+   "articleplaceholder-abouttopic-create-article": "Create a new page with 
the title",
"articleplaceholder-abouttopic-create-article-button": "Create an 
article",
"articleplaceholder-abouttopic-create-article-submit-button": "Submit",
-   "articleplaceholder-abouttopic-article-exists-error": "An article with 
this name already exists",
+   "articleplaceholder-abouttopic-article-exists-error": "A page with this 
name already exists",
"articleplaceholder-abouttopic-lua-entity": "Entity",
"articleplaceholder-abouttopic-lua-reference": "Reference",
"articleplaceholder-abouttopic-lua-qualifier": "Qualifier",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a9848e7..f5143a8 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -12,10 +12,10 @@
"articleplaceholder-abouttopic-entityid": "Text to encourage the user 
to enter an entity id.",
"articleplaceholder-abouttopic-submit": "Label on the submit 
button.\n{{Identical|Craft}}",
"articleplaceholder-abouttopic-no-entity-error": "Error message in case 
of an invalid entity id.",
-   "articleplaceholder-abouttopic-create-article": "Text in the popup 
encouraging the user to create an article with a selectable title",
+   "articleplaceholder-abouttopic-create-article": "Text in the popup 
encouraging the user to create a page with a selectable title",
"articleplaceholder-abouttopic-create-article-button": "Label on create 
article button",
"articleplaceholder-abouttopic-create-article-submit-button": "Label on 
submit button\n{{Identical|Submit}}",
-   "articleplaceholder-abouttopic-article-exists-error": "Error to 
indicate the given article title already exists",
+   "articleplaceholder-abouttopic-article-exists-error": "Error to 
indicate the given page title already exists",
"articleplaceholder-abouttopic-lua-entity": "Header of the entity 
section\n{{Identical|Entity}}",
"articleplaceholder-abouttopic-lua-reference": "Header of the reference 
section\n{{Identical|Reference}}",
"articleplaceholder-abouttopic-lua-qualifier": "Header of the qualifier 
section\n{{Identical|Qualifier}}",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d2187c212ad8a3f0ee6e952701982f9b7fecd26
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticlePlaceholder
Gerrit-Branch: master
Gerrit-Owner: Lucie Kaffee 

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


[MediaWiki-commits] [Gerrit] Split LocalisationCache.php classes into own files - change (mediawiki/core)

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

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

Change subject: Split LocalisationCache.php classes into own files
..

Split LocalisationCache.php classes into own files

Change-Id: I1b88081e6b082fcad73990550a3ffbf58e11d97e
---
M autoload.php
A includes/cache/LocalisationCache/LCStore.php
A includes/cache/LocalisationCache/LCStoreCDB.php
A includes/cache/LocalisationCache/LCStoreDB.php
A includes/cache/LocalisationCache/LCStoreNull.php
R includes/cache/LocalisationCache/LCStoreStaticArray.php
R includes/cache/LocalisationCache/LocalisationCache.php
A includes/cache/LocalisationCache/LocalisationCacheBulkLoad.php
8 files changed, 493 insertions(+), 388 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/18/278718/1

diff --git a/autoload.php b/autoload.php
index e74df0a..77ffbd3 100644
--- a/autoload.php
+++ b/autoload.php
@@ -634,11 +634,11 @@
'LBFactoryMulti' => __DIR__ . 
'/includes/db/loadbalancer/LBFactoryMulti.php',
'LBFactorySimple' => __DIR__ . 
'/includes/db/loadbalancer/LBFactorySimple.php',
'LBFactorySingle' => __DIR__ . 
'/includes/db/loadbalancer/LBFactorySingle.php',
-   'LCStore' => __DIR__ . '/includes/cache/LocalisationCache.php',
-   'LCStoreCDB' => __DIR__ . '/includes/cache/LocalisationCache.php',
-   'LCStoreDB' => __DIR__ . '/includes/cache/LocalisationCache.php',
-   'LCStoreNull' => __DIR__ . '/includes/cache/LocalisationCache.php',
-   'LCStoreStaticArray' => __DIR__ . 
'/includes/cache/LCStoreStaticArray.php',
+   'LCStore' => __DIR__ . '/includes/cache/LocalisationCache/LCStore.php',
+   'LCStoreCDB' => __DIR__ . 
'/includes/cache/LocalisationCache/LCStoreCDB.php',
+   'LCStoreDB' => __DIR__ . 
'/includes/cache/LocalisationCache/LCStoreDB.php',
+   'LCStoreNull' => __DIR__ . 
'/includes/cache/LocalisationCache/LCStoreNull.php',
+   'LCStoreStaticArray' => __DIR__ . 
'/includes/cache/LocalisationCache/LCStoreStaticArray.php',
'LangMemUsage' => __DIR__ . '/maintenance/language/langmemusage.php',
'Language' => __DIR__ . '/languages/Language.php',
'LanguageAr' => __DIR__ . '/languages/classes/LanguageAr.php',
@@ -718,8 +718,8 @@
'LocalIdLookup' => __DIR__ . '/includes/user/LocalIdLookup.php',
'LocalRepo' => __DIR__ . '/includes/filerepo/LocalRepo.php',
'LocalSettingsGenerator' => __DIR__ . 
'/includes/installer/LocalSettingsGenerator.php',
-   'LocalisationCache' => __DIR__ . 
'/includes/cache/LocalisationCache.php',
-   'LocalisationCacheBulkLoad' => __DIR__ . 
'/includes/cache/LocalisationCache.php',
+   'LocalisationCache' => __DIR__ . 
'/includes/cache/LocalisationCache/LocalisationCache.php',
+   'LocalisationCacheBulkLoad' => __DIR__ . 
'/includes/cache/LocalisationCache/LocalisationCacheBulkLoad.php',
'LockManager' => __DIR__ . 
'/includes/filebackend/lockmanager/LockManager.php',
'LockManagerGroup' => __DIR__ . 
'/includes/filebackend/lockmanager/LockManagerGroup.php',
'LogEntry' => __DIR__ . '/includes/logging/LogEntry.php',
diff --git a/includes/cache/LocalisationCache/LCStore.php 
b/includes/cache/LocalisationCache/LCStore.php
new file mode 100644
index 000..cb1e261
--- /dev/null
+++ b/includes/cache/LocalisationCache/LCStore.php
@@ -0,0 +1,66 @@
+http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+/**
+ * Interface for the persistence layer of LocalisationCache.
+ *
+ * The persistence layer is two-level hierarchical cache. The first level
+ * is the language, the second level is the item or subitem.
+ *
+ * Since the data for a whole language is rebuilt in one operation, it needs
+ * to have a fast and atomic method for deleting or replacing all of the
+ * current data for a given language. The interface reflects this bulk update
+ * operation. Callers writing to the cache must first call startWrite(), then
+ * will call set() a couple of thousand times, then will call finishWrite()
+ * to commit the operation. When finishWrite() is called, the cache is
+ * expected to delete all data previously stored for that language.
+ *
+ * The values stored are PHP variables suitable for serialize(). 
Implementations
+ * of LCStore are responsible for serializing and unserializing.
+ */
+interface LCStore {
+
+   /**
+* Get a value.
+* @param string $code Language code
+* @param string $key Cache key
+*/
+   function get( $code, $key );
+
+   /**
+* Start a write transaction.
+* @param string $code Language code
+*/
+   function startWrite( $code );
+
+   /**
+* Finish a write transaction.
+*/
+   function finishWrite();
+
+   /**
+* Set a key to a given value. startWrite() must be called before this
+* is called, and finishWrite() must be called afterwards.
+   

[MediaWiki-commits] [Gerrit] Revert "Don't parse URL to manipulate query parameters" - change (mediawiki...MobileFrontend)

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

Change subject: Revert "Don't parse URL to manipulate query parameters"
..


Revert "Don't parse URL to manipulate query parameters"

This reverts commit 3e6299f24ff136c7fa501cb5bff473339f510bc3, which
caused nightly build failures from Friday, 18th March onwards.

Bug: T129600
Change-Id: Iec1539758533e011ae1c366b7dc1842b46fb9ce2
---
M includes/MobileContext.php
D tests/browser/features/step_definitions/switch_views.rb
D tests/browser/features/step_definitions/switch_views_bug_t129600.rb
D tests/browser/features/support/pages/page.rb
D tests/browser/features/switch_views.feature
5 files changed, 3 insertions(+), 53 deletions(-)

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



diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index 6c7c134..d972cd3 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -963,7 +963,9 @@
return;
}
 
-   $query = $this->getRequest()->getQueryValues();
+   $url = $this->getRequest()->getFullRequestURL();
+   $parsed = wfParseUrl( $url );
+   $query = isset( $parsed['query'] ) ? wfCgiToArray( 
$parsed['query'] ) : array();
unset( $query['mobileaction'] );
unset( $query['useformat'] );
unset( $query['title'] );
diff --git a/tests/browser/features/step_definitions/switch_views.rb 
b/tests/browser/features/step_definitions/switch_views.rb
deleted file mode 100644
index 5f289dc..000
--- a/tests/browser/features/step_definitions/switch_views.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-Given(/^I toggle the mobile view$/) do
-  on(Page).toggle_mobile_view
-end
-
-Then(/^I should see the mobile view$/) do
-  expect(on(Page).toggle_view_desktop_element).to be_visible
-end
-
-Given(/^I toggle the desktop view$/) do
-  on(Page).toggle_desktop_view
-end
-
-Then(/^I should see the desktop view$/) do
-  expect(on(Page).toggle_view_mobile_element).to be_visible
-end
diff --git 
a/tests/browser/features/step_definitions/switch_views_bug_t129600.rb 
b/tests/browser/features/step_definitions/switch_views_bug_t129600.rb
deleted file mode 100644
index 9fb87a6..000
--- a/tests/browser/features/step_definitions/switch_views_bug_t129600.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-Given(/^I am on a page that transcludes content from a special page$/) do
-  api.create_page 'T129600', '{{Special:PrefixIndex/User:Admin/}}'
-
-  step 'I am on the "T129600" page'
-end
diff --git a/tests/browser/features/support/pages/page.rb 
b/tests/browser/features/support/pages/page.rb
deleted file mode 100644
index 8dc9a6c..000
--- a/tests/browser/features/support/pages/page.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-class Page
-  include PageObject
-
-  a(:toggle_view_mobile, css: '.stopMobileRedirectToggle')
-  a(:toggle_view_desktop, id: 'mw-mf-display-toggle')
-
-  def toggle_mobile_view
-toggle_view_mobile_element.click
-  end
-
-  def toggle_desktop_view
-toggle_view_desktop_element.click
-  end
-end
diff --git a/tests/browser/features/switch_views.feature 
b/tests/browser/features/switch_views.feature
deleted file mode 100644
index 724c281..000
--- a/tests/browser/features/switch_views.feature
+++ /dev/null
@@ -1,18 +0,0 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org 
@vagrant
-Feature: Switch between mobile and desktop views
-
-  Scenario: Switching from desktop view to mobile view
-Given I am on the "Main Page" page
-And I toggle the mobile view
-Then I should see the mobile view
-
-  Scenario: Switching from mobile view to desktop view
-Given I am on the "Main Page" page
-And I toggle the mobile view
-And I toggle the desktop view
-Then I should see the desktop view
-
-  Scenario: Bug: T129600
-Given I am on a page that transcludes content from a special page
-And I toggle the mobile view
-Then I should see the mobile view

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iec1539758533e011ae1c366b7dc1842b46fb9ce2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx 
Gerrit-Reviewer: Phuedx 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] (WIP) HACK tools/trigger-job.py (WIP) - change (integration/zuul)

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

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

Change subject: (WIP) HACK tools/trigger-job.py (WIP)
..

(WIP) HACK tools/trigger-job.py (WIP)

Tweak trigger-job utility to run against a branch and set node offline.

Change-Id: I2fe1e71b68f3800967ccd3eba8193d295fbda3c2
---
M tools/trigger-job.py
1 file changed, 18 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/zuul 
refs/changes/17/278717/1

diff --git a/tools/trigger-job.py b/tools/trigger-job.py
index dff4e3f..b11b20c 100755
--- a/tools/trigger-job.py
+++ b/tools/trigger-job.py
@@ -18,6 +18,7 @@
 # parameters.
 
 import argparse
+import sys
 import time
 import json
 from uuid import uuid4
@@ -35,31 +36,22 @@
 help='Project name')
 parser.add_argument('--pipeline', dest='pipeline', default='release',
 help='Zuul pipeline')
-parser.add_argument('--refname', dest='refname',
-help='Ref name')
-parser.add_argument('--oldrev', dest='oldrev',
-default='',
-help='Old revision (SHA)')
-parser.add_argument('--newrev', dest='newrev',
-help='New revision (SHA)')
+parser.add_argument('--branch', dest='branch',
+help='Branch name')
 parser.add_argument('--url', dest='url',
-default='http://zuul.openstack.org/p', help='Zuul URL')
-parser.add_argument('--logpath', dest='logpath', required=True,
-help='Path for log files.')
+default='https://gerrit.wikimedia.org/r/p',
+help='Git base URL')
 args = parser.parse_args()
 
 data = {'ZUUL_PIPELINE': args.pipeline,
 'ZUUL_PROJECT': args.project,
 'ZUUL_UUID': str(uuid4().hex),
-'ZUUL_REF': args.refname,
-'ZUUL_REFNAME': args.refname,
-'ZUUL_OLDREV': args.oldrev,
-'ZUUL_NEWREV': args.newrev,
-'ZUUL_SHORT_OLDREV': args.oldrev[:7],
-'ZUUL_SHORT_NEWREV': args.newrev[:7],
-'ZUUL_COMMIT': args.newrev,
+'ZUUL_REF': args.branch,
+'ZUUL_BRANCH': args.branch,
+'ZUUL_REFNAME': args.branch,
+'ZUUL_COMMIT': args.branch,
 'ZUUL_URL': args.url,
-'LOG_PATH': args.logpath,
+'OFFLINE_NODE_WHEN_COMPLETE': 1,
 }
 
 c.addServer('127.0.0.1', 4730)
@@ -71,7 +63,14 @@
 c.submitJob(job)
 
 while not job.complete:
+sys.stdout.write('.')
+sys.stdout.flush()
 time.sleep(1)
+if job.failure:
+print "Job failed!"
+return 1
+print "Job passed"
+print job.data
 
 if __name__ == '__main__':
-main()
+sys.exit(main())

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fe1e71b68f3800967ccd3eba8193d295fbda3c2
Gerrit-PatchSet: 1
Gerrit-Project: integration/zuul
Gerrit-Branch: debian/precise-wikimedia
Gerrit-Owner: Hashar 

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


[MediaWiki-commits] [Gerrit] Fix cross-namespace redirect scores - change (mediawiki...CirrusSearch)

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

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

Change subject: Fix cross-namespace redirect scores
..

Fix cross-namespace redirect scores

Refactored multiple calls to indexData into a single call with a loop over the
source indices.  The previous construct led to many subtle and dangerous bugs.
SuggestBuilder holds various states that should not be changed during the update
process, i.e. if batchId is udpated then the script might delete (when
recycling) all the data indexed from content index while indexing data from
general index.

This patch fixes the following score components:
* max_docs (used to normalize some score components) should be set to the total
  number of docs being indexed and not only to #docs in the source index being 
read.
* crossnamespace suggestions should be discounted at least like normal
  redirects. (discount set to 0.05 which is slightly more aggressive than
  classic redirects)

Bug: T130353
Change-Id: I782946a5fa60ab80dd9c990d6e82748da56040ac
---
M includes/BuildDocument/SuggestBuilder.php
M maintenance/updateSuggesterIndex.php
M tests/unit/SuggestBuilderTest.php
3 files changed, 98 insertions(+), 60 deletions(-)


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

diff --git a/includes/BuildDocument/SuggestBuilder.php 
b/includes/BuildDocument/SuggestBuilder.php
index c9e258a..db9be6f 100644
--- a/includes/BuildDocument/SuggestBuilder.php
+++ b/includes/BuildDocument/SuggestBuilder.php
@@ -45,6 +45,11 @@
const REDIRECT_DISCOUNT = 0.1;
 
/**
+* Discount suggestions based on crossnamespace redirects
+*/
+   const CROSSNS_DISCOUNT = 0.05;
+
+   /**
 * Redirect suggestion type
 */
const REDIRECT_SUGGESTION = 'r';
@@ -112,7 +117,13 @@
// Bad doc, nothing to do here.
continue;
}
-   if( $inputDoc['namespace'] != NS_MAIN ) {
+   if( $inputDoc['namespace'] == NS_MAIN ) {
+   if ( !isset( $inputDoc['title'] ) ) {
+   // Bad doc, nothing to do here.
+   continue;
+   }
+   $docs = array_merge( $docs, 
$this->buildNormalSuggestions( $id, $inputDoc ) );
+   } else {
if ( !isset( $inputDoc['redirect'] ) ) {
// Bad doc, nothing to do here.
continue;
@@ -127,8 +138,9 @@
if ( $redir['namespace'] != 
$this->targetNamespace ) {
continue;
}
-   // Should we discount the score?
$score = $this->scoringMethod->score( 
$inputDoc );
+   // Discount the score of these 
suggestions.
+   $score = (int) ($score * 
self::CROSSNS_DISCOUNT);
// We support only earth and the 
primary/first coordinates...
$location = 
$this->findPrimaryCoordinates( $inputDoc );
 
@@ -139,12 +151,6 @@
'location' => $location
);
}
-   } else {
-   if ( !isset( $inputDoc['title'] ) ) {
-   // Bad doc, nothing to do here.
-   continue;
-   }
-   $docs = array_merge( $docs, 
$this->buildNormalSuggestions( $id, $inputDoc ) );
}
}
 
diff --git a/maintenance/updateSuggesterIndex.php 
b/maintenance/updateSuggesterIndex.php
index 3d9c3b0..54b9025 100644
--- a/maintenance/updateSuggesterIndex.php
+++ b/maintenance/updateSuggesterIndex.php
@@ -216,13 +216,13 @@
}
} catch ( \Elastica\Exception\Connection\HttpException $e ) {
$message = $e->getMessage();
-   $this->output( "\nUnexpected Elasticsearch failure.\n" 
);
+   $this->log( "\nUnexpected Elasticsearch failure.\n" );
$this->error( "Http error communicating with 
Elasticsearch:  $message.\n", 1 );
} catch ( \Elastica\Exception\ExceptionInterface $e ) {
$type = get_class( $e );
$message = ElasticsearchIntermediary::extractMessage( 
$e );
$trace = 

[MediaWiki-commits] [Gerrit] Revert "Don't parse URL to manipulate query parameters" - change (mediawiki...MobileFrontend)

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

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

Change subject: Revert "Don't parse URL to manipulate query parameters"
..

Revert "Don't parse URL to manipulate query parameters"

This reverts commit 3e6299f24ff136c7fa501cb5bff473339f510bc3, which
caused nightly build failures from Friday, 18th March onwards.

Bug: T129600
Change-Id: Iec1539758533e011ae1c366b7dc1842b46fb9ce2
---
M includes/MobileContext.php
D tests/browser/features/step_definitions/switch_views.rb
D tests/browser/features/step_definitions/switch_views_bug_t129600.rb
D tests/browser/features/support/pages/page.rb
D tests/browser/features/switch_views.feature
5 files changed, 3 insertions(+), 53 deletions(-)


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

diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index 6c7c134..d972cd3 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -963,7 +963,9 @@
return;
}
 
-   $query = $this->getRequest()->getQueryValues();
+   $url = $this->getRequest()->getFullRequestURL();
+   $parsed = wfParseUrl( $url );
+   $query = isset( $parsed['query'] ) ? wfCgiToArray( 
$parsed['query'] ) : array();
unset( $query['mobileaction'] );
unset( $query['useformat'] );
unset( $query['title'] );
diff --git a/tests/browser/features/step_definitions/switch_views.rb 
b/tests/browser/features/step_definitions/switch_views.rb
deleted file mode 100644
index 5f289dc..000
--- a/tests/browser/features/step_definitions/switch_views.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-Given(/^I toggle the mobile view$/) do
-  on(Page).toggle_mobile_view
-end
-
-Then(/^I should see the mobile view$/) do
-  expect(on(Page).toggle_view_desktop_element).to be_visible
-end
-
-Given(/^I toggle the desktop view$/) do
-  on(Page).toggle_desktop_view
-end
-
-Then(/^I should see the desktop view$/) do
-  expect(on(Page).toggle_view_mobile_element).to be_visible
-end
diff --git 
a/tests/browser/features/step_definitions/switch_views_bug_t129600.rb 
b/tests/browser/features/step_definitions/switch_views_bug_t129600.rb
deleted file mode 100644
index 9fb87a6..000
--- a/tests/browser/features/step_definitions/switch_views_bug_t129600.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-Given(/^I am on a page that transcludes content from a special page$/) do
-  api.create_page 'T129600', '{{Special:PrefixIndex/User:Admin/}}'
-
-  step 'I am on the "T129600" page'
-end
diff --git a/tests/browser/features/support/pages/page.rb 
b/tests/browser/features/support/pages/page.rb
deleted file mode 100644
index 8dc9a6c..000
--- a/tests/browser/features/support/pages/page.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-class Page
-  include PageObject
-
-  a(:toggle_view_mobile, css: '.stopMobileRedirectToggle')
-  a(:toggle_view_desktop, id: 'mw-mf-display-toggle')
-
-  def toggle_mobile_view
-toggle_view_mobile_element.click
-  end
-
-  def toggle_desktop_view
-toggle_view_desktop_element.click
-  end
-end
diff --git a/tests/browser/features/switch_views.feature 
b/tests/browser/features/switch_views.feature
deleted file mode 100644
index 724c281..000
--- a/tests/browser/features/switch_views.feature
+++ /dev/null
@@ -1,18 +0,0 @@
-@chrome @en.m.wikipedia.beta.wmflabs.org @firefox @test2.m.wikipedia.org 
@vagrant
-Feature: Switch between mobile and desktop views
-
-  Scenario: Switching from desktop view to mobile view
-Given I am on the "Main Page" page
-And I toggle the mobile view
-Then I should see the mobile view
-
-  Scenario: Switching from mobile view to desktop view
-Given I am on the "Main Page" page
-And I toggle the mobile view
-And I toggle the desktop view
-Then I should see the desktop view
-
-  Scenario: Bug: T129600
-Given I am on a page that transcludes content from a special page
-And I toggle the mobile view
-Then I should see the mobile view

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

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

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


[MediaWiki-commits] [Gerrit] Use WatchedItemStore in ApiQueryInfo::getWatchedInfo - change (mediawiki/core)

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

Change subject: Use WatchedItemStore in ApiQueryInfo::getWatchedInfo
..


Use WatchedItemStore in ApiQueryInfo::getWatchedInfo

Adds a method for getting watchlist's notification timestamps
for a batch of LinkTargets.

Bug: T129482
Change-Id: I1f84212e7879a84b34bb3b53859069fcea282bba
---
M includes/WatchedItemStore.php
M includes/api/ApiQueryInfo.php
M tests/phpunit/includes/WatchedItemStoreIntegrationTest.php
M tests/phpunit/includes/WatchedItemStoreUnitTest.php
4 files changed, 332 insertions(+), 23 deletions(-)

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



diff --git a/includes/WatchedItemStore.php b/includes/WatchedItemStore.php
index 4e2dfa5..8a3f205 100644
--- a/includes/WatchedItemStore.php
+++ b/includes/WatchedItemStore.php
@@ -503,6 +503,61 @@
}
 
/**
+* @param User $user
+* @param LinkTarget[] $targets
+*
+* @return array multi-dimensional like 
$return[$namespaceId][$titleString] = $timestamp,
+* where $timestamp is:
+* - string|null value of wl_notificationtimestamp,
+* - false if $target is not watched by $user.
+*/
+   public function getNotificationTimestampsBatch( User $user, array 
$targets ) {
+   $timestamps = [];
+   foreach ( $targets as $target ) {
+   
$timestamps[$target->getNamespace()][$target->getDBkey()] = false;
+   }
+
+   if ( $user->isAnon() ) {
+   return $timestamps;
+   }
+
+   $targetsToLoad = [];
+   foreach ( $targets as $target ) {
+   $cachedItem = $this->getCached( $user, $target );
+   if ( $cachedItem ) {
+   
$timestamps[$target->getNamespace()][$target->getDBkey()] =
+   $cachedItem->getNotificationTimestamp();
+   } else {
+   $targetsToLoad[] = $target;
+   }
+   }
+
+   if ( !$targetsToLoad ) {
+   return $timestamps;
+   }
+
+   $dbr = $this->getConnection( DB_SLAVE );
+
+   $lb = new LinkBatch( $targetsToLoad );
+   $res = $dbr->select(
+   'watchlist',
+   [ 'wl_namespace', 'wl_title', 
'wl_notificationtimestamp' ],
+   [
+   $lb->constructSet( 'wl', $dbr ),
+   'wl_user' => $user->getId(),
+   ],
+   __METHOD__
+   );
+   $this->reuseConnection( $dbr );
+
+   foreach ( $res as $row ) {
+   $timestamps[(int)$row->wl_namespace][$row->wl_title] = 
$row->wl_notificationtimestamp;
+   }
+
+   return $timestamps;
+   }
+
+   /**
 * Must be called separately for Subject & Talk namespaces
 *
 * @param User $user
diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php
index 2d382dd..ea1b94e 100644
--- a/includes/api/ApiQueryInfo.php
+++ b/includes/api/ApiQueryInfo.php
@@ -448,8 +448,8 @@
ApiResult::setIndexedTagName( 
$pageInfo['restrictiontypes'], 'rt' );
}
 
-   if ( $this->fld_watched ) {
-   $pageInfo['watched'] = isset( 
$this->watched[$ns][$dbkey] );
+   if ( $this->fld_watched && $this->watched !== null ) {
+   $pageInfo['watched'] = $this->watched[$ns][$dbkey];
}
 
if ( $this->fld_watchers ) {
@@ -470,7 +470,7 @@
 
if ( $this->fld_notificationtimestamp ) {
$pageInfo['notificationtimestamp'] = '';
-   if ( isset( $this->notificationtimestamps[$ns][$dbkey] 
) ) {
+   if ( $this->notificationtimestamps[$ns][$dbkey] ) {
$pageInfo['notificationtimestamp'] =
wfTimestamp( TS_ISO_8601, 
$this->notificationtimestamps[$ns][$dbkey] );
}
@@ -758,29 +758,22 @@
 
$this->watched = [];
$this->notificationtimestamps = [];
-   $db = $this->getDB();
 
-   $lb = new LinkBatch( $this->everything );
+   $store = WatchedItemStore::getDefaultInstance();
+   $timestamps = $store->getNotificationTimestampsBatch( $user, 
$this->everything );
 
-   $this->resetQueryParams();
-   $this->addTables( [ 'watchlist' ] );
-   $this->addFields( [ 'wl_title', 'wl_namespace' ] );
-   $this->addFieldsIf( 'wl_notificationtimestamp', 

  1   2   >