[MediaWiki-commits] [Gerrit] Added a script to compare current parser output to cache - change (mediawiki/core)

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

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

Change subject: Added a script to compare current parser output to cache
..

Added a script to compare current parser output to cache

* This works on a random set of pages in a namespace and can
  be used to compare different PHP interpreters.
* This can, like any maintenance script, be used with --profiler.

Change-Id: Ica69a3ef27df29af1c6e4dc4c8413b55a03df49e
(cherry picked from commit 380b075756a15f82a158be5c3a4283188208c820)
---
A maintenance/compareParserCache.php
1 file changed, 101 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/69/133669/1

diff --git a/maintenance/compareParserCache.php 
b/maintenance/compareParserCache.php
new file mode 100644
index 000..97fd3ff
--- /dev/null
+++ b/maintenance/compareParserCache.php
@@ -0,0 +1,101 @@
+?php
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once __DIR__ . '/Maintenance.php';
+
+/**
+ * @ingroup Maintenance
+ */
+class CompareParserCache extends Maintenance {
+   public function __construct() {
+   parent::__construct();
+   $this-mDescription = Parse random pages and compare output to 
cache.;
+   $this-addOption( 'namespace', 'Page namespace number', true, 
true );
+   $this-addOption( 'maxpages', 'Number of pages to try', true, 
true );
+   }
+
+   public function execute() {
+   $pages = $this-getOption( 'maxpages' );
+
+   $dbr = $this-getDB( DB_SLAVE );
+
+   $totalsec = 0.0;
+   $scanned = 0;
+   $withcache = 0;
+   while ( $pages--  0 ) {
+   $row = $dbr-selectRow( 'page', '*',
+   array(
+   'page_namespace' = $this-getOption( 
'namespace' ),
+   'page_is_redirect' = 0,
+   'page_random = ' . wfRandom()
+   ),
+   __METHOD__,
+   array(
+   'ORDER BY' = 'page_random',
+   )
+   );
+
+   if ( !$row ) {
+   continue;
+   }
+   ++$scanned;
+
+   $title = Title::newFromRow( $row );
+   $page = WikiPage::factory( $title );
+   $revision = $page-getRevision();
+   $content = $revision-getContent( Revision::RAW );
+
+   $parserOptions = $page-makeParserOptions( 'canonical' 
);
+
+   $parserOutputOld = ParserCache::singleton()-get( 
$page, $parserOptions );
+
+   $t1 = microtime( true );
+   $parserOutputNew = $content-getParserOutput(
+   $title, $revision-getId(), $parserOptions, 
false );
+   $sec = microtime( true ) - $t1;
+   $totalsec += $sec;
+
+   $this-output( Parsed '{$title-getPrefixedText()}' in 
$sec seconds.\n );
+
+   if ( $parserOutputOld ) {
+   $this-output( Found cache entry found for 
'{$title-getPrefixedText()}'... );
+   $oldHtml = trim( preg_replace( '#!-- 
.+--#Us', '', $parserOutputOld-getText() ) );
+   $newHtml = trim( preg_replace( '#!-- 
.+--#Us', '',$parserOutputNew-getText() ) );
+   $diff = wfDiff( $oldHtml, $newHtml );
+   if ( strlen( $diff ) ) {
+   $this-output( differences 
found:\n\n$diff\n\n );
+   } else {
+   $this-output( No differences 
found.\n );
+   }
+   ++$withcache;
+   } else {
+   

[MediaWiki-commits] [Gerrit] Added a script to compare current parser output to cache - change (mediawiki/core)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Added a script to compare current parser output to cache
..


Added a script to compare current parser output to cache

* This works on a random set of pages in a namespace and can
  be used to compare different PHP interpreters.
* This can, like any maintenance script, be used with --profiler.

Also includes I8905ae02b: Tweaks to compareParserCache.php

* Skip parsing if there is no cache entry to compare to
* Mention the total number of pages with differences

Change-Id: Ica69a3ef27df29af1c6e4dc4c8413b55a03df49e
(cherry picked from commit 380b075756a15f82a158be5c3a4283188208c820)
---
A maintenance/compareParserCache.php
1 file changed, 104 insertions(+), 0 deletions(-)

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



diff --git a/maintenance/compareParserCache.php 
b/maintenance/compareParserCache.php
new file mode 100644
index 000..93fe660
--- /dev/null
+++ b/maintenance/compareParserCache.php
@@ -0,0 +1,104 @@
+?php
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Maintenance
+ */
+
+require_once __DIR__ . '/Maintenance.php';
+
+/**
+ * @ingroup Maintenance
+ */
+class CompareParserCache extends Maintenance {
+   public function __construct() {
+   parent::__construct();
+   $this-mDescription = Parse random pages and compare output to 
cache.;
+   $this-addOption( 'namespace', 'Page namespace number', true, 
true );
+   $this-addOption( 'maxpages', 'Number of pages to try', true, 
true );
+   }
+
+   public function execute() {
+   $pages = $this-getOption( 'maxpages' );
+
+   $dbr = $this-getDB( DB_SLAVE );
+
+   $totalsec = 0.0;
+   $scanned = 0;
+   $withcache = 0;
+   $withdiff = 0;
+   while ( $pages--  0 ) {
+   $row = $dbr-selectRow( 'page', '*',
+   array(
+   'page_namespace' = $this-getOption( 
'namespace' ),
+   'page_is_redirect' = 0,
+   'page_random = ' . wfRandom()
+   ),
+   __METHOD__,
+   array(
+   'ORDER BY' = 'page_random',
+   )
+   );
+
+   if ( !$row ) {
+   continue;
+   }
+   ++$scanned;
+
+   $title = Title::newFromRow( $row );
+   $page = WikiPage::factory( $title );
+   $revision = $page-getRevision();
+   $content = $revision-getContent( Revision::RAW );
+
+   $parserOptions = $page-makeParserOptions( 'canonical' 
);
+
+   $parserOutputOld = ParserCache::singleton()-get( 
$page, $parserOptions );
+
+   if ( $parserOutputOld ) {
+   $t1 = microtime( true );
+   $parserOutputNew = $content-getParserOutput(
+   $title, $revision-getId(), 
$parserOptions, false );
+   $sec = microtime( true ) - $t1;
+   $totalsec += $sec;
+
+   $this-output( Parsed 
'{$title-getPrefixedText()}' in $sec seconds.\n );
+
+   $this-output( Found cache entry found for 
'{$title-getPrefixedText()}'... );
+   $oldHtml = trim( preg_replace( '#!-- 
.+--#Us', '', $parserOutputOld-getText() ) );
+   $newHtml = trim( preg_replace( '#!-- 
.+--#Us', '',$parserOutputNew-getText() ) );
+   $diff = wfDiff( $oldHtml, $newHtml );
+   if ( strlen( $diff ) ) {
+   $this-output( differences 
found:\n\n$diff\n\n );
+   ++$withdiff;
+  

[MediaWiki-commits] [Gerrit] switch dbstore box analytics roles during upgrade - change (operations/dns)

2014-05-16 Thread Springle (Code Review)
Springle has uploaded a new change for review.

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

Change subject: switch dbstore box analytics roles during upgrade
..

switch dbstore box analytics roles during upgrade

Change-Id: I28e0237b8751aab0920b69d21791fd3853b78a8c
---
M templates/wmnet
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/70/133670/1

diff --git a/templates/wmnet b/templates/wmnet
index 9650ed1..f6afb75 100644
--- a/templates/wmnet
+++ b/templates/wmnet
@@ -212,14 +212,14 @@
 
 s1-analytics-slave 5M  IN CNAMEdb1047.eqiad.wmnet.
 s2-analytics-slave 5M  IN CNAMEdb69.pmtpa.wmnet.
-s3-analytics-slave 5M  IN CNAMEdbstore1002.eqiad.wmnet.
+s3-analytics-slave 5M  IN CNAMEdbstore1001.eqiad.wmnet.
 s4-analytics-slave 5M  IN CNAMEdb72.pmtpa.wmnet.
 s5-analytics-slave 5M  IN CNAMEdb1017.eqiad.wmnet.
 s6-analytics-slave 5M  IN CNAMEdb74.pmtpa.wmnet.
 s7-analytics-slave 5M  IN CNAMEdb1007.eqiad.wmnet.
 x1-analytics-slave 5M  IN CNAMEdb1031.eqiad.wmnet.
 analytics-slave5M  IN CNAMEdb1047.eqiad.wmnet.
-analytics-store5M  IN CNAMEdbstore1002.eqiad.wmnet.
+analytics-store5M  IN CNAMEdbstore1001.eqiad.wmnet.
 
 ; Cameras
 cam1-a-eqiad   1H  IN A10.64.0.27

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28e0237b8751aab0920b69d21791fd3853b78a8c
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Springle sprin...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] switch dbstore box analytics roles during upgrade - change (operations/dns)

2014-05-16 Thread Springle (Code Review)
Springle has submitted this change and it was merged.

Change subject: switch dbstore box analytics roles during upgrade
..


switch dbstore box analytics roles during upgrade

Change-Id: I28e0237b8751aab0920b69d21791fd3853b78a8c
---
M templates/wmnet
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/templates/wmnet b/templates/wmnet
index 9650ed1..f6afb75 100644
--- a/templates/wmnet
+++ b/templates/wmnet
@@ -212,14 +212,14 @@
 
 s1-analytics-slave 5M  IN CNAMEdb1047.eqiad.wmnet.
 s2-analytics-slave 5M  IN CNAMEdb69.pmtpa.wmnet.
-s3-analytics-slave 5M  IN CNAMEdbstore1002.eqiad.wmnet.
+s3-analytics-slave 5M  IN CNAMEdbstore1001.eqiad.wmnet.
 s4-analytics-slave 5M  IN CNAMEdb72.pmtpa.wmnet.
 s5-analytics-slave 5M  IN CNAMEdb1017.eqiad.wmnet.
 s6-analytics-slave 5M  IN CNAMEdb74.pmtpa.wmnet.
 s7-analytics-slave 5M  IN CNAMEdb1007.eqiad.wmnet.
 x1-analytics-slave 5M  IN CNAMEdb1031.eqiad.wmnet.
 analytics-slave5M  IN CNAMEdb1047.eqiad.wmnet.
-analytics-store5M  IN CNAMEdbstore1002.eqiad.wmnet.
+analytics-store5M  IN CNAMEdbstore1001.eqiad.wmnet.
 
 ; Cameras
 cam1-a-eqiad   1H  IN A10.64.0.27

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I28e0237b8751aab0920b69d21791fd3853b78a8c
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Springle sprin...@wikimedia.org
Gerrit-Reviewer: Springle sprin...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] SpecialUnwatchedpages: Ajaxify watch links - change (mediawiki/core)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: SpecialUnwatchedpages: Ajaxify watch links
..


SpecialUnwatchedpages: Ajaxify watch links

Add user friendly handling to watch pages from Special:UnwatchedPages
using ajax. Emits a notification message upon completion of the action
and strikes through the list item.

Bug: 17367
Change-Id: Ie32cc54abb6f888a433f7f18ef5ad747a80d7187
---
M includes/specials/SpecialUnwatchedpages.php
M languages/i18n/en.json
M languages/i18n/qqq.json
M resources/Resources.php
A resources/src/mediawiki.special/mediawiki.special.unwatchedPages.css
A resources/src/mediawiki.special/mediawiki.special.unwatchedPages.js
6 files changed, 93 insertions(+), 1 deletion(-)

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



diff --git a/includes/specials/SpecialUnwatchedpages.php 
b/includes/specials/SpecialUnwatchedpages.php
index ec2e7f5..fe0638e 100644
--- a/includes/specials/SpecialUnwatchedpages.php
+++ b/includes/specials/SpecialUnwatchedpages.php
@@ -71,6 +71,14 @@
}
 
/**
+* Add the JS
+*/
+   public function execute( $par ) {
+   parent::execute( $par );
+   $this-getOutput()-addModules( 
'mediawiki.special.unwatchedPages' );
+   }
+
+   /**
 * @param Skin $skin
 * @param object $result Result row
 * @return string
@@ -91,7 +99,7 @@
$wlink = Linker::linkKnown(
$nt,
$this-msg( 'watch' )-escaped(),
-   array(),
+   array( 'class' = 'mw-watch-link' ),
array( 'action' = 'watch', 'token' = $token )
);
 
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 399c932..27a08c4 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1819,8 +1819,10 @@
watchnologin: Not logged in,
addwatch: Add to watchlist,
addedwatchtext: The page \[[:$1]]\ has been added to your 
[[Special:Watchlist|watchlist]].\nFuture changes to this page and its 
associated talk page will be listed there.,
+   addedwatchtext-short: The page \$1\ has been added to your 
watchlist.,
removewatch: Remove from watchlist,
removedwatchtext: The page \[[:$1]]\ has been removed from 
[[Special:Watchlist|your watchlist]].,
+   removedwatchtext-short: The page \$1\ has been removed from your 
watchlist.,
watch: Watch,
watchthispage: Watch this page,
unwatch: Unwatch,
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 8f46025..40cdbd2 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -1981,8 +1981,10 @@
watchnologin: Used as error page title.\n\nThe error message for 
this title is:\n* {{msg-mw|Watchnologintext}}\n{{Identical|Not logged in}},
addwatch: Link to a dialog box, displayed at the end of the list of 
categories at the foot of each page.\n\nSee also:\n* {{msg-mw|Removewatch}},
addedwatchtext: Explanation shown when clicking on the 
{{msg-mw|Watch}} tab. Parameters:\n* $1 - page title\nSee also:\n* 
{{msg-mw|Addedwatch}},
+   addedwatchtext-short: Explanation shown when watching item from 
Special:UnwatchedPages,
removewatch: Link to a dialog box, displayed at the end of the list 
of categories at the foot of each page.\n\nSee also:\n* {{msg-mw|Addwatch}},
removedwatchtext: After a page has been removed from a user's 
watchlist by clicking the {{msg-mw|Unwatch}} tab at the top of an article, this 
message appears just below the title of the article.\n\nParameters:\n* $1 - the 
title of the article\nSee also:\n* {{msg-mw|Removedwatch}}\n* 
{{msg-mw|Addedwatchtext}},
+   removedwatchtext-short: Explanation shown when unwatching item from 
Special:UnwatchedPages,
watch: {{doc-actionlink}}\nName of the Watch tab. Should be in the 
imperative mood.\n\nSee also:\n* {{msg-mw|Watch}}\n* 
{{msg-mw|Accesskey-ca-watch}}\n* {{msg-mw|Tooltip-ca-watch}},
watchthispage: Used as link text.\n\nSee also:\n* 
{{msg-mw|Unwatchthispage|link text}}\n* {{msg-mw|Notanarticle|error 
message}}\n{{Identical|Watch this page}},
unwatch: {{doc-actionlink}}\nLabel of \Unwatch\ tab.\n\nSee 
also:\n* {{msg-mw|Unwatch}}\n* {{msg-mw|Accesskey-ca-unwatch}}\n* 
{{msg-mw|Tooltip-ca-unwatch}},
diff --git a/resources/Resources.php b/resources/Resources.php
index abc1661..f638eea 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -1298,6 +1298,25 @@
'jquery.throttle-debounce',
),
),
+   'mediawiki.special.unwatchedPages' = array(
+   'scripts' = 
'resources/src/mediawiki.special/mediawiki.special.unwatchedPages.js',
+   'styles' = 
'resources/src/mediawiki.special/mediawiki.special.unwatchedPages.css',
+   

[MediaWiki-commits] [Gerrit] [L10N] fallback is set to False per default - change (pywikibot/core)

2014-05-16 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

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

Change subject: [L10N] fallback is set to False per default
..

[L10N] fallback is set to False per default

Change-Id: Ie04be90e399c13a157d99b06f7f73c45f39ee85b
---
M scripts/welcome.py
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/71/133671/1

diff --git a/scripts/welcome.py b/scripts/welcome.py
index 77ab8ef..0b91f6e 100644
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -486,7 +486,8 @@
 
 # blacklist from wikipage
 badword_page = pywikibot.Page(self.site,
-  pywikibot.translate(self.site, 
bad_pag))
+  pywikibot.translate(self.site,
+  bad_pag))
 list_loaded = list()
 if badword_page.exists():
 pywikibot.output(u'\nLoading the bad words list from %s...'
@@ -585,7 +586,8 @@
  % username)
 else:
 # Adding the log.
-rep_text += pywikibot.translate(self.site, report_text) % 
username
+rep_text += pywikibot.translate(self.site,
+report_text) % username
 if self.site.code == 'it':
 rep_text = %s%s}} % (rep_text, self.bname[username])
 
@@ -606,7 +608,7 @@
 return
 
 text = u''
-logg = pywikibot.translate(self.site, logbook, fallback=False)
+logg = pywikibot.translate(self.site, logbook)
 if not logg:
 return
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie04be90e399c13a157d99b06f7f73c45f39ee85b
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

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


[MediaWiki-commits] [Gerrit] Check uniqueness only for edited language - change (mediawiki...Wikibase)

2014-05-16 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has uploaded a new change for review.

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

Change subject: Check uniqueness only for edited language
..

Check uniqueness only for edited language

This optimizes uniqueness checks to only apply to labels and
descriptions that were not already present before a given edit.

This reduces database load, but more importantly, this means that
if an item has a label conflict in english, the german language
label can still be edited.

Change-Id: I7d72077af67b6698aec8e28f56e22e6fb4e4bfd2
---
M repo/includes/LabelDescriptionDuplicateDetector.php
M repo/includes/Validators/LabelDescriptionUniquenessValidator.php
M repo/includes/Validators/LabelUniquenessValidator.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php
M repo/tests/phpunit/includes/LabelDescriptionDuplicateDetectorTest.php
M 
repo/tests/phpunit/includes/Validators/LabelDescriptionUniquenessValidatorTest.php
M repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php
7 files changed, 128 insertions(+), 175 deletions(-)


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

diff --git a/repo/includes/LabelDescriptionDuplicateDetector.php 
b/repo/includes/LabelDescriptionDuplicateDetector.php
index 26260ef..9643bca 100644
--- a/repo/includes/LabelDescriptionDuplicateDetector.php
+++ b/repo/includes/LabelDescriptionDuplicateDetector.php
@@ -9,6 +9,8 @@
 /**
  * Detector of label/description uniqueness constraint violations.
  *
+ * @todo: Fold this into TermCombinationMatchFinder resp. TermIndex
+ *
  * @since 0.5
  *
  * @licence GNU GPL v2+
@@ -26,41 +28,6 @@
 */
public function __construct( TermCombinationMatchFinder $termFinder ) {
$this-termFinder = $termFinder;
-   }
-
-   /**
-* Report errors about other entities of the same type using the same 
label
-* in the same language.
-*
-* @since 0.5
-*
-* @param Entity $entity
-*
-* @return Result. If there are conflicts, $result-isValid() will 
return false and
-* $result-getErrors() will return a non-empty list of Error 
objects.
-*/
-   public function detectLabelConflictsForEntity( Entity $entity ) {
-   $labels = $entity-getLabels();
-
-   return $this-detectTermConflicts( $labels, null, 
$entity-getId() );
-   }
-
-   /**
-* Report errors about other entities of the same type using the same 
combination
-* of label and description, in the same language.
-*
-* @since 0.5
-*
-* @param Entity $entity
-*
-* @return Result. If there are conflicts, $result-isValid() will 
return false and
-* $result-getErrors() will return a non-empty list of Error 
objects.
-*/
-   public function detectLabelDescriptionConflictsForEntity( Entity 
$entity ) {
-   $labels = $entity-getLabels();
-   $descriptions = $entity-getDescriptions();
-
-   return $this-detectTermConflicts( $labels, $descriptions, 
$entity-getId() );
}
 
/**
diff --git a/repo/includes/Validators/LabelDescriptionUniquenessValidator.php 
b/repo/includes/Validators/LabelDescriptionUniquenessValidator.php
index ec651e1..005ef5f 100644
--- a/repo/includes/Validators/LabelDescriptionUniquenessValidator.php
+++ b/repo/includes/Validators/LabelDescriptionUniquenessValidator.php
@@ -40,8 +40,10 @@
 * @return Result
 */
public function validateEntity( Entity $entity ) {
-   $result = 
$this-duplicateDetector-detectLabelDescriptionConflictsForEntity( $entity );
-   return $result;
+   $labels = $entity-getLabels();
+   $descriptions = $entity-getDescriptions();
+
+   return $this-duplicateDetector-detectTermConflicts( $labels, 
$descriptions, $entity-getId() );
}
 
/**
@@ -70,6 +72,19 @@
iterator_to_array( 
$fingerprint-getDescriptions()-getIterator() )
);
 
+   if ( $languageCodes !== null ) {
+   $labels = array_intersect_key( $labels, array_flip( 
$languageCodes ) );
+   $descriptions = array_intersect_key( $descriptions, 
array_flip( $languageCodes ) );
+   }
+
+   // no need to check labels in languages in which we don't have 
a description
+   $labels = array_intersect_key( $labels, $descriptions );
+
+   // nothing to do
+   if ( empty( $labels ) ) {
+   return Result::newSuccess();
+   }
+
return $this-duplicateDetector-detectTermConflicts( $labels, 
$descriptions, $entityId );
}
 
diff --git a/repo/includes/Validators/LabelUniquenessValidator.php 

[MediaWiki-commits] [Gerrit] [L10N] Revert set fallback to False for L10N, update from t... - change (pywikibot/core)

2014-05-16 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

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

Change subject: [L10N] Revert set fallback to False for L10N, update from 
trunk r11428
..

[L10N] Revert set fallback to False for L10N, update from trunk r11428

fallback is set to False by default

This reverts commit 9cf605628c9458cd7269df3f448520d36de23e38.

Change-Id: Ie343c69dff4dc492702bb89eefc9fbe63dbddcde
---
M scripts/clean_sandbox.py
1 file changed, 3 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/73/133673/1

diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py
index d284f4a..78b3272 100755
--- a/scripts/clean_sandbox.py
+++ b/scripts/clean_sandbox.py
@@ -150,8 +150,7 @@
 self.site.login()
 if self.getOption('user'):
 localSandboxTitle = pywikibot.translate(self.site,
-user_sandboxTemplate,
-fallback=False)
+user_sandboxTemplate)
 localSandbox = pywikibot.Page(self.site, localSandboxTitle)
 content.update(user_content)
 sandboxTitle[self.site.lang] = [item.title() for item in
@@ -171,8 +170,7 @@
 while True:
 wait = False
 now = time.strftime(%d %b %Y %H:%M:%S (UTC), time.gmtime())
-localSandboxTitle = pywikibot.translate(self.site, sandboxTitle,
-fallback=False)
+localSandboxTitle = pywikibot.translate(self.site, sandboxTitle)
 if type(localSandboxTitle) is list:
 titles = localSandboxTitle
 else:
@@ -183,8 +181,7 @@
  % sandboxPage.title(asLink=True))
 try:
 text = sandboxPage.get()
-translatedContent = pywikibot.translate(self.site, content,
-fallback=False)
+translatedContent = pywikibot.translate(self.site, content)
 translatedMsg = i18n.twtranslate(self.site,
  'clean_sandbox-cleaned')
 subst = 'subst:' in translatedContent

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie343c69dff4dc492702bb89eefc9fbe63dbddcde
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

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


[MediaWiki-commits] [Gerrit] [L10N] set translation fallback=True for fix message - change (pywikibot/core)

2014-05-16 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

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

Change subject: [L10N] set translation fallback=True for fix message
..

[L10N] set translation fallback=True for fix message

needed since fallback is False per default

Change-Id: I1e57ecf1527ae2be76529938c6f059c79da216ec
---
M scripts/replace.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/74/133674/1

diff --git a/scripts/replace.py b/scripts/replace.py
index df6c215..20582b9 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -619,7 +619,7 @@
 str(fix['msg']))
 else:
 edit_summary = pywikibot.translate(pywikibot.Site(),
-   fix['msg'])
+   fix['msg'], fallback=True)
 if exceptions in fix:
 exceptions = fix['exceptions']
 if nocase in fix:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1e57ecf1527ae2be76529938c6f059c79da216ec
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

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


[MediaWiki-commits] [Gerrit] Add OpenGraph support - change (mediawiki...TwitterCards)

2014-05-16 Thread Legoktm (Code Review)
Legoktm has uploaded a new change for review.

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

Change subject: Add OpenGraph support
..

Add OpenGraph support

Adds $wgTwitterCardsPreferOG to control using OpenGraph fallbacks
whenever possible (https://dev.twitter.com/docs/cards/markup-
reference).

For code clarity, the hook function was moved into its own file.

Change-Id: I585e8ee78007f7c5854fd06dbcfabd02271f6ab4
---
A TwitterCards.hooks.php
M TwitterCards.php
2 files changed, 108 insertions(+), 64 deletions(-)


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

diff --git a/TwitterCards.hooks.php b/TwitterCards.hooks.php
new file mode 100644
index 000..558d956
--- /dev/null
+++ b/TwitterCards.hooks.php
@@ -0,0 +1,98 @@
+?php
+
+class TwitterCardsHooks {
+
+   /**
+* Twitter -- OpenGraph fallbacks
+* Only used if $wgTwitterCardsPreferOG = true;
+* @var array
+*/
+   static $fallbacks = array(
+   'twitter:description' = 'og:description',
+   'twitter:title' = 'og:title',
+   'twitter:image:src' = 'og:image',
+   'twitter:image:width' = 'og:image:width',
+   'twitter:image:height' = 'og:image:height',
+   );
+
+
+   public static function onBeforePageDisplay( OutputPage $out, 
SkinTemplate $sk ) {
+   $title = $out-getTitle();
+   if ( $title-inNamespace( NS_SPECIAL ) ) {
+   return true;
+   //} elseif ( $title-inNamespace( NS_FILE ) ) {
+   //  self::photoCard( $out );
+   //  return true;
+   } else {
+   self::summaryCard( $out );
+   return true;
+   }
+   }
+
+   /**
+* @param Title $title
+* @param string $type
+* @return array
+*/
+   protected static function basicInfo( Title $title, $type ) {
+   global $wgTwitterCardsHandle;
+   $meta = array(
+   'twitter:card' = $type,
+   'twitter:title' = $title-getFullText(),
+   );
+
+   if ( $wgTwitterCardsHandle ) {
+   $meta['twitter:site'] = $wgTwitterCardsHandle;
+   }
+
+   return $meta;
+   }
+
+   protected static function addMetaData( array $meta, OutputPage $out ) {
+   global $wgTwitterCardsPreferOG;
+   foreach ( $meta as $name = $value ) {
+   if ( $wgTwitterCardsPreferOG  isset( 
self::$fallbacks[$name] ) ) {
+   $name = self::$fallbacks[$name];
+   }
+   $out-addHeadItem( meta:name:$name,   . 
Html::element( 'meta', array( 'name' = $name, 'content' = $value ) ) . \n );
+   }
+
+   }
+
+   protected static function summaryCard( OutputPage $out ) {
+   if ( !class_exists( 'ApiQueryExtracts') || !class_exists( 
'ApiQueryPageImages' ) ) {
+   wfDebugLog( 'TwitterCards', 'TextExtracts or PageImages 
extension is missing for summary card.' );
+   return;
+   }
+
+   $title = $out-getTitle();
+   $meta = self::basicInfo( $title, 'summary' );
+
+   // @todo does this need caching?
+   $api = new ApiMain(
+   new FauxRequest( array(
+   'action' = 'query',
+   'titles' = $title-getFullText(),
+   'prop' = 'extracts|pageimages',
+   'exchars' = '200', // limited by twitter
+   'exsectionformat' = 'plain',
+   'explaintext' = '1',
+   'exintro' = '1',
+   'piprop' = 'thumbnail',
+   'pithumbsize' = 120 * 2, // twitter says 120px 
minimum, let's double it
+   ) )
+   );
+
+   $api-execute();
+   $data = $api-getResult()-getData();
+   $pageData = $data['query']['pages'][$title-getArticleID()];
+
+   $meta['twitter:description'] = $pageData['extract']['*'];
+   if ( isset( $pageData['thumbnail'] ) ) { // not all pages have 
images
+   $meta['twitter:image'] = 
$pageData['thumbnail']['source'];
+   }
+
+   self::addMetaData( $meta, $out );
+
+   }
+}
\ No newline at end of file
diff --git a/TwitterCards.php b/TwitterCards.php
index 02a9e27..fe9fc43 100644
--- a/TwitterCards.php
+++ b/TwitterCards.php
@@ -26,7 +26,15 @@
'author' = array( 'Harsh Kothari', 'Kunal Mehta' ),
'descriptionmsg' = 'twittercards-desc',
'url' = 

[MediaWiki-commits] [Gerrit] Add basic unclosed HTML tags checking in PHP - change (mediawiki...MassMessage)

2014-05-16 Thread Wctaiwan (Code Review)
Wctaiwan has uploaded a new change for review.

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

Change subject: Add basic unclosed HTML tags checking in PHP
..

Add basic unclosed HTML tags checking in PHP

This should really have been done with an HTML parser instead of regular
expressions.

Bug: 54909
Change-Id: Ica688adc8593cbf13bdc076b22ccaf31fbd65476
---
M SpecialMassMessage.php
1 file changed, 71 insertions(+), 0 deletions(-)


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

diff --git a/SpecialMassMessage.php b/SpecialMassMessage.php
index 28ac2ee..fa60e4e 100644
--- a/SpecialMassMessage.php
+++ b/SpecialMassMessage.php
@@ -192,6 +192,67 @@
}
 
/**
+* Returns an array containing possibly unclosed HTML tags in $message
+* TODO: Use an HTML parser instead of regular expressions
+*
+* @param $message string
+* @return array
+*/
+   protected function getUnclosedTags( $message ) {
+   $startTags = array();
+   $endTags = array();
+
+   preg_match_all( '|\([\w]+)|', $message, $startTags );
+   preg_match_all( '|\/([\w]+)|', $message, $endTags );
+
+   // Keep just the tags from the matched patterns.
+   $startTags = $startTags[1];
+   $endTags = $endTags[1];
+
+   // Stop and return an empty array if there are no HTML tags.
+   if ( empty( $startTags )  empty( $endTags ) ) {
+   return array();
+   }
+
+   // Construct a set containing elements that do not need an end 
tag.
+   $voidElements = array();
+   $voidElementNames = array( 'area', 'base', 'br', 'col', 
'command', 'embed','hr', 'img',
+   'input', 'keygen', 'link', 'meta', 'param', 'source', 
'track', 'wbr' );
+   foreach ( $voidElementNames as $name ) {
+   $voidElements[$name] = 1;
+   }
+
+   // Count start / end tags for each element, ignoring start tags 
of void elements.
+   $tags = array();
+   foreach ( $startTags as $tag ) {
+   if ( !isset( $voidElements[$tag] ) ) {
+   if ( !isset( $tags[$tag] ) ) {
+   $tags[$tag] = 1;
+   } else {
+   $tags[$tag]++;
+   }
+   }
+   }
+   foreach ( $endTags as $tag ) {
+   if ( !isset( $tags[$tag] ) ) {
+   $tags[$tag] = -1;
+   } else {
+   $tags[$tag]--;
+   }
+   }
+
+   $possibles = array();
+   foreach ( $tags as $element = $num ) {
+   if ( $num  0 ) {
+   $possibles[] = '' . $element . '';
+   } else if ( $num  0 ) {
+   $possibles[] = '/' . $element . '';
+   }
+   }
+   return $possibles;
+   }
+
+   /**
 * A preview/confirmation screen
 *
 * @param $data Array
@@ -234,6 +295,16 @@
$this-status-fatal( 'massmessage-unescaped-langlinks' 
);
}
 
+   // Check for unclosed HTML tags (Bug 54909)
+   $unclosedTags = $this-getUnclosedTags( $message );
+   if ( !empty( $unclosedTags ) ) {
+   $this-status-fatal(
+   $this-msg( 'massmessage-badhtml' )
+   -params( htmlspecialchars( implode( ', 
', $unclosedTags ) ) )
+   -numParams( count( $unclosedTags ) )
+   );
+   }
+
// Check for no timestamp (Bug 54848)
if ( !preg_match( MassMessage::getTimestampRegex(), 
$content-getNativeData() ) ) {
$this-status-fatal( 'massmessage-no-timestamp' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica688adc8593cbf13bdc076b22ccaf31fbd65476
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MassMessage
Gerrit-Branch: master
Gerrit-Owner: Wctaiwan wctai...@gmail.com

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


[MediaWiki-commits] [Gerrit] Never modify fingerprint when validating - change (mediawiki...Wikibase)

2014-05-16 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has uploaded a new change for review.

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

Change subject: Never modify fingerprint when validating
..

Never modify fingerprint when validating

Change-Id: I550e81ddc2ae0c918e5f3e8d7fffb6098ccb4eec
---
M repo/includes/ChangeOp/ChangeOpDescription.php
M repo/includes/ChangeOp/ChangeOpLabel.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpDescriptionTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpLabelTest.php
4 files changed, 28 insertions(+), 14 deletions(-)


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

diff --git a/repo/includes/ChangeOp/ChangeOpDescription.php 
b/repo/includes/ChangeOp/ChangeOpDescription.php
index e99d13d..3a03414 100644
--- a/repo/includes/ChangeOp/ChangeOpDescription.php
+++ b/repo/includes/ChangeOp/ChangeOpDescription.php
@@ -123,7 +123,7 @@
$fingerprintValidator = 
$this-termValidatorFactory-getFingerprintValidator( $entity-getType() );
 
// check that the language is valid
-   $result = $languageValidator-validate( $this-language );
+   $result = clone $languageValidator-validate( $this-language );
 
if ( $result-isValid()  $this-description !== null ) {
// Check that the new description is valid
diff --git a/repo/includes/ChangeOp/ChangeOpLabel.php 
b/repo/includes/ChangeOp/ChangeOpLabel.php
index e3578cc..16558ab 100644
--- a/repo/includes/ChangeOp/ChangeOpLabel.php
+++ b/repo/includes/ChangeOp/ChangeOpLabel.php
@@ -142,7 +142,7 @@
}
 
// Check if the new fingerprint of the entity is valid (e.g. if 
the label is unique)
-   $fingerprint = $entity-getFingerprint();
+   $fingerprint = clone $entity-getFingerprint();
$this-updateFingerprint( $fingerprint );
 
$result = $fingerprintValidator-validateFingerprint(
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpDescriptionTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpDescriptionTest.php
index f3e59d7..d5ab185 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpDescriptionTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpDescriptionTest.php
@@ -69,10 +69,11 @@
$validatorFactory = $this-getTermValidatorFactory();
 
$args = array();
-   $args['invalid description'] = array ( new ChangeOpDescription( 
'fr', 'INVALID', $validatorFactory ) );
-   $args['duplicate description'] = array ( new 
ChangeOpDescription( 'fr', 'DUPE', $validatorFactory ) );
-   $args['invalid language'] = array ( new ChangeOpDescription( 
'INVALID', 'valid', $validatorFactory ) );
-   $args['set bad language to null'] = array ( new 
ChangeOpDescription( 'INVALID', null, $validatorFactory ), 'INVALID' );
+   $args['valid description'] = array ( new ChangeOpDescription( 
'fr', 'valid', $validatorFactory ), true );
+   $args['invalid description'] = array ( new ChangeOpDescription( 
'fr', 'INVALID', $validatorFactory ), false );
+   $args['duplicate description'] = array ( new 
ChangeOpDescription( 'fr', 'DUPE', $validatorFactory ), false );
+   $args['invalid language'] = array ( new ChangeOpDescription( 
'INVALID', 'valid', $validatorFactory ), false );
+   $args['set bad language to null'] = array ( new 
ChangeOpDescription( 'INVALID', null, $validatorFactory ), false );
 
return $args;
}
@@ -81,12 +82,18 @@
 * @dataProvider validateProvider
 *
 * @param ChangeOp $changeOp
+* @param bool $valid
 */
-   public function testValidate( ChangeOp $changeOp ) {
+   public function testValidate( ChangeOp $changeOp, $valid ) {
$entity = $this-provideNewEntity();
 
+   $oldLabels = $entity-getDescriptions();
+
$result = $changeOp-validate( $entity );
-   $this-assertFalse( $result-isValid() );
+   $this-assertEquals( $valid, $result-isValid(), 'isValid()' );
+
+   // labels should not have changed during validation
+   $this-assertEquals( $oldLabels, $entity-getDescriptions(), 
'Descriptions modified by validation!' );
}
 
/**
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpLabelTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpLabelTest.php
index 5f069dc..3f929ac 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpLabelTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpLabelTest.php
@@ -69,10 +69,11 @@
$validatorFactory = $this-getTermValidatorFactory();
 
$args = array();
-   $args['invalid label'] = array ( new ChangeOpLabel( 'fr', 
'INVALID', $validatorFactory ) );
-   

[MediaWiki-commits] [Gerrit] Use TextExtracts and PageImages extensions - change (mediawiki...TwitterCards)

2014-05-16 Thread Yuvipanda (Code Review)
Yuvipanda has submitted this change and it was merged.

Change subject: Use TextExtracts and PageImages extensions
..


Use TextExtracts and PageImages extensions

TextExtracts provides clean plain text summaries of article context,
and PageImages selects useful images to be used for display, as can
be seen by their usage in Popups. This adds a hard dependency
upon both extensions.

The extension now creates summary type cards, which works best
for Wikipedia-type content. We'll probably want to add galleries
and photo cards for Commons and other projects.

An internal API call is made to communicate with TextExtracts
and PageImages.

$wgTwitterCardsHandle was added to specify the site's twitter handle
rather than falling back to $wgSitename.

This also fixes bug 62134 since we no longer use WikiPage (which was
never necessary to begin with).

Bug: 62134
Change-Id: I8e22a7a13aada2fb3b446923cec13b8496b9bc7a
---
M TwitterCards.php
1 file changed, 61 insertions(+), 73 deletions(-)

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



diff --git a/TwitterCards.php b/TwitterCards.php
index 4de577c..02a9e27 100644
--- a/TwitterCards.php
+++ b/TwitterCards.php
@@ -3,6 +3,7 @@
  * TwitterCards
  * Extensions
  * @author Harsh Kothari (http://mediawiki.org/wiki/User:Harsh4101991) 
harshkothari...@gmail.com
+ * @author Kunal Mehta lego...@gmail.com
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  *
  * This program is free software; you can redistribute it and/or
@@ -15,102 +16,89 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
-if ( !defined( 'MEDIAWIKI' ) ) die( This is an extension to the MediaWiki 
package and cannot be run standalone. );
+if ( !defined( 'MEDIAWIKI' ) ) {
+   die( This is an extension to the MediaWiki package and cannot be run 
standalone. );
+}
 
-$wgExtensionCredits['parserhook'][] = array (
+$wgExtensionCredits['other'][] = array (
'path' = __FILE__,
'name' = 'TwitterCards',
-   'author' = 'Harsh Kothari',
+   'author' = array( 'Harsh Kothari', 'Kunal Mehta' ),
'descriptionmsg' = 'twittercards-desc',
'url' = 'https://www.mediawiki.org/wiki/Extension:TwitterCards',
 );
+
+/**
+ * Set this to your wiki's twitter handle
+ * for example: '@wikipedia'
+ * @var string
+ */
+$wgTwitterCardsHandle = '';
 
 $wgExtensionMessagesFiles['TwitterCardsMagic'] = __DIR__ . 
'/TwitterCards.magic.php';
 $wgMessagesDirs['TwitterCards'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['TwitterCards'] = __DIR__ . '/TwitterCards.i18n.php';
 
-$wgHooks['BeforePageDisplay'][] = 'efTwitterCardsHook';
+$wgHooks['BeforePageDisplay'][] = 'efTwitterCardsSummary';
 
 /**
  * Adds TwitterCards metadata for Images.
  * This is a callback method for the BeforePageDisplay hook.
  *
- * @param $out OutputPage The output page
- * @param $sk SkinTemplate The skin template
- * @return Boolean always true, to go on with BeforePageDisplay processing
+ * @param OutputPage $out
+ * @param SkinTemplate $sk
+ * @return bool
  */
-function efTwitterCardsHook( $out, $sk ) {
-   global $wgLogo, $wgSitename, $wgUploadPath, $wgServer, $wgArticleId;
+function efTwitterCardsSummary( OutputPage $out, SkinTemplate $sk ) {
+   global $wgTwitterCardsHandle;
 
-   $title = $out-getTitle();
-   $isMainpage = $title-isMainPage();
-
-   $meta = array();
-   $meta[twitter:card] = photo; // current proof of concept is 
tailored to work with images
-   $meta[twitter:site] = $wgSitename;
-
-   $dbr = wfGetDB( DB_SLAVE );
-   $pageId = $out-getWikiPage()-getId();
-   $res = $dbr-select(
-   'revision',
-   'rev_user_text',
-   'rev_page = ' . $pageId . '',
-   __METHOD__,
-   array( 'ORDER BY' = 'rev_timestamp ASC limit 1' )
-   );
-   if ( $row = $res-fetchObject() ) {
-   $meta[twitter:creator] = $row-rev_user_text;
-   }
-
-   $meta[twitter:title] = $title-getText();
-   $img_name = $title-getText();
-
-   if ( isset( $out-mDescription ) ) {
-   // Uses the Description2 extension
-   $meta[twitter:description] = $out-mDescription;
-   } else {
-   // Gets description for content
-   $dbr = wfGetDB( DB_SLAVE );
-   $img_name = str_replace(' ', '_', $img_name); //TODO: use Title 
object instead to get a proper title
-   $res = $dbr-select(
-   'image',
-   'img_description',
-   'img_name = ' . $img_name . '',
-   __METHOD__,
-   array( 'ORDER BY' = 'img_description ASC limit 1' )
-   );
-   if ( $row = $res-fetchObject() ) {
-   $meta[twitter:description] = 

[MediaWiki-commits] [Gerrit] Revert Minimal zoom implementation. - change (mediawiki...MultimediaViewer)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Revert Minimal zoom implementation.
..


Revert Minimal zoom implementation.

Per the design meeting, we are abandoning this feature for now - there is not 
enough time to ensure it is of acceptable quality.

This reverts commit 4329d453ecf4eaef6aba2b3744fa571ab1e1647e.

Change-Id: I27c113ffecb617d442557163722ea5181ed0b2f4
---
D resources/mmv/img/ajax-loader.gif
M resources/mmv/mmv.js
M resources/mmv/mmv.lightboxinterface.js
M resources/mmv/ui/mmv.ui.canvas.js
M resources/mmv/ui/mmv.ui.canvasButtons.js
M resources/mmv/ui/mmv.ui.canvasButtons.less
M tests/qunit/mmv/mmv.lightboxinterface.test.js
M tests/qunit/mmv/mmv.test.js
8 files changed, 24 insertions(+), 214 deletions(-)

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



diff --git a/resources/mmv/img/ajax-loader.gif 
b/resources/mmv/img/ajax-loader.gif
deleted file mode 100644
index 3288d10..000
--- a/resources/mmv/img/ajax-loader.gif
+++ /dev/null
Binary files differ
diff --git a/resources/mmv/mmv.js b/resources/mmv/mmv.js
index 55578b9..6725847 100755
--- a/resources/mmv/mmv.js
+++ b/resources/mmv/mmv.js
@@ -282,7 +282,6 @@
start = $.now();
 
imagePromise = this.fetchThumbnailForLightboxImage( image, 
imageWidths.real );
-   metadataPromise = this.fetchSizeIndependentLightboxInfo( 
image.filePageTitle );
 
this.resetBlurredThumbnailStates();
if ( imagePromise.state() === 'pending' ) {
@@ -290,7 +289,6 @@
}
 
this.setupProgressBar( image, imagePromise, imageWidths.real );
-   this.setupZoomControl( image, metadataPromise, 
imageWidths.cssWidth );
 
imagePromise.done( function ( thumbnail, imageElement ) {
if ( viewer.currentIndex !== image.index ) {
@@ -305,7 +303,9 @@
viewer.ui.canvas.showError( error );
} );
 
-   metadataPromise.done( function ( imageInfo, repoInfo, 
localUsage, globalUsage, userInfo ) {
+   metadataPromise = this.fetchSizeIndependentLightboxInfo(
+   image.filePageTitle
+   ).done( function ( imageInfo, repoInfo, localUsage, 
globalUsage, userInfo ) {
if ( viewer.currentIndex !== image.index ) {
return;
}
@@ -520,119 +520,6 @@
};
 
/**
-* Returns the original size of the image (i.e. the size of the full 
image, as opposed to the
-* size of the thumbnail). This information might or might not be 
available in the HTML source;
-* when it is not, we need to wait for the API response.
-* @param {mw.mmv.LightboxImage} image
-* @param {jQuery.Promise.mw.mmv.model.Image} metadataPromise
-* @returns {jQuery.Promise.number, number} width and height of the 
original image in pixels
-*/
-   MMVP.fetchOriginalImageSize = function ( image, metadataPromise ) {
-   if ( image.originalWidth  image.originalHeight ) {
-   return $.when( image.originalWidth, 
image.originalHeight );
-   } else {
-   return metadataPromise.then( function ( imageInfo ) {
-   return $.when( imageInfo.width, 
imageInfo.height );
-   } );
-   }
-   };
-
-   /**
-* Displays a zoom icon if the image can be zoomed.
-* @param {mw.mmv.LightboxImage} image
-* @param {jQuery.Promise.mw.mmv.model.Image} metadataPromise
-* @param {number} imageWidth needed for caching progress
-*/
-   MMVP.setupZoomControl = function ( image, metadataPromise, imageWidth ) 
{
-   var viewer = this,
-   originalWidthPromise = this.fetchOriginalImageSize( 
image, metadataPromise );
-
-   if ( originalWidthPromise.state() === 'pending' ) {
-   this.ui.buttons.toggleZoom( false ); // hide zoom while 
we don't know if it's available
-   }
-   originalWidthPromise.done( function ( originalImageWidth ) {
-   if ( viewer.currentIndex === image.index ) {
-   viewer.ui.buttons.toggleZoom( 
originalImageWidth  imageWidth );
-   }
-   });
-   };
-
-   /**
-* When showing a large image for zoom, it will be never larger than 
this.
-* @property {number}
-*/
-   MMVP.MAX_ZOOM_WIDTH = 3000;
-
-   /**
-* Fetches data needed for zooming and forvards it to the canvas.
-*/
-   MMVP.zoom = function () {
-   var zoomWindow,
-   metadataPromise, originalWidthPromise, thumbnailPromise,
-   viewer = 

[MediaWiki-commits] [Gerrit] (bugfix) manual is not a dict and can't be used for transl... - change (pywikibot/core)

2014-05-16 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

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

Change subject: (bugfix) manual is not a dict and can't be used for 
translation
..

(bugfix) manual is not a dict and can't be used for translation

on the other hand we have these translations on mediawiki and the
L10N_msg is obsolete. Update this part from compat.

Change-Id: I9e0903f5a93dd4cd5da342a591c68c59267ffef7
---
M scripts/reflinks.py
1 file changed, 8 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/78/133678/1

diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 4ec04a1..cf88bc8 100644
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -60,14 +60,10 @@
 'params;': pagegenerators.parameterHelp
 }
 
-localized_msg = ('fr', )  # localized message at mediawik
+localized_msg = ('fr', 'it', 'pl')  # localized message at mediawiki
 
 # localized message at specific wikipedia site
 # should be moved to mediawiki pywikibot manual
-L10N_msg = {
-'it': u'Utente:Marco27Bot/refLinks.py',
-'pl': u'Wikipedysta:MastiBot/refLinks',
-}
 
 
 stopPage = {
@@ -404,16 +400,13 @@
 self.site = pywikibot.Site()
 # Check
 manual = 'mw:Manual:Pywikibot/refLinks'
-if self.site.family.name == 'wikipedia':
-manual = pywikibot.translate(self.site.code, manual)
-else:
-code = None
-for alt in [self.site.code] + i18n._altlang(self.site.code):
-if alt in localized_msg:
-code = alt
-break
-if code:
-manual += '/%s' % code
+code = None
+for alt in [self.site.code] + i18n._altlang(self.site.code):
+if alt in localized_msg:
+code = alt
+break
+if code:
+manual += '/%s' % code
 self.msg = i18n.twtranslate(self.site, 'reflinks-msg', locals())
 self.stopPage = pywikibot.Page(self.site,
pywikibot.translate(self.site, 
stopPage))

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e0903f5a93dd4cd5da342a591c68c59267ffef7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

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


[MediaWiki-commits] [Gerrit] Fix PreviewTaskTests - change (apps...wikipedia)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix PreviewTaskTests
..


Fix PreviewTaskTests

The server response now includes more HTML classes:
icon icon-32px icon-edit enabled

Change-Id: I5a1cc787309a2bec4fbed663625b745f4ff9c89f
---
M wikipedia-it/src/main/java/org/wikipedia/test/PreviewTaskTests.java
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git 
a/wikipedia-it/src/main/java/org/wikipedia/test/PreviewTaskTests.java 
b/wikipedia-it/src/main/java/org/wikipedia/test/PreviewTaskTests.java
index ba87a37..27e0782 100644
--- a/wikipedia-it/src/main/java/org/wikipedia/test/PreviewTaskTests.java
+++ b/wikipedia-it/src/main/java/org/wikipedia/test/PreviewTaskTests.java
@@ -20,8 +20,7 @@
 final PageTitle title = new PageTitle(null, 
Test_page_for_app_testing/Section1, new Site(test.wikipedia.org));
 long randomTime = System.currentTimeMillis();
 final String wikitext = == Section 2 ==\n\nEditing section INSERT 
RANDOM  HERE test at  + randomTime;
-final String expected = div/divh2span class=\mw-headline\ 
id=\Section_2\Section 2/spana href=\#editor/1\ data-section=\1\ 
class=\edit-page\Edit/a/h2div\npEditing section INSERT RANDOM amp; 
HERE test at  + randomTime + /p\n\n\n\n/div;
-final WikipediaApp app = 
(WikipediaApp)getInstrumentation().getTargetContext().getApplicationContext();
+final String expected = div/divh2span class=\mw-headline\ 
id=\Section_2\Section 2/spana href=\#editor/1\ data-section=\1\ 
class=\edit-page icon icon-32px icon-edit 
enabled\Edit/a/h2div\npEditing section INSERT RANDOM amp; HERE test 
at  + randomTime + /p\n\n\n\n/div;
 final CountDownLatch completionLatch = new CountDownLatch(1);
 runTestOnUiThread(new Runnable() {
 @Override

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5a1cc787309a2bec4fbed663625b745f4ff9c89f
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: BearND bsitzm...@wikimedia.org
Gerrit-Reviewer: Brion VIBBER br...@wikimedia.org
Gerrit-Reviewer: Dbrant dbr...@wikimedia.org
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com
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 PageTitleTests - change (apps...wikipedia)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix PageTitleTests
..


Fix PageTitleTests

Got an ArrayOutOfBoundsException when parsing /wiki/Talk:India#.
When we encountered a hash at the end of the string we tried to
access text.split(#)[1]. Boom!

Change-Id: Ib80ab7e770e05510a7a4eb63341ee0de32f2792d
---
M wikipedia-it/src/main/java/org/wikipedia/test/PageTitleTests.java
M wikipedia/src/main/java/org/wikipedia/PageTitle.java
2 files changed, 7 insertions(+), 6 deletions(-)

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



diff --git a/wikipedia-it/src/main/java/org/wikipedia/test/PageTitleTests.java 
b/wikipedia-it/src/main/java/org/wikipedia/test/PageTitleTests.java
index e0611d9..c31ec46 100644
--- a/wikipedia-it/src/main/java/org/wikipedia/test/PageTitleTests.java
+++ b/wikipedia-it/src/main/java/org/wikipedia/test/PageTitleTests.java
@@ -45,7 +45,7 @@
 
 
assertEquals(enwiki.titleForInternalLink(/wiki/Talk:India#).getNamespace(), 
Talk);
 
assertEquals(enwiki.titleForInternalLink(/wiki/Talk:India#).getText(), 
India);
-
assertEquals(enwiki.titleForInternalLink(/wiki/Talk:India#).getFragment(), 
);
+
assertEquals(enwiki.titleForInternalLink(/wiki/Talk:India#).getFragment(), 
null);
 
 
assertEquals(enwiki.titleForInternalLink(/wiki/Talk:India#History).getNamespace(),
 Talk);
 
assertEquals(enwiki.titleForInternalLink(/wiki/Talk:India#History).getText(), 
India);
diff --git a/wikipedia/src/main/java/org/wikipedia/PageTitle.java 
b/wikipedia/src/main/java/org/wikipedia/PageTitle.java
index c16b3fd..dde0f6b 100644
--- a/wikipedia/src/main/java/org/wikipedia/PageTitle.java
+++ b/wikipedia/src/main/java/org/wikipedia/PageTitle.java
@@ -38,20 +38,21 @@
 // If empty, this refers to the main page.
 text = MainPageNameData.valueFor(site.getLanguage());
 }
-String[] parts;
-if (text.indexOf(#) != -1) {
+
+String[] fragParts = text.split(#);
+text = fragParts[0];
+if (fragParts.length  1) {
 try {
-this.fragment = URLDecoder.decode(text.split(#)[1], utf-8);
-parts = text.split(#)[0].split(:);
+this.fragment = URLDecoder.decode(fragParts[1], utf-8);
 } catch (UnsupportedEncodingException e) {
 // STUPID STUPID JAVA
 throw new RuntimeException(e);
 }
 } else {
 this.fragment = null;
-parts = text.split(:);
 }
 
+String[] parts = text.split(:);
 if (parts.length  1) {
 this.namespace = parts[0];
 this.text = TextUtils.join(:, Arrays.copyOfRange(parts, 1, 
parts.length));

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib80ab7e770e05510a7a4eb63341ee0de32f2792d
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: BearND bsitzm...@wikimedia.org
Gerrit-Reviewer: Brion VIBBER br...@wikimedia.org
Gerrit-Reviewer: Dbrant dbr...@wikimedia.org
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Bumping up wikimetrics module - change (operations/puppet)

2014-05-16 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged.

Change subject: Bumping up wikimetrics module
..


Bumping up wikimetrics module

Upstart configuration for wikimetrics daemons
uses exec instead of script stanza. See changeset:
https://gerrit.wikimedia.org/r/#/c/130588/

Change-Id: Ie12b96d907863c4b453a114f9f9de9ddf8afd74c
---
M modules/wikimetrics
1 file changed, 0 insertions(+), 0 deletions(-)

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



diff --git a/modules/wikimetrics b/modules/wikimetrics
index f9ad156..29ac957 16
--- a/modules/wikimetrics
+++ b/modules/wikimetrics
-Subproject commit f9ad1560b61684527479f077b5b4111d4bba7b85
+Subproject commit 29ac9573fc57c0970765d203d2ef1eb4c8b89ce0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie12b96d907863c4b453a114f9f9de9ddf8afd74c
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Nuria nu...@wikimedia.org
Gerrit-Reviewer: Ottomata o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] bacula: allow mysqldumps to be kept locally - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: bacula: allow mysqldumps to be kept locally
..


bacula: allow mysqldumps to be kept locally

Should a local_dump_dir parameter be defined and mysqldump version is
using keep a dump locally in the machine in the directory defined by the
parameter. While at it create rspec rules for it

Change-Id: Ib13604d83dd2a47467da41e6d6a01f9346b211f9
---
M manifests/backups.pp
M manifests/role/backup.pp
M modules/bacula/manifests/client/job.pp
M modules/bacula/manifests/client/mysql-bpipe.pp
M modules/bacula/manifests/director/fileset.pp
A modules/bacula/spec/defines/mysql-bpipe_spec.rb
M modules/bacula/templates/bacula-client-job.erb
M modules/bacula/templates/bacula-dir-fileset.erb
M modules/bacula/templates/bpipe-mysql-db.erb
A templates/backups/mysql-predump.erb
10 files changed, 281 insertions(+), 22 deletions(-)

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



diff --git a/manifests/backups.pp b/manifests/backups.pp
index f74bb9e..805ca49 100644
--- a/manifests/backups.pp
+++ b/manifests/backups.pp
@@ -51,11 +51,54 @@
 }
 }
 
-class backup::mysqlhost($xtrabackup=true, $per_db=false, $innodb_only=false) {
-bacula::client::mysql-bpipe { x${xtrabackup}-p${per_db}-i${innodb_only}:
-per_database   = $per_db,
-xtrabackup = $xtrabackup,
-mysqldump_innodb_only  = $innodb_only,
+define backup::mysqlset($method='bpipe',
+$xtrabackup=true,
+$per_db=false,
+$innodb_only=false,
+$local_dump_dir=undef,
+$password_file=undef,
+$mysql_binary=undef,
+$mysqldump_binary=undef,
+) {
+
+$allowed_methods = [ 'bpipe', 'predump' ]
+if !($method in $allowed_methods) {
+fail($method is not allowed)
+}
+
+if !defined(Package['pigz']) {
+package { 'pigz':
+ensure = present,
+}
+}
+$jobdefaults = $backup::host::jobdefaults
+if $method == 'predump' {
+$extras = {
+ 'ClientRunBeforeJob' =  '/etc/bacula/scripts/predump',
+}
+$basefileset = regsubst(regsubst($local_dump_dir,'/',''),'/','-','G')
+$fileset = mysql-${basefileset}
+
+} elsif $method == 'bpipe' {
+bacula::client::mysql-bpipe { 
mysql-bpipe-x${xtrabackup}-p${per_db}-i${innodb_only}:
+per_database  = $per_db,
+xtrabackup= $xtrabackup,
+mysqldump_innodb_only = $innodb_only,
+local_dump_dir= $local_dump_dir,
+password_file = $password_file,
+mysql_binary  = $mysql_binary,
+mysqldump_binary  = $mysqldump_binary,
+}
+$extras = undef
+$fileset = mysql-${method}-x${xtrabackup}-p${per_db}-i${innodb_only}
+}
+
+if $jobdefaults != undef {
+@bacula::client::job { mysql-${method}-${name}-${jobdefaults}:
+fileset = $fileset,
+jobdefaults = $jobdefaults,
+extras  = $extras,
+}
 }
 }
 
diff --git a/manifests/role/backup.pp b/manifests/role/backup.pp
index 7ea800a..c1a7311 100644
--- a/manifests/role/backup.pp
+++ b/manifests/role/backup.pp
@@ -131,6 +131,42 @@
 bacula::director::fileset { 'var-vmail':
 includes = [ '/var/vmail' ]
 }
+bacula::director::fileset { 'mysql-bpipe-xfalse-pfalse-ifalse':
+includes = [],
+plugins  = [ 'mysql-bpipe-xfalse-pfalse-ifalse',]
+}
+bacula::director::fileset { 'mysql-bpipe-xfalse-pfalse-itrue':
+includes = [],
+plugins  = [ 'mysql-bpipe-xfalse-pfalse-itrue',]
+}
+bacula::director::fileset { 'mysql-bpipe-xfalse-ptrue-ifalse':
+includes = [],
+plugins  = [ 'mysql-bpipe-xfalse-ptrue-ifalse',]
+}
+bacula::director::fileset { 'mysql-bpipe-xfalse-ptrue-itrue':
+includes = [],
+plugins  = [ 'mysql-bpipe-xfalse-ptrue-itrue',]
+}
+bacula::director::fileset { 'mysql-bpipe-xtrue-pfalse-ifalse':
+includes = [],
+plugins  = [ 'mysql-bpipe-xtrue-pfalse-ifalse',]
+}
+bacula::director::fileset { 'mysql-bpipe-xtrue-pfalse-itrue':
+includes = [],
+plugins  = [ 'mysql-bpipe-xtrue-pfalse-itrue',]
+}
+bacula::director::fileset { 'mysql-bpipe-xtrue-ptrue-ifalse':
+includes = [],
+plugins  = [ 'mysql-bpipe-xtrue-ptrue-ifalse',]
+}
+bacula::director::fileset { 'mysql-bpipe-xtrue-ptrue-itrue':
+includes = [],
+plugins  = [ 'mysql-bpipe-xtrue-ptrue-itrue',]
+}
+bacula::director::fileset { 'bpipe-mysql-xfalse-ptrue-itrue':
+includes = [],
+plugins  = [ 'bpipe-mysql-xfalse-ptrue-itrue'],
+}
 
 # The console should be 

[MediaWiki-commits] [Gerrit] Fix bug 55265 - change (pywikibot/compat)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix bug 55265
..


Fix bug 55265

Just adding Category: prefix in order to avoid any misinterpretation between 
namespace and il prefix
and using cat.title() instead of catTitle in order to avoid the bug

Change-Id: I072ebf11b2360fe9c04c23fa423bb44b4169db58
---
M category.py
M catlib.py
2 files changed, 3 insertions(+), 5 deletions(-)

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



diff --git a/category.py b/category.py
index 59ffddc..659cae5 100644
--- a/category.py
+++ b/category.py
@@ -415,14 +415,12 @@
 site = pywikibot.getSite()
 newCat = catlib.Category(site, self.newCatTitle)
 # set edit summary message
-
 if self.useSummaryForDeletion and self.editSummary:
 reason = self.editSummary
 else:
 reason = i18n.twtranslate(site, 'category-was-moved',
   {'newcat': self.newCatTitle,
'title': self.newCatTitle})
-
 if not self.editSummary:
 self.editSummary = i18n.twtranslate(site, 'category-changing',
 {'oldcat': self.oldCat.title(),
@@ -433,7 +431,7 @@
 oldMovedTalk = None
 if self.oldCat.exists() and self.moveCatPage:
 copied = self.oldCat.copyAndKeep(
-self.newCatTitle, pywikibot.translate(site, cfd_templates))
+newCat.title(), pywikibot.translate(site, cfd_templates))
 # Also move the talk page
 if copied:
 oldTalk = self.oldCat.toggleTalkPage()
diff --git a/catlib.py b/catlib.py
index 61fd798..6ed4f70 100644
--- a/catlib.py
+++ b/catlib.py
@@ -75,8 +75,8 @@
 self.sortKey = sortKey
 self.sortKeyPrefix = sortKeyPrefix
 if self.namespace() != 14:
-raise ValueError(u'BUG: %s is not in the category namespace!'
- % title)
+pywikibot.Page.__init__(self, site=site, title=Category: + 
title, insite=insite,
+defaultNamespace=14)
 self.completelyCached = False
 self.articleCache = []
 self.subcatCache = []

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I072ebf11b2360fe9c04c23fa423bb44b4169db58
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Xqt i...@gno.de
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 Hygiene: Start using models for history and contribution... - change (mediawiki...MobileFrontend)

2014-05-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: WIP Hygiene: Start using models for history and contributions 
page
..

WIP Hygiene: Start using models for history and contributions page

Remove code duplication.
Create class to capture what an edit is.

Change-Id: I73ce4208f5f3d2f56920202e6c7dd6be86c46fdf
---
M MobileFrontend.php
A includes/models/MobileFrontendEdit.php
M includes/specials/MobileSpecialPageFeed.php
M includes/specials/SpecialMobileContributions.php
M includes/specials/SpecialMobileHistory.php
5 files changed, 143 insertions(+), 130 deletions(-)


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

diff --git a/MobileFrontend.php b/MobileFrontend.php
index 383ce05..81a2e3b 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -85,6 +85,8 @@
'MinervaTemplateBeta' = 'skins/MinervaTemplateBeta',
'MinervaTemplateAlpha' = 'skins/MinervaTemplateAlpha',
 
+   'MobileFrontendEdit' = 'models/MobileFrontendEdit',
+
'SkinMinerva' = 'skins/SkinMinerva',
'SkinMinervaBeta' = 'skins/SkinMinervaBeta',
'SkinMinervaAlpha' = 'skins/SkinMinervaAlpha',
diff --git a/includes/models/MobileFrontendEdit.php 
b/includes/models/MobileFrontendEdit.php
new file mode 100644
index 000..9e3d0d1
--- /dev/null
+++ b/includes/models/MobileFrontendEdit.php
@@ -0,0 +1,114 @@
+?php
+/**
+ * Models a single MediaWiki edit
+ * @todo FIXME: Upstream to core under generic Edit class name
+ */
+class MobileFrontendEdit {
+   private $isAnon;
+   private $username;
+   private $currentRevision;
+   private $previousRevision;
+
+   /**
+* Constructs a representation of an edit
+* @param Revision $currentRevision the revision that was the result of 
the edit
+* @param User $user the user who wants to view this edit.
+* @param Revision $previousRevision an earlier revision you want to 
compare to.
+* @return string HTML representing the link in the header bar
+*/
+   public function __construct( Revision $currentRevision, User $user, 
$previousRevision = null ) {
+   $this-user = $user;
+   $this-currentRevision = $currentRevision;
+   $this-previousRevision = $previousRevision;
+
+   $userId = $this-currentRevision-getUser( 
Revision::FOR_THIS_USER, $user );
+   if ( $userId === 0 ) {
+   $this-username = IP::prettifyIP( 
$currentRevision-getRawUserText() );
+   $this-isAnon = true;
+   } else {
+   $this-username = $currentRevision-getUserText( 
Revision::FOR_THIS_USER, $user );
+   $this-isAnon = false;
+   }
+   // FIXME: Style differently user comment when this is the case
+   if ( !$currentRevision-userCan( Revision::DELETED_USER, $user 
) ) {
+   $username = $this-msg( 'rev-deleted-user' )-plain();
+   }
+   }
+
+   public function isMinor() {
+   return $this-currentRevision-isMinor();
+   }
+
+   public function getUsername() {
+   return $this-username;
+   }
+
+   public function isAnon() {
+   return $this-isAnon;
+   }
+
+   public function getBytes() {
+   $bytes = $this-currentRevision-getSize();
+   $prev = $this-previousRevision;
+   if ( $prev ) {
+   $bytes -= $prev-getSize();
+   }
+   return $bytes;
+   }
+
+   public function getTitle() {
+   return $this-currentRevision-getTitle();
+   }
+
+   public function getSummary() {
+   $user = $this-user;
+   $rev = $this-currentRevision;
+   // FIXME: Surface this so callers can style content differently
+   if ( $rev-userCan( Revision::DELETED_COMMENT, $user ) ) {
+   $comment = $this-formatComment(
+   $rev-getComment( Revision::FOR_THIS_USER, 
$user ) );
+   } else {
+   $comment = $this-msg( 'rev-deleted-comment' )-plain();
+   }
+   return $comment;
+   }
+
+   /**
+* Formats an edit comment
+* @param string $comment The raw comment text
+* @fixme: Duplication with SpecialMobileWatchlist
+*
+* @return string HTML code
+*/
+   protected function formatComment( $comment ) {
+   $title = $this-currentRevision-getTitle();
+   if ( $comment === '' ) {
+   $comment = wfMessage( 
'mobile-frontend-changeslist-nocomment' )-plain();
+   } else {
+   $comment = Linker::formatComment( $comment, $title );

[MediaWiki-commits] [Gerrit] WIP: Use MobileFrontendEditCollection model - change (mediawiki...MobileFrontend)

2014-05-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: WIP: Use MobileFrontendEditCollection model
..

WIP: Use MobileFrontendEditCollection model

Change-Id: Ie62537262a03cf27965d3bc986ddb04bb8f6fd04
---
M MobileFrontend.php
A includes/models/MobileFrontendEditCollection.php
M includes/specials/SpecialMobileHistory.php
3 files changed, 67 insertions(+), 16 deletions(-)


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

diff --git a/MobileFrontend.php b/MobileFrontend.php
index 81a2e3b..2aa6a87 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -86,6 +86,7 @@
'MinervaTemplateAlpha' = 'skins/MinervaTemplateAlpha',
 
'MobileFrontendEdit' = 'models/MobileFrontendEdit',
+   'MobileFrontendEditCollection' = 'models/MobileFrontendEditCollection',
 
'SkinMinerva' = 'skins/SkinMinerva',
'SkinMinervaBeta' = 'skins/SkinMinervaBeta',
diff --git a/includes/models/MobileFrontendEditCollection.php 
b/includes/models/MobileFrontendEditCollection.php
new file mode 100644
index 000..a0ba495
--- /dev/null
+++ b/includes/models/MobileFrontendEditCollection.php
@@ -0,0 +1,57 @@
+?php
+/**
+ * Models a collection of MediaWiki edits
+ * @todo FIXME: Upstream to core under generic Edit class name
+ */
+class MobileFrontendEditCollection implements Iterator {
+   private $edits = array();
+
+   public function __construct( $editsArray ) {
+   $this-edits = $editsArray;
+   }
+
+   public function slice( $start, $end = null ) {
+   return array_slice( $this-edits, $start, $end );
+   }
+
+   public function getSize() {
+   return count( $this-edits );
+   }
+
+   public static function newFromRevisionsResultWrapper( $res, $user ) {
+   $rev1 = $rev2 = null;
+   $edits = array();
+   foreach ( $res as $row ) {
+   $rev1 = new Revision( $row );
+   if ( $rev2 ) {
+   $edits[] = new MobileFrontendEdit( $rev2, 
$user, $rev1 );
+   }
+   $rev2 = $rev1;
+   }
+   if ( $rev1 ) {
+   $edits[] = new MobileFrontendEdit( $rev1, $user );
+   }
+   return new MobileFrontendEditCollection( $edits );
+   }
+
+   public function key() {
+   return key( $this-edits );
+   }
+
+   public function rewind() {
+   reset( $this-edits );
+   }
+
+   public function current() {
+   return current( $this-edits );
+   }
+
+   public function next() {
+   return next( $this-edits );
+   }
+
+   public function valid() {
+   $key = key($this-edits);
+   return ( $key !== null  $key !== false );
+   }
+}
diff --git a/includes/specials/SpecialMobileHistory.php 
b/includes/specials/SpecialMobileHistory.php
index 975ab85..a3a76e4 100644
--- a/includes/specials/SpecialMobileHistory.php
+++ b/includes/specials/SpecialMobileHistory.php
@@ -113,10 +113,9 @@
 * @param Revision $rev
 * @param Revision|null $prev
 */
-   protected function showRow( Revision $rev, $prev ) {
+   protected function showEdit( MobileFrontendEdit $edit ) {
wfProfileIn( __METHOD__ );
$user = $this-getUser();
-   $edit = new MobileFrontendEdit( $rev, $user, $prev );
$date = $this-getLanguage()-userDate( $edit-getTimestamp(), 
$user );
$this-renderListHeaderWhereNeeded( $date );
$this-renderFeedItemHtml( $edit );
@@ -137,27 +136,21 @@
}
 
protected function showHistory( ResultWrapper $res ) {
-   $numRows = $res-numRows();
+   $collection = 
MobileFrontendEditCollection::newFromRevisionsResultWrapper(
+   $res, $this-getUser() );
+   $numRows = $collection-getSize();
$rev1 = $rev2 = null;
$out = $this-getOutput();
if ( $numRows  0 ) {
 
-   foreach ( $res as $row ) {
-   $rev1 = new Revision( $row );
-   if ( $rev2 ) {
-   $this-showRow( $rev2, $rev1 );
-   }
-   $rev2 = $rev1;
+   foreach ( $collection-slice( 0, self::LIMIT ) as $edit 
) {
+   $this-showEdit( $edit );
}
-   // Render the original edit which had no preceeding edit
-   if ( $rev1  $numRows  self::LIMIT + 1 ) {
-   $this-showRow( $rev1, null );
-   }
+
  

[MediaWiki-commits] [Gerrit] Fix IE9 history navigation - change (mediawiki...MultimediaViewer)

2014-05-16 Thread Gilles (Code Review)
Gilles has uploaded a new change for review.

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

Change subject: Fix IE9 history navigation
..

Fix IE9 history navigation

Change-Id: I83469fdaa069e80dc17c0c0c307bff7e9b25e468
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/617
---
M resources/mmv/mmv.bootstrap.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/resources/mmv/mmv.bootstrap.js b/resources/mmv/mmv.bootstrap.js
index 8ace3d8..3016da5 100755
--- a/resources/mmv/mmv.bootstrap.js
+++ b/resources/mmv/mmv.bootstrap.js
@@ -355,7 +355,7 @@
MMVB.setupEventHandlers = function () {
var self = this;
 
-   $( window ).on( this.browserHistory ? 'popstate.mmvb' : 
'hashchange', function () {
+   $( window ).on( this.browserHistory  
this.browserHistory.pushState ? 'popstate.mmvb' : 'hashchange', function () {
self.hash();
} );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83469fdaa069e80dc17c0c0c307bff7e9b25e468
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Gilles gdu...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Test patch: Example to illustrate the Grid system (WIP) - change (mediawiki/core)

2014-05-16 Thread Pginer (Code Review)
Pginer has uploaded a new change for review.

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

Change subject: Test patch: Example to illustrate the Grid system (WIP)
..

Test patch: Example to illustrate the Grid system (WIP)

Patch illustrating the use of the grid system.
It modifies the Login form to show responsive layout,
typography and visibility.

To test, go to Special:UserLogin, and resize the window
(or try with different devices).

This patch should not be merged, it is only intended to facilitate the review 
of the grid system one ( https://gerrit.wikimedia.org/r/#/c/125387/ )

Change-Id: Icdab9d521cd134ea1c5efb208e03a1504f9cfbaf
---
M resources/src/mediawiki.ui/components/default/forms.less
M resources/src/mediawiki.ui/vector.less
2 files changed, 34 insertions(+), 1 deletion(-)


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

diff --git a/resources/src/mediawiki.ui/components/default/forms.less 
b/resources/src/mediawiki.ui/components/default/forms.less
index 6157fa2..fa74d1e 100644
--- a/resources/src/mediawiki.ui/components/default/forms.less
+++ b/resources/src/mediawiki.ui/components/default/forms.less
@@ -37,7 +37,7 @@
 .mw-ui-vform {
.box-sizing(border-box);
 
-   width: @defaultFormWidth;
+   //width: @defaultFormWidth;
 
// Immediate divs in a vform are block and spaced-out.
// XXX: We shouldn't depend on the tag name here...
diff --git a/resources/src/mediawiki.ui/vector.less 
b/resources/src/mediawiki.ui/vector.less
index 08690a3..7f01ba5 100644
--- a/resources/src/mediawiki.ui/vector.less
+++ b/resources/src/mediawiki.ui/vector.less
@@ -23,3 +23,36 @@
 @import components/utilities;
 @import components/vector/forms;
 @import components/vector/containers;
+@import mixins/grid;
+
+
+//Example to test the Grid System:
+
+#userloginForm {
+   .mw-ui-grid;
+}
+
+// Responsive layout: Form width is adjusted for different screen sizes:
+
+.mw-ui-vform {
+   .mw-ui-one-whole(@palm);
+   .mw-ui-two-thirds(@lap);
+   .mw-ui-one-third;
+}
+
+//Responsive typography: On small screens, font becomes bigger.
+
+#content {
+   @media @palm {
+   font-size: 1.6em;
+   margin-left: 0 !important;
+   }
+   @media @lap {
+   font-size: 1.2em;
+   }
+}
+
+//Responsive visibility:  On small screens, the  sidebar is hidden:
+#mw-navigation {
+   .mw-ui-hidden(@palm);
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdab9d521cd134ea1c5efb208e03a1504f9cfbaf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Pginer pgi...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Allow for custom templates - change (mediawiki...GWToolset)

2014-05-16 Thread Dan-nl (Code Review)
Dan-nl has uploaded a new change for review.

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

Change subject: Allow for custom templates
..

Allow for custom templates

* added new i18n messages
* added new form fields
* adjusted logic accordingly

Bug: 63889
Change-Id: Ibab2b75e018409e8699a72b9c90cb2eb6a7babf5
---
M i18n/en.json
M i18n/qqq.json
M includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
M includes/Forms/MetadataDetectForm.php
M includes/Forms/MetadataMappingForm.php
M includes/Handlers/Forms/MetadataDetectHandler.php
M includes/Models/MediawikiTemplate.php
7 files changed, 102 insertions(+), 32 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GWToolset 
refs/changes/84/133684/1

diff --git a/i18n/en.json b/i18n/en.json
index 3a6258b..154935e 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1,7 +1,7 @@
 {
@metadata: {
authors: [
-   dan-nl,
+   dan entous,
Brian Wolff,
Siebrand Mazeland,
Shirayuki,
@@ -86,7 +86,6 @@
gwtoolset-file-interpretation-error: There was a problem processing 
the metadata file.,
gwtoolset-mediawiki-template: Template $1,
gwtoolset-metadata-user-options-error: The following form 
{{PLURAL:$2|field|fields}} must be filled in:\n$1,
-   gwtoolset-metadata-invalid-template: No valid MediaWiki template 
found.,
gwtoolset-menu: * $1,
gwtoolset-menu-1: Metadata mapping,
gwtoolset-technical-error: There was a technical error.,
@@ -201,5 +200,10 @@
gwtoolset-verify-php-version: The $1 extension requires PHP = 
5.3.3.,
gwtoolset-verify-uploads-enabled: The $1 extension requires that 
file uploads are enabled.\n\nPlease make sure that 
code$wgEnableUploads/code is set to codetrue/code in 
codeLocalSettings.php/code.,
gwtoolset-verify-xmlreader: The $1 extension requires that PHP 
[http://www.php.net/manual/en/xmlreader.setup.php XMLReader] be installed.,
-   gwtoolset-wiki-checks-not-passed: Wiki checks did not pass
+   gwtoolset-wiki-checks-not-passed: Wiki checks did not pass,
+   gwtoolset-select-template: select a template:,
+   gwtoolset-select-custom-template: or enter a custom template:,
+   gwtoolset-no-templatedata: There is no 
codelt;templatedata/code block for template $1.\n\nIf possible, add a $2 
to the template, or to the template's $3.,
+   gwtoolset-templatedata-link-text: codelt;templatedata/code 
block,
+   gwtoolset-templatebox-link-text: codeTemplateBox/code
 }
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 0794712..04d625d 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -198,5 +198,10 @@
gwtoolset-verify-php-version: Message that appears when the PHP 
version is less than version 5.3.3. Parameters:\n* $1 - \GWToolset\ 
(untranslatable),
gwtoolset-verify-uploads-enabled: Message that appears when the wiki 
does not allow file uploads. Parameters:\n* $1 - \GWToolset\ 
(untranslatable),
gwtoolset-verify-xmlreader: Message that appears when PHP XMLReader 
is not available. Parameters:\n* $1 - \GWToolset\ (untranslatable),
-   gwtoolset-wiki-checks-not-passed: Heading used when a wiki 
requirement is not met.
+   gwtoolset-wiki-checks-not-passed: Heading used when a wiki 
requirement is not met.,
+   gwtoolset-select-template: Label for the corresponding field in Step 
1: Metadata detection.,
+   gwtoolset-select-custom-template: Label for the corresponding field 
in Step 1: Metadata detection.,
+   gwtoolset-no-templatedata: Message that appears when there is no 
templatedata for a MediaWiki template chosen in Step 1: Metadata detection. 
Parameters:\n* $1 - the name of the chosen template\n* $2 - a link to the 
MediaWiki templatedata help page for adding a templatedata block to a 
template\n* $3 - a link to the commons help page for adding templatedata to a 
template's templatebox,
+   gwtoolset-templatedata-link-text: Text for the templatedata link.,
+   gwtoolset-templatebox-link-text: Text for the templatebox link.
 }
diff --git a/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php 
b/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
index 206dd35..012256f 100644
--- a/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
+++ b/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php
@@ -14,6 +14,7 @@
GWToolset\Config,
GWToolset\GWTException,
GWToolset\Utils,
+   Linker,
Title;
 
 class MediawikiTemplatePhpAdapter implements DataAdapterInterface {
@@ -47,19 +48,6 @@
$result = array( 'mediawiki_template_json' = '' );
$template_data = null;
 
-   // should we limit the mw templates we allow?
-   // 2013-09-26 w/david haskia, for now, yes
-   if ( !isset(
-

[MediaWiki-commits] [Gerrit] Wait some more for the close button to appear - change (mediawiki...MultimediaViewer)

2014-05-16 Thread Gilles (Code Review)
Gilles has uploaded a new change for review.

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

Change subject: Wait some more for the close button to appear
..

Wait some more for the close button to appear

During the warmup steps Media Viewer might take some time
to open, which might be why the close button won't appear in
less than 5 seconds

Change-Id: I3b17d46c3343f2b1ff33aaaf55faa4adb71cb218
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/618
---
M tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git 
a/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb 
b/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb
index 2c56f94..5ce 100644
--- a/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb
+++ b/tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb
@@ -28,7 +28,7 @@
 end
 
 When(/^I close MMV$/) do
-  on(E2ETestPage).mmv_close_button_element.when_present.click
+  on(E2ETestPage).mmv_close_button_element.when_present(30).click
 end
 
 When(/^I press the browser back button$/) do

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b17d46c3343f2b1ff33aaaf55faa4adb71cb218
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Gilles gdu...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] pool db1071 and db1071 in s1, warm up - change (operations/mediawiki-config)

2014-05-16 Thread Springle (Code Review)
Springle has uploaded a new change for review.

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

Change subject: pool db1071 and db1071 in s1, warm up
..

pool db1071 and db1071 in s1, warm up

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


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

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 5e3c813..8d38c7b 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -94,6 +94,8 @@
'db1062' = 400, # 2.8TB 128GB
'db1065' = 500, # 2.8TB 160GB
'db1066' = 500, # 2.8TB 160GB
+   'db1070' = 50,  # 2.8TB 160GB, warm up
+   'db1071' = 50,  # 2.8TB 160GB, warm up
),
's2' = array(
'db1024' = 0,   # 1.4TB  64GB
@@ -404,6 +406,8 @@
'db1065' = '10.64.48.20', #do not remove or comment out
'db1066' = '10.64.48.21', #do not remove or comment out
'db1067' = '10.64.48.22', #do not remove or comment out
+   'db1070' = '10.64.48.25', #do not remove or comment out
+   'db1071' = '10.64.48.26', #do not remove or comment out
 ),
 
 'externalLoads' = array(

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I409fcd16e2b43db6ef70ef7fea1b52d1c76ef902
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Springle sprin...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] pool db1070 and db1071 in s1, warm up - change (operations/mediawiki-config)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: pool db1070 and db1071 in s1, warm up
..


pool db1070 and db1071 in s1, warm up

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

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



diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 5e3c813..8d38c7b 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -94,6 +94,8 @@
'db1062' = 400, # 2.8TB 128GB
'db1065' = 500, # 2.8TB 160GB
'db1066' = 500, # 2.8TB 160GB
+   'db1070' = 50,  # 2.8TB 160GB, warm up
+   'db1071' = 50,  # 2.8TB 160GB, warm up
),
's2' = array(
'db1024' = 0,   # 1.4TB  64GB
@@ -404,6 +406,8 @@
'db1065' = '10.64.48.20', #do not remove or comment out
'db1066' = '10.64.48.21', #do not remove or comment out
'db1067' = '10.64.48.22', #do not remove or comment out
+   'db1070' = '10.64.48.25', #do not remove or comment out
+   'db1071' = '10.64.48.26', #do not remove or comment out
 ),
 
 'externalLoads' = array(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I409fcd16e2b43db6ef70ef7fea1b52d1c76ef902
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Springle sprin...@wikimedia.org
Gerrit-Reviewer: Springle sprin...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Add passwords::mysql::dump - change (labs/private)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Add passwords::mysql::dump
..

Add passwords::mysql::dump

Change-Id: Ia02d7aeab42511c507d66af23859e2e77fc5771b
---
M modules/passwords/manifests/init.pp
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/private 
refs/changes/87/133687/1

diff --git a/modules/passwords/manifests/init.pp 
b/modules/passwords/manifests/init.pp
index bff46fb..00545b6 100644
--- a/modules/passwords/manifests/init.pp
+++ b/modules/passwords/manifests/init.pp
@@ -199,6 +199,11 @@
 $password = 'fakepassword'
 }
 
+class passwords::mysql::dump {
+$user = 'meh'
+$password = 'mah'
+}
+
 class passwords::mysql::eventlogging {
 $user = 'eventlogging'
 $password = '68QrOq220717816UycU1'

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia02d7aeab42511c507d66af23859e2e77fc5771b
Gerrit-PatchSet: 1
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Add passwords::mysql::dump - change (labs/private)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Add passwords::mysql::dump
..


Add passwords::mysql::dump

Change-Id: Ia02d7aeab42511c507d66af23859e2e77fc5771b
---
M modules/passwords/manifests/init.pp
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/modules/passwords/manifests/init.pp 
b/modules/passwords/manifests/init.pp
index bff46fb..00545b6 100644
--- a/modules/passwords/manifests/init.pp
+++ b/modules/passwords/manifests/init.pp
@@ -199,6 +199,11 @@
 $password = 'fakepassword'
 }
 
+class passwords::mysql::dump {
+$user = 'meh'
+$password = 'mah'
+}
+
 class passwords::mysql::eventlogging {
 $user = 'eventlogging'
 $password = '68QrOq220717816UycU1'

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia02d7aeab42511c507d66af23859e2e77fc5771b
Gerrit-PatchSet: 1
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] compare-puppet-catalogs: minor tweaks - change (operations/software)

2014-05-16 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged.

Change subject: compare-puppet-catalogs: minor tweaks
..


compare-puppet-catalogs: minor tweaks

I did my best to make the software NOT depend on being run as root out
of vagrant, and in general to play nicer for a production installation.

Change-Id: I72c5b17b58c327b973279bc89966bc6c44a56259
Signed-off-by: Giuseppe Lavagetto glavage...@wikimedia.org
---
M compare-puppet-catalogs/provision.sh
M compare-puppet-catalogs/puppet_compare/app_defaults.py
M compare-puppet-catalogs/puppet_compare/generator.py
M compare-puppet-catalogs/shell/compile
M compare-puppet-catalogs/shell/differ
R compare-puppet-catalogs/shell/env_puppet_2.7/.gitignore
M compare-puppet-catalogs/shell/env_puppet_2.7/Gemfile.lock
M compare-puppet-catalogs/shell/env_puppet_3/Gemfile.lock
M compare-puppet-catalogs/shell/helper
9 files changed, 21 insertions(+), 15 deletions(-)

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



diff --git a/compare-puppet-catalogs/provision.sh 
b/compare-puppet-catalogs/provision.sh
index fa1ccb5..6e436e3 100755
--- a/compare-puppet-catalogs/provision.sh
+++ b/compare-puppet-catalogs/provision.sh
@@ -2,7 +2,7 @@
 
 apt-get update
 apt-get -y install curl git-core vim python-pip python-dev
-apt-get -y install ruby1.8 rubygems ruby-bundler ruby1.8-dev
+apt-get -y install ruby1.8 rubygems ruby-bundler ruby1.8-dev ruby-bcrypt
 echo mysql-server-5.5 mysql-server/root_password password cucciolo | 
debconf-set-selections
 echo mysql-server-5.5 mysql-server/root_password_again password cucciolo | 
debconf-set-selections
 apt-get install -y mysql-common mysql-server mysql-client
diff --git a/compare-puppet-catalogs/puppet_compare/app_defaults.py 
b/compare-puppet-catalogs/puppet_compare/app_defaults.py
index 37821c1..c56c6d0 100644
--- a/compare-puppet-catalogs/puppet_compare/app_defaults.py
+++ b/compare-puppet-catalogs/puppet_compare/app_defaults.py
@@ -1,7 +1,7 @@
 import os
 MYDIR=os.path.dirname(os.path.realpath(__file__))
 PARENT=os.path.realpath(os.path.join(MYDIR,'..'))
-BASEDIR = os.environ.get('PUPPET_DIFFER_BASEDIR', '/vagrant')
+BASEDIR = os.environ.get('PUPPET_COMPILER_BASEDIR', PARENT)
 get_path = lambda x: os.path.join(BASEDIR, x)
 COMPILE_SCRIPT = get_path('shell/compile')
 FETCH_CHANGE = get_path('shell/prepare_change')
diff --git a/compare-puppet-catalogs/puppet_compare/generator.py 
b/compare-puppet-catalogs/puppet_compare/generator.py
index 81c9d88..43db10d 100644
--- a/compare-puppet-catalogs/puppet_compare/generator.py
+++ b/compare-puppet-catalogs/puppet_compare/generator.py
@@ -16,8 +16,9 @@
 
 
 def run(cmd, sudo=False, sudo_user='root', capture=True):
+env = os.environ.copy()
 if sudo:
-cmd = sudo -u %s '%s' % (sudo_user, cmd)
+cmd = sudo -E -u %s '%s' % (sudo_user, cmd)
 
 cmdlist = shlex.split(cmd)
 
@@ -27,7 +28,7 @@
 # This just works in python 2.7. Wrap this again?
 method = subprocess.check_call
 
-return method(cmdlist)
+return method(cmdlist, env=env)
 
 
 def ruby(cmd, **kwdargs):
diff --git a/compare-puppet-catalogs/shell/compile 
b/compare-puppet-catalogs/shell/compile
index 95eecbc..b25ae76 100755
--- a/compare-puppet-catalogs/shell/compile
+++ b/compare-puppet-catalogs/shell/compile
@@ -16,6 +16,14 @@
 CHANGE=${4}
 fi;
 
+# Get the password externally, or use the default
+if [ -z ${PUPPET_DIFFER_MYSQL_PWD} ]; then
+DBPASSWORD='puppet'
+else
+DBPASSWORD=${PUPPET_COMPILER_MYSQL_PWD}
+fi;
+
+
 ETCDIR=$( cd $( dirname ${BASH_SOURCE[0]} )  pwd )
 PUPPET_VERSION=${1}
 MY_GEMDIR=${ETCDIR}/env_puppet_${PUPPET_VERSION}
@@ -45,7 +53,7 @@
 WARNINGS_FILE=$CATALOG_DIR/$2.warnings
 
 if [ $PUPPET_VERSION == 3 ]; then
-COMPILE_OPTIONS=--storeconfigs true --thin_storeconfigs true --dbadapter 
mysql --dbserver localhost --dbuser puppet --dbpassword puppet
+COMPILE_OPTIONS=--storeconfigs true --thin_storeconfigs true --dbadapter 
mysql --dbserver localhost --dbuser puppet --dbpassword $DBPASSWORD
 else
 # storeconfigs gets you issues with compiling 2.7 catalogs
 # Verified on palladium, with storeconfigs the format of compiled catalogs 
changes in 2.7
diff --git a/compare-puppet-catalogs/shell/differ 
b/compare-puppet-catalogs/shell/differ
index 03153b2..d21239e 100755
--- a/compare-puppet-catalogs/shell/differ
+++ b/compare-puppet-catalogs/shell/differ
@@ -18,5 +18,5 @@
 OUTPUT_FILE=${OUT_DIR}/${1}.diff
 
 test -d ${OUT_DIR} || mkdir -p ${OUT_DIR}
-bundle exec puppet catalog diff --content_diff ${OLD_CATALOG_DIR}/${1}.pson 
${NEW_CATALOG_DIR}/${1}.pson  ${OUTPUT_FILE}
+bundle exec puppet catalog diff --modulepath=${PARENT}/external/puppet/modules 
--content_diff ${OLD_CATALOG_DIR}/${1}.pson ${NEW_CATALOG_DIR}/${1}.pson  
${OUTPUT_FILE}
 popd
diff --git a/compare-puppet-catalogs/shell/env_puppet_2.7/,gitingnore 

[MediaWiki-commits] [Gerrit] reassign db1056 to S4 commonswiki - change (operations/puppet)

2014-05-16 Thread Springle (Code Review)
Springle has uploaded a new change for review.

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

Change subject: reassign db1056 to S4 commonswiki
..

reassign db1056 to S4 commonswiki

Change-Id: I89c54cbf030db1be49b22067a3e6ea5477645ba3
---
M manifests/site.pp
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/88/133688/1

diff --git a/manifests/site.pp b/manifests/site.pp
index 2474071..88b8f75 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -647,7 +647,7 @@
 }
 
 # eqiad dbs
-node /^db10(50|51|52|55|56|61|62|65|66|70|71)\.eqiad\.wmnet/ {
+node /^db10(50|51|52|55|61|62|65|66|70|71)\.eqiad\.wmnet/ {
 $cluster = 'mysql'
 class { 'role::coredb::s1':
 innodb_file_per_table = true,
@@ -673,7 +673,7 @@
 }
 }
 
-node /^db10(04|11|40|42|49|59|64)\.eqiad\.wmnet/ {
+node /^db10(04|11|40|42|49|56|59|64)\.eqiad\.wmnet/ {
 $cluster = 'mysql'
 class { 'role::coredb::s4':
 innodb_file_per_table = true,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89c54cbf030db1be49b22067a3e6ea5477645ba3
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Springle sprin...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Update for newer jQuery - change (mediawiki...ApiSandbox)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update for newer jQuery
..


Update for newer jQuery

Change-Id: I64567dad87d271c6ba67219a7d5c01082f3c7adc
---
M resources/main.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/resources/main.js b/resources/main.js
index 807428c..ab28cf8 100644
--- a/resources/main.js
+++ b/resources/main.js
@@ -604,7 +604,7 @@
}
} );
 
-   $( '#param-generator' ).live( 'change', updateGenerator );
+   $( document ).on( 'change', '#param-generator', updateGenerator 
);
 
function doHash() {
var hash = window.location.hash.replace( /^#/, '' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I64567dad87d271c6ba67219a7d5c01082f3c7adc
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ApiSandbox
Gerrit-Branch: master
Gerrit-Owner: MaxSem maxsem.w...@gmail.com
Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com
Gerrit-Reviewer: Krinkle krinklem...@gmail.com
Gerrit-Reviewer: Reedy re...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] reassign db1056 to S4 commonswiki - change (operations/puppet)

2014-05-16 Thread Springle (Code Review)
Springle has submitted this change and it was merged.

Change subject: reassign db1056 to S4 commonswiki
..


reassign db1056 to S4 commonswiki

Change-Id: I89c54cbf030db1be49b22067a3e6ea5477645ba3
---
M manifests/site.pp
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/manifests/site.pp b/manifests/site.pp
index 2474071..88b8f75 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -647,7 +647,7 @@
 }
 
 # eqiad dbs
-node /^db10(50|51|52|55|56|61|62|65|66|70|71)\.eqiad\.wmnet/ {
+node /^db10(50|51|52|55|61|62|65|66|70|71)\.eqiad\.wmnet/ {
 $cluster = 'mysql'
 class { 'role::coredb::s1':
 innodb_file_per_table = true,
@@ -673,7 +673,7 @@
 }
 }
 
-node /^db10(04|11|40|42|49|59|64)\.eqiad\.wmnet/ {
+node /^db10(04|11|40|42|49|56|59|64)\.eqiad\.wmnet/ {
 $cluster = 'mysql'
 class { 'role::coredb::s4':
 innodb_file_per_table = true,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I89c54cbf030db1be49b22067a3e6ea5477645ba3
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Springle sprin...@wikimedia.org
Gerrit-Reviewer: Springle sprin...@wikimedia.org
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 form cache purging - change (mediawiki...SemanticForms)

2014-05-16 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

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

Change subject: Fix form cache purging
..

Fix form cache purging

Because we were checking the wrong variable, cached forms were not
purged on edit. Follow-up to Iec9cdb1b8390

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


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

diff --git a/includes/SF_FormUtils.php b/includes/SF_FormUtils.php
index 51824dd..1815d67 100644
--- a/includes/SF_FormUtils.php
+++ b/includes/SF_FormUtils.php
@@ -521,7 +521,7 @@
// get references to stored datasets
$listOfFormKeys = $cache-get( $cacheKeyForList );
 
-   if ( !is_array( $cacheKeyForList ) ) {
+   if ( !is_array( $listOfFormKeys ) ) {
return true;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0113f407819581a4716d3b9efb20631cf6997a36
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com

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


[MediaWiki-commits] [Gerrit] rm brokenunused EntityContent::getEntityRevision - change (mediawiki...Wikibase)

2014-05-16 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has uploaded a new change for review.

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

Change subject: rm brokenunused EntityContent::getEntityRevision
..

rm brokenunused EntityContent::getEntityRevision

Change-Id: I89a8265b226cf8d245e383fd8c56d5b3ec9b309c
---
M repo/includes/content/EntityContent.php
1 file changed, 1 insertion(+), 25 deletions(-)


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

diff --git a/repo/includes/content/EntityContent.php 
b/repo/includes/content/EntityContent.php
index 46153b3..dc54040 100644
--- a/repo/includes/content/EntityContent.php
+++ b/repo/includes/content/EntityContent.php
@@ -22,6 +22,7 @@
 use Wikibase\Lib\SnakFormatter;
 use Wikibase\Repo\EntitySearchTextGenerator;
 use Wikibase\Repo\WikibaseRepo;
+use Wikibase\Validators\EntityValidator;
 use WikiPage;
 
 /**
@@ -499,31 +500,6 @@
 
$localizer = 
WikibaseRepo::getDefaultInstance()-getValidatorErrorLocalizer();
return $localizer-getResultStatus( $result );
-   }
-
-   /**
-* @deprecated will be moved to WikiPageEntityStore
-*
-* @param int|null $revId Revision id to get a EntityRevision object 
for.
-*  If omitted, the latest revision will be used.
-*
-* @return EntityRevision
-*/
-   public function getEntityRevision( $revId = null ) {
-   if ( intval( $revId )  0 ) {
-   $pageRevision = Revision::newFromId( $revId );
-   } else {
-   $pageRevision = $this-getLatestRevision();
-   $revId = $pageRevision === null ? 0 : 
$pageRevision-getId();
-   }
-
-   $itemRevision = new EntityRevision(
-   $this-getEntity(),
-   intval( $revId ),
-   $pageRevision === null ? '' : 
$pageRevision-getTimestamp()
-   );
-
-   return $itemRevision;
}
 
/**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89a8265b226cf8d245e383fd8c56d5b3ec9b309c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] icinga: Fix anomaly detection checks - change (operations/puppet)

2014-05-16 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has uploaded a new change for review.

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

Change subject: icinga: Fix anomaly detection checks
..

icinga: Fix anomaly detection checks

Changed the check for reqstats.5xx to use the data and not the ratio to
requests as although formally more correct it's much more unstable than
the base check. Also, check_graphite now requests the holt-winters
anomaly bands with 5 delta confidence, which has proven to be much
nearer to detect a real anomaly with less false positives.

Change-Id: I8b06b0b139b292e57b97417c0f880ec660fbbf2d
Signed-off-by: Giuseppe Lavagetto glavage...@wikimedia.org
---
M files/icinga/check_graphite
M manifests/role/graphite.pp
2 files changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/files/icinga/check_graphite b/files/icinga/check_graphite
index f3ac06d..cb5cfe2 100755
--- a/files/icinga/check_graphite
+++ b/files/icinga/check_graphite
@@ -316,7 +316,7 @@
 for target in self.targets:
 self.params.append(('target', target))
 self.params.append(
-('target', 'holtWintersConfidenceBands(%s)' % target))
+('target', 'holtWintersConfidenceBands(%s, 5)' % target))
 self.check_window = args.check_window
 self.warn = args.warn
 self.crit = args.crit
@@ -423,7 +423,7 @@
check_threshold my.beloved.metric  --from -20m \
--threshold 100 --over -C 10 -W 5
 
-Check if a metric has exceeded its holter-winters confidence bands 5% of 
the
+Check if a metric has exceeded its holt-winters confidence bands 5% of the
 times over the last 500 checks
 
 ./check_graphyte.py --url http://some-graphite-host  \
diff --git a/manifests/role/graphite.pp b/manifests/role/graphite.pp
index 2246027..59a057d 100644
--- a/manifests/role/graphite.pp
+++ b/manifests/role/graphite.pp
@@ -200,7 +200,7 @@
 # if 10% of the last 100 checks is out of forecasted bounds
 monitor_graphite_anomaly {'requests_error_ratio':
 description  = 'HTTP error ratio anomaly detection',
-metric   = 'divideSeries(reqstats.5xx,reqstats.requests)',
+metric   = 'reqstats.5xx',
 warning  = 5,
 critical = 10,
 check_window = 100,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b06b0b139b292e57b97417c0f880ec660fbbf2d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto glavage...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] rm brokenunused EntityContent::getEntityRevision - change (mediawiki...Wikibase)

2014-05-16 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: rm brokenunused EntityContent::getEntityRevision
..


rm brokenunused EntityContent::getEntityRevision

Change-Id: I89a8265b226cf8d245e383fd8c56d5b3ec9b309c
---
M repo/includes/content/EntityContent.php
1 file changed, 1 insertion(+), 25 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Jeroen De Dauw: Looks good to me, approved



diff --git a/repo/includes/content/EntityContent.php 
b/repo/includes/content/EntityContent.php
index 46153b3..dc54040 100644
--- a/repo/includes/content/EntityContent.php
+++ b/repo/includes/content/EntityContent.php
@@ -22,6 +22,7 @@
 use Wikibase\Lib\SnakFormatter;
 use Wikibase\Repo\EntitySearchTextGenerator;
 use Wikibase\Repo\WikibaseRepo;
+use Wikibase\Validators\EntityValidator;
 use WikiPage;
 
 /**
@@ -499,31 +500,6 @@
 
$localizer = 
WikibaseRepo::getDefaultInstance()-getValidatorErrorLocalizer();
return $localizer-getResultStatus( $result );
-   }
-
-   /**
-* @deprecated will be moved to WikiPageEntityStore
-*
-* @param int|null $revId Revision id to get a EntityRevision object 
for.
-*  If omitted, the latest revision will be used.
-*
-* @return EntityRevision
-*/
-   public function getEntityRevision( $revId = null ) {
-   if ( intval( $revId )  0 ) {
-   $pageRevision = Revision::newFromId( $revId );
-   } else {
-   $pageRevision = $this-getLatestRevision();
-   $revId = $pageRevision === null ? 0 : 
$pageRevision-getId();
-   }
-
-   $itemRevision = new EntityRevision(
-   $this-getEntity(),
-   intval( $revId ),
-   $pageRevision === null ? '' : 
$pageRevision-getTimestamp()
-   );
-
-   return $itemRevision;
}
 
/**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I89a8265b226cf8d245e383fd8c56d5b3ec9b309c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Adrian Lang adrian.l...@wikimedia.de
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: WikidataJenkins wikidata-servi...@wikimedia.de
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 LabelDescriptionDuplicateDetector documentation - change (mediawiki...Wikibase)

2014-05-16 Thread WMDE
Thiemo Mättig (WMDE) has uploaded a new change for review.

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

Change subject: Update LabelDescriptionDuplicateDetector documentation
..

Update LabelDescriptionDuplicateDetector documentation

... and remove an unused parameter.

This patch is not important, obviously. I think it's better to merge
most other patches first. I will rebase this later.

Change-Id: If45845564cace68d83daae6d3d4f446aa86fadf6
---
M repo/includes/LabelDescriptionDuplicateDetector.php
1 file changed, 25 insertions(+), 26 deletions(-)


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

diff --git a/repo/includes/LabelDescriptionDuplicateDetector.php 
b/repo/includes/LabelDescriptionDuplicateDetector.php
index 26260ef..9b4b060 100644
--- a/repo/includes/LabelDescriptionDuplicateDetector.php
+++ b/repo/includes/LabelDescriptionDuplicateDetector.php
@@ -72,9 +72,9 @@
 *
 * @since 0.5
 *
-* @param array $labels An associative array of labels,
+* @param string[] $labels An associative array of labels,
 *with language codes as the keys.
-* @param array|null $descriptions An associative array of descriptions,
+* @param string[]|null $descriptions An associative array of 
descriptions,
 *with language codes as the keys.
 * @param EntityId $entityId The Id of the Entity the terms come from. 
Conflicts
 *with this entity will be considered self-conflicts and 
ignored.
@@ -86,7 +86,7 @@
 * The error code will be either 'label-conflict' or 
'label-with-description-conflict',
 * depending on whether descriptions where given.
 */
-   public function detectTermConflicts( $labels, $descriptions, EntityId 
$entityId = null ) {
+   public function detectTermConflicts( array $labels, $descriptions, 
EntityId $entityId = null ) {
if ( !is_array( $labels ) ) {
throw new InvalidArgumentException( '$labels must be an 
array' );
}
@@ -100,7 +100,7 @@
}
 
if ( $descriptions === null ) {
-   $termSpecs = $this-buildLabelConflictSpecs( $labels, 
$descriptions );
+   $termSpecs = $this-buildLabelConflictSpecs( $labels );
$errorCode = 'label-conflict';
} else {
$termSpecs = $this-buildLabelDescriptionConflictSpecs( 
$labels, $descriptions );
@@ -122,31 +122,31 @@
 * of label and description for a given language. This applies only for 
languages for
 * which both label and description are given in $terms.
 *
-* @param array|null $labels An associative array of labels,
+* @param string[] $labels An associative array of labels,
 *with language codes as the keys.
-* @param array|null $descriptions An associative array of descriptions,
+* @param string[] $descriptions An associative array of descriptions,
 *with language codes as the keys.
 *
-* @return array An array suitable for use with 
TermIndex::getMatchingTermCombination().
+* @return array[] An array suitable for use with 
TermIndex::getMatchingTermCombination().
 */
private function buildLabelDescriptionConflictSpecs( array $labels, 
array $descriptions ) {
$termSpecs = array();
 
-   foreach ( $labels as $lang = $label ) {
-   if ( !isset( $descriptions[$lang] ) ) {
+   foreach ( $labels as $languageCode = $label ) {
+   if ( !isset( $descriptions[$languageCode] ) ) {
// If there's no description, there will be no 
conflict
continue;
}
 
$label = new Term( array(
-   'termLanguage' = $lang,
+   'termLanguage' = $languageCode,
'termText' = $label,
'termType' = Term::TYPE_LABEL,
) );
 
$description = new Term( array(
-   'termLanguage' = $lang,
-   'termText' = $descriptions[$lang],
+   'termLanguage' = $languageCode,
+   'termText' = $descriptions[$languageCode],
'termType' = Term::TYPE_DESCRIPTION,
) );
 
@@ -160,19 +160,17 @@
 * Builds a term spec array suitable for finding entities with any of 
the given labels
 * for a given language.
 *
-* @param array $labels An associative array mapping language codes to
-*

[MediaWiki-commits] [Gerrit] Remove deprecated .live() call in htmlform - change (mediawiki/core)

2014-05-16 Thread Gilles (Code Review)
Gilles has uploaded a new change for review.

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

Change subject: Remove deprecated .live() call in htmlform
..

Remove deprecated .live() call in htmlform

Change-Id: If8f852724331db0fb70a33dc3984827486898006
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/591
---
M resources/src/mediawiki/mediawiki.htmlform.js
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/94/133694/1

diff --git a/resources/src/mediawiki/mediawiki.htmlform.js 
b/resources/src/mediawiki/mediawiki.htmlform.js
index f7aa7f8..394bd60 100644
--- a/resources/src/mediawiki/mediawiki.htmlform.js
+++ b/resources/src/mediawiki/mediawiki.htmlform.js
@@ -205,16 +205,17 @@
};
 
/**
-* Bind a function to the jQuery object via live(), and also 
immediately trigger
+* Bind a function to the jQuery object via on(), and also immediately 
trigger
 * the function on the objects with an 'instant' parameter set to true.
+* @param {string} selector
 * @param {Function} callback
 * @param {boolean|jQuery.Event} callback.immediate True when the event 
is called immediately,
 *  an event object when triggered from an event.
 */
-   $.fn.liveAndTestAtStart = function ( callback ) {
+   $.fn.onAndTestAtStart = function ( selector, callback ) {
$( this )
-   .live( 'change', callback )
-   .each( function () {
+   .on( 'change', selector, callback )
+   .find( selector ).each( function () {
callback.call( this, true );
} );
};
@@ -223,7 +224,7 @@
 
// Animate the SelectOrOther fields, to only show the text 
field when
// 'other' is selected.
-   $root.find( '.mw-htmlform-select-or-other' 
).liveAndTestAtStart( function ( instant ) {
+   $root.onAndTestAtStart( '.mw-htmlform-select-or-other', 
function ( instant ) {
var $other = $root.find( '#' + $( this ).attr( 'id' ) + 
'-other' );
$other = $other.add( $other.siblings( 'br' ) );
if ( $( this ).val() === 'other' ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8f852724331db0fb70a33dc3984827486898006
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gilles gdu...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Converted Ruby pageObjects to modules - change (mediawiki...Wikibase)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Converted Ruby pageObjects to modules
..


Converted Ruby pageObjects to modules

This is to use composition rather than inheritance and is more like what
the other projects are doing.

Change-Id: Ifffb996b8041527c4f65986a119aebb0e2d77871
---
A tests/browser/features/support/modules/special_modify_entity_module.rb
A tests/browser/features/support/modules/special_modify_term_module.rb
M tests/browser/features/support/pages/special_modify_entity_page.rb
M tests/browser/features/support/pages/special_modify_term_page.rb
M tests/browser/features/support/pages/special_set_label_page.rb
5 files changed, 38 insertions(+), 11 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/tests/browser/features/support/modules/special_modify_entity_module.rb 
b/tests/browser/features/support/modules/special_modify_entity_module.rb
new file mode 100644
index 000..fc6276c
--- /dev/null
+++ b/tests/browser/features/support/modules/special_modify_entity_module.rb
@@ -0,0 +1,16 @@
+# -*- encoding : utf-8 -*-
+# Wikidata UI tests
+#
+# Author:: Thiemo Mättig (thiemo.maet...@wikimedia.de)
+# License:: GNU GPL v2+
+#
+# module for the Special:ModifyEntity page
+
+module SpecialModifyEntityModule
+  include PageObject
+
+  p(:anonymous_edit_warning, class: warning)
+  p(:error_message, class: error)
+  text_field(:id_input_field, id: wb-modifyentity-id)
+
+end
diff --git 
a/tests/browser/features/support/modules/special_modify_term_module.rb 
b/tests/browser/features/support/modules/special_modify_term_module.rb
new file mode 100644
index 000..04439a3
--- /dev/null
+++ b/tests/browser/features/support/modules/special_modify_term_module.rb
@@ -0,0 +1,16 @@
+# -*- encoding : utf-8 -*-
+# Wikidata UI tests
+#
+# Author:: Thiemo Mättig (thiemo.maet...@wikimedia.de)
+# License:: GNU GPL v2+
+#
+# module for the Special:ModifyTerm page
+
+module SpecialModifyTermModule
+  include PageObject
+  include SpecialModifyEntityModule
+
+  text_field(:language_input_field, id: wb-modifyterm-language)
+  text_field(:term_input_field, id: wb-modifyterm-value)
+
+end
diff --git a/tests/browser/features/support/pages/special_modify_entity_page.rb 
b/tests/browser/features/support/pages/special_modify_entity_page.rb
index 7fe4dd2..43b3e47 100644
--- a/tests/browser/features/support/pages/special_modify_entity_page.rb
+++ b/tests/browser/features/support/pages/special_modify_entity_page.rb
@@ -8,9 +8,5 @@
 
 class SpecialModifyEntityPage
   include PageObject
-
-  p(:anonymous_edit_warning, class: warning)
-  p(:error_message, class: error)
-  text_field(:id_input_field, id: wb-modifyentity-id)
-
+  include SpecialModifyEntityModule
 end
diff --git a/tests/browser/features/support/pages/special_modify_term_page.rb 
b/tests/browser/features/support/pages/special_modify_term_page.rb
index 2157456..73bce51 100644
--- a/tests/browser/features/support/pages/special_modify_term_page.rb
+++ b/tests/browser/features/support/pages/special_modify_term_page.rb
@@ -6,10 +6,8 @@
 #
 # page object for the Special:ModifyTerm page
 
-class SpecialModifyTermPage  SpecialModifyEntityPage
+class SpecialModifyTermPage
   include PageObject
-
-  text_field(:language_input_field, id: wb-modifyterm-language)
-  text_field(:term_input_field, id: wb-modifyterm-value)
-
+  include SpecialModifyTermModule
+  include SpecialModifyEntityModule
 end
diff --git a/tests/browser/features/support/pages/special_set_label_page.rb 
b/tests/browser/features/support/pages/special_set_label_page.rb
index 9816498..39b5e06 100644
--- a/tests/browser/features/support/pages/special_set_label_page.rb
+++ b/tests/browser/features/support/pages/special_set_label_page.rb
@@ -6,8 +6,9 @@
 #
 # page object for the Special:SetLabel page
 
-class SpecialSetLabelPage  SpecialModifyTermPage
+class SpecialSetLabelPage
   include PageObject
+  include SpecialModifyTermModule
 
   page_url URL.repo_url(Special:SetLabel)
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifffb996b8041527c4f65986a119aebb0e2d77871
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: WikidataJenkins wikidata-servi...@wikimedia.de
Gerrit-Reviewer: Zfilipin zfili...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Never modify fingerprint when validating - change (mediawiki...Wikibase)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Never modify fingerprint when validating
..


Never modify fingerprint when validating

Change-Id: I550e81ddc2ae0c918e5f3e8d7fffb6098ccb4eec
---
M repo/includes/ChangeOp/ChangeOpDescription.php
M repo/includes/ChangeOp/ChangeOpLabel.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpDescriptionTest.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpLabelTest.php
4 files changed, 28 insertions(+), 14 deletions(-)

Approvals:
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/ChangeOp/ChangeOpDescription.php 
b/repo/includes/ChangeOp/ChangeOpDescription.php
index e99d13d..c147844 100644
--- a/repo/includes/ChangeOp/ChangeOpDescription.php
+++ b/repo/includes/ChangeOp/ChangeOpDescription.php
@@ -136,7 +136,7 @@
 
// Check if the new fingerprint of the entity is valid (e.g. if 
the combination
// of label and description  is still unique)
-   $fingerprint = $entity-getFingerprint();
+   $fingerprint = clone $entity-getFingerprint();
$this-updateFingerprint( $fingerprint );
 
$result = $fingerprintValidator-validateFingerprint(
diff --git a/repo/includes/ChangeOp/ChangeOpLabel.php 
b/repo/includes/ChangeOp/ChangeOpLabel.php
index e3578cc..16558ab 100644
--- a/repo/includes/ChangeOp/ChangeOpLabel.php
+++ b/repo/includes/ChangeOp/ChangeOpLabel.php
@@ -142,7 +142,7 @@
}
 
// Check if the new fingerprint of the entity is valid (e.g. if 
the label is unique)
-   $fingerprint = $entity-getFingerprint();
+   $fingerprint = clone $entity-getFingerprint();
$this-updateFingerprint( $fingerprint );
 
$result = $fingerprintValidator-validateFingerprint(
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpDescriptionTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpDescriptionTest.php
index f3e59d7..d5ab185 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpDescriptionTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpDescriptionTest.php
@@ -69,10 +69,11 @@
$validatorFactory = $this-getTermValidatorFactory();
 
$args = array();
-   $args['invalid description'] = array ( new ChangeOpDescription( 
'fr', 'INVALID', $validatorFactory ) );
-   $args['duplicate description'] = array ( new 
ChangeOpDescription( 'fr', 'DUPE', $validatorFactory ) );
-   $args['invalid language'] = array ( new ChangeOpDescription( 
'INVALID', 'valid', $validatorFactory ) );
-   $args['set bad language to null'] = array ( new 
ChangeOpDescription( 'INVALID', null, $validatorFactory ), 'INVALID' );
+   $args['valid description'] = array ( new ChangeOpDescription( 
'fr', 'valid', $validatorFactory ), true );
+   $args['invalid description'] = array ( new ChangeOpDescription( 
'fr', 'INVALID', $validatorFactory ), false );
+   $args['duplicate description'] = array ( new 
ChangeOpDescription( 'fr', 'DUPE', $validatorFactory ), false );
+   $args['invalid language'] = array ( new ChangeOpDescription( 
'INVALID', 'valid', $validatorFactory ), false );
+   $args['set bad language to null'] = array ( new 
ChangeOpDescription( 'INVALID', null, $validatorFactory ), false );
 
return $args;
}
@@ -81,12 +82,18 @@
 * @dataProvider validateProvider
 *
 * @param ChangeOp $changeOp
+* @param bool $valid
 */
-   public function testValidate( ChangeOp $changeOp ) {
+   public function testValidate( ChangeOp $changeOp, $valid ) {
$entity = $this-provideNewEntity();
 
+   $oldLabels = $entity-getDescriptions();
+
$result = $changeOp-validate( $entity );
-   $this-assertFalse( $result-isValid() );
+   $this-assertEquals( $valid, $result-isValid(), 'isValid()' );
+
+   // labels should not have changed during validation
+   $this-assertEquals( $oldLabels, $entity-getDescriptions(), 
'Descriptions modified by validation!' );
}
 
/**
diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpLabelTest.php 
b/repo/tests/phpunit/includes/ChangeOp/ChangeOpLabelTest.php
index 5f069dc..3f929ac 100644
--- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpLabelTest.php
+++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpLabelTest.php
@@ -69,10 +69,11 @@
$validatorFactory = $this-getTermValidatorFactory();
 
$args = array();
-   $args['invalid label'] = array ( new ChangeOpLabel( 'fr', 
'INVALID', $validatorFactory ) );
-   $args['duplicate label'] = array ( new ChangeOpLabel( 'fr', 
'DUPE', $validatorFactory ) );
- 

[MediaWiki-commits] [Gerrit] Update LabelDescriptionDuplicateDetector documentation - change (mediawiki...Wikibase)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update LabelDescriptionDuplicateDetector documentation
..


Update LabelDescriptionDuplicateDetector documentation

... and remove an unused parameter.

This patch is not important, obviously. I think it's better to merge
most other patches first. I will rebase this later.

Change-Id: If45845564cace68d83daae6d3d4f446aa86fadf6
---
M repo/includes/LabelDescriptionDuplicateDetector.php
1 file changed, 25 insertions(+), 26 deletions(-)

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



diff --git a/repo/includes/LabelDescriptionDuplicateDetector.php 
b/repo/includes/LabelDescriptionDuplicateDetector.php
index 26260ef..9b4b060 100644
--- a/repo/includes/LabelDescriptionDuplicateDetector.php
+++ b/repo/includes/LabelDescriptionDuplicateDetector.php
@@ -72,9 +72,9 @@
 *
 * @since 0.5
 *
-* @param array $labels An associative array of labels,
+* @param string[] $labels An associative array of labels,
 *with language codes as the keys.
-* @param array|null $descriptions An associative array of descriptions,
+* @param string[]|null $descriptions An associative array of 
descriptions,
 *with language codes as the keys.
 * @param EntityId $entityId The Id of the Entity the terms come from. 
Conflicts
 *with this entity will be considered self-conflicts and 
ignored.
@@ -86,7 +86,7 @@
 * The error code will be either 'label-conflict' or 
'label-with-description-conflict',
 * depending on whether descriptions where given.
 */
-   public function detectTermConflicts( $labels, $descriptions, EntityId 
$entityId = null ) {
+   public function detectTermConflicts( array $labels, $descriptions, 
EntityId $entityId = null ) {
if ( !is_array( $labels ) ) {
throw new InvalidArgumentException( '$labels must be an 
array' );
}
@@ -100,7 +100,7 @@
}
 
if ( $descriptions === null ) {
-   $termSpecs = $this-buildLabelConflictSpecs( $labels, 
$descriptions );
+   $termSpecs = $this-buildLabelConflictSpecs( $labels );
$errorCode = 'label-conflict';
} else {
$termSpecs = $this-buildLabelDescriptionConflictSpecs( 
$labels, $descriptions );
@@ -122,31 +122,31 @@
 * of label and description for a given language. This applies only for 
languages for
 * which both label and description are given in $terms.
 *
-* @param array|null $labels An associative array of labels,
+* @param string[] $labels An associative array of labels,
 *with language codes as the keys.
-* @param array|null $descriptions An associative array of descriptions,
+* @param string[] $descriptions An associative array of descriptions,
 *with language codes as the keys.
 *
-* @return array An array suitable for use with 
TermIndex::getMatchingTermCombination().
+* @return array[] An array suitable for use with 
TermIndex::getMatchingTermCombination().
 */
private function buildLabelDescriptionConflictSpecs( array $labels, 
array $descriptions ) {
$termSpecs = array();
 
-   foreach ( $labels as $lang = $label ) {
-   if ( !isset( $descriptions[$lang] ) ) {
+   foreach ( $labels as $languageCode = $label ) {
+   if ( !isset( $descriptions[$languageCode] ) ) {
// If there's no description, there will be no 
conflict
continue;
}
 
$label = new Term( array(
-   'termLanguage' = $lang,
+   'termLanguage' = $languageCode,
'termText' = $label,
'termType' = Term::TYPE_LABEL,
) );
 
$description = new Term( array(
-   'termLanguage' = $lang,
-   'termText' = $descriptions[$lang],
+   'termLanguage' = $languageCode,
+   'termText' = $descriptions[$languageCode],
'termType' = Term::TYPE_DESCRIPTION,
) );
 
@@ -160,19 +160,17 @@
 * Builds a term spec array suitable for finding entities with any of 
the given labels
 * for a given language.
 *
-* @param array $labels An associative array mapping language codes to
-*records. Reach record is an associative array with they keys 

[MediaWiki-commits] [Gerrit] Slight cleanup of varnish module - change (operations...varnish)

2014-05-16 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review.

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

Change subject: Slight cleanup of varnish module
..

Slight cleanup of varnish module

This isolates operations/production dependencies in a way
that allows this module to be usable in envrionments other
than production.

Change-Id: I9c348b3f0640fbd3bc47257847120fee7f2bed82
---
A lib/puppet/parser/functions/suffix.rb
D manifests/common.pp
M manifests/common/vcl.pp
M manifests/htcppurger.pp
M manifests/init.pp
M manifests/instance.pp
D manifests/packages.pp
7 files changed, 162 insertions(+), 93 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet/varnish 
refs/changes/95/133695/1

diff --git a/lib/puppet/parser/functions/suffix.rb 
b/lib/puppet/parser/functions/suffix.rb
new file mode 100644
index 000..f7792d6
--- /dev/null
+++ b/lib/puppet/parser/functions/suffix.rb
@@ -0,0 +1,45 @@
+#
+# suffix.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:suffix, :type = :rvalue, :doc = -EOS
+This function applies a suffix to all elements in an array.
+
+*Examples:*
+
+suffix(['a','b','c'], 'p')
+
+Will return: ['ap','bp','cp']
+EOS
+  ) do |arguments|
+
+# Technically we support two arguments but only first is mandatory ...
+raise(Puppet::ParseError, suffix(): Wrong number of arguments  +
+  given (#{arguments.size} for 1)) if arguments.size  1
+
+array = arguments[0]
+
+unless array.is_a?(Array)
+  raise Puppet::ParseError, suffix(): expected first argument to be an 
Array, got #{array.inspect}
+end
+
+suffix = arguments[1] if arguments[1]
+
+if suffix
+  unless suffix.is_a? String
+raise Puppet::ParseError, suffix(): expected second argument to be a 
String, got #{suffix.inspect}
+  end
+end
+
+# Turn everything into string same as join would do ...
+result = array.collect do |i|
+  i = i.to_s
+  suffix ? i + suffix : i
+end
+
+return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
diff --git a/manifests/common.pp b/manifests/common.pp
deleted file mode 100644
index 62d6cbf..000
--- a/manifests/common.pp
+++ /dev/null
@@ -1,26 +0,0 @@
-class varnish::common {
-require varnish::packages
-
-# Tune kernel settings
-# TODO: Should be moved to a role class.
-include webserver::base
-
-# Mount /var/lib/ganglia as tmpfs to avoid Linux flushing mlocked
-# shm memory to disk
-mount { '/var/lib/varnish':
-ensure  = mounted,
-device  = 'tmpfs',
-fstype  = 'tmpfs',
-options = 'noatime,defaults,size=512M',
-pass= 0,
-dump= 0,
-require = Class['varnish::packages'],
-}
-
-file { '/usr/share/varnish/reload-vcl':
-owner   = 'root',
-group   = 'root',
-mode= '0555',
-source  = puppet:///modules/${module_name}/reload-vcl,
-}
-}
diff --git a/manifests/common/vcl.pp b/manifests/common/vcl.pp
index 6893193..786137b 100644
--- a/manifests/common/vcl.pp
+++ b/manifests/common/vcl.pp
@@ -1,11 +1,11 @@
 class varnish::common::vcl {
-require varnish::common
+require varnish
 
 file { '/etc/varnish/geoip.inc.vcl':
 owner   = 'root',
 group   = 'root',
 mode= '0444',
-content = template('varnish/geoip.inc.vcl.erb'),
+content = template(${module_name}/vcl/geoip.inc.vcl.erb),
 }
 file { '/etc/varnish/device-detection.inc.vcl':
 ensure  = absent,
@@ -14,7 +14,7 @@
 owner   = 'root',
 group   = 'root',
 mode= '0444',
-content = template('varnish/errorpage.inc.vcl.erb'),
+content = template(${module_name}/vcl/errorpage.inc.vcl.erb),
 }
 
 # VCL unit tests
@@ -22,6 +22,6 @@
 owner  = 'root',
 group  = 'root',
 mode   = '0555',
-source = 'puppet:///files/varnish/varnish-test-geoip',
+source = puppet:///modules/${module_name}/varnish-test-geoip,
 }
 }
diff --git a/manifests/htcppurger.pp b/manifests/htcppurger.pp
index 9dca451..9016a4b 100644
--- a/manifests/htcppurger.pp
+++ b/manifests/htcppurger.pp
@@ -1,5 +1,5 @@
 class varnish::htcppurger($varnish_instances=['localhost:80']) {
-Class[varnish::packages] - Class[varnish::htcppurger]
+Class[varnish] - Class[varnish::htcppurger]
 
 package { 'vhtcpd':
 ensure = latest,
diff --git a/manifests/init.pp b/manifests/init.pp
index 1bb0ba1..bc0e184 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,2 +1,55 @@
-class varnish {
+class varnish(
+$version  = 'installed',
+$high_performance_sysctl_enabled  = false,
+)
+{
+package { ['varnish', 'varnish-dbg', 'libvarnishapi1']:
+ensure = $version,
+}
+
+# This custom reload-vcl takes a -n argument
+# which is used for multiple varnish
+# instances on the same node.
+file { 

[MediaWiki-commits] [Gerrit] Introduce role::mariadb::backup - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Introduce role::mariadb::backup
..


Introduce role::mariadb::backup

Include backup host
Get the credentials and use them to dump all the databases one by one,
then have bacula backup them. backup::mysqlset will also keep a local
copy of the last 15 days dumps
Enable on dbstore1001

Change-Id: I9b4dd318d0818cb551800178164e890925623dd2
---
M manifests/role/mariadb.pp
M manifests/site.pp
2 files changed, 48 insertions(+), 1 deletion(-)

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



diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp
index 3995871..1a1c62d 100644
--- a/manifests/role/mariadb.pp
+++ b/manifests/role/mariadb.pp
@@ -140,3 +140,43 @@
 
 mariadb::monitor_replication { ['s1', 'm2' ]: }
 }
+
+class role::mariadb::backup::config {
+if $mariadb_backups_folder {
+$folder = $mariadb_backups_folder
+} else {
+$folder = '/srv/backups'
+}
+}
+
+class role::mariadb::backup {
+include backup::host
+include passwords::mysql::dump
+
+include role::mariadb::backup::config
+$backups_folder = $role::mariadb::backup::config::folder
+
+file { $backups_folder:
+ensure = directory,
+owner  = 'root',
+group  = 'root',
+mode   = '0600', # implicitly 0700 for dirs
+}
+
+file { '/etc/mysql/conf.d/dumps.cnf':
+ensure  = present,
+owner   = 'root',
+group   = 'root',
+mode= '0400',
+content = 
[client]\nuser=${passwords::mysql::dump::user}\npassword=${passwords::mysql::dump::pass}\n,
+}
+
+backup::mysqlset {'dbstore':
+xtrabackup = false,
+per_db = true,
+innodb_only= true,
+local_dump_dir = $backups_folder,
+password_file  = '/etc/mysql/conf.d/dumps.cnf',
+method = 'predump',
+}
+}
diff --git a/manifests/site.pp b/manifests/site.pp
index 88b8f75..71e96e0 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -847,7 +847,14 @@
 include role::mariadb::tendril
 }
 
-node /^dbstore100(1|2)\.eqiad\.wmnet/ {
+node /^dbstore1001\.eqiad\.wmnet/ {
+$cluster = 'mysql'
+$mariadb_backups_folder = '/a/backups'
+include role::mariadb::dbstore
+include role::mariadb::backup
+}
+
+node /^dbstore1002\.eqiad\.wmnet/ {
 $cluster = 'mysql'
 include role::mariadb::dbstore
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b4dd318d0818cb551800178164e890925623dd2
Gerrit-PatchSet: 7
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Springle sprin...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Rewrite replica handling - change (mediawiki...CirrusSearch)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Rewrite replica handling
..


Rewrite replica handling

Use auto_expand_replicas. It's way nicer and easier to control.

Change-Id: Ia707b3cabefab5ac5abf002017dc4d4c5f3fd078
---
M CirrusSearch.php
M README
M maintenance/checkIndexes.php
M maintenance/updateOneSearchIndexConfig.php
M maintenance/updateVersionIndex.php
5 files changed, 31 insertions(+), 40 deletions(-)

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



diff --git a/CirrusSearch.php b/CirrusSearch.php
index b1b3364..c9ced2a 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -45,11 +45,12 @@
 // Number of shards for each index
 $wgCirrusSearchShardCount = array( 'content' = 4, 'general' = 4 );
 
-// Number of replicas per shard for each index
-// The default of 0 is fine for single-node setups, but if this is
-// deployed to a multi-node setting you probably at least want these
-// set to 1 for some redundancy, if not 2 for more redundancy.
-$wgCirrusSearchReplicaCount = array( 'content' = 0, 'general' = 0 );
+// Number of replicas Elasticsearch can expand or contract to. This allows for
+// easy development and deployment to a single node (0 replicas) to scale up to
+// higher levels of replication. You if you need more redundancy you could
+// adjust this to '0-10' or '0-all' or even 'false' (string, not boolean) to
+// disable the behavior entirely. The default should be fine for most people.
+$wgCirrusSearchReplicas = '0-2';
 
 // How many seconds must a search of Elasticsearch be before we consider it
 // slow?  Default value is 10 seconds which should be fine for catching the 
rare
@@ -80,8 +81,7 @@
 // mapped to specific index suffixes. The keys are the namespace number, and
 // the value is a string name of what index suffix to use. Changing this 
setting
 // requires a full reindex (not in-place) of the wiki.  If this setting 
contains
-// any values then the index names must also exist in $wgCirrusSearchShardCount
-// and $wgCirrusSearchReplicaCount.
+// any values then the index names must also exist in 
$wgCirrusSearchShardCount.
 $wgCirrusSearchNamespaceMappings = array();
 
 // Extra indexes (if any) you want to search, and for what namespaces?
diff --git a/README b/README
index af38c63..21d9ef5 100644
--- a/README
+++ b/README
@@ -17,8 +17,6 @@
 Configure your search servers in LocalSettings.php if you aren't running 
Elasticsearch on localhost:
  $wgCirrusSearchServers = array( 'elasticsearch0', 'elasticsearch1', 
'elasticsearch2', 'elasticsearch3' );
 There are other $wgCirrusSearch variables that you might want to change from 
their defaults.
-In production setups, you will very likely want to increase the number of 
replicas using
-$wgCirrusSearchReplicaCount.
 
 Now run this script to generate your elasticsearch index:
  php 
$MW_INSTALL_PATH/extensions/CirrusSearch/maintenance/updateSearchIndexConfig.php
@@ -198,15 +196,6 @@
  # Disable ability to shutdown nodes via REST API.
  ##
  action.disable_shutdown: true
-
-
-CirrusSearch
-
-You should change the number of replicas to at least one, two if you want 
protection from crashes
-during upgrades.  More replicas will help distribute queries across more 
nodes.  Having more
-replicas than nodes doesn't make sense and Elasticsearch will stay yellow if 
you do that.
-Anyway, you should add this to LocalSettings.php to change it:
- $wgCirrusSearchReplicaCount = array( 'content' = 2, 'general' = 2 );
 
 
 Testing
diff --git a/maintenance/checkIndexes.php b/maintenance/checkIndexes.php
index 15739c4..d85df37 100644
--- a/maintenance/checkIndexes.php
+++ b/maintenance/checkIndexes.php
@@ -47,7 +47,7 @@
}
$this-ensureClusterStateFetched();
$this-ensureCirrusInfoFetched();
-   $this-checkIndex( 'mw_cirrus_versions', 1, 1 );
+   $this-checkIndex( 'mw_cirrus_versions', 1 );
$aliases = array();
foreach ( $this-clusterState[ 'metadata' ][ 'indices' ] as 
$indexName = $data ) {
foreach ( $data[ 'aliases' ] as $alias ) {
@@ -56,7 +56,7 @@
}
foreach ( $this-cirrusInfo as $alias = $data ) {
foreach ( $aliases[ $alias ] as $indexName ) {
-   $this-checkIndex( $indexName, $data[ 
'shard_count'], $data[ 'replica_count' ] );
+   $this-checkIndex( $indexName, $data[ 
'shard_count'] );
}
}
$indexCount = count( $this-cirrusInfo );
@@ -77,7 +77,7 @@
}
}
 
-   private function checkIndex( $indexName, $expectedShardCount, 
$expectedReplicaCount ) {
+   private function checkIndex( $indexName, $expectedShardCount ) {
$this-path = array();
$metdata = $this-getIndexMetadata( 

[MediaWiki-commits] [Gerrit] Revert Introduce role::mariadb::backup - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Revert Introduce role::mariadb::backup
..

Revert Introduce role::mariadb::backup

Reverting because needed class passwords::mysql::dump has not yet been
added in the private repo.

This reverts commit 0cdadcd1535862a909ba14e48e7b45716e0b5365.

Change-Id: Ib1ad7b103cde05d7770576ff26b6841b77639173
---
M manifests/role/mariadb.pp
M manifests/site.pp
2 files changed, 1 insertion(+), 48 deletions(-)


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

diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp
index 1a1c62d..3995871 100644
--- a/manifests/role/mariadb.pp
+++ b/manifests/role/mariadb.pp
@@ -140,43 +140,3 @@
 
 mariadb::monitor_replication { ['s1', 'm2' ]: }
 }
-
-class role::mariadb::backup::config {
-if $mariadb_backups_folder {
-$folder = $mariadb_backups_folder
-} else {
-$folder = '/srv/backups'
-}
-}
-
-class role::mariadb::backup {
-include backup::host
-include passwords::mysql::dump
-
-include role::mariadb::backup::config
-$backups_folder = $role::mariadb::backup::config::folder
-
-file { $backups_folder:
-ensure = directory,
-owner  = 'root',
-group  = 'root',
-mode   = '0600', # implicitly 0700 for dirs
-}
-
-file { '/etc/mysql/conf.d/dumps.cnf':
-ensure  = present,
-owner   = 'root',
-group   = 'root',
-mode= '0400',
-content = 
[client]\nuser=${passwords::mysql::dump::user}\npassword=${passwords::mysql::dump::pass}\n,
-}
-
-backup::mysqlset {'dbstore':
-xtrabackup = false,
-per_db = true,
-innodb_only= true,
-local_dump_dir = $backups_folder,
-password_file  = '/etc/mysql/conf.d/dumps.cnf',
-method = 'predump',
-}
-}
diff --git a/manifests/site.pp b/manifests/site.pp
index 71e96e0..88b8f75 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -847,14 +847,7 @@
 include role::mariadb::tendril
 }
 
-node /^dbstore1001\.eqiad\.wmnet/ {
-$cluster = 'mysql'
-$mariadb_backups_folder = '/a/backups'
-include role::mariadb::dbstore
-include role::mariadb::backup
-}
-
-node /^dbstore1002\.eqiad\.wmnet/ {
+node /^dbstore100(1|2)\.eqiad\.wmnet/ {
 $cluster = 'mysql'
 include role::mariadb::dbstore
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1ad7b103cde05d7770576ff26b6841b77639173
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix reindex waiting for nodes - change (mediawiki...CirrusSearch)

2014-05-16 Thread Manybubbles (Code Review)
Manybubbles has uploaded a new change for review.

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

Change subject: Fix reindex waiting for nodes
..

Fix reindex waiting for nodes

The calculations were off by one

Change-Id: I212e0cae861531abf48ae38c98f5f19900cf1c9c
---
M maintenance/updateOneSearchIndexConfig.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/maintenance/updateOneSearchIndexConfig.php 
b/maintenance/updateOneSearchIndexConfig.php
index bf9bd9e..a4c138d 100644
--- a/maintenance/updateOneSearchIndexConfig.php
+++ b/maintenance/updateOneSearchIndexConfig.php
@@ -573,9 +573,9 @@
}
// If the upper range is all, expect 
the upper bound to be the number of nodes
if ( $upper === 'all' ) {
-   $upper = $nodes;
+   $upper = $nodes - 1;
}
-   $expectedReplicas =  min( max( $nodes, 
$lower ), $upper );
+   $expectedReplicas =  min( max( $nodes - 
1, $lower ), $upper );
$expectedActive = 
$this-getShardCount() * ( 1 + $expectedReplicas );
if ( $each === 0 || $active === 
$expectedActive ) {
$this-output( $this-indent . 
\t\tactive:$active/$expectedActive relocating:$relocating  .

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I212e0cae861531abf48ae38c98f5f19900cf1c9c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles never...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Revert Introduce role::mariadb::backup - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Revert Introduce role::mariadb::backup
..


Revert Introduce role::mariadb::backup

Reverting because needed class passwords::mysql::dump has not yet been
added in the private repo.

This reverts commit 0cdadcd1535862a909ba14e48e7b45716e0b5365.

Change-Id: Ib1ad7b103cde05d7770576ff26b6841b77639173
---
M manifests/role/mariadb.pp
M manifests/site.pp
2 files changed, 1 insertion(+), 48 deletions(-)

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



diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp
index 1a1c62d..3995871 100644
--- a/manifests/role/mariadb.pp
+++ b/manifests/role/mariadb.pp
@@ -140,43 +140,3 @@
 
 mariadb::monitor_replication { ['s1', 'm2' ]: }
 }
-
-class role::mariadb::backup::config {
-if $mariadb_backups_folder {
-$folder = $mariadb_backups_folder
-} else {
-$folder = '/srv/backups'
-}
-}
-
-class role::mariadb::backup {
-include backup::host
-include passwords::mysql::dump
-
-include role::mariadb::backup::config
-$backups_folder = $role::mariadb::backup::config::folder
-
-file { $backups_folder:
-ensure = directory,
-owner  = 'root',
-group  = 'root',
-mode   = '0600', # implicitly 0700 for dirs
-}
-
-file { '/etc/mysql/conf.d/dumps.cnf':
-ensure  = present,
-owner   = 'root',
-group   = 'root',
-mode= '0400',
-content = 
[client]\nuser=${passwords::mysql::dump::user}\npassword=${passwords::mysql::dump::pass}\n,
-}
-
-backup::mysqlset {'dbstore':
-xtrabackup = false,
-per_db = true,
-innodb_only= true,
-local_dump_dir = $backups_folder,
-password_file  = '/etc/mysql/conf.d/dumps.cnf',
-method = 'predump',
-}
-}
diff --git a/manifests/site.pp b/manifests/site.pp
index 71e96e0..88b8f75 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -847,14 +847,7 @@
 include role::mariadb::tendril
 }
 
-node /^dbstore1001\.eqiad\.wmnet/ {
-$cluster = 'mysql'
-$mariadb_backups_folder = '/a/backups'
-include role::mariadb::dbstore
-include role::mariadb::backup
-}
-
-node /^dbstore1002\.eqiad\.wmnet/ {
+node /^dbstore100(1|2)\.eqiad\.wmnet/ {
 $cluster = 'mysql'
 include role::mariadb::dbstore
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1ad7b103cde05d7770576ff26b6841b77639173
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove reference to 'calendar' for globe data type - change (mediawiki...Wikibase)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove reference to 'calendar' for globe data type
..


Remove reference to 'calendar' for globe data type

Change-Id: I639922a82277fa0b1871178af3fcaa771bde07df
---
M lib/includes/WikibaseDataTypeBuilders.php
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/lib/includes/WikibaseDataTypeBuilders.php 
b/lib/includes/WikibaseDataTypeBuilders.php
index 64a9b5f..1683054 100644
--- a/lib/includes/WikibaseDataTypeBuilders.php
+++ b/lib/includes/WikibaseDataTypeBuilders.php
@@ -252,7 +252,6 @@
$validators = array();
$validators[] = new TypeValidator( 'array' );
 
-   // calendar model field
$globeIdValidators = array();
// Expected to be a short IRI, see GlobeCoordinateValue and 
GlobeCoordinateParser.
$globeIdValidators[] = $urlValidator = 
$this-buildUrlValidator( array( 'http', 'https' ), 255 );
@@ -265,7 +264,7 @@
new CompositeValidator( $precisionValidators, true )
);
 
-   $validators[] = new DataFieldValidator( 'globe', // Note: 
validate the 'calendarmodel' field
+   $validators[] = new DataFieldValidator( 'globe', // Note: 
validate the 'globe' field
new CompositeValidator( $globeIdValidators, true ) 
//Note: each validator is fatal
);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I639922a82277fa0b1871178af3fcaa771bde07df
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: WikidataJenkins wikidata-servi...@wikimedia.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Converted $.each() to plain for() loop in GuidGenerator - change (mediawiki...Wikibase)

2014-05-16 Thread Henning Snater (Code Review)
Henning Snater has uploaded a new change for review.

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

Change subject: Converted $.each() to plain for() loop in GuidGenerator
..

Converted $.each() to plain for() loop in GuidGenerator

$.each() on strings fails in jQuery 1.9.

Change-Id: I71a7a0d6a861da3a262c8b0485ad7c2e6bf857b7
---
M lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js
1 file changed, 5 insertions(+), 4 deletions(-)


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

diff --git 
a/lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js 
b/lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js
index fd1bdde..7532a26 100644
--- a/lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js
+++ b/lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js
@@ -50,10 +50,12 @@
template = 'xx-x-x-x-xxx',
guid = '';
 
-   $.each( template, function( i, character ) {
+   for( var i = 0; i  template.length; i++ ) {
+   var character = template[i];
+
if ( character === '-' ) {
guid += '-';
-   return true;
+   continue;
}
 
var hex;
@@ -70,8 +72,7 @@
}
 
guid += hex;
-
-   } );
+   }
 
return guid;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71a7a0d6a861da3a262c8b0485ad7c2e6bf857b7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater henning.sna...@wikimedia.de

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


[MediaWiki-commits] [Gerrit] Revert Revert Introduce role::mariadb::backup - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Revert Revert Introduce role::mariadb::backup
..


Revert Revert Introduce role::mariadb::backup

Reverting the revert. The passwords::mysql::dump class has been added in
the private repo

This reverts commit f1d22656f098d617344027f557168eb5aaf90d3c.

Change-Id: I1bc1b33926289e012db82f30ee889e1305914a18
---
M manifests/role/mariadb.pp
M manifests/site.pp
2 files changed, 48 insertions(+), 1 deletion(-)

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



diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp
index 3995871..1a1c62d 100644
--- a/manifests/role/mariadb.pp
+++ b/manifests/role/mariadb.pp
@@ -140,3 +140,43 @@
 
 mariadb::monitor_replication { ['s1', 'm2' ]: }
 }
+
+class role::mariadb::backup::config {
+if $mariadb_backups_folder {
+$folder = $mariadb_backups_folder
+} else {
+$folder = '/srv/backups'
+}
+}
+
+class role::mariadb::backup {
+include backup::host
+include passwords::mysql::dump
+
+include role::mariadb::backup::config
+$backups_folder = $role::mariadb::backup::config::folder
+
+file { $backups_folder:
+ensure = directory,
+owner  = 'root',
+group  = 'root',
+mode   = '0600', # implicitly 0700 for dirs
+}
+
+file { '/etc/mysql/conf.d/dumps.cnf':
+ensure  = present,
+owner   = 'root',
+group   = 'root',
+mode= '0400',
+content = 
[client]\nuser=${passwords::mysql::dump::user}\npassword=${passwords::mysql::dump::pass}\n,
+}
+
+backup::mysqlset {'dbstore':
+xtrabackup = false,
+per_db = true,
+innodb_only= true,
+local_dump_dir = $backups_folder,
+password_file  = '/etc/mysql/conf.d/dumps.cnf',
+method = 'predump',
+}
+}
diff --git a/manifests/site.pp b/manifests/site.pp
index 88b8f75..71e96e0 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -847,7 +847,14 @@
 include role::mariadb::tendril
 }
 
-node /^dbstore100(1|2)\.eqiad\.wmnet/ {
+node /^dbstore1001\.eqiad\.wmnet/ {
+$cluster = 'mysql'
+$mariadb_backups_folder = '/a/backups'
+include role::mariadb::dbstore
+include role::mariadb::backup
+}
+
+node /^dbstore1002\.eqiad\.wmnet/ {
 $cluster = 'mysql'
 include role::mariadb::dbstore
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1bc1b33926289e012db82f30ee889e1305914a18
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Revert Revert Introduce role::mariadb::backup - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Revert Revert Introduce role::mariadb::backup
..

Revert Revert Introduce role::mariadb::backup

Reverting the revert. The passwords::mysql::dump class has been added in
the private repo

This reverts commit f1d22656f098d617344027f557168eb5aaf90d3c.

Change-Id: I1bc1b33926289e012db82f30ee889e1305914a18
---
M manifests/role/mariadb.pp
M manifests/site.pp
2 files changed, 48 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/00/133700/1

diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp
index 3995871..1a1c62d 100644
--- a/manifests/role/mariadb.pp
+++ b/manifests/role/mariadb.pp
@@ -140,3 +140,43 @@
 
 mariadb::monitor_replication { ['s1', 'm2' ]: }
 }
+
+class role::mariadb::backup::config {
+if $mariadb_backups_folder {
+$folder = $mariadb_backups_folder
+} else {
+$folder = '/srv/backups'
+}
+}
+
+class role::mariadb::backup {
+include backup::host
+include passwords::mysql::dump
+
+include role::mariadb::backup::config
+$backups_folder = $role::mariadb::backup::config::folder
+
+file { $backups_folder:
+ensure = directory,
+owner  = 'root',
+group  = 'root',
+mode   = '0600', # implicitly 0700 for dirs
+}
+
+file { '/etc/mysql/conf.d/dumps.cnf':
+ensure  = present,
+owner   = 'root',
+group   = 'root',
+mode= '0400',
+content = 
[client]\nuser=${passwords::mysql::dump::user}\npassword=${passwords::mysql::dump::pass}\n,
+}
+
+backup::mysqlset {'dbstore':
+xtrabackup = false,
+per_db = true,
+innodb_only= true,
+local_dump_dir = $backups_folder,
+password_file  = '/etc/mysql/conf.d/dumps.cnf',
+method = 'predump',
+}
+}
diff --git a/manifests/site.pp b/manifests/site.pp
index 88b8f75..71e96e0 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -847,7 +847,14 @@
 include role::mariadb::tendril
 }
 
-node /^dbstore100(1|2)\.eqiad\.wmnet/ {
+node /^dbstore1001\.eqiad\.wmnet/ {
+$cluster = 'mysql'
+$mariadb_backups_folder = '/a/backups'
+include role::mariadb::dbstore
+include role::mariadb::backup
+}
+
+node /^dbstore1002\.eqiad\.wmnet/ {
 $cluster = 'mysql'
 include role::mariadb::dbstore
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bc1b33926289e012db82f30ee889e1305914a18
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] raise db1070 and db1071 to normal load - change (operations/mediawiki-config)

2014-05-16 Thread Springle (Code Review)
Springle has uploaded a new change for review.

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

Change subject: raise db1070 and db1071 to normal load
..

raise db1070 and db1071 to normal load

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


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

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 8d38c7b..7e5abe7 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -94,8 +94,8 @@
'db1062' = 400, # 2.8TB 128GB
'db1065' = 500, # 2.8TB 160GB
'db1066' = 500, # 2.8TB 160GB
-   'db1070' = 50,  # 2.8TB 160GB, warm up
-   'db1071' = 50,  # 2.8TB 160GB, warm up
+   'db1070' = 500, # 2.8TB 160GB
+   'db1071' = 500, # 2.8TB 160GB
),
's2' = array(
'db1024' = 0,   # 1.4TB  64GB

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd28270f1d2bc45610c3489e42e6e077d3452597
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Springle sprin...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] raise db1070 and db1071 to normal load - change (operations/mediawiki-config)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: raise db1070 and db1071 to normal load
..


raise db1070 and db1071 to normal load

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

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



diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 8d38c7b..7e5abe7 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -94,8 +94,8 @@
'db1062' = 400, # 2.8TB 128GB
'db1065' = 500, # 2.8TB 160GB
'db1066' = 500, # 2.8TB 160GB
-   'db1070' = 50,  # 2.8TB 160GB, warm up
-   'db1071' = 50,  # 2.8TB 160GB, warm up
+   'db1070' = 500, # 2.8TB 160GB
+   'db1071' = 500, # 2.8TB 160GB
),
's2' = array(
'db1024' = 0,   # 1.4TB  64GB

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibd28270f1d2bc45610c3489e42e6e077d3452597
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Springle sprin...@wikimedia.org
Gerrit-Reviewer: Springle sprin...@wikimedia.org
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 numerous use statements - change (mediawiki...CirrusSearch)

2014-05-16 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

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

Change subject: Add numerous use statements
..

Add numerous use statements

Fixup some minor parameter documentation issues

Change-Id: I501e10a8403dcef8ede11bc269eb923366089513
---
M includes/Hooks.php
1 file changed, 16 insertions(+), 2 deletions(-)


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

diff --git a/includes/Hooks.php b/includes/Hooks.php
index 4daf254..eed6cd2 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -1,11 +1,17 @@
 ?php
 
 namespace CirrusSearch;
+use \ApiMain;
 use \CirrusSearch;
 use \BetaFeatures;
 use \JobQueueGroup;
+use \LinksUpdate;
+use \OutputPage;
+use \SpecialSearch;
 use \Title;
 use \RequestContext;
+use \User;
+use \WebRequest;
 use \WikiPage;
 use \Xml;
 
@@ -51,6 +57,9 @@
 * Initializes the portions of Cirrus that require the $user to be 
fully initialized and therefore
 * cannot be done in $wgExtensionFunctions.  Specifically this means 
the beta features check and
 * installing the prefix search hook, because it needs information from 
the beta features check.
+*
+* @param User $user
+* @param WebRequest $request
 */
private static function initializeForUser( $user, $request ) {
global $wgCirrusSearchEnablePref;
@@ -206,7 +215,7 @@
/**
 * Hooked to update the search index when pages change directly or when 
templates that
 * they include change.
-* @param $linksUpdate LinksUpdate source of all links update 
information
+* @param LinksUpdate $linksUpdate source of all links update 
information
 * @return bool
 */
public static function onLinksUpdateCompleted( $linksUpdate ) {
@@ -313,9 +322,10 @@
 * When we've moved a Title from A to B, update A as appropriate.
 * We already update B because of the implicit edit.
 * @param Title $title The old title
-* @param Title $title The new title
+* @param Title $newtitle The new title
 * @param User $user User who made the move
 * @param int $oldid The page id of the old page.
+* @return bool
 */
public static function onTitleMoveComplete( Title $title, Title 
$newtitle, $user, $oldid ) {
// If the page exists, update it, it's probably a redirect now.
@@ -334,10 +344,14 @@
 * This includes limiting them to $max titles.
 * @param array(Title) $titles titles to prepare
 * @param int $max maximum number of titles to return
+* @return array
 */
private static function prepareTitlesForLinksUpdate( $titles, $max ) {
$titles = self::pickFromArray( $titles, $max );
$dBKeys = array();
+   /**
+* @var Title $title
+*/
foreach ( $titles as $title ) {
$dBKeys[] = $title-getPrefixedDBkey();
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I501e10a8403dcef8ede11bc269eb923366089513
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Reedy re...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] bacula: Also encrypt the data channel - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: bacula: Also encrypt the data channel
..

bacula: Also encrypt the data channel

The actual data is already encrypted by the client before being
transmitted on the network but the metadata (filenames, permissions etc)
was not. This will incur some extra load on both servers due to the
extra layer of encryption but it should be relatively neglegible

Change-Id: I499a0d50d54e7b8e7d67f130d8887ee96d09c76d
---
M modules/bacula/templates/bacula-fd.conf.erb
M modules/bacula/templates/bacula-sd.conf.erb
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/02/133702/1

diff --git a/modules/bacula/templates/bacula-fd.conf.erb 
b/modules/bacula/templates/bacula-fd.conf.erb
index 3ac4fb7..0f9d655 100644
--- a/modules/bacula/templates/bacula-fd.conf.erb
+++ b/modules/bacula/templates/bacula-fd.conf.erb
@@ -28,8 +28,8 @@
 PKI Signatures = Yes
 PKI Keypair = /var/lib/puppet/ssl/private_keys/bacula-keypair-%= @fqdn 
%.pem
 PKI Master Key = /var/lib/puppet/ssl/certs/ca.pem
-# Do NOT enable Data channel encryption.
-TLS Enable = no
+# Do enable Data channel encryption.
+TLS Enable = yes
 TLS Require = yes
 TLS Certificate = /var/lib/puppet/ssl/certs/%= @fqdn %.pem
 TLS Key = /var/lib/puppet/ssl/private_keys/%= @fqdn %.pem
diff --git a/modules/bacula/templates/bacula-sd.conf.erb 
b/modules/bacula/templates/bacula-sd.conf.erb
index 22cd6f2..7022581 100644
--- a/modules/bacula/templates/bacula-sd.conf.erb
+++ b/modules/bacula/templates/bacula-sd.conf.erb
@@ -20,8 +20,8 @@
 Pid Directory = /var/run/bacula
 Maximum Concurrent Jobs = %= @sd_max_concur_jobs %
 Plugin Directory = /usr/lib/bacula
-# Do NOT Have the data channel encrypted.
-TLS Enable = no
+# Do Have the data channel encrypted.
+TLS Enable = yes
 TLS Require = yes
 TLS CA Certificate File = /var/lib/puppet/ssl/certs/ca.pem
 TLS Verify Peer = yes

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I499a0d50d54e7b8e7d67f130d8887ee96d09c76d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Revert Prevent horizontal scrollbar after menu closing anim... - change (mediawiki...MobileFrontend)

2014-05-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Revert Prevent horizontal scrollbar after menu closing 
animation
..

Revert Prevent horizontal scrollbar after menu closing animation

This reverts commit 5caf98a164c0d9b3ae09a16d851af4e7bb8e8f4e.
which has broken vertical scrolling in older iPhones

Bug: 65393
Change-Id: Ie38a49914c273f6b0b8ae3ce64c982ac147ab92f
---
M less/common/mainmenu.less
1 file changed, 1 insertion(+), 3 deletions(-)


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

diff --git a/less/common/mainmenu.less b/less/common/mainmenu.less
index 52d1833..37f8286 100644
--- a/less/common/mainmenu.less
+++ b/less/common/mainmenu.less
@@ -8,8 +8,6 @@
 #mw-mf-viewport {
position: relative;
height: 100%;
-   // opening nav transition can introduce a horizontal scrollbar without 
this
-   overflow-x: hidden;
 }
 
 #mw-mf-page-center {
@@ -164,7 +162,7 @@
 body.navigation-enabled {
 
#mw-mf-viewport {
-   // disable scrolling
+   // disable horizontal scrolling
overflow: hidden;
// the two following properties are needed to override the 
height set
// by position: fixed fallback on scroll event

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie38a49914c273f6b0b8ae3ce64c982ac147ab92f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson jrob...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Add /a/backups fileset to bacula director - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Add /a/backups fileset to bacula director
..

Add /a/backups fileset to bacula director

It was forgotten in 0cdadcd

Change-Id: I8c8f7df9edb2fba0304aee175ab1adb2deeed174
---
M manifests/role/backup.pp
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/04/133704/1

diff --git a/manifests/role/backup.pp b/manifests/role/backup.pp
index c1a7311..cb96b87 100644
--- a/manifests/role/backup.pp
+++ b/manifests/role/backup.pp
@@ -131,6 +131,9 @@
 bacula::director::fileset { 'var-vmail':
 includes = [ '/var/vmail' ]
 }
+bacula::director::fileset { 'a-backups':
+includes = [ '/a/backups' ]
+}
 bacula::director::fileset { 'mysql-bpipe-xfalse-pfalse-ifalse':
 includes = [],
 plugins  = [ 'mysql-bpipe-xfalse-pfalse-ifalse',]

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c8f7df9edb2fba0304aee175ab1adb2deeed174
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] repool db1056 in s4, warm up - change (operations/mediawiki-config)

2014-05-16 Thread Springle (Code Review)
Springle has uploaded a new change for review.

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

Change subject: repool db1056 in s4, warm up
..

repool db1056 in s4, warm up

Change-Id: I9ec35b22453825b1c75b3efefaf2fd337d3d68f8
---
M wmf-config/db-eqiad.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 7e5abe7..0c3d2fc 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -89,7 +89,6 @@
'db1052' = 0,   # 2.8TB  96GB
'db1055' = 0,   # 2.8TB  96GB, watchlist, recentchangeslinked, 
contributions, logpager
'db1051' = 0,   # 2.8TB  96GB, vslow, api, dump
-   #'db1056' = 300, # 2.8TB  96GB
'db1061' = 400, # 2.8TB 128GB
'db1062' = 400, # 2.8TB 128GB
'db1065' = 500, # 2.8TB 160GB
@@ -120,6 +119,7 @@
'db1004' = 0,   # 1.4TB  64GB, watchlist, recentchangeslinked, 
contributions, logpager
'db1011' = 300, # 1.4TB  64GB
'db1049' = 300, # 1.4TB  64GB
+   'db1056' = 50,  # 2.8TB  96GB, warm up
'db1059' = 400, # 2.8TB  96GB
'db1064' = 500, # 2.8TB 160GB
),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ec35b22453825b1c75b3efefaf2fd337d3d68f8
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Springle sprin...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] repool db1056 in s4, warm up - change (operations/mediawiki-config)

2014-05-16 Thread Springle (Code Review)
Springle has submitted this change and it was merged.

Change subject: repool db1056 in s4, warm up
..


repool db1056 in s4, warm up

Change-Id: I9ec35b22453825b1c75b3efefaf2fd337d3d68f8
---
M wmf-config/db-eqiad.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Springle: Looks good to me, approved



diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php
index 7e5abe7..0c3d2fc 100644
--- a/wmf-config/db-eqiad.php
+++ b/wmf-config/db-eqiad.php
@@ -89,7 +89,6 @@
'db1052' = 0,   # 2.8TB  96GB
'db1055' = 0,   # 2.8TB  96GB, watchlist, recentchangeslinked, 
contributions, logpager
'db1051' = 0,   # 2.8TB  96GB, vslow, api, dump
-   #'db1056' = 300, # 2.8TB  96GB
'db1061' = 400, # 2.8TB 128GB
'db1062' = 400, # 2.8TB 128GB
'db1065' = 500, # 2.8TB 160GB
@@ -120,6 +119,7 @@
'db1004' = 0,   # 1.4TB  64GB, watchlist, recentchangeslinked, 
contributions, logpager
'db1011' = 300, # 1.4TB  64GB
'db1049' = 300, # 1.4TB  64GB
+   'db1056' = 50,  # 2.8TB  96GB, warm up
'db1059' = 400, # 2.8TB  96GB
'db1064' = 500, # 2.8TB 160GB
),

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9ec35b22453825b1c75b3efefaf2fd337d3d68f8
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Springle sprin...@wikimedia.org
Gerrit-Reviewer: Springle sprin...@wikimedia.org
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 numerous use statements - change (mediawiki...CirrusSearch)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Add numerous use statements
..


Add numerous use statements

Fixup some minor parameter documentation issues

Change-Id: I501e10a8403dcef8ede11bc269eb923366089513
---
M includes/Hooks.php
1 file changed, 16 insertions(+), 2 deletions(-)

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



diff --git a/includes/Hooks.php b/includes/Hooks.php
index 4daf254..eed6cd2 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -1,11 +1,17 @@
 ?php
 
 namespace CirrusSearch;
+use \ApiMain;
 use \CirrusSearch;
 use \BetaFeatures;
 use \JobQueueGroup;
+use \LinksUpdate;
+use \OutputPage;
+use \SpecialSearch;
 use \Title;
 use \RequestContext;
+use \User;
+use \WebRequest;
 use \WikiPage;
 use \Xml;
 
@@ -51,6 +57,9 @@
 * Initializes the portions of Cirrus that require the $user to be 
fully initialized and therefore
 * cannot be done in $wgExtensionFunctions.  Specifically this means 
the beta features check and
 * installing the prefix search hook, because it needs information from 
the beta features check.
+*
+* @param User $user
+* @param WebRequest $request
 */
private static function initializeForUser( $user, $request ) {
global $wgCirrusSearchEnablePref;
@@ -206,7 +215,7 @@
/**
 * Hooked to update the search index when pages change directly or when 
templates that
 * they include change.
-* @param $linksUpdate LinksUpdate source of all links update 
information
+* @param LinksUpdate $linksUpdate source of all links update 
information
 * @return bool
 */
public static function onLinksUpdateCompleted( $linksUpdate ) {
@@ -313,9 +322,10 @@
 * When we've moved a Title from A to B, update A as appropriate.
 * We already update B because of the implicit edit.
 * @param Title $title The old title
-* @param Title $title The new title
+* @param Title $newtitle The new title
 * @param User $user User who made the move
 * @param int $oldid The page id of the old page.
+* @return bool
 */
public static function onTitleMoveComplete( Title $title, Title 
$newtitle, $user, $oldid ) {
// If the page exists, update it, it's probably a redirect now.
@@ -334,10 +344,14 @@
 * This includes limiting them to $max titles.
 * @param array(Title) $titles titles to prepare
 * @param int $max maximum number of titles to return
+* @return array
 */
private static function prepareTitlesForLinksUpdate( $titles, $max ) {
$titles = self::pickFromArray( $titles, $max );
$dBKeys = array();
+   /**
+* @var Title $title
+*/
foreach ( $titles as $title ) {
$dBKeys[] = $title-getPrefixedDBkey();
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I501e10a8403dcef8ede11bc269eb923366089513
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Reedy re...@wikimedia.org
Gerrit-Reviewer: Chad ch...@wikimedia.org
Gerrit-Reviewer: Manybubbles never...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] jQuery 1.9 compatibility fixes - change (mediawiki...UploadWizard)

2014-05-16 Thread Gilles (Code Review)
Gilles has uploaded a new change for review.

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

Change subject: jQuery 1.9 compatibility fixes
..

jQuery 1.9 compatibility fixes

Also takes care of a few core deprecations

Change-Id: Ia7f4376cd2ca5064ab486d5213cb842c35804eae
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/591
---
M resources/mw.ApiUploadFormDataHandler.js
M resources/mw.ApiUploadHandler.js
M resources/mw.Firefogg.js
M resources/mw.UploadWizard.js
M resources/mw.UploadWizardDeed.js
M resources/mw.UploadWizardDetails.js
M resources/mw.UploadWizardLicenseInput.js
M resources/mw.UploadWizardUpload.js
M resources/mw.UploadWizardUploadInterface.js
M resources/mw.fileApi.js
M resources/uploadWizard.css
M test/jasmine/spec/mediawiki.parser2.spec.js
12 files changed, 202 insertions(+), 217 deletions(-)


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

diff --git a/resources/mw.ApiUploadFormDataHandler.js 
b/resources/mw.ApiUploadFormDataHandler.js
index f0d2c4d..8de046e 100644
--- a/resources/mw.ApiUploadFormDataHandler.js
+++ b/resources/mw.ApiUploadFormDataHandler.js
@@ -45,7 +45,7 @@
 callerOk();
 };
 
-this.api.getEditToken( ok, err );
+this.api.getEditToken().done( ok ).fail( err );
 },
 
 /**
diff --git a/resources/mw.ApiUploadHandler.js b/resources/mw.ApiUploadHandler.js
index 358cc57..86be98d 100644
--- a/resources/mw.ApiUploadHandler.js
+++ b/resources/mw.ApiUploadHandler.js
@@ -75,7 +75,7 @@
 
var handler = this;
 
-   this.api.getEditToken( ok, err );
+   this.api.getEditToken().done( ok ).fail( err );
},
 
/**
diff --git a/resources/mw.Firefogg.js b/resources/mw.Firefogg.js
index 1ad65b9..607e808 100644
--- a/resources/mw.Firefogg.js
+++ b/resources/mw.Firefogg.js
@@ -1,5 +1,5 @@
 // Firefogg utilities not related to the upload handler or transport
-( function ( mw, $ ) {
+( function ( mw ) {
 mw.Firefogg = {
 
firefoggInstallLinks: {
@@ -13,7 +13,7 @@
 */
getFirefoggInstallUrl: function() {
var osLink = false;
-   if( ! $.browser.mozilla ){
+   if( ! /Firefox/.test( navigator.userAgent ) ) {
return 'http://firefogg.org/';
}
if ( navigator.oscpu ) {
@@ -32,4 +32,4 @@
return typeof window.Firefogg !== 'undefined'  new 
window.Firefogg().version = '2.8.05';
}
 };
-}( mediaWiki, jQuery ) );
+} ( mediaWiki ) );
diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index 9ecc0ca..ed20678 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -305,7 +305,7 @@
title: function() {
return mw.message(

'mwe-upwiz-tooltip-skiptutorial',
-   mw.config.get( 'wgServer' ) + 
mw.util.wikiGetlink( 'Special:Preferences' ) + '#mw-prefsection-uploads',
+   mw.config.get( 'wgServer' ) + 
mw.util.getUrl( 'Special:Preferences' ) + '#mw-prefsection-uploads',
mw.message( 'prefs-uploads' 
).escaped(),
mw.message( 
'prefs-upwiz-interface' ).escaped()
).parse();
@@ -366,7 +366,7 @@
 
// Insert input field into the form and set up submit action
$flickrForm.prepend( $flickrInput ).submit( function() {
-   $flickrButton.attr( 'disabled', 'disabled' );
+   $flickrButton.prop( 'disabled', true );
wizard.flickrChecker( checker );
// TODO Any particular reason to stopPropagation ?
return false;
@@ -396,7 +396,7 @@
// first destroy it completely, then reshow the add button
this.flickrInterfaceDestroy();
$( '#mwe-upwiz-upload-add-flickr-container' ).show();
-   $( '#mwe-upwiz-upload-add-flickr' ).removeAttr( 'disabled' );
+   $( '#mwe-upwiz-upload-add-flickr' ).removeProp( 'disabled' );
},
 
/**
@@ -409,7 +409,7 @@
$( '#mwe-upwiz-select-flickr' ).unbind();
$( '#mwe-upwiz-flickr-select-list-container' ).hide();
$( '#mwe-upwiz-upload-add-flickr-container' ).hide();
-   $( '#mwe-upwiz-upload-add-flickr' ).attr( 'disabled', 
'disabled' );
+   $( '#mwe-upwiz-upload-add-flickr' ).prop( 'disabled', true );
},
 
/**
@@ -1424,13 +1424,12 @@
 
$.fn.enableNextButton = function() {
return this.find( '.mwe-upwiz-button-next' )
- 

[MediaWiki-commits] [Gerrit] Add /a/backups fileset to bacula director - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Add /a/backups fileset to bacula director
..


Add /a/backups fileset to bacula director

It was forgotten in 0cdadcd

Change-Id: I8c8f7df9edb2fba0304aee175ab1adb2deeed174
---
M manifests/role/backup.pp
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/manifests/role/backup.pp b/manifests/role/backup.pp
index c1a7311..cb96b87 100644
--- a/manifests/role/backup.pp
+++ b/manifests/role/backup.pp
@@ -131,6 +131,9 @@
 bacula::director::fileset { 'var-vmail':
 includes = [ '/var/vmail' ]
 }
+bacula::director::fileset { 'a-backups':
+includes = [ '/a/backups' ]
+}
 bacula::director::fileset { 'mysql-bpipe-xfalse-pfalse-ifalse':
 includes = [],
 plugins  = [ 'mysql-bpipe-xfalse-pfalse-ifalse',]

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c8f7df9edb2fba0304aee175ab1adb2deeed174
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
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 graphite dashboard to gdash - change (operations/puppet)

2014-05-16 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review.

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

Change subject: add graphite dashboard to gdash
..

add graphite dashboard to gdash

Change-Id: Ibe966d1ff10a4364301e1657fdcf7619af88370c
---
A files/gdash/dashboards/graphite/carbon_cache.graph
A files/gdash/dashboards/graphite/carbon_relay.graph
A files/gdash/dashboards/graphite/cpu.graph
A files/gdash/dashboards/graphite/dash.yaml
A files/gdash/dashboards/graphite/disk_io.graph
A files/gdash/dashboards/graphite/disk_sched.graph
A files/gdash/dashboards/graphite/memory.graph
A files/gdash/dashboards/graphite/network_err.graph
A files/gdash/dashboards/graphite/network_io.graph
9 files changed, 127 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/07/133707/1

diff --git a/files/gdash/dashboards/graphite/carbon_cache.graph 
b/files/gdash/dashboards/graphite/carbon_cache.graph
new file mode 100644
index 000..05b31d8
--- /dev/null
+++ b/files/gdash/dashboards/graphite/carbon_cache.graph
@@ -0,0 +1,25 @@
+title   carbon cache
+
+field :updates,
+   :alias = updates,
+   :data  = sumSeries(carbon.agents.tungsten-*.updateOperations)
+
+field :received,
+   :alias = received,
+   :data  = sumSeries(carbon.agents.tungsten-*.metricsReceived)
+
+field :committed,
+   :alias = committed,
+   :data  = sumSeries(carbon.agents.tungsten-*.committedPoints)
+
+field :ppu,
+   :alias = points per update,
+   :data  = 
secondYAxis(sumSeries(carbon.agents.tungsten-*.pointsPerUpdate))
+
+field :creates,
+   :alias = creates,
+   :data  = 
secondYAxis(sumSeries(carbon.agents.tungsten-*.creates))
+
+field :cpu,
+   :alias = avg cpu,
+   :data  = 
secondYAxis(averageSeries(carbon.agents.tungsten-*.cpuUsage))
diff --git a/files/gdash/dashboards/graphite/carbon_relay.graph 
b/files/gdash/dashboards/graphite/carbon_relay.graph
new file mode 100644
index 000..159397d
--- /dev/null
+++ b/files/gdash/dashboards/graphite/carbon_relay.graph
@@ -0,0 +1,9 @@
+title   carbon relay
+
+field :metrics_in,
+   :alias = metrics received,
+   :data  = sumSeries(carbon.relays.tungsten-*.metricsReceived)
+
+field :queue_drops,
+   :alias = queue drops,
+   :data  = 
secondYAxis(sumSeries(carbon.relays.tungsten-*.destinations.*.fullQueueDrops))
diff --git a/files/gdash/dashboards/graphite/cpu.graph 
b/files/gdash/dashboards/graphite/cpu.graph
new file mode 100644
index 000..f6ce45c
--- /dev/null
+++ b/files/gdash/dashboards/graphite/cpu.graph
@@ -0,0 +1,13 @@
+title   CPU
+
+field :user,
+   :alias = user,
+   :data  = servers.tungsten.cpu.total.user.value
+
+field :iowait,
+   :alias = iowait,
+   :data  = servers.tungsten.cpu.total.iowait.value
+
+field :system,
+   :alias = system,
+   :data  = servers.tungsten.cpu.total.system.value
diff --git a/files/gdash/dashboards/graphite/dash.yaml 
b/files/gdash/dashboards/graphite/dash.yaml
new file mode 100644
index 000..4b57866
--- /dev/null
+++ b/files/gdash/dashboards/graphite/dash.yaml
@@ -0,0 +1,2 @@
+:name: Graphite
+:description: Health metrics from graphite on tungsten
diff --git a/files/gdash/dashboards/graphite/disk_io.graph 
b/files/gdash/dashboards/graphite/disk_io.graph
new file mode 100644
index 000..7d943d8
--- /dev/null
+++ b/files/gdash/dashboards/graphite/disk_io.graph
@@ -0,0 +1,17 @@
+title   Disk IO, sda
+
+field :write_s,
+   :alias = write/s,
+   :data  = servers.tungsten.iostat.sda.writes_per_second.value
+
+field :read_s,
+   :alias = read/s,
+   :data  = servers.tungsten.iostat.sda.reads_per_second.value
+
+field :read,
+   :alias = read B/s,
+   :data  = 
secondYAxis(servers.tungsten.iostat.sda.read_byte_per_second.value)
+
+field :write,
+   :alias = write B/s,
+   :data  = 
secondYAxis(servers.tungsten.iostat.sda.write_byte_per_second.value)
diff --git a/files/gdash/dashboards/graphite/disk_sched.graph 
b/files/gdash/dashboards/graphite/disk_sched.graph
new file mode 100644
index 000..f9688d2
--- /dev/null
+++ b/files/gdash/dashboards/graphite/disk_sched.graph
@@ -0,0 +1,14 @@
+title   Disk scheduling, sda
+
+field :svctm, :color = blue,
+   :alias = service time, ms,
+   :data  = 
secondYAxis(servers.tungsten.iostat.sda.service_time.value)
+
+field :await, :color = green,
+   :alias = wait, ms,
+   :data  = servers.tungsten.iostat.sda.await.value
+
+field :queue, :color = red,
+   :alias = queue length,
+   :data  = 
servers.tungsten.iostat.sda.average_queue_length.value
+
diff --git 

[MediaWiki-commits] [Gerrit] Also add /srv/backups - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Also add /srv/backups
..

Also add /srv/backups

Put a nice comment about /a/backups as well and put the mysql/mariadb
designation there as well

Change-Id: Ibfab2f34645b1b3222b5615723a122d1b3bdb658
---
M manifests/role/backup.pp
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/08/133708/1

diff --git a/manifests/role/backup.pp b/manifests/role/backup.pp
index cb96b87..c92ffdd 100644
--- a/manifests/role/backup.pp
+++ b/manifests/role/backup.pp
@@ -131,7 +131,12 @@
 bacula::director::fileset { 'var-vmail':
 includes = [ '/var/vmail' ]
 }
-bacula::director::fileset { 'a-backups':
+bacula::director::fileset { 'mysql-srv-backups':
+includes = [ '/srv/backups' ]
+}
+# As all /a this will hopefully no longer be needed at some point and will
+# be killed with fire
+bacula::director::fileset { 'mysql-a-backups':
 includes = [ '/a/backups' ]
 }
 bacula::director::fileset { 'mysql-bpipe-xfalse-pfalse-ifalse':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfab2f34645b1b3222b5615723a122d1b3bdb658
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Also add /srv/backups - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Also add /srv/backups
..


Also add /srv/backups

Put a nice comment about /a/backups as well and put the mysql/mariadb
designation there as well

Change-Id: Ibfab2f34645b1b3222b5615723a122d1b3bdb658
---
M manifests/role/backup.pp
1 file changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/manifests/role/backup.pp b/manifests/role/backup.pp
index cb96b87..c92ffdd 100644
--- a/manifests/role/backup.pp
+++ b/manifests/role/backup.pp
@@ -131,7 +131,12 @@
 bacula::director::fileset { 'var-vmail':
 includes = [ '/var/vmail' ]
 }
-bacula::director::fileset { 'a-backups':
+bacula::director::fileset { 'mysql-srv-backups':
+includes = [ '/srv/backups' ]
+}
+# As all /a this will hopefully no longer be needed at some point and will
+# be killed with fire
+bacula::director::fileset { 'mysql-a-backups':
 includes = [ '/a/backups' ]
 }
 bacula::director::fileset { 'mysql-bpipe-xfalse-pfalse-ifalse':

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibfab2f34645b1b3222b5615723a122d1b3bdb658
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] History: Simplify checkboxes script on History pages - change (mediawiki/core)

2014-05-16 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

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

Change subject: History: Simplify checkboxes script on History pages
..

History: Simplify checkboxes script on History pages

This should reduce the amount of variables constructed and also switches
to a class based implementation, which allows us to do the same with
fewer calls touching the DOM.

Bug: 51561
Change-Id: I4596b3667f990ef1d8c7ca753e1d80fe285d5614
---
M resources/Resources.php
A resources/src/mediawiki.action/mediawiki.action.history.css
M resources/src/mediawiki.action/mediawiki.action.history.js
3 files changed, 24 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/09/133709/1

diff --git a/resources/Resources.php b/resources/Resources.php
index c2112ae..01eb02e 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -971,6 +971,7 @@
),
'mediawiki.action.history' = array(
'scripts' = 
'resources/src/mediawiki.action/mediawiki.action.history.js',
+   'styles' = 
'resources/src/mediawiki.action/mediawiki.action.history.css',
'group' = 'mediawiki.action.history',
),
'mediawiki.action.history.diff' = array(
diff --git a/resources/src/mediawiki.action/mediawiki.action.history.css 
b/resources/src/mediawiki.action/mediawiki.action.history.css
new file mode 100644
index 000..841fadc
--- /dev/null
+++ b/resources/src/mediawiki.action/mediawiki.action.history.css
@@ -0,0 +1,6 @@
+#pagehistory li.before input[name=oldid] {
+   visibility: hidden;
+}
+#pagehistory li.after input[name=diff] {
+   visibility: hidden;
+}
diff --git a/resources/src/mediawiki.action/mediawiki.action.history.js 
b/resources/src/mediawiki.action/mediawiki.action.history.js
index 8aa5a1f..6a2a841 100644
--- a/resources/src/mediawiki.action/mediawiki.action.history.js
+++ b/resources/src/mediawiki.action/mediawiki.action.history.js
@@ -12,54 +12,38 @@
 * @param e {jQuery.Event}
 */
function updateDiffRadios() {
-   var diffLi = false, // the li where the diff radio is checked
-   oldLi = false; // the li where the oldid radio is 
checked
+   var state = 'before',
+   $li,
+   $inputs,
+   $oldidRadio,
+   $diffRadio;
 
if ( !$lis.length ) {
return true;
}
 
$lis
-   .removeClass( 'selected' )
.each( function () {
-   var $li = $( this ),
-   $inputs = $li.find( 'input[type=radio]' ),
-   $oldidRadio = $inputs.filter( '[name=oldid]' 
).eq( 0 ),
-   $diffRadio = $inputs.filter( '[name=diff]' 
).eq( 0 );
+   $li = $( this ),
+   $inputs = $li.find( 'input[type=radio]' ),
+   $oldidRadio = $inputs.filter( '[name=oldid]' ).eq( 0 
),
+   $diffRadio = $inputs.filter( '[name=diff]' ).eq( 0 );
+
+   $li.removeClass( 'selected between before after' );
 
if ( !$oldidRadio.length || !$diffRadio.length ) {
return true;
}
 
if ( $oldidRadio.prop( 'checked' ) ) {
-   oldLi = true;
-   $li.addClass( 'selected' );
-   $oldidRadio.css( 'visibility', 'visible' );
-   $diffRadio.css( 'visibility', 'hidden' );
-
+   $li.addClass( 'selected after' );
+   state = 'after';
} else if ( $diffRadio.prop( 'checked' ) ) {
-   diffLi = true;
-   $li.addClass( 'selected' );
-   $oldidRadio.css( 'visibility', 'hidden' );
-   $diffRadio.css( 'visibility', 'visible' );
-
-   // This list item has neither checked
+   $li.addClass( 'selected before' );
+   state = 'between';
} else {
-   // We're below the selected radios
-   if ( diffLi  oldLi ) {
-   $oldidRadio.css( 'visibility', 
'visible' );
-   $diffRadio.css( 'visibility', 'hidden' 
);
-
-   // We're between the selected radios
-   } else if ( diffLi ) {
-   $diffRadio.css( 'visibility', 'visible' 
);
- 

[MediaWiki-commits] [Gerrit] _autoload.php file was renamed to Autoload.php - change (mediawiki...Translate)

2014-05-16 Thread BPositive (Code Review)
BPositive has uploaded a new change for review.

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

Change subject: _autoload.php file was renamed to Autoload.php
..

_autoload.php file was renamed to Autoload.php

The file was renamed to keep consistency over extensions and the references 
were resolved as well.

Change-Id: I6262c9eb497e32d0280bc6aafc9c8503843cfb3b
---
R Autoload.php
M Translate.php
M tests/phpunit/SpecialPagesTest.php
3 files changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/_autoload.php b/Autoload.php
similarity index 99%
rename from _autoload.php
rename to Autoload.php
index 100abbe..398bf68 100644
--- a/_autoload.php
+++ b/Autoload.php
@@ -52,6 +52,7 @@
 $wgAutoloadClasses['SpecialTranslationStats'] = 
$dir/specials/SpecialTranslationStats.php;
 $wgAutoloadClasses['SpecialTranslations'] = 
$dir/specials/SpecialTranslations.php;
 $wgAutoloadClasses['SpecialTranslationStash'] = 
$dir/specials/SpecialTranslationStash.php;
+$wgAutoloadClasses['SpecialPageMigration'] = 
$dir/specials/SpecialPageMigration.php;
 /**@}*/
 
 /**
diff --git a/Translate.php b/Translate.php
index 7679b39..acfcca9 100644
--- a/Translate.php
+++ b/Translate.php
@@ -40,7 +40,7 @@
  * Setup class autoloading.
  */
 $dir = __DIR__;
-require_once $dir/_autoload.php;
+require_once $dir/Autoload.php;
 /** @endcond */
 
 /**
diff --git a/tests/phpunit/SpecialPagesTest.php 
b/tests/phpunit/SpecialPagesTest.php
index 5c6e035..658d859 100644
--- a/tests/phpunit/SpecialPagesTest.php
+++ b/tests/phpunit/SpecialPagesTest.php
@@ -26,7 +26,7 @@
}
 
public static function provideSpecialPages() {
-   require __DIR__ . '/../../_autoload.php';
+   require __DIR__ . '/../../Autoload.php';
global $wgSpecialPages;
 
$pages = array();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6262c9eb497e32d0280bc6aafc9c8503843cfb3b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: BPositive pr4tiklah...@gmail.com

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


[MediaWiki-commits] [Gerrit] Update jscs and jshint config - change (mediawiki/core)

2014-05-16 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: Update jscs and jshint config
..

Update jscs and jshint config

Continue specifying our coding style more accurately in jscs,
and phase out more deprecated jshint coding style options.

jshint:
* Update to grunt-contrib-jshint v0.10.0 (jshint v2.5.0).
* Remove coding style option curly (already covered by jscs).
* Remove coding style option smarttabs (already covered by jscs).
* Remove option regexp.
* Enable new option freeze (prohibits changing native prototypes).
  http://www.jshint.com/blog/new-in-jshint-oct-2013/#option-freeze
* Re-order to match http://www.jshint.com/docs/options/

jscs:
* Update to grunt-contrib-jshint v0.4.4 (jscs v1.4.5).
* Format .jscsrc file in a more spacious way and order the
  properties less arbitrarily (using the jscs's readme order).
* Improve rule requireCurlyBraces: Add more keywords that
should have their code block wrapped in curly braces.
* Improve rule requireMultipleVarDecl: Use onevar instead of true.
* Remove rules for sticky operators, these rules are buggy
and have been deprecated. Using the SpaceBefore/After rules
for Unary and Binary operators instead.
* Enable rule disallowYodaConditions.

Change-Id: I6f385e8860e91d9ef4d1f5abecf517d36af45565
---
M .jscsrc
M .jshintrc
M resources/src/jquery/jquery.highlightText.js
M resources/src/jquery/jquery.placeholder.js
M resources/src/jquery/jquery.qunit.completenessTest.js
M resources/src/jquery/jquery.suggestions.js
M resources/src/jquery/jquery.tablesorter.js
M resources/src/mediawiki.special/mediawiki.special.preferences.js
M resources/src/mediawiki/mediawiki.debug.profile.js
M resources/src/mediawiki/mediawiki.jqueryMsg.js
M resources/src/mediawiki/mediawiki.js
M resources/src/mediawiki/mediawiki.util.js
M skins/common/ajax.js
M tests/frontend/package.json
M tests/qunit/suites/resources/jquery/jquery.accessKeyLabel.test.js
M tests/qunit/suites/resources/jquery/jquery.textSelection.test.js
M tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
17 files changed, 185 insertions(+), 118 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/11/133711/1

diff --git a/.jscsrc b/.jscsrc
index b5481ea..0da9aa5 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -1,30 +1,94 @@
 {
-   requireCurlyBraces: [if, else, for, while, do],
-   requireSpaceAfterKeywords: [if, else, for, while, do, 
switch, return, function],
-   requireParenthesesAroundIIFE: true,
-   requireSpacesInFunctionExpression: {
-   beforeOpeningCurlyBrace: true
-   },
-   requireMultipleVarDecl: true,
-   disallowEmptyBlocks: true,
-   requireSpacesInsideObjectBrackets: all,
-   disallowSpaceAfterObjectKeys: true,
-   requireCommaBeforeLineBreak: true,
-   disallowLeftStickedOperators: [?, , =, , =],
-   disallowRightStickedOperators: [?, /, *, :, =, ==, ===, 
!=, !==, , =, , =],
-   requireRightStickedOperators: [!],
-   requireLeftStickedOperators: [,],
-   disallowSpaceAfterPrefixUnaryOperators: [++, --, +, -, ~],
-   disallowSpaceBeforePostfixUnaryOperators: [++, --],
-   requireSpaceBeforeBinaryOperators: [+, -, /, *, =, ==, 
===, !=, !==],
-   requireSpaceAfterBinaryOperators: [+, -, /, *, =, ==, 
===, !=, !==],
-   disallowKeywords: [ with ],
-   disallowMultipleLineBreaks: true,
-   validateLineBreaks: LF,
-   validateQuoteMarks: ',
-   disallowMixedSpacesAndTabs: smart,
-   disallowTrailingWhitespace: true,
-   requireLineFeedAtFileEnd: true,
-   requireCapitalizedConstructors: true,
-   requireDotNotation: true
+requireCurlyBraces: [
+if,
+else,
+for,
+while,
+do,
+try,
+catch
+],
+requireSpaceAfterKeywords: [
+if,
+else,
+for,
+while,
+do,
+switch,
+return,
+try,
+catch,
+function
+],
+requireSpaceBeforeBlockStatements: true,
+requireParenthesesAroundIIFE: true,
+requireSpacesInConditionalExpression: true,
+disallowSpacesInNamedFunctionExpression: {
+beforeOpeningRoundBrace: true
+},
+disallowSpacesInFunctionDeclaration: {
+beforeOpeningRoundBrace: true
+},
+requireMultipleVarDecl: onevar,
+requireBlocksOnNewline: 1,
+disallowEmptyBlocks: true,
+requireSpacesInsideObjectBrackets: all,
+disallowSpaceAfterObjectKeys: true,
+requireCommaBeforeLineBreak: true,
+disallowSpaceAfterPrefixUnaryOperators: [
+++,
+--,
++,
+-,
+~,
+!
+],
+disallowSpaceBeforePostfixUnaryOperators: [
+++,
+--
+],
+disallowSpaceBeforeBinaryOperators: [
+,
+],
+requireSpaceBeforeBinaryOperators: [
+=,
++,
+-,

[MediaWiki-commits] [Gerrit] Adding the predump script - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Adding the predump script
..

Adding the predump script

For some reason I missed this in ca9f1a6

Change-Id: If8dee9daf5f9103ad2e679838b686b62b1e55c97
---
M manifests/backups.pp
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/12/133712/1

diff --git a/manifests/backups.pp b/manifests/backups.pp
index 805ca49..f587cf9 100644
--- a/manifests/backups.pp
+++ b/manifests/backups.pp
@@ -79,6 +79,14 @@
 $basefileset = regsubst(regsubst($local_dump_dir,'/',''),'/','-','G')
 $fileset = mysql-${basefileset}
 
+file { '/etc/bacula/scripts/predump':
+ensure  = 'present',
+owner   = 'root',
+group   = 'root',
+mode= '0500',
+content = template('backups/mysql-predump.erb'),
+}
+
 } elsif $method == 'bpipe' {
 bacula::client::mysql-bpipe { 
mysql-bpipe-x${xtrabackup}-p${per_db}-i${innodb_only}:
 per_database  = $per_db,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8dee9daf5f9103ad2e679838b686b62b1e55c97
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Adding the predump script - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Adding the predump script
..


Adding the predump script

For some reason I missed this in ca9f1a6

Change-Id: If8dee9daf5f9103ad2e679838b686b62b1e55c97
---
M manifests/backups.pp
1 file changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/manifests/backups.pp b/manifests/backups.pp
index 805ca49..f587cf9 100644
--- a/manifests/backups.pp
+++ b/manifests/backups.pp
@@ -79,6 +79,14 @@
 $basefileset = regsubst(regsubst($local_dump_dir,'/',''),'/','-','G')
 $fileset = mysql-${basefileset}
 
+file { '/etc/bacula/scripts/predump':
+ensure  = 'present',
+owner   = 'root',
+group   = 'root',
+mode= '0500',
+content = template('backups/mysql-predump.erb'),
+}
+
 } elsif $method == 'bpipe' {
 bacula::client::mysql-bpipe { 
mysql-bpipe-x${xtrabackup}-p${per_db}-i${innodb_only}:
 per_database  = $per_db,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If8dee9daf5f9103ad2e679838b686b62b1e55c97
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Check uniqueness only for edited language - change (mediawiki...Wikibase)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Check uniqueness only for edited language
..


Check uniqueness only for edited language

This optimizes uniqueness checks to only apply to labels and
descriptions that were not already present before a given edit.

This reduces database load, but more importantly, this means that
if an item has a label conflict in english, the german language
label can still be edited.

Change-Id: I7d72077af67b6698aec8e28f56e22e6fb4e4bfd2
---
M repo/includes/LabelDescriptionDuplicateDetector.php
M repo/includes/Validators/LabelDescriptionUniquenessValidator.php
M repo/includes/Validators/LabelUniquenessValidator.php
M repo/tests/phpunit/includes/ChangeOp/ChangeOpTestMockProvider.php
M repo/tests/phpunit/includes/LabelDescriptionDuplicateDetectorTest.php
M 
repo/tests/phpunit/includes/Validators/LabelDescriptionUniquenessValidatorTest.php
M repo/tests/phpunit/includes/Validators/LabelUniquenessValidatorTest.php
7 files changed, 126 insertions(+), 175 deletions(-)

Approvals:
  WikidataJenkins: Verified
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/LabelDescriptionDuplicateDetector.php 
b/repo/includes/LabelDescriptionDuplicateDetector.php
index 26260ef..9643bca 100644
--- a/repo/includes/LabelDescriptionDuplicateDetector.php
+++ b/repo/includes/LabelDescriptionDuplicateDetector.php
@@ -9,6 +9,8 @@
 /**
  * Detector of label/description uniqueness constraint violations.
  *
+ * @todo: Fold this into TermCombinationMatchFinder resp. TermIndex
+ *
  * @since 0.5
  *
  * @licence GNU GPL v2+
@@ -26,41 +28,6 @@
 */
public function __construct( TermCombinationMatchFinder $termFinder ) {
$this-termFinder = $termFinder;
-   }
-
-   /**
-* Report errors about other entities of the same type using the same 
label
-* in the same language.
-*
-* @since 0.5
-*
-* @param Entity $entity
-*
-* @return Result. If there are conflicts, $result-isValid() will 
return false and
-* $result-getErrors() will return a non-empty list of Error 
objects.
-*/
-   public function detectLabelConflictsForEntity( Entity $entity ) {
-   $labels = $entity-getLabels();
-
-   return $this-detectTermConflicts( $labels, null, 
$entity-getId() );
-   }
-
-   /**
-* Report errors about other entities of the same type using the same 
combination
-* of label and description, in the same language.
-*
-* @since 0.5
-*
-* @param Entity $entity
-*
-* @return Result. If there are conflicts, $result-isValid() will 
return false and
-* $result-getErrors() will return a non-empty list of Error 
objects.
-*/
-   public function detectLabelDescriptionConflictsForEntity( Entity 
$entity ) {
-   $labels = $entity-getLabels();
-   $descriptions = $entity-getDescriptions();
-
-   return $this-detectTermConflicts( $labels, $descriptions, 
$entity-getId() );
}
 
/**
diff --git a/repo/includes/Validators/LabelDescriptionUniquenessValidator.php 
b/repo/includes/Validators/LabelDescriptionUniquenessValidator.php
index ec651e1..7291521 100644
--- a/repo/includes/Validators/LabelDescriptionUniquenessValidator.php
+++ b/repo/includes/Validators/LabelDescriptionUniquenessValidator.php
@@ -40,8 +40,10 @@
 * @return Result
 */
public function validateEntity( Entity $entity ) {
-   $result = 
$this-duplicateDetector-detectLabelDescriptionConflictsForEntity( $entity );
-   return $result;
+   $labels = $entity-getLabels();
+   $descriptions = $entity-getDescriptions();
+
+   return $this-duplicateDetector-detectTermConflicts( $labels, 
$descriptions, $entity-getId() );
}
 
/**
@@ -70,6 +72,17 @@
iterator_to_array( 
$fingerprint-getDescriptions()-getIterator() )
);
 
+   if ( $languageCodes !== null ) {
+   $languageKeys = array_flip( $languageCodes );
+   $labels = array_intersect_key( $labels, $languageKeys );
+   $descriptions = array_intersect_key( $descriptions, 
$languageKeys );
+   }
+
+   // nothing to do
+   if ( empty( $labels )  empty( $descriptions ) ) {
+   return Result::newSuccess();
+   }
+
return $this-duplicateDetector-detectTermConflicts( $labels, 
$descriptions, $entityId );
}
 
diff --git a/repo/includes/Validators/LabelUniquenessValidator.php 
b/repo/includes/Validators/LabelUniquenessValidator.php
index db6426a..652cbe3 100644
--- 

[MediaWiki-commits] [Gerrit] Fix a typo - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: Fix a typo
..

Fix a typo

The /8 should be done after the cast to Integer has occured

Change-Id: Ieefd59f5436134f436dc1a826098e1acaee386d4
---
M templates/backups/mysql-predump.erb
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/templates/backups/mysql-predump.erb 
b/templates/backups/mysql-predump.erb
index 371fa90..c783fe8 100644
--- a/templates/backups/mysql-predump.erb
+++ b/templates/backups/mysql-predump.erb
@@ -14,7 +14,7 @@
 DATE=$(date +%Y%m%d%H%M)
 
 # Let's be polite and not use all available processors
-PIGZ=/usr/bin/pigz -p %= Integer(@processorcount)/8  1 ? 
Integer(@processorcount/8) : 1 % 
+PIGZ=/usr/bin/pigz -p %= Integer(@processorcount)/8  1 ? 
Integer(@processorcount)/8 : 1 % 
 PIGZD=/usr/bin/pigz -d
 % if @pigz_level -%
 PIGZ=$PIGZ --%= @pigz_level -%
@@ -32,7 +32,7 @@
 find %= @local_dump_dir % -name *sql.gz -mtime +15 -exec rm {} \;
 for database in `$MYSQL -B -N -e select schema_name from 
information_schema.schemata where schema_name not like '%\_schema'`
 do
-   NP=$((%= @processorcount% * 3 / 4)) # This is guaranteed to return an 
integer
+   NP=$((%= @processorcount % * 3 / 4)) # This is guaranteed to return 
an integer
JOBS=$(jobs -p | wc -l)
if [ $JOBS -ge $NP ]; then
wait $(jobs -p | head -1)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieefd59f5436134f436dc1a826098e1acaee386d4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix a typo - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: Fix a typo
..


Fix a typo

The /8 should be done after the cast to Integer has occured

Change-Id: Ieefd59f5436134f436dc1a826098e1acaee386d4
---
M templates/backups/mysql-predump.erb
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/templates/backups/mysql-predump.erb 
b/templates/backups/mysql-predump.erb
index 371fa90..c783fe8 100644
--- a/templates/backups/mysql-predump.erb
+++ b/templates/backups/mysql-predump.erb
@@ -14,7 +14,7 @@
 DATE=$(date +%Y%m%d%H%M)
 
 # Let's be polite and not use all available processors
-PIGZ=/usr/bin/pigz -p %= Integer(@processorcount)/8  1 ? 
Integer(@processorcount/8) : 1 % 
+PIGZ=/usr/bin/pigz -p %= Integer(@processorcount)/8  1 ? 
Integer(@processorcount)/8 : 1 % 
 PIGZD=/usr/bin/pigz -d
 % if @pigz_level -%
 PIGZ=$PIGZ --%= @pigz_level -%
@@ -32,7 +32,7 @@
 find %= @local_dump_dir % -name *sql.gz -mtime +15 -exec rm {} \;
 for database in `$MYSQL -B -N -e select schema_name from 
information_schema.schemata where schema_name not like '%\_schema'`
 do
-   NP=$((%= @processorcount% * 3 / 4)) # This is guaranteed to return an 
integer
+   NP=$((%= @processorcount % * 3 / 4)) # This is guaranteed to return 
an integer
JOBS=$(jobs -p | wc -l)
if [ $JOBS -ge $NP ]; then
wait $(jobs -p | head -1)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieefd59f5436134f436dc1a826098e1acaee386d4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Converted $.each() to plain for() loop in GuidGenerator - change (mediawiki...Wikibase)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Converted $.each() to plain for() loop in GuidGenerator
..


Converted $.each() to plain for() loop in GuidGenerator

$.each() on strings fails in jQuery 1.9.

Change-Id: I71a7a0d6a861da3a262c8b0485ad7c2e6bf857b7
---
M lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Thiemo Mättig (WMDE): Looks good to me, approved
  jenkins-bot: Verified



diff --git 
a/lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js 
b/lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js
index fd1bdde..a4b5fec 100644
--- a/lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js
+++ b/lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js
@@ -50,10 +50,12 @@
template = 'xx-x-x-x-xxx',
guid = '';
 
-   $.each( template, function( i, character ) {
+   for( var i = 0; i  template.length; i++ ) {
+   var character = template.charAt( i );
+
if ( character === '-' ) {
guid += '-';
-   return true;
+   continue;
}
 
var hex;
@@ -70,8 +72,7 @@
}
 
guid += hex;
-
-   } );
+   }
 
return guid;
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I71a7a0d6a861da3a262c8b0485ad7c2e6bf857b7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater henning.sna...@wikimedia.de
Gerrit-Reviewer: Adrian Lang adrian.l...@wikimedia.de
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Hoo man h...@online.de
Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: WikidataJenkins wikidata-servi...@wikimedia.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Load shared MediaWiki styles when generating the style guide - change (mediawiki/core)

2014-05-16 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Load shared MediaWiki styles when generating the style guide
..

Load shared MediaWiki styles when generating the style guide

Among other things it defines styles for .errorbox and friends, which
are showcased in the guide.

Change-Id: I14279400b9aa362d19040e8083032e4e7c1c4ba6
---
M docs/kss/Makefile
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/16/133716/1

diff --git a/docs/kss/Makefile b/docs/kss/Makefile
index fee82cb..374bab2 100644
--- a/docs/kss/Makefile
+++ b/docs/kss/Makefile
@@ -6,7 +6,7 @@
 # Generates CSS of mediawiki.ui and mediawiki.ui.button using ResourceLoader, 
then applies it to the
 # KSS style guide
$(eval KSS_RL_TMP := $(shell mktemp /tmp/tmp.XX))
-   @curl -sG 
${MEDIAWIKI_LOAD_URL}?modules=mediawiki.ui|mediawiki.ui.buttononly=styles  
$(KSS_RL_TMP)
+   @curl -sG 
${MEDIAWIKI_LOAD_URL}?modules=mediawiki.legacy.shared|mediawiki.legacy.commonPrint|mediawiki.ui|mediawiki.ui.buttononly=styles
  $(KSS_RL_TMP)
@node_modules/.bin/kss-node ../../resources/src/mediawiki.ui static/ 
--css $(KSS_RL_TMP) -t styleguide-template
@rm $(KSS_RL_TMP)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14279400b9aa362d19040e8083032e4e7c1c4ba6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński matma@gmail.com

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


[MediaWiki-commits] [Gerrit] Load shared MediaWiki styles when generating the style guide - change (mediawiki/core)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Load shared MediaWiki styles when generating the style guide
..


Load shared MediaWiki styles when generating the style guide

Among other things it defines styles for .errorbox and friends, which
are showcased in the guide.

Change-Id: I14279400b9aa362d19040e8083032e4e7c1c4ba6
---
M docs/kss/Makefile
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/docs/kss/Makefile b/docs/kss/Makefile
index fee82cb..374bab2 100644
--- a/docs/kss/Makefile
+++ b/docs/kss/Makefile
@@ -6,7 +6,7 @@
 # Generates CSS of mediawiki.ui and mediawiki.ui.button using ResourceLoader, 
then applies it to the
 # KSS style guide
$(eval KSS_RL_TMP := $(shell mktemp /tmp/tmp.XX))
-   @curl -sG 
${MEDIAWIKI_LOAD_URL}?modules=mediawiki.ui|mediawiki.ui.buttononly=styles  
$(KSS_RL_TMP)
+   @curl -sG 
${MEDIAWIKI_LOAD_URL}?modules=mediawiki.legacy.shared|mediawiki.legacy.commonPrint|mediawiki.ui|mediawiki.ui.buttononly=styles
  $(KSS_RL_TMP)
@node_modules/.bin/kss-node ../../resources/src/mediawiki.ui static/ 
--css $(KSS_RL_TMP) -t styleguide-template
@rm $(KSS_RL_TMP)
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I14279400b9aa362d19040e8083032e4e7c1c4ba6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński matma@gmail.com
Gerrit-Reviewer: Jdlrobson jrob...@wikimedia.org
Gerrit-Reviewer: Waldir wal...@email.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] i18n overhaul: changed to JSON, qqq msgs added, fixed some h... - change (mediawiki...SiteSettings)

2014-05-16 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged.

Change subject: i18n overhaul: changed to JSON, qqq msgs added, fixed some 
hardcoded English
..


i18n overhaul: changed to JSON, qqq msgs added, fixed some hardcoded English

Change-Id: I42b27378c60d6686ca191a19b961a6101c81c0d3
---
M SiteSettings.i18n.php
M SiteSettings.php
M SpecialSiteSettings.php
A i18n/en.json
A i18n/qqq.json
5 files changed, 148 insertions(+), 64 deletions(-)

Approvals:
  Yaron Koren: Verified; Looks good to me, approved



diff --git a/SiteSettings.i18n.php b/SiteSettings.i18n.php
index dccc255..bab11f3 100644
--- a/SiteSettings.i18n.php
+++ b/SiteSettings.i18n.php
@@ -1,62 +1,20 @@
 ?php
-/**
- * @author Yaron Koren
- */
-
 $messages = array();
+$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = function ( $cache, $code, 
$cachedData ) {
+   $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
+   foreach ( $codeSequence as $csCode ) {
+   $fileName = __DIR__ . /i18n/$csCode.json;
+   if ( is_readable( $fileName ) ) {
+   $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
+   foreach ( array_keys( $data ) as $key ) {
+   if ( $key === '' || $key[0] === '@' ) {
+   unset( $data[$key] );
+   }
+   }
+   $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
+   }
 
-$messages['en'] = array(
-   'sitesettings-desc' = Allows for modifying settings through a wiki 
interface,
-   'sitesettings' = 'Site settings',
-   'sitesettings-sitename' = 'Site name:',
-   'sitesettings-sitenamespace' = 'Site-specific namespace name:',
-   'sitesettings-timezone' = 'Hours offset from GMT:',
-   'sitesettings-current-gmt' = '(current GMT time is $1 or $2)',
-   'sitesettings-americandates' = 'Use American-style dates',
-   'sitesettings-showpageviews' = 'Show count of page views at the bottom 
of each page',
-   'sitesettings-usesubpages' = 'Use a 
href=http://www.mediawiki.org/wiki/Help:Subpages;subpages/a',
-   'sitesettings-allowexternalimages' = 'Allow external images',
-   'sitesettings-allowlowercasepagenames' = 'Allow lowercase page names',
-   'sitesettings-copyrighturl' = 'Copyright URL:',
-   'sitesettings-copyrightdesc' = 'Copyright description:',
-   'sitesettings-viewingpolicy' = 'Viewing',
-   'sitesettings-public' = 'Public',
-   'sitesettings-publicdesc' = 'Everyone can read the site',
-   'sitesettings-private' = 'Private',
-   'sitesettings-privatedesc' = 'Only registered users can read the site',
-   'sitesettings-veryprivate' = 'Very private',
-   'sitesettings-veryprivatedesc' = 'Users can only view the main page 
and their own user page',
-   'sitesettings-registrationpolicy' = 'Registration',
-   'sitesettings-openreg' = 'Open',
-   'sitesettings-openregdesc' = 'Everyone can register',
-   'sitesettings-openidreg' = 'OpenID only',
-   'sitesettings-closedreg' = 'Closed',
-   'sitesettings-closedregdesc' = 'Users can only be added by an 
administrator',
-   'sitesettings-editingpolicy' = 'Editing',
-   'sitesettings-openediting' = 'Open',
-   'sitesettings-openeditingdesc' = 'Everyone can edit',
-   'sitesettings-closedediting' = 'Closed',
-   'sitesettings-closededitingdesc' = 'Only registered users can edit',
-   'sitesettings-veryclosedediting' = 'Very closed',
-   'sitesettings-veryclosededitingdesc' = 'Only administrators can edit',
-   'sitesettings-updated' = 'Site settings were updated.',
-   'sitesettings-appearanceupdated' = 'Site appearance settings were 
updated.',
-   'sitesettings-userskinsreset' = 'The skin for all existing users of 
this wiki has been changed to $1.',
-   'sitesettings-sitelogo' = 'Logo',
-   'sitesettings-nologo' = 'There is no current logo.',
-   'sitesettings-uploadlogo' = 'Upload logo:',
-   'sitesettings-currentlogo' = 'Current logo:',
-   'sitesettings-removelogo' = 'Remove logo',
-   'sitesettings-changelogo' = 'Change logo:',
-   'sitesettings-logouploaded' = 'Logo was uploaded.',
-   'sitesettings-logoremoved' = 'Logo was removed.',
-   'sitesettings-faviconheader' = 'Favicon file',
-   'sitesettings-sitefavicon' = 'Favicon',
-   'sitesettings-nofavicon' = 'There is no current favicon.',
-   'sitesettings-uploadfavicon' = 'Upload favicon (it should be called 
favicon.ico):',
-   'sitesettings-currentfavicon' = 'Current favicon:',
-   'sitesettings-removefavicon' = 'Remove favicon',
-   'sitesettings-changefavicon' = 'Change favicon:',
-   'sitesettings-faviconuploaded' = 'Favicon was uploaded.',
-   

[MediaWiki-commits] [Gerrit] bacula/backups: Use defaults-extra-file instead - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: bacula/backups: Use defaults-extra-file instead
..

bacula/backups: Use defaults-extra-file instead

Use --defaults-extra-file instead of --defaults-file. Also use
/usr/local/bin/mysqldump and /usr/local/bin/mysql for the mariadb
backups. Rely on the symlink being correct instead of relying in some
autodetection/hardcoding of the actual MariaDB installation and/or
system packages

Change-Id: I026b7e1dd2f1817710b3a481c8a1296ad7a65ab8
---
M manifests/role/mariadb.pp
M modules/bacula/templates/bpipe-mysql-db.erb
M templates/backups/mysql-predump.erb
3 files changed, 12 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/18/133718/1

diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp
index 1a1c62d..e7dcb44 100644
--- a/manifests/role/mariadb.pp
+++ b/manifests/role/mariadb.pp
@@ -172,11 +172,13 @@
 }
 
 backup::mysqlset {'dbstore':
-xtrabackup = false,
-per_db = true,
-innodb_only= true,
-local_dump_dir = $backups_folder,
-password_file  = '/etc/mysql/conf.d/dumps.cnf',
-method = 'predump',
+xtrabackup   = false,
+per_db   = true,
+innodb_only  = true,
+local_dump_dir   = $backups_folder,
+password_file= '/etc/mysql/conf.d/dumps.cnf',
+method   = 'predump',
+mysql_binary = '/usr/local/bin/mysql',
+mysqldump_binary = '/usr/local/bin/mysqldump',
 }
 }
diff --git a/modules/bacula/templates/bpipe-mysql-db.erb 
b/modules/bacula/templates/bpipe-mysql-db.erb
index 020f547..bbb70d5 100644
--- a/modules/bacula/templates/bpipe-mysql-db.erb
+++ b/modules/bacula/templates/bpipe-mysql-db.erb
@@ -23,8 +23,8 @@
 % end -%
 % if @password_file -%
 # This is just for a user with credentials to connect to the database
-MYSQL=$MYSQL --defaults-file=%= @password_file -% 
-MYSQLDUMP=$MYSQLDUMP --defaults-file=%= @password_file -% 
+MYSQL=$MYSQL --defaults-extra-file=%= @password_file -% 
+MYSQLDUMP=$MYSQLDUMP --defaults-extra-file=%= @password_file -% 
 % end -%
 % if @mysqldump_innodb_only -%
 # Provided we only have innodb tables --single-transcation works wonders
diff --git a/templates/backups/mysql-predump.erb 
b/templates/backups/mysql-predump.erb
index c783fe8..a52cf1e 100644
--- a/templates/backups/mysql-predump.erb
+++ b/templates/backups/mysql-predump.erb
@@ -21,8 +21,8 @@
 % end -%
 % if @password_file -%
 # This is just for a user with credentials to connect to the database
-MYSQL=$MYSQL --defaults-file=%= @password_file -% 
-MYSQLDUMP=$MYSQLDUMP --defaults-file=%= @password_file -% 
+MYSQL=$MYSQL --defaults-extra-file=%= @password_file -% 
+MYSQLDUMP=$MYSQLDUMP --defaults-extra-file=%= @password_file -% 
 % end -%
 % if @innodb_only -%
 # Provided we only have innodb tables --single-transcation works wonders

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I026b7e1dd2f1817710b3a481c8a1296ad7a65ab8
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] bacula/backups: Use defaults-extra-file instead - change (operations/puppet)

2014-05-16 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged.

Change subject: bacula/backups: Use defaults-extra-file instead
..


bacula/backups: Use defaults-extra-file instead

Use --defaults-extra-file instead of --defaults-file. Also use
/usr/local/bin/mysqldump and /usr/local/bin/mysql for the mariadb
backups. Rely on the symlink being correct instead of relying in some
autodetection/hardcoding of the actual MariaDB installation and/or
system packages

Change-Id: I026b7e1dd2f1817710b3a481c8a1296ad7a65ab8
---
M manifests/role/mariadb.pp
M modules/bacula/templates/bpipe-mysql-db.erb
M templates/backups/mysql-predump.erb
3 files changed, 12 insertions(+), 10 deletions(-)

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



diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp
index 1a1c62d..e7dcb44 100644
--- a/manifests/role/mariadb.pp
+++ b/manifests/role/mariadb.pp
@@ -172,11 +172,13 @@
 }
 
 backup::mysqlset {'dbstore':
-xtrabackup = false,
-per_db = true,
-innodb_only= true,
-local_dump_dir = $backups_folder,
-password_file  = '/etc/mysql/conf.d/dumps.cnf',
-method = 'predump',
+xtrabackup   = false,
+per_db   = true,
+innodb_only  = true,
+local_dump_dir   = $backups_folder,
+password_file= '/etc/mysql/conf.d/dumps.cnf',
+method   = 'predump',
+mysql_binary = '/usr/local/bin/mysql',
+mysqldump_binary = '/usr/local/bin/mysqldump',
 }
 }
diff --git a/modules/bacula/templates/bpipe-mysql-db.erb 
b/modules/bacula/templates/bpipe-mysql-db.erb
index 020f547..bbb70d5 100644
--- a/modules/bacula/templates/bpipe-mysql-db.erb
+++ b/modules/bacula/templates/bpipe-mysql-db.erb
@@ -23,8 +23,8 @@
 % end -%
 % if @password_file -%
 # This is just for a user with credentials to connect to the database
-MYSQL=$MYSQL --defaults-file=%= @password_file -% 
-MYSQLDUMP=$MYSQLDUMP --defaults-file=%= @password_file -% 
+MYSQL=$MYSQL --defaults-extra-file=%= @password_file -% 
+MYSQLDUMP=$MYSQLDUMP --defaults-extra-file=%= @password_file -% 
 % end -%
 % if @mysqldump_innodb_only -%
 # Provided we only have innodb tables --single-transcation works wonders
diff --git a/templates/backups/mysql-predump.erb 
b/templates/backups/mysql-predump.erb
index c783fe8..a52cf1e 100644
--- a/templates/backups/mysql-predump.erb
+++ b/templates/backups/mysql-predump.erb
@@ -21,8 +21,8 @@
 % end -%
 % if @password_file -%
 # This is just for a user with credentials to connect to the database
-MYSQL=$MYSQL --defaults-file=%= @password_file -% 
-MYSQLDUMP=$MYSQLDUMP --defaults-file=%= @password_file -% 
+MYSQL=$MYSQL --defaults-extra-file=%= @password_file -% 
+MYSQLDUMP=$MYSQLDUMP --defaults-extra-file=%= @password_file -% 
 % end -%
 % if @innodb_only -%
 # Provided we only have innodb tables --single-transcation works wonders

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I026b7e1dd2f1817710b3a481c8a1296ad7a65ab8
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris akosia...@wikimedia.org
Gerrit-Reviewer: Alexandros Kosiaris akosia...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] i18n overhaul: changed to JSON, qqq msgs added, fixed some h... - change (mediawiki...SiteSettings)

2014-05-16 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review.

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

Change subject: i18n overhaul: changed to JSON, qqq msgs added, fixed some 
hardcoded English
..

i18n overhaul: changed to JSON, qqq msgs added, fixed some hardcoded English

Change-Id: I42b27378c60d6686ca191a19b961a6101c81c0d3
---
M SiteSettings.i18n.php
M SiteSettings.php
M SpecialSiteSettings.php
A i18n/en.json
A i18n/qqq.json
5 files changed, 148 insertions(+), 64 deletions(-)


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

diff --git a/SiteSettings.i18n.php b/SiteSettings.i18n.php
index dccc255..bab11f3 100644
--- a/SiteSettings.i18n.php
+++ b/SiteSettings.i18n.php
@@ -1,62 +1,20 @@
 ?php
-/**
- * @author Yaron Koren
- */
-
 $messages = array();
+$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = function ( $cache, $code, 
$cachedData ) {
+   $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
+   foreach ( $codeSequence as $csCode ) {
+   $fileName = __DIR__ . /i18n/$csCode.json;
+   if ( is_readable( $fileName ) ) {
+   $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
+   foreach ( array_keys( $data ) as $key ) {
+   if ( $key === '' || $key[0] === '@' ) {
+   unset( $data[$key] );
+   }
+   }
+   $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
+   }
 
-$messages['en'] = array(
-   'sitesettings-desc' = Allows for modifying settings through a wiki 
interface,
-   'sitesettings' = 'Site settings',
-   'sitesettings-sitename' = 'Site name:',
-   'sitesettings-sitenamespace' = 'Site-specific namespace name:',
-   'sitesettings-timezone' = 'Hours offset from GMT:',
-   'sitesettings-current-gmt' = '(current GMT time is $1 or $2)',
-   'sitesettings-americandates' = 'Use American-style dates',
-   'sitesettings-showpageviews' = 'Show count of page views at the bottom 
of each page',
-   'sitesettings-usesubpages' = 'Use a 
href=http://www.mediawiki.org/wiki/Help:Subpages;subpages/a',
-   'sitesettings-allowexternalimages' = 'Allow external images',
-   'sitesettings-allowlowercasepagenames' = 'Allow lowercase page names',
-   'sitesettings-copyrighturl' = 'Copyright URL:',
-   'sitesettings-copyrightdesc' = 'Copyright description:',
-   'sitesettings-viewingpolicy' = 'Viewing',
-   'sitesettings-public' = 'Public',
-   'sitesettings-publicdesc' = 'Everyone can read the site',
-   'sitesettings-private' = 'Private',
-   'sitesettings-privatedesc' = 'Only registered users can read the site',
-   'sitesettings-veryprivate' = 'Very private',
-   'sitesettings-veryprivatedesc' = 'Users can only view the main page 
and their own user page',
-   'sitesettings-registrationpolicy' = 'Registration',
-   'sitesettings-openreg' = 'Open',
-   'sitesettings-openregdesc' = 'Everyone can register',
-   'sitesettings-openidreg' = 'OpenID only',
-   'sitesettings-closedreg' = 'Closed',
-   'sitesettings-closedregdesc' = 'Users can only be added by an 
administrator',
-   'sitesettings-editingpolicy' = 'Editing',
-   'sitesettings-openediting' = 'Open',
-   'sitesettings-openeditingdesc' = 'Everyone can edit',
-   'sitesettings-closedediting' = 'Closed',
-   'sitesettings-closededitingdesc' = 'Only registered users can edit',
-   'sitesettings-veryclosedediting' = 'Very closed',
-   'sitesettings-veryclosededitingdesc' = 'Only administrators can edit',
-   'sitesettings-updated' = 'Site settings were updated.',
-   'sitesettings-appearanceupdated' = 'Site appearance settings were 
updated.',
-   'sitesettings-userskinsreset' = 'The skin for all existing users of 
this wiki has been changed to $1.',
-   'sitesettings-sitelogo' = 'Logo',
-   'sitesettings-nologo' = 'There is no current logo.',
-   'sitesettings-uploadlogo' = 'Upload logo:',
-   'sitesettings-currentlogo' = 'Current logo:',
-   'sitesettings-removelogo' = 'Remove logo',
-   'sitesettings-changelogo' = 'Change logo:',
-   'sitesettings-logouploaded' = 'Logo was uploaded.',
-   'sitesettings-logoremoved' = 'Logo was removed.',
-   'sitesettings-faviconheader' = 'Favicon file',
-   'sitesettings-sitefavicon' = 'Favicon',
-   'sitesettings-nofavicon' = 'There is no current favicon.',
-   'sitesettings-uploadfavicon' = 'Upload favicon (it should be called 
favicon.ico):',
-   'sitesettings-currentfavicon' = 'Current favicon:',
-   'sitesettings-removefavicon' = 'Remove favicon',
-   'sitesettings-changefavicon' = 'Change favicon:',
-   

[MediaWiki-commits] [Gerrit] icinga: Fix anomaly detection checks - change (operations/puppet)

2014-05-16 Thread Giuseppe Lavagetto (Code Review)
Giuseppe Lavagetto has submitted this change and it was merged.

Change subject: icinga: Fix anomaly detection checks
..


icinga: Fix anomaly detection checks

Changed the check for reqstats.5xx to use the data and not the ratio to
requests as although formally more correct it's much more unstable than
the base check. Also, check_graphite now requests the holt-winters
anomaly bands with 5 delta confidence, which has proven to be much
nearer to detect a real anomaly with less false positives.

Change-Id: I8b06b0b139b292e57b97417c0f880ec660fbbf2d
Signed-off-by: Giuseppe Lavagetto glavage...@wikimedia.org
---
M files/icinga/check_graphite
M manifests/role/graphite.pp
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Filippo Giunchedi: Looks good to me, but someone else must approve
  Giuseppe Lavagetto: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/files/icinga/check_graphite b/files/icinga/check_graphite
index f3ac06d..cb5cfe2 100755
--- a/files/icinga/check_graphite
+++ b/files/icinga/check_graphite
@@ -316,7 +316,7 @@
 for target in self.targets:
 self.params.append(('target', target))
 self.params.append(
-('target', 'holtWintersConfidenceBands(%s)' % target))
+('target', 'holtWintersConfidenceBands(%s, 5)' % target))
 self.check_window = args.check_window
 self.warn = args.warn
 self.crit = args.crit
@@ -423,7 +423,7 @@
check_threshold my.beloved.metric  --from -20m \
--threshold 100 --over -C 10 -W 5
 
-Check if a metric has exceeded its holter-winters confidence bands 5% of 
the
+Check if a metric has exceeded its holt-winters confidence bands 5% of the
 times over the last 500 checks
 
 ./check_graphyte.py --url http://some-graphite-host  \
diff --git a/manifests/role/graphite.pp b/manifests/role/graphite.pp
index 2246027..59a057d 100644
--- a/manifests/role/graphite.pp
+++ b/manifests/role/graphite.pp
@@ -200,7 +200,7 @@
 # if 10% of the last 100 checks is out of forecasted bounds
 monitor_graphite_anomaly {'requests_error_ratio':
 description  = 'HTTP error ratio anomaly detection',
-metric   = 'divideSeries(reqstats.5xx,reqstats.requests)',
+metric   = 'reqstats.5xx',
 warning  = 5,
 critical = 10,
 check_window = 100,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8b06b0b139b292e57b97417c0f880ec660fbbf2d
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Giuseppe Lavagetto glavage...@wikimedia.org
Gerrit-Reviewer: Faidon Liambotis fai...@wikimedia.org
Gerrit-Reviewer: Filippo Giunchedi fgiunch...@wikimedia.org
Gerrit-Reviewer: Giuseppe Lavagetto glavage...@wikimedia.org
Gerrit-Reviewer: Rush r...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Remove jQuery.Migrate from default, moving to an optional mo... - change (mediawiki/core)

2014-05-16 Thread Jforrester (Code Review)
Jforrester has uploaded a new change for review.

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

Change subject: Remove jQuery.Migrate from default, moving to an optional module
..

Remove jQuery.Migrate from default, moving to an optional module

[DO NOT MERGE BEFORE MW 1.24wmf7 AT THE EARLIEST.]

Follows-up I468d6b45eae83 and I097c9639e3.

Per the plan[0], removing the jQuery.Migrate temporary plugin from
the default module for jQuery now that people have had time to fix
deprecated code.

[0]
 http://www.mail-archive.com/wikitech-l@lists.wikimedia.org/msg75735.html
 http://lists.wikimedia.org/pipermail/wikitech-l/2014-May/076340.html

Bug: 44740
Change-Id: If1c9ab722c7ce025b550b457506dcdf90d3326c3
---
M resources/Resources.php
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/19/133719/1

diff --git a/resources/Resources.php b/resources/Resources.php
index c2112ae..8344f66 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -192,8 +192,18 @@
'jquery' = array(
'scripts' = array(
'resources/lib/jquery/jquery.js',
+   ),
+   'debugRaw' = false,
+   'targets' = array( 'desktop', 'mobile' ),
+   ),
+
+   'jquery.migrate' = array(
+   'scripts' = array(
'resources/lib/jquery/jquery.migrate.js',
),
+   'dependencies' = array(
+   'jquery',
+   ),
'debugRaw' = false,
'targets' = array( 'desktop', 'mobile' ),
),

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1c9ab722c7ce025b550b457506dcdf90d3326c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jforrester jforres...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] [WIP] First version of Special:PageMigration - change (mediawiki...Translate)

2014-05-16 Thread BPositive (Code Review)
BPositive has uploaded a new change for review.

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

Change subject: [WIP] First version of Special:PageMigration
..

[WIP] First version of Special:PageMigration

Change-Id: Ic62ff3fcf52c1862b5d9f8ec14c60e1a00a340bb
---
A Autoload.php
M Resources.php
M Translate.alias.php
M Translate.php
A resources/css/ext.translate.special.pagemigration.css
A resources/js/ext.translate.special.pagemigration.js
A specials/SpecialPageMigration.php
M tests/phpunit/SpecialPagesTest.php
8 files changed, 501 insertions(+), 3 deletions(-)


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

diff --git a/Autoload.php b/Autoload.php
new file mode 100644
index 000..398bf68
--- /dev/null
+++ b/Autoload.php
@@ -0,0 +1,318 @@
+?php
+/**
+ * Autoload definitions.
+ *
+ * @file
+ * @author Niklas Laxström
+ * @copyright Copyright © 2008-2013, Niklas Laxström
+ * @license GPL-2.0+
+ */
+
+/** @cond file_level_code */
+global $wgAutoloadClasses;
+$dir = dirname( __FILE__ );
+/** @endcond */
+
+/**
+ * @name   Core Translate classes
+ * @{
+ */
+$wgAutoloadClasses['FatMessage'] = $dir/Message.php;
+$wgAutoloadClasses['MediaWikiMessageChecker'] = 
$dir/MediaWikiMessageChecker.php;
+$wgAutoloadClasses['MessageChecker'] = $dir/MessageChecks.php;
+$wgAutoloadClasses['MessageCollection'] = $dir/MessageCollection.php;
+$wgAutoloadClasses['MessageDefinitions'] = $dir/MessageCollection.php;
+$wgAutoloadClasses['MessageGroups'] = $dir/MessageGroups.php;
+$wgAutoloadClasses['TMessage'] = $dir/Message.php;
+$wgAutoloadClasses['ThinMessage'] = $dir/Message.php;
+$wgAutoloadClasses['TranslateEditAddons'] = $dir/TranslateEditAddons.php;
+$wgAutoloadClasses['TranslateHooks'] = $dir/TranslateHooks.php;
+$wgAutoloadClasses['TranslateTasks'] = $dir/TranslateTasks.php;
+$wgAutoloadClasses['TranslateUtils'] = $dir/TranslateUtils.php;
+/**@}*/
+
+/**
+ * @name   Special pages
+ * There are few more special pages in page translation section.
+ * @{
+ */
+$wgAutoloadClasses['TranslateSpecialPage'] = 
$dir/specials/TranslateSpecialPage.php;
+$wgAutoloadClasses['SpecialAggregateGroups'] = 
$dir/specials/SpecialAggregateGroups.php;
+$wgAutoloadClasses['SpecialImportTranslations'] = 
$dir/specials/SpecialImportTranslations.php;
+$wgAutoloadClasses['SpecialLanguageStats'] = 
$dir/specials/SpecialLanguageStats.php;
+$wgAutoloadClasses['SpecialMagic'] = $dir/specials/SpecialMagic.php;
+$wgAutoloadClasses['SpecialManageGroups'] = 
$dir/specials/SpecialManageGroups.php;
+$wgAutoloadClasses['SpecialMessageGroupStats'] = 
$dir/specials/SpecialMessageGroupStats.php;
+$wgAutoloadClasses['SpecialMyLanguage'] = 
$dir/specials/SpecialMyLanguage.php;
+$wgAutoloadClasses['SpecialSearchTranslations'] = 
$dir/specials/SpecialSearchTranslations.php;
+$wgAutoloadClasses['SpecialSupportedLanguages'] = 
$dir/specials/SpecialSupportedLanguages.php;
+$wgAutoloadClasses['SpecialTranslate'] = $dir/specials/SpecialTranslate.php;
+$wgAutoloadClasses['SpecialManageTranslatorSandbox'] =
+   $dir/specials/SpecialManageTranslatorSandbox.php;
+$wgAutoloadClasses['SpecialTranslationStats'] = 
$dir/specials/SpecialTranslationStats.php;
+$wgAutoloadClasses['SpecialTranslations'] = 
$dir/specials/SpecialTranslations.php;
+$wgAutoloadClasses['SpecialTranslationStash'] = 
$dir/specials/SpecialTranslationStash.php;
+$wgAutoloadClasses['SpecialPageMigration'] = 
$dir/specials/SpecialPageMigration.php;
+/**@}*/
+
+/**
+ * @name   Various utilities
+ * @{
+ */
+$wgAutoloadClasses['CDBMessageIndex'] = $dir/utils/MessageIndex.php;
+$wgAutoloadClasses['CachedMessageIndex'] = $dir/utils/MessageIndex.php;
+$wgAutoloadClasses['DatabaseMessageIndex'] = $dir/utils/MessageIndex.php;
+$wgAutoloadClasses['ExternalMessageSourceStateComparator'] =
+   $dir/utils/ExternalMessageSourceStateComparator.php;
+$wgAutoloadClasses['FCFontFinder'] = $dir/utils/Font.php;
+$wgAutoloadClasses['FileCachedMessageIndex'] = $dir/utils/MessageIndex.php;
+$wgAutoloadClasses['FuzzyBot'] = $dir/utils/FuzzyBot.php;
+$wgAutoloadClasses['HTMLJsSelectToInputField'] = 
$dir/utils/HTMLJsSelectToInputField.php;
+$wgAutoloadClasses['JsSelectToInput'] = $dir/utils/JsSelectToInput.php;
+$wgAutoloadClasses['MessageGroupCache'] = $dir/utils/MessageGroupCache.php;
+$wgAutoloadClasses['MessageGroupStates'] = $dir/utils/MessageGroupStates.php;
+$wgAutoloadClasses['MessageGroupStatesUpdaterJob'] = 
$dir/utils/MessageGroupStatesUpdaterJob.php;
+$wgAutoloadClasses['MessageGroupStats'] = $dir/utils/MessageGroupStats.php;
+$wgAutoloadClasses['MessageHandle'] = $dir/utils/MessageHandle.php;
+$wgAutoloadClasses['MessageIndex'] = $dir/utils/MessageIndex.php;
+$wgAutoloadClasses['MessageIndexRebuildJob'] = 
$dir/utils/MessageIndexRebuildJob.php;
+$wgAutoloadClasses['MessageTable'] = $dir/utils/MessageTable.php;
+$wgAutoloadClasses['MessageUpdateJob'] = $dir/utils/MessageUpdateJob.php;

[MediaWiki-commits] [Gerrit] Style search button as icon for non-JS users - change (mediawiki...MobileFrontend)

2014-05-16 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

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

Change subject: Style search button as icon for non-JS users
..

Style search button as icon for non-JS users

Bug: 63701
Change-Id: I0f951bf86c56ec2ef49652f36d0e1b7943a11c04
---
M includes/skins/MinervaTemplate.php
M less/app/common.less
M less/common/common.less
M less/common/icons.less
A less/common/images/magnifying-glass.png
A less/common/images/magnifying-glass.svg
A less/common/images/path3100.png
M less/common/reset.less
M less/common/ui.less
9 files changed, 31 insertions(+), 16 deletions(-)


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

diff --git a/includes/skins/MinervaTemplate.php 
b/includes/skins/MinervaTemplate.php
index 318c88e..d5cf0a1 100644
--- a/includes/skins/MinervaTemplate.php
+++ b/includes/skins/MinervaTemplate.php
@@ -247,7 +247,7 @@
// FIXME: change this 
into a search icon instead of a text button
echo 
$this-makeSearchButton(
'fulltext',
-   array( 'class' 
= 'searchSubmit mw-ui-button mw-ui-progressive' )
+   array( 'class' 
= 'no-js-only icon icon-search' )
);
?
/form
diff --git a/less/app/common.less b/less/app/common.less
index 4c5a7be..5e47ff6 100644
--- a/less/app/common.less
+++ b/less/app/common.less
@@ -1,7 +1,7 @@
 // FIXME: In future we want to support all of these!
 
 // Hide full text search button
-.searchSubmit,
+.icon-search,
 // Not possible to login with JavaScript and thus edit sections currently
 .edit-page,
 // Main menu links do not currently work
diff --git a/less/common/common.less b/less/common/common.less
index c0cbcfe..fc7c326 100644
--- a/less/common/common.less
+++ b/less/common/common.less
@@ -370,14 +370,21 @@
font-size: .9em;
 }
 
+// FIXME: Remove this rule when cache is clear
+.client-js .searchSubmit,
+.client-js .no-js-only,
 // FIXME: Use generic rule for print stylesheets
 .printfooter,
 .jsonly {
display: none;
 }
 
+
+// FIXME: Remove this rule when cache is clear
+.searchSubmit,
+.no-js-only,
 .client-js .jsonly {
-   display: block;
+   display: inherit;
 }
 
 .position-fixed {
diff --git a/less/common/icons.less b/less/common/icons.less
index 3a1a672..558ba15 100644
--- a/less/common/icons.less
+++ b/less/common/icons.less
@@ -204,3 +204,19 @@
.background-image('images/watched.png');
}
 }
+
+// Icon (search)
+//
+// Renders a search icon.
+//
+// Markup:
+// div class=icon icon-searchsearch/div
+//
+// Styleguide 8.3.5.
+.icon-search {
+   // FIXME: This 2 rules should probably be part of .icon
+   width: 24px;
+   height: 24px;
+   background-color: #FFF;
+   .background-image-svg-quick('images/magnifying-glass');
+}
diff --git a/less/common/images/magnifying-glass.png 
b/less/common/images/magnifying-glass.png
new file mode 100644
index 000..2f19a72
--- /dev/null
+++ b/less/common/images/magnifying-glass.png
Binary files differ
diff --git a/less/common/images/magnifying-glass.svg 
b/less/common/images/magnifying-glass.svg
new file mode 100644
index 000..e978d34
--- /dev/null
+++ b/less/common/images/magnifying-glass.svg
@@ -0,0 +1 @@
+?xml version=1.0 encoding=UTF-8 standalone=no?svg 
xmlns=http://www.w3.org/2000/svg; viewBox=0 0 611.975 580 
enable-background=new 0 0 612 792path d=M69.475 407.3c45.3 45.3 104.5 70.1 
168.9 70.1 56.1 0 109-19.1 151.7-54.2l173.4 156.8s38.9-10.2 
48.5-53.5l-174-157.4c61.2-93.1 
50.4-218-30.6-299-45.3-45.3-104.5-70.1-168.3-70.1-63.8 0-123.7 24.9-168.9 
69.5-93.8 93.6-93.1 244.7-.7 337.8zm39.5-285c1.9-2.6 4.5-5.1 7-7 33.2-32.5 
76.5-51 123-51s89.9 18.5 123 51c67.6 67.6 68.2 177.9-.6 246.1-33.1 33.1-76.5 
51-123 51s-89.9-18.5-123-51c-65-65-68.2-170.2-6.4-239.1z fill=#555//svg
\ No newline at end of file
diff --git a/less/common/images/path3100.png b/less/common/images/path3100.png
new file mode 100644
index 000..5bfadab
--- /dev/null
+++ b/less/common/images/path3100.png
Binary files differ
diff --git a/less/common/reset.less b/less/common/reset.less
index 7a1cb2b..675439e 100644
--- a/less/common/reset.less
+++ b/less/common/reset.less
@@ -20,6 +20,7 @@
font-size: 100%;
font: inherit;
vertical-align: baseline;
+   background: none;
 }
 button {
border: none;
diff --git a/less/common/ui.less b/less/common/ui.less
index 3cf268e..20870fa 100644
--- a/less/common/ui.less
+++ b/less/common/ui.less
@@ -101,25 +101,15 @@
 

[MediaWiki-commits] [Gerrit] Removed AutocompleteInterface - change (mediawiki...Wikibase)

2014-05-16 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has submitted this change and it was merged.

Change subject: Removed AutocompleteInterface
..


Removed AutocompleteInterface

The change set is meant to be part of an iterative refactoring.
AutocompleteInterface was exclusively used by SiteIdInterface and 
SitePageInterface. However,
most of its functions were overwritten in SiteIdInterface / special to the 
derived interfaces.
Ultimately, there is no reason to keep AutocompleteInterface since the old UI 
components
are to be removed anyway. By improving the separation of SitePageInterface and 
SiteIdInterface,
a new version of the suggester / siteselector widget can be applied more easily.
The change should have no impact on the actual UI behaviour.

Change-Id: Iab9d6b7d6110825a034b45a4b96d89f4686eacb5
---
M .jshintignore
M lib/WikibaseLib.hooks.php
M lib/resources/Resources.php
D 
lib/resources/wikibase.ui.PropertyEditTool.EditableValue.AutocompleteInterface.js
M lib/resources/wikibase.ui.PropertyEditTool.EditableValue.SiteIdInterface.js
M lib/resources/wikibase.ui.PropertyEditTool.EditableValue.SitePageInterface.js
D 
lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.AutocompleteInterface.tests.js
M 
lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.SiteIdInterface.tests.js
M lib/tests/qunit/wikibase.ui.SiteLinksEditTool.tests.js
9 files changed, 215 insertions(+), 375 deletions(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  WikidataJenkins: Verified
  jenkins-bot: Verified



diff --git a/.jshintignore b/.jshintignore
index 509464d..67488d7 100644
--- a/.jshintignore
+++ b/.jshintignore
@@ -8,7 +8,6 @@
 ./lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableDescription.tests.js
 ./lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableLabel.tests.js
 ./lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableSiteLink.tests.js
-./lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.AutocompleteInterface.tests.js
 ./lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.Interface.tests.js
 
./lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.ListInterface.tests.js
 
./lib/tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.SiteIdInterface.tests.js
diff --git a/lib/WikibaseLib.hooks.php b/lib/WikibaseLib.hooks.php
index 6457118..d70e558 100644
--- a/lib/WikibaseLib.hooks.php
+++ b/lib/WikibaseLib.hooks.php
@@ -104,7 +104,6 @@

'tests/qunit/wikibase.ui.PropertyEditTool.EditableLabel.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.EditableSiteLink.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.tests.js',
-   
'tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.AutocompleteInterface.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.Interface.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.SiteIdInterface.tests.js',

'tests/qunit/wikibase.ui.PropertyEditTool.EditableValue.SitePageInterface.tests.js',
diff --git a/lib/resources/Resources.php b/lib/resources/Resources.php
index 5bcfc9b..5328a0f 100644
--- a/lib/resources/Resources.php
+++ b/lib/resources/Resources.php
@@ -348,7 +348,6 @@
'wikibase.ui.PropertyEditTool.js',
'wikibase.ui.PropertyEditTool.EditableValue.js',

'wikibase.ui.PropertyEditTool.EditableValue.Interface.js',
-   
'wikibase.ui.PropertyEditTool.EditableValue.AutocompleteInterface.js',

'wikibase.ui.PropertyEditTool.EditableValue.SitePageInterface.js',

'wikibase.ui.PropertyEditTool.EditableValue.SiteIdInterface.js',

'wikibase.ui.PropertyEditTool.EditableValue.ListInterface.js',
diff --git 
a/lib/resources/wikibase.ui.PropertyEditTool.EditableValue.AutocompleteInterface.js
 
b/lib/resources/wikibase.ui.PropertyEditTool.EditableValue.AutocompleteInterface.js
deleted file mode 100644
index 741eca5..000
--- 
a/lib/resources/wikibase.ui.PropertyEditTool.EditableValue.AutocompleteInterface.js
+++ /dev/null
@@ -1,194 +0,0 @@
-/**
- * @licence GNU GPL v2+
- * @author H. Snater mediaw...@snater.com
- */
-( function( mw, wb, util, $ ) {
-'use strict';
-/* jshint camelcase: false */
-
-var PARENT = wb.ui.PropertyEditTool.EditableValue.Interface;
-
-/**
- * Serves an autocomplete supported input interface as part of an EditableValue
- * @constructor
- * @see wikibase.ui.PropertyEditTool.EditableValue.Interface
- * @since 0.1
- */
-wb.ui.PropertyEditTool.EditableValue.AutocompleteInterface = util.inherit( 
PARENT, {
-   /**
-* current result set of strings used for validation
-* @var Array

[MediaWiki-commits] [Gerrit] Use type hinting in ApiBase - change (mediawiki/core)

2014-05-16 Thread Anomie (Code Review)
Anomie has uploaded a new change for review.

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

Change subject: Use type hinting in ApiBase
..

Use type hinting in ApiBase

For ideological reasons this was not included in Ie6bf1915.

Change-Id: I5f7119665746eb6fcf86c3a403caa2dcb67904eb
---
M includes/api/ApiBase.php
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/22/133722/1

diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php
index a1e02ef..8a9f19c 100644
--- a/includes/api/ApiBase.php
+++ b/includes/api/ApiBase.php
@@ -87,17 +87,19 @@
 */
const GET_VALUES_FOR_HELP = 1;
 
-   private $mMainModule, $mModuleName, $mModulePrefix;
+   /** @var ApiMain */
+   private $mMainModule;
+   /** @var string */
+   private $mModuleName, $mModulePrefix;
private $mSlaveDB = null;
private $mParamCache = array();
 
/**
-* Constructor
 * @param ApiMain $mainModule
 * @param string $moduleName Name of this module
 * @param string $modulePrefix Prefix to use for parameter names
 */
-   public function __construct( $mainModule, $moduleName, $modulePrefix = 
'' ) {
+   public function __construct( ApiMain $mainModule, $moduleName, 
$modulePrefix = '' ) {
$this-mMainModule = $mainModule;
$this-mModuleName = $moduleName;
$this-mModulePrefix = $modulePrefix;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f7119665746eb6fcf86c3a403caa2dcb67904eb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie bjor...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] HTMLForm vform styling - change (mediawiki/core)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: HTMLForm vform styling
..


HTMLForm vform styling

Style select like other input fields (full width), and fix the issue
where validation errors partially obfuscate the fields by setting display:
block. Refactor code for styling error boxes and improve documentation.

Bug: 63644
Change-Id: I00a35c932a7e0b91b7b01fc327c0c1b9bae66c78
---
M resources/src/mediawiki.ui/components/default/forms.less
1 file changed, 41 insertions(+), 18 deletions(-)

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



diff --git a/resources/src/mediawiki.ui/components/default/forms.less 
b/resources/src/mediawiki.ui/components/default/forms.less
index 2b9b3cb..ee21932 100644
--- a/resources/src/mediawiki.ui/components/default/forms.less
+++ b/resources/src/mediawiki.ui/components/default/forms.less
@@ -25,7 +25,7 @@
 // Markup:
 // form class=mw-ui-vform
 //   div class=mw-ui-vform-divThis is a form example./div
-//   div
+//   div class=mw-ui-vform-div
 // labelUsername /label
 // input value=input
 //   /div
@@ -51,6 +51,7 @@
 
// MW currently doesn't use the type attribute everywhere on inputs.
input,
+   select,
.mw-ui-button {
display: block;
.box-sizing(border-box);
@@ -58,10 +59,17 @@
width: 100%;
}
 
-   // We exclude these because they'll generally use mw-ui-button.
+   // We exclude buttons because they'll generally use mw-ui-button.
// Otherwise, we'll unintentionally override that.
-   input:not([type=button]):not([type=submit]):not([type=file]), {
+   input:not([type=button]):not([type=submit]):not([type=file]) {
.agora-field-styling(); // mixins/forms.less
+   }
+
+   // Give dropdown lists the same spacing as input fields for consistency.
+   // Values taken from .agora-field-styling() in mixins/form.less
+   select {
+   padding: 0.35em 0.5em 0.35em 0.5em;
+   vertical-align: middle;
}
 
label {
@@ -93,27 +101,26 @@
//   div class=warningboxA warning to be noted/div
//   div class=successboxAction successful!/div
//   div class=errorA different kind of error/div
-   //   div
-   // input type=text value=input class=mw-ui-input
-   //   div
+   //   div class=error
+   // ulliThere are problems with some of your input./li/ul
//   /div
+   //   div class=mw-ui-vform-div
+   // input type=text value=input class=mw-ui-input
+   //   /div
+   //   div class=mw-ui-vform-div
+   // select
+   //   option value=1Option 1/option
+   //   option value=2Option 2/option
+   // /select
+   // span class=errorThe value you specified is not a valid 
option./span
+   //   /div
+   //   div
// button class=mw-ui-buttonButton in vform/button
//   /div
// /form
//
// Styleguide 3.1.
-   .error {
-   .box-sizing(border-box);
-   font-size: 0.9em;
-   margin: 0 0 1em;
-   padding: 0.5em;
-   color: #cc;
-   border: 1px solid #fac5c5;
-   background-color: #fae3e3;
-   text-shadow: 0 1px #fae3e3;
-   word-wrap: break-word;
-   }
-
+   .error,
.errorbox,
.warningbox,
.successbox {
@@ -124,6 +131,22 @@
word-wrap: break-word;
}
 
+   // Colours taken from those for .errorbox in skins/common/shared.css
+   .error {
+   color: #cc;
+   border: 1px solid #fac5c5;
+   background-color: #fae3e3;
+   text-shadow: 0 1px #fae3e3;
+   }
+
+   // This specifies styling for individual field validation error 
messages.
+   // Show them below the fields to prevent line break glitches, and leave
+   // some space between the field and the error message box.
+   .mw-ui-vform-div .error {
+   display: block;
+   margin-top: 5px;
+   }
+
 }
 
 // --

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I00a35c932a7e0b91b7b01fc327c0c1b9bae66c78
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Wctaiwan wctai...@gmail.com
Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com
Gerrit-Reviewer: EBernhardson ebernhard...@wikimedia.org
Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net
Gerrit-Reviewer: Spage sp...@wikimedia.org
Gerrit-Reviewer: Wctaiwan wctai...@gmail.com
Gerrit-Reviewer: jenkins-bot 


[MediaWiki-commits] [Gerrit] Use precise ApiMain/ApiQuery type hints in all API modules - change (mediawiki/core)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use precise ApiMain/ApiQuery type hints in all API modules
..


Use precise ApiMain/ApiQuery type hints in all API modules

Which type is used depends on the ApiModuleManager responsible for
the API module. There are two managers, one in ApiMain and one in
ApiQuery. Both contain a list of API modules they instantiate.
Both use $this as the first parameter in the constructors of the
individual modules. There is no other regular way to instantiate the
modules, so we know the type must either be ApiMain or ApiQuery.

The lists don't intersect.

I would have prefered the naming scheme $mainModule for ApiMain
modules and $queryModule for ApiQuery modules but since this
doesn't add much I left the shorter variable names untouched.

Change-Id: Ie6bf19150f1c9b619655a06a8e051412665e54db
---
M includes/api/ApiFormatBase.php
M includes/api/ApiFormatJson.php
M includes/api/ApiFormatRaw.php
M includes/api/ApiLogin.php
M includes/api/ApiModuleManager.php
M includes/api/ApiPageSet.php
M includes/api/ApiParamInfo.php
M includes/api/ApiQuery.php
M includes/api/ApiQueryAllCategories.php
M includes/api/ApiQueryAllImages.php
M includes/api/ApiQueryAllLinks.php
M includes/api/ApiQueryAllMessages.php
M includes/api/ApiQueryAllPages.php
M includes/api/ApiQueryAllUsers.php
M includes/api/ApiQueryBacklinks.php
M includes/api/ApiQueryBase.php
M includes/api/ApiQueryBlocks.php
M includes/api/ApiQueryCategories.php
M includes/api/ApiQueryCategoryInfo.php
M includes/api/ApiQueryCategoryMembers.php
M includes/api/ApiQueryContributors.php
M includes/api/ApiQueryDeletedrevs.php
M includes/api/ApiQueryDuplicateFiles.php
M includes/api/ApiQueryExtLinksUsage.php
M includes/api/ApiQueryExternalLinks.php
M includes/api/ApiQueryFileRepoInfo.php
M includes/api/ApiQueryFilearchive.php
M includes/api/ApiQueryIWBacklinks.php
M includes/api/ApiQueryIWLinks.php
M includes/api/ApiQueryImageInfo.php
M includes/api/ApiQueryImages.php
M includes/api/ApiQueryInfo.php
M includes/api/ApiQueryLangBacklinks.php
M includes/api/ApiQueryLangLinks.php
M includes/api/ApiQueryLinks.php
M includes/api/ApiQueryLogEvents.php
M includes/api/ApiQueryPagePropNames.php
M includes/api/ApiQueryPageProps.php
M includes/api/ApiQueryPagesWithProp.php
M includes/api/ApiQueryProtectedTitles.php
M includes/api/ApiQueryQueryPage.php
M includes/api/ApiQueryRandom.php
M includes/api/ApiQueryRecentChanges.php
M includes/api/ApiQueryRedirects.php
M includes/api/ApiQueryRevisions.php
M includes/api/ApiQuerySearch.php
M includes/api/ApiQuerySiteinfo.php
M includes/api/ApiQueryStashImageInfo.php
M includes/api/ApiQueryTags.php
M includes/api/ApiQueryUserContributions.php
M includes/api/ApiQueryUserInfo.php
M includes/api/ApiQueryUsers.php
M includes/api/ApiQueryWatchlist.php
M includes/api/ApiQueryWatchlistRaw.php
M includes/api/ApiResult.php
M includes/api/ApiRsd.php
M tests/phpunit/includes/api/PrefixUniquenessTest.php
57 files changed, 73 insertions(+), 65 deletions(-)

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



diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php
index 15b97d8..8954abc 100644
--- a/includes/api/ApiFormatBase.php
+++ b/includes/api/ApiFormatBase.php
@@ -34,12 +34,11 @@
private $mBufferResult = false, $mBuffer, $mDisabled = false;
 
/**
-* Constructor
 * If $format ends with 'fm', pretty-print the output in HTML.
 * @param ApiMain $main
 * @param string $format Format name
 */
-   public function __construct( $main, $format ) {
+   public function __construct( ApiMain $main, $format ) {
parent::__construct( $main, $format );
 
$this-mIsHtml = ( substr( $format, -2, 2 ) === 'fm' ); // ends 
with 'fm'
@@ -347,7 +346,7 @@
  */
 class ApiFormatFeedWrapper extends ApiFormatBase {
 
-   public function __construct( $main ) {
+   public function __construct( ApiMain $main ) {
parent::__construct( $main, 'feed' );
}
 
diff --git a/includes/api/ApiFormatJson.php b/includes/api/ApiFormatJson.php
index be0b58b..e2c6b9a 100644
--- a/includes/api/ApiFormatJson.php
+++ b/includes/api/ApiFormatJson.php
@@ -32,7 +32,7 @@
 
private $mIsRaw;
 
-   public function __construct( $main, $format ) {
+   public function __construct( ApiMain $main, $format ) {
parent::__construct( $main, $format );
$this-mIsRaw = ( $format === 'rawfm' );
}
diff --git a/includes/api/ApiFormatRaw.php b/includes/api/ApiFormatRaw.php
index af17554..3f5c8b7 100644
--- a/includes/api/ApiFormatRaw.php
+++ b/includes/api/ApiFormatRaw.php
@@ -31,11 +31,10 @@
 class ApiFormatRaw extends ApiFormatBase {
 
/**
-* Constructor
 * @param ApiMain $main
-* @param ApiFormatBase $errorFallback ApiFormatBase object to 

[MediaWiki-commits] [Gerrit] Remove unneeded $classes from SpecialTrackingCategories.php - change (mediawiki/core)

2014-05-16 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review.

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

Change subject: Remove unneeded $classes from SpecialTrackingCategories.php
..

Remove unneeded $classes from SpecialTrackingCategories.php

Change-Id: I9f10db9f6596ac0bfe0aa1595acbeeef4ca5713a
---
M includes/specials/SpecialTrackingCategories.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/23/133723/1

diff --git a/includes/specials/SpecialTrackingCategories.php 
b/includes/specials/SpecialTrackingCategories.php
index 9ec3c5b..8a32ba9 100644
--- a/includes/specials/SpecialTrackingCategories.php
+++ b/includes/specials/SpecialTrackingCategories.php
@@ -96,7 +96,6 @@
$catTitle,
htmlspecialchars( $catName )
);
-   $classes = array();
} else {
$catTitleText = $this-msg( 
'trackingcategories-disabled' )-parse();
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f10db9f6596ac0bfe0aa1595acbeeef4ca5713a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender umherirrender_de...@web.de

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


[MediaWiki-commits] [Gerrit] Log account creation with AddNewAccount, impression with Use... - change (mediawiki...GettingStarted)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Log account creation with AddNewAccount, impression with 
UserCreateForm
..


Log account creation with AddNewAccount, impression with UserCreateForm

Instead of conditionally logging event, make token optional on the
server-side.

Bump schemas:

* TrackedPageContentSaveComplete
* SignupExpAccountCreationImpression
* SignupExpAccountCreationComplete

for doc changes, and token being made optional.

Bug: 65352
Change-Id: I843ed9d4cbab221c0cb664f6820ab9139ced94e5
---
M GettingStarted.php
M Hooks.php
2 files changed, 48 insertions(+), 26 deletions(-)

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



diff --git a/GettingStarted.php b/GettingStarted.php
index 318cb6d..3d714fd 100644
--- a/GettingStarted.php
+++ b/GettingStarted.php
@@ -350,6 +350,8 @@
 $wgHooks[ 'CentralAuthPostLoginRedirect' ][] = 
'GettingStarted\Hooks::onCentralAuthPostLoginRedirect';
 $wgHooks[ 'ResourceLoaderTestModules' ][] = 
'GettingStarted\Hooks::onResourceLoaderTestModules';
 $wgHooks[ 'PageContentSaveComplete' ][] = 
'GettingStarted\Hooks::onPageContentSaveComplete';
+$wgHooks[ 'AddNewAccount' ][] = 'GettingStarted\Hooks::onAddNewAccount';
+$wgHooks[ 'UserCreateForm' ][] = 'GettingStarted\Hooks::onUserCreateForm';
 
 list( $site, $lang ) = $wgConf-siteFromDB( $wgDBname );
 
diff --git a/Hooks.php b/Hooks.php
index b39dcf7..bfffe7b 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -147,14 +147,6 @@
}
 
/**
-* Checks if the current page is user signup page.
-*/
-   protected static function isSignupPage( OutputPage $out ) {
-   $isSignup = $out-getRequest()-getText( 'type' ) == 'signup';
-   return $out-getTitle()-isSpecial( 'Userlogin' )  $isSignup;
-   }
-
-   /**
 * Adds the returnTo module to the  page the user returned to upon 
signup.
 *
 * Depending on the page, this may do nothing (except log), or add a 
CTA with
@@ -250,7 +242,6 @@
global $wgGettingStartedRunTest;
 
$user = $out-getUser();
-   $gettingStartedToken = self::getGettingStartedToken();
 
// Assign token; will support anonymous signup invite experiment
$out-addModules( 'ext.gettingstarted.assignToken' );
@@ -270,15 +261,6 @@
}
 
if ( self::isPostCreateReturn( $out ) ) {
-   // Log server side event if we acquired the user through
-   // pre or post edit call to action.
-   if ( $gettingStartedToken !== null ) {
-   $event = array(
-   'token'  = $gettingStartedToken,
-   'userId' = $user-getId()
-   );
-   \EventLogging::logEvent( 
'SignupExpAccountCreationComplete', 8102589, $event );
-   }
// TODO (mattflaschen, 2013-10-05): If we're not going 
to show
// anything, we probably shouldn't add this module for 
performance
// reasons.
@@ -287,13 +269,6 @@
// suitable name), then decide what to do about
// redirect-page-impression (maybe log on the server, 
or get rid of it?)
self::addReturnToModules( $out, $skin );
-   }
-
-   // Log server side event if user entered signup page through pre
-   // or post edit call to action
-   if( $gettingStartedToken !== null  self::isSignupPage( $out ) 
) {
-   $event = array( 'token' = $gettingStartedToken );
-   \EventLogging::logEvent( 
'SignupExpAccountCreationImpression', 8102591, $event );
}
 
if ( $wgGettingStartedRunTest  $user-isAnon() ) {
@@ -491,7 +466,7 @@
$event['token'] = $gettingStartedToken;
}
 
-   \EventLogging::logEvent( 'TrackedPageContentSaveComplete', 
7872558, $event );
+   \EventLogging::logEvent( 'TrackedPageContentSaveComplete', 
8535426, $event );
return true;
}
 
@@ -530,4 +505,49 @@
 
return true;
}
+
+   /**
+* Logs a successful account creation, including the token
+*
+* @param User $user Newly created user
+* @param boolean $byEmail True if and only if created by email
+*
+* @return bool Always true
+*/
+   public static function onAddNewAccount( User $user, $byEmail ) {
+   $gettingStartedToken = self::getGettingStartedToken();
+
+   $event = array(
+   'userId' = $user-getId()
+   

[MediaWiki-commits] [Gerrit] mediawiki.ui: Rename .mw-ui-vform-div → .mw-ui-vform-field, ... - change (mediawiki/core)

2014-05-16 Thread Code Review
Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: mediawiki.ui: Rename .mw-ui-vform-div → .mw-ui-vform-field, 
require it instead of styling all divs
..

mediawiki.ui: Rename .mw-ui-vform-div → .mw-ui-vform-field, require it instead 
of styling all divs

This resolves a few FIXMEs and dramatically lowers the awkwardness
level of using mediawiki.ui.

'.mw-ui-vform-field' is a more descriptive name than '.mw-ui-vform-div'
and corresponds to the HTMLFormField PHP class in core which generates
divs with this CSS class.

We previously styled '.mw-ui-vform  div' the same way we styled
'.mw-ui-vform .mw-ui-vform-div', which was an annoying piece of magic
causing difficult to debug problems when one needed a different HTML
structure (like bug 63233). Explicitly using '.mw-ui-vform-field'
where applicable is a lot saner.

Change-Id: I6f0b8842f5fdf70b97decb165086d1a83428b259
---
M includes/htmlform/HTMLFormField.php
M resources/src/mediawiki.ui/components/default/forms.less
2 files changed, 17 insertions(+), 23 deletions(-)


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

diff --git a/includes/htmlform/HTMLFormField.php 
b/includes/htmlform/HTMLFormField.php
index 0e1860b..8076e8a 100644
--- a/includes/htmlform/HTMLFormField.php
+++ b/includes/htmlform/HTMLFormField.php
@@ -504,7 +504,7 @@
);
$divCssClasses = array( mw-htmlform-field-$fieldType, 
$this-mClass, $errorClass );
if ( $this-mParent-isVForm() ) {
-   $divCssClasses[] = 'mw-ui-vform-div';
+   $divCssClasses[] = 'mw-ui-vform-field';
}
 
$wrapperAttributes = array(
diff --git a/resources/src/mediawiki.ui/components/default/forms.less 
b/resources/src/mediawiki.ui/components/default/forms.less
index ee21932..6c40c26 100644
--- a/resources/src/mediawiki.ui/components/default/forms.less
+++ b/resources/src/mediawiki.ui/components/default/forms.less
@@ -24,12 +24,12 @@
 //
 // Markup:
 // form class=mw-ui-vform
-//   div class=mw-ui-vform-divThis is a form example./div
-//   div class=mw-ui-vform-div
+//   div class=mw-ui-vform-fieldThis is a form example./div
+//   div class=mw-ui-vform-field
 // labelUsername /label
 // input value=input
 //   /div
-//   div
+//   div class=mw-ui-vform-field
 // button class=mw-ui-button mw-ui-constructiveButton in vform/button
 //   /div
 // /form
@@ -39,15 +39,6 @@
.box-sizing(border-box);
 
width: @defaultFormWidth;
-
-   // Immediate divs in a vform are block and spaced-out.
-   // XXX: We shouldn't depend on the tag name here...
- div {
-   display: block;
-   margin: 0 0 15px 0;
-   padding: 0;
-   width: 100%;
-   }
 
// MW currently doesn't use the type attribute everywhere on inputs.
input,
@@ -104,17 +95,17 @@
//   div class=error
// ulliThere are problems with some of your input./li/ul
//   /div
-   //   div class=mw-ui-vform-div
+   //   div class=mw-ui-vform-field
// input type=text value=input class=mw-ui-input
//   /div
-   //   div class=mw-ui-vform-div
+   //   div class=mw-ui-vform-field
// select
//   option value=1Option 1/option
//   option value=2Option 2/option
// /select
// span class=errorThe value you specified is not a valid 
option./span
//   /div
-   //   div
+   //   div class=mw-ui-vform-field
// button class=mw-ui-buttonButton in vform/button
//   /div
// /form
@@ -142,7 +133,8 @@
// This specifies styling for individual field validation error 
messages.
// Show them below the fields to prevent line break glitches, and leave
// some space between the field and the error message box.
-   .mw-ui-vform-div .error {
+   .mw-ui-vform-div .error, /* for backwards-compatibility, remove before 
1.24 */
+   .mw-ui-vform-field .error {
display: block;
margin-top: 5px;
}
@@ -153,12 +145,14 @@
 // Elements
 // --
 
-// Apply this to individual elements to style them.
-// You generally don't need to use this class on divs within an Agora
-// form container such as mw-ui-vform
-// XXX DRY: This repeats earlier styling, use an @include agora-div-styling ?
-// XXX: What is this even for?
-.mw-ui-vform-div {
+// A wrapper for a single form field: the input / select / button 
element,
+// help text, labels, associated error/warning/success messages, and so on.
+// Elements with this class are generated by HTMLFormField in core MediaWiki.
+//
+// (We use a broad definition of 'field' here: a purely textual 

[MediaWiki-commits] [Gerrit] Avoid running all of mw.lua twice - change (mediawiki...Scribunto)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Avoid running all of mw.lua twice
..


Avoid running all of mw.lua twice

LuaStandalone only uses 2 functions from mw.lua, so move them to their own
file to avoid running the whole thing twice.

Change-Id: Ia4d58f44be17f7a71666dbe750e66d9d90cb5c2f
---
M engines/LuaCommon/LuaCommon.php
M engines/LuaCommon/lualib/mw.lua
A engines/LuaCommon/lualib/mwInit.lua
M engines/LuaStandalone/mw_main.lua
4 files changed, 115 insertions(+), 106 deletions(-)

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



diff --git a/engines/LuaCommon/LuaCommon.php b/engines/LuaCommon/LuaCommon.php
index 2c0a93d..4e3179f 100644
--- a/engines/LuaCommon/LuaCommon.php
+++ b/engines/LuaCommon/LuaCommon.php
@@ -90,6 +90,7 @@
$lib[$name] = array( $this, $name );
}
 
+   $this-registerInterface( 'mwInit.lua', array() );
$this-mw = $this-registerInterface( 'mw.lua', $lib,
array( 'allowEnvFuncs' = 
$this-options['allowEnvFuncs'] ) );
 
diff --git a/engines/LuaCommon/lualib/mw.lua b/engines/LuaCommon/lualib/mw.lua
index e1fecab..4c2e005 100644
--- a/engines/LuaCommon/lualib/mw.lua
+++ b/engines/LuaCommon/lualib/mw.lua
@@ -104,36 +104,6 @@
packageCache = {}
 end
 
 Do a deep copy of a table or other value.
-function mw.clone( val )
-   local tableRefs = {}
-   local function recursiveClone( val )
-   if type( val ) == 'table' then
-   -- Encode circular references correctly
-   if tableRefs[val] ~= nil then
-   return tableRefs[val]
-   end
-
-   local retVal
-   retVal = {}
-   tableRefs[val] = retVal
-
-   -- Copy metatable
-   if getmetatable( val ) then
-   setmetatable( retVal, recursiveClone( 
getmetatable( val ) ) )
-   end
-
-   for key, elt in pairs( val ) do
-   retVal[key] = recursiveClone( elt )
-   end
-   return retVal
-   else
-   return val
-   end
-   end
-   return recursiveClone( val )
-end
-
 --- Set up a cloned environment for execution of a module chunk, then execute
 -- the module in that environment. This is called by the host to implement 
 -- {{#invoke}}.
@@ -161,81 +131,6 @@
 
setfenv( chunk, env )
return chunk()
-end
-
 Make isolation-safe setfenv and getfenv functions
---
--- @param protectedEnvironments A table where the keys are protected 
environment
---tables. These environments cannot be accessed with getfenv(), and
---functions with these environments cannot be modified or accessed using 
---integer indexes to setfenv(). However, functions with these environments 
---can have their environment set with setfenv() with a function value 
---argument.
---
--- @param protectedFunctions A table where the keys are protected functions, 
---which cannot have their environments set by setfenv() with a function 
---value argument.
---
--- @return setfenv
--- @return getfenv
-function mw.makeProtectedEnvFuncs( protectedEnvironments, protectedFunctions )
-   local old_setfenv = setfenv
-   local old_getfenv = getfenv
-
-   local function my_setfenv( func, newEnv )
-   if type( func ) == 'number' then
-   local stackIndex = math.floor( func )
-   if stackIndex = 0 then
-   error( 'setfenv' cannot set the global 
environment, it is protected, 2 )
-   end
-   if stackIndex  10 then
-   error( 'setfenv' cannot set an environment at 
a level greater than 10, 2 )
-   end
-
-   -- Add one because we are still in Lua and 1 is right 
here
-   stackIndex = stackIndex + 1
-
-   local env = old_getfenv( stackIndex )
-   if env == nil or protectedEnvironments[ env ] then
-   error( 'setfenv' cannot set the requested 
environment, it is protected, 2 )
-   end
-   func = old_setfenv( stackIndex, newEnv )
-   elseif type( func ) == 'function' then
-   if protectedFunctions[func] then
-   error( 'setfenv' cannot be called on a 
protected function, 2 )
-   end
-   local env = old_getfenv( func )
-   if env == nil or protectedEnvironments[ env ] then
-   

[MediaWiki-commits] [Gerrit] Merge remote-tracking branch 'gerrit/REL1_22' into fundraisi... - change (mediawiki/core)

2014-05-16 Thread Mwalker (Code Review)
Mwalker has uploaded a new change for review.

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

Change subject: Merge remote-tracking branch 'gerrit/REL1_22' into 
fundraising/REL1_22
..

Merge remote-tracking branch 'gerrit/REL1_22' into fundraising/REL1_22

Update to 1.22.6

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/133725/1


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6f55851d4f7229aaf60b7c9cef68fecf9c4986a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_22
Gerrit-Owner: Mwalker mwal...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] vector.collapsibleTabs: Rename $settings to settings - change (mediawiki/core)

2014-05-16 Thread Krinkle (Code Review)
Krinkle has uploaded a new change for review.

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

Change subject: vector.collapsibleTabs: Rename $settings to settings
..

vector.collapsibleTabs: Rename $settings to settings

This is just a plain object.

Change-Id: I062e2a081e605a002c841ad69fe0dcd90fbee057
---
M skins/vector/collapsibleTabs.js
1 file changed, 11 insertions(+), 11 deletions(-)


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

diff --git a/skins/vector/collapsibleTabs.js b/skins/vector/collapsibleTabs.js
index 0e49744..9344433 100644
--- a/skins/vector/collapsibleTabs.js
+++ b/skins/vector/collapsibleTabs.js
@@ -9,7 +9,7 @@
return this;
}
// Merge options into the defaults
-   var $settings = $.extend( {}, $.collapsibleTabs.defaults, 
options );
+   var settings = $.extend( {}, $.collapsibleTabs.defaults, 
options );
 
this.each( function () {
var $el = $( this );
@@ -17,9 +17,9 @@
$.collapsibleTabs.instances = ( 
$.collapsibleTabs.instances.length === 0 ?
$el : $.collapsibleTabs.instances.add( $el ) );
// attach the settings to the elements
-   $el.data( 'collapsibleTabsSettings', $settings );
+   $el.data( 'collapsibleTabsSettings', settings );
// attach data to our collapsible elements
-   $el.children( $settings.collapsible ).each( function () 
{
+   $el.children( settings.collapsible ).each( function () {
$.collapsibleTabs.addData( $( this ) );
} );
} );
@@ -84,23 +84,23 @@
}
},
addData: function ( $collapsible ) {
-   var $settings = $collapsible.parent().data( 
'collapsibleTabsSettings' );
-   if ( $settings ) {
+   var settings = $collapsible.parent().data( 
'collapsibleTabsSettings' );
+   if ( settings ) {
$collapsible.data( 'collapsibleTabsSettings', {
-   expandedContainer: 
$settings.expandedContainer,
-   collapsedContainer: 
$settings.collapsedContainer,
+   expandedContainer: 
settings.expandedContainer,
+   collapsedContainer: 
settings.collapsedContainer,
expandedWidth: $collapsible.width(),
prevElement: $collapsible.prev()
} );
}
},
getSettings: function ( $collapsible ) {
-   var $settings = $collapsible.data( 
'collapsibleTabsSettings' );
-   if ( !$settings ) {
+   var settings = $collapsible.data( 
'collapsibleTabsSettings' );
+   if ( !settings ) {
$.collapsibleTabs.addData( $collapsible );
-   $settings = $collapsible.data( 
'collapsibleTabsSettings' );
+   settings = $collapsible.data( 
'collapsibleTabsSettings' );
}
-   return $settings;
+   return settings;
},
handleResize: function () {
$.collapsibleTabs.instances.each( function () {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I062e2a081e605a002c841ad69fe0dcd90fbee057
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle krinklem...@gmail.com

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


[MediaWiki-commits] [Gerrit] mediawiki.searchSuggest: Remove duplicate code - change (mediawiki/core)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: mediawiki.searchSuggest: Remove duplicate code
..


mediawiki.searchSuggest: Remove duplicate code

The 'result' function for skin-provided search box is already provided
above as generic functionality, repeating it doesn't do anything.

Change-Id: I8693f3dbbfb64ac2816da86759233e3870234d77
---
M resources/src/mediawiki/mediawiki.searchSuggest.js
1 file changed, 1 insertion(+), 7 deletions(-)

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



diff --git a/resources/src/mediawiki/mediawiki.searchSuggest.js 
b/resources/src/mediawiki/mediawiki.searchSuggest.js
index 8a8871d..ea7c0c5 100644
--- a/resources/src/mediawiki/mediawiki.searchSuggest.js
+++ b/resources/src/mediawiki/mediawiki.searchSuggest.js
@@ -107,7 +107,7 @@
}
}
 
-   // General suggestions functionality for all search boxes
+   // Generic suggestions functionality for all search boxes
searchboxesSelectors = [
// Primary searchbox on every page in standard skins
'#searchInput',
@@ -168,12 +168,6 @@
 
// Special suggestions functionality for skin-provided search 
box
$searchInput.suggestions( {
-   result: {
-   render: renderFunction,
-   select: function () {
-   return true; // allow the form to be 
submitted
-   }
-   },
special: {
render: specialRenderFunction,
select: function ( $input ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8693f3dbbfb64ac2816da86759233e3870234d77
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński matma@gmail.com
Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net
Gerrit-Reviewer: Krinkle krinklem...@gmail.com
Gerrit-Reviewer: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: Thiemo Mättig (WMDE) thiemo.maet...@wikimedia.de
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] mediawiki.searchSuggest: Adjust font size for all inputs, no... - change (mediawiki/core)

2014-05-16 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: mediawiki.searchSuggest: Adjust font size for all inputs, not 
just magic ones
..


mediawiki.searchSuggest: Adjust font size for all inputs, not just magic ones

I have no idea why the fix was limited, this issue affects every single
input on every single page (including ones that are part of MediaWiki
interface itself, not skins, see If4ae687b).

Change-Id: I7a6dfbcced64dbfce5d1ab31201c98a134f72fe9
---
M resources/src/mediawiki/mediawiki.searchSuggest.js
1 file changed, 11 insertions(+), 9 deletions(-)

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



diff --git a/resources/src/mediawiki/mediawiki.searchSuggest.js 
b/resources/src/mediawiki/mediawiki.searchSuggest.js
index ea7c0c5..cbdf666 100644
--- a/resources/src/mediawiki/mediawiki.searchSuggest.js
+++ b/resources/src/mediawiki/mediawiki.searchSuggest.js
@@ -115,6 +115,7 @@
'#powerSearchText',
'#searchText',
// Generic selector for skins with multiple searchboxes 
(used by CologneBlue)
+   // and for MediaWiki itself (special pages with page 
title inputs)
'.mw-searchInput'
];
$( searchboxesSelectors.join( ', ' ) )
@@ -156,6 +157,16 @@
// make sure paste and cut events from the 
mouse and dragdrop events
// trigger the keypress handler and cause the 
suggestions to update
$( this ).trigger( 'keypress' );
+   } )
+   // In most skins (at least Monobook and Vector), the 
font-size is messed up in body.
+   // (they use 2 elements to get a sane font-height). So, 
instead of making exceptions for
+   // each skin or adding more stylesheets, just copy it 
from the active element so auto-fit.
+   .each( function () {
+   var $this = $( this );
+   $this
+   .data( 'suggestions-context' )
+   .data.$container
+   .css( 'fontSize', $this.css( 
'fontSize' ) );
} );
 
// Ensure that the thing is actually present!
@@ -181,15 +192,6 @@
 
// If the form includes any fallback fulltext search buttons, 
remove them
$searchInput.closest( 'form' ).find( '.mw-fallbackSearchButton' 
).remove();
-
-   // In most skins (at least Monobook and Vector), the font-size 
is messed up in body.
-   // (they use 2 elements to get a sane font-height). So, instead 
of making exceptions for
-   // each skin or adding more stylesheets, just copy it from the 
active element so auto-fit.
-   $searchInput
-   .data( 'suggestions-context' )
-   .data.$container
-   .css( 'fontSize', $searchInput.css( 'fontSize' 
) );
-
} );
 
 }( mediaWiki, jQuery ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a6dfbcced64dbfce5d1ab31201c98a134f72fe9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński matma@gmail.com
Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net
Gerrit-Reviewer: Krinkle krinklem...@gmail.com
Gerrit-Reviewer: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: jenkins-bot 

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


[MediaWiki-commits] [Gerrit] Merge remote-tracking branch 'gerrit/REL1_22' into fundraisi... - change (mediawiki/core)

2014-05-16 Thread Mwalker (Code Review)
Mwalker has submitted this change and it was merged.

Change subject: Merge remote-tracking branch 'gerrit/REL1_22' into 
fundraising/REL1_22
..


Merge remote-tracking branch 'gerrit/REL1_22' into fundraising/REL1_22

Update to 1.22.6

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

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




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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6f55851d4f7229aaf60b7c9cef68fecf9c4986a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: fundraising/REL1_22
Gerrit-Owner: Mwalker mwal...@wikimedia.org
Gerrit-Reviewer: Mwalker mwal...@wikimedia.org
Gerrit-Reviewer: Waldir wal...@email.com

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


[MediaWiki-commits] [Gerrit] Test commit for tests - change (mediawiki/core)

2014-05-16 Thread Mwalker (Code Review)
Mwalker has uploaded a new change for review.

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

Change subject: Test commit for tests
..

Test commit for tests

Change-Id: I844d433cecfd2afd7627d93e850a7031319a9d9d
---
A foo
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/27/133727/1

diff --git a/foo b/foo
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/foo

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I844d433cecfd2afd7627d93e850a7031319a9d9d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_22
Gerrit-Owner: Mwalker mwal...@wikimedia.org

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


  1   2   3   >