[MediaWiki-commits] [Gerrit] (bug 45643) Add new user groups to urwiki with specific righ... - change (operations/mediawiki-config)
Odder has uploaded a new change for review. https://gerrit.wikimedia.org/r/56578 Change subject: (bug 45643) Add new user groups to urwiki with specific rights Add abusefilter and rollbacker user groups, modify $wgAddGroups for crats and sysops, modify $wgRemoveGroups for crats .. (bug 45643) Add new user groups to urwiki with specific rights Add abusefilter and rollbacker user groups, modify $wgAddGroups for crats and sysops, modify $wgRemoveGroups for crats Change-Id: I35e44b7a9d63fd4f0ed648fc2f85a0f549998ad5 --- M wmf-config/InitialiseSettings.php M wmf-config/abusefilter.php 2 files changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/78/56578/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index a66aac8..a586981 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -7477,6 +7477,9 @@ 'ukwikimedia' => array( 'sysop' => array( 'importupload' => true ), // https://bugzilla.wikimedia.org/show_bug.cgi?id=17167 ), + 'urwiki' => array( + 'rollbacker' => array( 'rollback' => true ), // bug 45642 + ), 'vecwiki' => array( 'flood' => array( 'bot' => true ), ), @@ -7947,8 +7950,8 @@ 'sysop' => array( 'autoeditor' ), ), '+urwiki' => array( - 'bureaucrat' => array( 'import', 'confirmed' ), // Bug 42737 - 'sysop' => array( 'confirmed' ), // Bug 42737 + 'bureaucrat' => array( 'import', 'confirmed', 'abusefilter', 'rollbacker' ), // Bug 42737 and 45643 + 'sysop' => array( 'confirmed', 'abusefilter', 'rollbacker' ), // Bug 42737 and 45643 ), '+viwiki' => array( 'sysop' => array( 'rollbacker', 'flood' ), @@ -8361,7 +8364,7 @@ 'sysop' => array( 'autoeditor' ), ), '+urwiki' => array( - 'bureaucrat' => array( 'import', 'confirmed' ), // Bug 42737 + 'bureaucrat' => array( 'import', 'confirmed', 'abusefilter', 'rollbacker' ), // Bug 42737 and 45643 'sysop' => array( 'confirmed' ), // Bug 42737 ), '+viwiki' => array( diff --git a/wmf-config/abusefilter.php b/wmf-config/abusefilter.php index 73c8d04..f3f350c 100644 --- a/wmf-config/abusefilter.php +++ b/wmf-config/abusefilter.php @@ -280,4 +280,6 @@ } elseif ( $wgDBname == 'wikidatawiki' ) { $wgAbuseFilterNotifications = "udp"; // bug 45083 $wgAbuseFilterNotificationsPrivate = true; // bug 45083 +} elseif ( $wgDBname == 'urwiki' ) { + $wgGroupPermissions['abusefilter']['abusefilter-modify'] = true; // bug 45643 } -- To view, visit https://gerrit.wikimedia.org/r/56578 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I35e44b7a9d63fd4f0ed648fc2f85a0f549998ad5 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Odder ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add php interpreter and runtime (version 0.0.1) - change (mediawiki...Foxway)
Pastakhov has submitted this change and it was merged. Change subject: Add php interpreter and runtime (version 0.0.1) .. Add php interpreter and runtime (version 0.0.1) works only command 'echo' with strings and variables. Patchset 2: added tests and function process_slashes() Change-Id: I062ac9e6084e4afec15c82ae655d943ca217ed45 --- A Foxway.body.php A Foxway.i18n.magic.php A Foxway.i18n.php A Foxway.php A includes/Interpreter.php A includes/Runtime.php A tests/phpunit/includes/InterpreterTest.php 7 files changed, 612 insertions(+), 0 deletions(-) Approvals: Pastakhov: Verified; Looks good to me, approved diff --git a/Foxway.body.php b/Foxway.body.php new file mode 100644 index 000..7c4244b --- /dev/null +++ b/Foxway.body.php @@ -0,0 +1,46 @@ + + * @licence GNU General Public Licence 2.0 or later + */ +class Foxway { + + /** +* Render function used in hook ParserFirstCallInit +* +* @param Parser $parser +* @return string +*/ + public static function renderParserFunction(Parser &$parser) { + $params = func_get_args(); + array_shift( $params ); + + if( count($params) < 2 ) { + return '' . wfMessage( 'foxway-not-enough-parameters' )->escaped() . ''; + } + + $action = strtolower( $params[0] ); + switch ($action) { + case 'set': + $matches = array(); + if( preg_match('/^\s*([^=]+)\s*=\s*(.+)\s*$/si', $params[1], &$matches) ) { + $propertyName = $matches[1]; + $propertyValue = $matches[2]; + return \Foxway\ORM::SetProperty($propertyName, $propertyValue); + break; + } + break; + default: + return '' . wfMessage( 'foxway-unknown-action', $action )->escaped() . ''; + break; + } + } + + public static function render($input, array $args, Parser $parser, PPFrame $frame) { + return Foxway\Interpreter::run($input, true); + } +} \ No newline at end of file diff --git a/Foxway.i18n.magic.php b/Foxway.i18n.magic.php new file mode 100644 index 000..b29eb7b --- /dev/null +++ b/Foxway.i18n.magic.php @@ -0,0 +1,17 @@ + + */ + +$magicWords = array(); + +/** English + * @author pastakhov + */ +$magicWords['en'] = array( + 'foxway' => array( 0, 'foxway' ), +); diff --git a/Foxway.i18n.php b/Foxway.i18n.php new file mode 100644 index 000..12f9a18 --- /dev/null +++ b/Foxway.i18n.php @@ -0,0 +1,28 @@ + + */ + +$messages = array(); + +/** English + * @author pastakhov + */ +$messages['en'] = array( + 'foxway-desc' => 'Allows to store an object-oriented data and implements its own runtime for php code on wikipage', + 'foxway-php-syntax-error-unexpected' => 'PHP Parse error: syntax error, unexpected $1 in Command line code on line $2' +); + +/** Message documentation (Message documentation) + * @author pastakhov + */ +$messages['qqq'] = array( + 'foxway-desc' => '{{desc|name=Foxway|url=http://www.mediawiki.org/wiki/Extension:Foxway}}', + 'foxway-php-syntax-error-unexpected' => 'Error message, parameters: +* $1 - token or user-specified string a quoted +* $2 - the line number where the error occurred', +); diff --git a/Foxway.php b/Foxway.php new file mode 100644 index 000..ed7ad34 --- /dev/null +++ b/Foxway.php @@ -0,0 +1,82 @@ +https://www.mediawiki.org/wiki/Extension:Foxway Documentation + * @file Foxway.php + * @defgroup Foxway + * @ingroup Extensions + * @author Pavel Astakhov + * @licence GNU General Public Licence 2.0 or later + */ + +// Check to see if we are being called as an extension or directly +if ( !defined( 'MEDIAWIKI' ) ) { + die( 'This file is an extension to MediaWiki and thus not a valid entry point.' ); +} + +define( 'Foxway_VERSION' , '0.0.1' ); + +// Register this extension on Special:Version +$wgExtensionCredits['parserhook'][] = array( + 'path' => __FILE__, + 'name' => 'Foxway', + 'version' => Foxway_VERSION, + 'url' => 'https://www.mediawiki.org/wiki/Extension:Foxway', + 'author'=> array( '[[mw:User:Pastakhov|Pavel Astakhov]]' ), + 'descriptionmsg'=> 'foxway-desc' +); + +// Tell the whereabouts of files +$dir = __DIR__; + +// Allow translations for this extension +$wgExtensionMessagesFiles['Foxway'] = $dir . '/Foxway.i18n.php'; +$wgExtensionMessagesFiles['FoxwayMagic'] = $dir . '/Foxway.i18n.magic.php'; + +// Include the settings file. +//require_once $dir . '/Set
[MediaWiki-commits] [Gerrit] (Bug 46567) Saving again discards the correction - change (mediawiki...Translate)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/56579 Change subject: (Bug 46567) Saving again discards the correction .. (Bug 46567) Saving again discards the correction Disable the save button till previous save is done. Change-Id: If3e85bb64109ed2c2f577f2cc67cd3e4e03e59b4 --- M resources/js/ext.translate.editor.js 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/79/56579/1 diff --git a/resources/js/ext.translate.editor.js b/resources/js/ext.translate.editor.js index 3837b0a..ed130fe 100644 --- a/resources/js/ext.translate.editor.js +++ b/resources/js/ext.translate.editor.js @@ -390,8 +390,9 @@ } $saveButton.text( mw.msg( 'tux-editor-save-button-label' ) ); - // When there is content in the editor - if ( $.trim( $textArea.val() ) ) { + // When there is content in the editor enable the button. + // But do not enable when some saving is not finished yet. + if ( $.trim( $textArea.val() ) && !translateEditor.saving ) { $pasteSourceButton.addClass( 'hide' ); $saveButton.prop( 'disabled', false ); } else { -- To view, visit https://gerrit.wikimedia.org/r/56579 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3e85bb64109ed2c2f577f2cc67cd3e4e03e59b4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Santhosh ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add debug options - change (mediawiki...Foxway)
Pastakhov has uploaded a new change for review. https://gerrit.wikimedia.org/r/56580 Change subject: add debug options .. add debug options debug is disabled by default and it added as options Change-Id: Ife890f9b367869fc0f79dd5b7711fc13fcb27b97 --- M Foxway.body.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Foxway refs/changes/80/56580/1 diff --git a/Foxway.body.php b/Foxway.body.php index 7c4244b..393f214 100644 --- a/Foxway.body.php +++ b/Foxway.body.php @@ -41,6 +41,6 @@ } public static function render($input, array $args, Parser $parser, PPFrame $frame) { - return Foxway\Interpreter::run($input, true); + return Foxway\Interpreter::run( $input, isset($args['debug']) ); } } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/56580 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife890f9b367869fc0f79dd5b7711fc13fcb27b97 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Foxway Gerrit-Branch: master Gerrit-Owner: Pastakhov ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add debug options - change (mediawiki...Foxway)
Pastakhov has submitted this change and it was merged. Change subject: add debug options .. add debug options debug is disabled by default and it added as options Change-Id: Ife890f9b367869fc0f79dd5b7711fc13fcb27b97 --- M Foxway.body.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pastakhov: Verified; Looks good to me, approved diff --git a/Foxway.body.php b/Foxway.body.php index 7c4244b..393f214 100644 --- a/Foxway.body.php +++ b/Foxway.body.php @@ -41,6 +41,6 @@ } public static function render($input, array $args, Parser $parser, PPFrame $frame) { - return Foxway\Interpreter::run($input, true); + return Foxway\Interpreter::run( $input, isset($args['debug']) ); } } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/56580 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ife890f9b367869fc0f79dd5b7711fc13fcb27b97 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Foxway Gerrit-Branch: master Gerrit-Owner: Pastakhov Gerrit-Reviewer: Pastakhov ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fix problem with new line in debug mode - change (mediawiki...Foxway)
Pastakhov has uploaded a new change for review. https://gerrit.wikimedia.org/r/56581 Change subject: fix problem with new line in debug mode .. fix problem with new line in debug mode Change-Id: Ibdc7e69cc1b989688791d1fd2c420ae087c7270e --- M includes/Interpreter.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Foxway refs/changes/81/56581/1 diff --git a/includes/Interpreter.php b/includes/Interpreter.php index a1f2042..2e9ae01 100644 --- a/includes/Interpreter.php +++ b/includes/Interpreter.php @@ -217,7 +217,7 @@ } if( $is_debug ) { - $return = implode('', $debug) . '' . $return; + $return = implode('', $debug) . "\n" . $return; } return $return; } -- To view, visit https://gerrit.wikimedia.org/r/56581 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibdc7e69cc1b989688791d1fd2c420ae087c7270e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Foxway Gerrit-Branch: master Gerrit-Owner: Pastakhov ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fix problem with new line in debug mode - change (mediawiki...Foxway)
Pastakhov has submitted this change and it was merged. Change subject: fix problem with new line in debug mode .. fix problem with new line in debug mode Change-Id: Ibdc7e69cc1b989688791d1fd2c420ae087c7270e --- M includes/Interpreter.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pastakhov: Verified; Looks good to me, approved diff --git a/includes/Interpreter.php b/includes/Interpreter.php index a1f2042..2e9ae01 100644 --- a/includes/Interpreter.php +++ b/includes/Interpreter.php @@ -217,7 +217,7 @@ } if( $is_debug ) { - $return = implode('', $debug) . '' . $return; + $return = implode('', $debug) . "\n" . $return; } return $return; } -- To view, visit https://gerrit.wikimedia.org/r/56581 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibdc7e69cc1b989688791d1fd2c420ae087c7270e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Foxway Gerrit-Branch: master Gerrit-Owner: Pastakhov Gerrit-Reviewer: Pastakhov ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug 46686) Throttle rule for gu. workshop - change (operations/mediawiki-config)
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/56582 Change subject: (bug 46686) Throttle rule for gu. workshop .. (bug 46686) Throttle rule for gu. workshop Date ... 2013-03-29 IP . 14.139.122.82 Wiki ... gu.wikipedia Limit .. 100 Cleaning former rules. Change-Id: Ifaffe3fac771e0222ecd6f07a2d52ea527a839fc --- M wmf-config/throttle.php 1 file changed, 6 insertions(+), 27 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/82/56582/1 diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php index a51bb6a..0a93d52 100644 --- a/wmf-config/throttle.php +++ b/wmf-config/throttle.php @@ -20,33 +20,12 @@ ## Add throttling definitions below. -$wmfThrottlingExceptions[] = array( // UCSF event at medical school - 'from' => '2013-01-07T16:00 +0:00', - 'to' => '2013-01-12T02:00 +0:00', - 'IP' => array( -'205.154.255.252', -'64.54.222.227', - //Some IPs will be added here Monday - ), - 'dbname' => array( 'enwiki', 'commonswiki' ), - 'value' => 200, // 100 to 150 participants expected -); -// Wikipedia Summit Pune, https://bugzilla.wikimedia.org/show_bug.cgi?id=43856 -$wmfThrottlingExceptions[] = array( - 'from' => '2013-01-12T10:00 +5:30', - 'to' => '2013-01-14T17:00 +5:30', - 'IP' => array( '14.140.227.67', '14.140.227.68' ), - 'dbname' => array( 'enwiki', 'commonswiki' ), - 'value' => 50, -); - -// Israel Edithon https://bugzilla.wikimedia.org/show_bug.cgi?id=44506 -$wmfThrottlingExceptions[] = array( - 'from' => '2013-01-30T00:00 +2:00', - 'to' => '2013-02-01T00:00 +2:00', - 'IP' => '212.25.84.200', - 'dbname' => array( 'frwiki', ), - 'value' => 50, +$wmfThrottlingExceptions[] = array( // Bug 46686 - gu. workshop + 'from' => '2013-03-29T09:00 +0:00', + 'to' => '2013-03-30T05:30 +0:00', + 'IP' => '14.139.122.82', + 'dbname' => array( 'guwiki', ), + 'value' => 100, ); ## Add throttling definitions above. -- To view, visit https://gerrit.wikimedia.org/r/56582 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifaffe3fac771e0222ecd6f07a2d52ea527a839fc Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Dereckson ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug 46686) Throttle rule for gu. workshop - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: (bug 46686) Throttle rule for gu. workshop .. (bug 46686) Throttle rule for gu. workshop Date ... 2013-03-29 IP . 14.139.122.82 Wiki ... gu.wikipedia Limit .. 100 Cleaning former rules. Change-Id: Ifaffe3fac771e0222ecd6f07a2d52ea527a839fc --- M wmf-config/throttle.php 1 file changed, 6 insertions(+), 27 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php index a51bb6a..0a93d52 100644 --- a/wmf-config/throttle.php +++ b/wmf-config/throttle.php @@ -20,33 +20,12 @@ ## Add throttling definitions below. -$wmfThrottlingExceptions[] = array( // UCSF event at medical school - 'from' => '2013-01-07T16:00 +0:00', - 'to' => '2013-01-12T02:00 +0:00', - 'IP' => array( -'205.154.255.252', -'64.54.222.227', - //Some IPs will be added here Monday - ), - 'dbname' => array( 'enwiki', 'commonswiki' ), - 'value' => 200, // 100 to 150 participants expected -); -// Wikipedia Summit Pune, https://bugzilla.wikimedia.org/show_bug.cgi?id=43856 -$wmfThrottlingExceptions[] = array( - 'from' => '2013-01-12T10:00 +5:30', - 'to' => '2013-01-14T17:00 +5:30', - 'IP' => array( '14.140.227.67', '14.140.227.68' ), - 'dbname' => array( 'enwiki', 'commonswiki' ), - 'value' => 50, -); - -// Israel Edithon https://bugzilla.wikimedia.org/show_bug.cgi?id=44506 -$wmfThrottlingExceptions[] = array( - 'from' => '2013-01-30T00:00 +2:00', - 'to' => '2013-02-01T00:00 +2:00', - 'IP' => '212.25.84.200', - 'dbname' => array( 'frwiki', ), - 'value' => 50, +$wmfThrottlingExceptions[] = array( // Bug 46686 - gu. workshop + 'from' => '2013-03-29T09:00 +0:00', + 'to' => '2013-03-30T05:30 +0:00', + 'IP' => '14.139.122.82', + 'dbname' => array( 'guwiki', ), + 'value' => 100, ); ## Add throttling definitions above. -- To view, visit https://gerrit.wikimedia.org/r/56582 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifaffe3fac771e0222ecd6f07a2d52ea527a839fc Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Dereckson Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Pass the source and target languages as options to proofread... - change (mediawiki...Translate)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/56583 Change subject: Pass the source and target languages as options to proofread, pagemode plugins .. Pass the source and target languages as options to proofread, pagemode plugins Change-Id: Ie83bbb77000a85e28eda3012b55865f0e4235b31 --- M resources/js/ext.translate.messagetable.js M resources/js/ext.translate.pagemode.js M resources/js/ext.translate.proofread.js 3 files changed, 16 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/83/56583/1 diff --git a/resources/js/ext.translate.messagetable.js b/resources/js/ext.translate.messagetable.js index b99457f..ac44493 100644 --- a/resources/js/ext.translate.messagetable.js +++ b/resources/js/ext.translate.messagetable.js @@ -254,7 +254,10 @@ .data( 'message', message ); this.$container.append( $message ); - $message.proofread(); + $message.proofread( { + sourcelangcode: this.$container.data( 'sourcelangcode' ), + targetlangcode: this.$container.data( 'targetlangcode' ) + } ); return $message; }, @@ -267,7 +270,10 @@ .data( 'message', message ); this.$container.append( $message ); - $message.pagemode(); + $message.pagemode( { + sourcelangcode: this.$container.data( 'sourcelangcode' ), + targetlangcode: this.$container.data( 'targetlangcode' ) + } ); }, /** diff --git a/resources/js/ext.translate.pagemode.js b/resources/js/ext.translate.pagemode.js index 3af106e..682dec0 100644 --- a/resources/js/ext.translate.pagemode.js +++ b/resources/js/ext.translate.pagemode.js @@ -1,9 +1,9 @@ ( function ( $, mw ) { 'use strict'; - function PageMode( element ) { + function PageMode( element, options ) { this.$message = $( element ); - this.$messagetable = $( '.tux-messagelist' ); + this.options = options; this.message = this.$message.data( 'message' ); this.init(); this.listen(); @@ -38,9 +38,9 @@ render: function () { var targetLanguage, targetLanguageDir, sourceLanguage, sourceLanguageDir; - sourceLanguage = this.$messagetable.data( 'sourcelangcode' ); + sourceLanguage = this.options.sourcelangcode; sourceLanguageDir = $.uls.data.getDir( sourceLanguage ); - targetLanguage = this.$messagetable.data( 'targetlangcode' ); + targetLanguage = this.options.targetlangcode; targetLanguageDir = $.uls.data.getDir( targetLanguage ); this.$message.append( diff --git a/resources/js/ext.translate.proofread.js b/resources/js/ext.translate.proofread.js index 6af401c..4768e51 100644 --- a/resources/js/ext.translate.proofread.js +++ b/resources/js/ext.translate.proofread.js @@ -98,9 +98,9 @@ } } ); - function Proofread( element ) { + function Proofread( element, options ) { this.$message = $( element ); - this.$container = $( '.tux-messagelist' ); + this.options = options; this.message = this.$message.data( 'message' ); this.init(); this.listen(); @@ -156,9 +156,9 @@ translatedBySelf = ( this.message.properties['last-translator-text'] === mw.user.getName() ); proofreadBySelf = $.inArray( userId, reviewers ) > -1; - sourceLanguage = this.$container.data( 'sourcelangcode' ); + sourceLanguage = this.options.sourcelangcode; sourceLanguageDir = $.uls.data.getDir( sourceLanguage ); - targetLanguage = this.$container.data( 'targetlangcode' ); + targetLanguage = this.options.targetlangcode; targetLanguageDir = $.uls.data.getDir( targetLanguage ); $proofreadAction = $( '' ) -- To view, visit https://gerrit.wikimedia.org/r/56583 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie83bbb77000a85e28eda3012b55865f0e4235b31 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Santhosh ___ MediaWiki-commits mailing list MediaWiki-
[MediaWiki-commits] [Gerrit] Remove unused message translate-nothing-to-do - change (mediawiki...Translate)
Nemo bis has uploaded a new change for review. https://gerrit.wikimedia.org/r/56584 Change subject: Remove unused message translate-nothing-to-do .. Remove unused message translate-nothing-to-do Change-Id: I82012371fd1208024dd06ba62c1d9f53e90bb769 --- M Translate.i18n.php 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/84/56584/1 diff --git a/Translate.i18n.php b/Translate.i18n.php index a95af18..14a57fb 100644 --- a/Translate.i18n.php +++ b/Translate.i18n.php @@ -242,8 +242,6 @@ 'translate-untranslated' => 'Untranslated', 'translate-percentage-complete' => 'Completion', 'translate-percentage-fuzzy' => 'Outdated', - 'translate-nothing-to-do' => 'All possible translations appear to have been made. -You are encouraged to review messages through [[Special:Translate|{{int:translate}}]].', 'translate-languagestats-overall' => 'All message groups together', 'translate-ls-submit' => 'Show statistics', 'translate-ls-column-group' => 'Message group', -- To view, visit https://gerrit.wikimedia.org/r/56584 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I82012371fd1208024dd06ba62c1d9f53e90bb769 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nemo bis ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fix for interpreter - change (mediawiki...Foxway)
Pastakhov has uploaded a new change for review. https://gerrit.wikimedia.org/r/56585 Change subject: fix for interpreter .. fix for interpreter fix syntax error, unexpected T_ENCAPSED_AND_WHITESPACE in echo "foo is $foo\n\n"; Change-Id: I11c28d1e5c055b3d6e2d0659f33256eb4ef95a98 --- M includes/Interpreter.php M tests/phpunit/includes/InterpreterTest.php 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Foxway refs/changes/85/56585/1 diff --git a/includes/Interpreter.php b/includes/Interpreter.php index 2e9ae01..97fbdcf 100644 --- a/includes/Interpreter.php +++ b/includes/Interpreter.php @@ -174,7 +174,7 @@ if( $expectCurlyClose ) { $expected = array( '}' ); } else { - $expected = array( ';' ); + $expected = array( ';', T_ENCAPSED_AND_WHITESPACE ); } if( $expectListParams ) { $expected[] = ','; diff --git a/tests/phpunit/includes/InterpreterTest.php b/tests/phpunit/includes/InterpreterTest.php index 3945b95..27cf316 100644 --- a/tests/phpunit/includes/InterpreterTest.php +++ b/tests/phpunit/includes/InterpreterTest.php @@ -46,6 +46,14 @@ 'foo is foobar' ); $this->assertEquals( + Interpreter::run('echo "foo is {$foo}.";'), + 'foo is foobar.' + ); + $this->assertEquals( + Interpreter::run('echo "foo is $foo\n\n";'), + "foo is foobar\n\n" + ); + $this->assertEquals( Interpreter::run('echo \'foo is $foo\';'), 'foo is $foo' ); -- To view, visit https://gerrit.wikimedia.org/r/56585 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11c28d1e5c055b3d6e2d0659f33256eb4ef95a98 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Foxway Gerrit-Branch: master Gerrit-Owner: Pastakhov ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fix for interpreter - change (mediawiki...Foxway)
Pastakhov has submitted this change and it was merged. Change subject: fix for interpreter .. fix for interpreter fix syntax error, unexpected T_ENCAPSED_AND_WHITESPACE in echo "foo is $foo\n\n"; Change-Id: I11c28d1e5c055b3d6e2d0659f33256eb4ef95a98 --- M includes/Interpreter.php M tests/phpunit/includes/InterpreterTest.php 2 files changed, 9 insertions(+), 1 deletion(-) Approvals: Pastakhov: Verified; Looks good to me, approved diff --git a/includes/Interpreter.php b/includes/Interpreter.php index 2e9ae01..97fbdcf 100644 --- a/includes/Interpreter.php +++ b/includes/Interpreter.php @@ -174,7 +174,7 @@ if( $expectCurlyClose ) { $expected = array( '}' ); } else { - $expected = array( ';' ); + $expected = array( ';', T_ENCAPSED_AND_WHITESPACE ); } if( $expectListParams ) { $expected[] = ','; diff --git a/tests/phpunit/includes/InterpreterTest.php b/tests/phpunit/includes/InterpreterTest.php index 3945b95..27cf316 100644 --- a/tests/phpunit/includes/InterpreterTest.php +++ b/tests/phpunit/includes/InterpreterTest.php @@ -46,6 +46,14 @@ 'foo is foobar' ); $this->assertEquals( + Interpreter::run('echo "foo is {$foo}.";'), + 'foo is foobar.' + ); + $this->assertEquals( + Interpreter::run('echo "foo is $foo\n\n";'), + "foo is foobar\n\n" + ); + $this->assertEquals( Interpreter::run('echo \'foo is $foo\';'), 'foo is $foo' ); -- To view, visit https://gerrit.wikimedia.org/r/56585 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I11c28d1e5c055b3d6e2d0659f33256eb4ef95a98 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Foxway Gerrit-Branch: master Gerrit-Owner: Pastakhov Gerrit-Reviewer: Pastakhov ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused message translate-nothing-to-do - change (mediawiki...Translate)
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused message translate-nothing-to-do .. Remove unused message translate-nothing-to-do Change-Id: I82012371fd1208024dd06ba62c1d9f53e90bb769 --- M Translate.i18n.php 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Santhosh: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/Translate.i18n.php b/Translate.i18n.php index a95af18..14a57fb 100644 --- a/Translate.i18n.php +++ b/Translate.i18n.php @@ -242,8 +242,6 @@ 'translate-untranslated' => 'Untranslated', 'translate-percentage-complete' => 'Completion', 'translate-percentage-fuzzy' => 'Outdated', - 'translate-nothing-to-do' => 'All possible translations appear to have been made. -You are encouraged to review messages through [[Special:Translate|{{int:translate}}]].', 'translate-languagestats-overall' => 'All message groups together', 'translate-ls-submit' => 'Show statistics', 'translate-ls-column-group' => 'Message group', -- To view, visit https://gerrit.wikimedia.org/r/56584 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I82012371fd1208024dd06ba62c1d9f53e90bb769 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nemo bis Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: Santhosh Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix apt-get line to work on ubuntu 12.04 - change (mediawiki...VipsScaler)
J has uploaded a new change for review. https://gerrit.wikimedia.org/r/56586 Change subject: Fix apt-get line to work on ubuntu 12.04 .. Fix apt-get line to work on ubuntu 12.04 Change-Id: I7bbb4bafd1ed5446002956cea8293ed647a9cd8e --- M README 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VipsScaler refs/changes/86/56586/1 diff --git a/README b/README index ef9c588..f28c690 100644 --- a/README +++ b/README @@ -8,7 +8,7 @@ === Debian / Ubuntu === - $ apt-get install vips + $ apt-get install libvips-tools If you want to build from source have a look at upstream documentation: http://www.vips.ecs.soton.ac.uk/index.php?title=Build_on_Ubuntu -- To view, visit https://gerrit.wikimedia.org/r/56586 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7bbb4bafd1ed5446002956cea8293ed647a9cd8e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VipsScaler Gerrit-Branch: master Gerrit-Owner: J ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add jobs for mw/ext/Foxway - change (integration/jenkins-job-builder-config)
Pastakhov has uploaded a new change for review. https://gerrit.wikimedia.org/r/56587 Change subject: Add jobs for mw/ext/Foxway .. Add jobs for mw/ext/Foxway Change-Id: I630423df11beb6f2a75668fcffb68694d436c262 --- M mediawiki-extensions.yaml 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins-job-builder-config refs/changes/87/56587/1 diff --git a/mediawiki-extensions.yaml b/mediawiki-extensions.yaml index 5554830..40de1af 100644 --- a/mediawiki-extensions.yaml +++ b/mediawiki-extensions.yaml @@ -213,6 +213,7 @@ - ExtensionDistributor - FeaturedFeeds - FormPreloadPostCache + - Foxway - FundraiserLandingPage - Gadgets - GeoCrumbs -- To view, visit https://gerrit.wikimedia.org/r/56587 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I630423df11beb6f2a75668fcffb68694d436c262 Gerrit-PatchSet: 1 Gerrit-Project: integration/jenkins-job-builder-config Gerrit-Branch: master Gerrit-Owner: Pastakhov ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (Bug 46687) When user modifies a translation, it should no l... - change (mediawiki...Translate)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/56588 Change subject: (Bug 46687) When user modifies a translation, it should no longer be proofreadable .. (Bug 46687) When user modifies a translation, it should no longer be proofreadable Change-Id: I9218ee8a7dd308babe2f6a78eee1c4846c130367 --- M resources/js/ext.translate.proofread.js 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/88/56588/1 diff --git a/resources/js/ext.translate.proofread.js b/resources/js/ext.translate.proofread.js index 4768e51..7554878 100644 --- a/resources/js/ext.translate.proofread.js +++ b/resources/js/ext.translate.proofread.js @@ -135,6 +135,9 @@ proofread.$message.find( '.tux-proofread-translation' ) .text( translation ); proofread.message.translation = translation; + proofread.$message.addClass( 'own-translation' ); + // Own translations cannot be reviewed, so hide the review button + proofread.hide(); } } ); -- To view, visit https://gerrit.wikimedia.org/r/56588 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9218ee8a7dd308babe2f6a78eee1c4846c130367 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Santhosh ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] install script corrected a few bugs - change (mediawiki...WikiLexicalData)
Kipcool has uploaded a new change for review. https://gerrit.wikimedia.org/r/56589 Change subject: install script corrected a few bugs .. install script corrected a few bugs Change-Id: I0a38d659ce6d93ba57d6ab6d6db388485206a313 --- M Console/databaseTemplate.sql M Console/install.php 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiLexicalData refs/changes/89/56589/1 diff --git a/Console/databaseTemplate.sql b/Console/databaseTemplate.sql index 023e1d3..fbf5e42 100644 --- a/Console/databaseTemplate.sql +++ b/Console/databaseTemplate.sql @@ -145,7 +145,7 @@ KEY /*$wgWDprefix*/versioned_end_spelling (`remove_transaction_id`,`spelling`(255),`expression_id`,`language_id`), KEY /*$wgWDprefix*/versioned_start_expression (`add_transaction_id`,`expression_id`,`language_id`), KEY /*$wgWDprefix*/versioned_start_language (`add_transaction_id`,`language_id`,`expression_id`), - KEY /*$wgWDprefix*/versioned_start_spelling (`add_transaction_id`,`spelling`,`expression_id`,`language_id`) + KEY /*$wgWDprefix*/versioned_start_spelling (`add_transaction_id`,`spelling`,`expression_id`,`language_id`), KEY /*$wgWDprefix*/spelling_idx (`spelling`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; diff --git a/Console/install.php b/Console/install.php index 6dcf675..a844566 100644 --- a/Console/install.php +++ b/Console/install.php @@ -7,6 +7,7 @@ $baseDir = dirname( __FILE__ ) . '/../../..' ; require_once( $baseDir . '/maintenance/Maintenance.php' ); +require_once( $baseDir . '/extensions/WikiLexicalData/OmegaWiki/WikiDataGlobals.php' ); echo "start\n"; -- To view, visit https://gerrit.wikimedia.org/r/56589 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a38d659ce6d93ba57d6ab6d6db388485206a313 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiLexicalData Gerrit-Branch: master Gerrit-Owner: Kipcool ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] install script corrected a few bugs - change (mediawiki...WikiLexicalData)
Kipcool has submitted this change and it was merged. Change subject: install script corrected a few bugs .. install script corrected a few bugs Change-Id: I0a38d659ce6d93ba57d6ab6d6db388485206a313 --- M Console/databaseTemplate.sql M Console/install.php 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Kipcool: Verified; Looks good to me, approved diff --git a/Console/databaseTemplate.sql b/Console/databaseTemplate.sql index 023e1d3..fbf5e42 100644 --- a/Console/databaseTemplate.sql +++ b/Console/databaseTemplate.sql @@ -145,7 +145,7 @@ KEY /*$wgWDprefix*/versioned_end_spelling (`remove_transaction_id`,`spelling`(255),`expression_id`,`language_id`), KEY /*$wgWDprefix*/versioned_start_expression (`add_transaction_id`,`expression_id`,`language_id`), KEY /*$wgWDprefix*/versioned_start_language (`add_transaction_id`,`language_id`,`expression_id`), - KEY /*$wgWDprefix*/versioned_start_spelling (`add_transaction_id`,`spelling`,`expression_id`,`language_id`) + KEY /*$wgWDprefix*/versioned_start_spelling (`add_transaction_id`,`spelling`,`expression_id`,`language_id`), KEY /*$wgWDprefix*/spelling_idx (`spelling`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; diff --git a/Console/install.php b/Console/install.php index 6dcf675..a844566 100644 --- a/Console/install.php +++ b/Console/install.php @@ -7,6 +7,7 @@ $baseDir = dirname( __FILE__ ) . '/../../..' ; require_once( $baseDir . '/maintenance/Maintenance.php' ); +require_once( $baseDir . '/extensions/WikiLexicalData/OmegaWiki/WikiDataGlobals.php' ); echo "start\n"; -- To view, visit https://gerrit.wikimedia.org/r/56589 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a38d659ce6d93ba57d6ab6d6db388485206a313 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiLexicalData Gerrit-Branch: master Gerrit-Owner: Kipcool Gerrit-Reviewer: Kipcool ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Gems needed for tests to run on Windows - change (qa/browsertests)
Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/56590 Change subject: Gems needed for tests to run on Windows .. Gems needed for tests to run on Windows Change-Id: I9832ab808a0adb8e1d552e609c68078cce0ea569 --- M Gemfile.lock 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests refs/changes/90/56590/1 diff --git a/Gemfile.lock b/Gemfile.lock index 56c5aa8..34e9b4a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,7 +17,10 @@ faker (1.1.2) i18n (~> 0.5) ffi (1.6.0) +ffi (1.6.0-x86-mingw32) gherkin (2.11.6) + json (>= 1.7.6) +gherkin (2.11.6-x86-mingw32) json (>= 1.7.6) i18n (0.6.4) json (1.7.7) @@ -49,6 +52,7 @@ PLATFORMS ruby + x86-mingw32 DEPENDENCIES chunky_png -- To view, visit https://gerrit.wikimedia.org/r/56590 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9832ab808a0adb8e1d552e609c68078cce0ea569 Gerrit-PatchSet: 1 Gerrit-Project: qa/browsertests Gerrit-Branch: master Gerrit-Owner: Zfilipin ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] It is useful to sometimes debug problems in Firefox - change (mediawiki...MobileFrontend)
Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/56591 Change subject: It is useful to sometimes debug problems in Firefox .. It is useful to sometimes debug problems in Firefox I need to debug in Firefox right now. Change-Id: Iad85d611fd32232c309145e6ca506cc393005ba4 --- M tests/acceptance/docs/template.md 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/91/56591/1 diff --git a/tests/acceptance/docs/template.md b/tests/acceptance/docs/template.md index 5820395..28ba86d 100644 --- a/tests/acceptance/docs/template.md +++ b/tests/acceptance/docs/template.md @@ -26,6 +26,7 @@ - android - ipad - iphone + - firefox ## bundle exec -- To view, visit https://gerrit.wikimedia.org/r/56591 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad85d611fd32232c309145e6ca506cc393005ba4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Zfilipin ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (Bug 45766) - [TUX] Expired edit token is not refreshed - change (mediawiki...Translate)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/56592 Change subject: (Bug 45766) - [TUX] Expired edit token is not refreshed .. (Bug 45766) - [TUX] Expired edit token is not refreshed Use the postWithEditToken api method to post. It will take care of expired/invalid tokens. Change-Id: I2bc6724cee387c8f849aa7903d968548ae39c848 --- M Resources.php M resources/js/ext.translate.editor.js 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/92/56592/1 diff --git a/Resources.php b/Resources.php index aa3bd2c..75a1172 100644 --- a/Resources.php +++ b/Resources.php @@ -45,6 +45,7 @@ 'mediawiki.util', 'mediawiki.Uri', 'mediawiki.api', + 'mediawiki.api.edit', 'mediawiki.api.parse', 'mediawiki.user', 'mediawiki.jqueryMsg', diff --git a/resources/js/ext.translate.editor.js b/resources/js/ext.translate.editor.js index ed130fe..b35d240 100644 --- a/resources/js/ext.translate.editor.js +++ b/resources/js/ext.translate.editor.js @@ -129,12 +129,11 @@ // immediately move to the next message. translateEditor.next(); - api.post( { + api.postWithEditToken( { action: 'edit', title: translateEditor.message.title, text: translation, - token: mw.user.tokens.get( 'editToken' ) - } ).done( function ( response ) { + }, function ( response ) { if ( response.edit.result === 'Success' ) { translateEditor.markTranslated(); @@ -162,7 +161,7 @@ } mw.translate.dirty = false; - } ).fail( function ( errorCode, results ) { + }, function ( errorCode, results ) { translateEditor.savingError( results.error.info ); translateEditor.saving = false; -- To view, visit https://gerrit.wikimedia.org/r/56592 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2bc6724cee387c8f849aa7903d968548ae39c848 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Santhosh ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] beta: restore commonswiki - change (operations/mediawiki-config)
Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/56593 Change subject: beta: restore commonswiki .. beta: restore commonswiki A few days ago, I have reduced the number of wikis on beta (see bug 46104, gerrit https://gerrit.wikimedia.org/r/#/c/55889/ ). commonswiki has indeed been removed there but we do need it for testing purposes. That prevented MobileFrontend users from login on the wiki (bug 46649). Change-Id: I880b05c868dc461d88806c460db78a3366de6083 --- M all-labs.dblist M wikiversions-labs.dat 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/93/56593/1 diff --git a/all-labs.dblist b/all-labs.dblist index 4ce325d..4fc6ae5 100644 --- a/all-labs.dblist +++ b/all-labs.dblist @@ -1,4 +1,5 @@ aawiki +commonswiki dewiki dewikivoyage ee_prototypewiki diff --git a/wikiversions-labs.dat b/wikiversions-labs.dat index 5f38fee..98d2c30 100644 --- a/wikiversions-labs.dat +++ b/wikiversions-labs.dat @@ -1,4 +1,5 @@ aawiki php-master +commonswiki dewiki php-master dewikivoyage php-master ee_prototypewiki php-master -- To view, visit https://gerrit.wikimedia.org/r/56593 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I880b05c868dc461d88806c460db78a3366de6083 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Hashar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] beta: restore commonswiki - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: beta: restore commonswiki .. beta: restore commonswiki A few days ago, I have reduced the number of wikis on beta (see bug 46104, gerrit https://gerrit.wikimedia.org/r/#/c/55889/ ). commonswiki has indeed been removed there but we do need it for testing purposes. That prevented MobileFrontend users from login on the wiki (bug 46649). Change-Id: I880b05c868dc461d88806c460db78a3366de6083 --- M all-labs.dblist M wikiversions-labs.dat 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/all-labs.dblist b/all-labs.dblist index 4ce325d..4fc6ae5 100644 --- a/all-labs.dblist +++ b/all-labs.dblist @@ -1,4 +1,5 @@ aawiki +commonswiki dewiki dewikivoyage ee_prototypewiki diff --git a/wikiversions-labs.dat b/wikiversions-labs.dat index 5f38fee..98d2c30 100644 --- a/wikiversions-labs.dat +++ b/wikiversions-labs.dat @@ -1,4 +1,5 @@ aawiki php-master +commonswiki dewiki php-master dewikivoyage php-master ee_prototypewiki php-master -- To view, visit https://gerrit.wikimedia.org/r/56593 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I880b05c868dc461d88806c460db78a3366de6083 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Hashar Gerrit-Reviewer: Hashar Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] beta: commonswiki was missing the MediaWiki version - change (operations/mediawiki-config)
Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/56594 Change subject: beta: commonswiki was missing the MediaWiki version .. beta: commonswiki was missing the MediaWiki version Change-Id: I2a9d8fce2f7e3e183a0e80540b865c010cdf0615 --- M wikiversions-labs.dat 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/94/56594/1 diff --git a/wikiversions-labs.dat b/wikiversions-labs.dat index 98d2c30..3cb3840 100644 --- a/wikiversions-labs.dat +++ b/wikiversions-labs.dat @@ -1,5 +1,5 @@ aawiki php-master -commonswiki +commonswiki php-master dewiki php-master dewikivoyage php-master ee_prototypewiki php-master -- To view, visit https://gerrit.wikimedia.org/r/56594 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2a9d8fce2f7e3e183a0e80540b865c010cdf0615 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Hashar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] beta: commonswiki was missing the MediaWiki version - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: beta: commonswiki was missing the MediaWiki version .. beta: commonswiki was missing the MediaWiki version Change-Id: I2a9d8fce2f7e3e183a0e80540b865c010cdf0615 --- M wikiversions-labs.dat 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/wikiversions-labs.dat b/wikiversions-labs.dat index 98d2c30..3cb3840 100644 --- a/wikiversions-labs.dat +++ b/wikiversions-labs.dat @@ -1,5 +1,5 @@ aawiki php-master -commonswiki +commonswiki php-master dewiki php-master dewikivoyage php-master ee_prototypewiki php-master -- To view, visit https://gerrit.wikimedia.org/r/56594 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2a9d8fce2f7e3e183a0e80540b865c010cdf0615 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Hashar Gerrit-Reviewer: Hashar Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Store null for width/height in MWImageNode when value not set. - change (mediawiki...VisualEditor)
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/56595 Change subject: Store null for width/height in MWImageNode when value not set. .. Store null for width/height in MWImageNode when value not set. Using element.height was returning 0 if the attribute was empty when in fact what we mean to store is null (i.e. auto height). This takes care of the writing of attributes in CE as jQuery ignores an attribute-set command if the value is null. Bug: 56336 Change-Id: I297a1d0a07e9ebf9d0110fb1cdf266f8415f25b7 --- M modules/ve/dm/nodes/ve.dm.MWImageNode.js 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/95/56595/1 diff --git a/modules/ve/dm/nodes/ve.dm.MWImageNode.js b/modules/ve/dm/nodes/ve.dm.MWImageNode.js index 6601c84..a9bf9ab 100644 --- a/modules/ve/dm/nodes/ve.dm.MWImageNode.js +++ b/modules/ve/dm/nodes/ve.dm.MWImageNode.js @@ -31,12 +31,16 @@ ve.dm.MWImageNode.static.matchRdfaTypes = [ 'mw:Image' ]; ve.dm.MWImageNode.static.toDataElement = function ( domElements ) { + var $node = $(domElements[0].childNodes[0]), + width = $node.attr('width'), + height = $node.attr('height'); + return { 'type': 'MWimage', 'attributes': { - 'src': domElements[0].childNodes[0].src, - 'width': domElements[0].childNodes[0].width, - 'height': domElements[0].childNodes[0].height + 'src': $node.attr('src'), + 'width': width !== '' ? Number(width) : null, + 'height': height !== '' ? Number(height) : null } }; }; -- To view, visit https://gerrit.wikimedia.org/r/56595 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I297a1d0a07e9ebf9d0110fb1cdf266f8415f25b7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] OpenSearch: Error for unsupported formats and adding format=... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: OpenSearch: Error for unsupported formats and adding format=jsonfm .. OpenSearch: Error for unsupported formats and adding format=jsonfm Previously it would just completely ignore the format parameter. Making it always serve JSON no matter the value of the format parameter. Now it properly errors when doing (for example) format=txt or format=xml. Also adding support for jsonfm. Change-Id: Ia98f54f41f39006312fb49ecd718f0f161f27c37 --- M RELEASE-NOTES-1.21 M includes/api/ApiOpenSearch.php 2 files changed, 20 insertions(+), 3 deletions(-) Approvals: Anomie: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index ecb37d5..f8ce4a2 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -284,6 +284,8 @@ * The JSON output formatter now leaves forward slashes unescaped to improve human readability of URLs and similar strings. Also, a "utf8" option is now provided to use UTF-8 encoding instead of hex escape codes for most non-ASCII characters. +* action=opensearch no longer silently ignores the format parameter. +* action=opensearch now supports format=jsonfm. === API internal changes in 1.21 === * For debugging only, a new global $wgDebugAPI removes many API restrictions when true. diff --git a/includes/api/ApiOpenSearch.php b/includes/api/ApiOpenSearch.php index caf361a..315ace3 100644 --- a/includes/api/ApiOpenSearch.php +++ b/includes/api/ApiOpenSearch.php @@ -1,7 +1,5 @@ @gmail.com" @@ -29,8 +27,20 @@ */ class ApiOpenSearch extends ApiBase { + /** +* Override built-in handling of format parameter. +* Only JSON is supported. +* +* @return ApiFormatBase +*/ public function getCustomPrinter() { - return $this->getMain()->createPrinterByName( 'json' ); + $params = $this->extractRequestParams(); + $format = $params['format']; + $allowed = array( 'json', 'jsonfm' ); + if ( in_array( $format, $allowed ) ) { + return $this->getMain()->createPrinterByName( $format ); + } + return $this->getMain()->createPrinterByName( $allowed[0] ); } public function execute() { @@ -94,6 +104,10 @@ ApiBase::PARAM_ISMULTI => true ), 'suggest' => false, + 'format' => array( + ApiBase::PARAM_DFLT => 'json', + ApiBase::PARAM_TYPE => array( 'json', 'jsonfm' ), + ) ); } @@ -103,6 +117,7 @@ 'limit' => 'Maximum amount of results to return', 'namespace' => 'Namespaces to search', 'suggest' => 'Do nothing if $wgEnableOpenSearchSuggest is false', + 'format' => 'The format of the output', ); } -- To view, visit https://gerrit.wikimedia.org/r/56320 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia98f54f41f39006312fb49ecd718f0f161f27c37 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle Gerrit-Reviewer: Anomie Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Reedy Gerrit-Reviewer: Yurik Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug 46635) Recognize Windows path+drive letter - change (mediawiki...Scribunto)
Anomie has uploaded a new change for review. https://gerrit.wikimedia.org/r/56596 Change subject: (bug 46635) Recognize Windows path+drive letter .. (bug 46635) Recognize Windows path+drive letter The logic for recognizing absolute versus relative paths needs to take into account the possibility of a Windows drive letter. Bug: 46635 Change-Id: I3a43acac2f6e8b481807e1babe5a261b9eb1fe23 --- M engines/LuaCommon/LuaCommon.php 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Scribunto refs/changes/96/56596/1 diff --git a/engines/LuaCommon/LuaCommon.php b/engines/LuaCommon/LuaCommon.php index 703734f..81a303e 100644 --- a/engines/LuaCommon/LuaCommon.php +++ b/engines/LuaCommon/LuaCommon.php @@ -131,14 +131,18 @@ } /** -* Normalize a lua module to its full path. If path does not begin with "/", -* prepend getLuaLibDir() +* Normalize a lua module to its full path. If path does not look like an +* absolute path (i.e. begins with DIRECTORY_SEPARATOR or "X:"), prepend +* getLuaLibDir() * * @param $file String name of the lua module file * @return string */ protected function normalizeModuleFileName( $fileName ) { - return $fileName[0] !== DIRECTORY_SEPARATOR ? "{$this->getLuaLibDir()}/{$fileName}" : $fileName; + if ( !preg_match( '<^(?:[a-zA-Z]:)?' . DIRECTORY_SEPARATOR . '>', $fileName ) ) { + $fileName = "{$this->getLuaLibDir()}/{$fileName}"; + } + return $fileName; } /** -- To view, visit https://gerrit.wikimedia.org/r/56596 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3a43acac2f6e8b481807e1babe5a261b9eb1fe23 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Scribunto Gerrit-Branch: master Gerrit-Owner: Anomie ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add Scribunto as SMW testextensions dependency - change (integration/jenkins-job-builder-config)
Hashar has submitted this change and it was merged. Change subject: Add Scribunto as SMW testextensions dependency .. Add Scribunto as SMW testextensions dependency Without this dependency Scribunto_LuaEngineTestBase is an unknown class and will fail the SMW\Test\PropertyLibraryTest [1] [1] https://gerrit.wikimedia.org/r/#/c/56393/ Change-Id: I66c51ecb15f6e4dba82c9633aeda609a9adb1e3e --- M mediawiki-extensions.yaml 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Hashar: Verified; Looks good to me, approved diff --git a/mediawiki-extensions.yaml b/mediawiki-extensions.yaml index 5554830..6db9cce 100644 --- a/mediawiki-extensions.yaml +++ b/mediawiki-extensions.yaml @@ -391,7 +391,7 @@ - '{name}-{ext-name}-testextensions-{mwbranch}': name: mwext ext-name: SemanticMediaWiki -dependencies: 'DataValues,Validator' +dependencies: 'DataValues,Validator,Scribunto' - '{name}-{ext-name}-testextensions-{mwbranch}': name: mwext ext-name: TranslationNotifications -- To view, visit https://gerrit.wikimedia.org/r/56570 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I66c51ecb15f6e4dba82c9633aeda609a9adb1e3e Gerrit-PatchSet: 2 Gerrit-Project: integration/jenkins-job-builder-config Gerrit-Branch: master Gerrit-Owner: Mwjames Gerrit-Reviewer: Hashar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations-debs-python-voluptuous-debbuild non voting - change (integration/zuul-config)
Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/56597 Change subject: operations-debs-python-voluptuous-debbuild non voting .. operations-debs-python-voluptuous-debbuild non voting Change-Id: I829d7e2cd5a433c5d2151b57103fe0ffe85c5cc8 --- M layout.yaml 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/zuul-config refs/changes/97/56597/1 diff --git a/layout.yaml b/layout.yaml index 0be0d75..d7eab14 100644 --- a/layout.yaml +++ b/layout.yaml @@ -345,6 +345,9 @@ - name: ^mwext-TranslationNotifications-testextensions.* voting: false + - name: ^operations-debs-python-voluptuous-debbuild.* +voting: false + # New Parsoid tests (not yet merged in jenkins-job-builder-config) # Still being developed, non-voting for now. - name: ^parsoid-server-sanity-check$ -- To view, visit https://gerrit.wikimedia.org/r/56597 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I829d7e2cd5a433c5d2151b57103fe0ffe85c5cc8 Gerrit-PatchSet: 1 Gerrit-Project: integration/zuul-config Gerrit-Branch: master Gerrit-Owner: Hashar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations-debs-python-voluptuous-debbuild non voting - change (integration/zuul-config)
Hashar has submitted this change and it was merged. Change subject: operations-debs-python-voluptuous-debbuild non voting .. operations-debs-python-voluptuous-debbuild non voting Change-Id: I829d7e2cd5a433c5d2151b57103fe0ffe85c5cc8 --- M layout.yaml 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Hashar: Verified; Looks good to me, approved diff --git a/layout.yaml b/layout.yaml index 42267cb..2f9ee5b 100644 --- a/layout.yaml +++ b/layout.yaml @@ -345,6 +345,9 @@ - name: ^mwext-TranslationNotifications-testextensions.* voting: false + - name: ^operations-debs-python-voluptuous-debbuild.* +voting: false + # New Parsoid tests (not yet merged in jenkins-job-builder-config) # Still being developed, non-voting for now. - name: ^parsoid-server-sanity-check$ -- To view, visit https://gerrit.wikimedia.org/r/56597 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I829d7e2cd5a433c5d2151b57103fe0ffe85c5cc8 Gerrit-PatchSet: 2 Gerrit-Project: integration/zuul-config Gerrit-Branch: master Gerrit-Owner: Hashar Gerrit-Reviewer: Hashar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Urgent fix: Provide greater expect-ations (fix breaking tests) - change (mediawiki...MobileFrontend)
JGonera has submitted this change and it was merged. Change subject: Urgent fix: Provide greater expect-ations (fix breaking tests) .. Urgent fix: Provide greater expect-ations (fix breaking tests) Make use of expect in qunit tests (see change I214b3d4da46f3f3bb0fcde313ac2d82439e40e3c) Avoid using module and test as a global (All tests are currently failing with latest core so please merge this asap) Change-Id: I545cd1520ac4b0f945b71f76479473bcebe66573 --- M .jshintrc M tests/js/common/mf-navigation.js M tests/js/specials/mobilediff.js M tests/js/specials/uploads.js M tests/js/test_application.js M tests/js/test_banner.js M tests/js/test_beta_opensearch.js M tests/js/test_eventemitter.js M tests/js/test_mf-api.js M tests/js/test_mf-edit.js M tests/js/test_mf-history.js M tests/js/test_mf-last-modified.js M tests/js/test_mf-oop.js M tests/js/test_mf-photo.js M tests/js/test_mf-view.js M tests/js/test_mf-watchstar.js M tests/js/test_references.js M tests/js/test_settings.js M tests/js/test_toggle.js M tests/js/widgets/test_progress-bar.js 20 files changed, 109 insertions(+), 108 deletions(-) Approvals: JGonera: Verified; Looks good to me, approved diff --git a/.jshintrc b/.jshintrc index 3975b29..9093094 100644 --- a/.jshintrc +++ b/.jshintrc @@ -8,11 +8,8 @@ "mw": true, "mwMobileFrontendConfig": true, - "module": true, "strictEqual": true, "deepEqual": true, - "throws": true, - "test": true, "ok": true, "sinon": true }, diff --git a/tests/js/common/mf-navigation.js b/tests/js/common/mf-navigation.js index 378c5f6..57d9255 100644 --- a/tests/js/common/mf-navigation.js +++ b/tests/js/common/mf-navigation.js @@ -1,15 +1,15 @@ ( function( nav, $ ) { -module( 'MobileFrontend: mf-navigation.js', {} ); +QUnit.module( 'MobileFrontend: mf-navigation.js' ); -test( 'Simple overlay', function() { +QUnit.test( 'Simple overlay', 2, function() { var overlay = new nav.Overlay( { heading: 'Title', content: 'Text' } ); overlay.show(); strictEqual( overlay.$el[0].parentNode, document.body, 'In DOM' ); strictEqual( overlay.$el.html(), 'Title/Text' ); } ); -test( 'HTML overlay', function() { +QUnit.test( 'HTML overlay', 1, function() { var overlay = new nav.Overlay( { heading: 'Awesome: ', content: 'YO' @@ -17,14 +17,14 @@ strictEqual( overlay.$el.html(), 'Awesome: /YO' ); } ); -test( 'Close overlay', function() { +QUnit.test( 'Close overlay', 1, function() { var overlay = new nav.Overlay( { heading: 'Title', content: 'Text' } ); overlay.show(); overlay.hide(); strictEqual( overlay.$el[0].parentNode, null, 'No longer in DOM' ); } ); -test( 'Stacked overlays', function() { +QUnit.test( 'Stacked overlays', 6, function() { var overlay = new nav.Overlay( { heading: 'Overlay 1', content: 'Text' } ), overlayTwo = new nav.Overlay( { heading: 'Overlay 2', content: 'Text cancel', parent: overlay } ); diff --git a/tests/js/specials/mobilediff.js b/tests/js/specials/mobilediff.js index e209abf..502c438 100644 --- a/tests/js/specials/mobilediff.js +++ b/tests/js/specials/mobilediff.js @@ -2,9 +2,9 @@ var m = M.require( 'diff' ); -module( 'MobileFrontend: mobilediff.js', {} ); +QUnit.module( 'MobileFrontend: mobilediff.js' ); -test( 'makePrettyDiff', function() { +QUnit.test( 'makePrettyDiff', function() { var testCases = [ [ $( 'foo' ), 'foo' ], [ @@ -25,6 +25,7 @@ ] ]; + QUnit.expect( testCases.length ); $.each( testCases, function( i, test ) { strictEqual( m.makePrettyDiff( test[0] ).html(), test[1], 'Test case ' + i ); } ); diff --git a/tests/js/specials/uploads.js b/tests/js/specials/uploads.js index 25519d8..52031e2 100644 --- a/tests/js/specials/uploads.js +++ b/tests/js/specials/uploads.js @@ -1,15 +1,16 @@ ( function ( M, $ ) { var m = M.require( 'userGallery' ); -module( 'MobileFrontend donate image' ); +QUnit.module( 'MobileFrontend donate image' ); -test( 'extractDescription', function() { +QUnit.test( 'extractDescription', function() { var tests = [ [ '== {{int:filedesc}} ==\nHello world', 'Hello world' ], [ '==Foo 1==\nbar 1\n==Foo 2==\nbar 2\n== {{int:filedesc}} ==\npicture of cat\n', 'picture of cat' ], [ '==Foo 1==\nbar 1\n== {{int:filedesc}} ==\npicture of dog\n==Foo 2==\nbar 2\n', 'picture of dog' ], [ '== Yo ==\nother text', '' ] ]; + QUnit.expect( tests.length ); $( tests ).each( function( i ) { var val = m.extractDescription( this[0] ); st
[MediaWiki-commits] [Gerrit] Initial commit. Second try. - change (mediawiki...OdbcDatabase)
Chiefgeek157 has uploaded a new change for review. https://gerrit.wikimedia.org/r/56598 Change subject: Initial commit. Second try. .. Initial commit. Second try. Change-Id: I4599f4d2605eb106ef323abe5cf2ec262b03b67c --- A OdbcDatabase.aliases.php A OdbcDatabase.body.php A OdbcDatabase.i18n.php A OdbcDatabase.php A README 5 files changed, 493 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OdbcDatabase refs/changes/98/56598/1 diff --git a/OdbcDatabase.aliases.php b/OdbcDatabase.aliases.php new file mode 100644 index 000..02b193c --- /dev/null +++ b/OdbcDatabase.aliases.php @@ -0,0 +1,13 @@ + array( 'OdbcDatabase' ) +); + diff --git a/OdbcDatabase.body.php b/OdbcDatabase.body.php new file mode 100644 index 000..484355c --- /dev/null +++ b/OdbcDatabase.body.php @@ -0,0 +1,384 @@ +mConn, $sql ); + if ( $res ) { + $this->mAffectedRows = odbc_num_rows( $res ); + $res = new ResultWrapper( $this, $res ); + $this->mRowNum = 0; + } + return $res; + } + + /** +* @param $server string +* @param $user string +* @param $password string +* @param $dbName string +* @return bool +* @throws DBConnectionError +*/ + function open( $server, $user, $password, $dbName ) { + if ( !function_exists( 'odbc_connect' ) ) { + throw new DBConnectionError( $this, wfMessage( 'odbcdatabase-odbc-missing' ) . "\n" ); + } + + $success = false; + + $this->close(); + $this->mServer = $server; + $this->mUser = $user; + $this->mPassword = $password; + $this->mDBname = $dbName; + + $this->mConn = odbc_connect( $server, $user, $password ); + + if ( !$this->mConn ) { + $error = $this->lastError(); + if ( !$error ) { + $error = $phpError; + } + wfLogDBError( wfMessage( 'odbcdatabase-connection-error', $this->mServer, $error ) . "\n" ); + } else { + $success = true; + } + + $this->mOpened = $success; + return $success; + } + + /** +* @return bool +*/ + function closeConnection() { + if ( $this->mConn ) { + return odbc_close( $this->mConn ); + } else { + return true; + } + } + + /** +* @param $res ResultWrapper +* @throws DBUnexpectedError +*/ + function freeResult( $res ) { + if ( $res instanceof ResultWrapper ) { + $res->free(); + } else { + $ok = odbc_free_result( $res ); + if ( !$ok ) { + throw new DBUnexpectedError( $this, wfMessage( 'odbcdatabase-free-error' ) . "\n" ); + } + } + $this->mAffectedRows = 0; + $this->mRowNum = 0; + } + + /** +* @param $res ResultWrapper +* @return object|stdClass +* @throws DBUnexpectedError +*/ + function fetchObject( $res ) { + if ( $res instanceof ResultWrapper ) { + $res = $res->result; + } + $row = odbc_fetch_object( $res ); + if ( $row ) { + $this->mRowNum++; + } else if ( $this->mRowNum <= $this->mAffectedRows ) { + if( $this->lastErrno() ) { + throw new DBUnexpectedError( $this, wfMessage( 'odbcdatabase-fetch-object-error', $this->lastErrno(), htmlspecialchars( $this->lastError() ) ) ); + } + } + return $row; + } + + /** +* @param $res ResultWrapper +* @return array +* @throws DBUnexpectedError +*/ + function fetchRow( $res ) { + if ( $res instanceof ResultWrapper ) { + $res = $res->result; + } + + $array = null; + $row = odbc_fetch_row( $res ); + if ( $row ) { + $this->mRowNum++; + $nCols = odbc_num_fields( $res ); + for ( $i = 0; $i < $nCols; $i++ ) { + $array[$i] = odbc_result( $res, $i+1 ); + } + } else if ( $this->mRowNum <= $this->mAffectedRows ) { + if ( $this->lastErrno() ) { + throw new DBUnexpectedError( $thi
[MediaWiki-commits] [Gerrit] Initial commit. Second try. - change (mediawiki...OdbcDatabase)
Chiefgeek157 has submitted this change and it was merged. Change subject: Initial commit. Second try. .. Initial commit. Second try. Change-Id: I4599f4d2605eb106ef323abe5cf2ec262b03b67c --- A OdbcDatabase.aliases.php A OdbcDatabase.body.php A OdbcDatabase.i18n.php A OdbcDatabase.php A README 5 files changed, 493 insertions(+), 0 deletions(-) Approvals: Chiefgeek157: Verified; Looks good to me, approved diff --git a/OdbcDatabase.aliases.php b/OdbcDatabase.aliases.php new file mode 100644 index 000..02b193c --- /dev/null +++ b/OdbcDatabase.aliases.php @@ -0,0 +1,13 @@ + array( 'OdbcDatabase' ) +); + diff --git a/OdbcDatabase.body.php b/OdbcDatabase.body.php new file mode 100644 index 000..484355c --- /dev/null +++ b/OdbcDatabase.body.php @@ -0,0 +1,384 @@ +mConn, $sql ); + if ( $res ) { + $this->mAffectedRows = odbc_num_rows( $res ); + $res = new ResultWrapper( $this, $res ); + $this->mRowNum = 0; + } + return $res; + } + + /** +* @param $server string +* @param $user string +* @param $password string +* @param $dbName string +* @return bool +* @throws DBConnectionError +*/ + function open( $server, $user, $password, $dbName ) { + if ( !function_exists( 'odbc_connect' ) ) { + throw new DBConnectionError( $this, wfMessage( 'odbcdatabase-odbc-missing' ) . "\n" ); + } + + $success = false; + + $this->close(); + $this->mServer = $server; + $this->mUser = $user; + $this->mPassword = $password; + $this->mDBname = $dbName; + + $this->mConn = odbc_connect( $server, $user, $password ); + + if ( !$this->mConn ) { + $error = $this->lastError(); + if ( !$error ) { + $error = $phpError; + } + wfLogDBError( wfMessage( 'odbcdatabase-connection-error', $this->mServer, $error ) . "\n" ); + } else { + $success = true; + } + + $this->mOpened = $success; + return $success; + } + + /** +* @return bool +*/ + function closeConnection() { + if ( $this->mConn ) { + return odbc_close( $this->mConn ); + } else { + return true; + } + } + + /** +* @param $res ResultWrapper +* @throws DBUnexpectedError +*/ + function freeResult( $res ) { + if ( $res instanceof ResultWrapper ) { + $res->free(); + } else { + $ok = odbc_free_result( $res ); + if ( !$ok ) { + throw new DBUnexpectedError( $this, wfMessage( 'odbcdatabase-free-error' ) . "\n" ); + } + } + $this->mAffectedRows = 0; + $this->mRowNum = 0; + } + + /** +* @param $res ResultWrapper +* @return object|stdClass +* @throws DBUnexpectedError +*/ + function fetchObject( $res ) { + if ( $res instanceof ResultWrapper ) { + $res = $res->result; + } + $row = odbc_fetch_object( $res ); + if ( $row ) { + $this->mRowNum++; + } else if ( $this->mRowNum <= $this->mAffectedRows ) { + if( $this->lastErrno() ) { + throw new DBUnexpectedError( $this, wfMessage( 'odbcdatabase-fetch-object-error', $this->lastErrno(), htmlspecialchars( $this->lastError() ) ) ); + } + } + return $row; + } + + /** +* @param $res ResultWrapper +* @return array +* @throws DBUnexpectedError +*/ + function fetchRow( $res ) { + if ( $res instanceof ResultWrapper ) { + $res = $res->result; + } + + $array = null; + $row = odbc_fetch_row( $res ); + if ( $row ) { + $this->mRowNum++; + $nCols = odbc_num_fields( $res ); + for ( $i = 0; $i < $nCols; $i++ ) { + $array[$i] = odbc_result( $res, $i+1 ); + } + } else if ( $this->mRowNum <= $this->mAffectedRows ) { + if ( $this->lastErrno() ) { + throw new DBUnexpectedError( $this, wfMessage( 'odbcdatabase-fetch-row-error', $this->lastErrno(), html
[MediaWiki-commits] [Gerrit] Regression: Stop low res main menu icon from 404ing due to move - change (mediawiki...MobileFrontend)
JGonera has submitted this change and it was merged. Change subject: Regression: Stop low res main menu icon from 404ing due to move .. Regression: Stop low res main menu icon from 404ing due to move Follow up to I4365f914f95a8b4d1f2d9ab2e37614e835cc2fc5 Change-Id: Id95b18a22fac371b1e0aa7682e18be073305ed2c --- R stylesheets/common/images/menu/lowres/main.png 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: JGonera: Verified; Looks good to me, approved diff --git a/stylesheets/specials/images/menu/lowres/main.png b/stylesheets/common/images/menu/lowres/main.png similarity index 100% rename from stylesheets/specials/images/menu/lowres/main.png rename to stylesheets/common/images/menu/lowres/main.png Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/56358 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id95b18a22fac371b1e0aa7682e18be073305ed2c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson Gerrit-Reviewer: JGonera Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Extent $allowedGlobals in Scribunto_LuaCommonTests - change (mediawiki...Scribunto)
Mwjames has uploaded a new change for review. https://gerrit.wikimedia.org/r/56599 Change subject: Extent $allowedGlobals in Scribunto_LuaCommonTests .. Extent $allowedGlobals in Scribunto_LuaCommonTests Without this extension tests will fail with "The following globals are leaked: smw " [1] SMW uses its own namespace as an external library to declare methods such as smw.property.getPropertyType etc. It would be better to have a public setter to allow to specify an additional global and having tests also recognizing it without the need to tight it up. [1] https://gerrit.wikimedia.org/r/#/c/56393/ Change-Id: I9e311dfd657ce32bbadb389774aa80eae4089807 --- M tests/engines/LuaCommon/CommonTest.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Scribunto refs/changes/99/56599/1 diff --git a/tests/engines/LuaCommon/CommonTest.php b/tests/engines/LuaCommon/CommonTest.php index 87ec0af..90e2747 100644 --- a/tests/engines/LuaCommon/CommonTest.php +++ b/tests/engines/LuaCommon/CommonTest.php @@ -31,6 +31,7 @@ 'debug', 'math', 'mw', + 'smw', 'os', 'package', 'string', -- To view, visit https://gerrit.wikimedia.org/r/56599 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e311dfd657ce32bbadb389774aa80eae4089807 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Scribunto Gerrit-Branch: master Gerrit-Owner: Mwjames ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Reimported Upstream version 1.5.8 - change (operations...python-statsd)
Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/56600 Change subject: Reimported Upstream version 1.5.8 .. Reimported Upstream version 1.5.8 The previous import has been made using the pypip tarball which is slightly different from the one generated by github. Thus I have reimported the proper tarball. Change-Id: I158e452311a27f82d322e78177f2c1468becf130 --- A .gitignore A .travis.yml A LICENSE D PKG-INFO A docs/Makefile A docs/conf.py A docs/index.rst A docs/make.bat A docs/statsd.client.rst A docs/statsd.connection.rst A docs/statsd.counter.rst A docs/statsd.gauge.rst A docs/statsd.raw.rst A docs/statsd.rst A docs/statsd.timer.rst A docs/usage.rst D python_statsd.egg-info/PKG-INFO D python_statsd.egg-info/SOURCES.txt D python_statsd.egg-info/dependency_links.txt D python_statsd.egg-info/top_level.txt M setup.cfg A tests/__init__.py A tests/test_connection.py A tests/test_counter.py A tests/test_gauge.py A tests/test_timer.py A tox.ini 27 files changed, 766 insertions(+), 365 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/python-statsd refs/changes/00/56600/1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..f5c5fdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*.pyc +build +dist +*.egg-info +*.egg +.tox + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000..2d1e3ed --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: python +python: + - "2.5" + - "2.6" + - "2.7" +# command to install dependencies +install: + - pip install . --use-mirrors +# command to run tests +script: python setup.py nosetests diff --git a/LICENSE b/LICENSE new file mode 100644 index 000..6947f9f --- /dev/null +++ b/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2013, Rick van Hattem +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. +Neither the name of the nor the names of its contributors may be +used to endorse or promote products derived from this software without specific +prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/PKG-INFO b/PKG-INFO deleted file mode 100644 index 2520973..000 --- a/PKG-INFO +++ /dev/null @@ -1,169 +0,0 @@ -Metadata-Version: 1.1 -Name: python-statsd -Version: 1.5.8 -Summary: statsd is a client for Etsy's node-js statsd server. A proxy for the Graphite stats collection and graphing server. -Home-page: https://github.com/WoLpH/python-statsd -Author: Rick van Hattem -Author-email: rick.van.hat...@fawo.nl -License: BSD -Description: Introduction - - -`statsd` is a client for Etsy's statsd server, a front end/proxy for the -Graphite stats collection and graphing server. - -* Graphite -- http://graphite.wikidot.com -* Statsd -- code: https://github.com/etsy/statsd -- blog post: http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/ - - -Install -=== - -To install simply execute `python setup.py install`. -If you want to run the tests first, run `python setup.py nosetests` - - -Usage -= - -To get started real quick, just try something like this: - -Basic Usage ---- - -Timers -^^ - ->>> import statsd ->>> ->>> timer = statsd.Timer('MyApplication') ->>> ->>> timer.start() ->>> # do something here ->>> timer.stop('SomeTimer') - - -Counters - - ->>> import statsd ->>> -
[MediaWiki-commits] [Gerrit] fixing script to use /var/run/icinga - change (operations/puppet)
Lcarr has uploaded a new change for review. https://gerrit.wikimedia.org/r/56601 Change subject: fixing script to use /var/run/icinga .. fixing script to use /var/run/icinga Change-Id: I43b73c6bc2328e70fdd506483ff3c6f8d53e1053 --- M files/icinga/nagios-nrpe-server-init 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/01/56601/1 diff --git a/files/icinga/nagios-nrpe-server-init b/files/icinga/nagios-nrpe-server-init index 02a153f..1af139a 100755 --- a/files/icinga/nagios-nrpe-server-init +++ b/files/icinga/nagios-nrpe-server-init @@ -18,7 +18,7 @@ NAME=nagios-nrpe DESC=nagios-nrpe CONFIG=/etc/icinga/nrpe.cfg -PIDDIR=/var/run/nagios +PIDDIR=/var/run/icinga test -x $DAEMON || exit 0 @@ -43,7 +43,7 @@ #since /var/run can be wiped completly we create our run directory here if [ ! -d "$PIDDIR" ]; then mkdir "$PIDDIR" - chown nagios "$PIDDIR" + chown icinga "$PIDDIR" fi set -e -- To view, visit https://gerrit.wikimedia.org/r/56601 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43b73c6bc2328e70fdd506483ff3c6f8d53e1053 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Lcarr ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fixing script to use /var/run/icinga - change (operations/puppet)
Lcarr has submitted this change and it was merged. Change subject: fixing script to use /var/run/icinga .. fixing script to use /var/run/icinga Change-Id: I43b73c6bc2328e70fdd506483ff3c6f8d53e1053 --- M files/icinga/nagios-nrpe-server-init 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Lcarr: Looks good to me, approved jenkins-bot: Verified diff --git a/files/icinga/nagios-nrpe-server-init b/files/icinga/nagios-nrpe-server-init index 02a153f..1af139a 100755 --- a/files/icinga/nagios-nrpe-server-init +++ b/files/icinga/nagios-nrpe-server-init @@ -18,7 +18,7 @@ NAME=nagios-nrpe DESC=nagios-nrpe CONFIG=/etc/icinga/nrpe.cfg -PIDDIR=/var/run/nagios +PIDDIR=/var/run/icinga test -x $DAEMON || exit 0 @@ -43,7 +43,7 @@ #since /var/run can be wiped completly we create our run directory here if [ ! -d "$PIDDIR" ]; then mkdir "$PIDDIR" - chown nagios "$PIDDIR" + chown icinga "$PIDDIR" fi set -e -- To view, visit https://gerrit.wikimedia.org/r/56601 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43b73c6bc2328e70fdd506483ff3c6f8d53e1053 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Lcarr Gerrit-Reviewer: Lcarr Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Reimported Upstream version 1.5.8 - change (operations...python-statsd)
Ottomata has submitted this change and it was merged. Change subject: Reimported Upstream version 1.5.8 .. Reimported Upstream version 1.5.8 The previous import has been made using the pypip tarball which is slightly different from the one generated by github. Thus I have reimported the proper tarball. Change-Id: I158e452311a27f82d322e78177f2c1468becf130 --- A .gitignore A .travis.yml A LICENSE D PKG-INFO A docs/Makefile A docs/conf.py A docs/index.rst A docs/make.bat A docs/statsd.client.rst A docs/statsd.connection.rst A docs/statsd.counter.rst A docs/statsd.gauge.rst A docs/statsd.raw.rst A docs/statsd.rst A docs/statsd.timer.rst A docs/usage.rst D python_statsd.egg-info/PKG-INFO D python_statsd.egg-info/SOURCES.txt D python_statsd.egg-info/dependency_links.txt D python_statsd.egg-info/top_level.txt M setup.cfg A tests/__init__.py A tests/test_connection.py A tests/test_counter.py A tests/test_gauge.py A tests/test_timer.py A tox.ini 27 files changed, 766 insertions(+), 365 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..f5c5fdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*.pyc +build +dist +*.egg-info +*.egg +.tox + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000..2d1e3ed --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: python +python: + - "2.5" + - "2.6" + - "2.7" +# command to install dependencies +install: + - pip install . --use-mirrors +# command to run tests +script: python setup.py nosetests diff --git a/LICENSE b/LICENSE new file mode 100644 index 000..6947f9f --- /dev/null +++ b/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2013, Rick van Hattem +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. +Neither the name of the nor the names of its contributors may be +used to endorse or promote products derived from this software without specific +prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/PKG-INFO b/PKG-INFO deleted file mode 100644 index 2520973..000 --- a/PKG-INFO +++ /dev/null @@ -1,169 +0,0 @@ -Metadata-Version: 1.1 -Name: python-statsd -Version: 1.5.8 -Summary: statsd is a client for Etsy's node-js statsd server. A proxy for the Graphite stats collection and graphing server. -Home-page: https://github.com/WoLpH/python-statsd -Author: Rick van Hattem -Author-email: rick.van.hat...@fawo.nl -License: BSD -Description: Introduction - - -`statsd` is a client for Etsy's statsd server, a front end/proxy for the -Graphite stats collection and graphing server. - -* Graphite -- http://graphite.wikidot.com -* Statsd -- code: https://github.com/etsy/statsd -- blog post: http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/ - - -Install -=== - -To install simply execute `python setup.py install`. -If you want to run the tests first, run `python setup.py nosetests` - - -Usage -= - -To get started real quick, just try something like this: - -Basic Usage ---- - -Timers -^^ - ->>> import statsd ->>> ->>> timer = statsd.Timer('MyApplication') ->>> ->>> timer.start() ->>> # do something here ->>> timer.stop('SomeTimer') - - -Counters - - ->>> import statsd ->>> ->>> counter = statsd.Counter('MyApplication') ->>>
[MediaWiki-commits] [Gerrit] Merge `upstream` Reimported Upstream version 1.5.8 - change (operations...python-statsd)
Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/56602 Change subject: Merge `upstream` Reimported Upstream version 1.5.8 .. Merge `upstream` Reimported Upstream version 1.5.8 Change-Id: Ie584bf9575ab1b74afb9de31745ad89e7e94be91 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/python-statsd refs/changes/02/56602/1 -- To view, visit https://gerrit.wikimedia.org/r/56602 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie584bf9575ab1b74afb9de31745ad89e7e94be91 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/python-statsd Gerrit-Branch: master Gerrit-Owner: Hashar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove disable_zoom now that it's unused - change (mediawiki...MobileFrontend)
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/56603 Change subject: Remove disable_zoom now that it's unused .. Remove disable_zoom now that it's unused Change-Id: Ifca553e4c077ee8c78b8556cc67fa16da55bc175 --- M includes/DeviceDetection.php 1 file changed, 0 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/03/56603/1 diff --git a/includes/DeviceDetection.php b/includes/DeviceDetection.php index 6815741..0d47e02 100644 --- a/includes/DeviceDetection.php +++ b/includes/DeviceDetection.php @@ -203,121 +203,101 @@ 'view_format' => 'html', 'css_file_name' => '', 'supports_jquery' => true, - 'disable_zoom' => false, ), 'blackberry' => array ( 'view_format' => 'html', 'css_file_name' => 'blackberry', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'blackberry-lt5' => array ( 'view_format' => 'html', 'css_file_name' => 'blackberry', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'capable' => array ( 'view_format' => 'html', 'css_file_name' => '', 'supports_jquery' => true, - 'disable_zoom' => true, ), 'html' => array ( 'view_format' => 'html', 'css_file_name' => '', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'ie' => array ( 'view_format' => 'html', 'css_file_name' => 'ie', 'supports_jquery' => true, - 'disable_zoom' => false, ), 'iphone' => array ( 'view_format' => 'html', 'css_file_name' => 'iphone', 'supports_jquery' => true, - 'disable_zoom' => false, ), 'kindle' => array ( 'view_format' => 'html', 'css_file_name' => 'kindle', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'kindle2' => array ( 'view_format' => 'html', 'css_file_name' => 'kindle', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'netfront' => array ( 'view_format' => 'html', 'css_file_name' => 'simple', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'nokia' => array ( 'view_format' => 'html', 'css_file_name' => 'nokia', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'operamini' => array ( 'view_format' => 'html', 'css_file_name' => 'operamini', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'operamobile' => array ( 'view_format' => 'html', 'css_file_name' => 'operamobile', 'supports_jquery' => true, - 'disable_zoom' => true, ), 'palm_pre' => array ( 'view_format' => 'html', 'css_file_name' => '', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'ps3' => array ( 'view_format' => 'html', 'css_file_name' => 'simple', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'psp' => array ( 'view_format' => 'html', 'css_file_name' => 'psp', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'wap2' => array ( 'view_format' => 'html', 'css_file_name' => 'simple', 'supports_jquery' => false, - 'disable_zoom' =
[MediaWiki-commits] [Gerrit] one more script to use /var/run/icinga - change (operations/puppet)
Jeremyb has uploaded a new change for review. https://gerrit.wikimedia.org/r/56604 Change subject: one more script to use /var/run/icinga .. one more script to use /var/run/icinga followup I43b73c6bc2328e70fdd506483ff3c6f8d53e1053 RT: 4851 Change-Id: Iaf9dcb9ab7574ce79c74f559c48d0c1d31fb51be --- M templates/icinga/nrpe_local.cfg.erb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/04/56604/1 diff --git a/templates/icinga/nrpe_local.cfg.erb b/templates/icinga/nrpe_local.cfg.erb index 932588e..9cbc02c 100644 --- a/templates/icinga/nrpe_local.cfg.erb +++ b/templates/icinga/nrpe_local.cfg.erb @@ -1,4 +1,4 @@ -pid_file=/var/run/nagios/nrpe.pid +pid_file=/var/run/icinga/nrpe.pid allowed_hosts=<%= scope.lookupvar("nrpe::packages::nrpe_allowed_hosts") %> command[check_disk_5_2]=/usr/lib/nagios/plugins/check_disk -w 5% -c 2% -l -e -- To view, visit https://gerrit.wikimedia.org/r/56604 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf9dcb9ab7574ce79c74f559c48d0c1d31fb51be Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Jeremyb ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fixing pid file - change (operations/puppet)
Lcarr has uploaded a new change for review. https://gerrit.wikimedia.org/r/56605 Change subject: fixing pid file .. fixing pid file Change-Id: I2a9fbe5f7522ba9fed64415b5f7b230ee50cfc23 --- M templates/icinga/nrpe_local.cfg.erb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/05/56605/1 diff --git a/templates/icinga/nrpe_local.cfg.erb b/templates/icinga/nrpe_local.cfg.erb index 932588e..9cbc02c 100644 --- a/templates/icinga/nrpe_local.cfg.erb +++ b/templates/icinga/nrpe_local.cfg.erb @@ -1,4 +1,4 @@ -pid_file=/var/run/nagios/nrpe.pid +pid_file=/var/run/icinga/nrpe.pid allowed_hosts=<%= scope.lookupvar("nrpe::packages::nrpe_allowed_hosts") %> command[check_disk_5_2]=/usr/lib/nagios/plugins/check_disk -w 5% -c 2% -l -e -- To view, visit https://gerrit.wikimedia.org/r/56605 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2a9fbe5f7522ba9fed64415b5f7b230ee50cfc23 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Lcarr ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use getUserPermissionsErrors in EditEntityAction::showPermis... - change (mediawiki...Wikibase)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/56606 Change subject: Use getUserPermissionsErrors in EditEntityAction::showPermissionError .. Use getUserPermissionsErrors in EditEntityAction::showPermissionError Bug: 46698 Change-Id: I2fa839995de0c31af8ad122d9bb4cb00a9c68170 --- M repo/includes/actions/EditEntityAction.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/06/56606/1 diff --git a/repo/includes/actions/EditEntityAction.php b/repo/includes/actions/EditEntityAction.php index e822e93..0df0cbd 100644 --- a/repo/includes/actions/EditEntityAction.php +++ b/repo/includes/actions/EditEntityAction.php @@ -45,7 +45,11 @@ public function showPermissionError( $action ) { if ( !$this->getTitle()->userCan( $action, $this->getUser() ) ) { - $this->getOutput()->showPermissionsErrorPage( array( array( "wikibase-cant-undo" ) ), $action ); //TODO: define message + $this->getOutput()->showPermissionsErrorPage( + array( $this->getTitle()->getUserPermissionsErrors( $action, $this->getUser() ) ), + $action + ); + return true; } -- To view, visit https://gerrit.wikimedia.org/r/56606 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fa839995de0c31af8ad122d9bb4cb00a9c68170 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Hoo man ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fixing pid file - change (operations/puppet)
Lcarr has submitted this change and it was merged. Change subject: fixing pid file .. fixing pid file Change-Id: I2a9fbe5f7522ba9fed64415b5f7b230ee50cfc23 --- M templates/icinga/nrpe_local.cfg.erb 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Lcarr: Looks good to me, approved jenkins-bot: Verified diff --git a/templates/icinga/nrpe_local.cfg.erb b/templates/icinga/nrpe_local.cfg.erb index 932588e..9cbc02c 100644 --- a/templates/icinga/nrpe_local.cfg.erb +++ b/templates/icinga/nrpe_local.cfg.erb @@ -1,4 +1,4 @@ -pid_file=/var/run/nagios/nrpe.pid +pid_file=/var/run/icinga/nrpe.pid allowed_hosts=<%= scope.lookupvar("nrpe::packages::nrpe_allowed_hosts") %> command[check_disk_5_2]=/usr/lib/nagios/plugins/check_disk -w 5% -c 2% -l -e -- To view, visit https://gerrit.wikimedia.org/r/56605 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2a9fbe5f7522ba9fed64415b5f7b230ee50cfc23 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Lcarr Gerrit-Reviewer: Lcarr Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updated documentation - change (operations/puppet)
Andrew Bogott has submitted this change and it was merged. Change subject: Updated documentation .. Updated documentation Change-Id: I548367c234e4e53d9950ffdfdc29ea897423603d --- M modules/wikidata_singlenode/templates/wikidata-client-requires.php M modules/wikidata_singlenode/templates/wikidata-repo-requires.php 2 files changed, 2 insertions(+), 3 deletions(-) Approvals: Andrew Bogott: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/modules/wikidata_singlenode/templates/wikidata-client-requires.php b/modules/wikidata_singlenode/templates/wikidata-client-requires.php index c1262a1..ece0b0a 100644 --- a/modules/wikidata_singlenode/templates/wikidata-client-requires.php +++ b/modules/wikidata_singlenode/templates/wikidata-client-requires.php @@ -41,7 +41,7 @@ // The global site ID by which this wiki is known on the repo. $wgWBSettings['siteGlobalID'] = "<%=siteGlobalID%>"; -// Database name of the repository, for use by the pollForChanges script. +// Database name of the repository, for the propagation of changes. // This requires the given database name to be known to LBFactory, see // $wgLBFactoryConf below. $wgWBSettings['changesDatabase'] = "repo"; diff --git a/modules/wikidata_singlenode/templates/wikidata-repo-requires.php b/modules/wikidata_singlenode/templates/wikidata-repo-requires.php index baa60a6..d12c964 100644 --- a/modules/wikidata_singlenode/templates/wikidata-repo-requires.php +++ b/modules/wikidata_singlenode/templates/wikidata-repo-requires.php @@ -118,8 +118,7 @@ // Load Balancer $wgLBFactoryConf = array( - // In order to seamlessly access a remote wiki, as the pollForChanges script needs to do, - // LBFactory_Multi must be used. + // In order to seamlessly access a remote wiki, LBFactory_Multi must be used. 'class' => 'LBFactory_Multi', // Connect to all databases using the same credentials. -- To view, visit https://gerrit.wikimedia.org/r/55872 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I548367c234e4e53d9950ffdfdc29ea897423603d Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Silke Meyer Gerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] improved style for TOC - fix a.selected css selector into li... - change (mediawiki...Configure)
Waldir has uploaded a new change for review. https://gerrit.wikimedia.org/r/56607 Change subject: improved style for TOC - fix a.selected css selector into li.selected, since the class was applied to the rather than the - improve overal styling (compare before: http://i.imgur.com/fHz8dMB.png and after: http://i.imgur.com/ub5QAaW.png) - ch .. improved style for TOC - fix a.selected css selector into li.selected, since the class was applied to the rather than the - improve overal styling (compare before: http://i.imgur.com/fHz8dMB.png and after: http://i.imgur.com/ub5QAaW.png) - change alignment technique so it works regardless of font metrics - minor grammar tweak to the extension's description string Change-Id: I3884950719744bcbdb148fd9711ace823e993f74 --- M Configure.css M Configure.i18n.php 2 files changed, 23 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Configure refs/changes/07/56607/1 diff --git a/Configure.css b/Configure.css index b7f48ac..2803192 100644 --- a/Configure.css +++ b/Configure.css @@ -16,7 +16,12 @@ td.config-col-toc { border-right: 1px solid #999; + padding: 0; margin-right: .5em; +} + +td.config-col-toc ul { + margin-left: 0; } td.config-col-form { @@ -35,7 +40,6 @@ ul.configtoc { vertical-align: top; - padding-right: 0.5em; } ul.configtoc, ul.configtoc > li > ul { @@ -45,16 +49,29 @@ ul.configtoc li { white-space: nowrap; - background-color: #fefefe; + padding: 0.5em; + position: relative; } -ul.configtoc li > a.selected { +ul.configtoc > li { + padding-left: 2.5em; +} + +ul.configtoc > li > ul > li { + padding-left: 1.5em; +} + +ul.configtoc li.selected { background-color: #ff; + border-top-left-radius: 10px; + border-bottom-left-radius: 10px; } ul.configtoc li > a.toggle { - margin-left: -1.5em; - padding-right: 0.3em; +/* margin-left: -2em; + padding-right: 0.3em;*/ + position: absolute; + left: 0.75em; } .config-toc-delimiter { diff --git a/Configure.i18n.php b/Configure.i18n.php index d9e2e3b..74eea7e 100644 --- a/Configure.i18n.php +++ b/Configure.i18n.php @@ -33,7 +33,7 @@ 'configure-customised'=> "''This setting has been customized''", 'configure-arrayinput-oneperline' => "''(one per line)''", - 'configure-summary' => 'This special page allows you to configure this wiki, see [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings] for more information.', + 'configure-summary' => 'This special page allows you to configure this wiki. See [http://www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings] for more information.', 'configure-btn-save' => 'Save settings', 'configure-db-error' => 'The database you specified to hold the configuration ($1) does not exist. Please create it and apply configure.sql or correct its name.', -- To view, visit https://gerrit.wikimedia.org/r/56607 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3884950719744bcbdb148fd9711ace823e993f74 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Configure Gerrit-Branch: master Gerrit-Owner: Waldir ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove disable_zoom now that it's unused - change (mediawiki...MobileFrontend)
Jdlrobson has submitted this change and it was merged. Change subject: Remove disable_zoom now that it's unused .. Remove disable_zoom now that it's unused Change-Id: Ifca553e4c077ee8c78b8556cc67fa16da55bc175 --- M includes/DeviceDetection.php 1 file changed, 0 insertions(+), 21 deletions(-) Approvals: Jdlrobson: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/includes/DeviceDetection.php b/includes/DeviceDetection.php index 6815741..0d47e02 100644 --- a/includes/DeviceDetection.php +++ b/includes/DeviceDetection.php @@ -203,121 +203,101 @@ 'view_format' => 'html', 'css_file_name' => '', 'supports_jquery' => true, - 'disable_zoom' => false, ), 'blackberry' => array ( 'view_format' => 'html', 'css_file_name' => 'blackberry', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'blackberry-lt5' => array ( 'view_format' => 'html', 'css_file_name' => 'blackberry', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'capable' => array ( 'view_format' => 'html', 'css_file_name' => '', 'supports_jquery' => true, - 'disable_zoom' => true, ), 'html' => array ( 'view_format' => 'html', 'css_file_name' => '', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'ie' => array ( 'view_format' => 'html', 'css_file_name' => 'ie', 'supports_jquery' => true, - 'disable_zoom' => false, ), 'iphone' => array ( 'view_format' => 'html', 'css_file_name' => 'iphone', 'supports_jquery' => true, - 'disable_zoom' => false, ), 'kindle' => array ( 'view_format' => 'html', 'css_file_name' => 'kindle', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'kindle2' => array ( 'view_format' => 'html', 'css_file_name' => 'kindle', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'netfront' => array ( 'view_format' => 'html', 'css_file_name' => 'simple', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'nokia' => array ( 'view_format' => 'html', 'css_file_name' => 'nokia', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'operamini' => array ( 'view_format' => 'html', 'css_file_name' => 'operamini', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'operamobile' => array ( 'view_format' => 'html', 'css_file_name' => 'operamobile', 'supports_jquery' => true, - 'disable_zoom' => true, ), 'palm_pre' => array ( 'view_format' => 'html', 'css_file_name' => '', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'ps3' => array ( 'view_format' => 'html', 'css_file_name' => 'simple', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'psp' => array ( 'view_format' => 'html', 'css_file_name' => 'psp', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'wap2' => array ( 'view_format' => 'html', 'css_file_name' => 'simple', 'supports_jquery' => false, - 'disable_zoom' => true, ), 'webkit
[MediaWiki-commits] [Gerrit] generate puppet doc using Jenkins - change (integration/zuul-config)
Hashar has uploaded a new change for review. https://gerrit.wikimedia.org/r/56608 Change subject: generate puppet doc using Jenkins .. generate puppet doc using Jenkins triggers postmerge job operations-puppet-doc Change-Id: I1975ec6de4f4f4926e82f7a646b691119f3ba8ff --- M layout.yaml 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/zuul-config refs/changes/08/56608/1 diff --git a/layout.yaml b/layout.yaml index 2f9ee5b..6c49b0f 100644 --- a/layout.yaml +++ b/layout.yaml @@ -502,6 +502,8 @@ - operations-puppet-pep8 - operations-puppet-typos - operations-puppet-validate +postmerge: + - operations-puppet-doc - name: operations/software check-voter: -- To view, visit https://gerrit.wikimedia.org/r/56608 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1975ec6de4f4f4926e82f7a646b691119f3ba8ff Gerrit-PatchSet: 1 Gerrit-Project: integration/zuul-config Gerrit-Branch: master Gerrit-Owner: Hashar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] generate puppet doc using Jenkins - change (integration/zuul-config)
Hashar has submitted this change and it was merged. Change subject: generate puppet doc using Jenkins .. generate puppet doc using Jenkins triggers postmerge job operations-puppet-doc Change-Id: I1975ec6de4f4f4926e82f7a646b691119f3ba8ff --- M layout.yaml 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Hashar: Verified; Looks good to me, approved diff --git a/layout.yaml b/layout.yaml index 2f9ee5b..6c49b0f 100644 --- a/layout.yaml +++ b/layout.yaml @@ -502,6 +502,8 @@ - operations-puppet-pep8 - operations-puppet-typos - operations-puppet-validate +postmerge: + - operations-puppet-doc - name: operations/software check-voter: -- To view, visit https://gerrit.wikimedia.org/r/56608 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1975ec6de4f4f4926e82f7a646b691119f3ba8ff Gerrit-PatchSet: 1 Gerrit-Project: integration/zuul-config Gerrit-Branch: master Gerrit-Owner: Hashar Gerrit-Reviewer: Hashar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations-puppet-doc for docs.wikimedia.org/puppet - change (integration/jenkins-job-builder-config)
Hashar has submitted this change and it was merged. Change subject: operations-puppet-doc for docs.wikimedia.org/puppet .. operations-puppet-doc for docs.wikimedia.org/puppet Require JJB to support setting the 'workspace' on a job. Upstream patch is https://review.openstack.org/24427 Change-Id: Iae192f6380e72c46822f0a738ab88a1d452aad2e --- M operations-puppet.yaml 1 file changed, 17 insertions(+), 0 deletions(-) Approvals: Hashar: Verified; Looks good to me, approved diff --git a/operations-puppet.yaml b/operations-puppet.yaml index 27dbc3e..09d38d7 100644 --- a/operations-puppet.yaml +++ b/operations-puppet.yaml @@ -28,6 +28,22 @@ rake --rakefile rakefile validate ) +# Documentation for our puppet repository +- job-template: +name: 'operations-puppet-doc' +defaults: use-zuul +triggers: + - zuul +workspace: '/srv/org/wikimedia/doc/puppetsource' +builders: + - shell: | +#!/bin/bash -e +/usr/bin/puppet doc \ +--mode rdoc \ +--outputdir /srv/org/wikimedia/doc/puppet \ +--modulepath "$WORKSPACE/modules" \ +--manifestdir "$WORKSPACE/manifests" + # Find out common typos in any files of ops/puppet - job-template: name: 'operations-puppet-typos' @@ -52,3 +68,4 @@ - '{name}-pep8' - operations-puppet-typos - operations-puppet-validate + - operations-puppet-doc -- To view, visit https://gerrit.wikimedia.org/r/53753 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iae192f6380e72c46822f0a738ab88a1d452aad2e Gerrit-PatchSet: 2 Gerrit-Project: integration/jenkins-job-builder-config Gerrit-Branch: master Gerrit-Owner: Hashar Gerrit-Reviewer: Hashar ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Enabling tests that were disabled because of a know MediaWik... - change (qa/browsertests)
Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/56609 Change subject: Enabling tests that were disabled because of a know MediaWiki bugs .. Enabling tests that were disabled because of a know MediaWiki bugs Bug: 46168, 46367 Change-Id: I68a480a44c122c80f6c15fd1a24abcdbd3880d31 --- M features/guided_tour.feature M features/page_triage.feature 2 files changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests refs/changes/09/56609/1 diff --git a/features/guided_tour.feature b/features/guided_tour.feature index 3d33946..425ab9e 100644 --- a/features/guided_tour.feature +++ b/features/guided_tour.feature @@ -25,8 +25,6 @@ When I save the page without changing anything Then Looking for more to do guider should not appear - # https://bugzilla.wikimedia.org/show_bug.cgi?id=46168 - @bug Scenario: Check that "Looking for more to do" guider does appear when page is changed and saved Given I am on a page with You're almost finished guider When I save the page is changed and saved diff --git a/features/page_triage.feature b/features/page_triage.feature index 27b20b4..e7873c1 100644 --- a/features/page_triage.feature +++ b/features/page_triage.feature @@ -8,8 +8,7 @@ And I should not see a Review button # https://bugzilla.wikimedia.org/show_bug.cgi?id=43598 ie - # https://bugzilla.wikimedia.org/show_bug.cgi?id=46367 ff - @ie6-bug @ie7-bug @firefox-bug + @ie6-bug @ie7-bug Scenario: Check set filters selection Given I am at the NewPagesFeed page When I click Set filters -- To view, visit https://gerrit.wikimedia.org/r/56609 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68a480a44c122c80f6c15fd1a24abcdbd3880d31 Gerrit-PatchSet: 1 Gerrit-Project: qa/browsertests Gerrit-Branch: master Gerrit-Owner: Zfilipin ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't announce comments on drafts to IRC - change (operations/puppet)
Ryan Lane has submitted this change and it was merged. Change subject: Don't announce comments on drafts to IRC .. Don't announce comments on drafts to IRC Bug: 37538 Change-Id: I8662bf45f1fb89fcb0695b559617fc584fc17318 --- M files/gerrit/hooks/comment-added 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Ryan Lane: Looks good to me, approved Demon: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/files/gerrit/hooks/comment-added b/files/gerrit/hooks/comment-added index 3e87aaf..c3a8bfa 100755 --- a/files/gerrit/hooks/comment-added +++ b/files/gerrit/hooks/comment-added @@ -16,7 +16,10 @@ self.parser.add_option("--topic", dest="topic") self.parser.add_option("--VRIF", dest="verified") self.parser.add_option("--CRVW", dest="codereview") +self.parser.add_option("--is-draft", dest="draft") (options, args) = self.parser.parse_args() +if options.draft == "true": +return # Don't report drafts to IRC! comment = re.sub(r"^\s*Patch Set \d+:.*$", '', options.comment, flags=re.MULTILINE).strip().splitlines() if comment: comment = comment[0] -- To view, visit https://gerrit.wikimedia.org/r/53759 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8662bf45f1fb89fcb0695b559617fc584fc17318 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Demon Gerrit-Reviewer: Demon Gerrit-Reviewer: Ryan Lane Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Properly configure hooks-bugzilla plugin based on feedback - change (operations/puppet)
Ryan Lane has submitted this change and it was merged. Change subject: Properly configure hooks-bugzilla plugin based on feedback .. Properly configure hooks-bugzilla plugin based on feedback - Comment on change abandoned/restored - Comment on new changes - Don't comment on new patchsets Change-Id: I1219d6abf261057fbfefe9c88518553d7bfd45e2 --- M templates/gerrit/gerrit.config.erb 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Ryan Lane: Looks good to me, approved QChris: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/templates/gerrit/gerrit.config.erb b/templates/gerrit/gerrit.config.erb index 3120509..007acb4 100644 --- a/templates/gerrit/gerrit.config.erb +++ b/templates/gerrit/gerrit.config.erb @@ -109,9 +109,10 @@ [bugzilla] url = https://bugzilla.wikimedia.org username = gerritad...@wikimedia.org - commentOnChangeAbandoned = false + commentOnChangeAbandoned = true commentOnChangeMerged = true - commentOnChangeRestored = false + commentOnChangeRestored = true + commentOnChangeCreated = true commentOnCommentAdded = false - commentOnPatchSetCreated = true + commentOnPatchSetCreated = false commentOnRefUpdatedGitWeb = false -- To view, visit https://gerrit.wikimedia.org/r/54989 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1219d6abf261057fbfefe9c88518553d7bfd45e2 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Demon Gerrit-Reviewer: Demon Gerrit-Reviewer: QChris Gerrit-Reviewer: Ryan Lane Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Send analytics repos to #wikimedia-analytics - change (operations/puppet)
Ryan Lane has submitted this change and it was merged. Change subject: Send analytics repos to #wikimedia-analytics .. Send analytics repos to #wikimedia-analytics Change-Id: I9e6a5ef2a053e48e28a9c22831d8200ae621d221 --- M manifests/gerrit.pp M templates/gerrit/hookconfig.py.erb 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Ryan Lane: Looks good to me, approved Demon: Looks good to me, but someone else must approve Yuvipanda: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/manifests/gerrit.pp b/manifests/gerrit.pp index 8c63ac2..6d9dfa5 100644 --- a/manifests/gerrit.pp +++ b/manifests/gerrit.pp @@ -346,6 +346,7 @@ "${ircecho_logbase}/wikimedia-dev.log" => "#wikimedia-dev", "${ircecho_logbase}/semantic-mediawiki.log" => ["#semantic-mediawiki", "#mediawiki"], "${ircecho_logbase}/wikidata.log"=> "#wikimedia-wikidata", + "${ircecho_logbase}/wikimedia-analytics.log" => "#wikimedia-analytics", } $ircecho_nick = "gerrit-wm" $ircecho_server = "chat.freenode.net" diff --git a/templates/gerrit/hookconfig.py.erb b/templates/gerrit/hookconfig.py.erb index aafcc3a..cf69199 100644 --- a/templates/gerrit/hookconfig.py.erb +++ b/templates/gerrit/hookconfig.py.erb @@ -30,7 +30,7 @@ "mediawiki/extensions/Parsoid": "parsoid.log", "mediawiki/extensions/VisualEditor": "visualeditor.log", "mediawiki/extensions/TemplateData": "visualeditor.log", - "analytics/*" : "wikimedia-dev.log", + "analytics/*" : "wikimedia-analytics.log", "integration/*" : "wikimedia-dev.log", "labs/*" : "labs.log", "mediawiki/*" : "mediawiki.log", -- To view, visit https://gerrit.wikimedia.org/r/55057 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e6a5ef2a053e48e28a9c22831d8200ae621d221 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Demon Gerrit-Reviewer: Demon Gerrit-Reviewer: Ryan Lane Gerrit-Reviewer: Yuvipanda Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (bug 46635) Recognize Windows path+drive letter - change (mediawiki...Scribunto)
jenkins-bot has submitted this change and it was merged. Change subject: (bug 46635) Recognize Windows path+drive letter .. (bug 46635) Recognize Windows path+drive letter The logic for recognizing absolute versus relative paths needs to take into account the possibility of a Windows drive letter. Bug: 46635 Change-Id: I3a43acac2f6e8b481807e1babe5a261b9eb1fe23 --- M engines/LuaCommon/LuaCommon.php 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved Mwjames: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/engines/LuaCommon/LuaCommon.php b/engines/LuaCommon/LuaCommon.php index 703734f..fc38213 100644 --- a/engines/LuaCommon/LuaCommon.php +++ b/engines/LuaCommon/LuaCommon.php @@ -131,14 +131,18 @@ } /** -* Normalize a lua module to its full path. If path does not begin with "/", -* prepend getLuaLibDir() +* Normalize a lua module to its full path. If path does not look like an +* absolute path (i.e. begins with DIRECTORY_SEPARATOR or "X:"), prepend +* getLuaLibDir() * * @param $file String name of the lua module file * @return string */ protected function normalizeModuleFileName( $fileName ) { - return $fileName[0] !== DIRECTORY_SEPARATOR ? "{$this->getLuaLibDir()}/{$fileName}" : $fileName; + if ( !preg_match( '<^(?:[a-zA-Z]:)?' . preg_quote( DIRECTORY_SEPARATOR ) . '>', $fileName ) ) { + $fileName = "{$this->getLuaLibDir()}/{$fileName}"; + } + return $fileName; } /** -- To view, visit https://gerrit.wikimedia.org/r/56596 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3a43acac2f6e8b481807e1babe5a261b9eb1fe23 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Scribunto Gerrit-Branch: master Gerrit-Owner: Anomie Gerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Anomie Gerrit-Reviewer: Demon Gerrit-Reviewer: Mwjames Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Consolidate gallium and formey replication - change (operations/puppet)
Ryan Lane has submitted this change and it was merged. Change subject: Consolidate gallium and formey replication .. Consolidate gallium and formey replication Allows for slightly more parallel execution of internal replication. Change-Id: I4f3cab1b75cb6d4a192d1e2c8c18ab64dc989f16 --- M manifests/role/gerrit.pp 1 file changed, 3 insertions(+), 7 deletions(-) Approvals: Ryan Lane: Looks good to me, approved Demon: Looks good to me, but someone else must approve jenkins-bot: Verified Objections: Hashar: There's a problem with this change, please improve diff --git a/manifests/role/gerrit.pp b/manifests/role/gerrit.pp index ad057a8..1473e03 100644 --- a/manifests/role/gerrit.pp +++ b/manifests/role/gerrit.pp @@ -29,8 +29,9 @@ ssl_ca => "Equifax_Secure_CA", replication => { # If adding a new entry, remember to add the fingerprint to gerrit2's known_hosts - "formey" => { - "url" => 'gerritsl...@formey.wikimedia.org:/var/lib/gerrit2/review_site/git/${name}.git', + "inside-wmf" => { + "url" => "gerritsl...@formey.wikimedia.org:/var/lib/gerrit2/review_site/git/${name}.git + url = gerritsl...@gallium.wikimedia.org:/var/lib/git/${name}.git", "threads" => "4", "mirror" => "true", }, @@ -43,11 +44,6 @@ "isGithubRepo" => "true", "remoteNameStyle" => "dash", "mirror" => "true", - }, - 'gallium' => { - 'url' => 'gerritsl...@gallium.wikimedia.org:/var/lib/git/${name}.git', - 'threads' => '4', - "mirror" => "true" }, }, smtp_host => "smtp.pmtpa.wmnet" -- To view, visit https://gerrit.wikimedia.org/r/55259 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f3cab1b75cb6d4a192d1e2c8c18ab64dc989f16 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Demon Gerrit-Reviewer: Demon Gerrit-Reviewer: Hashar Gerrit-Reviewer: Ryan Lane Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updating for 2.6-rc0-76-g52fb5ae - change (operations...gerrit)
Ryan Lane has submitted this change and it was merged. Change subject: Updating for 2.6-rc0-76-g52fb5ae .. Updating for 2.6-rc0-76-g52fb5ae Change-Id: I508690d2418484d0846f216e1a3aeac54515c56f --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Ryan Lane: Verified; Looks good to me, approved Demon: Looks good to me, but someone else must approve diff --git a/debian/changelog b/debian/changelog index 09c227e..74476dc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +gerrit (2.6-rc0-76-g52fb5ae-1) precise-wikimedia; urgency=low + + * Updating for 2.6-rc0-76-g52fb5ae + + -- Chad Horohoe Thu, 28 Mar 2013 19:15:01 + + gerrit (2.5.2-1636-g353e384-1) precise-wikimedia; urgency=low * Updating for 2.5.2-1636-g353e384 -- To view, visit https://gerrit.wikimedia.org/r/56485 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I508690d2418484d0846f216e1a3aeac54515c56f Gerrit-PatchSet: 2 Gerrit-Project: operations/debs/gerrit Gerrit-Branch: master Gerrit-Owner: Demon Gerrit-Reviewer: Demon Gerrit-Reviewer: Ryan Lane ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bug 41519: Only request token when clicking the star - change (mediawiki...MobileFrontend)
Jdlrobson has submitted this change and it was merged. Change subject: Bug 41519: Only request token when clicking the star .. Bug 41519: Only request token when clicking the star Currently we are making unnecessary token requests. This changes things so we only make one when the user hits the star. Document functions in process Bug 41519 Change-Id: I9512c26a3f7ae020bf604a7b94283821a08606a3 --- M javascripts/modules/mf-watchstar.js 1 file changed, 37 insertions(+), 19 deletions(-) Approvals: Jdlrobson: Verified; Looks good to me, approved diff --git a/javascripts/modules/mf-watchstar.js b/javascripts/modules/mf-watchstar.js index baf88b4..dff5fac 100644 --- a/javascripts/modules/mf-watchstar.js +++ b/javascripts/modules/mf-watchstar.js @@ -1,14 +1,21 @@ (function( M, $ ) { var api = M.require( 'api' ), w = ( function() { - var lastToken, nav = M.require( 'navigation' ), popup = M.require( 'notifications' ), + var nav = M.require( 'navigation' ), popup = M.require( 'notifications' ), drawer = new nav.CtaDrawer( { content: mw.msg( 'mobile-frontend-watchlist-cta' ), returnToQuery: 'article_action=watch' } ); // FIXME: this should live in a separate module and make use of MobileFrontend events - function logWatchEvent( eventType ) { + /** +* Checks whether a list of article titles are being watched by the current user +* Checks a local cache before making a query to server +* +* @param {Integer} eventType: 0=watched article, 1=stopped watching article, 2=clicked star as anonymous user +* @param {String} token: Token returned from getToken, optional when eventType is 2 +*/ + function logWatchEvent( eventType, token ) { var types = [ 'watchlist', 'unwatchlist', 'anonCTA' ], data = { // FIXME: this gives wrong results when page loaded dynamically @@ -16,7 +23,7 @@ anon: mw.config.get( 'wgUserName' ) === null, action: types[ eventType ], isStable: mw.config.get( 'wgMFMode' ), - token: lastToken || '+\\', // +\\ for anon + token: eventType === 2 ? '+\\' : token, // +\\ for anon username: mw.config.get( 'wgUserName' ) || '' }; @@ -55,6 +62,13 @@ return $( '' ).appendTo( container )[ 0 ]; } + /** +* Creates a watchlist button +* +* @param {jQuery} container: Element in which to create a watch star +* @param {String} title: The title to be watched +* @param {Boolean} isWatchedArticle: Whether the article is currently watched by the user or not +*/ function createWatchListButton( container, title, isWatchedArticle ) { var prevent, watchBtn = createButton( container ); @@ -68,12 +82,12 @@ $( watchBtn ).removeClass( 'disabled loading' ); } - function success( data ) { + function success( data, token ) { if ( data.watch.hasOwnProperty( 'watched' ) ) { - logWatchEvent( 0 ); + logWatchEvent( 0, token ); $( watchBtn ).addClass( 'watched' ); } else { - logWatchEvent( 1 ); + logWatchEvent( 1, token ); $( watchBtn ).removeClass( 'watched' ); } enable(); @@ -81,7 +95,10 @@ function toggleWatchStatus( unwatch ) { api.getToken( 'watch' ).done( function( token ) { - toggleWatch( title, token, unwatch, success, enable ); + toggleWatch( title, token, unwatch, + function( data ) { + success( data, token ); + }, enable ); } ); } @@ -143,13 +160,18 @@ } } + /** +* Creates a watch star OR a drawer to encourage user to register / login +* +* @param {jQuery} container: A jQuery container to create a watch list button +* @param {String} title: The name of the article to watch +*/ function initWatchListIcon( container, title ) { - api.getToken( 'watch' ).done( function( token ) { - lastToken = token; + if ( M.isLoggedIn() ) {
[MediaWiki-commits] [Gerrit] Fix the target URL of HTMLForm - change (mediawiki/core)
IAlex has uploaded a new change for review. https://gerrit.wikimedia.org/r/56610 Change subject: Fix the target URL of HTMLForm .. Fix the target URL of HTMLForm - Use a local URL instead of a full one - Use $wgScriptPath instead of title's URL when $wgArticlePath contains a "?" since it'll be removed by web browser - Move the URL generation to getAction() for better readability - Use getMethod() instead of mMethod for consistency Change-Id: I7c40cae839e52e2e8618d48c7a3b2f9709e6f2d6 --- M includes/HTMLForm.php 1 file changed, 28 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/10/56610/1 diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 4a527bb..6c2f496 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -640,8 +640,8 @@ : 'application/x-www-form-urlencoded'; # Attributes $attribs = array( - 'action' => $this->mAction === false ? $this->getTitle()->getFullURL() : $this->mAction, - 'method' => $this->mMethod, + 'action' => $this->getAction(), + 'method' => $this->getMethod(), 'class' => 'visualClear', 'enctype' => $encType, ); @@ -1074,6 +1074,32 @@ return $this; } + /** +* Get the value for the action attribute of the form. +* +* @since 1.22 +* +* @return string +*/ + public function getAction() { + global $wgScript, $wgArticlePath; + + // If an action is alredy provided, return it + if ( $this->mAction !== false ) { + return $this->mAction; + } + + // Check whether we are in GET mode and $wgArticlePath contains a "?" + // meaning that getLocalURL() would return something like "index.php?title=...". + // As browser remove the query string before submitting GET forms, + // it means that the title would be lost. In such case use $wgScript instead + // and put title in an hidden field (see getHiddenFields()). + if ( strpos( $wgArticlePath, '?' ) !== false && $this->getMethod() == 'get' ) { + return $wgScript; + } + + return $this->getTitle()->getLocalURL(); + } } /** -- To view, visit https://gerrit.wikimedia.org/r/56610 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c40cae839e52e2e8618d48c7a3b2f9709e6f2d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: IAlex ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] contint: puppet doc now handled by Jenkins - change (operations/puppet)
Ryan Lane has submitted this change and it was merged. Change subject: contint: puppet doc now handled by Jenkins .. contint: puppet doc now handled by Jenkins The puppet documentation is now handled by Jenkins. This patch: * removes the puppet classe misc::docs::puppet which was used to generate the documentation on gallium. * move misc::docsite under the contint module which would thus now manage doc.wikimedia.org * /srv/org/wikimedia/doc now belongs to jenkins:jenkins and group writable. Change-Id: I1a503f65ea15e160ae4b5e1a8110c5bfba37a348 --- D manifests/misc/docs.pp M manifests/site.pp R modules/contint/files/apache/doc.wikimedia.org M modules/contint/manifests/website.pp 4 files changed, 20 insertions(+), 35 deletions(-) Approvals: Ryan Lane: Looks good to me, approved jenkins-bot: Verified diff --git a/manifests/misc/docs.pp b/manifests/misc/docs.pp deleted file mode 100644 index 01d8316..000 --- a/manifests/misc/docs.pp +++ /dev/null @@ -1,31 +0,0 @@ -class misc::docsite { - system_role { "misc::docsite": description => "doc site server" } - file { - '/etc/apache2/sites-available/doc.wikimedia.org': - path => '/etc/apache2/sites-available/doc.wikimedia.org', - mode => 0444, - owner => root, - group => root, - source => 'puppet:///files/apache/sites/doc.wikimedia.org'; - '/srv/org/wikimedia/doc': - ensure => 'directory'; - } - - apache_site { docs: name => 'doc.wikimedia.org' } -} - -class misc::docs::puppet { - - git::clone { "puppetsource": - directory => "/srv/org/wikimedia/doc/puppetsource", - branch => "master", - ensure => latest, - origin => "https://gerrit.wikimedia.org/r/p/operations/puppet";; - } - - exec { "generate puppet docsite": - require => git::clone['puppetsource'], - command => "/usr/bin/puppet doc --mode rdoc --outputdir /srv/org/wikimedia/doc/puppet --modulepath /srv/org/wikimedia/doc/puppetsource/modules --manifestdir /srv/org/wikimedia/doc/puppetsource/manifests", - } - -} diff --git a/manifests/site.pp b/manifests/site.pp index 62d3bce..2295bee 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -846,8 +846,6 @@ misc::contint::test::packages, misc::contint::test::jenkins, misc::contint::android::sdk, - misc::docsite, - misc::docs::puppet, role::zuul::production, admins::roots, admins::jenkins diff --git a/files/apache/sites/doc.wikimedia.org b/modules/contint/files/apache/doc.wikimedia.org similarity index 100% rename from files/apache/sites/doc.wikimedia.org rename to modules/contint/files/apache/doc.wikimedia.org diff --git a/modules/contint/manifests/website.pp b/modules/contint/manifests/website.pp index 1dbcf60..58cec15 100644 --- a/modules/contint/manifests/website.pp +++ b/modules/contint/manifests/website.pp @@ -1,10 +1,10 @@ # Class for website hosted on the continuous integration server # https://integration.mediawiki.org/ # https://doc.wikimedia.org/ -# https://doc.mediawiki.org/ class contint::website { - # This is mostly to get the files properly setup + # Static files in these docroots are in integration/docroot.git + file { '/srv/org': ensure => directory, mode => '0775', @@ -54,6 +54,24 @@ name => 'integration.mediawiki.org', } + # Written to by jenkins for automatically generated + # documentations + file { '/srv/org/wikimedia/doc': +ensure => directory, +mode => '0775', +owner => 'jenkins', +group => 'jenkins', + } + file { '/etc/apache2/sites-available/doc.wikimedia.org': +mode => '0444', +owner => 'root', +group => 'root', +source => 'puppet:///modules/contint/apache/doc.wikimedia.org', + } + apache_site { 'doc.wikimedia.org': +name => 'doc.wikimedia.org', + } + file { '/srv/localhost': ensure => directory, mode => '0775', -- To view, visit https://gerrit.wikimedia.org/r/53958 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a503f65ea15e160ae4b5e1a8110c5bfba37a348 Gerrit-PatchSet: 7 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Krinkle Gerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: Hashar Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Ryan Lane Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] WTS Code cleanup: Simplify calls to serializeChildren - change (mediawiki...Parsoid)
Subramanya Sastry has uploaded a new change for review. https://gerrit.wikimedia.org/r/56611 Change subject: WTS Code cleanup: Simplify calls to serializeChildren .. WTS Code cleanup: Simplify calls to serializeChildren * No change in parser test results. Change-Id: Iabf7a6e819762fbaf75a348e51da5dd3f0978bfc --- M js/lib/mediawiki.WikitextSerializer.js 1 file changed, 39 insertions(+), 35 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/11/56611/1 diff --git a/js/lib/mediawiki.WikitextSerializer.js b/js/lib/mediawiki.WikitextSerializer.js index 667233e..f3fbe8a 100644 --- a/js/lib/mediawiki.WikitextSerializer.js +++ b/js/lib/mediawiki.WikitextSerializer.js @@ -374,37 +374,41 @@ // Serialize the children of a DOM node, sharing the global serializer // state. Typically called by a DOM-based handler to continue handling its // children. - serializeChildren: function(nodes, chunkCB, wtEscaper, forceSep) { + serializeChildren: function(node, chunkCB, wtEscaper, forceSep) { var oldCB = this.chunkCB, - oldSep = this.sep; + oldSep = this.sep, + children = node.childNodes, + child = children[0], + nextChild; + this.chunkCB = chunkCB; if ( wtEscaper ) { this.wteHandlerStack.push(wtEscaper); } - var node = nodes[0], - parentNode = node && node.parentNode, - nextNode; - while (node) { - nextNode = this.serializer._serializeNode(node, this); - if (nextNode === parentNode) { + + while (child) { + nextChild = this.serializer._serializeNode(child, this); + if (nextChild === node) { // serialized all children break; - } else if (nextNode === node) { + } else if (nextChild === child) { // advance the child - node = node.nextSibling; + child = child.nextSibling; } else { - //console.log('nextNode', nextNode && nextNode.outerHTML); - node = nextNode; + //console.log('nextChild', nextChild && nextChild.outerHTML); + child = nextChild; } } + if (forceSep && oldSep === this.sep) { // Force separator out - if (nodes.length) { - chunkCB('', nodes.last()); + if (children.length) { + chunkCB('', children.last()); } else { chunkCB('', {nodeName: 'fooobar'}); } } + this.chunkCB = oldCB; if ( wtEscaper ) { this.wteHandlerStack.pop(); @@ -430,7 +434,7 @@ bits.push(res); }; this.sep = {}; - this.serializeChildren(node.childNodes, cb, wtEscaper); + this.serializeChildren(node, cb, wtEscaper); self.serializer.emitSeparator(this, cb, node); // restore the separator state this.sep = sepState; @@ -1115,7 +1119,7 @@ handle: function(node, state, cb) { cb(headingWT, node); if (node.childNodes.length) { - state.serializeChildren(node.childNodes, cb, state.serializer.wteHandlers.headingHandler); + state.serializeChildren(node, cb, state.serializer.wteHandlers.headingHandler); } else { // Deal with empty headings cb('', node); @@ -1282,7 +1286,7 @@ cb(state.serializer._getListBullets(node), node); } // Just serialize the children, ignore the (implicit) tbody - state.serializeChildren(node.childNodes, cb, state.serializer.wteHandlers.liHandler, true); + state.serializeChildren(node, cb, state.serializer.wteHandlers.liHandler, true); }, sepnls: { before: function (node, otherNode) { @@ -1312,7 +1316,7 @@ cb(state.serializer._getListBullets(node), node);
[MediaWiki-commits] [Gerrit] Need single quotes since ${name} is literal - change (operations/puppet)
Demon has uploaded a new change for review. https://gerrit.wikimedia.org/r/56612 Change subject: Need single quotes since ${name} is literal .. Need single quotes since ${name} is literal Change-Id: Ie1934cc9c7c5ab27e5ad82aa48bc0f08c0c42852 --- M manifests/role/gerrit.pp 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/12/56612/1 diff --git a/manifests/role/gerrit.pp b/manifests/role/gerrit.pp index 1473e03..fa8f11e 100644 --- a/manifests/role/gerrit.pp +++ b/manifests/role/gerrit.pp @@ -30,8 +30,8 @@ replication => { # If adding a new entry, remember to add the fingerprint to gerrit2's known_hosts "inside-wmf" => { - "url" => "gerritsl...@formey.wikimedia.org:/var/lib/gerrit2/review_site/git/${name}.git - url = gerritsl...@gallium.wikimedia.org:/var/lib/git/${name}.git", + "url" => 'gerritsl...@formey.wikimedia.org:/var/lib/gerrit2/review_site/git/${name}.git + url = gerritsl...@gallium.wikimedia.org:/var/lib/git/${name}.git', "threads" => "4", "mirror" => "true", }, -- To view, visit https://gerrit.wikimedia.org/r/56612 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1934cc9c7c5ab27e5ad82aa48bc0f08c0c42852 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Demon ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use file name for images with descriptions with templates - change (mediawiki...MobileFrontend)
JGonera has uploaded a new change for review. https://gerrit.wikimedia.org/r/56613 Change subject: Use file name for images with descriptions with templates .. Use file name for images with descriptions with templates Strip File: and extension. Change-Id: Ie1fc7f0591b6312fbdd45d9889895d74b25ded02 --- M javascripts/specials/uploads.js 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/13/56613/1 diff --git a/javascripts/specials/uploads.js b/javascripts/specials/uploads.js index 654f284..c0f93be 100644 --- a/javascripts/specials/uploads.js +++ b/javascripts/specials/uploads.js @@ -55,6 +55,10 @@ index = text.indexOf( '== {{int:filedesc}} ==' ); if ( index > - 1 ) { summary = $.trim( text.substr( index ).split( '==' )[ 2 ] ); + // if description contains templates, don't use it (FIXME?) + if ( summary.indexOf( '{{' ) !== -1 ) { + summary = ''; + } } return summary; } @@ -81,7 +85,7 @@ } ); $( pages ).each( function() { imageData[ this.title ].description = extractDescription( this.revisions[0]['*'] ) || - mw.msg( 'mobile-frontend-listed-image-no-description' ); + this.title.replace( /^File:/, '' ).replace( /\.[^\.]+$/, '' ); } ); callback( imageData ); } ); -- To view, visit https://gerrit.wikimedia.org/r/56613 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1fc7f0591b6312fbdd45d9889895d74b25ded02 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: JGonera ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Looking up udp2log socket stats by port instead of socket in... - change (operations/puppet)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/56614 Change subject: Looking up udp2log socket stats by port instead of socket inode. .. Looking up udp2log socket stats by port instead of socket inode. Change-Id: Ib2bdec0204faf6d296926a0ca8ab96d51da30bf9 --- M files/ganglia/plugins/udp2log_socket.py 1 file changed, 33 insertions(+), 33 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/14/56614/1 diff --git a/files/ganglia/plugins/udp2log_socket.py b/files/ganglia/plugins/udp2log_socket.py index 569a773..e149d81 100644 --- a/files/ganglia/plugins/udp2log_socket.py +++ b/files/ganglia/plugins/udp2log_socket.py @@ -1,18 +1,18 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- """ -Gmond module for aggregating and posting udp2log socket stats. Easily -adaptable to other processes. +Gmond module for aggregating and posting udp2log socket stats. Notes: - If multiple udp2log instances are running, their stats will be aggregated. -- The user running this script must have read rights on the file - descriptors owned by udp2log. - -TODO (Ori.livneh, 6-Aug-2012): Rather than hard-code udp2log, grab the -process pattern from 'params' argument to metric_init. If key is missing, -tally queues / drops for all open UDP sockets. +- Ori's original script read from /proc//fd to + find socket inodes. These were used for finding + socket stats in /proc/net/udp. ganglia does not have + read permissions on /proc//fd. Instead, this + script now finds the udp2log listen port in the + udp2log command line, and uses that to find socket + stats in /proc/net/udp. Original: https://github.com/atdt/python-udp-gmond @@ -46,10 +46,21 @@ "drops": "udp2log Dropped Packets" } -def pgrep(pattern): -"""Get a list of process ids whose invocation matches `pattern`""" -return [pid for pid in iter_pids() if pattern in get_cmd(pid)[0]] - +def get_udp2log_ports(): +"""Returns the listen ports of running udp2log processes""" +pattern = "/usr/bin/udp2log" +ports = [] +for pid in iter_pids(): +cmd = get_cmd(pid) +if pattern in cmd[0]: +print(cmd) +p_index = False +try: +p_index = cmd.index('-p') +except ValueError, e: +continue +ports.append(int(cmd[p_index + 1])) +return ports def get_cmd(pid): """Get the command-line instantiation for a given process id""" @@ -58,35 +69,24 @@ def iter_pids(): -"""Returns an iterator of process ids of running processes""" +"""Returns an iterator of process ids of all running processes""" return (int(node) for node in os.listdir('/proc') if node.isdigit()) - - -def iter_fds(pid): -"""Iterate file descriptors owned by process with id `pid`""" -fd_path = '/proc/%s/fd' % pid -return (os.path.join(fd_path, fd) for fd in os.listdir(fd_path)) - - -def get_socket_inodes(pid): -"""Get inodes of process's sockets""" -stats = (os.stat(fd) for fd in iter_fds(pid)) -return [fd_stats.st_ino for fd_stats in stats if -stat.S_ISSOCK(fd_stats.st_mode)] def check_udp_sockets(): """ Gets the number of packets in each active UDP socket's tx/rx queues and the number of dropped packets. Returns a dictionary of dictionaries, keyed to -socket inodes, with sub-keys 'tx_queue', 'rx_queue' and 'drops'. +socket port, with sub-keys 'tx_queue', 'rx_queue' and 'drops'. """ sockets = {} with open('/proc/net/udp', 'rt') as f: f.readline() # Consume and discard header line for line in f: values = line.replace(':', ' ').split() -sockets[int(values[13])] = { +# key by integer port value. +# e.g. Convert 20E4 hex to int 8420. +sockets[int(values[2], 16)] = { 'tx_queue' : int(values[6], 16), 'rx_queue' : int(values[7], 16), 'drops': int(values[16]) @@ -98,12 +98,12 @@ """ Aggregate data about all running udp2log instances """ -inodes = [] -for udp2log_instance in pgrep('udp2log'): -inodes.extend(get_socket_inodes(udp2log_instance)) aggr = dict(tx_queue=0, rx_queue=0, drops=0) -for inode, status in check_udp_sockets().items(): -if inode in inodes: +ports = get_udp2log_ports() +for port, status in check_udp_sockets().items(): +# if the udp socket is a udp2log port, +# aggregate the stats. +if port in ports: aggr['tx_queue'] += status['tx_queue'] aggr['rx_queue'] += status['rx_queue'] aggr['drops'] += status['drops'] -- To view, visit https://gerrit.wikimedia.org/r/56614 To unsubscribe, visit https://gerrit.wikime
[MediaWiki-commits] [Gerrit] Re-enabled async upload for commons. - change (operations/mediawiki-config)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/56615 Change subject: Re-enabled async upload for commons. .. Re-enabled async upload for commons. Change-Id: I930c68bcbc3eb91720aacf621d055089f62c3900 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/15/56615/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index a66aac8..4d277d1 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -978,6 +978,7 @@ 'default' => false, 'testwiki' => true, 'test2wiki' => true, + 'commonswiki' => true ), # wgUploadNavigationUrl @{ -- To view, visit https://gerrit.wikimedia.org/r/56615 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I930c68bcbc3eb91720aacf621d055089f62c3900 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aaron Schulz ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix MWImageNode dimensions and implement toDomElements - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Fix MWImageNode dimensions and implement toDomElements .. Fix MWImageNode dimensions and implement toDomElements Using element.height was returning 0 if the attribute was empty when in fact what we mean to store is null (i.e. auto height). This takes care of the writing of attributes in CE as jQuery ignores an attribute-set command if the value is null. Also in this commit I've implemented a basic toDomElements that outputs the original HTML (code copied from AlienNode). This stops the code from throwing an exception but will eventually need to be rewritten to rebuild the HTML from the attributes stored in the DM. Bug: 56336 Change-Id: I297a1d0a07e9ebf9d0110fb1cdf266f8415f25b7 --- M modules/ve/dm/nodes/ve.dm.MWImageNode.js M modules/ve/test/dm/ve.dm.Converter.test.js M modules/ve/test/dm/ve.dm.example.js 3 files changed, 43 insertions(+), 7 deletions(-) Approvals: Trevor Parscal: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve/dm/nodes/ve.dm.MWImageNode.js b/modules/ve/dm/nodes/ve.dm.MWImageNode.js index 6601c84..e905a34 100644 --- a/modules/ve/dm/nodes/ve.dm.MWImageNode.js +++ b/modules/ve/dm/nodes/ve.dm.MWImageNode.js @@ -30,17 +30,34 @@ ve.dm.MWImageNode.static.matchRdfaTypes = [ 'mw:Image' ]; +ve.dm.MWImageNode.static.storeHtmlAttributes = false; + ve.dm.MWImageNode.static.toDataElement = function ( domElements ) { + var $node = $( domElements[0].childNodes[0] ), + width = $node.attr( 'width' ), + height = $node.attr( 'height' ), + html = $( '', domElements[0].ownerDocument ).append( $( domElements ).clone() ).html(); + return { - 'type': 'MWimage', + 'type': this.name, 'attributes': { - 'src': domElements[0].childNodes[0].src, - 'width': domElements[0].childNodes[0].width, - 'height': domElements[0].childNodes[0].height - } + 'src': $node.attr( 'src' ), + 'width': width !== '' ? Number( width ) : null, + 'height': height !== '' ? Number( height ) : null, + // TODO: don't store html, just enough attributes to rebuild + 'html': html + }, }; }; +ve.dm.MWImageNode.static.toDomElements = function ( dataElement ) { + //TODO: rebuild html from attributes + var wrapper = document.createElement( 'div' ); + wrapper.innerHTML = dataElement.attributes.html; + // Convert wrapper.children to an array + return Array.prototype.slice.call( wrapper.childNodes, 0 ); +}; + /* Registration */ ve.dm.modelRegistry.register( ve.dm.MWImageNode ); diff --git a/modules/ve/test/dm/ve.dm.Converter.test.js b/modules/ve/test/dm/ve.dm.Converter.test.js index f45855f..557a73a 100644 --- a/modules/ve/test/dm/ve.dm.Converter.test.js +++ b/modules/ve/test/dm/ve.dm.Converter.test.js @@ -38,7 +38,7 @@ } } ); -QUnit.test( 'getDataFromDom', 49, function ( assert ) { +QUnit.test( 'getDataFromDom', 50, function ( assert ) { var msg, cases = ve.dm.example.domToDataCases; @@ -59,7 +59,7 @@ } } ); -QUnit.test( 'getDomFromData', 53, function ( assert ) { +QUnit.test( 'getDomFromData', 54, function ( assert ) { var msg, cases = ve.dm.example.domToDataCases; diff --git a/modules/ve/test/dm/ve.dm.example.js b/modules/ve/test/dm/ve.dm.example.js index 31886f5..59a75f9 100644 --- a/modules/ve/test/dm/ve.dm.example.js +++ b/modules/ve/test/dm/ve.dm.example.js @@ -675,6 +675,8 @@ } }; +ve.dm.example.MWImageHtml = ''; + ve.dm.example.domToDataCases = { 'paragraph with plain text': { 'html': 'abc', @@ -705,6 +707,23 @@ { 'type': '/paragraph' } ] }, + 'mw:Image': { + 'html': '' + ve.dm.example.MWImageHtml + '', + 'data': [ + { 'type': 'paragraph' }, + { + 'type': 'MWimage', + 'attributes': { + 'src': '/index.php?title=Special:FilePath/image.png&width=500', + 'width': 500, + 'height': null, + 'html': ve.dm.example.MWImageHtml + } + }, + { 'type': '/MWimage' }, + { 'type': '/paragraph' } + ] + }, 'paragraph with alienInline inside': { 'html': 'abc', 'data': [ -- To view, visit https://gerrit.wikimedia.org/r/56595 To unsubscribe, vis
[MediaWiki-commits] [Gerrit] Introducing Python Fundraiser Stats! - change (wikimedia...tools)
Demon has submitted this change and it was merged. Change subject: Introducing Python Fundraiser Stats! .. Introducing Python Fundraiser Stats! Generate all your flat file needs with this one horrific script! Change-Id: I6ab75c986fcc6823c2064d2ccd11c1d022e9e31b --- A FundraiserStatisticsGen/fundstatgen.cfg A FundraiserStatisticsGen/fundstatgen.py 2 files changed, 181 insertions(+), 0 deletions(-) Approvals: Demon: Verified; Looks good to me, approved diff --git a/FundraiserStatisticsGen/fundstatgen.cfg b/FundraiserStatisticsGen/fundstatgen.cfg new file mode 100644 index 000..75b1d1e --- /dev/null +++ b/FundraiserStatisticsGen/fundstatgen.cfg @@ -0,0 +1,6 @@ +[MySQL] +hostname= +port=3306 +username= +password= +database=civicrm \ No newline at end of file diff --git a/FundraiserStatisticsGen/fundstatgen.py b/FundraiserStatisticsGen/fundstatgen.py new file mode 100644 index 000..98fcebc --- /dev/null +++ b/FundraiserStatisticsGen/fundstatgen.py @@ -0,0 +1,175 @@ +#!/usr/bin/python + +import sys +import MySQLdb as db +import csv +from optparse import OptionParser +from ConfigParser import SafeConfigParser +from operator import itemgetter + +def main(): +# Extract any command line options +parser = OptionParser(usage="usage: %prog [options] ") +parser.add_option("-c", "--config", dest='configFile', default=None, help='Path to configuration file') +(options, args) = parser.parse_args() + +if len(args) != 1: +parser.print_help() +exit(1) +workingDir = args[0] + +# Load the configuration from the file +config = SafeConfigParser() +fileList = ['./fundstatgen.cfg'] +if options.configFile is not None: +fileList.append(options.configFile) +config.read(fileList) + +# === BEGIN PROCESSING === +print("Running query...") +stats = getPerYearData( +config.get('MySQL', 'hostname'), +config.getint('MySQL', 'port'), +config.get('MySQL', 'username'), +config.get('MySQL', 'password'), +config.get('MySQL', 'database') +) + +print("Pivoting data into year/day form...") +(years, pivot) = pivotDataByYear(stats) + +print("Writing output files...") +createSingleOutFile(stats, 'date', workingDir + '/donationdata-vs-day.csv') +createOutputFiles(pivot, 'date', workingDir + '/yeardata-day-vs-', years) + + +def getPerYearData(host, port, username, password, database): +""" +Obtain basic statistics (USD sum, number donations, USD avg amount, USD max amount, +USD YTD sum) per day from the MySQL server. + +Returns a dict like: {date => {report type => {value}} where report types are: +- sum, refund_sum, donations, refunds, avg, max, ytdsum, ytdloss +""" +con = db.connect(host=host, port=port, user=username, passwd=password, db=database) +cur = con.cursor() +cur.execute(""" +SELECT + DATE_FORMAT(receive_date, "%Y-%m-%d") as receive_date, + SUM(IF(total_amount >= 0, total_amount, 0)) as credit, + SUM(IF(total_amount >= 0, 1, 0)) as credit_count, + SUM(IF(total_amount < 0, total_amount, 0)) as refund, + SUM(IF(total_amount < 0, 1, 0)) as refund_count, + AVG(IF(total_amount >= 0, total_amount, 0)) as `avg`, + MAX(total_amount) +FROM civicrm_contribution +WHERE receive_date >= '2006-01-01' +GROUP BY DATE_FORMAT(receive_date, "%Y-%m-%d") ASC; +""") + +data = {} +ytdCreditSum = 0 +ytdRefundSum = 0 +cyear = 0 +for row in cur: +(date, credit_sum, credit_count, refund_sum, refund_count, avg, max) = row +year = int(date[0:4]) +credit_sum = float(credit_sum) +credit_count = int(credit_count) +refund_sum = float(refund_sum) +refund_count = int(refund_count) +avg = float(avg) +max = float(max) + +if cyear != year: +ytdCreditSum = 0 +ytdRefundSum = 0 +ytdCreditSum += credit_sum +ytdRefundSum += refund_sum + +data[date] = { +'sum': credit_sum, +'refund_sum': refund_sum, +'donations': credit_count, +'refunds': refund_count, +'avg': avg, +'max': max, +'ytdsum': ytdCreditSum, +'ytdloss': ytdRefundSum +} + +del cur +con.close() +return data + + +def pivotDataByYear(stats): +""" +Transformation of the statistical data -- grouping reports by date + +Returns ((list of years), {report: {date: [year data]}}) +""" +years = [] +pivot = {} + +reports = stats.values()[0].keys() +for report in reports: +pivot[report] = {} + +# Do the initial pivot +for date in stats: +(year, month, day) = date.split('-') +if year not in years: +years.append(year) + +for report in repo
[MediaWiki-commits] [Gerrit] I hate when people change parameter names - change (operations/puppet)
Demon has uploaded a new change for review. https://gerrit.wikimedia.org/r/56616 Change subject: I hate when people change parameter names .. I hate when people change parameter names Change-Id: I7072e0639564b07549e89f529752aaf5ab5df981 --- M files/gerrit/hooks/comment-added 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/16/56616/1 diff --git a/files/gerrit/hooks/comment-added b/files/gerrit/hooks/comment-added index c3a8bfa..57b9eed 100755 --- a/files/gerrit/hooks/comment-added +++ b/files/gerrit/hooks/comment-added @@ -14,8 +14,8 @@ self.parser.add_option("--commit", dest="commit") self.parser.add_option("--comment", dest="comment") self.parser.add_option("--topic", dest="topic") -self.parser.add_option("--VRIF", dest="verified") -self.parser.add_option("--CRVW", dest="codereview") +self.parser.add_option("--Verified", dest="verified") +self.parser.add_option("--Code-Review", dest="codereview") self.parser.add_option("--is-draft", dest="draft") (options, args) = self.parser.parse_args() if options.draft == "true": -- To view, visit https://gerrit.wikimedia.org/r/56616 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7072e0639564b07549e89f529752aaf5ab5df981 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Demon ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] I hate when people change parameter names - change (operations/puppet)
Ryan Lane has submitted this change and it was merged. Change subject: I hate when people change parameter names .. I hate when people change parameter names Change-Id: I7072e0639564b07549e89f529752aaf5ab5df981 --- M files/gerrit/hooks/comment-added 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Ryan Lane: Looks good to me, approved jenkins-bot: Verified diff --git a/files/gerrit/hooks/comment-added b/files/gerrit/hooks/comment-added index c3a8bfa..57b9eed 100755 --- a/files/gerrit/hooks/comment-added +++ b/files/gerrit/hooks/comment-added @@ -14,8 +14,8 @@ self.parser.add_option("--commit", dest="commit") self.parser.add_option("--comment", dest="comment") self.parser.add_option("--topic", dest="topic") -self.parser.add_option("--VRIF", dest="verified") -self.parser.add_option("--CRVW", dest="codereview") +self.parser.add_option("--Verified", dest="verified") +self.parser.add_option("--Code-Review", dest="codereview") self.parser.add_option("--is-draft", dest="draft") (options, args) = self.parser.parse_args() if options.draft == "true": -- To view, visit https://gerrit.wikimedia.org/r/56616 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7072e0639564b07549e89f529752aaf5ab5df981 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Demon Gerrit-Reviewer: Ryan Lane Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Story 400: Deal with first time user upload - change (mediawiki...MobileFrontend)
JGonera has submitted this change and it was merged. Change subject: Story 400: Deal with first time user upload .. Story 400: Deal with first time user upload Update photo success handler to show the upload count in case it has been hidden and destroy the carousel Change-Id: Idc891a2b420f1e9b715694519a710c7686e91657 --- M MobileFrontend.i18n.php M MobileFrontend.php M includes/MobileFrontend.hooks.php M javascripts/specials/uploads.js A javascripts/widgets/carousel.js M less/mf-mixins.less M less/mf-variables.less M less/specials/uploads.less A stylesheets/specials/images/uploads/Indicator_active.png A stylesheets/specials/images/uploads/Indicator_default.png A stylesheets/specials/images/uploads/SplashScreen1.png A stylesheets/specials/images/uploads/SplashScreen2.png A stylesheets/specials/images/uploads/SplashScreen3.png A stylesheets/specials/images/uploads/Tour_1.png A stylesheets/specials/images/uploads/Tour_2.png A stylesheets/specials/images/uploads/Tour_3.png A stylesheets/specials/images/uploads/chevron_left.png A stylesheets/specials/images/uploads/chevron_right.png M stylesheets/specials/uploads.css A templates/specials/uploads/carousel.html M tests/js/fixtures-templates.js A tests/js/widgets/carousel.js 22 files changed, 309 insertions(+), 7 deletions(-) Approvals: JGonera: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php index 95fd39d..4a254ce 100644 --- a/MobileFrontend.i18n.php +++ b/MobileFrontend.i18n.php @@ -181,6 +181,9 @@ 'mobile-frontend-listed-image-no-description' => 'No description', 'mobile-frontend-donate-photo-upload-success' => 'Success! Your image can now be used on {{SITENAME}}!', 'mobile-frontend-donate-photo-first-upload-success' => 'Success! Thanks for your first contribution!', + 'mobile-frontend-first-upload-wizard-page-1' => '{{SITENAME}} needs your photos to bring its pages to life!', + 'mobile-frontend-first-upload-wizard-page-2' => 'Please only donate photos that you took yourself.', + 'mobile-frontend-first-upload-wizard-page-3' => 'Your donated photos can be shared, reused, and remixed by millions.', // watchlist 'mobile-frontend-watchlist-add' => 'Added $1 to your watchlist', @@ -232,7 +235,7 @@ 'mobile-frontend-photo-ownership' => 'I, $1, created this image.', 'mobile-frontend-photo-ownership-help' => 'What does this mean?', 'mobile-frontend-photo-ownership-confirm' => 'Got it!', - 'mobile-frontend-photo-ownership-bullet-one' => 'We can only accept images that you took yourself. Please do not upload images you found somewhere else on the Internet.', + 'mobile-frontend-photo-ownership-bullet-one' => 'We can only accept photos that you took yourself. Please do not upload images you found somewhere else on the Internet.', 'mobile-frontend-photo-ownership-bullet-two' => 'Copyrighted and inappropriate images will be removed.', 'mobile-frontend-photo-ownership-bullet-three' => 'Your uploads are released under a free license and can be reused by anyone for free.', 'mobile-frontend-image-uploading-wait' => 'Uploading image, please wait.', @@ -534,6 +537,9 @@ 'mobile-frontend-listed-image-no-description' => 'What to show when no description available', 'mobile-frontend-donate-photo-upload-success' => 'On upload page - notification shown after a successful upload', 'mobile-frontend-donate-photo-first-upload-success' => 'On upload page - notification shown after a successful upload when it is the first upload by that user', + 'mobile-frontend-first-upload-wizard-page-1' => 'Message shown to users who have never uploaded a photo to commons. Explain why photos are important.', + 'mobile-frontend-first-upload-wizard-page-2' => 'Explains important of the photos being owned by the person uploading them.', + 'mobile-frontend-first-upload-wizard-page-3' => 'Explains implications of uploading a photo.', 'mobile-frontend-watchlist-add' => 'Notification message when you add an article to your watchlist *$1 - the title of the article', 'mobile-frontend-watchlist-removed' => 'Notification message when you remove an article from your watchlist diff --git a/MobileFrontend.php b/MobileFrontend.php index d1f9b14..2567ac0 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -157,6 +157,15 @@ 'targets' => 'mobile', ); +/** + * A boilerplate for the MFResourceLoaderModule that supports templates + */ +$wgMFMobileResourceTemplateBoilerplate = array( + 'localBasePath' => $localBasePath, + 'localTemplateBasePath' => $localBasePath . '/templates', + 'class' => 'MFResourceLoaderModule', +); + // Filepages $wgResourceModules['mobile.file.styles'] = $wgMFMobileResourceBoilerplate + array( 'dependencies' =>
[MediaWiki-commits] [Gerrit] Removing debug statement - change (operations/puppet)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/56617 Change subject: Removing debug statement .. Removing debug statement Change-Id: Idb464f6d9b5b1438e273cbb53b2856cd7bfdb7dc --- M files/ganglia/plugins/udp2log_socket.py 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/17/56617/1 diff --git a/files/ganglia/plugins/udp2log_socket.py b/files/ganglia/plugins/udp2log_socket.py index e149d81..37c4019 100644 --- a/files/ganglia/plugins/udp2log_socket.py +++ b/files/ganglia/plugins/udp2log_socket.py @@ -53,7 +53,6 @@ for pid in iter_pids(): cmd = get_cmd(pid) if pattern in cmd[0]: -print(cmd) p_index = False try: p_index = cmd.index('-p') -- To view, visit https://gerrit.wikimedia.org/r/56617 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idb464f6d9b5b1438e273cbb53b2856cd7bfdb7dc Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Removing debug statement - change (operations/puppet)
Ottomata has submitted this change and it was merged. Change subject: Removing debug statement .. Removing debug statement Change-Id: Idb464f6d9b5b1438e273cbb53b2856cd7bfdb7dc --- M files/ganglia/plugins/udp2log_socket.py 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Ottomata: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/files/ganglia/plugins/udp2log_socket.py b/files/ganglia/plugins/udp2log_socket.py index e149d81..37c4019 100644 --- a/files/ganglia/plugins/udp2log_socket.py +++ b/files/ganglia/plugins/udp2log_socket.py @@ -53,7 +53,6 @@ for pid in iter_pids(): cmd = get_cmd(pid) if pattern in cmd[0]: -print(cmd) p_index = False try: p_index = cmd.index('-p') -- To view, visit https://gerrit.wikimedia.org/r/56617 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idb464f6d9b5b1438e273cbb53b2856cd7bfdb7dc Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata Gerrit-Reviewer: Ottomata Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove tumbleweed code for WLM banner - change (mediawiki...MobileFrontend)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/56618 Change subject: Remove tumbleweed code for WLM banner .. Remove tumbleweed code for WLM banner This was added to allow banners in WLM. Going forward we should use CentralNotice instead Change-Id: Ibf582717ca2f8c513177b2340c9a1f70c58d2b3e --- M includes/skins/SkinMobileBase.php 1 file changed, 0 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/18/56618/1 diff --git a/includes/skins/SkinMobileBase.php b/includes/skins/SkinMobileBase.php index 297db88..75ad4b7 100644 --- a/includes/skins/SkinMobileBase.php +++ b/includes/skins/SkinMobileBase.php @@ -57,24 +57,6 @@ $this->extMobileFrontend = $extMobileFrontend; } - /** -* createDismissableBanner -* -* @param $id string: unique identification string for banner to distinguish it from other banners -* @param $content string: html string to put in banner -* @param $classNames string: additional classes that can be added to the banner. In particular used to target certain devices (e.g. android) -* @param $bannerStyle string: additional styling for banner -* @return string -*/ - public function createDismissableBanner( $id, $content="", $classNames="", $bannerStyle="" ) { - return << - {$content} - -HTML; - } - public function outputPage( OutputPage $out = null ) { global $wgMFNoindexPages; wfProfileIn( __METHOD__ ); -- To view, visit https://gerrit.wikimedia.org/r/56618 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf582717ca2f8c513177b2340c9a1f70c58d2b3e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] WebRequest::getRequestURL: Follow up Ibe00a6b8 - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: WebRequest::getRequestURL: Follow up Ibe00a6b8 .. WebRequest::getRequestURL: Follow up Ibe00a6b8 * Only match consecutive slashes at the beginning of the URL, where they are actually a problem. * Fix bug 46607 in cases where the server provides an absolute URL. Change-Id: Ibe00a6b8722786170d09b846c1c4054b73da3d9e --- M includes/WebRequest.php 1 file changed, 3 insertions(+), 6 deletions(-) Approvals: MarkAHershberger: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 739340c..3bdf645 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -656,14 +656,11 @@ } if( $base[0] == '/' ) { - if( isset( $base[1] ) && $base[1] == '/' ) { /* More than one slash will look like it is protocol relative */ - return preg_replace( '!//*!', '/', $base ); - } - - return $base; + // More than one slash will look like it is protocol relative + return preg_replace( '!^/+!', '/', $base ); } else { // We may get paths with a host prepended; strip it. - return preg_replace( '!^[^:]+://[^/]+/!', '/', $base ); + return preg_replace( '!^[^:]+://[^/]+/+!', '/', $base ); } } -- To view, visit https://gerrit.wikimedia.org/r/56344 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibe00a6b8722786170d09b846c1c4054b73da3d9e Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: PleaseStand Gerrit-Reviewer: MarkAHershberger Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Drop doc mention of removed importUseModWiki.php script - change (mediawiki/core)
Brion VIBBER has uploaded a new change for review. https://gerrit.wikimedia.org/r/56619 Change subject: Drop doc mention of removed importUseModWiki.php script .. Drop doc mention of removed importUseModWiki.php script The script was removed in commit f51b580f0c7ee63539e16d3017f8dd0de0ee2391 (October 2011) due to lack of maintenance. Change-Id: Ida8369d4ad9326664b072adb0cb73f2f24465d1e --- M UPGRADE 1 file changed, 0 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/19/56619/1 diff --git a/UPGRADE b/UPGRADE index 7987b22..96b5836 100644 --- a/UPGRADE +++ b/UPGRADE @@ -296,18 +296,3 @@ in late August 2003) you may need to manually run some of the update SQL scripts in maintenance/archives before the installer is able to pick up with remaining updates. - - -== Upgrading from UseModWiki or old "phase 2" Wikipedia code == - -There is a semi-maintained UseModWiki to MediaWiki conversion script at -maintenance/importUseModWiki.php; it may require tweaking and customization -to work for you. - -Install a new MediaWiki first, then use the conversion script which will -output SQL statements; direct these to a file and then run that into your -database. - -You will have to rebuild the links tables etc after importing. - - -- To view, visit https://gerrit.wikimedia.org/r/56619 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida8369d4ad9326664b072adb0cb73f2f24465d1e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Brion VIBBER ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Several Parsoid-specific tests for serializer edge cases. - change (mediawiki/core)
Subramanya Sastry has uploaded a new change for review. https://gerrit.wikimedia.org/r/56620 Change subject: Several Parsoid-specific tests for serializer edge cases. .. Several Parsoid-specific tests for serializer edge cases. * For catching future serializer regressions. * For fixing existing incorrect serialization. Change-Id: Ifbb7da59f65e790b66a621b7964179e4eb1f3fc4 --- M tests/parser/parserTests.txt 1 file changed, 96 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/20/56620/1 diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index d3bd6a5..af9eea3 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -6007,6 +6007,15 @@ !!end !!test +Templates: HTML Tag: 7. Generation of partial attribute key string +!!input +foo +!!result +foo + +!!end + +!!test Templates: HTML Tables: 1. Generating start of a HTML table !!input {{echo|foo}} @@ -14203,6 +14212,93 @@ !! end +### +### Parsoid-centric tests for testing RTing of inter-element separators +### Edge cases not tested by existing parser tests and specific to +### Parsoid-specific serialization strategies. +### + +!!test +RT-ed inter-element separators should be valid separators +!!input +{| +|- [[foo]] +|} +!!result + + + + +!!end + +!!test +Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out +(Parsoid-only since PHP parser relies on Tidy for correct output) +!!options +disabled parsoid +!!input +{| +|foo +bar +|} + +{| +|foo +|} +!!result +!!end + +!!test +Empty TD followed by TD with tpl-generated attribute +!!input +{| +|- +| +|{{echo|style='color:red'}}|foo +|} +!!result + + + + + +foo + + +!!end + +!!test +Empty TR followed by a template-generated TR +(Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext) +!!options +disabled parsoid +!!input +{| +|- +{{echo|foo}} +|} +!!result + + + + + +foo +!!end + +!!test +Multi-line image caption generated by templates with/without trailing newlines +!!options +parsoid +!!input +[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]] +[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]] +!!result +File:Foo.jpg foo\nA\nB\nC +File:Foo.jpg foo\nA\nB\nC\n\n + +!!end + TODO: more images more tables -- To view, visit https://gerrit.wikimedia.org/r/56620 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifbb7da59f65e790b66a621b7964179e4eb1f3fc4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Subramanya Sastry ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixing .pyconf module name - change (operations/puppet)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/56621 Change subject: Fixing .pyconf module name .. Fixing .pyconf module name Change-Id: I250fa142b35fe12db152e7fc85af18ea835e6ff0 --- M files/ganglia/plugins/udp2log_socket.pyconf 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/21/56621/1 diff --git a/files/ganglia/plugins/udp2log_socket.pyconf b/files/ganglia/plugins/udp2log_socket.pyconf index 81201d9..3cb3303 100644 --- a/files/ganglia/plugins/udp2log_socket.pyconf +++ b/files/ganglia/plugins/udp2log_socket.pyconf @@ -5,7 +5,7 @@ modules { module { -name = "udp2log_gmond" +name = "udp2log_socket" language = "python" } } -- To view, visit https://gerrit.wikimedia.org/r/56621 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I250fa142b35fe12db152e7fc85af18ea835e6ff0 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixing .pyconf module name - change (operations/puppet)
Ottomata has submitted this change and it was merged. Change subject: Fixing .pyconf module name .. Fixing .pyconf module name Change-Id: I250fa142b35fe12db152e7fc85af18ea835e6ff0 --- M files/ganglia/plugins/udp2log_socket.pyconf 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/files/ganglia/plugins/udp2log_socket.pyconf b/files/ganglia/plugins/udp2log_socket.pyconf index 81201d9..3cb3303 100644 --- a/files/ganglia/plugins/udp2log_socket.pyconf +++ b/files/ganglia/plugins/udp2log_socket.pyconf @@ -5,7 +5,7 @@ modules { module { -name = "udp2log_gmond" +name = "udp2log_socket" language = "python" } } -- To view, visit https://gerrit.wikimedia.org/r/56621 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I250fa142b35fe12db152e7fc85af18ea835e6ff0 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata Gerrit-Reviewer: Ottomata ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Apply IP blocks to X-Forwarded-For header - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Apply IP blocks to X-Forwarded-For header .. Apply IP blocks to X-Forwarded-For header Adds a new configuration variable ($wgApplyIpBlocksToXff), which when enabled will scan the XFF header for IP addresses and check if any of them have been blocked. $wgApplyIpBlocksToXff is disabled by default. Bug: 23343 Change-Id: I3e38b94d10600a60d2d4857de54307f34c4662c4 --- M RELEASE-NOTES-1.21 M includes/Block.php M includes/DefaultSettings.php M includes/User.php M languages/messages/MessagesEn.php M languages/messages/MessagesQqq.php M maintenance/language/messages.inc M tests/phpunit/includes/BlockTest.php 8 files changed, 329 insertions(+), 2 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 56d812c..ff0569e 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -125,6 +125,8 @@ correctly. * (bug 45803) Whitespace within == Headline == syntax and within headings is now non-significant and not preserved in the HTML output. +* (bug 23343) Implemented ability to apply IP blocks to the contents of X-Forwarded-For headers + by adding a new configuration variable $wgApplyIpBlocksToXff (disabled by default). === Bug fixes in 1.21 === * (bug 40353) SpecialDoubleRedirect should support interwiki redirects. diff --git a/includes/Block.php b/includes/Block.php index 7ee36ce..fc8ece6 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -1074,6 +1074,187 @@ return null; } + + /** +* Get all blocks that match any IP from an array of IP addresses. Blocks are +* sorted so that hard blocks are before soft blocks, and blocks that disable +* account creation are before those that don't. +* +* @param Array $ipChain list of IPs (strings), usually retrieved from the +* X-Forwarded-For header of the request +* @param Bool $isAnon Exclude anonymous-only blocks if false +* @param Bool $fromMaster Whether to query the master or slave database +* @return Array of Blocks +* @since 1.21 +*/ + public static function getBlocksForIPList( array $ipChain, $isAnon, $fromMaster = false ) { + if ( !count( $ipChain ) ) { + return array(); + } + + wfProfileIn( __METHOD__ ); + $conds = array(); + foreach ( array_unique( $ipChain ) as $ipaddr ) { + # Discard invalid IP addresses. Since XFF can be spoofed and we do not + # necessarily trust the header given to us, make sure that we are only + # checking for blocks on well-formatted IP addresses (IPv4 and IPv6). + # Do not treat private IP spaces as special as it may be desirable for wikis + # to block those IP ranges in order to stop misbehaving proxies that spoof XFF. + if ( !IP::isValid( $ipaddr ) ) { + continue; + } + # Don't check trusted IPs (includes local squids which will be in every request) + if ( wfIsTrustedProxy( $ipaddr ) ) { + continue; + } + # Check both the original IP (to check against single blocks), as well as build + # the clause to check for rangeblocks for the given IP. + $conds['ipb_address'][] = $ipaddr; + $conds[] = self::getRangeCond( IP::toHex( $ipaddr ) ); + } + + if ( !count( $conds ) ) { + wfProfileOut( __METHOD__ ); + return array(); + } + + if ( $fromMaster ) { + $db = wfGetDB( DB_MASTER ); + } else { + $db = wfGetDB( DB_SLAVE ); + } + $conds = $db->makeList( $conds, LIST_OR ); + if ( !$isAnon ) { + $conds = array( $conds, 'ipb_anon_only' => 0 ); + } + $selectFields = array_merge( + array( 'ipb_range_start', 'ipb_range_end' ), + Block::selectFields() + ); + $rows = $db->select( 'ipblocks', + $selectFields, + $conds, + __METHOD__, + array( 'ORDER BY' => 'ipb_anon_only ASC, ipb_create_account DESC' ) + ); + + $blocks = array(); + foreach ( $rows as $row ) { + $block = self::newFromRow( $row ); + if ( !$block->deleteIfExpir
[MediaWiki-commits] [Gerrit] Make it possible to use a custom selection of translation aids. - change (mediawiki...Translate)
Jarry1250 has uploaded a new change for review. https://gerrit.wikimedia.org/r/56622 Change subject: Make it possible to use a custom selection of translation aids. .. Make it possible to use a custom selection of translation aids. For both removals and additions, the list of TranslationAids available must be set on group-by-group basis. Here, the existing (static) method provides the base set to the MessageGroup and MessageGroupOld base classes. Changes can then be made by overriding the MessageGroup(Old) default set. Custom removals are effected by allowing use of a new UnsupportedTranslationAid class that always errors, ensuring that handlers need only check for the presence of an error response rather than also testing for the existence of a response at all. Custom additions require the new identifier to be registered using a repurposed TranslateTranslationAid hook in addition to the obvious addition to the base list when overriding the base class. Also, expose the group-type via Tux to allow for usable hook runs (it is already exposed in the default interface). _autoload.php and hooks.txt updated accordingly. Change-Id: Ifb0a2d510487bb5f888930a824d227f1ae6d50b2 --- M _autoload.php M api/ApiQueryTranslationAids.php M hooks.txt M messagegroups/MessageGroup.php M messagegroups/MessageGroupBase.php M messagegroups/MessageGroupOld.php M resources/js/ext.translate.editor.helpers.js M translationaids/TranslationAid.php A translationaids/UnsupportedTranslationAid.php M utils/TuxMessageTable.php 10 files changed, 69 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/22/56622/1 diff --git a/_autoload.php b/_autoload.php index 5788ec1..f999050 100644 --- a/_autoload.php +++ b/_autoload.php @@ -265,6 +265,7 @@ $wgAutoloadClasses['SupportAid'] = "$dir/translationaids/SupportAid.php"; $wgAutoloadClasses['TTMServerAid'] = "$dir/translationaids/TTMServerAid.php"; $wgAutoloadClasses['TranslationAid'] = "$dir/translationaids/TranslationAid.php"; +$wgAutoloadClasses['UnsupportedTranslationAid'] = "$dir/translationaids/UnsupportedTranslationAid.php"; $wgAutoloadClasses['UpdatedDefinitionAid'] = "$dir/translationaids/UpdatedDefinitionAid.php"; /**@}*/ diff --git a/api/ApiQueryTranslationAids.php b/api/ApiQueryTranslationAids.php index 392b687..e61030d 100644 --- a/api/ApiQueryTranslationAids.php +++ b/api/ApiQueryTranslationAids.php @@ -42,9 +42,12 @@ $props = $params['prop']; - $types = TranslationAid::getTypes(); + $types = $group->getTranslationAids(); $result = $this->getResult(); foreach ( $props as $type ) { + // Do not continue if not supported for this message group + if( !isset( $types[$type] ) ) continue; + $start = microtime( true ); $class = $types[$type]; $obj = new $class( $group, $handle, $this ); @@ -70,6 +73,7 @@ public function getAllowedParams() { $props = array_keys( TranslationAid::getTypes() ); + wfRunHooks( 'TranslateTranslationAids', array( &$props ) ); return array( 'title' => array( diff --git a/hooks.txt b/hooks.txt index 081402a..52894d5 100644 --- a/hooks.txt +++ b/hooks.txt @@ -142,8 +142,8 @@ array &$list: List of languages indexed by language code string $language: Language code of the language of which language names are in -;TranslateTranslationAids: Allows adding (and removing) new translation aids - array &$types: List of translation aid classes indexed by type identifier +;TranslateTranslationAids: Allows adding new translation aids + array &$types: List of translation aid indentifiers, numerically indexed === JavaScript events === @@ -155,3 +155,7 @@ ;beforeSubmit: Provides an opportunity to modify a Translate translation form immediately before it is submitted jQuery form: The form being submitted + +;showTranslationHelpers: Provides an opportunity to handle custom translation helpers + objectresult.helpers: JSON subset focussing on the helpers returned e.g. result.helpers.definition + jQuerytranslateEditor.$editor: The current translation-editing form diff --git a/messagegroups/MessageGroup.php b/messagegroups/MessageGroup.php index f75cdb0..149a6fe 100644 --- a/messagegroups/MessageGroup.php +++ b/messagegroups/MessageGroup.php @@ -161,4 +161,12 @@ * @return array|null The language codes as array keys. */ public function getTranslatableLanguages(); + + /** +* List of available message types mapped to the classes +* implementing them. +* +* @return array +*/ + public f
[MediaWiki-commits] [Gerrit] Adding class misc::monitoring::net::udp for generic udp stat... - change (operations/puppet)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/56623 Change subject: Adding class misc::monitoring::net::udp for generic udp statistics monitoring. .. Adding class misc::monitoring::net::udp for generic udp statistics monitoring. Including this class on udp2log hosts Change-Id: I8d12d445d176b9231816e81d1abaa212c3987187 --- A files/ganglia/plugins/udp_stats.py A files/ganglia/plugins/udp_stats.pyconf M manifests/misc/monitoring.pp M manifests/misc/udp2log.pp 4 files changed, 155 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/23/56623/1 diff --git a/files/ganglia/plugins/udp_stats.py b/files/ganglia/plugins/udp_stats.py new file mode 100644 index 000..32dee1c --- /dev/null +++ b/files/ganglia/plugins/udp_stats.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Python Gmond Module for UDP Statistics +Original: https://github.com/atdt/python-udp-gmond + +:copyright: (c) 2012 Wikimedia Foundation +:author: Ori Livneh +:license: GPL + +""" +from __future__ import print_function + +import logging +from ast import literal_eval +from threading import Timer + + +UPDATE_INTERVAL = 5 # seconds + +defaults = { +"slope" : "both", +"time_max" : 60, +"format" : "%u", +"value_type" : "uint", +"groups" : "network,udp", +"units" : "packets" +} + +udp_fields = { +"InDatagrams" : "UDP Packets Received", +"NoPorts" : "UDP Packets to Unknown Port Received", +"InErrors" : "UDP Packet Receive Errors", +"OutDatagrams" : "UDP Packets Sent", +"RcvbufErrors" : "UDP Receive Buffer Errors", +"SndbufErrors" : "UDP Send Buffer Errors" +} + +netstats = {} + + +def get_netstats(): +"""Parse /proc/net/snmp""" +with open('/proc/net/snmp', 'rt') as snmp: +raw = {} +for line in snmp: +key, vals = line.split(':', 1) +key = key.lower() +vals = vals.strip().split() +raw.setdefault(key, []).append(vals) +return dict((k, dict(zip(*vs))) for (k, vs) in raw.items()) + + +def update_stats(): +"""Update netstats and schedule the next run""" +netstats.update(get_netstats()) +logging.info("Updated: %s", netstats['udp']) +Timer(UPDATE_INTERVAL, update_stats).start() + + +def metric_handler(name): +"""Get value of particular metric; part of Gmond interface""" +logging.debug('metric_handler(): %s', name) +return literal_eval(netstats['udp'][name]) + + +def metric_init(params): +"""Initialize; part of Gmond interface""" +descriptors = [] +defaults['call_back'] = metric_handler +for name, description in udp_fields.items(): +descriptor = dict(name=name, description=description) +descriptor.update(defaults) +descriptors.append(descriptor) +update_stats() +return descriptors + + +def metric_cleanup(): +"""Teardown; part of Gmond interface""" +pass + + +if __name__ == '__main__': +# When invoked as standalone script, run a self-test by querying each +# metric descriptor and printing it out. +logging.basicConfig(level=logging.DEBUG) +for metric in metric_init({}): +value = metric['call_back'](metric['name']) +print(( "%s => " + metric['format'] ) % ( metric['name'], value )) diff --git a/files/ganglia/plugins/udp_stats.pyconf b/files/ganglia/plugins/udp_stats.pyconf new file mode 100644 index 000..776ce46 --- /dev/null +++ b/files/ganglia/plugins/udp_stats.pyconf @@ -0,0 +1,47 @@ +# Gmond configuration for UDP metric module +# Install to /etc/ganglia/conf.d +# +# Original: https://github.com/atdt/python-udp-gmond + +modules { + module { +name = "udp_stats" +language = "python" + } +} + +collection_group { + collect_every = 10 + time_threshold = 60 + + metric { +name = "InDatagrams" +title = "UDP Packets Received" +value_threshold = 0 + } + metric { +name = "NoPorts" +title = "UDP Packets to Unknown Port Received" +value_threshold = 0 + } + metric { +name = "InErrors" +title = "UDP Packet Receive Errors" +value_threshold = 0 + } + metric { +name = "OutDatagrams" +title = "UDP Packets Sent" +value_threshold = 0 + } + metric { +name = "RcvbufErrors" +title = "UDP Receive Buffer Errors" +value_threshold = 0 + } + metric { +name = "SndbufErrors" +title = "UDP Send Buffer Errors" +value_threshold = 0 + } +} diff --git a/manifests/misc/monitoring.pp b/manifests/misc/monitoring.pp index 311f27a..d1ccbc8 100644 --- a/manifests/misc/monitoring.pp +++ b/manifests/misc/monitoring.pp @@ -26,3 +26,18 @@ #source => "puppet:///files/ganglia/plugins/htcpseqcheck.pyconf"; } } + +# == Class misc::monitoring::net::udp +# Sends UDP statistics to ganglia. +class misc:
[MediaWiki-commits] [Gerrit] Adding class misc::monitoring::net::udp for generic udp stat... - change (operations/puppet)
Ottomata has submitted this change and it was merged. Change subject: Adding class misc::monitoring::net::udp for generic udp statistics monitoring. .. Adding class misc::monitoring::net::udp for generic udp statistics monitoring. Including this class on udp2log hosts Change-Id: I8d12d445d176b9231816e81d1abaa212c3987187 --- A files/ganglia/plugins/udp_stats.py A files/ganglia/plugins/udp_stats.pyconf M manifests/misc/monitoring.pp M manifests/misc/udp2log.pp 4 files changed, 155 insertions(+), 0 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/files/ganglia/plugins/udp_stats.py b/files/ganglia/plugins/udp_stats.py new file mode 100644 index 000..32dee1c --- /dev/null +++ b/files/ganglia/plugins/udp_stats.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Python Gmond Module for UDP Statistics +Original: https://github.com/atdt/python-udp-gmond + +:copyright: (c) 2012 Wikimedia Foundation +:author: Ori Livneh +:license: GPL + +""" +from __future__ import print_function + +import logging +from ast import literal_eval +from threading import Timer + + +UPDATE_INTERVAL = 5 # seconds + +defaults = { +"slope" : "both", +"time_max" : 60, +"format" : "%u", +"value_type" : "uint", +"groups" : "network,udp", +"units" : "packets" +} + +udp_fields = { +"InDatagrams" : "UDP Packets Received", +"NoPorts" : "UDP Packets to Unknown Port Received", +"InErrors" : "UDP Packet Receive Errors", +"OutDatagrams" : "UDP Packets Sent", +"RcvbufErrors" : "UDP Receive Buffer Errors", +"SndbufErrors" : "UDP Send Buffer Errors" +} + +netstats = {} + + +def get_netstats(): +"""Parse /proc/net/snmp""" +with open('/proc/net/snmp', 'rt') as snmp: +raw = {} +for line in snmp: +key, vals = line.split(':', 1) +key = key.lower() +vals = vals.strip().split() +raw.setdefault(key, []).append(vals) +return dict((k, dict(zip(*vs))) for (k, vs) in raw.items()) + + +def update_stats(): +"""Update netstats and schedule the next run""" +netstats.update(get_netstats()) +logging.info("Updated: %s", netstats['udp']) +Timer(UPDATE_INTERVAL, update_stats).start() + + +def metric_handler(name): +"""Get value of particular metric; part of Gmond interface""" +logging.debug('metric_handler(): %s', name) +return literal_eval(netstats['udp'][name]) + + +def metric_init(params): +"""Initialize; part of Gmond interface""" +descriptors = [] +defaults['call_back'] = metric_handler +for name, description in udp_fields.items(): +descriptor = dict(name=name, description=description) +descriptor.update(defaults) +descriptors.append(descriptor) +update_stats() +return descriptors + + +def metric_cleanup(): +"""Teardown; part of Gmond interface""" +pass + + +if __name__ == '__main__': +# When invoked as standalone script, run a self-test by querying each +# metric descriptor and printing it out. +logging.basicConfig(level=logging.DEBUG) +for metric in metric_init({}): +value = metric['call_back'](metric['name']) +print(( "%s => " + metric['format'] ) % ( metric['name'], value )) diff --git a/files/ganglia/plugins/udp_stats.pyconf b/files/ganglia/plugins/udp_stats.pyconf new file mode 100644 index 000..776ce46 --- /dev/null +++ b/files/ganglia/plugins/udp_stats.pyconf @@ -0,0 +1,47 @@ +# Gmond configuration for UDP metric module +# Install to /etc/ganglia/conf.d +# +# Original: https://github.com/atdt/python-udp-gmond + +modules { + module { +name = "udp_stats" +language = "python" + } +} + +collection_group { + collect_every = 10 + time_threshold = 60 + + metric { +name = "InDatagrams" +title = "UDP Packets Received" +value_threshold = 0 + } + metric { +name = "NoPorts" +title = "UDP Packets to Unknown Port Received" +value_threshold = 0 + } + metric { +name = "InErrors" +title = "UDP Packet Receive Errors" +value_threshold = 0 + } + metric { +name = "OutDatagrams" +title = "UDP Packets Sent" +value_threshold = 0 + } + metric { +name = "RcvbufErrors" +title = "UDP Receive Buffer Errors" +value_threshold = 0 + } + metric { +name = "SndbufErrors" +title = "UDP Send Buffer Errors" +value_threshold = 0 + } +} diff --git a/manifests/misc/monitoring.pp b/manifests/misc/monitoring.pp index 311f27a..d1ccbc8 100644 --- a/manifests/misc/monitoring.pp +++ b/manifests/misc/monitoring.pp @@ -26,3 +26,18 @@ #source => "puppet:///files/ganglia/plugins/htcpseqcheck.pyconf"; } } + +# == Class misc::monitoring::net::udp +# Sends UDP statistics to ganglia. +class misc::monitoring::net::udp { + file { + '/us
[MediaWiki-commits] [Gerrit] Remove rel="next" that accompanied returnto. - change (mediawiki/core)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/56624 Change subject: Remove rel="next" that accompanied returnto. .. Remove rel="next" that accompanied returnto. Bug: 46680 Change-Id: Ifaf40c663dc25e51bffc317144d9bdc1dab21785 --- M RELEASE-NOTES-1.21 M includes/OutputPage.php 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/24/56624/1 diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index bac6c2a..50fd734 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -356,6 +356,8 @@ * BREAKING CHANGE: The Services_JSON class has been removed; if necessary, be sure to upgrade affected extensions at the same time (e.g. Collection). * Calling Linker methods using a skin will now output deprecation warnings. +* Pages with a returnto (such as the page when you login or logout), no + longer have a rel="next" link tag. == Compatibility == diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 905b005..0099461 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2401,7 +2401,6 @@ $proto = PROTO_RELATIVE; } - $this->addLink( array( 'rel' => 'next', 'href' => $title->getFullURL( '', false, $proto ) ) ); $link = $this->msg( 'returnto' )->rawParams( Linker::link( $title, $text, array(), $query, $options ) )->escaped(); $this->addHTML( "{$link}\n" ); -- To view, visit https://gerrit.wikimedia.org/r/56624 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifaf40c663dc25e51bffc317144d9bdc1dab21785 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Mattflaschen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Minor QUnit test fixes - change (mediawiki...MobileFrontend)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/56625 Change subject: Minor QUnit test fixes .. Minor QUnit test fixes Avoid using globals Tell test how many to expect Change-Id: Ied1cd5f0ae56951bfad37772a0a73dcd251b51b3 --- M tests/js/widgets/carousel.js 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/25/56625/1 diff --git a/tests/js/widgets/carousel.js b/tests/js/widgets/carousel.js index c812382..904b87e 100644 --- a/tests/js/widgets/carousel.js +++ b/tests/js/widgets/carousel.js @@ -2,9 +2,9 @@ var Carousel = M.require( 'widgets/carousel' ); - module( 'MobileFrontend Carousel' ); + QUnit.module( 'MobileFrontend Carousel' ); - test( '#next', function() { + QUnit.test( '#next', 5, function() { var c = new Carousel(); strictEqual( c.totalPages, 3, 'There are 3 pages in the carousel' ); strictEqual( c.page, 0, 'Initialises to page 0' ); @@ -16,7 +16,7 @@ strictEqual( c.page, 2, 'Still page 2 (no more pages)' ); } ); - test( '#prev', function() { + QUnit.test( '#prev', 4, function() { var c = new Carousel(); strictEqual( c.page, 0, 'Initialises to page 0' ); c.previous(); @@ -27,7 +27,7 @@ strictEqual( c.page, 0, 'Back on page 0' ); } ); - test( '#showCurrentPage', function() { + QUnit.test( '#showCurrentPage', 3, function() { var c = new Carousel(); strictEqual( c.page, 0, 'Initialises to page 0' ); c.next(); -- To view, visit https://gerrit.wikimedia.org/r/56625 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied1cd5f0ae56951bfad37772a0a73dcd251b51b3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add temporary message for users using ancient skins - change (mediawiki...WikimediaMessages)
jenkins-bot has submitted this change and it was merged. Change subject: Add temporary message for users using ancient skins .. Add temporary message for users using ancient skins Change-Id: I5c0621bcca31587f68c601c96c0f37d7d6639c62 --- M WikimediaTemporaryMessages.i18n.php 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Raimond Spekking: Looks good to me, approved jenkins-bot: Verified diff --git a/WikimediaTemporaryMessages.i18n.php b/WikimediaTemporaryMessages.i18n.php index d3e32b9..bec6a6e 100644 --- a/WikimediaTemporaryMessages.i18n.php +++ b/WikimediaTemporaryMessages.i18n.php @@ -10,6 +10,8 @@ $messages = array(); $messages['en'] = array( + 'wikimedia-oldskin-removal' => 'You are using the $1 skin, which is being removed beginning on $2. +[[$3|More information]].', 'wikimediamessages-desc' => 'Wikimedia specific temporary messages', ); @@ -17,6 +19,10 @@ * @author Shirayuki */ $messages['qqq'] = array( + 'wikimedia-oldskin-removal' => "Message shown in early 2013 to users who are using old skins +$1 is the current user's skin +$2 is the date for removal +$3 is an interwiki link to a page for more information", 'wikimediamessages-desc' => '{{desc|name=Wikimedia Temporary Messages}}', ); -- To view, visit https://gerrit.wikimedia.org/r/56398 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c0621bcca31587f68c601c96c0f37d7d6639c62 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/WikimediaMessages Gerrit-Branch: master Gerrit-Owner: Demon Gerrit-Reviewer: Raimond Spekking Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Avoid sending multiple UDP packets for the same key in wfInc... - change (mediawiki/core)
Aaron Schulz has submitted this change and it was merged. Change subject: Avoid sending multiple UDP packets for the same key in wfIncrStats(). .. Avoid sending multiple UDP packets for the same key in wfIncrStats(). * This should help reduce collector data loss. Change-Id: Ibe55648422d1b8aac86dd6fa83973d3c8715b0aa --- M includes/AutoLoader.php M includes/GlobalFunctions.php A includes/StatCounter.php 3 files changed, 145 insertions(+), 45 deletions(-) Approvals: Aaron Schulz: Verified Demon: Looks good to me, approved diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 0b3c788..9ef3165 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -243,6 +243,7 @@ 'SpecialRedirectToSpecial' => 'includes/SpecialPage.php', 'SquidPurgeClient' => 'includes/SquidPurgeClient.php', 'SquidPurgeClientPool' => 'includes/SquidPurgeClient.php', + 'StatCounter' => 'includes/StatCounter.php', 'Status' => 'includes/Status.php', 'StreamFile' => 'includes/StreamFile.php', 'StringUtils' => 'includes/StringUtils.php', diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 9042926..1a4b985 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1177,6 +1177,8 @@ global $wgRequestTime, $wgDebugLogFile, $wgDebugRawPage, $wgRequest; global $wgProfileLimit, $wgUser; + StatCounter::singleton()->flush(); + $profiler = Profiler::instance(); # Profiling must actually be enabled... @@ -1240,51 +1242,7 @@ * @return void */ function wfIncrStats( $key, $count = 1 ) { - global $wgStatsMethod; - - $count = intval( $count ); - if ( $count == 0 ) { - return; - } - - if( $wgStatsMethod == 'udp' ) { - global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgAggregateStatsID; - static $socket; - - $id = $wgAggregateStatsID !== false ? $wgAggregateStatsID : wfWikiID(); - - if ( !$socket ) { - $socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); - $statline = "stats/{$id} - 1 1 1 1 1 -total\n"; - socket_sendto( - $socket, - $statline, - strlen( $statline ), - 0, - $wgUDPProfilerHost, - $wgUDPProfilerPort - ); - } - $statline = "stats/{$id} - {$count} 1 1 1 1 {$key}\n"; - wfSuppressWarnings(); - socket_sendto( - $socket, - $statline, - strlen( $statline ), - 0, - $wgUDPProfilerHost, - $wgUDPProfilerPort - ); - wfRestoreWarnings(); - } elseif( $wgStatsMethod == 'cache' ) { - global $wgMemc; - $key = wfMemcKey( 'stats', $key ); - if ( is_null( $wgMemc->incr( $key, $count ) ) ) { - $wgMemc->add( $key, $count ); - } - } else { - // Disabled - } + StatCounter::singleton()->incr( $key, $count ); } /** diff --git a/includes/StatCounter.php b/includes/StatCounter.php new file mode 100644 index 000..30e5042 --- /dev/null +++ b/includes/StatCounter.php @@ -0,0 +1,141 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + * @ingroup StatCounter + */ + +/** + * Aggregator for wfIncrStats() that batches updates per request. + * This avoids spamming the collector many times for the same key. + * + * @ingroup StatCounter + */ +class StatCounter { + /** @var Array */ + protected $deltas = array(); // (key => count) + + protected function __construct() {} + + public static function singleton() { + static $instance = null; + if ( !$instance ) { + $instance = new self(); + } + return $instance; + } + + /** +* Increment a key by delta $count +* +* @param string $key +* @param integer $count +* @return void +*/ + public function incr( $key, $count = 1 ) { + if ( PHP_SAPI === 'cli' ) { + $this->sendDelta( $key, $count ); + } else { + if ( !isset( $this->deltas[$key] ) ) { + $this->deltas[$key] = 0; + } + $this->deltas[$key] += $count; + } + } + + /** +* Flush all pending deltas to persistent storage +* +* @return void +*/ + public function flush() { +
[MediaWiki-commits] [Gerrit] Change diff colors after design input - change (mediawiki...MobileFrontend)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/56626 Change subject: Change diff colors after design input .. Change diff colors after design input Munaf/Vibha approved diff colors Now Protanopia and Deuteranopia friendly! Add margin right for single characters Change-Id: I7ad474695ecfe9f6265a256b9535e49bc063b682 --- M less/specials/mobilediff.less M stylesheets/specials/mobilediff.css 2 files changed, 11 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/26/56626/1 diff --git a/less/specials/mobilediff.less b/less/specials/mobilediff.less index 1412c79..369519b 100644 --- a/less/specials/mobilediff.less +++ b/less/specials/mobilediff.less @@ -145,12 +145,16 @@ } } + span { + margin-right: 2px; + } + ins { - background-color: #ddffdd; + background-color: #75C877; } del { - background-color: #ff; + background-color: #E07076; text-decoration: none; } diff --git a/stylesheets/specials/mobilediff.css b/stylesheets/specials/mobilediff.css index 77afa6f..d1f3d7b 100644 --- a/stylesheets/specials/mobilediff.css +++ b/stylesheets/specials/mobilediff.css @@ -126,11 +126,14 @@ .alpha #mw-mf-diffview del::before { content: ""; } +.alpha #mw-mf-diffview span { + margin-right: 2px; +} .alpha #mw-mf-diffview ins { - background-color: #ddffdd; + background-color: #75C877; } .alpha #mw-mf-diffview del { - background-color: #ff; + background-color: #E07076; text-decoration: none; } .alpha #mw-mf-diffview .prettyDiff ins, -- To view, visit https://gerrit.wikimedia.org/r/56626 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ad474695ecfe9f6265a256b9535e49bc063b682 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add new diff test case for simple insertion - change (mediawiki...MobileFrontend)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/56627 Change subject: Add new diff test case for simple insertion .. Add new diff test case for simple insertion Also avoid adding empty del or ins elements in clean diff Change-Id: I97ed3eaf6756cf2fe8a30ab4f768eb9f1b34b1eb --- M javascripts/specials/mobilediff.js M tests/js/specials/mobilediff.js 2 files changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/27/56627/1 diff --git a/javascripts/specials/mobilediff.js b/javascripts/specials/mobilediff.js index 5ae3f46..e987821 100644 --- a/javascripts/specials/mobilediff.js +++ b/javascripts/specials/mobilediff.js @@ -3,11 +3,15 @@ function makePrettyDiff( $diff ) { var $diffclone = $diff.clone(); - if ( $diff.children( 'ins' ).length === 0 ) { // if just a delete do nothing + // simple case where just an insert or just a delete + if ( $diff.children( 'ins' ).length === 0 || $diff.children( 'del' ).length === 0 ) { $diff.empty().addClass( 'prettyDiff' ); - $diffclone.find( 'del' ).each( function() { - $( this ).clone().appendTo( $diff ); - $( '' ).appendTo( $diff ); + $diffclone.find( 'del,ins' ).each( function() { + $el = $( this ).clone(); + if ( $el.text() ) { // don't add empty elements + $el.appendTo( $diff ); + $( '' ).appendTo( $diff ); + } } ); return $diff; } else if ( $diff.children().length > 1 ) { // if there is only one line it is not a complicated diff diff --git a/tests/js/specials/mobilediff.js b/tests/js/specials/mobilediff.js index 502c438..26f2d15 100644 --- a/tests/js/specials/mobilediff.js +++ b/tests/js/specials/mobilediff.js @@ -21,7 +21,12 @@ ], [ $( '== Fliberty gibbit ==Foobar!' ), - '== Fliberty gibbit ==Foobar!' + '== Fliberty gibbit ==Foobar!' + ], + [ + // no deletions + $( 'French duo Daft Punk weren\'t named in the initial announcement, but added the festival to a list of shows on its official Vevo page on March 27. {{cite news| url= http://www.3news.co.nz/Daft-Punk-website-shows-Coachella-date/tabid/418/articleID/292127/Default.aspx|work=3 News NZ |title= Daft Punk website shows Coachella date| date=March 28, 2013}}' ), + 'French duo Daft Punk weren\'t named in the initial announcement, but added the festival to a list of shows on its official Vevo page on March 27. {{cite news| url= http://www.3news.co.nz/Daft-Punk-website-shows-Coachella-date/tabid/418/articleID/292127/Default.aspx|work=3 News NZ |title= Daft Punk website shows Coachella date| date=March 28, 2013}}' ] ]; -- To view, visit https://gerrit.wikimedia.org/r/56627 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I97ed3eaf6756cf2fe8a30ab4f768eb9f1b34b1eb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Avoid sending multiple UDP packets for the same key in wfInc... - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/56628 Change subject: Avoid sending multiple UDP packets for the same key in wfIncrStats(). .. Avoid sending multiple UDP packets for the same key in wfIncrStats(). * This should help reduce collector data loss. Change-Id: Ibe55648422d1b8aac86dd6fa83973d3c8715b0aa (cherry picked from commit 5f1e95436eac69fb7d02a538ac20b4215391e2b6) --- M includes/AutoLoader.php M includes/GlobalFunctions.php A includes/StatCounter.php 3 files changed, 145 insertions(+), 45 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/28/56628/1 diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 7136232..5bd057a 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -242,6 +242,7 @@ 'SpecialRedirectToSpecial' => 'includes/SpecialPage.php', 'SquidPurgeClient' => 'includes/SquidPurgeClient.php', 'SquidPurgeClientPool' => 'includes/SquidPurgeClient.php', + 'StatCounter' => 'includes/StatCounter.php', 'Status' => 'includes/Status.php', 'StreamFile' => 'includes/StreamFile.php', 'StringUtils' => 'includes/StringUtils.php', diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index e1e1234..6e79393 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1177,6 +1177,8 @@ global $wgRequestTime, $wgDebugLogFile, $wgDebugRawPage, $wgRequest; global $wgProfileLimit, $wgUser; + StatCounter::singleton()->flush(); + $profiler = Profiler::instance(); # Profiling must actually be enabled... @@ -1240,51 +1242,7 @@ * @return void */ function wfIncrStats( $key, $count = 1 ) { - global $wgStatsMethod; - - $count = intval( $count ); - if ( $count == 0 ) { - return; - } - - if( $wgStatsMethod == 'udp' ) { - global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgAggregateStatsID; - static $socket; - - $id = $wgAggregateStatsID !== false ? $wgAggregateStatsID : wfWikiID(); - - if ( !$socket ) { - $socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); - $statline = "stats/{$id} - 1 1 1 1 1 -total\n"; - socket_sendto( - $socket, - $statline, - strlen( $statline ), - 0, - $wgUDPProfilerHost, - $wgUDPProfilerPort - ); - } - $statline = "stats/{$id} - {$count} 1 1 1 1 {$key}\n"; - wfSuppressWarnings(); - socket_sendto( - $socket, - $statline, - strlen( $statline ), - 0, - $wgUDPProfilerHost, - $wgUDPProfilerPort - ); - wfRestoreWarnings(); - } elseif( $wgStatsMethod == 'cache' ) { - global $wgMemc; - $key = wfMemcKey( 'stats', $key ); - if ( is_null( $wgMemc->incr( $key, $count ) ) ) { - $wgMemc->add( $key, $count ); - } - } else { - // Disabled - } + StatCounter::singleton()->incr( $key, $count ); } /** diff --git a/includes/StatCounter.php b/includes/StatCounter.php new file mode 100644 index 000..30e5042 --- /dev/null +++ b/includes/StatCounter.php @@ -0,0 +1,141 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + * @ingroup StatCounter + */ + +/** + * Aggregator for wfIncrStats() that batches updates per request. + * This avoids spamming the collector many times for the same key. + * + * @ingroup StatCounter + */ +class StatCounter { + /** @var Array */ + protected $deltas = array(); // (key => count) + + protected function __construct() {} + + public static function singleton() { + static $instance = null; + if ( !$instance ) { + $instance = new self(); + } + return $instance; + } + + /** +* Increment a key by delta $count +* +* @param string $key +* @param integer $count +* @return void +*/ + public function incr( $key, $count = 1 ) { + if ( PHP_SAPI === 'cli' ) { + $this->sendDelta( $key, $count ); + } else { + if ( !isset( $this->deltas[$key] ) ) { + $this->deltas[$key] = 0; + } + $this->deltas[$key] += $count; + } + } + + /** +* Flush all pendin
[MediaWiki-commits] [Gerrit] Made sure MediaTransformOutput::getLocalCopyPath handles sto... - change (mediawiki/core)
Aaron Schulz has submitted this change and it was merged. Change subject: Made sure MediaTransformOutput::getLocalCopyPath handles storage paths. .. Made sure MediaTransformOutput::getLocalCopyPath handles storage paths. * Storage paths are passed in for several cases in File::transform(). Change-Id: I61a4058b80a37f36b78e2dfe62ffdf6f73e6f41e --- M includes/filerepo/file/File.php M includes/media/MediaTransformOutput.php 2 files changed, 7 insertions(+), 3 deletions(-) Approvals: Aaron Schulz: Verified; Looks good to me, approved Parent5446: Looks good to me, but someone else must approve J: Looks good to me, but someone else must approve diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 5eff954..d72755a 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -910,8 +910,7 @@ // XXX: Pass in the storage path even though we are not rendering anything // and the path is supposed to be an FS path. This is due to getScalerType() // getting called on the path and clobbering $thumb->getUrl() if it's false. - $thumb = $handler->getTransform( - $this, $thumbPath, $thumbUrl, $params ); + $thumb = $handler->getTransform( $this, $thumbPath, $thumbUrl, $params ); $thumb->setStoragePath( $thumbPath ); break; } diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index 1f95bc3..1c2dfdd 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -151,7 +151,12 @@ if ( $this->isError() ) { return false; } elseif ( $this->path === null ) { - return $this->file->getLocalRefPath(); + return $this->file->getLocalRefPath(); // assume thumb was not scaled + } elseif ( FileBackend::isStoragePath( $this->path ) ) { + $be = $this->file->getRepo()->getBackend(); + // The temp file will be process cached by FileBackend + $fsFile = $be->getLocalReference( array( 'src' => $this->path ) ); + return $fsFile ? $fsFile->getPath() : false; } else { return $this->path; // may return false } -- To view, visit https://gerrit.wikimedia.org/r/56199 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61a4058b80a37f36b78e2dfe62ffdf6f73e6f41e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz Gerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Demon Gerrit-Reviewer: J Gerrit-Reviewer: Parent5446 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adding a new Report for A Special Person - change (wikimedia...tools)
Mwalker has uploaded a new change for review. https://gerrit.wikimedia.org/r/56630 Change subject: Adding a new Report for A Special Person .. Adding a new Report for A Special Person We needed a report that broke down campaign data for a special project. :) Change-Id: I7b9ba99081a2760dc3cd119d6e91f008a75475b1 --- M FundraiserStatisticsGen/fundstatgen.py 1 file changed, 87 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools refs/changes/30/56630/1 diff --git a/FundraiserStatisticsGen/fundstatgen.py b/FundraiserStatisticsGen/fundstatgen.py index 98fcebc..501fade 100644 --- a/FundraiserStatisticsGen/fundstatgen.py +++ b/FundraiserStatisticsGen/fundstatgen.py @@ -26,21 +26,27 @@ config.read(fileList) # === BEGIN PROCESSING === -print("Running query...") -stats = getPerYearData( -config.get('MySQL', 'hostname'), -config.getint('MySQL', 'port'), -config.get('MySQL', 'username'), -config.get('MySQL', 'password'), -config.get('MySQL', 'database') -) +hostname = config.get('MySQL', 'hostname') +port = config.getint('MySQL', 'port') +username = config.get('MySQL', 'username') +password = config.get('MySQL', 'password') +database = config.get('MySQL', 'database') + +print("Running per year query...") +stats = getPerYearData(hostname, port, username, password, database) print("Pivoting data into year/day form...") (years, pivot) = pivotDataByYear(stats) -print("Writing output files...") +print("Writing year data output files...") createSingleOutFile(stats, 'date', workingDir + '/donationdata-vs-day.csv') createOutputFiles(pivot, 'date', workingDir + '/yeardata-day-vs-', years) + +print("Running per campaign query...") +pcStats = getPerCampaignData(hostname, port, username, password, database) + +print("Writing campaign data output files...") +createSingleOutFile(pcStats, ('medium', 'campaign'), workingDir + '/campaign-vs-amount.csv') def getPerYearData(host, port, username, password, database): @@ -103,6 +109,58 @@ return data +def getPerCampaignData(host, port, username, password, database): +""" +Obtain basic statistics (USD sum, number donations, USD avg amount, USD max amount, +USD YTD sum) per medium, campaign + +Returns a dict like: {(medium, campaign) => {value => value} where value types are: +- start_date, stop_date, count, sum, avg, std, max +""" +con = db.connect(host=host, port=port, user=username, passwd=password, db=database) +cur = con.cursor() +cur.execute(""" +SELECT + ct.utm_medium, + ct.utm_campaign, + min(c.receive_date), + max(c.receive_date), + count(*), + sum(c.total_amount), + avg(c.total_amount), + std(c.total_amount), + max(c.total_amount) +FROM drupal.contribution_tracking ct, civicrm.civicrm_contribution c +WHERE + ct.contribution_id=c.id AND + c.total_amount >= 0 +GROUP BY utm_medium, utm_campaign; +""") + +data = {} +for row in cur: +(medium, campaign, start, stop, count, sum, usdavg, usdstd, usdmax) = row +count = int(count) +sum = float(sum) +usdavg = float(usdavg) +usdstd = float(usdstd) +usdmax = float(usdmax) + +data[(medium, campaign)] = { +'start_date': start, +'stop_date': stop, +'count': count, +'sum': sum, +'avg': usdavg, +'usdstd': usdstd, +'usdmax': usdmax +} + +del cur +con.close() +return data + + def pivotDataByYear(stats): """ Transformation of the statistical data -- grouping reports by date @@ -152,9 +210,15 @@ createSingleOutFile(stats[report], firstcol, basename + report + '.csv', colnames) -def createSingleOutFile(stats, firstcol, filename, colnames = None): +def createSingleOutFile(stats, firstcols, filename, colnames = None): """ Creates a single report file from a keyed dict + +stats must be a dictionary of something list like; if internally it is a dictionary +then the column names will be taken from the dict; otherwise they come colnames + +firstcols can be a string or a list depending on how the data is done but it should +reflect the primary key of stats """ if colnames is None: colnames = stats.itervalues().next().keys() @@ -162,12 +226,23 @@ else: colindices = range(0, len(colnames)) +if isinstance(firstcols, basestring): +firstcols = [firstcols] +else: +firstcols = list(firstcols) + f = file(filename, 'w') csvf = csv.writer(f) -csvf.writerow([firstcol] + colnames) +csvf.write
[MediaWiki-commits] [Gerrit] Fix up the mediawiki extension class a bit. - change (operations/puppet)
Andrew Bogott has submitted this change and it was merged. Change subject: Fix up the mediawiki extension class a bit. .. Fix up the mediawiki extension class a bit. Change-Id: Ia674ceaa6d670b2c9f3240575b361aab41eec63a --- M modules/mediawiki_singlenode/manifests/init.pp M modules/mediawiki_singlenode/manifests/mw-extension.pp M modules/wikidata_singlenode/manifests/init.pp 3 files changed, 8 insertions(+), 6 deletions(-) Approvals: Andrew Bogott: Checked; Looks good to me, approved Silke Meyer: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/modules/mediawiki_singlenode/manifests/init.pp b/modules/mediawiki_singlenode/manifests/init.pp index 69b2205..7c72d3b 100644 --- a/modules/mediawiki_singlenode/manifests/init.pp +++ b/modules/mediawiki_singlenode/manifests/init.pp @@ -42,6 +42,8 @@ # get the extensions mw-extension { [ "Nuke", "SpamBlacklist", "ConfirmEdit" ]: require => Git::Clone["mediawiki"], + ensure => $ensure, + install_path => $install_path; } file { diff --git a/modules/mediawiki_singlenode/manifests/mw-extension.pp b/modules/mediawiki_singlenode/manifests/mw-extension.pp index 11fdadb..7769d6b 100644 --- a/modules/mediawiki_singlenode/manifests/mw-extension.pp +++ b/modules/mediawiki_singlenode/manifests/mw-extension.pp @@ -2,12 +2,8 @@ define mw-extension( # defaults $branch="master", - $ssh="", - $owner="root", - $group="root", - $timeout="300", - $depth="full", - $mode=0755) { + $ensure=present, + $install_path="/srv/mediawiki") { git::clone { "$name": require => git::clone["mediawiki"], directory => "${install_path}/extensions/${name}", diff --git a/modules/wikidata_singlenode/manifests/init.pp b/modules/wikidata_singlenode/manifests/init.pp index 33d2498..384be5c 100644 --- a/modules/wikidata_singlenode/manifests/init.pp +++ b/modules/wikidata_singlenode/manifests/init.pp @@ -72,11 +72,13 @@ # get the dependencies for Wikibase extension after the successful installation of mediawiki core mw-extension { [ "Diff", "DataValues" ]: require => [Git::Clone["mediawiki"], Exec["mediawiki_setup"]], + install_path => $install_path, } # get more extensions for Wikidata test instances mw-extension { [ "DismissableSiteNotice", "ApiSandbox", "OAI", "SiteMatrix" ]: require => Git::Clone["mediawiki"], + install_path => $install_path, } # get "mediawiki-config" for SiteMatrix extension git::clone { "mwconfig": @@ -146,6 +148,7 @@ # for repo get extensions Wikibase and ULS mw-extension { [ "Wikibase", "UniversalLanguageSelector", "Babel", "Translate", "AbuseFilter" ]: require => [Git::Clone["mediawiki"], Exec["mediawiki_setup"], Exec["repo_move_mainpage"], Mw-extension["Diff"], Mw-extension["DataValues"]], + install_path => $install_path, } # put a repo specific settings file to $install_path (required by LocalSettings.php) file { "${install_path}/wikidata_repo_requires.php": @@ -200,6 +203,7 @@ # for client get extensions Wikibase and ParserFunctions (needed) and a bunch of other extensions that are on Wikipedias mw-extension { [ "Wikibase", "ParserFunctions", "AbuseFilter", "AntiBot", "AntiSpoof", "APC", "ArticleFeedback", "ArticleFeedbackv5", "AssertEdit", "Babel", "CategoryTree", "CharInsert", "CheckUser", "Cite", "cldr", "ClickTracking", "CodeEditor", "Collection", "CustomData", "Echo", "EditPageTracking", "EmailCapture", "ExpandTemplates", "FeaturedFeeds", "FlaggedRevs", "Gadgets", "GlobalUsage", "ImageMap", "InputBox", "Interwiki", "LocalisationUpdate", "MarkAsHelpful", "Math", "MobileFrontend", "MwEmbedSupport", "MWSearch", "NewUserMessage", "normal", "OATHAuth", "OpenSearchXml", "Oversight", "PagedTiffHandler", "PageTriage", "PdfHandler", "Poem", "PoolCounter", "PostEdit", "ReaderFeedback", "RelatedArticles", "RelatedSites", "Renameuser", "Scribunto", "SecurePoll", "SimpleAntiSpam", "SwiftCloudFiles", "SyntaxHighlight_GeSHi", "TemplateSandbox", "TitleKey", "TorBlock", "Translate", "UserDailyContribs", "UserMerge", "Vector", "WikiEditor", "wikihiero", "WikiLove", "WikimediaMaintenance", "WikimediaMessages" ]: require => [Git::Clone["mediawiki"], Exec["mediawiki_setup"], Mw-extension["Diff"], Mw-extension["DataValues"]], + install_path => $install_path, } # put a client specific settings file to $install_path (required by LocalSettings.php) file { "${install_path}/wikidata_client_requires.php": -- To view, visit
[MediaWiki-commits] [Gerrit] Avoid sending multiple UDP packets for the same key in wfInc... - change (mediawiki/core)
Aaron Schulz has submitted this change and it was merged. Change subject: Avoid sending multiple UDP packets for the same key in wfIncrStats(). .. Avoid sending multiple UDP packets for the same key in wfIncrStats(). * This should help reduce collector data loss. Change-Id: Ibe55648422d1b8aac86dd6fa83973d3c8715b0aa (cherry picked from commit 5f1e95436eac69fb7d02a538ac20b4215391e2b6) --- M includes/AutoLoader.php M includes/GlobalFunctions.php A includes/StatCounter.php 3 files changed, 145 insertions(+), 45 deletions(-) Approvals: Aaron Schulz: Verified; Looks good to me, approved diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index 7136232..5bd057a 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -242,6 +242,7 @@ 'SpecialRedirectToSpecial' => 'includes/SpecialPage.php', 'SquidPurgeClient' => 'includes/SquidPurgeClient.php', 'SquidPurgeClientPool' => 'includes/SquidPurgeClient.php', + 'StatCounter' => 'includes/StatCounter.php', 'Status' => 'includes/Status.php', 'StreamFile' => 'includes/StreamFile.php', 'StringUtils' => 'includes/StringUtils.php', diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index e1e1234..6e79393 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1177,6 +1177,8 @@ global $wgRequestTime, $wgDebugLogFile, $wgDebugRawPage, $wgRequest; global $wgProfileLimit, $wgUser; + StatCounter::singleton()->flush(); + $profiler = Profiler::instance(); # Profiling must actually be enabled... @@ -1240,51 +1242,7 @@ * @return void */ function wfIncrStats( $key, $count = 1 ) { - global $wgStatsMethod; - - $count = intval( $count ); - if ( $count == 0 ) { - return; - } - - if( $wgStatsMethod == 'udp' ) { - global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgAggregateStatsID; - static $socket; - - $id = $wgAggregateStatsID !== false ? $wgAggregateStatsID : wfWikiID(); - - if ( !$socket ) { - $socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); - $statline = "stats/{$id} - 1 1 1 1 1 -total\n"; - socket_sendto( - $socket, - $statline, - strlen( $statline ), - 0, - $wgUDPProfilerHost, - $wgUDPProfilerPort - ); - } - $statline = "stats/{$id} - {$count} 1 1 1 1 {$key}\n"; - wfSuppressWarnings(); - socket_sendto( - $socket, - $statline, - strlen( $statline ), - 0, - $wgUDPProfilerHost, - $wgUDPProfilerPort - ); - wfRestoreWarnings(); - } elseif( $wgStatsMethod == 'cache' ) { - global $wgMemc; - $key = wfMemcKey( 'stats', $key ); - if ( is_null( $wgMemc->incr( $key, $count ) ) ) { - $wgMemc->add( $key, $count ); - } - } else { - // Disabled - } + StatCounter::singleton()->incr( $key, $count ); } /** diff --git a/includes/StatCounter.php b/includes/StatCounter.php new file mode 100644 index 000..30e5042 --- /dev/null +++ b/includes/StatCounter.php @@ -0,0 +1,141 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + * @ingroup StatCounter + */ + +/** + * Aggregator for wfIncrStats() that batches updates per request. + * This avoids spamming the collector many times for the same key. + * + * @ingroup StatCounter + */ +class StatCounter { + /** @var Array */ + protected $deltas = array(); // (key => count) + + protected function __construct() {} + + public static function singleton() { + static $instance = null; + if ( !$instance ) { + $instance = new self(); + } + return $instance; + } + + /** +* Increment a key by delta $count +* +* @param string $key +* @param integer $count +* @return void +*/ + public function incr( $key, $count = 1 ) { + if ( PHP_SAPI === 'cli' ) { + $this->sendDelta( $key, $count ); + } else { + if ( !isset( $this->deltas[$key] ) ) { + $this->deltas[$key] = 0; + } + $this->deltas[$key] += $count; + } + } + + /** +* Flush all pending deltas to persistent storage +* +*
[MediaWiki-commits] [Gerrit] add transitionteam wiki conf - RT-4850 - change (operations/apache-config)
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/56631 Change subject: add transitionteam wiki conf - RT-4850 .. add transitionteam wiki conf - RT-4850 Change-Id: Icb652217cb96000e285771777cab9901c5cd --- M remnant.conf 1 file changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/apache-config refs/changes/31/56631/1 diff --git a/remnant.conf b/remnant.conf index d60f16d..c919a25 100644 --- a/remnant.conf +++ b/remnant.conf @@ -1633,5 +1633,41 @@ +# transitionteam private wiki - RT-4850 + +DocumentRoot "/usr/local/apache/common/docroot/transitionteam" +ServerName transitionteam.wikimedia.org + +AllowEncodedSlashes On + +RewriteEngine On +RewriteCond %{HTTP:X-Forwarded-Proto} !https +RewriteRule ^/(.*)$ https://transitionteam.wikimedia.org/$1 [R=301,L] + +# Primary wiki redirector: +Alias /wiki /usr/local/apache/common/docroot/transitionteam/w/index.php +RewriteRule ^/$ /w/index.php + +# UseMod compatibility URLs +RewriteCond %{QUERY_STRING} ([^&;]+) +RewriteRule ^/wiki\.cgi$ /w/index.php?title=%1 [R=301,L] +RewriteRule ^/wiki\.cgi$ /w/index.php [R=301,L] + +RewriteRule ^/math/(.*) http://upload.wikimedia.org/math/$1 [R=301] + +# Configurable favicon +RewriteRule ^/favicon\.ico$ /w/favicon.php [L] + + + +php_admin_flag engine on + + + + +php_admin_flag engine off + + + ## donatewiki has been moved to main.conf so it can catch donate.wikipedia.org -- To view, visit https://gerrit.wikimedia.org/r/56631 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb652217cb96000e285771777cab9901c5cd Gerrit-PatchSet: 1 Gerrit-Project: operations/apache-config Gerrit-Branch: master Gerrit-Owner: Dzahn ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] add transitionteam wiki conf - RT-4850 - change (operations/apache-config)
Dzahn has submitted this change and it was merged. Change subject: add transitionteam wiki conf - RT-4850 .. add transitionteam wiki conf - RT-4850 Change-Id: Icb652217cb96000e285771777cab9901c5cd --- M remnant.conf 1 file changed, 36 insertions(+), 0 deletions(-) Approvals: Dzahn: Looks good to me, approved diff --git a/remnant.conf b/remnant.conf index d60f16d..c919a25 100644 --- a/remnant.conf +++ b/remnant.conf @@ -1633,5 +1633,41 @@ +# transitionteam private wiki - RT-4850 + +DocumentRoot "/usr/local/apache/common/docroot/transitionteam" +ServerName transitionteam.wikimedia.org + +AllowEncodedSlashes On + +RewriteEngine On +RewriteCond %{HTTP:X-Forwarded-Proto} !https +RewriteRule ^/(.*)$ https://transitionteam.wikimedia.org/$1 [R=301,L] + +# Primary wiki redirector: +Alias /wiki /usr/local/apache/common/docroot/transitionteam/w/index.php +RewriteRule ^/$ /w/index.php + +# UseMod compatibility URLs +RewriteCond %{QUERY_STRING} ([^&;]+) +RewriteRule ^/wiki\.cgi$ /w/index.php?title=%1 [R=301,L] +RewriteRule ^/wiki\.cgi$ /w/index.php [R=301,L] + +RewriteRule ^/math/(.*) http://upload.wikimedia.org/math/$1 [R=301] + +# Configurable favicon +RewriteRule ^/favicon\.ico$ /w/favicon.php [L] + + + +php_admin_flag engine on + + + + +php_admin_flag engine off + + + ## donatewiki has been moved to main.conf so it can catch donate.wikipedia.org -- To view, visit https://gerrit.wikimedia.org/r/56631 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb652217cb96000e285771777cab9901c5cd Gerrit-PatchSet: 1 Gerrit-Project: operations/apache-config Gerrit-Branch: master Gerrit-Owner: Dzahn Gerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adding a new Report for A Special Person - change (wikimedia...tools)
Adamw has submitted this change and it was merged. Change subject: Adding a new Report for A Special Person .. Adding a new Report for A Special Person We needed a report that broke down campaign data for a special project. :) Also; I can now use the AmazonAudit cfg file instead of creating a new one Change-Id: I7b9ba99081a2760dc3cd119d6e91f008a75475b1 --- M FundraiserStatisticsGen/fundstatgen.cfg M FundraiserStatisticsGen/fundstatgen.py 2 files changed, 88 insertions(+), 13 deletions(-) Approvals: Adamw: Verified; Looks good to me, approved diff --git a/FundraiserStatisticsGen/fundstatgen.cfg b/FundraiserStatisticsGen/fundstatgen.cfg index 75b1d1e..16d1e5a 100644 --- a/FundraiserStatisticsGen/fundstatgen.cfg +++ b/FundraiserStatisticsGen/fundstatgen.cfg @@ -3,4 +3,4 @@ port=3306 username= password= -database=civicrm \ No newline at end of file +schema=civicrm \ No newline at end of file diff --git a/FundraiserStatisticsGen/fundstatgen.py b/FundraiserStatisticsGen/fundstatgen.py index 98fcebc..48c2049 100644 --- a/FundraiserStatisticsGen/fundstatgen.py +++ b/FundraiserStatisticsGen/fundstatgen.py @@ -26,21 +26,27 @@ config.read(fileList) # === BEGIN PROCESSING === -print("Running query...") -stats = getPerYearData( -config.get('MySQL', 'hostname'), -config.getint('MySQL', 'port'), -config.get('MySQL', 'username'), -config.get('MySQL', 'password'), -config.get('MySQL', 'database') -) +hostname = config.get('MySQL', 'hostname') +port = config.getint('MySQL', 'port') +username = config.get('MySQL', 'username') +password = config.get('MySQL', 'password') +database = config.get('MySQL', 'schema') + +print("Running per year query...") +stats = getPerYearData(hostname, port, username, password, database) print("Pivoting data into year/day form...") (years, pivot) = pivotDataByYear(stats) -print("Writing output files...") +print("Writing year data output files...") createSingleOutFile(stats, 'date', workingDir + '/donationdata-vs-day.csv') createOutputFiles(pivot, 'date', workingDir + '/yeardata-day-vs-', years) + +print("Running per campaign query...") +pcStats = getPerCampaignData(hostname, port, username, password, database) + +print("Writing campaign data output files...") +createSingleOutFile(pcStats, ('medium', 'campaign'), workingDir + '/campaign-vs-amount.csv') def getPerYearData(host, port, username, password, database): @@ -103,6 +109,58 @@ return data +def getPerCampaignData(host, port, username, password, database): +""" +Obtain basic statistics (USD sum, number donations, USD avg amount, USD max amount, +USD YTD sum) per medium, campaign + +Returns a dict like: {(medium, campaign) => {value => value} where value types are: +- start_date, stop_date, count, sum, avg, std, max +""" +con = db.connect(host=host, port=port, user=username, passwd=password, db=database) +cur = con.cursor() +cur.execute(""" +SELECT + ct.utm_medium, + ct.utm_campaign, + min(c.receive_date), + max(c.receive_date), + count(*), + sum(c.total_amount), + avg(c.total_amount), + std(c.total_amount), + max(c.total_amount) +FROM drupal.contribution_tracking ct, civicrm.civicrm_contribution c +WHERE + ct.contribution_id=c.id AND + c.total_amount >= 0 +GROUP BY utm_medium, utm_campaign; +""") + +data = {} +for row in cur: +(medium, campaign, start, stop, count, sum, usdavg, usdstd, usdmax) = row +count = int(count) +sum = float(sum) +usdavg = float(usdavg) +usdstd = float(usdstd) +usdmax = float(usdmax) + +data[(medium, campaign)] = { +'start_date': start, +'stop_date': stop, +'count': count, +'sum': sum, +'avg': usdavg, +'usdstd': usdstd, +'usdmax': usdmax +} + +del cur +con.close() +return data + + def pivotDataByYear(stats): """ Transformation of the statistical data -- grouping reports by date @@ -152,9 +210,15 @@ createSingleOutFile(stats[report], firstcol, basename + report + '.csv', colnames) -def createSingleOutFile(stats, firstcol, filename, colnames = None): +def createSingleOutFile(stats, firstcols, filename, colnames = None): """ Creates a single report file from a keyed dict + +stats must be a dictionary of something list like; if internally it is a dictionary +then the column names will be taken from the dict; otherwise they come colnames + +firstcols can be a string or a list depending on how the data is done but it should +reflect the primary key of stats ""
[MediaWiki-commits] [Gerrit] Handle invalid entity IDs in SetReference::getEntityContent - change (mediawiki...Wikibase)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/56632 Change subject: Handle invalid entity IDs in SetReference::getEntityContent .. Handle invalid entity IDs in SetReference::getEntityContent Bug: 46701 Change-Id: I3c9fa8314df050561927daf7aa9a3503c7916b13 --- M repo/includes/api/SetReference.php 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/32/56632/1 diff --git a/repo/includes/api/SetReference.php b/repo/includes/api/SetReference.php index f13bb25..37af48d 100644 --- a/repo/includes/api/SetReference.php +++ b/repo/includes/api/SetReference.php @@ -82,6 +82,11 @@ $params = $this->extractRequestParams(); $entityId = EntityId::newFromPrefixedId( Entity::getIdFromClaimGuid( $params['statement'] ) ); + + if ( $entityId === null ) { + $this->dieUsage( 'No such entity', 'setreference-entity-not-found' ); + } + $entityTitle = EntityContentFactory::singleton()->getTitleForId( $entityId ); if ( $entityTitle === null ) { -- To view, visit https://gerrit.wikimedia.org/r/56632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3c9fa8314df050561927daf7aa9a3503c7916b13 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Hoo man ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits