[MediaWiki-commits] [Gerrit] MWException - Exception - change (mediawiki...Math)
Physikerwelt has submitted this change and it was merged. Change subject: MWException - Exception .. MWException - Exception Change-Id: I18da1baeb70387b96e30811a049185a264dec26d --- M Math.alias.php M Math.hooks.php M MathSource.php M tests/MathCoverageTest.php M tests/MathIdTest.php M tests/MathLaTeXMLTest.php M tests/MathMathMLTest.php M tests/MathRendererTest.php M tests/MathSourceTest.php 9 files changed, 13 insertions(+), 13 deletions(-) Approvals: Physikerwelt: Verified; Looks good to me, approved diff --git a/Math.alias.php b/Math.alias.php index 0613ed6..91de3f5 100644 --- a/Math.alias.php +++ b/Math.alias.php @@ -11,4 +11,4 @@ /** English (English) */ $specialPageAliases['en'] = array( 'MathShowImage' = array( 'MathShowImage', 'MathShowImage' ) // No need to translate! The PageTitle does not appear. -); \ No newline at end of file +); diff --git a/Math.hooks.php b/Math.hooks.php index 213ac8f..54622cd 100644 --- a/Math.hooks.php +++ b/Math.hooks.php @@ -212,13 +212,13 @@ * LoadExtensionSchemaUpdates handler; set up math table on install/upgrade. * * @param $updater DatabaseUpdater -* @throws MWException +* @throws Exception * @return bool */ static function onLoadExtensionSchemaUpdates( $updater = null ) { global $wgMathValidModes; if ( is_null( $updater ) ) { - throw new MWException( 'Math extension is only necessary in 1.18 or above' ); + throw new Exception( 'Math extension is only necessary in 1.18 or above' ); } $map = array( 'mysql', 'sqlite', 'postgres', 'oracle', 'mssql' ); @@ -237,7 +237,7 @@ $updater-modifyExtensionField( 'mathlatexml', 'math_mathml', $sql ); } } else { - throw new MWException( Math extension does not currently support $type database for LaTeXML. ); + throw new Exception( Math extension does not currently support $type database for LaTeXML. ); } } if ( in_array( MW_MATH_MATHML, $wgMathValidModes ) ) { @@ -245,11 +245,11 @@ $sql = dirname( __FILE__ ) . '/db/mathoid.' . $type . '.sql'; $updater-addExtensionTable( 'mathoid', $sql ); } else { - throw new MWException( Math extension does not currently support $type database for Mathoid. ); + throw new Exception( Math extension does not currently support $type database for Mathoid. ); } } } else { - throw new MWException( Math extension does not currently support $type database. ); + throw new Exception( Math extension does not currently support $type database. ); } return true; } diff --git a/MathSource.php b/MathSource.php index 95340ac..77c84cc 100644 --- a/MathSource.php +++ b/MathSource.php @@ -56,7 +56,7 @@ } protected function getMathTableName() { - throw new MWException ( 'in math source mode no database caching should happen'); + throw new Exception ( 'in math source mode no database caching should happen'); } /** diff --git a/tests/MathCoverageTest.php b/tests/MathCoverageTest.php index 71d2422..94af443 100644 --- a/tests/MathCoverageTest.php +++ b/tests/MathCoverageTest.php @@ -87,4 +87,4 @@ private function normalize( $input ) { return preg_replace( '#src=(.*?)/(([a-f]|\d)*).png#', 'src=\2.png', $input ); } -} \ No newline at end of file +} diff --git a/tests/MathIdTest.php b/tests/MathIdTest.php index c7c5719..4365c4a 100644 --- a/tests/MathIdTest.php +++ b/tests/MathIdTest.php @@ -14,4 +14,4 @@ $this-assertEquals( RANDOM_ID, $renderer-getId() ); } -} \ No newline at end of file +} diff --git a/tests/MathLaTeXMLTest.php b/tests/MathLaTeXMLTest.php index 5606f97..71f98b9 100644 --- a/tests/MathLaTeXMLTest.php +++ b/tests/MathLaTeXMLTest.php @@ -49,4 +49,4 @@ , Rendering of a+b in plain Text mode. . $renderer-getLastError() ); } -} \ No newline at end of file +} diff --git a/tests/MathMathMLTest.php b/tests/MathMathMLTest.php index d101c06..e410070 100644 --- a/tests/MathMathMLTest.php +++ b/tests/MathMathMLTest.php @@ -211,4 +211,4 @@ return MathMathMLTest::$html; } -} \ No newline at end of file +} diff --git
[MediaWiki-commits] [Gerrit] Cleanup the projects announced in -releng - change (labs...wikibugs2)
jenkins-bot has submitted this change and it was merged. Change subject: Cleanup the projects announced in -releng .. Cleanup the projects announced in -releng Change-Id: Ic6b64ea169fba3684450d8056de8e8861c0192b1 --- M channels.yaml 1 file changed, 2 insertions(+), 9 deletions(-) Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/channels.yaml b/channels.yaml index 7bc304b..6557aae 100644 --- a/channels.yaml +++ b/channels.yaml @@ -79,22 +79,15 @@ - Release-Engineering #wikimedia-releng: -# wikimedia-devtools + wikimedia-qa # teams +- Release-Engineering - Phabricator # projects -- Wikibugs -- Phabricator.org -- Bugzilla-Migration -- Bugzilla-Preview -- RT-Migration -- Project-Management - Code-Review -- Gitblit-Deprecate - Continuous-integration - Quality-Assurance - Beta-Cluster -- Release-Engineering +- Deployment-Systems #mediawiki-visualeditor: # x.get(X-Bugzilla-Product, None) in [VisualEditor, OOjs, OOjs UI] or \ -- To view, visit https://gerrit.wikimedia.org/r/183994 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic6b64ea169fba3684450d8056de8e8861c0192b1 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Greg Grossmeier g...@wikimedia.org Gerrit-Reviewer: Aklapper aklap...@wikimedia.org Gerrit-Reviewer: Greg Grossmeier g...@wikimedia.org Gerrit-Reviewer: Hashar has...@free.fr Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Qgil q...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update MathParser tests - change (mediawiki...Math)
Physikerwelt has uploaded a new change for review. https://gerrit.wikimedia.org/r/184124 Change subject: Update MathParser tests .. Update MathParser tests In the most recent version of ubuntu14 the outputhash of the png images for some math objects has changed. However, the rendered images seem to look ok. T86309 Change-Id: I52dbdefdcfa19c10f1d9d1a43369aabe8bfd92bf --- M tests/ParserTest.json 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math refs/changes/24/184124/1 diff --git a/tests/ParserTest.json b/tests/ParserTest.json index c0e2e94..168496b 100644 --- a/tests/ParserTest.json +++ b/tests/ParserTest.json @@ -49,7 +49,7 @@ ], [ \\hat{a}, \\widehat{a}, \\vec{a} \\!, -img class=\mwe-math-fallback-image-inline tex\ alt=\\\hat{a}, \\widehat{a}, \\vec{a} \\!\ src=\eaededf26bb201c699ef1597902383c3.png\ \/ +img class=\mwe-math-fallback-image-inline tex\ alt=\\\hat{a}, \\widehat{a}, \\vec{a} \\!\ src=\731677a388ba08f520ebe91623dab74a.png\ \/ ], [ \\exp_a b = a^b, \\exp b = e^b, 10^m \\!, @@ -333,7 +333,7 @@ ], [ \\bar{q}, \\bar{abc}, \\overline{q}, \\overline{abc}, \\!, -img class=\mwe-math-fallback-image-inline tex\ alt=\\\bar{q}, \\bar{abc}, \\overline{q}, \\overline{abc}, \\!\ src=\dcb1a2881216fe505b14faa2f5dd4f0e.png\ \/ +img class=\mwe-math-fallback-image-inline tex\ alt=\\\bar{q}, \\bar{abc}, \\overline{q}, \\overline{abc}, \\!\ src=\223a4c78df8eb8b9a1086c5e490f48ce.png\ \/ ], [ \\lnot \\neg, \\not\\operatorname{R}, \\bot, \\top \\!, @@ -513,11 +513,11 @@ ], [ \\overrightarrow{a b} \\ \\overleftarrow{c d} \\ \\widehat{d e f}, -img class=\mwe-math-fallback-image-inline tex\ alt=\ \\overrightarrow{a b} \\ \\overleftarrow{c d} \\ \\widehat{d e f}\ src=\12e159cc1c8699d116a85ef715af3951.png\ \/ +img class=\mwe-math-fallback-image-inline tex\ alt=\ \\overrightarrow{a b} \\ \\overleftarrow{c d} \\ \\widehat{d e f}\ src=\068086b5de6bf21adea301df3efffbf7.png\ \/ ], [ \\overline{g h i} \\ \\underline{j k l}, -img class=\mwe-math-fallback-image-inline tex\ alt=\ \\overline{g h i} \\ \\underline{j k l}\ src=\2dc44edf7a2bdedf2e01e6622e15d695.png\ \/ +img class=\mwe-math-fallback-image-inline tex\ alt=\ \\overline{g h i} \\ \\underline{j k l}\ src=\849f4d97e037fc2cf06b1257d31b67a9.png\ \/ ], [ \\overset{\\frown} {AB}, @@ -529,11 +529,11 @@ ], [ \\overbrace{ 1+2+\\cdots+100 }^{5050}, -img class=\mwe-math-fallback-image-inline tex\ alt=\\\overbrace{ 1+2+\\cdots+100 }^{5050}\ src=\813e812891b31b2b02178327fd69fdb9.png\ \/ +img class=\mwe-math-fallback-image-inline tex\ alt=\\\overbrace{ 1+2+\\cdots+100 }^{5050}\ src=\eae794abb74d6c73dc96eaa994cc0a16.png\ \/ ], [ \\underbrace{ a+b+\\cdots+z }_{26}, -img class=\mwe-math-fallback-image-inline tex\ alt=\\\underbrace{ a+b+\\cdots+z }_{26}\ src=\f1da0064e0dba6c5951d44e07e191c5a.png\ \/ +img class=\mwe-math-fallback-image-inline tex\ alt=\\\underbrace{ a+b+\\cdots+z }_{26}\ src=\32035dea97452b31b44d084f90bd66a6.png\ \/ ], [ \\sum_{k=1}^N k^2, @@ -1665,11 +1665,11 @@ ], [ \\widehat{x}, -img class=\mwe-math-fallback-image-inline tex\ alt=\\\widehat{x}\ src=\998309e831dfb051f233c92b4b8a825b.png\ \/ +img class=\mwe-math-fallback-image-inline tex\ alt=\\\widehat{x}\ src=\260a7a181658b82549b23574d4bf476b.png\ \/ ], [ \\widetilde{x}, -img class=\mwe-math-fallback-image-inline tex\ alt=\\\widetilde{x}\ src=\e9e91996778a6d6f5cdf4cc951955206.png\ \/ +img class=\mwe-math-fallback-image-inline tex\ alt=\\\widetilde{x}\ src=\4848f7a70999ab4e0ca9d205efa3cd04.png\ \/ ], [ \\euro 200, -- To view, visit https://gerrit.wikimedia.org/r/184124 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52dbdefdcfa19c10f1d9d1a43369aabe8bfd92bf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Math Gerrit-Branch: master Gerrit-Owner: Physikerwelt w...@physikerwelt.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add feature: tabs that show up in every tab - change (mediawiki...Tabs)
Joeytje50 has uploaded a new change for review. https://gerrit.wikimedia.org/r/184126 Change subject: Add feature: tabs that show up in every tab .. Add feature: tabs that show up in every tab Using index=* for a tab tag will now make it show up for every single tab. This is useful when nesting toggle boxes or dropdown menus inside tab menus. Also fixed a bug that made it impossible to use {{#tab:#1|cont}} syntax, because index=#1 would be set. Change-Id: Iff726f885bbd4b55d66dc0d2055e64eb7344cb4d --- M Tabs.body.php M ext.tabs.css 2 files changed, 40 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Tabs refs/changes/26/184126/1 diff --git a/Tabs.body.php b/Tabs.body.php index 7aa8d9f..501337a 100644 --- a/Tabs.body.php +++ b/Tabs.body.php @@ -66,42 +66,47 @@ } // Default value for the tab's given index: index attribute's value, or else the index of the tab with the same name as name attribute, or else the tab index if (!$nested) { - $index = 0; // indices do nothing for non-nested tabs, so don't even bother doing the computations. + $index = -1; // indices do nothing for non-nested tabs, so don't even bother doing the computations. } elseif (isset($attr['index']) intval($attr['index']) = count($names)) { $index = intval($attr['index']); // if the index is given, and it isn't greater than the current index + 1. - } elseif (isset($attr['name']) array_search($attr['name'], $names) !== false) + } elseif (isset($attr['index']) $attr['index'] == '*') { + $index = 0; //use wildcard index: this tab's contents shows up for every single tab; + //this makes it possible to have a dropdown box inside a tabs box, which shows up for every tab. + } elseif (isset($attr['name']) array_search($attr['name'], $names) !== false) { $index = array_search($attr['name'], $names)+1; // if index is not defined, but the name is, use the index of the tabname. - else { + } else { $index = count($names)+1; // index of this tab in this scope. Plus one because tabs are 1-based, arrays are 0-based. } $classPrefix = ''; - if ($nested) // Note: This is defined seperately for toggleboxes, because of the different classes required. + if ($nested) {// Note: This is defined seperately for toggleboxes, because of the different classes required. $classPrefix .= tabs-content tabs-content-$index; - - if (!isset($attr['class'])) - $attr['class'] = $classPrefix; // only the prefix if no classes have been defined - else - $attr['class'] = trim($classPrefix .htmlspecialchars($attr['class'])); - - if (isset($names[$index-1])) {// if array $names already has a name defined at position $index, use that. - $name = $names[$index-1]; // minus 1 because tabs are 1-based, arrays 0-based. - } else {// otherwise, use the entered name, or the $index with a Tab prefix if it is not defined or empty. - $name = trim(isset($attr['name']) $attr['name'] ? $attr['name'] : wfMessage('tabs-tab-label', $index)); } - + if (isset($attr['class'])) { + $attr['class'] = trim($classPrefix .htmlspecialchars($attr['class'])); + } else { + $attr['class'] = $classPrefix; // only the prefix if no classes have been defined + } + if ($index !== 0) { + if (isset($names[$index-1])) { // if array $names already has a name defined at position $index, use that. + $name = $names[$index-1]; // minus 1 because tabs are 1-based, arrays 0-based. + } else { // otherwise, use the entered name, or the $index with a Tab prefix if it is not defined or empty. + $name = trim(isset($attr['name']) $attr['name'] ? $attr['name'] : wfMessage('tabs-tab-label', $index)); + } + } if (!$nested) { // This runs when the tab is not nested inside a tabs tag. $container = $this-renderBox($input, $attr, $parser); } else { // this runs when the tab is nested inside a tabs tag. - if (array_search($name, $names) === false) // append name if it's not already in the list. + if ($index !== 0 array_search($name, $names) === false) {// append name if it's
[MediaWiki-commits] [Gerrit] Remove FlaggedRevs config on metawiki - change (operations/mediawiki-config)
Glaisher has uploaded a new change for review. https://gerrit.wikimedia.org/r/184133 Change subject: Remove FlaggedRevs config on metawiki .. Remove FlaggedRevs config on metawiki Added for Zero testing purposes, which is now over. Bug: T86443 Change-Id: Ic87ef159ad1304d0a2585df59f532f272408f6ed --- M flaggedrevs.dblist M wmf-config/flaggedrevs.php 2 files changed, 0 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/33/184133/1 diff --git a/flaggedrevs.dblist b/flaggedrevs.dblist index 3bff8d6..e9d5729 100644 --- a/flaggedrevs.dblist +++ b/flaggedrevs.dblist @@ -27,7 +27,6 @@ iswiktionary kawiki lawikisource -metawiki mkwiki plwiki plwikisource diff --git a/wmf-config/flaggedrevs.php b/wmf-config/flaggedrevs.php index 8530825..74fa63a 100644 --- a/wmf-config/flaggedrevs.php +++ b/wmf-config/flaggedrevs.php @@ -503,19 +503,6 @@ $wgGroupPermissions['trusted']['autoreview'] = true; } -elseif ( $wgDBname == 'metawiki' ) { - $wgFlaggedRevsNamespaces = array ( 480 /* NS_ZERO */ ); - $wgFlaggedRevTags = array( - 'safeness' = array( 'levels' = 1, 'quality' = 2, 'pristine' = 3 ), - ); - $wgFlagRestrictions = array( 'safeness' = array( 'review' = 1 ) ); - $wgFlaggedRevsAutopromote = false; - unset( $wgGroupPermissions['editor'] ); - unset( $wgGroupPermissions['reviewer'] ); - $wgGroupPermissions['zeroadmin']['review'] = true; - $wgGroupPermissions['zeroadmin']['autoreview'] = true; -} - elseif ( $wgDBname == 'plwiki' ) { // Bugs 43617, 48043 $wgFlaggedRevsNamespaces = array( NS_MAIN, NS_TEMPLATE, NS_CATEGORY, NS_HELP, 100, 828 ); -- To view, visit https://gerrit.wikimedia.org/r/184133 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic87ef159ad1304d0a2585df59f532f272408f6ed Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Glaisher glaisher.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Tel-Hai Academic College event - change (operations/mediawiki-config)
Eranroz has uploaded a new change for review. https://gerrit.wikimedia.org/r/184119 Change subject: Tel-Hai Academic College event .. Tel-Hai Academic College event see T85773 Change-Id: I8d295804097da633d7edbcd37facc61fb02fe2e4 --- M wmf-config/throttle.php 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/19/184119/1 diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php index 24e0190..925303d 100644 --- a/wmf-config/throttle.php +++ b/wmf-config/throttle.php @@ -20,12 +20,12 @@ # (default: any project) ## Add throttling definitions below. -$wmgThrottlingExceptions[] = array( // T78752 - 'from' = '2014-12-18T11:00 +2:00', - 'to' = '2014-12-18T20:00 +2:00', - 'range' = array( '132.74.0.0/16', '132.75.0.0/16' ), +$wmgThrottlingExceptions[] = array( // T85773 + 'from' = '2015-01-12T09:00 +2:00', + 'to' = '2014-01-12T16:00 +2:00', + 'range' = array( '31.168.96.0/20', '192.115.130.0/24' ), 'dbname' = array( 'hewiki', 'commonswiki' ), - 'value' = 55, + 'value' = 40, ); ## Add throttling definitions above. -- To view, visit https://gerrit.wikimedia.org/r/184119 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8d295804097da633d7edbcd37facc61fb02fe2e4 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Eranroz eranro...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [bugfix] use message_package_name for i18n.twhas_key() method - change (pywikibot/core)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/184120 Change subject: [bugfix] use message_package_name for i18n.twhas_key() method .. [bugfix] use message_package_name for i18n.twhas_key() method This patch re-enables using this method through Python Shell Change-Id: I8e766f30dac4a13b6b215ddd7dc50a95386e730d --- M pywikibot/i18n.py 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/20/184120/1 diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 6b0dede..50cf790 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -359,7 +359,8 @@ @param parameters: For passing parameters. package = twtitle.split(-)[0] -transdict = getattr(__import__(messages_package_name, fromlist=[package]), package).msg +transdict = getattr(__import__(messages_package_name, fromlist=[package]), +package).msg code_needed = False # If a site is given instead of a code, use its language @@ -490,7 +491,8 @@ @param twtitle: The TranslateWiki string title, in package-key format package = twtitle.split(-)[0] -transdict = getattr(__import__(i18n, fromlist=[package]), package).msg +transdict = getattr(__import__(messages_package_name, fromlist=[package]), +package).msg # If a site is given instead of a code, use its language if hasattr(code, 'code'): code = code.code -- To view, visit https://gerrit.wikimedia.org/r/184120 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e766f30dac4a13b6b215ddd7dc50a95386e730d Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt i...@gno.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add Wikidata support to isbn.py script - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Add Wikidata support to isbn.py script .. Add Wikidata support to isbn.py script The support is done via a separate Bot class. It can find ISBN-10 and ISBN-13 property IDs or they can be provided manually by the user. Also, the patch adds support for -always option in WikidataBot when using new method WikidataBot.userEditEntity. Bug: T85242 Change-Id: I38cf459d78eb02102da6a169c9c0633ee95b1f3b --- M pywikibot/bot.py M scripts/isbn.py M tests/isbn_tests.py 3 files changed, 259 insertions(+), 12 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/bot.py b/pywikibot/bot.py index d56b526..0bb79ba 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -1006,19 +1006,36 @@ if 'comment' in kwargs: pywikibot.output(u'Comment: %s' % kwargs['comment']) +page.text = newtext +self._save_page(page, page.save, **kwargs) + +def _save_page(self, page, func, *args, **kwargs): + +Helper function to handle page save-related option error handling. + +@param page: currently edited page +@param func: the function to call +@param args: passed to the function +@param kwargs: passed to the function +@kwarg ignore_server_errors: if True, server errors will be reported + and ignored (default: False) +@kwtype ignore_server_errors: bool +@kwarg ignore_save_related_errors: if True, errors related to +page save will be reported and ignored (default: False) +@kwtype ignore_save_related_errors: bool + if not self.user_confirm('Do you want to accept these changes?'): return if 'async' not in kwargs and self.getOption('always'): kwargs['async'] = True -page.text = newtext - -ignore_save_related_errors = kwargs.pop('ignore_save_related_errors', False) +ignore_save_related_errors = kwargs.pop('ignore_save_related_errors', +False) ignore_server_errors = kwargs.pop('ignore_server_errors', False) try: -page.save(**kwargs) +func(*args, **kwargs) except pywikibot.PageSaveRelatedError as e: if not ignore_save_related_errors: raise @@ -1164,6 +1181,67 @@ self.source_values[family_code][source_lang] = pywikibot.ItemPage(self.repo, family[source_lang]) +def get_property_by_name(self, property_name): + +Find given property and return its ID. + +Method first uses site.search() and if the property isn't found, then +asks user to provide the property ID. + +@param property_name: property to find +@type property_name: str + +ns = self.site.data_repository().property_namespace +for page in self.site.search(property_name, step=1, total=1, + namespaces=ns): +page = pywikibot.PropertyPage(self.site.data_repository(), + page.title()) +pywikibot.output(uAssuming that %s property is %s. % + (property_name, page.id)) +return page.id +return pywikibot.input(u'Property %s was not found. Please enter the ' + u'property ID (e.g. P123) of it:' + % property_name).upper() + +def user_edit_entity(self, item, data=None, **kwargs): + +Edit entity with data provided, with user confirmation as required. + +@param item: page to be edited +@type item: ItemPage +@param data: data to be saved, or None if the diff should be created + automatically +@kwarg summary: revision comment, passed to ItemPage.editEntity +@kwtype summary: str +@kwarg show_diff: show changes between oldtext and newtext (default: + True) +@kwtype show_diff: bool +@kwarg ignore_server_errors: if True, server errors will be reported + and ignored (default: False) +@kwtype ignore_server_errors: bool +@kwarg ignore_save_related_errors: if True, errors related to +page save will be reported and ignored (default: False) +@kwtype ignore_save_related_errors: bool + +self.current_page = item + +show_diff = kwargs.pop('show_diff', True) +if show_diff: +if data is None: +diff = item.toJSON(diffto=( +item._content if hasattr(item, '_content') else None)) +else: +diff = pywikibot.WikibasePage._normalizeData(data) +
[MediaWiki-commits] [Gerrit] Add classes for tests that alter mylang and family - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Add classes for tests that alter mylang and family .. Add classes for tests that alter mylang and family Change-Id: I247b44d55b2cf744b72fe0731b3beb67bb86ce1f --- M tests/aspects.py M tests/deletionbot_tests.py M tests/interwiki_link_tests.py M tests/link_tests.py M tests/reflinks_tests.py 5 files changed, 75 insertions(+), 93 deletions(-) Approvals: John Vandenberg: Looks good to me, but someone else must approve XZise: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/aspects.py b/tests/aspects.py index 86d1341..b6b0956 100644 --- a/tests/aspects.py +++ b/tests/aspects.py @@ -913,6 +913,35 @@ code = config.mylang +class AlteredDefaultSiteTestCase(TestCase): + +Save and restore the config.mylang and config.family. + +def setUp(self): +Prepare the environment for running main() in a script. +self.original_family = pywikibot.config.family +self.original_code = pywikibot.config.mylang +super(AlteredDefaultSiteTestCase, self).setUp() + +def tearDown(self): +Restore the environment. +pywikibot.config.family = self.original_family +pywikibot.config.mylang = self.original_code +super(AlteredDefaultSiteTestCase, self).tearDown() + + +class ScenarioDefinedDefaultSiteTestCase(AlteredDefaultSiteTestCase): + +Tests that depend on the default site being set to the test site. + +def setUp(self): +Prepare the environment for running main() in a script. +super(ScenarioDefinedDefaultSiteTestCase, self).setUp() +site = self.get_site() +pywikibot.config.family = site.family +pywikibot.config.mylang = site.code + + class DefaultDrySiteTestCase(DefaultSiteTestCase): Run tests using the config specified site in offline mode. @@ -1072,6 +1101,13 @@ % (cls.__name__, cls.get_site())) +class ScriptMainTestCase(ScenarioDefinedDefaultSiteTestCase): + +Test running a script main(). + +pass + + class PwbTestCase(TestCase): diff --git a/tests/deletionbot_tests.py b/tests/deletionbot_tests.py index 7c0d893..1a8d5ed 100644 --- a/tests/deletionbot_tests.py +++ b/tests/deletionbot_tests.py @@ -12,10 +12,10 @@ from scripts import delete -from tests.aspects import unittest, TestCase +from tests.aspects import unittest, ScriptMainTestCase -class TestDeletionBotWrite(TestCase): +class TestDeletionBotWrite(ScriptMainTestCase): Test deletionbot script. @@ -48,7 +48,7 @@ '-undelete', '-summary=pywikibot unit tests') -class TestDeletionBotUser(TestCase): +class TestDeletionBotUser(ScriptMainTestCase): Test deletionbot as a user (not sysop). @@ -75,7 +75,7 @@ p1.save('unit test', botflag=True) -class TestDeletionBot(TestCase): +class TestDeletionBot(ScriptMainTestCase): Test deletionbot with patching to make it non-write. diff --git a/tests/interwiki_link_tests.py b/tests/interwiki_link_tests.py index ea7ec08..d5b44fb 100644 --- a/tests/interwiki_link_tests.py +++ b/tests/interwiki_link_tests.py @@ -10,24 +10,20 @@ from pywikibot import config2 as config from pywikibot.page import Link from pywikibot.exceptions import InvalidTitle -from tests.aspects import unittest, TestCase +from tests.aspects import ( +unittest, +AlteredDefaultSiteTestCase as LinkTestCase, +TestCase, +) -class TestPartiallyQualifiedLinkDifferentCodeParser(TestCase): +class TestPartiallyQualifiedLinkDifferentCodeParser(LinkTestCase): Tests for interwiki links to local sites. family = 'wikipedia' code = 'en' cached = True - -def setUp(self): -self.old_lang = config.mylang -self.old_family = config.family - -def tearDown(self): -config.mylang = self.old_lang -config.family = self.old_family def test_partially_qualified_NS0_family(self): Test that Link uses config.family for namespace 0. diff --git a/tests/link_tests.py b/tests/link_tests.py index a378c65..ab80d0d 100644 --- a/tests/link_tests.py +++ b/tests/link_tests.py @@ -11,7 +11,13 @@ from pywikibot import config2 as config from pywikibot.page import Link from pywikibot.exceptions import Error, InvalidTitle -from tests.aspects import unittest, DefaultDrySiteTestCase, TestCase +from tests.aspects import ( +unittest, +AlteredDefaultSiteTestCase as LinkTestCase, +DefaultDrySiteTestCase, +WikimediaDefaultSiteTestCase, +TestCase, +) # Tests checking if the parser does (not) accept (in)valid titles @@ -102,21 +108,13 @@ # The first set of tests are explicit links, starting with a ':'. -class TestPartiallyQualifiedExplicitLinkSameSiteParser(TestCase): +class TestPartiallyQualifiedExplicitLinkSameSiteParser(LinkTestCase): Link tests. family = 'wikipedia' code
[MediaWiki-commits] [Gerrit] Add dependency to mediawiki.toolbar - change (mediawiki...Math)
Physikerwelt has uploaded a new change for review. https://gerrit.wikimedia.org/r/184127 Change subject: Add dependency to mediawiki.toolbar .. Add dependency to mediawiki.toolbar It seems that ext.math.editbutton.enabler depends on mediawiki.toolbar. Bug: T86235 Change-Id: I37a0b8e84a9bd6a0de0386d5b9924bd7249c --- M Math.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math refs/changes/27/184127/1 diff --git a/Math.php b/Math.php index 0d94491..46bdc6f 100644 --- a/Math.php +++ b/Math.php @@ -498,6 +498,7 @@ 'scripts' = 'ext.math.editbutton.js', 'dependencies' = array( 'mediawiki.action.edit', + 'mediawiki.toolbar' ), 'messages' = array( 'math_tip', -- To view, visit https://gerrit.wikimedia.org/r/184127 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37a0b8e84a9bd6a0de0386d5b9924bd7249c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Math Gerrit-Branch: master Gerrit-Owner: Physikerwelt w...@physikerwelt.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Documentation fix - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Documentation fix .. Documentation fix Change-Id: Ic9a2452e9dbe36542a9f4a108c93d5508a582018 --- M tests/l10n_tests.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/l10n_tests.py b/tests/l10n_tests.py index e6bd7bc..d3dc417 100644 --- a/tests/l10n_tests.py +++ b/tests/l10n_tests.py @@ -62,7 +62,7 @@ class TestValidTemplate(TestCase): -Test cases for date library processed by unittest. +Test cases L10N message templates processed by unittest. __metaclass__ = TestValidTemplateMeta net = True # magic flag tells jenkins to not run the test. -- To view, visit https://gerrit.wikimedia.org/r/184122 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic9a2452e9dbe36542a9f4a108c93d5508a582018 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt i...@gno.de Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Xqt i...@gno.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add dependency to texlive-generic-extra - change (mediawiki/vagrant)
Physikerwelt has uploaded a new change for review. https://gerrit.wikimedia.org/r/184123 Change subject: Add dependency to texlive-generic-extra .. Add dependency to texlive-generic-extra Without iftex some commands from teubner like for instance $\\varstigma$ do not work Change-Id: I84f649b55a50b033ae3737e8b93ec96bb058b69c --- M puppet/modules/role/manifests/math.pp 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/23/184123/1 diff --git a/puppet/modules/role/manifests/math.pp b/puppet/modules/role/manifests/math.pp index 0b89dec..67b4b73 100644 --- a/puppet/modules/role/manifests/math.pp +++ b/puppet/modules/role/manifests/math.pp @@ -44,6 +44,7 @@ 'texlive-pictures', 'texlive-pstricks', 'texlive-publishers', +'texlive-generic-extra' ]: } -- To view, visit https://gerrit.wikimedia.org/r/184123 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I84f649b55a50b033ae3737e8b93ec96bb058b69c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Physikerwelt w...@physikerwelt.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move taxonomy to Phabricator/Projects - change (labs...wikibugs2)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/184129 Change subject: Move taxonomy to Phabricator/Projects .. Move taxonomy to Phabricator/Projects Bug: T85096 Change-Id: Ia8f09e64d086ff6189ddcfe77b521ab44cef91a8 --- M taxonomy.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 refs/changes/29/184129/1 diff --git a/taxonomy.py b/taxonomy.py index c944b0b..51dd6e5 100644 --- a/taxonomy.py +++ b/taxonomy.py @@ -90,6 +90,6 @@ user=conf.get('MEDIAWIKI_USER') ) site.login(password=conf.get('MEDIAWIKI_PASS')) -page = pywikibot.Page(site, 'Phabricator/Projects/Test') +page = pywikibot.Page(site, 'Phabricator/Projects') page.text = wikipage page.save(comment='Updating project taxonomy', botflag=False) -- To view, visit https://gerrit.wikimedia.org/r/184129 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8f09e64d086ff6189ddcfe77b521ab44cef91a8 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add Taxonomy cron job - change (labs...wikibugs2)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/184128 Change subject: Add Taxonomy cron job .. Add Taxonomy cron job Bug: T85096 Change-Id: I7a176c915b97c1f84f9e983e5ee7601863dc1093 --- M fabfile.py 1 file changed, 20 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 refs/changes/28/184128/1 diff --git a/fabfile.py b/fabfile.py index 5d8dd33..f582cca 100644 --- a/fabfile.py +++ b/fabfile.py @@ -1,14 +1,18 @@ +from io import StringIO from fabric.api import * # noqa from fabric.contrib.console import confirm +tool_name = 'wikibugs' + env.hosts = ['tools-login.wmflabs.org'] -env.sudo_user = 'tools.wikibugs' +env.sudo_user = 'tools.{}'.format(tool_name) env.sudo_prefix = 'sudo -ni ' env.use_ssh_config = True -code_dir = '/data/project/wikibugs/wikibugs2' +home_dir = '/data/project/{}'.format(tool_name) +code_dir = '{}/wikibugs2'.format(home_dir) +python = '{}/py-wikibugs2/bin/python'.format(home_dir) -python = '/data/project/wikibugs/py-wikibugs2/bin/python' jobs = { 'wb2-phab': '{python} {code_dir}/wikibugs.py', 'wb2-irc': '{python} {code_dir}/redis2irc.py', @@ -28,6 +32,19 @@ sudo('git pull') +@task +def crontab(): +with cd(home_dir): +contents = StringIO( +u# This crontab was auto-generated by Fabric +#m h dom mon dow cmd + 0 0 * * 0 /usr/bin/jsub -N taxonomy -mem 512m -once {python} {code_dir}/taxonomy.py /dev/null +.format(**globals()) +) +put(contents, 'crontab', mode=0o664) +sudo('crontab crontab') + + def start_job(name): # string formatting as fab doesn't get list-style commands... sudo('jstart -N {name} -l release=trusty -mem 1G -once {command}'.format( -- To view, visit https://gerrit.wikimedia.org/r/184128 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a176c915b97c1f84f9e983e5ee7601863dc1093 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Cleanup ext.cx.tools.manager.js - change (mediawiki...ContentTranslation)
jenkins-bot has submitted this change and it was merged. Change subject: Cleanup ext.cx.tools.manager.js .. Cleanup ext.cx.tools.manager.js * Cleanup whitespace. * Remove a useless comment. Change-Id: Ie07f36b5356e9a1af891e1f52027c3f072290486 --- M modules/tools/ext.cx.tools.manager.js 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/tools/ext.cx.tools.manager.js b/modules/tools/ext.cx.tools.manager.js index 9f3efee..4bb7113 100644 --- a/modules/tools/ext.cx.tools.manager.js +++ b/modules/tools/ext.cx.tools.manager.js @@ -10,7 +10,7 @@ * A tool can register as a CX tool card with this manager. * Example: * code - * mw.cx.tools.dictionary = DictionaryCard; + * mw.cx.tools.dictionary = DictionaryCard; * /code * In this example dictionary is a unique identifier for the tool card * DictionaryCard is a class that implements the tool card @@ -32,10 +32,13 @@ */ function CXToolManager( container, options ) { this.options = $.extend( {}, $.fn.cxtoolmanager.defaults, options ); + // The tools container this.$container = $( container ); + // Collection of all tool instances that are currently shown this.tools = {}; + // Collection of all events that the registered tools listen for. this.eventRegistry = {}; this.init(); @@ -55,14 +58,13 @@ for ( index = 0; index events.length; index++ ) { if ( !cxToolManager.eventRegistry[ events[ index ] ] ) { - // initialize the array cxToolManager.eventRegistry[ events[ index ] ] = []; } cxToolManager.eventRegistry[ events[ index ] ].push( toolName ); if ( toolName === cxToolManager.options.defaultTool ) { - // show the default tool + // Show the default tool cxToolManager.showCard( toolName ); } } @@ -170,10 +172,12 @@ if ( toolName === currentToolName ) { continue; } + if ( tool.sticky ) { // If the card is sticky, do not hide till it is done. Example: MTAbuse card. continue; } + toolEvents = tool.getTriggerEvents(); if ( intersection( currentToolEvents, toolEvents ).length === 0 ) { this.hideCard( toolName ); -- To view, visit https://gerrit.wikimedia.org/r/183851 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie07f36b5356e9a1af891e1f52027c3f072290486 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Amire80 amir.ahar...@mail.huji.ac.il Gerrit-Reviewer: KartikMistry kartik.mis...@gmail.com Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [bugfix] use message_package_name for i18n.twhas_key() method - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [bugfix] use message_package_name for i18n.twhas_key() method .. [bugfix] use message_package_name for i18n.twhas_key() method This patch re-enables using this method through Python Shell Change-Id: I8e766f30dac4a13b6b215ddd7dc50a95386e730d --- M pywikibot/i18n.py 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 6b0dede..50cf790 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -359,7 +359,8 @@ @param parameters: For passing parameters. package = twtitle.split(-)[0] -transdict = getattr(__import__(messages_package_name, fromlist=[package]), package).msg +transdict = getattr(__import__(messages_package_name, fromlist=[package]), +package).msg code_needed = False # If a site is given instead of a code, use its language @@ -490,7 +491,8 @@ @param twtitle: The TranslateWiki string title, in package-key format package = twtitle.split(-)[0] -transdict = getattr(__import__(i18n, fromlist=[package]), package).msg +transdict = getattr(__import__(messages_package_name, fromlist=[package]), +package).msg # If a site is given instead of a code, use its language if hasattr(code, 'code'): code = code.code -- To view, visit https://gerrit.wikimedia.org/r/184120 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e766f30dac4a13b6b215ddd7dc50a95386e730d Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt i...@gno.de Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPROV] Request all tokens at once - change (pywikibot/core)
XZise has uploaded a new change for review. https://gerrit.wikimedia.org/r/184125 Change subject: [IMPROV] Request all tokens at once .. [IMPROV] Request all tokens at once Prior to version 1.20 it wasn't requesting all tokens at once but each in a separate request. But the API actually allows to request all tokens at once. Change-Id: I91326d6a30269f617ba60d18079339832028da5b --- M pywikibot/site.py 1 file changed, 12 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/25/184125/1 diff --git a/pywikibot/site.py b/pywikibot/site.py index c1fd08a..9e0c75a 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -2673,24 +2673,23 @@ if _version MediaWikiVersion('1.20'): if all: types.extend(self.TOKENS_0) -for tokentype in self.validate_tokens(types): -# 'patrol' token is done later on. -if tokentype == 'patrol': -continue -query = api.PropertyGenerator('info', - titles='Dummy page', - intoken=tokentype, - site=self) -query.request._warning_handler = warn_handler +valid_tokens = set(self.validate_tokens(types)) +# don't request patrol +query = api.PropertyGenerator('info', + titles='Dummy page', + intoken=valid_tokens - set(['patrol']), + site=self) +query.request._warning_handler = warn_handler -for item in query: -pywikibot.debug(unicode(item), _logger) +for item in query: +pywikibot.debug(unicode(item), _logger) +for tokentype in valid_tokens: if (tokentype + 'token') in item: user_tokens[tokentype] = item[tokentype + 'token'] # patrol token require special handling. # TODO: try to catch exceptions? -if 'patrol' in types: +if 'patrol' in valid_tokens: if MediaWikiVersion('1.14') = _version MediaWikiVersion('1.17'): user_tokens['patrol'] = user_tokens['edit'] else: @@ -2707,8 +2706,7 @@ item = data['recentchanges'][0] pywikibot.debug(unicode(item), _logger) if 'patroltoken' in item: -user_tokens['patrol'] = item.get('patroltoken') - +user_tokens['patrol'] = item['patroltoken'] else: if _version MediaWikiVersion('1.24wmf19'): if all is not False: -- To view, visit https://gerrit.wikimedia.org/r/184125 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91326d6a30269f617ba60d18079339832028da5b Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Documentation fix - change (pywikibot/core)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/184122 Change subject: Documentation fix .. Documentation fix Change-Id: Ic9a2452e9dbe36542a9f4a108c93d5508a582018 --- M tests/l10n_tests.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/22/184122/1 diff --git a/tests/l10n_tests.py b/tests/l10n_tests.py index e6bd7bc..d3dc417 100644 --- a/tests/l10n_tests.py +++ b/tests/l10n_tests.py @@ -62,7 +62,7 @@ class TestValidTemplate(TestCase): -Test cases for date library processed by unittest. +Test cases L10N message templates processed by unittest. __metaclass__ = TestValidTemplateMeta net = True # magic flag tells jenkins to not run the test. -- To view, visit https://gerrit.wikimedia.org/r/184122 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9a2452e9dbe36542a9f4a108c93d5508a582018 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt i...@gno.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Create 'Draft' (118) namespace on hewikipedia - change (operations/mediawiki-config)
Glaisher has uploaded a new change for review. https://gerrit.wikimedia.org/r/184130 Change subject: Create 'Draft' (118) namespace on hewikipedia .. Create 'Draft' (118) namespace on hewikipedia ..with the associated talk namespace. Also prevent indexing of the pages in these namespaces by search engines (nofollow,noindex). Bug: T86329 Change-Id: Ieed28431bd70944db42e5e1e6ab322e68438f2f9 --- M wmf-config/InitialiseSettings.php 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/30/184130/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4712642..df144a9 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -4598,6 +4598,8 @@ 101 = 'שיחת_פורטל', 108 = 'ספר', // Book 109 = 'שיחת_ספר', // Book talk + 118 = 'טיוטה', // Draft - T86329 + 119 = 'שיחת_טיוטה', ), 'hiwiki' = array( 100 = 'प्रवेशद्वार', @@ -9657,6 +9659,8 @@ ), 'hewiki' = array( NS_USER = 'noindex,follow', // bug 16247 + 118 = 'noindex,nofollow', // Draft - T86329 + 119 = 'noindex,nofollow', ), 'ruwiki' = array( 102 = 'noindex,follow', @@ -9874,6 +9878,7 @@ 'wmgExemptFromUserRobotsControlExtra' = array( 'default' = array(), 'enwiki' = array( 118, 119 ), // draft and draft talk + 'hewiki' = array( 118, 119 ), // draft and draft talk - T86329 ), 'wgRevisionCacheExpiry' = array( -- To view, visit https://gerrit.wikimedia.org/r/184130 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieed28431bd70944db42e5e1e6ab322e68438f2f9 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Glaisher glaisher.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add feature: tabs that show up in every tab - change (mediawiki...Tabs)
jenkins-bot has submitted this change and it was merged. Change subject: Add feature: tabs that show up in every tab .. Add feature: tabs that show up in every tab Using index=* for a tab tag will now make it show up for every single tab. This is useful when nesting toggle boxes or dropdown menus inside tab menus. Also fixed a bug that made it impossible to use {{#tab:#1|cont}} syntax, because index=#1 would be set. Change-Id: Iff726f885bbd4b55d66dc0d2055e64eb7344cb4d --- M Tabs.body.php M ext.tabs.css M ext.tabs.js 3 files changed, 66 insertions(+), 40 deletions(-) Approvals: Joeytje50: Looks good to me, approved jenkins-bot: Verified diff --git a/Tabs.body.php b/Tabs.body.php index 7aa8d9f..7383443 100644 --- a/Tabs.body.php +++ b/Tabs.body.php @@ -66,42 +66,47 @@ } // Default value for the tab's given index: index attribute's value, or else the index of the tab with the same name as name attribute, or else the tab index if (!$nested) { - $index = 0; // indices do nothing for non-nested tabs, so don't even bother doing the computations. + $index = -1; // indices do nothing for non-nested tabs, so don't even bother doing the computations. } elseif (isset($attr['index']) intval($attr['index']) = count($names)) { $index = intval($attr['index']); // if the index is given, and it isn't greater than the current index + 1. - } elseif (isset($attr['name']) array_search($attr['name'], $names) !== false) + } elseif (isset($attr['index']) $attr['index'] == '*') { + $index = 0; //use wildcard index: this tab's contents shows up for every single tab; + //this makes it possible to have a dropdown box inside a tabs box, which shows up for every tab. + } elseif (isset($attr['name']) array_search($attr['name'], $names) !== false) { $index = array_search($attr['name'], $names)+1; // if index is not defined, but the name is, use the index of the tabname. - else { + } else { $index = count($names)+1; // index of this tab in this scope. Plus one because tabs are 1-based, arrays are 0-based. } $classPrefix = ''; - if ($nested) // Note: This is defined seperately for toggleboxes, because of the different classes required. + if ($nested) {// Note: This is defined seperately for toggleboxes, because of the different classes required. $classPrefix .= tabs-content tabs-content-$index; - - if (!isset($attr['class'])) - $attr['class'] = $classPrefix; // only the prefix if no classes have been defined - else - $attr['class'] = trim($classPrefix .htmlspecialchars($attr['class'])); - - if (isset($names[$index-1])) {// if array $names already has a name defined at position $index, use that. - $name = $names[$index-1]; // minus 1 because tabs are 1-based, arrays 0-based. - } else {// otherwise, use the entered name, or the $index with a Tab prefix if it is not defined or empty. - $name = trim(isset($attr['name']) $attr['name'] ? $attr['name'] : wfMessage('tabs-tab-label', $index)); } - + if (isset($attr['class'])) { + $attr['class'] = trim($classPrefix .htmlspecialchars($attr['class'])); + } else { + $attr['class'] = $classPrefix; // only the prefix if no classes have been defined + } + if ($index !== 0) { + if (isset($names[$index-1])) { // if array $names already has a name defined at position $index, use that. + $name = $names[$index-1]; // minus 1 because tabs are 1-based, arrays 0-based. + } else { // otherwise, use the entered name, or the $index with a Tab prefix if it is not defined or empty. + $name = trim(isset($attr['name']) $attr['name'] ? $attr['name'] : wfMessage('tabs-tab-label', $index)); + } + } if (!$nested) { // This runs when the tab is not nested inside a tabs tag. $container = $this-renderBox($input, $attr, $parser); } else { // this runs when the tab is nested inside a tabs tag. - if (array_search($name, $names) === false) // append name if it's not already in the list. + if ($index !== 0 array_search($name, $names) === false) {// append name if it's not already in the list.
[MediaWiki-commits] [Gerrit] LabsDB-Auditor - labs - change (labs...wikibugs2)
jenkins-bot has submitted this change and it was merged. Change subject: LabsDB-Auditor - labs .. LabsDB-Auditor - labs Change-Id: I0557a87cdff67211d9eb723708e6a8f57054af41 --- M channels.yaml 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Yuvipanda: Looks good to me, approved jenkins-bot: Verified diff --git a/channels.yaml b/channels.yaml index 6557aae..213c86f 100644 --- a/channels.yaml +++ b/channels.yaml @@ -50,6 +50,7 @@ - Quarry - Wikibugs - Gerrit-Patch-Uploader +- LabsDB-Auditor #wikimedia-mobile: # x.get(X-Bugzilla-Product, None) in [Wikimedia Mobile, Commons App, Wikipedia App, MobileFrontend], -- To view, visit https://gerrit.wikimedia.org/r/184134 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0557a87cdff67211d9eb723708e6a8f57054af41 Gerrit-PatchSet: 2 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] ApiEditPage: Fix Wikipedia-specific wording - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: ApiEditPage: Fix Wikipedia-specific wording .. ApiEditPage: Fix Wikipedia-specific wording Article is specific to Wikipedia. Change to page for universality. Change-Id: I4a10583d463c90df437ffd0e60e6f100674e49b2 --- M includes/api/i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Umherirrender: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json index 0eed4cd..cba687b 100644 --- a/includes/api/i18n/en.json +++ b/includes/api/i18n/en.json @@ -83,7 +83,7 @@ apihelp-edit-param-bot: Mark this edit as bot., apihelp-edit-param-basetimestamp: Timestamp of the base revision, used to detect edit conflicts. May be obtained through [[Special:ApiHelp/query+revisions|action=queryprop=revisionsrvprop=timestamp]]., apihelp-edit-param-starttimestamp: Timestamp when you began the editing process, used to detect edit conflicts. An appropriate value may be obtained using [[Special:ApiHelp/main|curtimestamp]] when beginning the edit process (e.g. when loading the page content to edit)., - apihelp-edit-param-recreate: Override any errors about the article having been deleted in the meantime., + apihelp-edit-param-recreate: Override any errors about the page having been deleted in the meantime., apihelp-edit-param-createonly: Don't edit the page if it exists already., apihelp-edit-param-nocreate: Throw an error if the page doesn't exist., apihelp-edit-param-watch: Add the page to your watchlist., -- To view, visit https://gerrit.wikimedia.org/r/184114 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a10583d463c90df437ffd0e60e6f100674e49b2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gifti gi...@tools.wmflabs.org Gerrit-Reviewer: Anomie bjor...@wikimedia.org Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: Umherirrender umherirrender_de...@web.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Changing logo for klwiki from $stdlogo to commons - change (operations/mediawiki-config)
Steinsplitter has uploaded a new change for review. https://gerrit.wikimedia.org/r/184121 Change subject: Changing logo for klwiki from $stdlogo to commons .. Changing logo for klwiki from $stdlogo to commons Bug: T86313 Change-Id: Ifa3de1243768af08b857e514a75fdcfbd491d317 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/21/184121/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4712642..fe8d3d0 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -549,7 +549,7 @@ 'kbdwiki' = '//upload.wikimedia.org/wikipedia/commons/b/b0/Wikipedia-logo-v2-kbd.png', 'kiwiki' = '//upload.wikimedia.org/wikipedia/commons/1/1a/Wikipedia-logo-v2-ki.png', // bug 48397 'kkwiki' = '$stdlogo', - 'klwiki' = '$stdlogo', + 'klwiki' = '//upload.wikimedia.org/wikipedia/commons/c/c9/Wikipedia-logo-kl.png', // bug T86313 'kmwiki' = '$stdlogo', 'knwiki' = '//upload.wikimedia.org/wikipedia/commons/b/bf/Wikipedia-logo-v2-kn.png', // bug 46589, bug 27657 'kowiki' = '$stdlogo', -- To view, visit https://gerrit.wikimedia.org/r/184121 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa3de1243768af08b857e514a75fdcfbd491d317 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Steinsplitter steinsplit...@wikipedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Log sent messages to checkuser - change (mediawiki...MediaWikiChat)
UltrasonicNXT has uploaded a new change for review. https://gerrit.wikimedia.org/r/184132 Change subject: Log sent messages to checkuser .. Log sent messages to checkuser As requested by Krusher Change-Id: I2e4c4c9c9942dcd7dba704c10d690056b3b2fb34 --- M MediaWikiChat.php M api/Send.api.php 2 files changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MediaWikiChat refs/changes/32/184132/1 diff --git a/MediaWikiChat.php b/MediaWikiChat.php index d095129..0f83571 100644 --- a/MediaWikiChat.php +++ b/MediaWikiChat.php @@ -16,7 +16,7 @@ $wgExtensionCredits['specialpage'][] = array( 'path' = __FILE__, 'name' = 'MediaWikiChat', - 'version' = '2.12.9', + 'version' = '2.12.10', 'author' = 'Adam Carter/UltrasonicNXT', 'url' = 'https://www.mediawiki.org/wiki/Extension:MediaWikiChat', 'descriptionmsg' = 'chat-desc', diff --git a/api/Send.api.php b/api/Send.api.php index d2e33e4..d3f56a3 100644 --- a/api/Send.api.php +++ b/api/Send.api.php @@ -54,7 +54,13 @@ '4::message' = $originalMessage, // we want the logs to show the source message, not the parsed one ) ); - $logEntry-insert(); + $logID = $logEntry-insert(); + + if ( class_exists( 'CheckUserHooks' ) ) { + $rc = $logEntry-getRecentChange( $logID ); + + CheckUserHooks::updateCheckUserData( $rc ); + } MediaWikiChat::deleteEntryIfNeeded(); MediaWikiChat::updateAway( $user ); -- To view, visit https://gerrit.wikimedia.org/r/184132 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e4c4c9c9942dcd7dba704c10d690056b3b2fb34 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MediaWikiChat Gerrit-Branch: master Gerrit-Owner: UltrasonicNXT adamr_car...@btinternet.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Rename some date model keys to be clearer - change (operations...labsdb-auditor)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/184131 Change subject: Rename some date model keys to be clearer .. Rename some date model keys to be clearer - Remove 'replacewith', since we will replace everything with only SQL 'NULL' - 'condition' in the columns becomes 'null_if' since replacewith is no longer a thing, and 'null_if' makes it clearer that we are nulling columns if this is true, rather than false. - 'where' in the table defintion becomes 'include_only_if', which makes it extremely clear what exactly it does. Change-Id: I892f0ba4e6fa2db25696f1b7922f1e7c44630466 --- M auditor/models.py M auditor/reports/viewdiffs.py M greylisted.yaml 3 files changed, 95 insertions(+), 101 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/labsdb-auditor refs/changes/31/184131/1 diff --git a/auditor/models.py b/auditor/models.py index 83d9b53..04829ec 100644 --- a/auditor/models.py +++ b/auditor/models.py @@ -24,7 +24,7 @@ A column that is potentially conditionally or unconditionally nulled -def __init__(self, name, whitelisted=True, condition=None, replacewith=None): +def __init__(self, name, whitelisted=True, null_if=None): A column in a table that can be whitelisted or conditionally nulled @@ -32,16 +32,15 @@ :param name: Name of this column :param whitelisted: True if the column is whitelisted -:param condition: Conditions under which this column is replaced. - Specified as a string that is valid SQL expression -:param replacewith: What to replace the column's value with if condition is matched -If set to None with whitelisted = False, implies SQL None +:param null_if: Conditions under which this column is nulled. +Specified as a string that is valid SQL expression. +If set to None whitelisted=False, then nulled all the time + :return: self.name = name self.whitelisted = whitelisted -self.condition = condition -self.replacewith = replacewith +self.null_if = null_if class Table(object): @@ -70,10 +69,8 @@ for c in self.columns.values(): columndict = {} columndict['whitelisted'] = c.whitelisted -if c.condition: -columndict['condition'] = c.condition -if c.replacewith: -columndict['replacewith'] = c.replacewith +if c.null_if: +columndict['null_if'] = c.null_if tabledict['columns'][c.name] = columndict if self.table_name != self.name: tabledict['table_name'] = self.table_name @@ -89,10 +86,7 @@ else: # Greylisted table! for colname, coldata in tabledata['columns'].items(): -col = Column(colname, - whitelisted=coldata.get('whitelisted'), - condition=coldata.get('condition'), - replacewith=coldata.get('replacewith')) +col = Column(colname, coldata.get('whitelisted'), coldata.get('null_if')) table.add_column(col) return table diff --git a/auditor/reports/viewdiffs.py b/auditor/reports/viewdiffs.py index 7e9a54b..b9fa163 100644 --- a/auditor/reports/viewdiffs.py +++ b/auditor/reports/viewdiffs.py @@ -33,7 +33,7 @@ def diff_columns(expected, actual): -return _diff(expected, actual, ('name', 'whitelisted', 'condition', 'replacewith')) +return _diff(expected, actual, ('name', 'whitelisted', 'null_if')) def diff_tables(expected, actual): @@ -88,7 +88,7 @@ # Where cond is a valid SQL relational expression, column-name, wikiname, tablename are strings identifier = alphanums + _ -if_definition = if( + SkipTo(,)(condition) + , + Word(identifier) + , + Word(identifier) + ) +if_definition = if( + SkipTo(,)(null_if) + , + Word(identifier) + , + Word(identifier) + ) column_definition = (if_definition ^ Word(identifier)('expression')) + AS + Word(identifier)(name) + Optional(,) sql_definition = select + OneOrMore(column_definition)(columns) + \ from + Word(identifier) + . + Word(identifier)(tablename) + \ @@ -103,8 +103,8 @@ table = Table(viewname, {}, res.where if res.where else None, res.tablename) for tokens, start, end in column_definition.scanString(sql): table.add_column(Column(tokens.name, -whitelisted=tokens.condition == '' and tokens.expression != 'NULL', -condition=tokens.condition if tokens.condition else None)) +whitelisted=tokens.null_if == '' and tokens.expression != 'NULL', +
[MediaWiki-commits] [Gerrit] Log sent messages to checkuser - change (mediawiki...MediaWikiChat)
UltrasonicNXT has submitted this change and it was merged. Change subject: Log sent messages to checkuser .. Log sent messages to checkuser As requested by Krusher Change-Id: I2e4c4c9c9942dcd7dba704c10d690056b3b2fb34 --- M MediaWikiChat.php M api/Send.api.php 2 files changed, 8 insertions(+), 2 deletions(-) Approvals: UltrasonicNXT: Verified; Looks good to me, approved diff --git a/MediaWikiChat.php b/MediaWikiChat.php index d095129..0f83571 100644 --- a/MediaWikiChat.php +++ b/MediaWikiChat.php @@ -16,7 +16,7 @@ $wgExtensionCredits['specialpage'][] = array( 'path' = __FILE__, 'name' = 'MediaWikiChat', - 'version' = '2.12.9', + 'version' = '2.12.10', 'author' = 'Adam Carter/UltrasonicNXT', 'url' = 'https://www.mediawiki.org/wiki/Extension:MediaWikiChat', 'descriptionmsg' = 'chat-desc', diff --git a/api/Send.api.php b/api/Send.api.php index d2e33e4..d3f56a3 100644 --- a/api/Send.api.php +++ b/api/Send.api.php @@ -54,7 +54,13 @@ '4::message' = $originalMessage, // we want the logs to show the source message, not the parsed one ) ); - $logEntry-insert(); + $logID = $logEntry-insert(); + + if ( class_exists( 'CheckUserHooks' ) ) { + $rc = $logEntry-getRecentChange( $logID ); + + CheckUserHooks::updateCheckUserData( $rc ); + } MediaWikiChat::deleteEntryIfNeeded(); MediaWikiChat::updateAway( $user ); -- To view, visit https://gerrit.wikimedia.org/r/184132 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e4c4c9c9942dcd7dba704c10d690056b3b2fb34 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MediaWikiChat Gerrit-Branch: master Gerrit-Owner: UltrasonicNXT adamr_car...@btinternet.com Gerrit-Reviewer: UltrasonicNXT adamr_car...@btinternet.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Porting patrol.py to core. - change (pywikibot/core)
Prianka has uploaded a new change for review. https://gerrit.wikimedia.org/r/184118 Change subject: Porting patrol.py to core. .. Porting patrol.py to core. Made minor necessary changes to make it compatible with core (like using pywikibot etc.).Added returndict parameter in site.recentchanges to make the script run.Made changes in patrol.api_feed_repeater. Bug:T74206 Change-Id: I8612ce905d149d0e440d819f62f923385a583920 --- M pywikibot/site.py A scripts/patrol.py 2 files changed, 475 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/18/184118/1 diff --git a/pywikibot/site.py b/pywikibot/site.py index c1fd08a..0955e58 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -3608,7 +3608,8 @@ namespaces=None, pagelist=None, changetype=None, showMinor=None, showBot=None, showAnon=None, showRedirects=None, showPatrolled=None, topOnly=False, - step=None, total=None, user=None, excludeuser=None): + step=None, total=None, user=None, excludeuser=None, + returndict=False): Iterate recent changes. @param start: Timestamp to start listing from diff --git a/scripts/patrol.py b/scripts/patrol.py new file mode 100644 index 000..ca687fa --- /dev/null +++ b/scripts/patrol.py @@ -0,0 +1,473 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +The bot is meant to mark the edits based on info obtained by whitelist. + +This bot obtains a list of recent changes and newpages and marks the +edits as patrolled based on a whitelist. +See http://en.wikisource.org/wiki/User:JVbot/patrol_whitelist + +The following parameters are supported: + +params; + + +# +# (C) Pywikipedia bot team, 2011-2013 +# +# Distributed under the terms of the MIT license. +# +__version__ = '$Id$' +import pywikibot +from pywikibot import pagegenerators +import mwlib.uparser # used to parse the whitelist +import mwlib.parser # used to parse the whitelist +import time + +_logger = patrol + +# This is required for the text that is shown when you run this script +# with the parameter -help. +docuReplacements = { +'params;': pagegenerators.parameterHelp +} + + +class PatrolBot: +# Localised name of the whitelist page +whitelist_subpage_name = { +'en': u'patrol_whitelist', +} + +def __init__(self, feed, user=None, ask=True, whitelist=None): + +Constructor. Parameters: +* feed - The changes feed to work on (Newpages or Recentchanges) +* user - Limit whitelist parsing and patrolling to a specific user +* ask - If True, confirm each patrol action +* whitelist - page title for whitelist (optional) + + +self.feed = feed +self.user = user +self.ask = ask +self.site = pywikibot.Site() +if whitelist: +self.whitelist_pagename = whitelist +else: +local_whitelist_subpage_name = pywikibot.translate( +self.site, self.whitelist_subpage_name) +self.whitelist_pagename = u'%s:%s/%s' \ + % (self.site.namespace(2), + self.site.username(), + local_whitelist_subpage_name) +self.whitelist = None +self.whitelist_ts = 0 +self.whitelist_load_ts = 0 + +self.autopatroluserns = False +self.highest_rcid = 0 # used to track loops +self.last_rcid = 0 +self.repeat_start_ts = 0 + +self.rc_item_counter = 0 # counts how many items have been reviewed +self.patrol_counter = 0 # and how many times an action was taken + +def load_whitelist(self): +# Check for a more recent version after 5 minutes +if self.whitelist_load_ts and ( +(time.time() - self.whitelist_load_ts) 300): +pywikibot.output(u'Whitelist not stale yet') +return + +whitelist_page = pywikibot.Page(pywikibot.Site(), +self.whitelist_pagename) + +if not self.whitelist: +pywikibot.output(u'Loading %s' % self.whitelist_pagename) + +try: +if self.whitelist_ts: +# check for a more recent version +h = whitelist_page.getVersionHistory(forceReload=True, + revCount=1) +last_edit_ts = pywikibot.parsetime2stamp(h[0][1]) +if last_edit_ts == self.whitelist_ts: +# As there hasn't been any changed to the whitelist +# it has been effectively reloaded 'now' +self.whitelist_load_ts = time.time() +pywikibot.output(u'Whitelist not modified') +
[MediaWiki-commits] [Gerrit] L10N test for valid templates - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: L10N test for valid templates .. L10N test for valid templates - test for redirect-broken-redirect-template - test for archivebot-archiveheader New parameter fallback for i18n.twtranslate() to disable language code fallback for test purposes and L10N. New method i18n.twget_keys to retrieve all language codes of a package. Add l10n_tests to flake8-docstrings-mandatory Change-Id: I891a4862e16d2d51eec0cca03367e74feedf4d2b --- M pywikibot/i18n.py A tests/l10n_tests.py M tox.ini 3 files changed, 107 insertions(+), 12 deletions(-) Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/i18n.py b/pywikibot/i18n.py index 50cf790..ac10b82 100644 --- a/pywikibot/i18n.py +++ b/pywikibot/i18n.py @@ -347,16 +347,21 @@ return trans -def twtranslate(code, twtitle, parameters=None): +def twtranslate(code, twtitle, parameters=None, fallback=True): Translate a message. The translations are retrieved from i18n.package, based on the callers import table. +fallback parameter must be True for i18n and False for L10N or testing +purposes. + @param code: The language code @param twtitle: The TranslateWiki string title, in package-key format @param parameters: For passing parameters. +@param fallback: Try an alternate language code +@type fallback: boolean package = twtitle.split(-)[0] transdict = getattr(__import__(messages_package_name, fromlist=[package]), @@ -382,17 +387,19 @@ trans = transdict[lang][twtitle] except KeyError: # try alternative languages and English -for alt in _altlang(lang) + ['en']: -try: -trans = transdict[alt][twtitle] -if code_needed: -lang = alt -break -except KeyError: -continue -if trans is None: -raise TranslationError(No English translation has been defined - for TranslateWiki key %r % twtitle) +if fallback: +for alt in _altlang(lang) + ['en']: +try: +trans = transdict[alt][twtitle] +if code_needed: +lang = alt +break +except KeyError: +continue +if trans is None: +raise TranslationError( +No English translation has been defined +for TranslateWiki key %r % twtitle) # send the language code back via the given list if code_needed: code.append(lang) @@ -499,6 +506,18 @@ return code in transdict and twtitle in transdict[code] +def twget_keys(twtitle): + +Return all language codes for a special message. + +@param twtitle: The TranslateWiki string title, in package-key format + +package = twtitle.split(-)[0] +transdict = getattr(__import__(messages_package_name, fromlist=[package]), +package).msg +return (lang for lang in sorted(transdict.keys()) if lang != 'qqq') + + def input(twtitle, parameters=None, password=False): Ask the user a question, return the user's answer. diff --git a/tests/l10n_tests.py b/tests/l10n_tests.py new file mode 100644 index 000..e6bd7bc --- /dev/null +++ b/tests/l10n_tests.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +Test valid templates. +# +# (C) Pywikibot team, 2015 +# +# Distributed under the terms of the MIT license. +# +__version__ = '$Id$' + +import re +from tests.aspects import unittest, MetaTestCaseClass, TestCase +import pywikibot +from pywikibot import i18n + + +PACKAGES = ( +'redirect-broken-redirect-template', # speedy deletion template +'archivebot-archiveheader', # archive header template +) + + +class TestValidTemplateMeta(MetaTestCaseClass): + +Test meta class. + +def __new__(cls, name, bases, dct): +Create the new class. +# this comment is to avoid senseless flake8 warning + +def test_method(msg, code): + +def test_template(self): +Test validity of template. +if msg: +# check whether the message contains a template +template = re.findall(u'.*?{{(.*?)[|}]', msg) +self.assertTrue(template) + +if template: +# check whether site is valid +site = pywikibot.Site('en', 'wikipedia') +self.assertTrue(code in site.languages()) + +# check whether template exists +title = template[0] +site = pywikibot.Site(code, 'wikipedia') +page = pywikibot.Page(site, title,
[MediaWiki-commits] [Gerrit] LabsDB-Auditor - labs - change (labs...wikibugs2)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/184134 Change subject: LabsDB-Auditor - labs .. LabsDB-Auditor - labs Change-Id: I0557a87cdff67211d9eb723708e6a8f57054af41 --- M channels.yaml 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 refs/changes/34/184134/1 diff --git a/channels.yaml b/channels.yaml index 7bc304b..be429cf 100644 --- a/channels.yaml +++ b/channels.yaml @@ -50,6 +50,7 @@ - Quarry - Wikibugs - Gerrit-Patch-Uploader +- LabsDB-Auditor #wikimedia-mobile: # x.get(X-Bugzilla-Product, None) in [Wikimedia Mobile, Commons App, Wikipedia App, MobileFrontend], -- To view, visit https://gerrit.wikimedia.org/r/184134 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0557a87cdff67211d9eb723708e6a8f57054af41 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove no longer needed hook handlers from Bug54847 - change (operations/mediawiki-config)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/184136 Change subject: Remove no longer needed hook handlers from Bug54847 .. Remove no longer needed hook handlers from Bug54847 There are no more active session by users that are affected by this bug, so no need to check on existing sessions. Change-Id: I0eeca1b4f7f7a620944c0b69f2219a7a3c16b291 --- M wmf-config/Bug54847.php 1 file changed, 0 insertions(+), 55 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/36/184136/1 diff --git a/wmf-config/Bug54847.php b/wmf-config/Bug54847.php index 4d3aea3..ea17e10 100644 --- a/wmf-config/Bug54847.php +++ b/wmf-config/Bug54847.php @@ -74,61 +74,6 @@ } -// Abort existing open sessions for affected users. (But not -// repeatedly, only once.) -// Maybe we dont do this and just reset everyone's tokens instead? - -$wgHooks['UserLoadAfterLoadFromSession'][] = function ( $user ) { - if ( efUserIsAffected( $user ) ) { - $dbw = CentralAuthUser::getCentralDB(); - $dbw-update( - 'bug_54847_password_resets', - array( 'r_logged_out' = 1 ), - array( 'r_username' = $user-getName(), - 'r_wiki' = wfWikiID() - ), - __METHOD__ - ); - $user-logout(); - } -}; - - -$wgHooks['UserLoadFromSession'][] = function ( $user, $result ) { - - $loggedout = false; - $isGlobal = false; - if ( efUserIsAffected( $user, $loggedout, $isGlobal ) ) { - if ( $loggedout ) { - // Already logged them out - return true; - } - - wfDebugLog( Bug54847, Logging out user . $user-getName() ); - - $dbw = CentralAuthUser::getCentralDB(); - - $updateWikis = wfWikiID(); - if ( $isGlobal ) { - $centralUser = CentralAuthUser::getInstance( $user ); - $updateWikis = $centralUser-listAttached(); - } - $dbw-update( - 'bug_54847_password_resets', - array( 'r_logged_out' = 1 ), - array( 'r_username' = $user-getName(), - 'r_wiki' = $updateWikis - ), - __METHOD__ - ); - - $user-logout(); - $result = false; - return false; - } - return true; -}; - $wgHooks[ 'AbortLogin' ][] = function ( User $user, $password, $retval, $msg ) { global $wgOut, $egBug54847; if ( empty( $egBug54847 ) $user-checkPassword( $password ) efUserIsAffected( $user ) ) { -- To view, visit https://gerrit.wikimedia.org/r/184136 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0eeca1b4f7f7a620944c0b69f2219a7a3c16b291 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Hoo man h...@online.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add report that verifies view definitions - change (operations...labsdb-auditor)
Merlijn van Deen has submitted this change and it was merged. Change subject: Add report that verifies view definitions .. Add report that verifies view definitions - Diff the Table and Column objects from greylisted/whitelisted files vs reality and report on things that are missing - Use a combination of regex (to clean up) and pyparsing to parse the SQL used to define a view and convert that into Table and Column objects - Fix greylisted.yaml to match reality - mostly human errors that were made when transcribing from the perl file - Fully paranthesize all SQL expressions in greylisted.yaml since that is how MySQL seems to give them back when asking for view definitions - Add diff_iters and common_iters helpers to do set operations on lists. We want to keep them as lists since if we output them as sets to YAML then YAML doesn't output them cleanly and adds a python set decorator Bug: T85473 Change-Id: I2e8896fd55a75fa7f6ae1a63bdbb6c04e47bff5c --- M auditor/audit.py M auditor/models.py M auditor/reports/databases.py M auditor/reports/tables.py A auditor/reports/viewdiffs.py R auditor/utils.py M greylisted.yaml M requirements.txt 8 files changed, 257 insertions(+), 99 deletions(-) Approvals: Merlijn van Deen: Verified; Looks good to me, approved diff --git a/auditor/audit.py b/auditor/audit.py index 958dda5..c3d6a6b 100644 --- a/auditor/audit.py +++ b/auditor/audit.py @@ -33,6 +33,7 @@ from reports.databases import databases_report from reports.tables import extra_tables_report +from reports.viewdiffs import views_schema_diff_report argparser = argparse.ArgumentParser() @@ -57,6 +58,7 @@ rr.register_report(databases_report) rr.register_report(extra_tables_report) +rr.register_report(views_schema_diff_report) logging.info('Starting report generation') reports = rr.run() diff --git a/auditor/models.py b/auditor/models.py index 38d37b4..af4131c 100644 --- a/auditor/models.py +++ b/auditor/models.py @@ -17,6 +17,8 @@ import yaml import os +from utils import diff_iters + class Column(object): @@ -87,7 +89,11 @@ else: # Greylisted table! for colname, coldata in tabledata['columns'].items(): -table.add_column(Column(colname, coldata.get('whitelisted'), coldata.get('condition'), coldata.get('replacewith'))) +col = Column(colname, + whitelisted=coldata.get('whitelisted'), + condition=coldata.get('condition'), + replacewith=coldata.get('replacewith')) +table.add_column(col) return table @@ -127,6 +133,6 @@ with open(all_dblist_path) as all_file, open(private_dblist_path) as priv_file: all_dbs = [l.strip() for l in all_file.readlines()] priv_dbs = [l.strip() for l in priv_file.readlines()] -dbs = list(set(all_dbs) - (set(priv_dbs))) +dbs, _ = diff_iters(all_dbs, priv_dbs) return cls(dbs, tables) diff --git a/auditor/reports/databases.py b/auditor/reports/databases.py index c2ee418..4e64f4a 100644 --- a/auditor/reports/databases.py +++ b/auditor/reports/databases.py @@ -13,7 +13,7 @@ # limitations under the License. import re -from ..dbutils import get_databases +from ..utils import get_databases def databases_report(config, model, conn): diff --git a/auditor/reports/tables.py b/auditor/reports/tables.py index e4309d6..ab35bce 100644 --- a/auditor/reports/tables.py +++ b/auditor/reports/tables.py @@ -14,7 +14,7 @@ import logging import MySQLdb -from ..dbutils import get_tables +from ..utils import get_tables, diff_iters def _get_extra_tables(model, conn, dbs): @@ -22,7 +22,7 @@ for db in dbs: logging.debug('Finding extra tables on %s', db) try: -diff = set(get_tables(conn, db)) - set(model.tables.keys()) +extra_tables, _ = diff_iters(get_tables(conn, db), model.tables) except MySQLdb.OperationalError as e: # Ignore missing database errors (cod 1049). # Not using MySQLdb.constants.ER because it is stupid and needs to be explicitly imported to use. @@ -31,8 +31,8 @@ continue # We have other reports taking care of unknown dbs else: raise -if diff: -for tablename in diff: +if extra_tables: +for tablename in extra_tables: if tablename in extra_tables: extra_tables[tablename].append(db) else: diff --git a/auditor/reports/viewdiffs.py b/auditor/reports/viewdiffs.py new file mode 100644 index 000..e9e91d0 --- /dev/null +++ b/auditor/reports/viewdiffs.py @@ -0,0 +1,136 @@ +# Copyright 2015 Yuvi Panda yuvipa...@gmail.com +# +# Licensed under the Apache License, Version 2.0 (the License); +# you may not use this
[MediaWiki-commits] [Gerrit] Fix jslint errors. - change (mediawiki...Tabs)
Joeytje50 has uploaded a new change for review. https://gerrit.wikimedia.org/r/184138 Change subject: Fix jslint errors. .. Fix jslint errors. On the previous commit, jslint didn't mention these errors until jenkins-bot decided to merge it, so this will have to be a seperate commit. See https://integration.wikimedia.org/ci/job/mwext-Tabs-jslint/3/console Change-Id: Ic437dfdb79fea6f983531914951b875929723385 --- M ext.tabs.js 1 file changed, 35 insertions(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Tabs refs/changes/38/184138/1 diff --git a/ext.tabs.js b/ext.tabs.js index 5ed0c87..3e71a30 100644 --- a/ext.tabs.js +++ b/ext.tabs.js @@ -1,7 +1,29 @@ -$(function() { +jQuery(function($) { + /** +* Imitates the normal feature in browsers to scroll to an id that has the same id as the url fragment/hash. +* This makes it unnecessary to use actual ids on the tabs, which could cause the same id to occur twice in the same document. +* Does not scroll to exactly the tab's height, but just a bit above it. +*/ + function moveToHash() { + var hash = location.hash.substr(1).replace(/_/g,' ').trim(); + if (!hash || $(location.hash).length) { + return; // if there's no hash defined, or an element on the page with the same hash already, stop looking for tabs + } + $('.tabs-tabbox .tabs-label:contains('+hash+')').each(function() { + // double-check if the hash is indeed exactly the same as the label. + // Does not match if hash is only a part of the label's contents, unlike jQuery's :contains() selector + if (this.innerHTML.trim() !== hash) { + return true; // continue the $.each() function + } + this.click(); // open the selected tab by default. + document.documentElement.scrollTop = this.offsetTop; + return false; // stop the $.each() function after the first match. + }); + } + // Credit for this testing method: 2astalavista @ http://stackoverflow.com/a/21095568/1256925 // The font will be sans-serif if the :not() property is supported. The margin will be 1px if the sibling selector is supported. - if ($('#tabs-inputform').css('font-family').replace(/[']/g,'') == 'sans-serif' $('#tabs-inputform').css('margin') == '1px') { + if ($('#tabs-inputform').css('font-family').replace(/[']/g,'') === 'sans-serif' $('#tabs-inputform').css('margin') === '1px') { $(function() { $('body').addClass('tabs-oldbrowserscript'); // Make the unselected tabs hide when the browser loads this script $('.tabs-label').click(function(e) { @@ -9,9 +31,13 @@ return false; }); $('.tabs-input').each(function() { - if (this.checked) $(this).addClass('checked'); // Adds checked class to each checked box + if (this.checked) { + $(this).addClass('checked'); // Adds checked class to each checked box + } }).change(function() { - if (!this.checked) return $(this).removeClass('checked'); // for toggleboxes + if (!this.checked) { + return $(this).removeClass('checked'); // for toggleboxes + } $(this).siblings('.checked').removeClass('checked'); // Uncheck all currently checked siblings $(this).addClass('checked'); // and do check this box $(this).parents('.tabs').toggleClass('tabs').toggleClass('tabs'); // remove and readd class to recalculate styles for its children. @@ -22,23 +48,6 @@ } else { $(moveToHash); } - /** -* Imitates the normal feature in browsers to scroll to an id that has the same id as the url fragment/hash. -* This makes it unnecessary to use actual ids on the tabs, which could cause the same id to occur twice in the same document. -* Does not scroll to exactly the tab's height, but just a bit above it. -*/ - function moveToHash() { - var hash = location.hash.substr(1).replace(/_/g,' ').trim(); - if (!hash || $(location.hash).length) return; // if there's no hash defined, or an element on the page with the same hash already, stop looking for tabs - $('.tabs-tabbox .tabs-label:contains('+hash+')').each(function() { -
[MediaWiki-commits] [Gerrit] Remove unused message 'rollback_short' - change (mediawiki/core)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/184145 Change subject: Remove unused message 'rollback_short' .. Remove unused message 'rollback_short' Last seen in ca38c84 (r7511, from 2005). Change-Id: Ida0b52e05e1ca66595a6f8352c14d825655dabc3 --- M languages/i18n/en.json 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/45/184145/1 diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 2046929..3c86243 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1887,7 +1887,6 @@ deleteprotected: You cannot delete this page because it has been protected., deleting-backlinks-warning: '''Warning:''' [[Special:WhatLinksHere/{{FULLPAGENAME}}|Other pages]] link to or transclude the page you are about to delete., rollback: Roll back edits, - rollback_short: Rollback, rollbacklink: rollback, rollbacklinkcount: rollback $1 {{PLURAL:$1|edit|edits}}, rollbacklinkcount-morethan: rollback more than $1 {{PLURAL:$1|edit|edits}}, -- To view, visit https://gerrit.wikimedia.org/r/184145 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida0b52e05e1ca66595a6f8352c14d825655dabc3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński matma@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Set wgArticlePath in test environment - change (mediawiki...Translate)
jenkins-bot has submitted this change and it was merged. Change subject: Set wgArticlePath in test environment .. Set wgArticlePath in test environment This allows to run tests on different installation paths. Change-Id: I0607dbbad843d9e68eeae8c926d076d283633b4f --- M tests/qunit/ext.translate.parsers.test.js 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/qunit/ext.translate.parsers.test.js b/tests/qunit/ext.translate.parsers.test.js index 1d76ef2..96d0077 100644 --- a/tests/qunit/ext.translate.parsers.test.js +++ b/tests/qunit/ext.translate.parsers.test.js @@ -11,6 +11,8 @@ QUnit.module( 'ext.translate.parsers', QUnit.newMwEnvironment() ); QUnit.test( '-- External links', 3, function ( assert ) { + mw.config.set( 'wgArticlePath', '/wiki/$1' ); + assert.strictEqual( 'This page is [in English]', mw.translate.formatMessageGently( 'This page is [in English]' ), -- To view, visit https://gerrit.wikimedia.org/r/180219 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0607dbbad843d9e68eeae8c926d076d283633b4f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Fomafix Gerrit-Reviewer: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] commoncat.py: align with LogEntry structure in core - change (pywikibot/core)
Mpaa has uploaded a new change for review. https://gerrit.wikimedia.org/r/184155 Change subject: commoncat.py: align with LogEntry structure in core .. commoncat.py: align with LogEntry structure in core When porting from compat to core, the compat structure was not changed. A tuple was expected instead of a LogEntry object. Bug: T86433 Change-Id: If7d166f81076da7394f2acd243fcf13d0e68df8e --- M scripts/commonscat.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/55/184155/1 diff --git a/scripts/commonscat.py b/scripts/commonscat.py index 13031a5..e0f4dc4 100755 --- a/scripts/commonscat.py +++ b/scripts/commonscat.py @@ -473,8 +473,8 @@ pywikibot.output(u'Commons category does not exist. Examining deletion log...') logpages = commonsSite.logevents(logtype='delete', page=commonsPage) for logitem in logpages: -logitem = next(logpages) -(logpage, loguser, logtimestamp, logcomment) = logitem +loguser = logitem.user() +logcomment = logitem.comment() # Some logic to extract the target page. regex = u'moved to \[\[\:?Category:(?Pnewcat1[^\|\}]+)(\|[^\}]+)?\]\]|Robot: Changing Category:(.+) to Category:(?Pnewcat2.+)' m = re.search(regex, logcomment, flags=re.I) -- To view, visit https://gerrit.wikimedia.org/r/184155 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7d166f81076da7394f2acd243fcf13d0e68df8e Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Mpaa mpaa.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Unify Special:UncategorizedPages/Categories/Templates - change (mediawiki/core)
Harmageddon has uploaded a new change for review. https://gerrit.wikimedia.org/r/184189 Change subject: Unify Special:UncategorizedPages/Categories/Templates .. Unify Special:UncategorizedPages/Categories/Templates Adds a namespace parameter to Special:UncategorizedPages and removes Special:UncategorizedCategories and Special:UncategorizedTemplates. Bug: T14942 Change-Id: Iee110509c3d2743aa198d348dd87f869ba31dc73 --- M autoload.php M includes/specialpage/QueryPage.php M includes/specialpage/SpecialPageFactory.php D includes/specials/SpecialUncategorizedcategories.php M includes/specials/SpecialUncategorizedpages.php D includes/specials/SpecialUncategorizedtemplates.php M maintenance/dictionary/mediawiki.dic 7 files changed, 33 insertions(+), 94 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/89/184189/1 diff --git a/autoload.php b/autoload.php index 674d4b0..e46cd88 100644 --- a/autoload.php +++ b/autoload.php @@ -1204,10 +1204,8 @@ 'UDPTransport' = __DIR__ . '/includes/libs/UDPTransport.php', 'UIDGenerator' = __DIR__ . '/includes/utils/UIDGenerator.php', 'UcdXmlReader' = __DIR__ . '/maintenance/language/generateCollationData.php', - 'UncategorizedCategoriesPage' = __DIR__ . '/includes/specials/SpecialUncategorizedcategories.php', 'UncategorizedImagesPage' = __DIR__ . '/includes/specials/SpecialUncategorizedimages.php', 'UncategorizedPagesPage' = __DIR__ . '/includes/specials/SpecialUncategorizedpages.php', - 'UncategorizedTemplatesPage' = __DIR__ . '/includes/specials/SpecialUncategorizedtemplates.php', 'Undelete' = __DIR__ . '/maintenance/undelete.php', 'UnifiedDiffFormatter' = __DIR__ . '/includes/diff/UnifiedDiffFormatter.php', 'UnlistedSpecialPage' = __DIR__ . '/includes/specialpage/UnlistedSpecialPage.php', diff --git a/includes/specialpage/QueryPage.php b/includes/specialpage/QueryPage.php index 1ff7e3f..41fc39a 100644 --- a/includes/specialpage/QueryPage.php +++ b/includes/specialpage/QueryPage.php @@ -86,10 +86,8 @@ array( 'MostrevisionsPage', 'Mostrevisions' ), array( 'FewestrevisionsPage', 'Fewestrevisions' ), array( 'ShortPagesPage', 'Shortpages' ), - array( 'UncategorizedCategoriesPage', 'Uncategorizedcategories' ), array( 'UncategorizedPagesPage', 'Uncategorizedpages' ), array( 'UncategorizedImagesPage', 'Uncategorizedimages' ), - array( 'UncategorizedTemplatesPage', 'Uncategorizedtemplates' ), array( 'UnusedCategoriesPage', 'Unusedcategories' ), array( 'UnusedimagesPage', 'Unusedimages' ), array( 'WantedCategoriesPage', 'Wantedcategories' ), diff --git a/includes/specialpage/SpecialPageFactory.php b/includes/specialpage/SpecialPageFactory.php index 175b0cb..b01be9b 100644 --- a/includes/specialpage/SpecialPageFactory.php +++ b/includes/specialpage/SpecialPageFactory.php @@ -60,10 +60,8 @@ 'Protectedpages' = 'SpecialProtectedpages', 'Protectedtitles' = 'SpecialProtectedtitles', 'Shortpages' = 'ShortPagesPage', - 'Uncategorizedcategories' = 'UncategorizedCategoriesPage', 'Uncategorizedimages' = 'UncategorizedImagesPage', 'Uncategorizedpages' = 'UncategorizedPagesPage', - 'Uncategorizedtemplates' = 'UncategorizedTemplatesPage', 'Unusedcategories' = 'UnusedCategoriesPage', 'Unusedimages' = 'UnusedimagesPage', 'Unusedtemplates' = 'UnusedtemplatesPage', diff --git a/includes/specials/SpecialUncategorizedcategories.php b/includes/specials/SpecialUncategorizedcategories.php deleted file mode 100644 index 1cc40a9..000 --- a/includes/specials/SpecialUncategorizedcategories.php +++ /dev/null @@ -1,47 +0,0 @@ -?php -/** - * Implements Special:Uncategorizedcategories - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * http://www.gnu.org/copyleft/gpl.html - *
[MediaWiki-commits] [Gerrit] Remove -qa from announce list (moved to -releng) - change (labs...wikibugs2)
Greg Grossmeier has uploaded a new change for review. https://gerrit.wikimedia.org/r/184195 Change subject: Remove -qa from announce list (moved to -releng) .. Remove -qa from announce list (moved to -releng) Change-Id: Ie97fe05c96389d55222be77416bb6c33f21b711c --- M channels.yaml 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 refs/changes/95/184195/1 diff --git a/channels.yaml b/channels.yaml index 213c86f..21c90dc 100644 --- a/channels.yaml +++ b/channels.yaml @@ -73,12 +73,6 @@ - Code-Review - Gitblit-Deprecate -#wikimedia-qa: -- Continuous-integration -- Quality-Assurance -- Beta-Cluster -- Release-Engineering - #wikimedia-releng: # teams - Release-Engineering -- To view, visit https://gerrit.wikimedia.org/r/184195 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie97fe05c96389d55222be77416bb6c33f21b711c Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Greg Grossmeier g...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make phabricator and phabricator.org always report to -dev - change (labs...wikibugs2)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/184196 Change subject: Make phabricator and phabricator.org always report to -dev .. Make phabricator and phabricator.org always report to -dev Change-Id: I3a3bdc1ace5b912b86b87318c5857b0b1356e311 --- M channels.yaml 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 refs/changes/96/184196/1 diff --git a/channels.yaml b/channels.yaml index 213c86f..d126df8 100644 --- a/channels.yaml +++ b/channels.yaml @@ -136,6 +136,8 @@ #wikimedia-dev: # x.get(X-Bugzilla-Product, None) == MediaWiki - MediaWiki(-.*)? +- Phabricator +- Phabricator.org #wikimedia-operations: - ops(-.*)? -- To view, visit https://gerrit.wikimedia.org/r/184196 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3a3bdc1ace5b912b86b87318c5857b0b1356e311 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Parameter type hints for Bug54847.php - change (operations/mediawiki-config)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/184141 Change subject: Parameter type hints for Bug54847.php .. Parameter type hints for Bug54847.php Remove unused variable too Change-Id: I89b652a7d05b44337c115097fbfe55aed0496d7c --- M wmf-config/Bug54847.php 1 file changed, 47 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/41/184141/1 diff --git a/wmf-config/Bug54847.php b/wmf-config/Bug54847.php index 6b056db..c2e0aae 100644 --- a/wmf-config/Bug54847.php +++ b/wmf-config/Bug54847.php @@ -1,5 +1,12 @@ ?php +/** + * @param User $user + * @param null $loggedout + * @param bool $isGlobal + * @return bool + * @throws CentralAuthReadOnlyError + */ function efUserIsAffected ( $user, $loggedout = null, $isGlobal = false ) { global $wgMemc; @@ -74,10 +81,14 @@ } -// Abort existing open sessions for affected users. (But not -// repeatedly, only once.) -// Maybe we dont do this and just reset everyone's tokens instead? - +/** + * Abort existing open sessions for affected users. (But not + * repeatedly, only once.) + * Maybe we dont do this and just reset everyone's tokens instead? + * + * @param User $user + * @throws CentralAuthReadOnlyError + */ $wgHooks['UserLoadAfterLoadFromSession'][] = function ( $user ) { if ( efUserIsAffected( $user ) ) { $dbw = CentralAuthUser::getCentralDB(); @@ -93,7 +104,12 @@ } }; - +/** + * @param User $user + * @param $result + * @return bool + * @throws CentralAuthReadOnlyError + */ $wgHooks['UserLoadFromSession'][] = function ( $user, $result ) { $loggedout = false; @@ -129,6 +145,14 @@ return true; }; +/** + * @param User $user + * @param $password + * @param $retval + * @param $msg + * @return bool + * @throws MWException + */ $wgHooks[ 'AbortLogin' ][] = function ( User $user, $password, $retval, $msg ) { global $wgOut, $egBug54847; if ( empty( $egBug54847 ) $user-checkPassword( $password ) efUserIsAffected( $user ) ) { @@ -140,11 +164,20 @@ } }; -// Reject attempts to set an existing password as the new password. +/** + * Reject attempts to set an existing password as the new password. + * + * @param User $user + * @param $password + * @param $newpassword + * @param $errorMsg + * @return bool + * @throws CentralAuthReadOnlyError + * @throws MWException + */ $wgHooks['AbortChangePassword'][] = function ( $user, $password, $newpassword, $errorMsg ) { global $egBug54847; - $passwordOK = false; $loggedout = false; $isGlobal = false; @@ -233,6 +266,13 @@ ); }; +/** + * @param User $user + * @param $pass + * @param $msg + * @return bool + * @throws CentralAuthReadOnlyError + */ $wgHooks['PrefsPasswordAudit'][] = function ( $user, $pass, $msg ) { global $egBug54847, $wgMemc; -- To view, visit https://gerrit.wikimedia.org/r/184141 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I89b652a7d05b44337c115097fbfe55aed0496d7c Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix refactoring snafu - change (operations...labsdb-auditor)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/184142 Change subject: Fix refactoring snafu .. Fix refactoring snafu Change-Id: I266e8d4ff24c1c538704f056cf9aefa7e34a0a0c --- M auditor/reports/tables.py 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/labsdb-auditor refs/changes/42/184142/1 diff --git a/auditor/reports/tables.py b/auditor/reports/tables.py index c5e73cd..4e65895 100644 --- a/auditor/reports/tables.py +++ b/auditor/reports/tables.py @@ -18,7 +18,7 @@ def _get_extra_tables(model, conn, dbs): -extra_tables = {} # K:V :: tablename::listdbname +extra_tables_dbs = {} # K:V :: tablename::listdbname for db in dbs: logging.debug('Finding extra tables on %s', db) try: @@ -33,11 +33,11 @@ raise if extra_tables: for tablename in extra_tables: -if tablename in extra_tables: -extra_tables[tablename].append(db) +if tablename in extra_tables_dbs: +extra_tables_dbs[tablename].append(db) else: -extra_tables[tablename] = [db] -return extra_tables +extra_tables_dbs[tablename] = [db] +return extra_tables_dbs def extra_tables_report(config, model, conn): -- To view, visit https://gerrit.wikimedia.org/r/184142 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I266e8d4ff24c1c538704f056cf9aefa7e34a0a0c Gerrit-PatchSet: 1 Gerrit-Project: operations/software/labsdb-auditor Gerrit-Branch: master Gerrit-Owner: Yuvipanda yuvipa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Memoize parsing View definitions into Table objects - change (operations...labsdb-auditor)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/184143 Change subject: Memoize parsing View definitions into Table objects .. Memoize parsing View definitions into Table objects This should improve performance significantly, since profiling showed that about 50% of time is spent in parsing SQL. We could also make the parser itself faster, but this seemed to be a simpler solution. Change-Id: Ibf4f91b07ea45029561ab399b6aea6f00db82aaa --- M auditor/models.py M auditor/reports/viewdiffs.py 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/labsdb-auditor refs/changes/43/184143/1 diff --git a/auditor/models.py b/auditor/models.py index 5d5cd92..e0ef167 100644 --- a/auditor/models.py +++ b/auditor/models.py @@ -42,6 +42,12 @@ self.whitelisted = whitelisted self.null_if = null_if +def make_copy(self): + +Returns a copy of this column + +return Column(self.name, self.whitelisted, self.null_if) + class Table(object): def __init__(self, name, columns={}, include_row_if=None, table_name=None): @@ -50,6 +56,13 @@ self.include_row_if = include_row_if self.table_name = table_name if table_name else name +def make_copy(self): + +Return copy of this table + +return Table(self.name, {n: c.make_copy() for n, c in self.columns.items()}, + self.include_row_if, self.table_name) + def add_column(self, column): self.columns[column.name] = column column.table = self diff --git a/auditor/reports/viewdiffs.py b/auditor/reports/viewdiffs.py index b0e57a1..2dbcd9e 100644 --- a/auditor/reports/viewdiffs.py +++ b/auditor/reports/viewdiffs.py @@ -94,10 +94,16 @@ Optional(where + SkipTo(StringEnd())(include_row_if)) + StringEnd() +# Caches cleaned definer sql - table instances +# Since a lot of definers are the same, this memoization should speed things up +cache = {} + def _table_from_definer(sql, viewname): Build a Table object given a cleaned up SQL statement that defines the view +if sql in cache: +return cache[sql].make_copy() res = sql_definition.parseString(sql) table = Table(viewname, {}, res.include_row_if if res.include_row_if else None, res.tablename) for tokens, start, end in column_definition.scanString(sql): @@ -105,6 +111,7 @@ whitelisted=tokens.null_if == '' and tokens.expression != 'NULL', null_if=tokens.null_if if tokens.null_if else None)) +cache[sql] = table return table -- To view, visit https://gerrit.wikimedia.org/r/184143 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf4f91b07ea45029561ab399b6aea6f00db82aaa Gerrit-PatchSet: 1 Gerrit-Project: operations/software/labsdb-auditor Gerrit-Branch: master Gerrit-Owner: Yuvipanda yuvipa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Load the VisualEditor early - change (mediawiki/vagrant)
Physikerwelt has uploaded a new change for review. https://gerrit.wikimedia.org/r/184144 Change subject: Load the VisualEditor early .. Load the VisualEditor early Similar to BetaFeatures VisualEditor needs to be loaded early in order to load the buttons defined by extensions. Bug: T86449 Change-Id: Icbea2cff74459b3713b404375cfef1eeb8656390 --- M puppet/modules/role/manifests/visualeditor.pp 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/44/184144/1 diff --git a/puppet/modules/role/manifests/visualeditor.pp b/puppet/modules/role/manifests/visualeditor.pp index effdc79..4c2c5cc 100644 --- a/puppet/modules/role/manifests/visualeditor.pp +++ b/puppet/modules/role/manifests/visualeditor.pp @@ -11,5 +11,6 @@ mediawiki::extension { 'VisualEditor': settings = template('role/ve-config.php.erb'), browser_tests = 'modules/ve-mw/tests/browser', +priority = $::LOAD_EARLY, } } -- To view, visit https://gerrit.wikimedia.org/r/184144 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icbea2cff74459b3713b404375cfef1eeb8656390 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Physikerwelt w...@physikerwelt.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't use protected CentralAuthUser::getPasswordObject - change (operations/mediawiki-config)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/184147 Change subject: Don't use protected CentralAuthUser::getPasswordObject .. Don't use protected CentralAuthUser::getPasswordObject Doing it like CentralAuthPlugin does now... *sigh* Change-Id: I59766cbf9bc71e32a2b08e6703635a9982b3903b --- M wmf-config/Bug54847.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/47/184147/1 diff --git a/wmf-config/Bug54847.php b/wmf-config/Bug54847.php index 4d3aea3..6125b80 100644 --- a/wmf-config/Bug54847.php +++ b/wmf-config/Bug54847.php @@ -158,7 +158,7 @@ try { if ( $isGlobal ) { $centralUser = CentralAuthUser::getInstance( $user ); - if ( $centralUser-getPasswordObject()-equals( $newpassword ) ) { + if ( $centralUser-authenticate( $newpassword ) === 'ok' ) { wfDebugLog( Bug54847, User attempted to reset with CentralAuth password: . $user-getName() ); $errorMsg = 'password-recycled'; return false; -- To view, visit https://gerrit.wikimedia.org/r/184147 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59766cbf9bc71e32a2b08e6703635a9982b3903b Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Hoo man h...@online.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki.js: Add mw.Map#unset - change (mediawiki/core)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/184150 Change subject: mediawiki.js: Add mw.Map#unset .. mediawiki.js: Add mw.Map#unset If I remember correctly, we didn't have this only because mw.Map used to use the 'window' object before 24f84b08, and you can't 'delete' properties of window on Internet Explorer 8, or something like this. Add a usage in mediawiki.action.view.redirect. Change-Id: I8868ae6ed4bf75bec04849b119132c0dc10c20a0 --- M resources/src/mediawiki.action/mediawiki.action.view.redirect.js M resources/src/mediawiki/mediawiki.js M tests/qunit/suites/resources/mediawiki/mediawiki.test.js 3 files changed, 38 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/50/184150/1 diff --git a/resources/src/mediawiki.action/mediawiki.action.view.redirect.js b/resources/src/mediawiki.action/mediawiki.action.view.redirect.js index 52e0d4e..69fb221 100644 --- a/resources/src/mediawiki.action/mediawiki.action.view.redirect.js +++ b/resources/src/mediawiki.action/mediawiki.action.view.redirect.js @@ -12,7 +12,7 @@ shouldChangeFragment, index; // Clear internal mw.config entries, so that no one tries to depend on them - mw.config.set( 'wgInternalRedirectTargetUrl', null ); + mw.config.unset( 'wgInternalRedirectTargetUrl' ); index = canonical.indexOf( '#' ); if ( index !== -1 ) { diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index 1763c8e..1c72ebe 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -209,6 +209,32 @@ }, /** +* Unsets one or multiple key/value pairs, removing it from the map. +* +* @since 1.25 +* @param {string|Array} selection String key or array of keys to unset values for. +* @return {boolean} This returns true on success, false on failure. +*/ + unset: function ( selection ) { + var i; + + if ( $.isArray( selection ) ) { + selection = slice.call( selection ); + for ( i = 0; i selection.length; i++ ) { + delete this.values[selection[i]]; + } + return true; + } + + if ( typeof selection === 'string' ) { + delete this.values[selection]; + return true; + } + + return false; + }, + + /** * Checks if one or multiple keys exist. * * @param {Mixed} selection String key or array of keys to check diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js index 6c8c62f..4456e7f 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js @@ -55,7 +55,7 @@ this.restoreWarnings(); } ); - QUnit.test( 'mw.Map', 34, function ( assert ) { + QUnit.test( 'mw.Map', 37, function ( assert ) { var arry, conf, funky, globalConf, nummy, someValues; conf = new mw.Map(); @@ -96,6 +96,10 @@ assert.strictEqual( conf.get( funky ), null, 'Map.get ruturns null if selection was invalid (Function)' ); assert.strictEqual( conf.get( nummy ), null, 'Map.get ruturns null if selection was invalid (Number)' ); + conf.set( 'unsetA', 'A' ); + conf.unset( 'unsetA' ); + assert.strictEqual( conf.get( 'unsetA', true ), true, 'Map.unset supports string argument' ); + conf.set( String( nummy ), 'I used to be a number' ); assert.strictEqual( conf.exists( 'doesNotExist' ), false, 'Map.exists where property does not exist' ); @@ -121,6 +125,12 @@ 'notExist': null }, 'Map.get return includes keys that were not found as null values' ); + conf.set( 'unsetB', 'B' ); + conf.set( 'unsetC', 'C' ); + conf.unset( ['unsetB', 'unsetC'] ); + assert.strictEqual( conf.get( 'unsetB', true ), true, 'Map.unset supports array argument' ); + assert.strictEqual( conf.get( 'unsetC', true ), true, 'Map.unset supports array argument' ); + // Interacting with globals and accessing the values object assert.strictEqual( conf.get(), conf.values, 'Map.get returns the entire values object by reference (if called without
[MediaWiki-commits] [Gerrit] Allow numeric headers in Sidebar - change (mediawiki...CologneBlue)
Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/184153 Change subject: Allow numeric headers in Sidebar .. Allow numeric headers in Sidebar A numeric string set as key of an array gets casted to an integer. Since I458c0af3114754ddf3d721f6c374e249f482e4cf wfMessage does not except integer as message key, therefore cast the heading name back to string. Bug: T73639 Change-Id: I729bfdc5ec9eb925a32d64499fe381002a69601b --- M SkinCologneBlue.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/CologneBlue refs/changes/53/184153/1 diff --git a/SkinCologneBlue.php b/SkinCologneBlue.php index a8ed90e..e7482b7 100644 --- a/SkinCologneBlue.php +++ b/SkinCologneBlue.php @@ -572,6 +572,9 @@ $s = div id='quickbar'\n; foreach ( $bar as $heading = $data ) { + // Numeric strings gets an integer when set as key, cast back - T73639 + $heading = (string)$heading; + $portletId = Sanitizer::escapeId( p-$heading ); $headingMsg = wfMessage( $idToMessage[$heading] ? $idToMessage[$heading] : $heading ); $headingHTML = h3; -- To view, visit https://gerrit.wikimedia.org/r/184153 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I729bfdc5ec9eb925a32d64499fe381002a69601b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/CologneBlue Gerrit-Branch: master Gerrit-Owner: Umherirrender umherirrender_de...@web.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add nested= attribute to tab tag - change (mediawiki...Tabs)
Joeytje50 has uploaded a new change for review. https://gerrit.wikimedia.org/r/184188 Change subject: Add nested= attribute to tab tag .. Add nested= attribute to tab tag now it is possible to make nested toggle boxes or dropdowns have content that depends on the selected tab; simply put a {{#tab:}} or {{#tag:tab}} with |nested=true as last argument inside the toggle/dropdown box. Change-Id: I413ebfc42213ae6e88cd87343cc620fc62016571 --- M README.md M Tabs.body.php M Tabs.php 3 files changed, 33 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Tabs refs/changes/88/184188/1 diff --git a/README.md b/README.md index aedad16..d895546 100644 --- a/README.md +++ b/README.md @@ -360,6 +360,17 @@ |dropdown=true}} = Toggle boxes and dropdowns in tab boxes = + +If you want to place a toggle box or a dropdown inside a tab navigation, and want the toggle box to show up for every tab as opposed to just the tab it's nested in, first a parent codelt;tabgt;/code tab must be made, with codeindex=*/code, so that the toggle box won't be recognised as a seperate tab content. + +If you want to place a toggle box or dropdown menu inside a tab menu, you can simply place a codelt;tabgt;/code tag inside the codelt;tabgt;/code tag that functions as a tab. This will restrict toggle boxes and dropdowns to visibility in just one tab though. So, if you want to have a toggle box or dropdown that's visible in every tab, encase it in a codelt;tabgt;/code tag with an codeindex=*/code set to it. + +That way, the outer codelt;tabgt;/code tag will be recognised as a tab container, and the inner one will be recognised as a toggle box or dropdown menu, as desired. The toggle box or dropdown must then also use the [[#General usage information|parser function syntax]]. + +If you want the contents of the toggle box inside the tab menu to be able to change depending on the selected tab, you should use the codenested=true/code attribute on the tag. This can be done by setting the very last argument of the code#tab:/code parser function or the code#tag:tab/code parser function to codenested=true/code. + +See this demo for an example of how to make this work: + tabs tab name=Toggle box This first tab has a toggle box nested inside it @@ -369,6 +380,9 @@ This second tab has a dropdown nested inside it {{#tag:tab|This dropdown is created via the code#tag:tab/code parser function, since it's not possible to define attributes such as codedropdown/code via the code#tab:/code parser function.|dropdown=true}} /tab +tab index=* block +{{#tag:tab|This toggle box shows up inside {{#tab:|every|each of the|nested=true}} tab{{#tag:tab|s|index=2|nested=true}}, because the containing tab tag has got its index attribute set to codeindex=*/code. It also has a codeblock/code attribute.|openname=Open|closename=Close}} +/tab /tabs = Toggle boxes in dropdowns = diff --git a/Tabs.body.php b/Tabs.body.php index 7383443..677360c 100644 --- a/Tabs.body.php +++ b/Tabs.body.php @@ -60,14 +60,15 @@ $form = $parser-tabsData['tabCount'] === 0 ? $this-insertCSSJS($parser) : ''; // init styles, set the return form tag as $form. ++$parser-tabsData['tabCount']; $names = $parser-tabsData['tabNames']; + $nestAttr = isset($attr['nested']); //adding this attribute will restrict functionality, but allow nested tabs inside toggleboxes $nested = $parser-tabsData['nested']; if (isset($attr['name'])) { $attr['name'] = trim(htmlspecialchars($attr['name'])); // making the name attr safe to use } // Default value for the tab's given index: index attribute's value, or else the index of the tab with the same name as name attribute, or else the tab index - if (!$nested) { + if (!$nested !$nestAttr) { $index = -1; // indices do nothing for non-nested tabs, so don't even bother doing the computations. - } elseif (isset($attr['index']) intval($attr['index']) = count($names)) { + } elseif (isset($attr['index']) (intval($attr['index']) = count($names) || $nestAttr)) { $index = intval($attr['index']); // if the index is given, and it isn't greater than the current index + 1. } elseif (isset($attr['index']) $attr['index'] == '*') { $index = 0; //use wildcard index: this tab's contents shows up for every single tab; @@ -79,7 +80,7 @@ } $classPrefix = ''; - if ($nested) {// Note: This is defined seperately for toggleboxes, because of the different classes required. + if ($nested || $nestAttr) {// Note: This is defined seperately for toggleboxes,
[MediaWiki-commits] [Gerrit] Feed the refined text table from the unrefined text (not upl... - change (analytics/refinery)
Hello Ottomata, Nuria, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/184193 to review the following change. Change subject: Feed the refined text table from the unrefined text (not upload) table .. Feed the refined text table from the unrefined text (not upload) table Change-Id: I82f98f4b8ed452fc64ed066d8926beb85da1cda9 --- M oozie/webrequest/datasets_refined.xml 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/refinery refs/changes/93/184193/1 diff --git a/oozie/webrequest/datasets_refined.xml b/oozie/webrequest/datasets_refined.xml index df9b42a..5314075 100644 --- a/oozie/webrequest/datasets_refined.xml +++ b/oozie/webrequest/datasets_refined.xml @@ -31,7 +31,7 @@ frequency=${coord:hours(1)} initial-instance=${start_time} timezone=Universal - uri-template${webrequest_refined_data_directory}/webrequest_source=upload/year=${YEAR}/month=${MONTH}/day=${DAY}/hour=${HOUR}/uri-template + uri-template${webrequest_refined_data_directory}/webrequest_source=text/year=${YEAR}/month=${MONTH}/day=${DAY}/hour=${HOUR}/uri-template /dataset /datasets -- To view, visit https://gerrit.wikimedia.org/r/184193 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I82f98f4b8ed452fc64ed066d8926beb85da1cda9 Gerrit-PatchSet: 1 Gerrit-Project: analytics/refinery Gerrit-Branch: master Gerrit-Owner: QChris christ...@quelltextlich.at Gerrit-Reviewer: Nuria nu...@wikimedia.org Gerrit-Reviewer: Ottomata o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use absolute imports instead of relative imports - change (operations...labsdb-auditor)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/184139 Change subject: Use absolute imports instead of relative imports .. Use absolute imports instead of relative imports This will simplify code a little bit, since python's relative imports are fraught with errors. And also let us run audit.py directly Change-Id: I20ff620d1bb4851ce4751002c4eff2be9ca891f4 --- M auditor/reports/databases.py M auditor/reports/tables.py M auditor/reports/viewdiffs.py 3 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/labsdb-auditor refs/changes/39/184139/1 diff --git a/auditor/reports/databases.py b/auditor/reports/databases.py index 4e64f4a..db1fc55 100644 --- a/auditor/reports/databases.py +++ b/auditor/reports/databases.py @@ -13,7 +13,7 @@ # limitations under the License. import re -from ..utils import get_databases +from auditor.utils import get_databases def databases_report(config, model, conn): diff --git a/auditor/reports/tables.py b/auditor/reports/tables.py index ab35bce..c5e73cd 100644 --- a/auditor/reports/tables.py +++ b/auditor/reports/tables.py @@ -14,7 +14,7 @@ import logging import MySQLdb -from ..utils import get_tables, diff_iters +from auditor.utils import get_tables, diff_iters def _get_extra_tables(model, conn, dbs): diff --git a/auditor/reports/viewdiffs.py b/auditor/reports/viewdiffs.py index 6bd800c..b0e57a1 100644 --- a/auditor/reports/viewdiffs.py +++ b/auditor/reports/viewdiffs.py @@ -15,8 +15,8 @@ import logging from pyparsing import OneOrMore, Optional, Word, SkipTo, StringEnd, alphanums -from ..models import Column, Table -from ..utils import get_tables, diff_iters, common_iters +from auditor.models import Column, Table +from auditor.utils import get_tables, diff_iters, common_iters def _diff(expected, actual, fields): -- To view, visit https://gerrit.wikimedia.org/r/184139 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I20ff620d1bb4851ce4751002c4eff2be9ca891f4 Gerrit-PatchSet: 1 Gerrit-Project: operations/software/labsdb-auditor Gerrit-Branch: master Gerrit-Owner: Yuvipanda yuvipa...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update jquery.hoverIntent to 1.8.1 - change (mediawiki/core)
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/184140 Change subject: Update jquery.hoverIntent to 1.8.1 .. Update jquery.hoverIntent to 1.8.1 Project site * http://cherne.net/brian/resources/jquery.hoverIntent.html File source * https://github.com/briancherne/jquery-hoverIntent/blob/v1.8.1/jquery.hoverIntent.js Requires jQuery 1.9.1+ Changes between r 5 and 1.8.1 are No difference between 1.8.0 and 1.8.1 except from version. * v1.8.0 = (2014) Changed to Semantic Versioning (from r 8 to v1.8.0). * r 7 = (2013) Added event delegation via selector param/property. Added namespaced events for better isolation. Added handlerInOut support. * r 6 = (2011) Identical to r5 except that the Google Chrome defect is fixed once you upgrade to jQuery 1.5.1 (or later). Upgrading from r 5 to 1.8.1. r5 is from 2007 and 1.8.1 is from 2014. Change-Id: Ieb014f15566d58fcecff0655549bc1049bacd02f --- M RELEASE-NOTES-1.25 M includes/api/i18n/en.json M resources/lib/jquery/jquery.hoverIntent.js 3 files changed, 59 insertions(+), 54 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/40/184140/1 diff --git a/RELEASE-NOTES-1.25 b/RELEASE-NOTES-1.25 index 2aa066c..93f830d 100644 --- a/RELEASE-NOTES-1.25 +++ b/RELEASE-NOTES-1.25 @@ -80,6 +80,7 @@ they will add the proper credits to the skins or extensions section. * Update QUnit from v1.14.0 to v1.16.0. * Update Moment.js from v2.8.3 to v2.8.4. +* Upgrade jQuery hoverIntent to v1.8.0. External libraries * MediaWiki now requires certain external libraries to be installed. In the past diff --git a/includes/api/i18n/en.json b/includes/api/i18n/en.json index 0eed4cd..cba687b 100644 --- a/includes/api/i18n/en.json +++ b/includes/api/i18n/en.json @@ -83,7 +83,7 @@ apihelp-edit-param-bot: Mark this edit as bot., apihelp-edit-param-basetimestamp: Timestamp of the base revision, used to detect edit conflicts. May be obtained through [[Special:ApiHelp/query+revisions|action=queryprop=revisionsrvprop=timestamp]]., apihelp-edit-param-starttimestamp: Timestamp when you began the editing process, used to detect edit conflicts. An appropriate value may be obtained using [[Special:ApiHelp/main|curtimestamp]] when beginning the edit process (e.g. when loading the page content to edit)., - apihelp-edit-param-recreate: Override any errors about the article having been deleted in the meantime., + apihelp-edit-param-recreate: Override any errors about the page having been deleted in the meantime., apihelp-edit-param-createonly: Don't edit the page if it exists already., apihelp-edit-param-nocreate: Throw an error if the page doesn't exist., apihelp-edit-param-watch: Add the page to your watchlist., diff --git a/resources/lib/jquery/jquery.hoverIntent.js b/resources/lib/jquery/jquery.hoverIntent.js index adf948d..2f0fa51 100644 --- a/resources/lib/jquery/jquery.hoverIntent.js +++ b/resources/lib/jquery/jquery.hoverIntent.js @@ -1,42 +1,51 @@ -/** -* hoverIntent is similar to jQuery's built-in hover function except that -* instead of firing the onMouseOver event immediately, hoverIntent checks -* to see if the user's mouse has slowed down (beneath the sensitivity -* threshold) before firing the onMouseOver event. -* -* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+ -* http://cherne.net/brian/resources/jquery.hoverIntent.html -* -* hoverIntent is currently available for use in all personal or commercial -* projects under both MIT and GPL licenses. This means that you can choose -* the license that best suits your project, and use it accordingly. -* -* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions -* $(ul li).hoverIntent( showNav , hideNav ); -* -* // advanced usage receives configuration object only -* $(ul li).hoverIntent({ -* sensitivity: 7, // number = sensitivity threshold (must be 1 or higher) -* interval: 100, // number = milliseconds of polling interval -* over: showNav, // function = onMouseOver callback (required) -* timeout: 0, // number = milliseconds delay before onMouseOut function call -* out: hideNav// function = onMouseOut callback (required) -* }); -* -* @param f onMouseOver function || An object with configuration options -* @param g onMouseOut function || Nothing (use configuration options object) -* @authorBrian Cherne br...@cherne.net -*/ +/*! + * hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+ + * http://cherne.net/brian/resources/jquery.hoverIntent.html + * + * You may use hoverIntent under the terms of the MIT license. Basically that + * means you are free to use hoverIntent as long as this header is left intact. + * Copyright 2007, 2014 Brian Cherne + */ + +/* hoverIntent is similar to jQuery's built-in hover method except that + * instead of firing the
[MediaWiki-commits] [Gerrit] Add standard threshold for iNaturalist - change (translatewiki)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/184146 Change subject: Add standard threshold for iNaturalist .. Add standard threshold for iNaturalist Change-Id: I095d589a26bb393c65eec1fd25743576c9bdd7f6 --- M bin/repoexport 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/46/184146/1 diff --git a/bin/repoexport b/bin/repoexport index 89f1f97..428bb13 100755 --- a/bin/repoexport +++ b/bin/repoexport @@ -61,7 +61,7 @@ elif [ $PROJECT = inaturalist ] then - php $EXPORTER --target . --group=out-inaturalist --lang='*' --skip en $HOURS + php $EXPORTER --target . --group=out-inaturalist --lang='*' --skip en $HOURS $THRESHOLD elif [ $PROJECT = intuition ] then -- To view, visit https://gerrit.wikimedia.org/r/184146 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I095d589a26bb393c65eec1fd25743576c9bdd7f6 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't use protected CentralAuthUser::getPasswordObject - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Don't use protected CentralAuthUser::getPasswordObject .. Don't use protected CentralAuthUser::getPasswordObject Doing it like CentralAuthPlugin does now... *sigh* Change-Id: I59766cbf9bc71e32a2b08e6703635a9982b3903b --- M wmf-config/Bug54847.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/Bug54847.php b/wmf-config/Bug54847.php index 4d3aea3..6125b80 100644 --- a/wmf-config/Bug54847.php +++ b/wmf-config/Bug54847.php @@ -158,7 +158,7 @@ try { if ( $isGlobal ) { $centralUser = CentralAuthUser::getInstance( $user ); - if ( $centralUser-getPasswordObject()-equals( $newpassword ) ) { + if ( $centralUser-authenticate( $newpassword ) === 'ok' ) { wfDebugLog( Bug54847, User attempted to reset with CentralAuth password: . $user-getName() ); $errorMsg = 'password-recycled'; return false; -- To view, visit https://gerrit.wikimedia.org/r/184147 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59766cbf9bc71e32a2b08e6703635a9982b3903b Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Hoo man h...@online.de Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement message group configuration validation - change (mediawiki...Translate)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/184148 Change subject: Implement message group configuration validation .. Implement message group configuration validation * Validation is optional, but automatically performed if the metayaml library is available. Added it to suggest section in composer.json. * All twn Yaml files are validated under 200 ms, which is fast enough in my opinion. * Moved some code out of TranslateYaml to MessageGroupConfigurationParser where I also placed the new validation code. * Added MetaYamlSchemaExtender interface, which I unfortunately can't use because there is no function to check whether a class implements and interface. There are functions that provide the information but they are harder to use and could be slower, so I went for duck typing instead. Left the class in, however, in case this wll change in the future as well as for other use cases. Constructing these objects is non-trivial, in case you wonder why I don't use instanceof. Change-Id: I09e481d30d068177db3f71d2ebfffa87c394060c --- M Autoload.php A MessageGroupConfigurationParser.php M MessageGroups.php A MetaYamlSchemaExtender.php M composer.json A data/group-yaml-schema.yaml M ffs/FlatPhpFFS.php M ffs/GettextFFS.php M ffs/JavaFFS.php M ffs/YamlFFS.php M messagegroups/FileBasedMessageGroup.php M stringmangler/StringMatcher.php M utils/TranslateYaml.php 13 files changed, 437 insertions(+), 46 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/48/184148/1 diff --git a/Autoload.php b/Autoload.php index d58f480..11edc22 100644 --- a/Autoload.php +++ b/Autoload.php @@ -22,6 +22,8 @@ $al['MessageCollection'] = $dir/MessageCollection.php; $al['MessageDefinitions'] = $dir/MessageCollection.php; $al['MessageGroups'] = $dir/MessageGroups.php; +$al['MessageGroupConfigurationParser'] = $dir/MessageGroupConfigurationParser.php; +$al['MetaYamlSchemaExtender'] = $dir/MetaYamlSchemaExtender.php; $al['TMessage'] = $dir/Message.php; $al['ThinMessage'] = $dir/Message.php; $al['TranslateEditAddons'] = $dir/TranslateEditAddons.php; diff --git a/MessageGroupConfigurationParser.php b/MessageGroupConfigurationParser.php new file mode 100644 index 000..5f5a37e --- /dev/null +++ b/MessageGroupConfigurationParser.php @@ -0,0 +1,155 @@ +?php +/** + * + * @file + * @author Niklas Laxström + * @license GPL-2.0+ + */ + +/** + * Utility class to parse and validate message group configurations. + * @since 2014.01 + */ +class MessageGroupConfigurationParser { + protected $baseSchema; + + public function __construct() { + // Don't perform validations if library not available + if ( class_exists( 'RomaricDrigon\MetaYaml\MetaYaml' ) ) { + $this-baseSchema = $this-getBaseSchema(); + } + } + + /** +* Easy to use function to get valid group configurations from YAML. Those not matching +* schema will be ignored, if schema validation is enabled. +* +* @param string $data Yaml +* @param callable $callback Optional callback which is called on errors. Parameters are +* document index, processed configuration and error message. +* @return array Group configurations indexed by message group id. +*/ + public function getHopefullyValidConfigurations( $data, $callback = null ) { + if ( !is_callable( $callback ) ) { + $callback = function () {/*noop*/}; + } + + $documents = self::getDocumentsFromYaml( $data ); + $configurations = self::parseDocuments( $documents ); + $groups = array(); + + if ( is_array( $this-baseSchema ) ) { + foreach ( $configurations as $index = $config ) { + try { + $this-validate( $config ); + $groups[$config['BASIC']['id']] = $config; + } catch ( Exception $e ) { + $callback( $index, $config, $e-getMessage() ); + } + } + } else { + foreach ( $configurations as $index = $config ) { + if ( isset( $config['BASIC']['id'] ) ) { + $groups[$config['BASIC']['id']] = $config; + } else { + $callback( $index, $config, 'id is missing' ); + } + } + } + + return $groups; + } + + /** +* Given a Yaml string, returns the non-empty documents as an array. +* +* @param
[MediaWiki-commits] [Gerrit] Remove unused message 'rollback_short' - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused message 'rollback_short' .. Remove unused message 'rollback_short' Last seen in ca38c84 (r7511, from 2005). Change-Id: Ida0b52e05e1ca66595a6f8352c14d825655dabc3 --- M languages/i18n/en.json M languages/i18n/qqq.json 2 files changed, 0 insertions(+), 2 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 2046929..3c86243 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1887,7 +1887,6 @@ deleteprotected: You cannot delete this page because it has been protected., deleting-backlinks-warning: '''Warning:''' [[Special:WhatLinksHere/{{FULLPAGENAME}}|Other pages]] link to or transclude the page you are about to delete., rollback: Roll back edits, - rollback_short: Rollback, rollbacklink: rollback, rollbacklinkcount: rollback $1 {{PLURAL:$1|edit|edits}}, rollbacklinkcount-morethan: rollback more than $1 {{PLURAL:$1|edit|edits}}, diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 87e69a1..504658e 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2051,7 +2051,6 @@ deleteprotected: Used as error message when deleting the page.\n\n\If protection keeps them from editing, they shouldn't be able to delete.\, deleting-backlinks-warning: A warning shown when a page that is being deleted has at least one link to it or is transcluded in at least one page., rollback: {{Identical|Rollback}}, - rollback_short: {{Identical|Rollback}}, rollbacklink: {{Doc-actionlink}}\nThis link text appears on the recent changes page to users who have the \rollback\ right.\nThis message has a tooltip {{msg-mw|tooltip-rollback}}\n{{Identical|Rollback}}, rollbacklinkcount: {{doc-actionlink}}\nText of the rollback link showing the number of edits to be rolled back. See also {{msg-mw|rollbacklink}}.\n\nParameters:\n* $1 - the number of edits that will be rolled back. If $1 is over the value of code$wgShowRollbackEditCount/code (default: 10) {{msg-mw|rollbacklinkcount-morethan}} is used.\n\nThe rollback link is displayed with a tooltip {{msg-mw|Tooltip-rollback}}, rollbacklinkcount-morethan: {{doc-actionlink}}\nText of the rollback link when a greater number of edits is to be rolled back. See also {{msg-mw|rollbacklink}}.\n\nWhen the number of edits rolled back is smaller than [[mw:Special:MyLanguage/Manual:$wgShowRollbackEditCount|$wgShowRollbackEditCount]], {{msg-mw|rollbacklinkcount}} is used instead.\n\nParameters:\n* $1 - number of edits, -- To view, visit https://gerrit.wikimedia.org/r/184145 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida0b52e05e1ca66595a6f8352c14d825655dabc3 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com Gerrit-Reviewer: Siebrand siebr...@kitano.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add version comments to DatabaseUpdater for 1.25 - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Add version comments to DatabaseUpdater for 1.25 .. Add version comments to DatabaseUpdater for 1.25 There are already version comments for the older versions, so also adding comments for the current version to make it easier finding the corresponding version when looking at database changes. As suggested in Ieeb558f9523c11965cbc1941cad4f316c00c85c5 Change-Id: Idf4f52aec4eeb73ec2f830d7d7eaab84c73b6d95 --- M includes/installer/MssqlUpdater.php M includes/installer/MysqlUpdater.php M includes/installer/OracleUpdater.php M includes/installer/PostgresUpdater.php M includes/installer/SqliteUpdater.php 5 files changed, 10 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/installer/MssqlUpdater.php b/includes/installer/MssqlUpdater.php index 2d7afc1..5eef335 100644 --- a/includes/installer/MssqlUpdater.php +++ b/includes/installer/MssqlUpdater.php @@ -42,6 +42,8 @@ // 1.24 array( 'addField', 'page', 'page_lang', 'patch-page-page_lang.sql'), + + // 1.25 array( 'dropTable', 'hitcounter' ), array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ), array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ), diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index d7b0dec..7a36f01 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -266,6 +266,8 @@ 'patch-oi_major_mime-chemical.sql' ), array( 'modifyField', 'filearchive', 'fa_major_mime', 'patch-fa_major_mime-chemical.sql' ), + + // 1.25 array( 'dropTable', 'hitcounter' ), array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ), array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ), diff --git a/includes/installer/OracleUpdater.php b/includes/installer/OracleUpdater.php index c731d98..03dbd1c 100644 --- a/includes/installer/OracleUpdater.php +++ b/includes/installer/OracleUpdater.php @@ -102,6 +102,8 @@ // 1.24 array( 'addField', 'page', 'page_lang', 'patch-page-page_lang.sql' ), + + // 1.25 array( 'dropTable', 'hitcounter' ), array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ), array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ), diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 3b1c579..bc25455 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -418,6 +418,8 @@ array( 'addPgField', 'pagelinks', 'pl_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ), array( 'addPgField', 'templatelinks', 'tl_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ), array( 'addPgField', 'imagelinks', 'il_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ), + + // 1.25 array( 'dropTable', 'hitcounter' ), array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ), array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ), diff --git a/includes/installer/SqliteUpdater.php b/includes/installer/SqliteUpdater.php index 490cdb7..81304c4 100644 --- a/includes/installer/SqliteUpdater.php +++ b/includes/installer/SqliteUpdater.php @@ -137,6 +137,8 @@ array( 'addField', 'pagelinks', 'pl_from_namespace', 'patch-pl_from_namespace.sql' ), array( 'addField', 'templatelinks', 'tl_from_namespace', 'patch-tl_from_namespace.sql' ), array( 'addField', 'imagelinks', 'il_from_namespace', 'patch-il_from_namespace.sql' ), + + // 1.25 array( 'dropTable', 'hitcounter' ), array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ), array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ), -- To view, visit https://gerrit.wikimedia.org/r/183979 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idf4f52aec4eeb73ec2f830d7d7eaab84c73b6d95 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner:
[MediaWiki-commits] [Gerrit] Make group configs pass schema - change (translatewiki)
Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/184149 Change subject: Make group configs pass schema .. Make group configs pass schema Bug: T86336 Change-Id: I84d65ac05b5dbb6f07cf7a5350aa0c7044a9b034 --- M groups/EOL/EOL.yaml M groups/Europeana/Europeana.yaml M groups/FUEL/FUEL.yaml M groups/MathJax/MathJax.yaml M groups/OpenStreetMap/OpenStreetMap.yaml 5 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/49/184149/1 diff --git a/groups/EOL/EOL.yaml b/groups/EOL/EOL.yaml index 75e70f6..3015e02 100644 --- a/groups/EOL/EOL.yaml +++ b/groups/EOL/EOL.yaml @@ -7,7 +7,7 @@ FILES: class: RubyYamlFFS -codeAsRoot: 1 +codeAsRoot: true codeMap: be-tarask: be-Tarask ku-latn: ku-Latn diff --git a/groups/Europeana/Europeana.yaml b/groups/Europeana/Europeana.yaml index aa4553b..ef3dd76 100644 --- a/groups/Europeana/Europeana.yaml +++ b/groups/Europeana/Europeana.yaml @@ -9,7 +9,7 @@ FILES: sourcePattern: %GROUPROOT%/europeana/config/locales/%CODE%.yml class: RubyYamlFFS - codeAsRoot: 1 + codeAsRoot: true codeMap: be-tarask: be-Tarask ku-latn: ku-Latn diff --git a/groups/FUEL/FUEL.yaml b/groups/FUEL/FUEL.yaml index 086d5e7..9417bf0 100644 --- a/groups/FUEL/FUEL.yaml +++ b/groups/FUEL/FUEL.yaml @@ -8,7 +8,7 @@ FILES: class: GettextFFS keyAlgorithm: simple -codemap: +codeMap: zh-hans: zh_CN zh-hant: zh_TW diff --git a/groups/MathJax/MathJax.yaml b/groups/MathJax/MathJax.yaml index a37cf47..f659b6b 100644 --- a/groups/MathJax/MathJax.yaml +++ b/groups/MathJax/MathJax.yaml @@ -19,7 +19,7 @@ description: {{int:translate-group-desc-mathjax}} namespace: NS_MATHJAX class: AggregateMessageGroup - meta: 1 + meta: true GROUPS: - out-mathjax-* diff --git a/groups/OpenStreetMap/OpenStreetMap.yaml b/groups/OpenStreetMap/OpenStreetMap.yaml index f40efe5..ef6f0ea 100644 --- a/groups/OpenStreetMap/OpenStreetMap.yaml +++ b/groups/OpenStreetMap/OpenStreetMap.yaml @@ -6,7 +6,7 @@ FILES: class: RubyYamlFFS -codeAsRoot: 1 +codeAsRoot: true codeMap: be-tarask: be-Tarask ku-latn: ku-Latn -- To view, visit https://gerrit.wikimedia.org/r/184149 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I84d65ac05b5dbb6f07cf7a5350aa0c7044a9b034 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add processing of logs from 'misc' caches - change (analytics/refinery)
QChris has uploaded a new change for review. https://gerrit.wikimedia.org/r/184191 Change subject: Add processing of logs from 'misc' caches .. Add processing of logs from 'misc' caches Change-Id: If0cf42cae05cad26984fb3d35208b54803f72f88 --- M camus/camus.webrequest.properties M oozie/webrequest/datasets.xml M oozie/webrequest/datasets_refined.xml M oozie/webrequest/load/bundle.xml M oozie/webrequest/refine/bundle.xml 5 files changed, 39 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/refinery refs/changes/91/184191/1 diff --git a/camus/camus.webrequest.properties b/camus/camus.webrequest.properties index 4f33104..330bb69 100644 --- a/camus/camus.webrequest.properties +++ b/camus/camus.webrequest.properties @@ -66,7 +66,7 @@ kafka.blacklist.topics= # These are the kafka topics camus brings to HDFS -kafka.whitelist.topics=webrequest_bits,webrequest_mobile,webrequest_text,webrequest_upload +kafka.whitelist.topics=webrequest_bits,webrequest_mobile,webrequest_text,webrequest_upload,webrequest_misc # Name of the client as seen by kafka kafka.client.name=camus-webrequest-00 diff --git a/oozie/webrequest/datasets.xml b/oozie/webrequest/datasets.xml index 7056ac5..fe47548 100644 --- a/oozie/webrequest/datasets.xml +++ b/oozie/webrequest/datasets.xml @@ -43,6 +43,13 @@ uri-template${webrequest_data_directory}/webrequest_upload/hourly/${YEAR}/${MONTH}/${DAY}/${HOUR}/uri-template done-flag/done-flag /dataset +dataset name=webrequest_misc_unchecked + frequency=${coord:hours(1)} + initial-instance=${start_time} + timezone=Universal + uri-template${webrequest_data_directory}/webrequest_misc/hourly/${YEAR}/${MONTH}/${DAY}/${HOUR}/uri-template +done-flag/done-flag +/dataset !-- The webrequest_* datasets should be used if you want to be @@ -80,5 +87,12 @@ uri-template${webrequest_data_directory}/webrequest_upload/hourly/${YEAR}/${MONTH}/${DAY}/${HOUR}/uri-template done-flag_SUCCESS/done-flag /dataset +dataset name=webrequest_misc + frequency=${coord:hours(1)} + initial-instance=${start_time} + timezone=Universal + uri-template${webrequest_data_directory}/webrequest_misc/hourly/${YEAR}/${MONTH}/${DAY}/${HOUR}/uri-template +done-flag_SUCCESS/done-flag +/dataset /datasets diff --git a/oozie/webrequest/datasets_refined.xml b/oozie/webrequest/datasets_refined.xml index df9b42a..66674b5 100644 --- a/oozie/webrequest/datasets_refined.xml +++ b/oozie/webrequest/datasets_refined.xml @@ -16,7 +16,7 @@ above two 'raw' datasets, except that they use a more efficient storage format, and contain extra information. -This dataset does not yet include upload or bits. +This dataset does not yet include upload, bits, or misc. TODO: I would like to eventually name this data set 'webrequest_mobile', etc. and rename the datasets.xml datasets to webrequest_mobile_raw, etc. diff --git a/oozie/webrequest/load/bundle.xml b/oozie/webrequest/load/bundle.xml index df602b7..72281e2 100644 --- a/oozie/webrequest/load/bundle.xml +++ b/oozie/webrequest/load/bundle.xml @@ -65,4 +65,14 @@ /configuration /coordinator +coordinator name='hive_webrequest_load-webrequest-misc' +app-path${coordinator_file}/app-path +configuration +property +namewebrequest_source/name +valuemisc/value +/property +/configuration +/coordinator + /bundle-app diff --git a/oozie/webrequest/refine/bundle.xml b/oozie/webrequest/refine/bundle.xml index 47b74aa..ecb35ba 100644 --- a/oozie/webrequest/refine/bundle.xml +++ b/oozie/webrequest/refine/bundle.xml @@ -24,7 +24,7 @@ /parameters !-- -For now, don't refine bits or upload. +For now, don't refine bits, upload or misc. coordinator name='refine-webrequest-bits' app-path${coordinator_file}/app-path @@ -68,4 +68,16 @@ /configuration /coordinator -- + +!-- +coordinator name='refine-webrequest-misc' +app-path${coordinator_file}/app-path +configuration +property +namewebrequest_source/name +valuemisc/value +/property +/configuration +/coordinator +-- /bundle-app -- To view, visit https://gerrit.wikimedia.org/r/184191 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0cf42cae05cad26984fb3d35208b54803f72f88 Gerrit-PatchSet: 1 Gerrit-Project: analytics/refinery Gerrit-Branch: master Gerrit-Owner: QChris christ...@quelltextlich.at ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] Adjust comment for Camus' whitelist to match the current set... - change (analytics/refinery)
QChris has uploaded a new change for review. https://gerrit.wikimedia.org/r/184190 Change subject: Adjust comment for Camus' whitelist to match the current setting .. Adjust comment for Camus' whitelist to match the current setting Change-Id: I892910e20111c0c02405221dabda92c8c097af2e --- M camus/camus.webrequest.properties 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/refinery refs/changes/90/184190/1 diff --git a/camus/camus.webrequest.properties b/camus/camus.webrequest.properties index 22d3c46..4f33104 100644 --- a/camus/camus.webrequest.properties +++ b/camus/camus.webrequest.properties @@ -65,7 +65,7 @@ # if whitelist has values, only whitelisted topic are pulled. nothing on the blacklist is pulled kafka.blacklist.topics= -# For now, we are only importing webrequest_mobile logs. +# These are the kafka topics camus brings to HDFS kafka.whitelist.topics=webrequest_bits,webrequest_mobile,webrequest_text,webrequest_upload # Name of the client as seen by kafka -- To view, visit https://gerrit.wikimedia.org/r/184190 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I892910e20111c0c02405221dabda92c8c097af2e Gerrit-PatchSet: 1 Gerrit-Project: analytics/refinery Gerrit-Branch: master Gerrit-Owner: QChris christ...@quelltextlich.at ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] commoncat.py: align with LogEntry structure in core - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: commoncat.py: align with LogEntry structure in core .. commoncat.py: align with LogEntry structure in core When porting from compat to core, the compat structure was not changed. A tuple was expected instead of a LogEntry object. Slightly improved output message in checkCommonscatLink(). Bug: T86433 Change-Id: If7d166f81076da7394f2acd243fcf13d0e68df8e --- M scripts/commonscat.py 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Ricordisamoa: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/commonscat.py b/scripts/commonscat.py index 13031a5..d276360 100755 --- a/scripts/commonscat.py +++ b/scripts/commonscat.py @@ -473,8 +473,8 @@ pywikibot.output(u'Commons category does not exist. Examining deletion log...') logpages = commonsSite.logevents(logtype='delete', page=commonsPage) for logitem in logpages: -logitem = next(logpages) -(logpage, loguser, logtimestamp, logcomment) = logitem +loguser = logitem.user() +logcomment = logitem.comment() # Some logic to extract the target page. regex = u'moved to \[\[\:?Category:(?Pnewcat1[^\|\}]+)(\|[^\}]+)?\]\]|Robot: Changing Category:(.+) to Category:(?Pnewcat2.+)' m = re.search(regex, logcomment, flags=re.I) @@ -485,9 +485,9 @@ return self.checkCommonscatLink(m.group('newcat2')) else: pywikibot.output( -u'getCommonscat: Deleted by %s. Couldn\'t find ' +u'getCommonscat: %s deleted by %s. Couldn\'t find ' u'move target in %s' -% (loguser, logcomment)) +% (commonsPage, loguser, logcomment)) return u'' return u'' elif commonsPage.isRedirectPage(): -- To view, visit https://gerrit.wikimedia.org/r/184155 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7d166f81076da7394f2acd243fcf13d0e68df8e Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Mpaa mpaa.w...@gmail.com Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Mpaa mpaa.w...@gmail.com Gerrit-Reviewer: Ricordisamoa ricordisa...@openmailbox.org Gerrit-Reviewer: Rubin ru...@wikimedia.ru Gerrit-Reviewer: XZise commodorefabia...@gmx.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move Test files under same folder structure where class is (... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Move Test files under same folder structure where class is (/languages/) .. Move Test files under same folder structure where class is (/languages/) Change-Id: I25c99272a1c2e318e6c61b4a497bf04886430e9b --- R tests/phpunit/languages/LanguageConverterTest.php R tests/phpunit/languages/classes/LanguageAmTest.php R tests/phpunit/languages/classes/LanguageArTest.php R tests/phpunit/languages/classes/LanguageArqTest.php R tests/phpunit/languages/classes/LanguageBeTest.php R tests/phpunit/languages/classes/LanguageBe_taraskTest.php R tests/phpunit/languages/classes/LanguageBhoTest.php R tests/phpunit/languages/classes/LanguageBsTest.php R tests/phpunit/languages/classes/LanguageCsTest.php R tests/phpunit/languages/classes/LanguageCuTest.php R tests/phpunit/languages/classes/LanguageCyTest.php R tests/phpunit/languages/classes/LanguageDsbTest.php R tests/phpunit/languages/classes/LanguageFrTest.php R tests/phpunit/languages/classes/LanguageGaTest.php R tests/phpunit/languages/classes/LanguageGdTest.php R tests/phpunit/languages/classes/LanguageGvTest.php R tests/phpunit/languages/classes/LanguageHeTest.php R tests/phpunit/languages/classes/LanguageHiTest.php R tests/phpunit/languages/classes/LanguageHrTest.php R tests/phpunit/languages/classes/LanguageHsbTest.php R tests/phpunit/languages/classes/LanguageHuTest.php R tests/phpunit/languages/classes/LanguageHyTest.php R tests/phpunit/languages/classes/LanguageKshTest.php R tests/phpunit/languages/classes/LanguageLnTest.php R tests/phpunit/languages/classes/LanguageLtTest.php R tests/phpunit/languages/classes/LanguageLvTest.php R tests/phpunit/languages/classes/LanguageMgTest.php R tests/phpunit/languages/classes/LanguageMkTest.php R tests/phpunit/languages/classes/LanguageMlTest.php R tests/phpunit/languages/classes/LanguageMoTest.php R tests/phpunit/languages/classes/LanguageMtTest.php R tests/phpunit/languages/classes/LanguageNlTest.php R tests/phpunit/languages/classes/LanguageNsoTest.php R tests/phpunit/languages/classes/LanguagePlTest.php R tests/phpunit/languages/classes/LanguageRoTest.php R tests/phpunit/languages/classes/LanguageRuTest.php R tests/phpunit/languages/classes/LanguageSeTest.php R tests/phpunit/languages/classes/LanguageSgsTest.php R tests/phpunit/languages/classes/LanguageShTest.php R tests/phpunit/languages/classes/LanguageSkTest.php R tests/phpunit/languages/classes/LanguageSlTest.php R tests/phpunit/languages/classes/LanguageSmaTest.php R tests/phpunit/languages/classes/LanguageSrTest.php R tests/phpunit/languages/classes/LanguageTiTest.php R tests/phpunit/languages/classes/LanguageTlTest.php R tests/phpunit/languages/classes/LanguageTrTest.php R tests/phpunit/languages/classes/LanguageUkTest.php R tests/phpunit/languages/classes/LanguageUzTest.php R tests/phpunit/languages/classes/LanguageWaTest.php 49 files changed, 0 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/includes/LanguageConverterTest.php b/tests/phpunit/languages/LanguageConverterTest.php similarity index 100% rename from tests/phpunit/includes/LanguageConverterTest.php rename to tests/phpunit/languages/LanguageConverterTest.php diff --git a/tests/phpunit/languages/LanguageAmTest.php b/tests/phpunit/languages/classes/LanguageAmTest.php similarity index 100% rename from tests/phpunit/languages/LanguageAmTest.php rename to tests/phpunit/languages/classes/LanguageAmTest.php diff --git a/tests/phpunit/languages/LanguageArTest.php b/tests/phpunit/languages/classes/LanguageArTest.php similarity index 100% rename from tests/phpunit/languages/LanguageArTest.php rename to tests/phpunit/languages/classes/LanguageArTest.php diff --git a/tests/phpunit/languages/LanguageArqTest.php b/tests/phpunit/languages/classes/LanguageArqTest.php similarity index 100% rename from tests/phpunit/languages/LanguageArqTest.php rename to tests/phpunit/languages/classes/LanguageArqTest.php diff --git a/tests/phpunit/languages/LanguageBeTest.php b/tests/phpunit/languages/classes/LanguageBeTest.php similarity index 100% rename from tests/phpunit/languages/LanguageBeTest.php rename to tests/phpunit/languages/classes/LanguageBeTest.php diff --git a/tests/phpunit/languages/LanguageBe_taraskTest.php b/tests/phpunit/languages/classes/LanguageBe_taraskTest.php similarity index 100% rename from tests/phpunit/languages/LanguageBe_taraskTest.php rename to tests/phpunit/languages/classes/LanguageBe_taraskTest.php diff --git a/tests/phpunit/languages/LanguageBhoTest.php b/tests/phpunit/languages/classes/LanguageBhoTest.php similarity index 100% rename from tests/phpunit/languages/LanguageBhoTest.php rename to tests/phpunit/languages/classes/LanguageBhoTest.php diff --git a/tests/phpunit/languages/LanguageBsTest.php b/tests/phpunit/languages/classes/LanguageBsTest.php similarity index
[MediaWiki-commits] [Gerrit] Fix gallery rearrange on resize with missing images - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Fix gallery rearrange on resize with missing images .. Fix gallery rearrange on resize with missing images Follow-ups I286e0a4c8230c11619ca30f8f3b66778de835a33 Bug: T55664 Change-Id: I95cc64de11df3197378f4873d62a76333d55b452 --- M resources/src/mediawiki.page/mediawiki.page.gallery.js 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Fomafix: Looks good to me, but someone else must approve Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki.page/mediawiki.page.gallery.js b/resources/src/mediawiki.page/mediawiki.page.gallery.js index e3ffbda..e4cd3a2 100644 --- a/resources/src/mediawiki.page/mediawiki.page.gallery.js +++ b/resources/src/mediawiki.page/mediawiki.page.gallery.js @@ -222,12 +222,14 @@ imgHeight = $( this ).data( 'imgHeight' ), width = $( this ).data( 'width' ), captionWidth = $( this ).data( 'captionWidth' ), + $innerDiv = $( this ).children( 'div' ).first(), + $imageDiv = $innerDiv.children( 'div.thumb' ), $imageElm, imageElm; // Restore original sizes so we can arrange the elements as on freshly loaded page $( this ).width( width ); - $( this ).children( 'div' ).first().width( width ); - $( this ).children( 'div' ).first().children( 'div.thumb' ).width( imgWidth ); + $innerDiv.width( width ); + $imageDiv.width( imgWidth ); $( this ).find( 'div.gallerytextwrapper' ).width( captionWidth ); $imageElm = $( this ).find( 'img' ).first(); @@ -235,6 +237,8 @@ if ( imageElm ) { imageElm.width = imgWidth; imageElm.height = imgHeight; + } else { + $imageDiv.height( imgHeight ); } } ); } ) ); -- To view, visit https://gerrit.wikimedia.org/r/183989 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95cc64de11df3197378f4873d62a76333d55b452 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Fomafix Gerrit-Reviewer: Jack Phoenix j...@countervandalism.net Gerrit-Reviewer: Krinkle krinklem...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow numeric headers in Sidebar - change (mediawiki...MonoBook)
Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/184152 Change subject: Allow numeric headers in Sidebar .. Allow numeric headers in Sidebar A numeric string set as key of an array gets casted to an integer. Since I458c0af3114754ddf3d721f6c374e249f482e4cf wfMessage does not except integer as message key, therefore cast the boxname back to string. Bug: T73639 Change-Id: I8f75243abbdb67d70f54fedb3ebd266e6ced05e3 --- M MonoBookTemplate.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MonoBook refs/changes/52/184152/1 diff --git a/MonoBookTemplate.php b/MonoBookTemplate.php index b859480..beb6212 100644 --- a/MonoBookTemplate.php +++ b/MonoBookTemplate.php @@ -211,6 +211,9 @@ continue; } + // Numeric strings gets an integer when set as key, cast back - T73639 + $boxName = (string)$boxName; + if ( $boxName == 'SEARCH' ) { $this-searchBox(); } elseif ( $boxName == 'TOOLBOX' ) { -- To view, visit https://gerrit.wikimedia.org/r/184152 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f75243abbdb67d70f54fedb3ebd266e6ced05e3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/MonoBook Gerrit-Branch: master Gerrit-Owner: Umherirrender umherirrender_de...@web.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow numeric headers in Sidebar - change (mediawiki...Vector)
Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/184151 Change subject: Allow numeric headers in Sidebar .. Allow numeric headers in Sidebar A numeric string set as key of an array gets casted to an integer. Since I458c0af3114754ddf3d721f6c374e249f482e4cf wfMessage does not except integer as message key, therefore cast the heading name back to string. Bug: T73639 Change-Id: I376fb49d03251a71372738c531a09f014540b958 --- M VectorTemplate.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Vector refs/changes/51/184151/1 diff --git a/VectorTemplate.php b/VectorTemplate.php index 4acfa8c..56e3937 100644 --- a/VectorTemplate.php +++ b/VectorTemplate.php @@ -282,6 +282,9 @@ continue; } + // Numeric strings gets an integer when set as key, cast back - T73639 + $name = (string)$name; + switch ( $name ) { case 'SEARCH': break; -- To view, visit https://gerrit.wikimedia.org/r/184151 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I376fb49d03251a71372738c531a09f014540b958 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Vector Gerrit-Branch: master Gerrit-Owner: Umherirrender umherirrender_de...@web.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add nested= attribute to tab tag - change (mediawiki...Tabs)
jenkins-bot has submitted this change and it was merged. Change subject: Add nested= attribute to tab tag .. Add nested= attribute to tab tag now it is possible to make nested toggle boxes or dropdowns have content that depends on the selected tab; simply put a {{#tab:}} or {{#tag:tab}} with |nested=true as last argument inside the toggle/dropdown box. Change-Id: I413ebfc42213ae6e88cd87343cc620fc62016571 --- M README.md M Tabs.body.php M Tabs.php 3 files changed, 33 insertions(+), 8 deletions(-) Approvals: Joeytje50: Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index aedad16..d895546 100644 --- a/README.md +++ b/README.md @@ -360,6 +360,17 @@ |dropdown=true}} = Toggle boxes and dropdowns in tab boxes = + +If you want to place a toggle box or a dropdown inside a tab navigation, and want the toggle box to show up for every tab as opposed to just the tab it's nested in, first a parent codelt;tabgt;/code tab must be made, with codeindex=*/code, so that the toggle box won't be recognised as a seperate tab content. + +If you want to place a toggle box or dropdown menu inside a tab menu, you can simply place a codelt;tabgt;/code tag inside the codelt;tabgt;/code tag that functions as a tab. This will restrict toggle boxes and dropdowns to visibility in just one tab though. So, if you want to have a toggle box or dropdown that's visible in every tab, encase it in a codelt;tabgt;/code tag with an codeindex=*/code set to it. + +That way, the outer codelt;tabgt;/code tag will be recognised as a tab container, and the inner one will be recognised as a toggle box or dropdown menu, as desired. The toggle box or dropdown must then also use the [[#General usage information|parser function syntax]]. + +If you want the contents of the toggle box inside the tab menu to be able to change depending on the selected tab, you should use the codenested=true/code attribute on the tag. This can be done by setting the very last argument of the code#tab:/code parser function or the code#tag:tab/code parser function to codenested=true/code. + +See this demo for an example of how to make this work: + tabs tab name=Toggle box This first tab has a toggle box nested inside it @@ -369,6 +380,9 @@ This second tab has a dropdown nested inside it {{#tag:tab|This dropdown is created via the code#tag:tab/code parser function, since it's not possible to define attributes such as codedropdown/code via the code#tab:/code parser function.|dropdown=true}} /tab +tab index=* block +{{#tag:tab|This toggle box shows up inside {{#tab:|every|each of the|nested=true}} tab{{#tag:tab|s|index=2|nested=true}}, because the containing tab tag has got its index attribute set to codeindex=*/code. It also has a codeblock/code attribute.|openname=Open|closename=Close}} +/tab /tabs = Toggle boxes in dropdowns = diff --git a/Tabs.body.php b/Tabs.body.php index 7383443..677360c 100644 --- a/Tabs.body.php +++ b/Tabs.body.php @@ -60,14 +60,15 @@ $form = $parser-tabsData['tabCount'] === 0 ? $this-insertCSSJS($parser) : ''; // init styles, set the return form tag as $form. ++$parser-tabsData['tabCount']; $names = $parser-tabsData['tabNames']; + $nestAttr = isset($attr['nested']); //adding this attribute will restrict functionality, but allow nested tabs inside toggleboxes $nested = $parser-tabsData['nested']; if (isset($attr['name'])) { $attr['name'] = trim(htmlspecialchars($attr['name'])); // making the name attr safe to use } // Default value for the tab's given index: index attribute's value, or else the index of the tab with the same name as name attribute, or else the tab index - if (!$nested) { + if (!$nested !$nestAttr) { $index = -1; // indices do nothing for non-nested tabs, so don't even bother doing the computations. - } elseif (isset($attr['index']) intval($attr['index']) = count($names)) { + } elseif (isset($attr['index']) (intval($attr['index']) = count($names) || $nestAttr)) { $index = intval($attr['index']); // if the index is given, and it isn't greater than the current index + 1. } elseif (isset($attr['index']) $attr['index'] == '*') { $index = 0; //use wildcard index: this tab's contents shows up for every single tab; @@ -79,7 +80,7 @@ } $classPrefix = ''; - if ($nested) {// Note: This is defined seperately for toggleboxes, because of the different classes required. + if ($nested || $nestAttr) {// Note: This is defined seperately for toggleboxes, because of the different classes required.
[MediaWiki-commits] [Gerrit] Add autocomplete for WhatLinksHere subpages - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Add autocomplete for WhatLinksHere subpages .. Add autocomplete for WhatLinksHere subpages Implements prefixSearchSubpages() Change-Id: I15895c0b5ae55419928d624c318a53c27cde2820 --- M includes/specials/SpecialWhatlinkshere.php 1 file changed, 18 insertions(+), 0 deletions(-) Approvals: Anomie: Looks good to me, but someone else must approve Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index 11ec363..7e7abe5 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -496,6 +496,24 @@ ); } + /** +* Return an array of subpages beginning with $search that this special page will accept. +* +* @param string $search Prefix to search for +* @param int $limit Maximum number of results to return (usually 10) +* @param int $offset Number of results to skip (usually 0) +* @return string[] Matching subpages +*/ + public function prefixSearchSubpages( $search, $limit, $offset ) { + if ( $search === '' ) { + return array(); + } + // Autocomplete subpage the same as a normal search + $prefixSearcher = new StringPrefixSearch; + $result = $prefixSearcher-search( $search, $limit, array(), $offset ); + return $result; + } + protected function getGroupName() { return 'pagetools'; } -- To view, visit https://gerrit.wikimedia.org/r/175386 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I15895c0b5ae55419928d624c318a53c27cde2820 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Anomie bjor...@wikimedia.org Gerrit-Reviewer: Bartosz Dziewoński matma@gmail.com Gerrit-Reviewer: Chad ch...@wikimedia.org Gerrit-Reviewer: Gerrit Patch Uploader gerritpatchuploa...@gmail.com Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: MZMcBride w...@mzmcbride.com Gerrit-Reviewer: Manybubbles never...@wikimedia.org Gerrit-Reviewer: PiRSquared17 pirsquare...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki.page.gallery: Support live preview - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: mediawiki.page.gallery: Support live preview .. mediawiki.page.gallery: Support live preview Change-Id: I1dbcf5e7a9dc145417e0ffee9b1a5220eb34e0bd --- M resources/src/mediawiki.page/mediawiki.page.gallery.js 1 file changed, 206 insertions(+), 202 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki.page/mediawiki.page.gallery.js b/resources/src/mediawiki.page/mediawiki.page.gallery.js index e4cd3a2..3658ed8 100644 --- a/resources/src/mediawiki.page/mediawiki.page.gallery.js +++ b/resources/src/mediawiki.page/mediawiki.page.gallery.js @@ -2,222 +2,226 @@ * Show gallery captions when focused. Copied directly from jquery.mw-jump.js. * Also Dynamically resize images to justify them. */ -( function ( $ ) { - $( function () { - var isTouchScreen, - gettingFocus, - galleries = 'ul.mw-gallery-packed-overlay, ul.mw-gallery-packed-hover, ul.mw-gallery-packed'; +( function ( mw, $ ) { + // Is there a better way to detect a touchscreen? Current check taken from stack overflow. + var isTouchScreen = !!( window.ontouchstart !== undefined || window.DocumentTouch !== undefined document instanceof window.DocumentTouch ), + $galleries = $(); - // Is there a better way to detect a touchscreen? Current check taken from stack overflow. - isTouchScreen = !!( window.ontouchstart !== undefined || window.DocumentTouch !== undefined document instanceof window.DocumentTouch ); + // Now on to justification. + function justify() { + var lastTop, + $img, + imgWidth, + imgHeight, + captionWidth, + rows = [], + $gallery = $( this ); + $gallery.children( 'li' ).each( function () { + // Math.floor to be paranoid if things are off by 0.001 + var top = Math.floor( $( this ).position().top ), + $this = $( this ); + + if ( top !== lastTop ) { + rows[rows.length] = []; + lastTop = top; + } + + $img = $this.find( 'div.thumb a.image img' ); + if ( $img.length $img[0].height ) { + imgHeight = $img[0].height; + imgWidth = $img[0].width; + } else { + // If we don't have a real image, get the containing divs width/height. + // Note that if we do have a real image, using this method will generally + // give the same answer, but can be different in the case of a very + // narrow image where extra padding is added. + imgHeight = $this.children().children( 'div:first' ).height(); + imgWidth = $this.children().children( 'div:first' ).width(); + } + + // Hack to make an edge case work ok + if ( imgHeight 30 ) { + // Don't try and resize this item. + imgHeight = 0; + } + + captionWidth = $this.children().children( 'div.gallerytextwrapper' ).width(); + rows[rows.length - 1][rows[rows.length - 1].length] = { + $elm: $this, + width: $this.outerWidth(), + imgWidth: imgWidth, + // XXX: can divide by 0 ever happen? + aspect: imgWidth / imgHeight, + captionWidth: captionWidth, + height: imgHeight + }; + + // Save all boundaries so we can restore them on window resize + $this.data( 'imgWidth', imgWidth ); + $this.data( 'imgHeight', imgHeight ); + $this.data( 'width', $this.outerWidth() ); + $this.data( 'captionWidth', captionWidth ); + } ); + + ( function () { + var maxWidth, + combinedAspect, + combinedPadding, + curRow, + curRowHeight, + wantedWidth, + preferredHeight, +
[MediaWiki-commits] [Gerrit] Remove length limit from template generation script - change (analytics/multimedia)
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/184192 Change subject: Remove length limit from template generation script .. Remove length limit from template generation script Change-Id: Ie383e4431214f8be7344f93627a72bac24282424 --- M generate.py 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/multimedia refs/changes/92/184192/1 diff --git a/generate.py b/generate.py index 9e73896..a2d5b09 100755 --- a/generate.py +++ b/generate.py @@ -60,7 +60,7 @@ sql = open( os.path.dirname(os.path.realpath(__file__)) + -'/' + folder + '/template.sql').read(1) +'/' + folder + '/template.sql').read() sql = sql.replace('%wiki%', replacement) sql = sql.replace('%wikidb%', wiki) @@ -91,3 +91,4 @@ if wiki != 'global': generate('optout', wiki) + \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/184192 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie383e4431214f8be7344f93627a72bac24282424 Gerrit-PatchSet: 1 Gerrit-Project: analytics/multimedia Gerrit-Branch: master Gerrit-Owner: Gergő Tisza gti...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move -qa announces to -releng - change (labs...grrrit)
Greg Grossmeier has uploaded a new change for review. https://gerrit.wikimedia.org/r/184197 Change subject: Move -qa announces to -releng .. Move -qa announces to -releng supersedes I60bfb8098b6c5e6dbbb6480f73d190a91090e464 Bug: T86053 Change-Id: I17363039cf738ded970231652089e0f55115 --- M config.yaml 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/grrrit refs/changes/97/184197/1 diff --git a/config.yaml b/config.yaml index 1e1d916..ecd1af8 100644 --- a/config.yaml +++ b/config.yaml @@ -107,7 +107,7 @@ wikimedia/bugzilla/modifications, wikimedia/bots/jouncebot } -#wikimedia-qa: { +#wikimedia-releng: { mediawiki/selenium, mediawiki/ruby/.*, integration/.*, -- To view, visit https://gerrit.wikimedia.org/r/184197 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I17363039cf738ded970231652089e0f55115 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/grrrit Gerrit-Branch: master Gerrit-Owner: Greg Grossmeier g...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Rename some date model keys to be clearer - change (operations...labsdb-auditor)
Merlijn van Deen has submitted this change and it was merged. Change subject: Rename some date model keys to be clearer .. Rename some date model keys to be clearer - Remove 'replacewith', since we will replace everything with only SQL 'NULL' - 'condition' in the columns becomes 'null_if' since replacewith is no longer a thing, and 'null_if' makes it clearer that we are nulling columns if this is true, rather than false. - 'where' in the table defintion becomes 'include_row_if', which makes it extremely clear what exactly it does. Change-Id: I892f0ba4e6fa2db25696f1b7922f1e7c44630466 --- M auditor/models.py M auditor/reports/viewdiffs.py M greylisted.yaml 3 files changed, 103 insertions(+), 109 deletions(-) Approvals: Merlijn van Deen: Verified; Looks good to me, approved diff --git a/auditor/models.py b/auditor/models.py index af4131c..5d5cd92 100644 --- a/auditor/models.py +++ b/auditor/models.py @@ -24,7 +24,7 @@ A column that is potentially conditionally or unconditionally nulled -def __init__(self, name, whitelisted=True, condition=None, replacewith=None): +def __init__(self, name, whitelisted=True, null_if=None): A column in a table that can be whitelisted or conditionally nulled @@ -32,23 +32,22 @@ :param name: Name of this column :param whitelisted: True if the column is whitelisted -:param condition: Conditions under which this column is replaced. - Specified as a string that is valid SQL expression -:param replacewith: What to replace the column's value with if condition is matched -If set to None with whitelisted = False, implies SQL None +:param null_if: Conditions under which this column is nulled. +Specified as a string that is valid SQL expression. +If set to None whitelisted=False, then nulled all the time + :return: self.name = name self.whitelisted = whitelisted -self.condition = condition -self.replacewith = replacewith +self.null_if = null_if class Table(object): -def __init__(self, name, columns={}, where=None, table_name=None): +def __init__(self, name, columns={}, include_row_if=None, table_name=None): self.name = name self.columns = columns -self.where = where +self.include_row_if = include_row_if self.table_name = table_name if table_name else name def add_column(self, column): @@ -60,8 +59,8 @@ Convert Table to a minimal dict from which it can be reconstituted tabledict = {} -if self.where: -tabledict['where'] = self.where +if self.include_row_if: +tabledict['include_row_if'] = self.include_row_if if all([c.whitelisted for c in self.columns.values()]): # Everything is whitelisted! tabledict['columns'] = [c.name for c in self.columns] @@ -70,10 +69,8 @@ for c in self.columns.values(): columndict = {} columndict['whitelisted'] = c.whitelisted -if c.condition: -columndict['condition'] = c.condition -if c.replacewith: -columndict['replacewith'] = c.replacewith +if c.null_if: +columndict['null_if'] = c.null_if tabledict['columns'][c.name] = columndict if self.table_name != self.name: tabledict['table_name'] = self.table_name @@ -81,7 +78,7 @@ @classmethod def from_dict(cls, tablename, tabledata): -table = cls(tablename, {}, tabledata.get('where', None), tabledata.get('table_name', None)) +table = cls(tablename, {}, tabledata.get('include_row_if', None), tabledata.get('table_name', None)) if isinstance(tabledata['columns'], list): # Whitelisted table for colname in tabledata['columns']: @@ -89,10 +86,7 @@ else: # Greylisted table! for colname, coldata in tabledata['columns'].items(): -col = Column(colname, - whitelisted=coldata.get('whitelisted'), - condition=coldata.get('condition'), - replacewith=coldata.get('replacewith')) +col = Column(colname, coldata.get('whitelisted'), coldata.get('null_if')) table.add_column(col) return table diff --git a/auditor/reports/viewdiffs.py b/auditor/reports/viewdiffs.py index e9e91d0..6bd800c 100644 --- a/auditor/reports/viewdiffs.py +++ b/auditor/reports/viewdiffs.py @@ -33,11 +33,11 @@ def diff_columns(expected, actual): -return _diff(expected, actual, ('name', 'whitelisted', 'condition', 'replacewith')) +
[MediaWiki-commits] [Gerrit] Remove hashs, pif_edits povwatch* view from whitelist - change (operations...labsdb-auditor)
Merlijn van Deen has submitted this change and it was merged. Change subject: Remove hashs, pif_edits povwatch* view from whitelist .. Remove hashs, pif_edits povwatch* view from whitelist Bug: T85867 Change-Id: I9e6e08c8e7aa5baf11981802d99c729be68dd3dd --- M whitelisted.yaml 1 file changed, 0 insertions(+), 22 deletions(-) Approvals: Merlijn van Deen: Verified; Looks good to me, approved diff --git a/whitelisted.yaml b/whitelisted.yaml index 6c2140e..1696c01 100644 --- a/whitelisted.yaml +++ b/whitelisted.yaml @@ -397,13 +397,6 @@ - gil_page - gil_page_namespace_id - gil_to -hashs: - columns: - - hs_nstitle - - hs_timestamp - - hs_user_text - - hs_hash - - hs_old_id hitcounter: columns: - hc_id @@ -551,21 +544,6 @@ - ptrt_tag_desc - ptrt_tag_id - ptrt_tag_name -pif_edits: - columns: - - pif_user - - pif_edits -povwatch_log: - columns: - - pwl_title - - pwl_comment - - pwl_timestamp - - pwl_namespace - - pwl_user - - pwl_id -povwatch_subscribers: - columns: - - pws_user protected_titles: columns: - pt_timestamp -- To view, visit https://gerrit.wikimedia.org/r/183872 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e6e08c8e7aa5baf11981802d99c729be68dd3dd Gerrit-PatchSet: 4 Gerrit-Project: operations/software/labsdb-auditor Gerrit-Branch: master Gerrit-Owner: Yuvipanda yuvipa...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add data provider to split MediaHandlerTest::testFitBoxWidth - change (mediawiki/core)
Addshore has submitted this change and it was merged. Change subject: Add data provider to split MediaHandlerTest::testFitBoxWidth .. Add data provider to split MediaHandlerTest::testFitBoxWidth Change-Id: Ie1cf501a6a0c8e688aca1a5577a293f526398dd3 --- M tests/phpunit/includes/media/MediaHandlerTest.php 1 file changed, 33 insertions(+), 35 deletions(-) Approvals: Addshore: Looks good to me, approved diff --git a/tests/phpunit/includes/media/MediaHandlerTest.php b/tests/phpunit/includes/media/MediaHandlerTest.php index d8cfcc4..5fa609a 100644 --- a/tests/phpunit/includes/media/MediaHandlerTest.php +++ b/tests/phpunit/includes/media/MediaHandlerTest.php @@ -7,50 +7,48 @@ /** * @covers MediaHandler::fitBoxWidth -* @todo split into a dataprovider and test method +* +* @dataProvider provideTestFitBoxWidth */ - public function testFitBoxWidth() { - $vals = array( - array( - 'width' = 50, - 'height' = 50, - 'tests' = array( + public function testFitBoxWidth( $width, $height, $max, $expected ) { + $y = round( $expected * $height / $width ); + $result = MediaHandler::fitBoxWidth( $width, $height, $max ); + $y2 = round( $result * $height / $width ); + $this-assertEquals( $expected, + $result, + ($width, $height, $max) wanted: {$expected}x$y, got: {z$result}x$y2 ); + } + + public function provideTestFitBoxWidth() { + return array_merge( + $this-provideTestFitBoxWidthSingle( 50, 50, array( 50 = 50, 17 = 17, - 18 = 18 ) ), - array( - 'width' = 366, - 'height' = 300, - 'tests' = array( + 18 = 18 ) + ), + $this-provideTestFitBoxWidthSingle( 366, 300, array( 50 = 61, 17 = 21, - 18 = 22 ) ), - array( - 'width' = 300, - 'height' = 366, - 'tests' = array( + 18 = 22 ) + ), + $this-provideTestFitBoxWidthSingle( 300, 366, array( 50 = 41, 17 = 14, - 18 = 15 ) ), - array( - 'width' = 100, - 'height' = 400, - 'tests' = array( + 18 = 15 ) + ), + $this-provideTestFitBoxWidthSingle( 100, 400, array( 50 = 12, 17 = 4, - 18 = 4 ) ) ); - foreach ( $vals as $row ) { - $tests = $row['tests']; - $height = $row['height']; - $width = $row['width']; - foreach ( $tests as $max = $expected ) { - $y = round( $expected * $height / $width ); - $result = MediaHandler::fitBoxWidth( $width, $height, $max ); - $y2 = round( $result * $height / $width ); - $this-assertEquals( $expected, - $result, - ($width, $height, $max) wanted: {$expected}x$y, got: {$result}x$y2 ); - } + 18 = 4 ) + ) + ); + } + + private function provideTestFitBoxWidthSingle( $width, $height, $tests ) { + $result = array(); + foreach ( $tests as $max = $expected ) { + $result[] = array( $width, $height, $max, $expected ); } + return $result; } } -- To view, visit https://gerrit.wikimedia.org/r/182470 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1cf501a6a0c8e688aca1a5577a293f526398dd3 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: M4tx m...@m4tx.pl Gerrit-Reviewer: Addshore addshorew...@gmail.com Gerrit-Reviewer: Hashar has...@free.fr
[MediaWiki-commits] [Gerrit] Add standard threshold for iNaturalist and remove hours - change (translatewiki)
jenkins-bot has submitted this change and it was merged. Change subject: Add standard threshold for iNaturalist and remove hours .. Add standard threshold for iNaturalist and remove hours Change-Id: I095d589a26bb393c65eec1fd25743576c9bdd7f6 --- M bin/repoexport 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/bin/repoexport b/bin/repoexport index 89f1f97..ccd5625 100755 --- a/bin/repoexport +++ b/bin/repoexport @@ -61,7 +61,7 @@ elif [ $PROJECT = inaturalist ] then - php $EXPORTER --target . --group=out-inaturalist --lang='*' --skip en $HOURS + php $EXPORTER --target . --group=out-inaturalist --lang='*' --skip en $THRESHOLD elif [ $PROJECT = intuition ] then -- To view, visit https://gerrit.wikimedia.org/r/184146 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I095d589a26bb393c65eec1fd25743576c9bdd7f6 Gerrit-PatchSet: 2 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: bf34ebf..a9f3abb - change (mediawiki/extensions)
Jenkins-mwext-sync has uploaded a new change for review. https://gerrit.wikimedia.org/r/184187 Change subject: Syncronize VisualEditor: bf34ebf..a9f3abb .. Syncronize VisualEditor: bf34ebf..a9f3abb Change-Id: I3f582c874a33ffb33e374048ed1186735903d461 --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions refs/changes/87/184187/1 diff --git a/VisualEditor b/VisualEditor index bf34ebf..a9f3abb 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit bf34ebf6928c1bc1f2f3043470d01afec52bd193 +Subproject commit a9f3abbead987f803174b969691732fc5b9fa9ce -- To view, visit https://gerrit.wikimedia.org/r/184187 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f582c874a33ffb33e374048ed1186735903d461 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: bf34ebf..a9f3abb - change (mediawiki/extensions)
Jenkins-mwext-sync has submitted this change and it was merged. Change subject: Syncronize VisualEditor: bf34ebf..a9f3abb .. Syncronize VisualEditor: bf34ebf..a9f3abb Change-Id: I3f582c874a33ffb33e374048ed1186735903d461 --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Jenkins-mwext-sync: Verified; Looks good to me, approved diff --git a/VisualEditor b/VisualEditor index bf34ebf..a9f3abb 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit bf34ebf6928c1bc1f2f3043470d01afec52bd193 +Subproject commit a9f3abbead987f803174b969691732fc5b9fa9ce -- To view, visit https://gerrit.wikimedia.org/r/184187 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3f582c874a33ffb33e374048ed1186735903d461 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync jenkins-...@wikimedia.org Gerrit-Reviewer: Jenkins-mwext-sync jenkins-...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add logs from 'misc' caches to kafka pipeline - change (operations/puppet)
Hello Ottomata, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/184183 to review the following change. Change subject: Add logs from 'misc' caches to kafka pipeline .. Add logs from 'misc' caches to kafka pipeline Change-Id: Ia3712a0d85ffa893912af2dff312017f03a7a935 --- M manifests/role/cache.pp 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/83/184183/1 diff --git a/manifests/role/cache.pp b/manifests/role/cache.pp index 0dd66e5..65e63db 100644 --- a/manifests/role/cache.pp +++ b/manifests/role/cache.pp @@ -1590,5 +1590,15 @@ ] }, } + +# ToDo: Remove production conditional once this works +# is verified to work in labs. +if $::realm == 'production' { +# Install a varnishkafka producer to send +# varnish webrequest logs to Kafka. +class { 'role::cache::varnish::kafka::webrequest': +topic = 'webrequest_misc', +} +} } } -- To view, visit https://gerrit.wikimedia.org/r/184183 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3712a0d85ffa893912af2dff312017f03a7a935 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: QChris christ...@quelltextlich.at Gerrit-Reviewer: Ottomata o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [IMPROV] Request all tokens at once - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: [IMPROV] Request all tokens at once .. [IMPROV] Request all tokens at once Prior to version 1.20 it wasn't requesting all tokens at once but each in a separate request. But the API actually allows to request all tokens at once. Change-Id: I91326d6a30269f617ba60d18079339832028da5b --- M pywikibot/site.py 1 file changed, 12 insertions(+), 14 deletions(-) Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/site.py b/pywikibot/site.py index c1fd08a..9e0c75a 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -2673,24 +2673,23 @@ if _version MediaWikiVersion('1.20'): if all: types.extend(self.TOKENS_0) -for tokentype in self.validate_tokens(types): -# 'patrol' token is done later on. -if tokentype == 'patrol': -continue -query = api.PropertyGenerator('info', - titles='Dummy page', - intoken=tokentype, - site=self) -query.request._warning_handler = warn_handler +valid_tokens = set(self.validate_tokens(types)) +# don't request patrol +query = api.PropertyGenerator('info', + titles='Dummy page', + intoken=valid_tokens - set(['patrol']), + site=self) +query.request._warning_handler = warn_handler -for item in query: -pywikibot.debug(unicode(item), _logger) +for item in query: +pywikibot.debug(unicode(item), _logger) +for tokentype in valid_tokens: if (tokentype + 'token') in item: user_tokens[tokentype] = item[tokentype + 'token'] # patrol token require special handling. # TODO: try to catch exceptions? -if 'patrol' in types: +if 'patrol' in valid_tokens: if MediaWikiVersion('1.14') = _version MediaWikiVersion('1.17'): user_tokens['patrol'] = user_tokens['edit'] else: @@ -2707,8 +2706,7 @@ item = data['recentchanges'][0] pywikibot.debug(unicode(item), _logger) if 'patroltoken' in item: -user_tokens['patrol'] = item.get('patroltoken') - +user_tokens['patrol'] = item['patroltoken'] else: if _version MediaWikiVersion('1.24wmf19'): if all is not False: -- To view, visit https://gerrit.wikimedia.org/r/184125 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I91326d6a30269f617ba60d18079339832028da5b Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XZise commodorefabia...@gmx.de Gerrit-Reviewer: John Vandenberg jay...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Mpaa mpaa.w...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove -qa from announce list (moved to -releng) - change (labs...wikibugs2)
jenkins-bot has submitted this change and it was merged. Change subject: Remove -qa from announce list (moved to -releng) .. Remove -qa from announce list (moved to -releng) Change-Id: Ie97fe05c96389d55222be77416bb6c33f21b711c --- M channels.yaml M test_channels_yaml.py 2 files changed, 1 insertion(+), 7 deletions(-) Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified diff --git a/channels.yaml b/channels.yaml index 213c86f..21c90dc 100644 --- a/channels.yaml +++ b/channels.yaml @@ -73,12 +73,6 @@ - Code-Review - Gitblit-Deprecate -#wikimedia-qa: -- Continuous-integration -- Quality-Assurance -- Beta-Cluster -- Release-Engineering - #wikimedia-releng: # teams - Release-Engineering diff --git a/test_channels_yaml.py b/test_channels_yaml.py index efb6450..f3a7de2 100755 --- a/test_channels_yaml.py +++ b/test_channels_yaml.py @@ -11,7 +11,7 @@ assert expected == actual, \nExpected: %s\nActual: %s % (expected, actual) assertEquals( -{'#mediawiki-feed', '#wikimedia-qa', '#wikimedia-releng'}, +{'#mediawiki-feed', '#wikimedia-releng'}, chanfilter.channels_for(['Continuous-Integration'])) assertEquals( -- To view, visit https://gerrit.wikimedia.org/r/184195 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie97fe05c96389d55222be77416bb6c33f21b711c Gerrit-PatchSet: 2 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Greg Grossmeier g...@wikimedia.org Gerrit-Reviewer: Greg Grossmeier g...@wikimedia.org Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bug54847.php: Replace removed CentralAuthUser::getPasswordHash - change (operations/mediawiki-config)
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/184135 Change subject: Bug54847.php: Replace removed CentralAuthUser::getPasswordHash .. Bug54847.php: Replace removed CentralAuthUser::getPasswordHash Needed after I642884f93673 Change-Id: I35454073a08cb46cfe37386fee491f3fdc35df69 --- M wmf-config/Bug54847.php 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/35/184135/1 diff --git a/wmf-config/Bug54847.php b/wmf-config/Bug54847.php index 6b056db..4d3aea3 100644 --- a/wmf-config/Bug54847.php +++ b/wmf-config/Bug54847.php @@ -158,9 +158,7 @@ try { if ( $isGlobal ) { $centralUser = CentralAuthUser::getInstance( $user ); - list( $salt, $crypt ) = $centralUser-getPasswordHash(); - //if ( $centralUser-matchHash( $newpassword, $salt, $crypt ) ) { - if ( User::comparePasswords( $crypt, $newpassword, $salt ) ) { + if ( $centralUser-getPasswordObject()-equals( $newpassword ) ) { wfDebugLog( Bug54847, User attempted to reset with CentralAuth password: . $user-getName() ); $errorMsg = 'password-recycled'; return false; -- To view, visit https://gerrit.wikimedia.org/r/184135 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I35454073a08cb46cfe37386fee491f3fdc35df69 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Hoo man h...@online.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused udp2log awk scripts that forwarded to universi... - change (operations/puppet)
Hello Ottomata, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/184137 to review the following change. Change subject: Remove unused udp2log awk scripts that forwarded to universities .. Remove unused udp2log awk scripts that forwarded to universities The corresponding udp2log filters have been removed in * 64848d7a3ed205e8b4b0471c82c6573231c02624 (minnesota.awk) * b70209dbce9347aeab2ce632c611cd9b0aef536c (vu.awk) Change-Id: I913af090eb8549a87b32cf21ced7a7dba5a43c1a --- D files/udp2log/minnesota.awk D files/udp2log/vu.awk M manifests/role/logging.pp 3 files changed, 2 insertions(+), 24 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/37/184137/1 diff --git a/files/udp2log/minnesota.awk b/files/udp2log/minnesota.awk deleted file mode 100644 index 4830ff6..000 --- a/files/udp2log/minnesota.awk +++ /dev/null @@ -1,3 +0,0 @@ -# University of Minnesota udp2log filter - -$5 !~ /^(145\.97\.39\.|66\.230\.200\.|211\.115\.107\.)/ {print $3, $9} \ No newline at end of file diff --git a/files/udp2log/vu.awk b/files/udp2log/vu.awk deleted file mode 100644 index 2b1d715..000 --- a/files/udp2log/vu.awk +++ /dev/null @@ -1,11 +0,0 @@ -# Vrije Universiteit udp2log filter - -function savemark(url, code) { - if (url ~ /action=submit$/ code == TCP_MISS/302) - return save - return - -} - -$5 !~ /^(145\.97\.39\.|66\.230\.200\.|211\.115\.107\.)/ { - print $3, $9, savemark($9, $6) -} diff --git a/manifests/role/logging.pp b/manifests/role/logging.pp index fa116c0..d0a5d4c 100644 --- a/manifests/role/logging.pp +++ b/manifests/role/logging.pp @@ -340,18 +340,10 @@ } file { $webrequest_filter_directory/vu.awk: -ensure = 'file', -source = 'puppet:///files/udp2log/vu.awk', -mode = 0755, -owner = 'udp2log', -group = 'udp2log', +ensure = absent, } file { $webrequest_filter_directory/minnesota.awk: -ensure = 'file', -source = 'puppet:///files/udp2log/minnesota.awk', -mode = 0755, -owner = 'udp2log', -group = 'udp2log', +ensure = absent, } # oxygen run webstatscollector's filter process, -- To view, visit https://gerrit.wikimedia.org/r/184137 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I913af090eb8549a87b32cf21ced7a7dba5a43c1a Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: QChris christ...@quelltextlich.at Gerrit-Reviewer: Ottomata o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix jslint errors. - change (mediawiki...Tabs)
jenkins-bot has submitted this change and it was merged. Change subject: Fix jslint errors. .. Fix jslint errors. On the previous commit, jslint didn't mention these errors until jenkins-bot decided to merge it, so this will have to be a seperate commit. See https://integration.wikimedia.org/ci/job/mwext-Tabs-jslint/3/console Change-Id: Ic437dfdb79fea6f983531914951b875929723385 --- M ext.tabs.js 1 file changed, 35 insertions(+), 24 deletions(-) Approvals: Joeytje50: Looks good to me, approved jenkins-bot: Verified diff --git a/ext.tabs.js b/ext.tabs.js index 5ed0c87..3e71a30 100644 --- a/ext.tabs.js +++ b/ext.tabs.js @@ -1,7 +1,29 @@ -$(function() { +jQuery(function($) { + /** +* Imitates the normal feature in browsers to scroll to an id that has the same id as the url fragment/hash. +* This makes it unnecessary to use actual ids on the tabs, which could cause the same id to occur twice in the same document. +* Does not scroll to exactly the tab's height, but just a bit above it. +*/ + function moveToHash() { + var hash = location.hash.substr(1).replace(/_/g,' ').trim(); + if (!hash || $(location.hash).length) { + return; // if there's no hash defined, or an element on the page with the same hash already, stop looking for tabs + } + $('.tabs-tabbox .tabs-label:contains('+hash+')').each(function() { + // double-check if the hash is indeed exactly the same as the label. + // Does not match if hash is only a part of the label's contents, unlike jQuery's :contains() selector + if (this.innerHTML.trim() !== hash) { + return true; // continue the $.each() function + } + this.click(); // open the selected tab by default. + document.documentElement.scrollTop = this.offsetTop; + return false; // stop the $.each() function after the first match. + }); + } + // Credit for this testing method: 2astalavista @ http://stackoverflow.com/a/21095568/1256925 // The font will be sans-serif if the :not() property is supported. The margin will be 1px if the sibling selector is supported. - if ($('#tabs-inputform').css('font-family').replace(/[']/g,'') == 'sans-serif' $('#tabs-inputform').css('margin') == '1px') { + if ($('#tabs-inputform').css('font-family').replace(/[']/g,'') === 'sans-serif' $('#tabs-inputform').css('margin') === '1px') { $(function() { $('body').addClass('tabs-oldbrowserscript'); // Make the unselected tabs hide when the browser loads this script $('.tabs-label').click(function(e) { @@ -9,9 +31,13 @@ return false; }); $('.tabs-input').each(function() { - if (this.checked) $(this).addClass('checked'); // Adds checked class to each checked box + if (this.checked) { + $(this).addClass('checked'); // Adds checked class to each checked box + } }).change(function() { - if (!this.checked) return $(this).removeClass('checked'); // for toggleboxes + if (!this.checked) { + return $(this).removeClass('checked'); // for toggleboxes + } $(this).siblings('.checked').removeClass('checked'); // Uncheck all currently checked siblings $(this).addClass('checked'); // and do check this box $(this).parents('.tabs').toggleClass('tabs').toggleClass('tabs'); // remove and readd class to recalculate styles for its children. @@ -22,23 +48,6 @@ } else { $(moveToHash); } - /** -* Imitates the normal feature in browsers to scroll to an id that has the same id as the url fragment/hash. -* This makes it unnecessary to use actual ids on the tabs, which could cause the same id to occur twice in the same document. -* Does not scroll to exactly the tab's height, but just a bit above it. -*/ - function moveToHash() { - var hash = location.hash.substr(1).replace(/_/g,' ').trim(); - if (!hash || $(location.hash).length) return; // if there's no hash defined, or an element on the page with the same hash already, stop looking for tabs - $('.tabs-tabbox .tabs-label:contains('+hash+')').each(function() { - // double-check if the hash is indeed
[MediaWiki-commits] [Gerrit] Bug54847.php: Replace removed CentralAuthUser::getPasswordHash - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Bug54847.php: Replace removed CentralAuthUser::getPasswordHash .. Bug54847.php: Replace removed CentralAuthUser::getPasswordHash Needed after I642884f93673 Change-Id: I35454073a08cb46cfe37386fee491f3fdc35df69 --- M wmf-config/Bug54847.php 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: Hoo man: Looks good to me, approved Reedy: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/wmf-config/Bug54847.php b/wmf-config/Bug54847.php index 6b056db..4d3aea3 100644 --- a/wmf-config/Bug54847.php +++ b/wmf-config/Bug54847.php @@ -158,9 +158,7 @@ try { if ( $isGlobal ) { $centralUser = CentralAuthUser::getInstance( $user ); - list( $salt, $crypt ) = $centralUser-getPasswordHash(); - //if ( $centralUser-matchHash( $newpassword, $salt, $crypt ) ) { - if ( User::comparePasswords( $crypt, $newpassword, $salt ) ) { + if ( $centralUser-getPasswordObject()-equals( $newpassword ) ) { wfDebugLog( Bug54847, User attempted to reset with CentralAuth password: . $user-getName() ); $errorMsg = 'password-recycled'; return false; -- To view, visit https://gerrit.wikimedia.org/r/184135 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I35454073a08cb46cfe37386fee491f3fdc35df69 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Hoo man h...@online.de Gerrit-Reviewer: CSteipp cste...@wikimedia.org Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Reedy re...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] MediaWiki Theme: Adjust toolbar popups' border and shadows - change (oojs/ui)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/184194 Change subject: MediaWiki Theme: Adjust toolbar popups' border and shadows .. MediaWiki Theme: Adjust toolbar popups' border and shadows * Shadow colors per the mockup at T78083. * Border radius of 0.2em to match windows and popup widgets. Bug: T78083 Bug: T85973 Change-Id: I57182e6c6d36dae7ad2570148c0d663cc7ec3dda --- M src/themes/mediawiki/tools.less 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/94/184194/1 diff --git a/src/themes/mediawiki/tools.less b/src/themes/mediawiki/tools.less index 6f76a5d..6f09c3e 100644 --- a/src/themes/mediawiki/tools.less +++ b/src/themes/mediawiki/tools.less @@ -208,7 +208,8 @@ .oo-ui-toolGroup-tools { padding: 0.25em 0 0.25em 0; border: 1px solid #aaa; - box-shadow: inset 0 -0.2em 0 0 rgba(0,0,0,0.2), 0 0.1em 0 0 rgba(0,0,0,0.2); + border-radius: 0.2em; + box-shadow: inset 0 -0.2em 0 0 rgba(0,0,0,0.2), 0 0.1em 0 0 rgba(0,0,0,0.1); } } @@ -224,7 +225,8 @@ margin-left: -1px; padding: 0.25em 0 0.25em 0; border: 1px solid #aaa; - box-shadow: inset 0 -0.2em 0 0 rgba(0,0,0,0.2), 0 0.1em 0 0 rgba(0,0,0,0.2); + border-radius: 0.2em; + box-shadow: inset 0 -0.2em 0 0 rgba(0,0,0,0.2), 0 0.1em 0 0 rgba(0,0,0,0.1); } .oo-ui-widget-enabled { -- To view, visit https://gerrit.wikimedia.org/r/184194 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I57182e6c6d36dae7ad2570148c0d663cc7ec3dda Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński matma@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove length limit from template generation script - change (analytics/multimedia)
jenkins-bot has submitted this change and it was merged. Change subject: Remove length limit from template generation script .. Remove length limit from template generation script Change-Id: Ie383e4431214f8be7344f93627a72bac24282424 --- M generate.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/generate.py b/generate.py index 9e73896..73d9a1e 100755 --- a/generate.py +++ b/generate.py @@ -60,7 +60,7 @@ sql = open( os.path.dirname(os.path.realpath(__file__)) + -'/' + folder + '/template.sql').read(1) +'/' + folder + '/template.sql').read() sql = sql.replace('%wiki%', replacement) sql = sql.replace('%wikidb%', wiki) -- To view, visit https://gerrit.wikimedia.org/r/184192 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie383e4431214f8be7344f93627a72bac24282424 Gerrit-PatchSet: 2 Gerrit-Project: analytics/multimedia Gerrit-Branch: master Gerrit-Owner: Gergő Tisza gti...@wikimedia.org Gerrit-Reviewer: Gergő Tisza gti...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Report progress while populating entity_usage table - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Report progress while populating entity_usage table .. Report progress while populating entity_usage table Change-Id: Idbfc50c6cd8b0f37d71b35ee1893d6bb764536eb --- M client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: JanZerebecki: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php b/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php index b0b7910..987847b 100644 --- a/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php +++ b/client/includes/Usage/Sql/SqlUsageTrackerSchemaUpdater.php @@ -4,6 +4,7 @@ use DatabaseUpdater; use Wikibase\Client\WikibaseClient; +use Wikibase\Lib\Reporting\ObservableMessageReporter; /** * Schema updater for SqlUsageTracker @@ -80,6 +81,12 @@ 1000 ); + $reporter = new ObservableMessageReporter(); + $reporter-registerReporterCallback( function( $msg ) use ( $dbUpdater ) { + $dbUpdater-output( \t$msg\n ); + } ); + $primer-setProgressReporter( $reporter ); + $primer-fillUsageTable(); } -- To view, visit https://gerrit.wikimedia.org/r/183836 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idbfc50c6cd8b0f37d71b35ee1893d6bb764536eb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de Gerrit-Reviewer: Adrian Lang adrian.he...@wikimedia.de Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: JanZerebecki jan.wikime...@zerebecki.de Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] TOC: Trigger the loadmore check after each load - change (mediawiki...Flow)
jenkins-bot has submitted this change and it was merged. Change subject: TOC: Trigger the loadmore check after each load .. TOC: Trigger the loadmore check after each load The loadmore code was attempting to trigger the scroll.flow event, but under some circumstances was triggering it against an unparented target. Our actual handler is not the target but an element in the bubble path, so the unparented event did not trigger the right code. This removes the unnecessary check in flow-board-loadmore.js, and adjusts to trigger the 'scroll.flow' event on the correct elements. Change-Id: I8ecb1c417e6a378aeb582002e669ec288cc8d076 --- M modules/engine/components/board/features/flow-board-loadmore.js M modules/engine/components/board/features/flow-board-toc.js 2 files changed, 1 insertion(+), 8 deletions(-) Approvals: Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/engine/components/board/features/flow-board-loadmore.js b/modules/engine/components/board/features/flow-board-loadmore.js index eb219fd..2f1e040 100644 --- a/modules/engine/components/board/features/flow-board-loadmore.js +++ b/modules/engine/components/board/features/flow-board-loadmore.js @@ -345,13 +345,6 @@ $target.on( 'scroll.flow', $.throttle( 50, function () { _flowBoardComponentLoadMoreFeatureInfiniteScrollCheck.call( board, $scrollContainer, $target ); } ) ); - - // Auto-trigger to keep loading if the new button is already in the viewport - if ( $button.is( ':visible' ) ) { - setTimeout( function () { - $button.parents().trigger( 'scroll.flow' ); - }, 100 ); - } } } FlowBoardComponentLoadMoreFeatureMixin.UI.events.loadHandlers.loadMore = flowBoardComponentLoadMoreFeatureElementLoadCallback; diff --git a/modules/engine/components/board/features/flow-board-toc.js b/modules/engine/components/board/features/flow-board-toc.js index 4508944..74b7fbf 100644 --- a/modules/engine/components/board/features/flow-board-toc.js +++ b/modules/engine/components/board/features/flow-board-toc.js @@ -220,7 +220,7 @@ } // Triggers load more if we didn't load enough content to fill the viewport - info.$target.trigger( 'scroll.flow' ); + $kids.trigger( 'scroll.flow' ); } FlowBoardComponentTocFeatureMixin.UI.events.apiHandlers.topicList = flowBoardComponentTocFeatureMixinTopicListApiHandler; -- To view, visit https://gerrit.wikimedia.org/r/180115 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ecb1c417e6a378aeb582002e669ec288cc8d076 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: EBernhardson ebernhard...@wikimedia.org Gerrit-Reviewer: EBernhardson ebernhard...@wikimedia.org Gerrit-Reviewer: Mattflaschen mflasc...@wikimedia.org Gerrit-Reviewer: SG shah...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] WM-Bot - #wm-bot - change (labs...wikibugs2)
jenkins-bot has submitted this change and it was merged. Change subject: WM-Bot - #wm-bot .. WM-Bot - #wm-bot Change-Id: I483924856ee573c597bca0e8f9863c732b6f8308 --- M channels.yaml 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Merlijn van Deen: Looks good to me, approved Technical 13: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/channels.yaml b/channels.yaml index 21c90dc..a2e3a4f 100644 --- a/channels.yaml +++ b/channels.yaml @@ -14,6 +14,9 @@ #lambda x: x.get(X-Bugzilla-Product, None) == Pywikibot, - Pywikibot(-.*)? +#wm-bot: +- WM-Bot + #wikidata: - Wikidata # x.get(X-Bugzilla-Product, None) in [MediaWiki extensions] and -- To view, visit https://gerrit.wikimedia.org/r/184201 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I483924856ee573c597bca0e8f9863c732b6f8308 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl Gerrit-Reviewer: Technical 13 technical...@yahoo.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use better Title::inNamespaces() instead - change (mediawiki...BlueSky)
Llbraughler has uploaded a new change for review. https://gerrit.wikimedia.org/r/184206 Change subject: Use better Title::inNamespaces() instead .. Use better Title::inNamespaces() instead Change-Id: I477b5931db770ece0da25aeebbb0d5de6b6130bf --- M BlueSky.skin.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSky refs/changes/06/184206/1 diff --git a/BlueSky.skin.php b/BlueSky.skin.php index 60ad907..3343124 100755 --- a/BlueSky.skin.php +++ b/BlueSky.skin.php @@ -2090,7 +2090,7 @@ /div!--end #side_rc_widget-- ?php endif; ? - ?php if ( ( $title-getNamespace() == NS_MAIN || $title-getNamespace() == NS_USER ) !$isDocViewer ) { ? + ?php if ( $title-inNamespaces( NS_MAIN, NS_USER ) !$isDocViewer ) { ? div id=side_featured_contributor class=sidebox ?php $this-showFeaturedContributorWidget(); ? ?php if ( !$isLoggedIn ) { ? -- To view, visit https://gerrit.wikimedia.org/r/184206 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I477b5931db770ece0da25aeebbb0d5de6b6130bf Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/BlueSky Gerrit-Branch: master Gerrit-Owner: Llbraughler llbraugh...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] registration: Add ConfigRegistry to the extension.json schema - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/184207 Change subject: registration: Add ConfigRegistry to the extension.json schema .. registration: Add ConfigRegistry to the extension.json schema Change-Id: I6918215e3b5b2dd4c993d8a8767dc3ce998bd5ed --- M docs/extension.schema.json M includes/registration/ExtensionProcessor.php 2 files changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/07/184207/1 diff --git a/docs/extension.schema.json b/docs/extension.schema.json index 4b29872..46f8623 100644 --- a/docs/extension.schema.json +++ b/docs/extension.schema.json @@ -420,6 +420,10 @@ type: object, description: ResourceLoader import paths }, + ConfigRegistry: { + type: object, + description: Registry of factory functions to create Config objects + }, namespaces: { type: object, description: Method to add extra namespaces, diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php index 459d95b..45bea64 100644 --- a/includes/registration/ExtensionProcessor.php +++ b/includes/registration/ExtensionProcessor.php @@ -23,6 +23,7 @@ 'RemoveGroups', 'AvailableRights', 'ContentHandlers', + 'ConfigRegistry', 'RateLimits', 'ParserTestFiles', 'RecentChangesFlags', -- To view, visit https://gerrit.wikimedia.org/r/184207 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6918215e3b5b2dd4c993d8a8767dc3ce998bd5ed Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Handle more cases in convertExtensionToRegistration.php - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/184208 Change subject: Handle more cases in convertExtensionToRegistration.php .. Handle more cases in convertExtensionToRegistration.php * Handle constructs like $wgResourceModules += array(...) * Support $wgMessagesDirs['FooBar'] = array(...) * Handle stripping paths where it is the current directory * Use FormatJson::ALL_OK when writing the file Bug: T86311 Change-Id: I9434f6634fd6e460a5c2f6dac95c9065da35a51a --- M maintenance/convertExtensionToRegistration.php 1 file changed, 32 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/08/184208/1 diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index cbdc1ba..75500c2 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -5,7 +5,7 @@ class ConvertExtensionToRegistration extends Maintenance { protected $custom = array( - 'MessagesDirs' = 'removeAbsolutePath', + 'MessagesDirs' = 'handleMessagesDirs', 'ExtensionMessagesFiles' = 'removeAbsolutePath', 'AutoloadClasses' = 'removeAbsolutePath', 'ExtensionCredits' = 'handleCredits', @@ -21,18 +21,33 @@ $this-mDescription = 'Converts extension entry points to the new JSON registration format'; } + protected function getAllGlobals() { + $processor = new ReflectionClass( 'ExtensionProcessor' ); + $settings = $processor-getProperty( 'globalSettings' ); + $settings-setAccessible( true ); + return $settings-getValue(); + } + public function execute() { + // Extensions will do stuff like $wgResourceModules += array(...) which is a + // fatal unless an array is already set. So set an empty value. + foreach ( array_merge( $this-getAllGlobals(), array_keys( $this-custom ) ) as $var ) { + $var = 'wg' . $var; + $$var = array(); + } + unset( $var ); require $this-getArg( 0 ); // Try not to create any local variables before this line $vars = get_defined_vars(); unset( $vars['this'] ); $this-dir = dirname( realpath( $this-getArg( 0 ) ) ); $this-json = array(); - $processor = new ReflectionClass( 'ExtensionProcessor' ); - $settings = $processor-getProperty( 'globalSettings' ); - $settings-setAccessible( true ); - $globalSettings = $settings-getValue(); + $globalSettings = $this-getAllGlobals(); foreach ( $vars as $name = $value ) { + // If an empty array, assume it's the default we set, so skip it + if ( is_array( $value ) count( $value ) === 0 ) { + continue; + } $realName = substr( $name, 2 ); // Strip 'wg' if ( isset( $this-custom[$realName] ) ) { call_user_func_array( array( $this, $this-custom[$realName] ), array( $realName, $value ) ); @@ -45,7 +60,7 @@ } $fname = {$this-dir}/extension.json; - $prettyJSON = FormatJson::encode( $this-json, \t ); + $prettyJSON = FormatJson::encode( $this-json, \t, FormatJson::ALL_OK ); file_put_contents( $fname, $prettyJSON . \n ); $this-output( Wrote output to $fname.\n ); } @@ -60,8 +75,18 @@ $this-json[$realName] = $value; } + protected function handleMessagesDirs( $realName, $value ) { + foreach ( $value as $key = $dirs ) { + foreach ( (array)$dirs as $dir ) { + $this-json[$realName][$key][] = $this-stripPath( $dir, $this-dir ); + } + } + } + private function stripPath( $val, $dir ) { - if ( strpos( $val, $dir ) === 0 ) { + if ( $val === $dir ) { + $val = ''; + } elseif ( strpos( $val, $dir ) === 0 ) { // +1 is for the trailing / that won't be in $this-dir $val = substr( $val, strlen( $dir ) + 1 ); } -- To view, visit https://gerrit.wikimedia.org/r/184208 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9434f6634fd6e460a5c2f6dac95c9065da35a51a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
[MediaWiki-commits] [Gerrit] MediaWiki Theme: Don't use 'box-shadow' to produce thin grey... - change (oojs/ui)
Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/184198 Change subject: MediaWiki Theme: Don't use 'box-shadow' to produce thin grey lines in dialogs .. MediaWiki Theme: Don't use 'box-shadow' to produce thin grey lines in dialogs At least the Blink rendering engine is wonky and the shadows sometimes become invisible. Using 'outline' instead, as it doesn't seem to have these problems and is functionally identical otherwise. Bug: T85226 Change-Id: I0451ad0736a1e84404cd566157c14e5f2a3b9a4b --- M src/themes/mediawiki/windows.less 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/98/184198/1 diff --git a/src/themes/mediawiki/windows.less b/src/themes/mediawiki/windows.less index 8e2742c..9bf8ee2 100644 --- a/src/themes/mediawiki/windows.less +++ b/src/themes/mediawiki/windows.less @@ -11,7 +11,7 @@ .theme-oo-ui-dialog () { -content .oo-ui-window-body { - box-shadow: 0 0 1px 0 #aaa; + outline: 1px solid #aaa; } } @@ -130,7 +130,7 @@ .oo-ui-window-body { top: 3.4em; - box-shadow: 0 0 0 1px rgba(0,0,0,0.2); + outline: 1px solid rgba(0,0,0,0.2); } } -- To view, visit https://gerrit.wikimedia.org/r/184198 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0451ad0736a1e84404cd566157c14e5f2a3b9a4b Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński matma@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] WM-Bot - #wm-bot - change (labs...wikibugs2)
Merlijn van Deen has uploaded a new change for review. https://gerrit.wikimedia.org/r/184201 Change subject: WM-Bot - #wm-bot .. WM-Bot - #wm-bot Change-Id: I483924856ee573c597bca0e8f9863c732b6f8308 --- M channels.yaml 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 refs/changes/01/184201/1 diff --git a/channels.yaml b/channels.yaml index 21c90dc..a2e3a4f 100644 --- a/channels.yaml +++ b/channels.yaml @@ -14,6 +14,9 @@ #lambda x: x.get(X-Bugzilla-Product, None) == Pywikibot, - Pywikibot(-.*)? +#wm-bot: +- WM-Bot + #wikidata: - Wikidata # x.get(X-Bugzilla-Product, None) in [MediaWiki extensions] and -- To view, visit https://gerrit.wikimedia.org/r/184201 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I483924856ee573c597bca0e8f9863c732b6f8308 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] demo: Switch the default theme from 'Apex' to 'MediaWiki' - change (oojs/ui)
Ricordisamoa has uploaded a new change for review. https://gerrit.wikimedia.org/r/184204 Change subject: demo: Switch the default theme from 'Apex' to 'MediaWiki' .. demo: Switch the default theme from 'Apex' to 'MediaWiki' It is going to be the choice for UI Standardization; MediaWiki core already uses it (T78054). Change-Id: I0242c4a7ed912f6416ffded9ebc385868b3e2f60 --- M demos/demo.js 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/04/184204/1 diff --git a/demos/demo.js b/demos/demo.js index 6c9ddfd..194dc5e 100644 --- a/demos/demo.js +++ b/demos/demo.js @@ -29,8 +29,8 @@ } ); this.pageMenu = this.pageDropdown.getMenu(); this.themeSelect = new OO.ui.ButtonSelectWidget( { $: this.$ } ).addItems( [ - new OO.ui.ButtonOptionWidget( { $: this.$, data: 'apex', label: 'Apex' } ), - new OO.ui.ButtonOptionWidget( { $: this.$, data: 'mediawiki', label: 'MediaWiki' } ) + new OO.ui.ButtonOptionWidget( { $: this.$, data: 'mediawiki', label: 'MediaWiki' } ), + new OO.ui.ButtonOptionWidget( { $: this.$, data: 'apex', label: 'Apex' } ) ] ); this.graphicsSelect = new OO.ui.ButtonSelectWidget( { $: this.$ } ).addItems( [ new OO.ui.ButtonOptionWidget( { $: this.$, data: 'vector', label: 'Vector' } ), @@ -96,13 +96,13 @@ * @property {Object.string,Object} */ OO.ui.Demo.static.themes = { - apex: { - fileSuffix: '-apex', - theme: OO.ui.ApexTheme || OO.ui.Theme - }, mediawiki: { fileSuffix: '-mediawiki', theme: OO.ui.MediaWikiTheme || OO.ui.Theme + }, + apex: { + fileSuffix: '-apex', + theme: OO.ui.ApexTheme || OO.ui.Theme } }; @@ -152,7 +152,7 @@ * @static * @property {string} */ -OO.ui.Demo.static.defaultTheme = 'apex'; +OO.ui.Demo.static.defaultTheme = 'mediawiki'; /** * Default page. -- To view, visit https://gerrit.wikimedia.org/r/184204 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0242c4a7ed912f6416ffded9ebc385868b3e2f60 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Ricordisamoa ricordisa...@openmailbox.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Different filenames and descriptions support for Uploadbot - change (pywikibot/core)
Murfel has uploaded a new change for review. https://gerrit.wikimedia.org/r/184209 Change subject: Different filenames and descriptions support for Uploadbot .. Different filenames and descriptions support for Uploadbot Parameter url may be a two-dimensional list with path, filename and description for each file. It is not available from command line (yet?). Bug: T86300 Change-Id: I6609af1c9b2119cbd76ff6045a207f84284ebeeb --- M scripts/upload.py M tests/uploadbot_tests.py 2 files changed, 90 insertions(+), 49 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/09/184209/1 diff --git a/scripts/upload.py b/scripts/upload.py index e3daa44..fbc2ed3 100755 --- a/scripts/upload.py +++ b/scripts/upload.py @@ -74,7 +74,9 @@ Constructor. @param url: path to url or local file (deprecated), or list of urls or -paths to local files. +paths to local files, or list of lists of form of [url, filename, +description] where filename and description are either strings or +None. @type url: string (deprecated) or list @param description: Description of file for its page. If multiple files are uploading the same description is used for every file. @@ -195,29 +197,42 @@ return tempname def process_filename(self, file_url=None): -Return base filename portion of file_url. +Return base filename portion of file_url or file_url[0]. if not file_url: file_url = self.url -pywikibot.warning(file_url is not given. - Set to self.url by default.) +pywikibot.warning( +file_url is not given. Set to +[self.url, None, self.description] by default.) + +return_filename = False +if isinstance(file_url, basestring): +return_filename = True +file_url = [file_url, None] +if self.description: +file_url.append(self.description) +else: +file_url.append(None) # Isolate the pure name -filename = file_url +filename = file_url[0] # Filename may be either a URL or a local file path if :// in filename: # extract the path portion of the URL filename = urlparse(filename).path filename = os.path.basename(filename) + +if not file_url[1]: +file_url[1] = filename if self.useFilename: -filename = self.useFilename +file_url[1] = self.useFilename if not self.keepFilename: pywikibot.output( -uThe filename on the target wiki will default to: %s -% filename) +uThefile_url[1]on the target wiki will default to: %s +% file_url[1]) newfn = pywikibot.input( u'Enter a better name, or press enter to accept:') if newfn != : -filename = newfn +file_url[1] = newfn # FIXME: these 2 belong somewhere else, presumably in family # forbidden characters are handled by pywikibot/page.py forbidden = ':*?/\\' # to be extended @@ -228,13 +243,13 @@ first_check = True while True: if not first_check: -filename = pywikibot.input(u'Enter a better name, ' - 'or press enter to skip:') -if not filename: +file_url[1] = pywikibot.input(u'Enter a better name, ' + 'or press enter to skip:') +if notfile_url[1]: return None first_check = False ext = os.path.splitext(filename)[1].lower().strip('.') -# are any chars in forbidden also in filename? +# are any chars in forbidden also infile_url[1]? invalid = set(forbidden) set(filename) if invalid: c = .join(invalid) @@ -247,42 +262,41 @@ % (u' '.join(allowed_formats), ext), default=False, automatic_quit=False): continue -potential_file_page = pywikibot.FilePage(self.targetSite, filename) +potential_file_page = pywikibot.FilePage(self.targetSite, file_url[1]) if potential_file_page.exists(): if potential_file_page.canBeEdited(): if pywikibot.input_yn(uFile with name %s already exists. Would you like to change the name? (Otherwise file will be overwritten.) - % filename, default=True, + % file_url[1],
[MediaWiki-commits] [Gerrit] Move notices to -releng from -qa - change (operations/puppet)
Greg Grossmeier has uploaded a new change for review. https://gerrit.wikimedia.org/r/184199 Change subject: Move notices to -releng from -qa .. Move notices to -releng from -qa Also general s/qa/releng/, which I hope was done correctly. Bug: T86053 Change-Id: I094610fb1c6dbde83c62d4a03fb1baab8c30d2ca --- M files/logstash/filter-irc-banglog.conf M manifests/role/logstash.pp M modules/icinga/files/contactgroups.cfg M modules/icinga/manifests/ircbot.pp M modules/nagios_common/templates/notification_commands.cfg.erb M modules/shinken/files/contactgroups.cfg M modules/shinken/files/contacts.cfg M modules/shinken/manifests/ircbot.pp 8 files changed, 16 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/99/184199/1 diff --git a/files/logstash/filter-irc-banglog.conf b/files/logstash/filter-irc-banglog.conf index cfa2315..44cfb5c 100644 --- a/files/logstash/filter-irc-banglog.conf +++ b/files/logstash/filter-irc-banglog.conf @@ -11,7 +11,7 @@ } } -if [channel] == #wikimedia-qa or [channel] == #wikimedia-releng { +if [channel] == #wikimedia-releng { mutate { add_field = [ project, qa ] } diff --git a/manifests/role/logstash.pp b/manifests/role/logstash.pp index 2c3c949..a1eebe7 100644 --- a/manifests/role/logstash.pp +++ b/manifests/role/logstash.pp @@ -133,7 +133,7 @@ logstash::input::irc { 'freenode': user = $irc_name, nick = $irc_name, -channels = ['#wikimedia-labs', '#wikimedia-qa', '#wikimedia-releng'], +channels = ['#wikimedia-labs', '#wikimedia-releng'], } logstash::input::tcp { 'tcp_json': diff --git a/modules/icinga/files/contactgroups.cfg b/modules/icinga/files/contactgroups.cfg index bc1dde6..efee916 100644 --- a/modules/icinga/files/contactgroups.cfg +++ b/modules/icinga/files/contactgroups.cfg @@ -36,7 +36,7 @@ define contactgroup { contactgroup_name contint -members krinkle,amusso,irc-qa,irc +members krinkle,amusso,irc-releng,irc } define contactgroup { diff --git a/modules/icinga/manifests/ircbot.pp b/modules/icinga/manifests/ircbot.pp index 9b61202..57062ce 100644 --- a/modules/icinga/manifests/ircbot.pp +++ b/modules/icinga/manifests/ircbot.pp @@ -6,10 +6,7 @@ $ircecho_logs = { '/var/log/icinga/irc.log' = '#wikimedia-operations', '/var/log/icinga/irc-wikidata.log' = '#wikidata', -'/var/log/icinga/irc-qa.log' = [ -'#wikimedia-qa', -'#wikimedia-releng', -], +'/var/log/icinga/irc-releng.log' = '#wikimedia-releng', '/var/log/icinga/irc-labs.log' = '#wikimedia-labs', } $ircecho_nick = 'icinga-wm' diff --git a/modules/nagios_common/templates/notification_commands.cfg.erb b/modules/nagios_common/templates/notification_commands.cfg.erb index 3854ddd..c7c52af 100644 --- a/modules/nagios_common/templates/notification_commands.cfg.erb +++ b/modules/nagios_common/templates/notification_commands.cfg.erb @@ -80,15 +80,15 @@ command_lineecho $NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ %= @irc_dir_path %/irc-wikidata.log } -# IRC output for QA team +# IRC output for RelEng team define command{ - command_namenotify-host-by-irc-qa - command_lineecho $NOTIFICATIONTYPE$ - Host $HOSTALIAS$ is $HOSTSTATE$: $HOSTOUTPUT$ $HOSTACKAUTHOR$ $HOSTACKCOMMENT$ %= @irc_dir_path %/irc-qa.log + command_namenotify-host-by-irc-releng + command_lineecho $NOTIFICATIONTYPE$ - Host $HOSTALIAS$ is $HOSTSTATE$: $HOSTOUTPUT$ $HOSTACKAUTHOR$ $HOSTACKCOMMENT$ %= @irc_dir_path %/irc-releng.log } define command{ - command_namenotify-service-by-irc-qa - command_lineecho $NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ %= @irc_dir_path %/irc-qa.log + command_namenotify-service-by-irc-releng + command_lineecho $NOTIFICATIONTYPE$ - $SERVICEDESC$ on $HOSTNAME$ is $SERVICESTATE$: $SERVICEOUTPUT$ $SERVICEACKAUTHOR$ $SERVICEACKCOMMENT$ %= @irc_dir_path %/irc-releng.log } # IRC output for (tool)labs diff --git a/modules/shinken/files/contactgroups.cfg b/modules/shinken/files/contactgroups.cfg index 3e3ee91..f7afe89 100644 --- a/modules/shinken/files/contactgroups.cfg +++ b/modules/shinken/files/contactgroups.cfg @@ -16,7 +16,7 @@ define contactgroup { contactgroup_name deployment-prep alias Beta Cluster Administrators -members guest,yuvipanda,greg_g,cmcmahon,amusso,twentyafterfour,betacluster-alerts-list,irc-qa,kart_ +members
[MediaWiki-commits] [Gerrit] Fix scrolling in Chrome, add scroll documentation - change (mediawiki...Tabs)
jenkins-bot has submitted this change and it was merged. Change subject: Fix scrolling in Chrome, add scroll documentation .. Fix scrolling in Chrome, add scroll documentation Scrolling/hotlinking tabs didn't work in Chrome; fixed that also added documentation about the hotlinking of tabs to README. Change-Id: I21018afe9351a073f04f99477ed49f7f13fc32d0 --- M README.md M Tabs.php M ext.tabs.js 3 files changed, 8 insertions(+), 3 deletions(-) Approvals: Joeytje50: Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index d895546..b188a4a 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,10 @@ |style=color:{{#if:{{{1|}}}|green|red}} }} /pre + Hotlinking tabs + +It is possible to hotlink tabs the same way as hotlinking sections on pages. Simply put the tab label in the URL, and the page will automatically scroll to the top of the tab, and open the selected tab. This will always open only the very first tab that has the specified tab label (for example, if there are two tab boxes that both have a tab labelled Tab 1, putting code#Tab_1/code in the URL will scroll to the first one on the page). If there is already another element on the page that could be scrolled to, such as a page section, that other element will have priority, and the tab will not be focused. + === Toggle box === Documentation @@ -365,7 +369,7 @@ If you want to place a toggle box or dropdown menu inside a tab menu, you can simply place a codelt;tabgt;/code tag inside the codelt;tabgt;/code tag that functions as a tab. This will restrict toggle boxes and dropdowns to visibility in just one tab though. So, if you want to have a toggle box or dropdown that's visible in every tab, encase it in a codelt;tabgt;/code tag with an codeindex=*/code set to it. -That way, the outer codelt;tabgt;/code tag will be recognised as a tab container, and the inner one will be recognised as a toggle box or dropdown menu, as desired. The toggle box or dropdown must then also use the [[#General usage information|parser function syntax]]. +That way, the outer codelt;tabgt;/code tag will be recognised as a tab container, and the inner one will be recognised as a toggle box or dropdown menu, as desired. The toggle box or dropdown must then also use the [[#Nested combinations|parser function syntax]]. If you want the contents of the toggle box inside the tab menu to be able to change depending on the selected tab, you should use the codenested=true/code attribute on the tag. This can be done by setting the very last argument of the code#tab:/code parser function or the code#tag:tab/code parser function to codenested=true/code. diff --git a/Tabs.php b/Tabs.php index f33b2fe..50cc9de 100644 --- a/Tabs.php +++ b/Tabs.php @@ -30,7 +30,7 @@ 'author' = 'Joeytje50', 'url'= 'https://www.mediawiki.org/wiki/Extension:Tabs', 'descriptionmsg' = 'tabs-desc', - 'version'= 1.3, + 'version'= '1.3.1', 'license-name' = 'GPLv2+' ); diff --git a/ext.tabs.js b/ext.tabs.js index 3e71a30..1c56b57 100644 --- a/ext.tabs.js +++ b/ext.tabs.js @@ -16,7 +16,7 @@ return true; // continue the $.each() function } this.click(); // open the selected tab by default. - document.documentElement.scrollTop = this.offsetTop; + window.scrollTo(0, $(this).offset().top); return false; // stop the $.each() function after the first match. }); } @@ -48,6 +48,7 @@ } else { $(moveToHash); } + addEventListener('hashchange', moveToHash); /* * System to fix toggle boxes in Android Browser -- To view, visit https://gerrit.wikimedia.org/r/184202 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I21018afe9351a073f04f99477ed49f7f13fc32d0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Tabs Gerrit-Branch: master Gerrit-Owner: Joeytje50 joeytj...@gmail.com Gerrit-Reviewer: Joeytje50 joeytj...@gmail.com Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move DeferredStringifier into libs, add tests - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/184205 Change subject: Move DeferredStringifier into libs, add tests .. Move DeferredStringifier into libs, add tests Change-Id: I384d1a3854e957315584d30ec58c48c02fee6a2c --- M autoload.php R includes/libs/DeferredStringifier.php A tests/phpunit/includes/libs/DeferredStringifierTest.php 3 files changed, 24 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/05/184205/1 diff --git a/autoload.php b/autoload.php index 674d4b0..72345fe 100644 --- a/autoload.php +++ b/autoload.php @@ -292,7 +292,7 @@ 'DateFormatter' = __DIR__ . '/includes/parser/DateFormatter.php', 'DeadendPagesPage' = __DIR__ . '/includes/specials/SpecialDeadendpages.php', 'DeferrableUpdate' = __DIR__ . '/includes/deferred/DeferredUpdates.php', - 'DeferredStringifier' = __DIR__ . '/includes/DeferredStringifier.php', + 'DeferredStringifier' = __DIR__ . '/includes/libs/DeferredStringifier.php', 'DeferredUpdates' = __DIR__ . '/includes/deferred/DeferredUpdates.php', 'DeleteAction' = __DIR__ . '/includes/actions/DeleteAction.php', 'DeleteArchivedFiles' = __DIR__ . '/maintenance/deleteArchivedFiles.php', diff --git a/includes/DeferredStringifier.php b/includes/libs/DeferredStringifier.php similarity index 100% rename from includes/DeferredStringifier.php rename to includes/libs/DeferredStringifier.php diff --git a/tests/phpunit/includes/libs/DeferredStringifierTest.php b/tests/phpunit/includes/libs/DeferredStringifierTest.php new file mode 100644 index 000..45f5e37 --- /dev/null +++ b/tests/phpunit/includes/libs/DeferredStringifierTest.php @@ -0,0 +1,23 @@ +?php + +class DeferredStringifierTest extends PHPUnit_Framework_TestCase { + + /** +* @covers DeferredStringifier +* @dataProvider provideToString +*/ + public function testToString( $params, $expected ) { + $class = new ReflectionClass( 'DeferredStringifier' ); + $ds = $class-newInstanceArgs( $params ); + $this-assertEquals( $expected, (string)$ds ); + } + + public static function provideToString() { + return array( + // No args + array( array( function() { return 'foo'; } ), 'foo' ), + // Has args + array( array( function( $i ) { return $i; }, 'bar' ), 'bar' ), + ); + } +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/184205 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I384d1a3854e957315584d30ec58c48c02fee6a2c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bump default batch size for populateEntityUsage.php - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Bump default batch size for populateEntityUsage.php .. Bump default batch size for populateEntityUsage.php Bumping the default in the maintenance script to the batch size used by SqlUsageTrackerSchemaUpdater. Change-Id: I7e82a904774bb98f22609edc15cc478106bb5121 --- M client/maintenance/populateEntityUsage.php 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: JanZerebecki: Looks good to me, approved jenkins-bot: Verified diff --git a/client/maintenance/populateEntityUsage.php b/client/maintenance/populateEntityUsage.php index 2a555ff..74d4c27 100644 --- a/client/maintenance/populateEntityUsage.php +++ b/client/maintenance/populateEntityUsage.php @@ -28,6 +28,8 @@ $this-addOption( 'start-page', The page ID to start from., false, true ); parent::__construct(); + + $this-setBatchSize( 1000 ); } /** -- To view, visit https://gerrit.wikimedia.org/r/183837 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7e82a904774bb98f22609edc15cc478106bb5121 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de Gerrit-Reviewer: Adrian Lang adrian.he...@wikimedia.de Gerrit-Reviewer: Aude aude.w...@gmail.com Gerrit-Reviewer: Hoo man h...@online.de Gerrit-Reviewer: JanZerebecki jan.wikime...@zerebecki.de Gerrit-Reviewer: Springle sprin...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove -qa channel announces - change (integration/config)
Greg Grossmeier has uploaded a new change for review. https://gerrit.wikimedia.org/r/184200 Change subject: Remove -qa channel announces .. Remove -qa channel announces Bug: T86053 Change-Id: Ie869ab1a0a69bab4f1dfb20e6880bf83ef7063f3 --- M jjb/beta.yaml M jjb/macro-browsertests.yaml 2 files changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/00/184200/1 diff --git a/jjb/beta.yaml b/jjb/beta.yaml index 160a8ad..21e601d 100644 --- a/jjb/beta.yaml +++ b/jjb/beta.yaml @@ -292,8 +292,6 @@ message-type: summary matrix-notifier: only-parent channels: - - name: '#wikimedia-qa' -notify-only: true - name: '#wikimedia-releng' notify-only: true diff --git a/jjb/macro-browsertests.yaml b/jjb/macro-browsertests.yaml index 552d556..b922d6e 100644 --- a/jjb/macro-browsertests.yaml +++ b/jjb/macro-browsertests.yaml @@ -144,7 +144,5 @@ message-type: summary matrix-notifier: only-configurations channels: - - name: '#wikimedia-qa' -notify-only: true - name: '#wikimedia-releng' notify-only: true -- To view, visit https://gerrit.wikimedia.org/r/184200 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie869ab1a0a69bab4f1dfb20e6880bf83ef7063f3 Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Greg Grossmeier g...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Different filenames and descriptions support for Uploadbot - change (pywikibot/core)
Murfel has uploaded a new change for review. https://gerrit.wikimedia.org/r/184210 Change subject: Different filenames and descriptions support for Uploadbot .. Different filenames and descriptions support for Uploadbot Parameter url may be a two-dimensional list with path, filename and description for each file. It is not available from command line (yet?). Bug: T86300 Change-Id: I2bdebca7a03195877e83c57541885614f8f0459c --- M scripts/upload.py M tests/uploadbot_tests.py 2 files changed, 90 insertions(+), 49 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/10/184210/1 diff --git a/scripts/upload.py b/scripts/upload.py index e3daa44..3cb8625 100755 --- a/scripts/upload.py +++ b/scripts/upload.py @@ -74,7 +74,9 @@ Constructor. @param url: path to url or local file (deprecated), or list of urls or -paths to local files. +paths to local files, or list of lists of form of [url, filename, +description] where filename and description are either strings or +None. @type url: string (deprecated) or list @param description: Description of file for its page. If multiple files are uploading the same description is used for every file. @@ -195,29 +197,42 @@ return tempname def process_filename(self, file_url=None): -Return base filename portion of file_url. +Return base filename portion of file_url or file_url[0]. if not file_url: file_url = self.url -pywikibot.warning(file_url is not given. - Set to self.url by default.) +pywikibot.warning( +file_url is not given. Set to +[self.url, None, self.description] by default.) + +return_filename = False +if isinstance(file_url, basestring): +return_filename = True +file_url = [file_url, None] +if self.description: +file_url.append(self.description) +else: +file_url.append(None) # Isolate the pure name -filename = file_url +filename = file_url[0] # Filename may be either a URL or a local file path if :// in filename: # extract the path portion of the URL filename = urlparse(filename).path filename = os.path.basename(filename) + +if not file_url[1]: +file_url[1] = filename if self.useFilename: -filename = self.useFilename +file_url[1] = self.useFilename if not self.keepFilename: pywikibot.output( -uThe filename on the target wiki will default to: %s -% filename) +uThefile_url[1]on the target wiki will default to: %s +% file_url[1]) newfn = pywikibot.input( u'Enter a better name, or press enter to accept:') if newfn != : -filename = newfn +file_url[1] = newfn # FIXME: these 2 belong somewhere else, presumably in family # forbidden characters are handled by pywikibot/page.py forbidden = ':*?/\\' # to be extended @@ -228,13 +243,13 @@ first_check = True while True: if not first_check: -filename = pywikibot.input(u'Enter a better name, ' - 'or press enter to skip:') -if not filename: +file_url[1] = pywikibot.input(u'Enter a better name, ' + 'or press enter to skip:') +if not file_url[1]: return None first_check = False ext = os.path.splitext(filename)[1].lower().strip('.') -# are any chars in forbidden also in filename? +# are any chars in forbidden also infile_url[1]? invalid = set(forbidden) set(filename) if invalid: c = .join(invalid) @@ -247,42 +262,41 @@ % (u' '.join(allowed_formats), ext), default=False, automatic_quit=False): continue -potential_file_page = pywikibot.FilePage(self.targetSite, filename) +potential_file_page = pywikibot.FilePage(self.targetSite, file_url[1]) if potential_file_page.exists(): if potential_file_page.canBeEdited(): if pywikibot.input_yn(uFile with name %s already exists. Would you like to change the name? (Otherwise file will be overwritten.) - % filename, default=True, + %
[MediaWiki-commits] [Gerrit] Fix scrolling in Chrome, add scroll documentation - change (mediawiki...Tabs)
Joeytje50 has uploaded a new change for review. https://gerrit.wikimedia.org/r/184202 Change subject: Fix scrolling in Chrome, add scroll documentation .. Fix scrolling in Chrome, add scroll documentation Scrolling/hotlinking tabs didn't work in Chrome; fixed that also added documentation about the hotlinking of tabs to README. Change-Id: I21018afe9351a073f04f99477ed49f7f13fc32d0 --- M README.md M Tabs.php M ext.tabs.js 3 files changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Tabs refs/changes/02/184202/1 diff --git a/README.md b/README.md index d895546..b188a4a 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,10 @@ |style=color:{{#if:{{{1|}}}|green|red}} }} /pre + Hotlinking tabs + +It is possible to hotlink tabs the same way as hotlinking sections on pages. Simply put the tab label in the URL, and the page will automatically scroll to the top of the tab, and open the selected tab. This will always open only the very first tab that has the specified tab label (for example, if there are two tab boxes that both have a tab labelled Tab 1, putting code#Tab_1/code in the URL will scroll to the first one on the page). If there is already another element on the page that could be scrolled to, such as a page section, that other element will have priority, and the tab will not be focused. + === Toggle box === Documentation @@ -365,7 +369,7 @@ If you want to place a toggle box or dropdown menu inside a tab menu, you can simply place a codelt;tabgt;/code tag inside the codelt;tabgt;/code tag that functions as a tab. This will restrict toggle boxes and dropdowns to visibility in just one tab though. So, if you want to have a toggle box or dropdown that's visible in every tab, encase it in a codelt;tabgt;/code tag with an codeindex=*/code set to it. -That way, the outer codelt;tabgt;/code tag will be recognised as a tab container, and the inner one will be recognised as a toggle box or dropdown menu, as desired. The toggle box or dropdown must then also use the [[#General usage information|parser function syntax]]. +That way, the outer codelt;tabgt;/code tag will be recognised as a tab container, and the inner one will be recognised as a toggle box or dropdown menu, as desired. The toggle box or dropdown must then also use the [[#Nested combinations|parser function syntax]]. If you want the contents of the toggle box inside the tab menu to be able to change depending on the selected tab, you should use the codenested=true/code attribute on the tag. This can be done by setting the very last argument of the code#tab:/code parser function or the code#tag:tab/code parser function to codenested=true/code. diff --git a/Tabs.php b/Tabs.php index f33b2fe..50cc9de 100644 --- a/Tabs.php +++ b/Tabs.php @@ -30,7 +30,7 @@ 'author' = 'Joeytje50', 'url'= 'https://www.mediawiki.org/wiki/Extension:Tabs', 'descriptionmsg' = 'tabs-desc', - 'version'= 1.3, + 'version'= '1.3.1', 'license-name' = 'GPLv2+' ); diff --git a/ext.tabs.js b/ext.tabs.js index 3e71a30..1c56b57 100644 --- a/ext.tabs.js +++ b/ext.tabs.js @@ -16,7 +16,7 @@ return true; // continue the $.each() function } this.click(); // open the selected tab by default. - document.documentElement.scrollTop = this.offsetTop; + window.scrollTo(0, $(this).offset().top); return false; // stop the $.each() function after the first match. }); } @@ -48,6 +48,7 @@ } else { $(moveToHash); } + addEventListener('hashchange', moveToHash); /* * System to fix toggle boxes in Android Browser -- To view, visit https://gerrit.wikimedia.org/r/184202 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I21018afe9351a073f04f99477ed49f7f13fc32d0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Tabs Gerrit-Branch: master Gerrit-Owner: Joeytje50 joeytj...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Escape unescaped messages in Special:Ask - change (mediawiki...SemanticMediaWiki)
M4tx has uploaded a new change for review. https://gerrit.wikimedia.org/r/184203 Change subject: Escape unescaped messages in Special:Ask .. Escape unescaped messages in Special:Ask Bug: T85864 Change-Id: Ic98b6f52c77c2a401a448dcc4ad6e5461f146535 --- M includes/specials/SMW_SpecialAsk.php 1 file changed, 19 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki refs/changes/03/184203/1 diff --git a/includes/specials/SMW_SpecialAsk.php b/includes/specials/SMW_SpecialAsk.php index 55808c1..0d2fc58 100644 --- a/includes/specials/SMW_SpecialAsk.php +++ b/includes/specials/SMW_SpecialAsk.php @@ -42,7 +42,7 @@ $this-setHeaders(); if ( !$smwgQEnabled ) { - $wgOut-addHTML( 'br /' . wfMessage( 'smw_iq_disabled' )-text() ); + $wgOut-addHTML( 'br /' . wfMessage( 'smw_iq_disabled' )-escaped() ); } else { if ( $wgRequest-getCheck( 'showformatoptions' ) ) { // handle Ajax action @@ -352,8 +352,8 @@ $result .= Html::hidden( 'title', $title-getPrefixedDBKey() ); // Table for main query and printouts. - $result .= 'table class=smw-ask-query style=width: 100%;trth' . wfMessage( 'smw_ask_queryhead' )-text() . /th\nth . wfMessage( 'smw_ask_printhead' )-text() . br /\n . - 'span style=font-weight: normal;' . wfMessage( 'smw_ask_printdesc' )-text() . '/span' . /th/tr\n . + $result .= 'table class=smw-ask-query style=width: 100%;trth' . wfMessage( 'smw_ask_queryhead' )-escaped() . /th\nth . wfMessage( 'smw_ask_printhead' )-escaped() . br /\n . + 'span style=font-weight: normal;' . wfMessage( 'smw_ask_printdesc' )-escaped() . '/span' . /th/tr\n . 'trtd style=padding-left: 0px;textarea class=smw-ask-query-condition name=q cols=20 rows=6' . htmlspecialchars( $this-m_querystring ) . /textarea/td\n . 'td style=padding-left: 7px;textarea id=add_property class=smw-ask-query-printout name=po cols=20 rows=6' . htmlspecialchars( $printoutstring ) . '/textarea/td/tr/table' . \n; @@ -385,7 +385,7 @@ $urltail = str_replace( 'eq=yes', '', $urltail ) . 'eq=no'; // FIXME: doing it wrong, srysly // Submit - $result .= 'br /input type=submit value=' . wfMessage( 'smw_ask_submit' )-text() . '/' . + $result .= 'br /input type=submit value=' . wfMessage( 'smw_ask_submit' )-escaped() . '/' . 'input type=hidden name=eq value=yes/' . Html::element( 'a', @@ -396,7 +396,7 @@ wfMessage( 'smw_ask_hidequery' )-text() ) . ' | ' . SMWAskPage::getEmbedToggle() . - ' | a href=' . htmlspecialchars( wfMessage( 'smw_ask_doculink' )-text() ) . '' . wfMessage( 'smw_ask_help' )-text() . '/a' . + ' | a href=' . wfMessage( 'smw_ask_doculink' )-escaped() . '' . wfMessage( 'smw_ask_help' )-escaped() . '/a' . \n/form; } else { // if $this-m_editquery == false $urltail = str_replace( 'eq=no', '', $urltail ) . 'eq=yes'; @@ -413,7 +413,7 @@ '/p'; } //show|hide inline embed code - $result .= 'div id=inlinequeryembed style=display: nonediv id=inlinequeryembedinstruct' . wfMessage( 'smw_ask_embed_instr' )-text() . '/divtextarea id=inlinequeryembedarea readonly=yes cols=20 rows=6 onclick=this.select()' . + $result .= 'div id=inlinequeryembed style=display: nonediv id=inlinequeryembedinstruct' . wfMessage( 'smw_ask_embed_instr' )-escaped() . '/divtextarea id=inlinequeryembedarea readonly=yes cols=20 rows=6 onclick=this.select()' . '{{#ask:' . htmlspecialchars( $this-m_querystring ) . \n; foreach ( $this-m_printouts as $printout ) { @@ -453,7 +453,7 @@ } } - $result .= 'br /span class=smw-ask-query-format style=vertical-align:middle;' . wfMessage( 'smw_ask_format_as' )-text() . ' input type=hidden name=eq value=yes/' . \n . + $result .= 'br /span class=smw-ask-query-format style=vertical-align:middle;' . wfMessage( 'smw_ask_format_as' )-escaped() . ' input type=hidden name=eq value=yes/' . \n . Html::openElement(