[MediaWiki-commits] [Gerrit] mediawiki/core[master]: LinkBatch: Set visibility and document constructor
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/309518 Change subject: LinkBatch: Set visibility and document constructor .. LinkBatch: Set visibility and document constructor Change-Id: I9d8edeb214b9d7507826004e470dcb5c1ef015f6 --- M includes/cache/LinkBatch.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/18/309518/1 diff --git a/includes/cache/LinkBatch.php b/includes/cache/LinkBatch.php index e6d8630..8a4d061 100644 --- a/includes/cache/LinkBatch.php +++ b/includes/cache/LinkBatch.php @@ -40,7 +40,11 @@ */ protected $caller; - function __construct( $arr = [] ) { + /** +* LinkBatch constructor. +* @param LinkTarget[] $arr Initial items to be added to the batch +*/ + public function __construct( $arr = [] ) { foreach ( $arr as $item ) { $this->addObj( $item ); } -- To view, visit https://gerrit.wikimedia.org/r/309518 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d8edeb214b9d7507826004e470dcb5c1ef015f6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Title: Document that Title::compare() can be used for LinkTa...
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/309517 Change subject: Title: Document that Title::compare() can be used for LinkTargets .. Title: Document that Title::compare() can be used for LinkTargets It only depends upon functions that are all in the LinkTarget interface. Change-Id: I95e598ea6014ced8f1b947c283dd0b542756b8e2 --- M includes/Title.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/17/309517/1 diff --git a/includes/Title.php b/includes/Title.php index 5e5a1b7..3475b26 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -751,12 +751,12 @@ /** * Callback for usort() to do title sorts by (namespace, title) * -* @param Title $a -* @param Title $b +* @param LinkTarget $a +* @param LinkTarget $b * * @return int Result of string comparison, or namespace comparison */ - public static function compare( $a, $b ) { + public static function compare( LinkTarget $a, LinkTarget $b ) { if ( $a->getNamespace() == $b->getNamespace() ) { return strcmp( $a->getText(), $b->getText() ); } else { -- To view, visit https://gerrit.wikimedia.org/r/309517 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95e598ea6014ced8f1b947c283dd0b542756b8e2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move Linker::formatTemplates() to separate class, remove glo...
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/309519 Change subject: Move Linker::formatTemplates() to separate class, remove global usage .. Move Linker::formatTemplates() to separate class, remove global usage Linker::formatTemplates() was a static function that depended upon global state like $wgLang (explicitly), $wgUser & $wgTitle (implicitly). Moving it to a separate class allows us to clean it up a little bit and use modern things like RequestContext and LinkRenderer. Bug: T145177 Change-Id: Icdea8a2b299b4876feb3df3d66df3e4c104dd928 --- M autoload.php M includes/DummyLinker.php M includes/EditPage.php M includes/Linker.php A includes/TemplatesOnThisPageFormatter.php M includes/actions/InfoAction.php 6 files changed, 248 insertions(+), 93 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/19/309519/1 diff --git a/autoload.php b/autoload.php index 71f1809..ff33cb44 100644 --- a/autoload.php +++ b/autoload.php @@ -1395,6 +1395,7 @@ 'TempFSFile' => __DIR__ . '/includes/filebackend/TempFSFile.php', 'TempFileRepo' => __DIR__ . '/includes/filerepo/FileRepo.php', 'TemplateParser' => __DIR__ . '/includes/TemplateParser.php', + 'TemplatesOnThisPageFormatter' => __DIR__ . '/includes/TemplatesOnThisPageFormatter.php', 'TestFileOpPerformance' => __DIR__ . '/maintenance/fileOpPerfTest.php', 'TextContent' => __DIR__ . '/includes/content/TextContent.php', 'TextContentHandler' => __DIR__ . '/includes/content/TextContentHandler.php', diff --git a/includes/DummyLinker.php b/includes/DummyLinker.php index ba24799..89a735e 100644 --- a/includes/DummyLinker.php +++ b/includes/DummyLinker.php @@ -453,12 +453,17 @@ ); } + /** +* @deprecated since 1.28, use TemplatesOnThisPageFormatter directly +*/ public function formatTemplates( $templates, $preview = false, $section = false, $more = null ) { + wfDeprecated( __METHOD__, '1.28' ); + return Linker::formatTemplates( $templates, $preview, diff --git a/includes/EditPage.php b/includes/EditPage.php index 7e4e411..777e93a 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -21,6 +21,7 @@ */ use MediaWiki\Logger\LoggerFactory; +use MediaWiki\MediaWikiServices; /** * The edit page/HTML interface (split from Article) @@ -747,8 +748,7 @@ $this->showTextbox( $text, 'wpTextbox1', [ 'readonly' ] ); $wgOut->addHTML( $this->editFormTextAfterContent ); - $wgOut->addHTML( Html::rawElement( 'div', [ 'class' => 'templatesUsed' ], - Linker::formatTemplates( $this->getTemplates() ) ) ); + $wgOut->addHTML( $this->makeTemplatesOnThisPageList( $this->getTemplates() ) ); $wgOut->addModules( 'mediawiki.action.edit.collapsibleFooter' ); @@ -2744,8 +2744,7 @@ $wgOut->addHTML( $this->editFormTextAfterTools . "\n" ); - $wgOut->addHTML( Html::rawElement( 'div', [ 'class' => 'templatesUsed' ], - Linker::formatTemplates( $this->getTemplates(), $this->preview, $this->section != '' ) ) ); + $wgOut->addHTML( $this->makeTemplatesOnThisPageList( $this->getTemplates() ) ); $wgOut->addHTML( Html::rawElement( 'div', [ 'class' => 'hiddencats' ], Linker::formatHiddenCategories( $this->page->getHiddenCategories() ) ) ); @@ -2795,6 +2794,32 @@ } /** +* Wrapper around TemplatesOnThisPageFormatter to make +* a "templates on this page" list. +* +* @param Title[] $templates +* @return string HTML +*/ + protected function makeTemplatesOnThisPageList( array $templates ) { + $templateListFormatter = new TemplatesOnThisPageFormatter( + $this->context, MediaWikiServices::getInstance()->getLinkRenderer() + ); + + // preview if preview, else section if section, else false + $type = false; + if ( $this->preview ) { + $type = 'preview'; + } elseif ( $this->section != '' ) { + $type = 'section'; + } + + return Html::rawElement( 'div', [ 'class' => 'templatesUsed' ], + $templateListFormatter->format( $templates, $type ) + ); + + } + + /** * Extract the section title from current section text, if any. * * @param string $text diff --git a/includes/Linker.php b/includes/Linker.php index bcc348e..eae49e7 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1919,6
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Update composer libs
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/309516 Change subject: Update composer libs .. Update composer libs Change-Id: I83627f436fefa7cfcf7b31011b0845ea26458aba --- M composer.lock 1 file changed, 14 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/16/309516/1 diff --git a/composer.lock b/composer.lock index 5332109..6353e2b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file;, "This file is @generated automatically" ], -"hash": "9e29cbff77457b9da548f665e5e010ea", +"hash": "16969a6f73b030f3d6c3a2435a7099ae", "content-hash": "b48455e6e53399fe588ca65fb1257c5e", "packages": [ { @@ -546,7 +546,7 @@ }, { "name": "symfony/event-dispatcher", -"version": "v2.8.9", +"version": "v2.8.11", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git;, @@ -606,16 +606,16 @@ }, { "name": "symfony/http-foundation", -"version": "v2.8.9", +"version": "v2.8.11", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git;, -"reference": "f20bea598906c990eebe3c70a63ca5ed18cdbc11" +"reference": "1d4ab8de2215e44e57fddc1e6b5d122546769e7d" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/symfony/http-foundation/zipball/f20bea598906c990eebe3c70a63ca5ed18cdbc11;, -"reference": "f20bea598906c990eebe3c70a63ca5ed18cdbc11", +"url": "https://api.github.com/repos/symfony/http-foundation/zipball/1d4ab8de2215e44e57fddc1e6b5d122546769e7d;, +"reference": "1d4ab8de2215e44e57fddc1e6b5d122546769e7d", "shasum": "" }, "require": { @@ -657,7 +657,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com;, -"time": "2016-07-30 07:20:35" +"time": "2016-09-06 10:55:00" }, { "name": "symfony/polyfill-mbstring", @@ -834,16 +834,16 @@ }, { "name": "symfony/yaml", -"version": "v2.8.9", +"version": "v2.8.11", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git;, -"reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d" +"reference": "e7540734bad981fe59f8ef14b6fc194ae9df8d9c" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/symfony/yaml/zipball/0ceab136f43ed9d3e97b3eea32a7855dc50c121d;, -"reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d", +"url": "https://api.github.com/repos/symfony/yaml/zipball/e7540734bad981fe59f8ef14b6fc194ae9df8d9c;, +"reference": "e7540734bad981fe59f8ef14b6fc194ae9df8d9c", "shasum": "" }, "require": { @@ -879,7 +879,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com;, -"time": "2016-07-17 09:06:15" +"time": "2016-09-02 01:57:56" }, { "name": "wikimedia/smash-pig", @@ -887,7 +887,7 @@ "source": { "type": "git", "url": "https://gerrit.wikimedia.org/r/wikimedia/fundraising/SmashPig.git;, -"reference": "aa1532a9c046a5378572a3177b5f194a820bee4e" +"reference": "010270421ae87b43f59a7b43fc385aa52367d600" }, "require": { "amzn/login-and-pay-with-amazon-sdk-php": "dev-master", @@ -938,7 +938,7 @@ "donations", "payments" ], -"time": "2016-08-25 19:50:04" +"time": "2016-09-07 23:18:54" }, { "name": "zordius/lightncandy", -- To view, visit https://gerrit.wikimedia.org/r/309516 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83627f436fefa7cfcf7b31011b0845ea26458aba Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...RevisionSlider[master]: Add missing dependencies to core modules
Fomafix has uploaded a new change for review. https://gerrit.wikimedia.org/r/309515 Change subject: Add missing dependencies to core modules .. Add missing dependencies to core modules Change-Id: I53174e3d437b4d12525c1cf915027cb26f87bedc --- M extension.json 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RevisionSlider refs/changes/15/309515/1 diff --git a/extension.json b/extension.json index 60d43a8..60994e8 100644 --- a/extension.json +++ b/extension.json @@ -40,7 +40,8 @@ "ext.RevisionSlider.icons", "ext.RevisionSlider.pointers.lower", "ext.RevisionSlider.pointers.upper", - "mediawiki.api.options" + "mediawiki.api.options", + "mediawiki.util" ], "messages": [ "revisionslider-show-help-tooltip", @@ -95,6 +96,7 @@ ], "dependencies": [ "jquery.ui.draggable", + "mediawiki.util", "oojs-ui", "ext.RevisionSlider.DiffPage", "ext.RevisionSlider.HelpDialog", @@ -116,7 +118,8 @@ ], "dependencies": [ "ext.RevisionSlider.Revision", - "ext.RevisionSlider.RevisionListView" + "ext.RevisionSlider.RevisionListView", + "mediawiki.util" ] }, "ext.RevisionSlider.RevisionListView": { @@ -135,6 +138,8 @@ "revisionslider-minoredit" ], "dependencies": [ + "mediawiki.language", + "mediawiki.util", "oojs-ui" ] }, -- To view, visit https://gerrit.wikimedia.org/r/309515 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53174e3d437b4d12525c1cf915027cb26f87bedc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/RevisionSlider Gerrit-Branch: master Gerrit-Owner: Fomafix___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Fix ilegal wgFlaggedRevsWhitelist for arwiki
Urbanecm has uploaded a new change for review. https://gerrit.wikimedia.org/r/309514 Change subject: Fix ilegal wgFlaggedRevsWhitelist for arwiki .. Fix ilegal wgFlaggedRevsWhitelist for arwiki Bug: T144673 Change-Id: I4a72ed833917b4c48443a87404e6ede9ea13567f --- M wmf-config/flaggedrevs.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/14/309514/1 diff --git a/wmf-config/flaggedrevs.php b/wmf-config/flaggedrevs.php index f6cb104..c45e3b4 100644 --- a/wmf-config/flaggedrevs.php +++ b/wmf-config/flaggedrevs.php @@ -35,7 +35,7 @@ } elseif ( $wgDBname == 'arwiki' ) { - $wgFlaggedRevsWhitelist = [ 'اÙصÙ?ØØ©_اÙرئÙسÙØ©' ]; + $wgFlaggedRevsWhitelist = [ 'اÙصÙØØ©_اÙرئÙسÙØ©' ]; $wgFlaggedRevsNamespaces = array_merge( $wgFlaggedRevsNamespaces, [ 100, 104 ] ); // T21332 } -- To view, visit https://gerrit.wikimedia.org/r/309514 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a72ed833917b4c48443a87404e6ede9ea13567f Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Urbanecm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: puppetmaster: offline temporarily puppetmaster2002
Giuseppe Lavagetto has submitted this change and it was merged. Change subject: puppetmaster: offline temporarily puppetmaster2002 .. puppetmaster: offline temporarily puppetmaster2002 While testing puppetdb on 2001, this makes things easier. Change-Id: Iefa92c5b68aece47e904c7a1a1b19aa5b3f9fb75 --- M hieradata/common/puppetmaster.yaml 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Giuseppe Lavagetto: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/hieradata/common/puppetmaster.yaml b/hieradata/common/puppetmaster.yaml index bed5274..0c1f9d8 100644 --- a/hieradata/common/puppetmaster.yaml +++ b/hieradata/common/puppetmaster.yaml @@ -8,4 +8,4 @@ - { worker: rhodium.eqiad.wmnet, loadfactor: 20 } puppetmaster2001.codfw.wmnet: - { worker: puppetmaster2001.codfw.wmnet, loadfactor: 10 } -- { worker: puppetmaster2002.codfw.wmnet, loadfactor: 20 } +- { worker: puppetmaster2002.codfw.wmnet, loadfactor: 20, offline: true } -- To view, visit https://gerrit.wikimedia.org/r/309513 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iefa92c5b68aece47e904c7a1a1b19aa5b3f9fb75 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Giuseppe LavagettoGerrit-Reviewer: Giuseppe Lavagetto Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: puppetmaster: offline temporarily puppetmaster2002
Giuseppe Lavagetto has uploaded a new change for review. https://gerrit.wikimedia.org/r/309513 Change subject: puppetmaster: offline temporarily puppetmaster2002 .. puppetmaster: offline temporarily puppetmaster2002 While testing puppetdb on 2001, this makes things easier. Change-Id: Iefa92c5b68aece47e904c7a1a1b19aa5b3f9fb75 --- M hieradata/common/puppetmaster.yaml 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/13/309513/1 diff --git a/hieradata/common/puppetmaster.yaml b/hieradata/common/puppetmaster.yaml index bed5274..0c1f9d8 100644 --- a/hieradata/common/puppetmaster.yaml +++ b/hieradata/common/puppetmaster.yaml @@ -8,4 +8,4 @@ - { worker: rhodium.eqiad.wmnet, loadfactor: 20 } puppetmaster2001.codfw.wmnet: - { worker: puppetmaster2001.codfw.wmnet, loadfactor: 10 } -- { worker: puppetmaster2002.codfw.wmnet, loadfactor: 20 } +- { worker: puppetmaster2002.codfw.wmnet, loadfactor: 20, offline: true } -- To view, visit https://gerrit.wikimedia.org/r/309513 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iefa92c5b68aece47e904c7a1a1b19aa5b3f9fb75 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Giuseppe Lavagetto___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: admin: fix documentation of hashuser
Giuseppe Lavagetto has submitted this change and it was merged. Change subject: admin: fix documentation of hashuser .. admin: fix documentation of hashuser Change-Id: Ief556ce348ede5ee56fcf856fd958fe75dfdfcde --- M modules/admin/manifests/hashuser.pp 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Giuseppe Lavagetto: Verified; Looks good to me, approved diff --git a/modules/admin/manifests/hashuser.pp b/modules/admin/manifests/hashuser.pp index 5cf5738..da1baa7 100644 --- a/modules/admin/manifests/hashuser.pp +++ b/modules/admin/manifests/hashuser.pp @@ -5,9 +5,6 @@ # [*name*] # Hash user name # -# [*phash*] -# Hash with valid user data - define admin::hashuser( ) { -- To view, visit https://gerrit.wikimedia.org/r/309512 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ief556ce348ede5ee56fcf856fd958fe75dfdfcde Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Giuseppe LavagettoGerrit-Reviewer: Giuseppe Lavagetto ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Lift of IP cap - WomenInSience
Urbanecm has uploaded a new change for review. https://gerrit.wikimedia.org/r/309511 Change subject: Lift of IP cap - WomenInSience .. Lift of IP cap - WomenInSience Bug: T145115 Change-Id: I8373fd8e6db39a0fc47aaf757fd2a276a74e4f58 --- M wmf-config/throttle.php 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/11/309511/1 diff --git a/wmf-config/throttle.php b/wmf-config/throttle.php index 00da4ee..ac8b9aa 100644 --- a/wmf-config/throttle.php +++ b/wmf-config/throttle.php @@ -42,6 +42,13 @@ 'dbname' => 'labswiki', 'value' => 60 //50 expected ]; +$wmgThrottlingExceptions[] = [ // T145115 + 'from' => '2016-09-21T13:00 -4:00', + 'to' => '2016-09-21T17:00 -4:00', + 'range' => '132.205.228.0/24', + 'dbname' => [ 'enwiki', 'frwiki' ], + 'value' => 50 //40 expected +]; ## Add throttling definitions above. -- To view, visit https://gerrit.wikimedia.org/r/309511 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8373fd8e6db39a0fc47aaf757fd2a276a74e4f58 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Urbanecm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: admin: fix documentation of hashuser
Giuseppe Lavagetto has uploaded a new change for review. https://gerrit.wikimedia.org/r/309512 Change subject: admin: fix documentation of hashuser .. admin: fix documentation of hashuser Change-Id: Ief556ce348ede5ee56fcf856fd958fe75dfdfcde --- M modules/admin/manifests/hashuser.pp 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/12/309512/1 diff --git a/modules/admin/manifests/hashuser.pp b/modules/admin/manifests/hashuser.pp index 5cf5738..da1baa7 100644 --- a/modules/admin/manifests/hashuser.pp +++ b/modules/admin/manifests/hashuser.pp @@ -5,9 +5,6 @@ # [*name*] # Hash user name # -# [*phash*] -# Hash with valid user data - define admin::hashuser( ) { -- To view, visit https://gerrit.wikimedia.org/r/309512 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief556ce348ede5ee56fcf856fd958fe75dfdfcde Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Giuseppe Lavagetto___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: WebRequest: Add more unit tests
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/309510 Change subject: WebRequest: Add more unit tests .. WebRequest: Add more unit tests * Complete detectServer() coverage, test $wgAssumeProxiesUseDefaultProtocolPorts. * Complete getAcceptLang() coverage. * Add tests for getGPCVal() normalisation. * Add tests for other getter methods. Also: * Ignore __construct() coverage as it only sets up properties from global state. The use of those properties are covered. * Make normalizeUnicode() visibility explicit. Change-Id: I6504136e6df47e504bc2e0e91fe2625f19d9 --- M includes/WebRequest.php M tests/phpunit/includes/WebRequestTest.php 2 files changed, 239 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/10/309510/1 diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 5492737..8f78164 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -83,6 +83,9 @@ /** @var bool Whether this HTTP request is "safe" (even if it is an HTTP post) */ protected $markedAsSafe = false; + /** +* @codeCoverageIgnore +*/ public function __construct() { $this->requestTime = isset( $_SERVER['REQUEST_TIME_FLOAT'] ) ? $_SERVER['REQUEST_TIME_FLOAT'] : microtime( true ); @@ -351,7 +354,7 @@ * @return array|string Cleaned-up version of the given * @private */ - function normalizeUnicode( $data ) { + public function normalizeUnicode( $data ) { if ( is_array( $data ) ) { foreach ( $data as $key => $val ) { $data[$key] = $this->normalizeUnicode( $val ); @@ -641,6 +644,7 @@ * Get the values passed in the query string. * No transformation is performed on the values. * +* @codeCoverageIgnore * @return array */ public function getQueryValues() { @@ -651,6 +655,7 @@ * Return the contents of the Query with no decoding. Use when you need to * know exactly what was sent, e.g. for an OAuth signature over the elements. * +* @codeCoverageIgnore * @return string */ public function getRawQueryString() { diff --git a/tests/phpunit/includes/WebRequestTest.php b/tests/phpunit/includes/WebRequestTest.php index c946689..0f1634b 100644 --- a/tests/phpunit/includes/WebRequestTest.php +++ b/tests/phpunit/includes/WebRequestTest.php @@ -23,8 +23,11 @@ /** * @dataProvider provideDetectServer * @covers WebRequest::detectServer +* @covers WebRequest::detectProtocol */ public function testDetectServer( $expected, $input, $description ) { + $this->setMwGlobals( 'wgAssumeProxiesUseDefaultProtocolPorts', true ); + $_SERVER = $input; $result = WebRequest::detectServer(); $this->assertEquals( $expected, $result, $description ); @@ -62,6 +65,24 @@ 'HTTPS' => 'off', ], 'Secure off' + ], + [ + 'https://x', + [ + 'HTTP_HOST' => 'x', + 'HTTP_X_FORWARDED_PROTO' => 'https', + ], + 'Forwarded HTTPS' + ], + [ + 'https://x', + [ + 'HTTP_HOST' => 'x', + 'HTTPS' => 'off', + 'SERVER_PORT' => '81', + 'HTTP_X_FORWARDED_PROTO' => 'https', + ], + 'Forwarded HTTPS' ], [ 'http://y', @@ -102,6 +123,217 @@ 'Possible lighttpd environment per bug 14977 comment 13', ], ]; + } + + protected function mockWebRequest( $data = [] ) { + // Cannot use PHPUnit getMockBuilder() as it does not support + // overriding protected properties afterwards + $reflection = new ReflectionClass( 'WebRequest' ); + $req = $reflection->newInstanceWithoutConstructor(); + + $prop = $reflection->getProperty( 'data' ); + $prop->setAccessible( true ); + $prop->setValue( $req, $data ); + + return $req; + } + + /** +* @covers WebRequest::getElapsedTime +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: rollback: Log content model changes
jenkins-bot has submitted this change and it was merged. Change subject: rollback: Log content model changes .. rollback: Log content model changes If the content model changes during a rollback, make sure it is logged to Special:Log/contentmodel. Change-Id: Icd9a2b0221468936e186178ef09141c09e053cbb --- M includes/page/WikiPage.php 1 file changed, 20 insertions(+), 1 deletion(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index f1e59de..d5dfd3d 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -3235,9 +3235,12 @@ $flags |= EDIT_FORCE_BOT; } + $targetContent = $target->getContent(); + $changingContentModel = $targetContent->getModel() !== $current->getContentModel(); + // Actually store the edit $status = $this->doEditContent( - $target->getContent(), + $targetContent, $summary, $flags, $target->getId(), @@ -3287,6 +3290,22 @@ ] ]; } + if ( $changingContentModel ) { + // If the content model changed during the rollback, + // make sure it gets logged to Special:Log/contentmodel + $log = new ManualLogEntry( 'contentmodel', 'change' ); + $log->setPerformer( $guser ); + $log->setTarget( $this->mTitle ); + $log->setComment( $summary ); + $log->setParameters( [ + '4::oldmodel' => $current->getContentModel(), + '5::newmodel' => $targetContent->getModel(), + ] ); + + $logId = $log->insert( $dbw ); + $log->publish( $logId ); + } + $revId = $statusRev->getId(); Hooks::run( 'ArticleRollbackComplete', [ $this, $guser, $target, $current ] ); -- To view, visit https://gerrit.wikimedia.org/r/309508 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icd9a2b0221468936e186178ef09141c09e053cbb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Brian Wolff 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/core[master]: Allow to clean page restrictions table
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/309509 Change subject: Allow to clean page restrictions table .. Allow to clean page restrictions table As described on T145172, the page_restrictions table could contain entries with a bogus 0 value for pr_page. We provide a maintenance script to allow to clean up this table. [ Public API extra methods ] Additionnally, a call to CleanupPageRestrictionsTable::getRowsCount method allows to count the rows to delete. Bug: T145173 Change-Id: I230f3e9371f65e014f6d826c515d78690c9b8982 --- A maintenance/cleanupPageRestrictionsTable.php 1 file changed, 120 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/09/309509/1 diff --git a/maintenance/cleanupPageRestrictionsTable.php b/maintenance/cleanupPageRestrictionsTable.php new file mode 100644 index 000..094f120 --- /dev/null +++ b/maintenance/cleanupPageRestrictionsTable.php @@ -0,0 +1,120 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + * @ingroup Maintenance + * @author Sébastien Santoro aka Dereckson + */ + +require_once __DIR__ . '/Maintenance.php'; + +/** + * Maintenance script to clean page_restrictions table. + * + * @ingroup Maintenance + */ +class CleanupPageRestrictionsTable extends Maintenance { + + /** +* The table to clean up. +*/ + const TABLE = 'page_restrictions'; + + /** +* Initialize a new instance of +* the CleanupPageRestrictionsTable class. +*/ + public function __construct() { + parent::__construct(); + + $this->addDescription( 'Cleans page_restrictions table.' ); + $this->addOption( 'fix', 'Actually remove entries' ); + } + + /// + /// Main tasks + /// + + /** +* Execute the maintenance task. +*/ + public function execute() { + if ( $this->hasOption( 'fix' ) ) { + $this->cleanUp(); + } else { + $this->printReport(); + } + } + + /** +* Clean up the table. +*/ + private function cleanUp() { + $dbw = $this->getDB( DB_MASTER ); + + $dbw->delete( self::TABLE, [ 'pr_page' => 0 ], __METHOD__ ); + + $count = $dbw->affectedRows(); + $this->printFinalResult( $count, "Deleted." ); + } + + /** +* Print a report of the maintenance task. +*/ + private function printReport() { + $count = $this->getRowsCount(); + $this->printFinalResult( + $count, + "To actually delete them, run this script with --fix.\n" + ); + } + + /// + /// Helper methods + /// + + /** +* Print final maintenance task result. +* +* @param int $count The number of rows to deleteo +* @param string $status The task status or call for action +*/ + private function printFinalResult( $count, $status ) { + $this->output( "Found $count entries to delete.\n" ); + $this->output( $status ); + } + + /** +* Count the rows to delete. +* +* @return int +*/ + public function getRowsCount() { + $dbr = $this->getDB( DB_REPLICA ); + return $dbr->selectField( + self::TABLE, 'COUNT(*)', [ 'pr_page' => 0 ], __METHOD__ + ); + } + +} + +$maintClass = "CleanupPageRestrictionsTable"; +require_once RUN_MAINTENANCE_IF_MAIN; -- To view, visit https://gerrit.wikimedia.org/r/309509 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I230f3e9371f65e014f6d826c515d78690c9b8982 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: InfoAction: Add a link to Special:ChangeContentModel if allowed
jenkins-bot has submitted this change and it was merged. Change subject: InfoAction: Add a link to Special:ChangeContentModel if allowed .. InfoAction: Add a link to Special:ChangeContentModel if allowed If the user is allowed to change the content model of the page, then add a link to it on ?action=info, next to the localized content model name. Change-Id: I084e8f390f90d29ed2e2d0f8ab43bcdfe8538ad1 --- M includes/actions/InfoAction.php M languages/i18n/en.json M languages/i18n/qqq.json 3 files changed, 13 insertions(+), 1 deletion(-) Approvals: Brian Wolff: Looks good to me, approved Gergő Tisza: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 43bff87..abc7cb2 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -202,6 +202,7 @@ $title = $this->getTitle(); $id = $title->getArticleID(); $config = $this->context->getConfig(); + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); $pageCounts = $this->pageCounts( $this->page ); @@ -279,9 +280,18 @@ . ' ' . $this->msg( 'parentheses', $pageLang )->escaped() ]; // Content model of the page + $modelHtml = htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) ); + // If the user can change it, add a link to Special:ChangeContentModel + if ( $title->quickUserCan( 'editcontentmodel' ) ) { + $modelHtml .= ' ' . $this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink( + SpecialPage::getTitleValueFor( 'ChangeContentModel', $title->getPrefixedText() ), + $this->msg( 'pageinfo-content-model-change' )->text() + ) )->escaped(); + } + $pageInfo['header-basic'][] = [ $this->msg( 'pageinfo-content-model' ), - htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) ) + $modelHtml ]; // Search engine status diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 020f058..c8969a7 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2810,6 +2810,7 @@ "pageinfo-article-id": "Page ID", "pageinfo-language": "Page content language", "pageinfo-content-model": "Page content model", + "pageinfo-content-model-change": "change", "pageinfo-robot-policy": "Indexing by robots", "pageinfo-robot-index": "Allowed", "pageinfo-robot-noindex": "Disallowed", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 4d38ce7..562e3e5 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2994,6 +2994,7 @@ "pageinfo-article-id": "The numeric identifier of the page.\n{{Identical|Page ID}}", "pageinfo-language": "Language in which the page content is written.", "pageinfo-content-model": "The model in which the page content is written.\n\nUsed as label at [{{fullurl:Main Page|action=info}} action=info]. Followed by one of the following messages:\n* {{msg-mw|Content-model-wikitext}}\n* {{msg-mw|Content-model-javascript}}\n* {{msg-mw|Content-model-css}}\n* {{msg-mw|Content-model-text}}", + "pageinfo-content-model-change": "Link text for a link to Special:ChangeContentModel. The link will be wrapped in parenthesis.", "pageinfo-robot-policy": "The search engine status of the page.\n\nUsed as label. Followed by any one of the following messages:\n*{{msg-mw|Pageinfo-robot-index}}\n*{{msg-mw|Pageinfo-robot-noindex}}", "pageinfo-robot-index": "An indication that the page is indexable by search engines, that is listed in their search results.\n\nPreceded by the label {{msg-mw|Pageinfo-robot-policy}}.\n{{Identical|Allowed}}", "pageinfo-robot-noindex": "An indication that the page is not indexable (that is, is not listed on the results page of a search engine).\n\nPreceded by the label {{msg-mw|Pageinfo-robot-policy}}.", -- To view, visit https://gerrit.wikimedia.org/r/309492 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I084e8f390f90d29ed2e2d0f8ab43bcdfe8538ad1 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Brian Wolff Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: rollback: Log content model changes
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/309508 Change subject: rollback: Log content model changes .. rollback: Log content model changes If the content model changes during a rollback, make sure it is logged to Special:Log/contentmodel. Change-Id: Icd9a2b0221468936e186178ef09141c09e053cbb --- M includes/page/WikiPage.php 1 file changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/08/309508/1 diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index f1e59de..d5dfd3d 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -3235,9 +3235,12 @@ $flags |= EDIT_FORCE_BOT; } + $targetContent = $target->getContent(); + $changingContentModel = $targetContent->getModel() !== $current->getContentModel(); + // Actually store the edit $status = $this->doEditContent( - $target->getContent(), + $targetContent, $summary, $flags, $target->getId(), @@ -3287,6 +3290,22 @@ ] ]; } + if ( $changingContentModel ) { + // If the content model changed during the rollback, + // make sure it gets logged to Special:Log/contentmodel + $log = new ManualLogEntry( 'contentmodel', 'change' ); + $log->setPerformer( $guser ); + $log->setTarget( $this->mTitle ); + $log->setComment( $summary ); + $log->setParameters( [ + '4::oldmodel' => $current->getContentModel(), + '5::newmodel' => $targetContent->getModel(), + ] ); + + $logId = $log->insert( $dbw ); + $log->publish( $logId ); + } + $revId = $statusRev->getId(); Hooks::run( 'ArticleRollbackComplete', [ $this, $guser, $target, $current ] ); -- To view, visit https://gerrit.wikimedia.org/r/309508 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icd9a2b0221468936e186178ef09141c09e053cbb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Make editing the image field work via GUI editor.
jenkins-bot has submitted this change and it was merged. Change subject: Make editing the image field work via GUI editor. .. Make editing the image field work via GUI editor. Bug: T144683 Change-Id: I9c7630cca0d7732d26127f150b0f972dee721f4e --- M modules/ext.CollaborationKit.list.edit.js 1 file changed, 7 insertions(+), 10 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ext.CollaborationKit.list.edit.js b/modules/ext.CollaborationKit.list.edit.js index 4ec524d..9e1362f 100644 --- a/modules/ext.CollaborationKit.list.edit.js +++ b/modules/ext.CollaborationKit.list.edit.js @@ -346,11 +346,14 @@ dialog = this; getCurrentJson( mw.config.get( 'wgArticleId' ), function ( res ) { - var itemToAdd = { + var index, itemToAdd = { title: title, notes: notes - }, - index; + }; + + if ( file ) { + itemToAdd.image = file; + } if ( dialog.itemIndex ) { if (res.content.items <= dialog.itemIndex || res.content.items[ dialog.itemIndex ].title !== dialog.itemTitle @@ -364,13 +367,7 @@ } else { index = res.content.items.length; } - res.content.items[ index ] = { - title: title, - notes: notes - }; - if ( file !== '' ) { - itemToAdd.image = file; - } + res.content.items[ index ] = itemToAdd; res.summary = mw.msg( 'collaborationkit-list-add-summary', title ); saveJson( res, function () { dialog.close(); // FIXME should we just leave open? -- To view, visit https://gerrit.wikimedia.org/r/309507 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9c7630cca0d7732d26127f150b0f972dee721f4e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: Brian WolffGerrit-Reviewer: Brian Wolff 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...CollaborationKit[master]: Make editing the image field work via GUI editor.
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/309507 Change subject: Make editing the image field work via GUI editor. .. Make editing the image field work via GUI editor. Bug: T144683 Change-Id: I9c7630cca0d7732d26127f150b0f972dee721f4e --- M modules/ext.CollaborationKit.list.edit.js 1 file changed, 7 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit refs/changes/07/309507/1 diff --git a/modules/ext.CollaborationKit.list.edit.js b/modules/ext.CollaborationKit.list.edit.js index 4ec524d..9e1362f 100644 --- a/modules/ext.CollaborationKit.list.edit.js +++ b/modules/ext.CollaborationKit.list.edit.js @@ -346,11 +346,14 @@ dialog = this; getCurrentJson( mw.config.get( 'wgArticleId' ), function ( res ) { - var itemToAdd = { + var index, itemToAdd = { title: title, notes: notes - }, - index; + }; + + if ( file ) { + itemToAdd.image = file; + } if ( dialog.itemIndex ) { if (res.content.items <= dialog.itemIndex || res.content.items[ dialog.itemIndex ].title !== dialog.itemTitle @@ -364,13 +367,7 @@ } else { index = res.content.items.length; } - res.content.items[ index ] = { - title: title, - notes: notes - }; - if ( file !== '' ) { - itemToAdd.image = file; - } + res.content.items[ index ] = itemToAdd; res.summary = mw.msg( 'collaborationkit-list-add-summary', title ); saveJson( res, function () { dialog.close(); // FIXME should we just leave open? -- To view, visit https://gerrit.wikimedia.org/r/309507 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c7630cca0d7732d26127f150b0f972dee721f4e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: Brian Wolff___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Only apply DB_MASTER fallback in Revision::fetchText() if RE...
jenkins-bot has submitted this change and it was merged. Change subject: Only apply DB_MASTER fallback in Revision::fetchText() if READ_LATEST .. Only apply DB_MASTER fallback in Revision::fetchText() if READ_LATEST Add support to DBAccessObjectUtils for fallback logic to make this simple for other callers too. Change-Id: I58ab7bd7d31a481f9dc9a773392ea90feb1ebeac --- M includes/Revision.php M includes/dao/DBAccessObjectUtils.php 2 files changed, 63 insertions(+), 28 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Revision.php b/includes/Revision.php index ef0f03d..0f8d0bd 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -1608,25 +1608,38 @@ $row = null; } + // Callers doing updates will pass in READ_LATEST as usual. Since the text/blob tables + // do not normally get rows changed around, set READ_LATEST_IMMUTABLE in those cases. + $flags = $this->mQueryFlags; + $flags |= DBAccessObjectUtils::hasFlags( $flags, self::READ_LATEST ) + ? self::READ_LATEST_IMMUTABLE + : 0; + + list( $index, $options, $fallbackIndex, $fallbackOptions ) = + DBAccessObjectUtils::getDBOptions( $flags ); + if ( !$row ) { // Text data is immutable; check replica DBs first. - $dbr = wfGetDB( DB_REPLICA ); - $row = $dbr->selectRow( 'text', - [ 'old_text', 'old_flags' ], - [ 'old_id' => $textId ], - __METHOD__ ); - } - - // Fallback to the master in case of replica DB lag. Also use FOR UPDATE if it was - // used to fetch this revision to avoid missing the row due to REPEATABLE-READ. - $forUpdate = ( $this->mQueryFlags & self::READ_LOCKING == self::READ_LOCKING ); - if ( !$row && ( $forUpdate || wfGetLB()->getServerCount() > 1 ) ) { - $dbw = wfGetDB( DB_MASTER ); - $row = $dbw->selectRow( 'text', + $row = wfGetDB( $index )->selectRow( + 'text', [ 'old_text', 'old_flags' ], [ 'old_id' => $textId ], __METHOD__, - $forUpdate ? [ 'FOR UPDATE' ] : [] ); + $options + ); + } + + // Fallback to DB_MASTER in some cases if the row was not found + if ( !$row && $fallbackIndex !== null ) { + // Use FOR UPDATE if it was used to fetch this revision. This avoids missing the row + // due to REPEATABLE-READ. Also fallback to the master if READ_LATEST is provided. + $row = wfGetDB( $fallbackIndex )->selectRow( + 'text', + [ 'old_text', 'old_flags' ], + [ 'old_id' => $textId ], + __METHOD__, + $fallbackOptions + ); } if ( !$row ) { diff --git a/includes/dao/DBAccessObjectUtils.php b/includes/dao/DBAccessObjectUtils.php index 1fc9ae7..cc63446 100644 --- a/includes/dao/DBAccessObjectUtils.php +++ b/includes/dao/DBAccessObjectUtils.php @@ -26,7 +26,7 @@ * * @since 1.26 */ -class DBAccessObjectUtils { +class DBAccessObjectUtils implements IDBAccessObject { /** * @param integer $bitfield * @param integer $flags IDBAccessObject::READ_* constant @@ -37,23 +37,45 @@ } /** -* Get an appropriate DB index and options for a query +* Get an appropriate DB index, options, and fallback DB index for a query * -* @param integer $bitfield -* @return array (DB_MASTER/DB_REPLICA, SELECT options array) +* The fallback DB index and options are to be used if the entity is not found +* with the initial DB index, typically querying the master DB to avoid lag +* +* @param integer $bitfield Bitfield of IDBAccessObject::READ_* constants +* @return array List of DB indexes and options in this order: +* - DB_MASTER or DB_REPLICA constant for the initial query +* - SELECT options array for the initial query +* - DB_MASTER constant for the fallback query; null if no fallback should happen +* - SELECT options array for the fallback query; empty if no fallback should happen */ public static function getDBOptions( $bitfield ) { -
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Update composer libs
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/309506 Change subject: Update composer libs .. Update composer libs Change-Id: Ic4aec7f6cf245d030133f116fc6018c7737f4401 --- M composer.lock 1 file changed, 23 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/06/309506/1 diff --git a/composer.lock b/composer.lock index c8a1cb4..132fad8 100644 --- a/composer.lock +++ b/composer.lock @@ -249,7 +249,6 @@ "messaging", "stomp" ], -"abandoned": "stomp-php/stomp-php", "time": "2013-02-23 17:34:44" }, { @@ -690,7 +689,7 @@ }, { "name": "symfony/event-dispatcher", -"version": "v2.8.9", +"version": "v2.8.11", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git;, @@ -750,16 +749,16 @@ }, { "name": "symfony/http-foundation", -"version": "v2.8.9", +"version": "v2.8.11", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git;, -"reference": "f20bea598906c990eebe3c70a63ca5ed18cdbc11" +"reference": "1d4ab8de2215e44e57fddc1e6b5d122546769e7d" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/symfony/http-foundation/zipball/f20bea598906c990eebe3c70a63ca5ed18cdbc11;, -"reference": "f20bea598906c990eebe3c70a63ca5ed18cdbc11", +"url": "https://api.github.com/repos/symfony/http-foundation/zipball/1d4ab8de2215e44e57fddc1e6b5d122546769e7d;, +"reference": "1d4ab8de2215e44e57fddc1e6b5d122546769e7d", "shasum": "" }, "require": { @@ -801,7 +800,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com;, -"time": "2016-07-30 07:20:35" +"time": "2016-09-06 10:55:00" }, { "name": "symfony/polyfill-mbstring", @@ -978,16 +977,16 @@ }, { "name": "symfony/yaml", -"version": "v2.8.9", +"version": "v2.8.11", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git;, -"reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d" +"reference": "e7540734bad981fe59f8ef14b6fc194ae9df8d9c" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/symfony/yaml/zipball/0ceab136f43ed9d3e97b3eea32a7855dc50c121d;, -"reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d", +"url": "https://api.github.com/repos/symfony/yaml/zipball/e7540734bad981fe59f8ef14b6fc194ae9df8d9c;, +"reference": "e7540734bad981fe59f8ef14b6fc194ae9df8d9c", "shasum": "" }, "require": { @@ -1023,20 +1022,20 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com;, -"time": "2016-07-17 09:06:15" +"time": "2016-09-02 01:57:56" }, { "name": "twig/twig", -"version": "v1.24.1", +"version": "v1.24.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git;, -"reference": "3566d311a92aae4deec6e48682dc5a4528c4a512" +"reference": "33093f6e310e6976baeac7b14f3a6ec02f2d79b7" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/twigphp/Twig/zipball/3566d311a92aae4deec6e48682dc5a4528c4a512;, -"reference": "3566d311a92aae4deec6e48682dc5a4528c4a512", +"url": "https://api.github.com/repos/twigphp/Twig/zipball/33093f6e310e6976baeac7b14f3a6ec02f2d79b7;, +"reference": "33093f6e310e6976baeac7b14f3a6ec02f2d79b7", "shasum": "" }, "require": { @@ -1084,7 +1083,7 @@ "keywords": [ "templating" ], -"time": "2016-05-30 09:11:59" +"time": "2016-09-01 17:50:53" }, { "name": "wikimedia/donation-interface", @@ -1092,7 +1091,7 @@ "source": { "type": "git", "url": "https://gerrit.wikimedia.org/r/mediawiki/extensions/DonationInterface.git;, -"reference": "1e2fd3deade07d4663999496dd0aa79c27eb9d2d" +"reference":
[MediaWiki-commits] [Gerrit] oojs/ui[master]: Show left border on action tool groups, instead of right
jenkins-bot has submitted this change and it was merged. Change subject: Show left border on action tool groups, instead of right .. Show left border on action tool groups, instead of right Show a right border on the whole toolbar if it is not the last child (e.g. there is a save button on the right). Change-Id: I3e54b77880d8e59711662af6984193628a0d4c2c --- M src/themes/mediawiki/tools.less 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: VolkerE: Looks good to me, approved jenkins-bot: Verified diff --git a/src/themes/mediawiki/tools.less b/src/themes/mediawiki/tools.less index 8716bcf..2c64d46 100644 --- a/src/themes/mediawiki/tools.less +++ b/src/themes/mediawiki/tools.less @@ -30,6 +30,10 @@ } } } + + > .oo-ui-toolbar:not( :last-child ) { + border-right: @border-default; + } } } @@ -77,6 +81,11 @@ .theme-oo-ui-toolGroup () { border-right: @border-default; + .oo-ui-toolbar-actions & { + border-right: 0; + border-left: @border-default; + } + .oo-ui-toolbar-narrow & { + .oo-ui-toolGroup { margin-left: 0; -- To view, visit https://gerrit.wikimedia.org/r/309206 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e54b77880d8e59711662af6984193628a0d4c2c Gerrit-PatchSet: 2 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: EsandersGerrit-Reviewer: Esanders Gerrit-Reviewer: VolkerE Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Avoid $wmfMasterDatacenter notices from noc files
jenkins-bot has submitted this change and it was merged. Change subject: Avoid $wmfMasterDatacenter notices from noc files .. Avoid $wmfMasterDatacenter notices from noc files Bug: T143784 Change-Id: I2a37bac1106628154236b2946d700cfd90911ae0 --- M docroot/noc/db.php M wmf-config/InitialiseSettings.php 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/docroot/noc/db.php b/docroot/noc/db.php index 76f7354..ad010db 100644 --- a/docroot/noc/db.php +++ b/docroot/noc/db.php @@ -13,7 +13,7 @@ ini_set( 'display_errors', 1 ); # some lame definitions used in db.php -$wgDBname = $wgDBuser = $wgDBpassword = null; +$wgDBname = $wgDBuser = $wgDBpassword = $wmfMasterDatacenter = null; define( 'DBO_DEFAULT', 'uniq' ); require_once( '../../wmf-config/db-eqiad.php' ); diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 9350bde..b79c28e 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -19,7 +19,7 @@ # Globals set in CommonSettings.php for use in settings values global $wmfUdp2logDest, $wmfDatacenter, $wmfRealm, $wmfConfigDir, $wgConf, - $wmfAllServices, $wmfLocalServices, $wmfMasterServices; + $wmfAllServices, $wmfLocalServices, $wmfMasterServices, $wmfMasterDatacenter; $wgConf->settings = [ -- To view, visit https://gerrit.wikimedia.org/r/309503 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2a37bac1106628154236b2946d700cfd90911ae0 Gerrit-PatchSet: 4 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Florianschmidtwelzow 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/core[master]: API: When undoing an edit, allow overriding content model.
jenkins-bot has submitted this change and it was merged. Change subject: API: When undoing an edit, allow overriding content model. .. API: When undoing an edit, allow overriding content model. This brings the API in line with web UI changes from Ic528f65d. Bug: T145044 Change-Id: Ib97eef38d228c4da4b062ee96dd926ee665b --- M includes/api/ApiEditPage.php M tests/phpunit/includes/api/ApiEditPageTest.php 2 files changed, 73 insertions(+), 7 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 00daba9..ee9150c 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -97,6 +97,7 @@ } else { $contentHandler = ContentHandler::getForModelID( $params['contentmodel'] ); } + $contentModel = $contentHandler->getModelID(); $name = $titleObj->getPrefixedDBkey(); $model = $contentHandler->getModelID(); @@ -111,10 +112,10 @@ } if ( !isset( $params['contentformat'] ) || $params['contentformat'] == '' ) { - $params['contentformat'] = $contentHandler->getDefaultFormat(); + $contentFormat = $contentHandler->getDefaultFormat(); + } else { + $contentFormat = $params['contentformat']; } - - $contentFormat = $params['contentformat']; if ( !$contentHandler->isSupportedFormat( $contentFormat ) ) { @@ -265,9 +266,21 @@ if ( !$newContent ) { $this->dieUsageMsg( 'undo-failure' ); } - - $params['text'] = $newContent->serialize( $params['contentformat'] ); - + if ( empty( $params['contentmodel'] ) + && empty( $params['contentformat'] ) + ) { + // If we are reverting content model, the new content model + // might not support the current serialization format, in + // which case go back to the old serialization format, + // but only if the user hasn't specified a format/model + // parameter. + if ( !$newContent->isSupportedFormat( $contentFormat ) ) { + $contentFormat = $undoafterRev->getContentFormat(); + } + // Override content model with model of undid revision. + $contentModel = $newContent->getModel(); + } + $params['text'] = $newContent->serialize( $contentFormat ); // If no summary was given and we only undid one rev, // use an autosummary if ( is_null( $params['summary'] ) && @@ -288,7 +301,7 @@ $requestArray = [ 'wpTextbox1' => $params['text'], 'format' => $contentFormat, - 'model' => $contentHandler->getModelID(), + 'model' => $contentModel, 'wpEditToken' => $params['token'], 'wpIgnoreBlankSummary' => true, 'wpIgnoreBlankArticle' => true, diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php index 7a8e208..02d0a0d 100644 --- a/tests/phpunit/includes/api/ApiEditPageTest.php +++ b/tests/phpunit/includes/api/ApiEditPageTest.php @@ -513,4 +513,57 @@ $this->assertEquals( "testing-nontext", $page->getContentModel() ); $this->assertEquals( $data, $page->getContent()->serialize() ); } + + /** +* This test verifies that after changing the content model +* of a page, undoing that edit via the API will also +* undo the content model change. +*/ + public function testUndoAfterContentModelChange() { + $name = 'Help:' . __FUNCTION__; + $uploader = self::$users['uploader']->getUser(); + $sysop = self::$users['sysop']->getUser(); + $apiResult = $this->doApiRequestWithToken( [ + 'action' => 'edit', + 'title' => $name, + 'text' => 'some text', + ], null, $sysop )[0]; + + // Check success + $this->assertArrayHasKey( 'edit', $apiResult ); + $this->assertArrayHasKey( 'result', $apiResult['edit'] ); + $this->assertEquals( 'Success', $apiResult['edit']['result'] ); +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Allow undoing edits that change content model if top
jenkins-bot has submitted this change and it was merged. Change subject: Allow undoing edits that change content model if top .. Allow undoing edits that change content model if top This allows people to revert content model changes using the undo button, provided that we are undoing the topmost edit (Otherwise it may get confusing if you try to undo an edit in the middle of the history that changes content model). Bug: T145044 Change-Id: Ic528f65d0dc581c4e241a22f19c512e02aeaa9e7 --- M includes/EditPage.php M includes/content/ContentHandler.php 2 files changed, 43 insertions(+), 15 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/EditPage.php b/includes/EditPage.php index 4e9aeba..7e4e411 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -562,16 +562,29 @@ $revision = $this->mArticle->getRevisionFetched(); // Disallow editing revisions with content models different from the current one - if ( $revision && $revision->getContentModel() !== $this->contentModel ) { - $this->displayViewSourcePage( - $this->getContentObject(), - wfMessage( - 'contentmodelediterror', - $revision->getContentModel(), - $this->contentModel - )->plain() - ); - return; + // Undo edits being an exception in order to allow reverting content model changes. + if ( $revision + && $revision->getContentModel() !== $this->contentModel + ) { + $prevRev = null; + if ( $this->undidRev ) { + $undidRevObj = Revision::newFromId( $this->undidRev ); + $prevRev = $undidRevObj ? $undidRevObj->getPrevious() : null; + } + if ( !$this->undidRev + || !$prevRev + || $prevRev->getContentModel() !== $this->contentModel + ) { + $this->displayViewSourcePage( + $this->getContentObject(), + wfMessage( + 'contentmodelediterror', + $revision->getContentModel(), + $this->contentModel + )->plain() + ); + return; + } } $this->isConflict = false; @@ -1134,6 +1147,14 @@ $oldContent = $this->page->getContent( Revision::RAW ); $popts = ParserOptions::newFromUserAndLang( $wgUser, $wgContLang ); $newContent = $content->preSaveTransform( $this->mTitle, $wgUser, $popts ); + if ( $newContent->getModel() !== $oldContent->getModel() ) { + // The undo may change content + // model if its reverting the top + // edit. This can result in + // mismatched content model/format. + $this->contentModel = $newContent->getModel(); + $this->contentFormat = $oldrev->getContentFormat(); + } if ( $newContent->equals( $oldContent ) ) { # Tell the user that the undo results in no change, @@ -1264,9 +1285,11 @@ $handler = ContentHandler::getForModelID( $this->contentModel ); return $handler->makeEmptyContent(); - } else { + } elseif ( !$this->undidRev ) { // Content models should always be the same since we error - // out if they are different before this point. + // out if they are different before this point (in ->edit()). + // The exception being, during an undo, the current revision might +
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Sort by alphabetical order mediawiki::packages::multimedia
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/309504 Change subject: Sort by alphabetical order mediawiki::packages::multimedia .. Sort by alphabetical order mediawiki::packages::multimedia Change-Id: Ib52347afc696246c8d868646ff14a4e685557d32 --- M modules/mediawiki/manifests/packages/multimedia.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/04/309504/1 diff --git a/modules/mediawiki/manifests/packages/multimedia.pp b/modules/mediawiki/manifests/packages/multimedia.pp index e89ced2..4638244 100644 --- a/modules/mediawiki/manifests/packages/multimedia.pp +++ b/modules/mediawiki/manifests/packages/multimedia.pp @@ -8,6 +8,7 @@ 'ffmpeg2theora', 'fontconfig-config', 'ghostscript', +'libimage-exiftool-perl', 'libjpeg-turbo-progs', 'libogg0', 'libtheora0', @@ -15,7 +16,6 @@ 'libvorbisenc2', 'netpbm', 'oggvideotools', -'libimage-exiftool-perl', ]: ensure => present, } -- To view, visit https://gerrit.wikimedia.org/r/309504 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib52347afc696246c8d868646ff14a4e685557d32 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Install exiv2 to mediawiki::packages::multimedia
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/309505 Change subject: Install exiv2 to mediawiki::packages::multimedia .. Install exiv2 to mediawiki::packages::multimedia VIPS scaled thumbnails don't have a comment with a link to the file description page. To implement this option, we need to run exiv2 to extract metadata. Bug: T71336 Change-Id: I0eb9a0c462ba33a3aee232964e71ae835898a620 --- M modules/mediawiki/manifests/packages/multimedia.pp 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/05/309505/1 diff --git a/modules/mediawiki/manifests/packages/multimedia.pp b/modules/mediawiki/manifests/packages/multimedia.pp index 4638244..9b90be2 100644 --- a/modules/mediawiki/manifests/packages/multimedia.pp +++ b/modules/mediawiki/manifests/packages/multimedia.pp @@ -16,6 +16,7 @@ 'libvorbisenc2', 'netpbm', 'oggvideotools', + 'pyexiv2', # T71336 ]: ensure => present, } -- To view, visit https://gerrit.wikimedia.org/r/309505 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0eb9a0c462ba33a3aee232964e71ae835898a620 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Avoid $wmfMasterDatacenter notices from noc files
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/309503 Change subject: Avoid $wmfMasterDatacenter notices from noc files .. Avoid $wmfMasterDatacenter notices from noc files Bug: 143785 Change-Id: I2a37bac1106628154236b2946d700cfd90911ae0 --- M docroot/noc/db.php M wmf-config/InitialiseSettings.php 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/03/309503/1 diff --git a/docroot/noc/db.php b/docroot/noc/db.php index 76f7354..ad010db 100644 --- a/docroot/noc/db.php +++ b/docroot/noc/db.php @@ -13,7 +13,7 @@ ini_set( 'display_errors', 1 ); # some lame definitions used in db.php -$wgDBname = $wgDBuser = $wgDBpassword = null; +$wgDBname = $wgDBuser = $wgDBpassword = $wmfMasterDatacenter = null; define( 'DBO_DEFAULT', 'uniq' ); require_once( '../../wmf-config/db-eqiad.php' ); diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 0453905..f75b385 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -19,7 +19,7 @@ # Globals set in CommonSettings.php for use in settings values global $wmfUdp2logDest, $wmfDatacenter, $wmfRealm, $wmfConfigDir, $wgConf, - $wmfAllServices, $wmfLocalServices, $wmfMasterServices; + $wmfAllServices, $wmfLocalServices, $wmfMasterServices, $wmfMasterDatacenter; $wgConf->settings = [ -- To view, visit https://gerrit.wikimedia.org/r/309503 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2a37bac1106628154236b2946d700cfd90911ae0 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Rename mediawiki.action.history.diff to mediawiki.diff.styles
jenkins-bot has submitted this change and it was merged. Change subject: Rename mediawiki.action.history.diff to mediawiki.diff.styles .. Rename mediawiki.action.history.diff to mediawiki.diff.styles Depends-On: I7ecc08417c5f1870ed6f2ca139fd953d68f6ec8e Change-Id: I638b23cd8bc67075e82517a0e1e435670db98a39 --- M extension.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index 92d2c0f..85c755d 100644 --- a/extension.json +++ b/extension.json @@ -1182,7 +1182,7 @@ "dependencies": [ "ext.visualEditor.core", "mediawiki.Title", - "mediawiki.action.history.diff", + "mediawiki.diff.styles", "mediawiki.user", "mediawiki.util", "mediawiki.jqueryMsg", -- To view, visit https://gerrit.wikimedia.org/r/307487 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I638b23cd8bc67075e82517a0e1e435670db98a39 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: WMDE-leszekGerrit-Reviewer: Jforrester Gerrit-Reviewer: WMDE-leszek 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/core[master]: Make sure the lock in JobRunner::commitMasterChanges() releases
jenkins-bot has submitted this change and it was merged. Change subject: Make sure the lock in JobRunner::commitMasterChanges() releases .. Make sure the lock in JobRunner::commitMasterChanges() releases Used a ScopedCallback in case of exception to avoid queue backup Change-Id: I58a5f152a54ed9a0d5544014788792bd62afbf4a --- M includes/jobqueue/JobRunner.php 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php index 7a6b5fc..570d6db 100644 --- a/includes/jobqueue/JobRunner.php +++ b/includes/jobqueue/JobRunner.php @@ -537,6 +537,10 @@ // This will trigger a rollback in the main loop throw new DBError( $dbwSerial, "Timed out waiting on commit queue." ); } + $unlocker = new ScopedCallback( function () use ( $dbwSerial ) { + $dbwSerial->unlock( 'jobrunner-serial-commit', __METHOD__ ); + } ); + // Wait for the replica DBs to catch up $pos = $lb->getMasterPos(); if ( $pos ) { @@ -545,8 +549,6 @@ // Actually commit the DB master changes $lbFactory->commitMasterChanges( $fnameTrxOwner ); - - // Release the lock - $dbwSerial->unlock( 'jobrunner-serial-commit', __METHOD__ ); + ScopedCallback::consume( $unlocker ); } } -- To view, visit https://gerrit.wikimedia.org/r/309268 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I58a5f152a54ed9a0d5544014788792bd62afbf4a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Legoktm 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...SpamBlacklist[master]: Actually use STASH_TTL constant and bump it to 3 minutes
jenkins-bot has submitted this change and it was merged. Change subject: Actually use STASH_TTL constant and bump it to 3 minutes .. Actually use STASH_TTL constant and bump it to 3 minutes Change-Id: Ia50296919a5c8bdeb63496397c538f39d43c4d54 --- M SpamBlacklist_body.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/SpamBlacklist_body.php b/SpamBlacklist_body.php index 137947a..43ea74d 100644 --- a/SpamBlacklist_body.php +++ b/SpamBlacklist_body.php @@ -7,8 +7,8 @@ use \MediaWiki\MediaWikiServices; class SpamBlacklist extends BaseBlacklist { - const STASH_TTL = 60; - const STASH_AGE_DYING = 30; + const STASH_TTL = 180; + const STASH_AGE_DYING = 150; /** * Changes to external links, for logging purposes @@ -154,7 +154,7 @@ if ( $retVal === false ) { // Cache the typical negative results - $cache->set( $key, time(), $cache::TTL_MINUTE ); + $cache->set( $key, time(), self::STASH_TTL ); if ( $mode === 'stash' ) { $statsd->increment( 'spamblacklist.check-stash.store' ); } -- To view, visit https://gerrit.wikimedia.org/r/309495 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia50296919a5c8bdeb63496397c538f39d43c4d54 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/SpamBlacklist Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Jackmcbarn Gerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] performance/WebPageTest[master]: Collect response bodies for text assets
jenkins-bot has submitted this change and it was merged. Change subject: Collect response bodies for text assets .. Collect response bodies for text assets Collecting response bodies for all text assets makes it possible to actually see what we send to the browser. Bug: T116981 Change-Id: Id27464a67455e1e36de80ec99103d1dca923af9c --- M scripts/batch/desktop.txt M scripts/batch/mobile.txt 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/batch/desktop.txt b/scripts/batch/desktop.txt index 06197c8..79fbd47 100644 --- a/scripts/batch/desktop.txt +++ b/scripts/batch/desktop.txt @@ -10,7 +10,7 @@ # $ WMF_WPT_KEY=SECRET_KEY STATSV_ENDPOINT=http://localhost WPT_RUNS=1 WMF_WPT_LOCATION=us-west-1 bin/index.js --batch scripts/batch/desktop.txt # Collect metrics using Chrome ---webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.enwiki.anonymous.Facebook --reporter statsv --timeline true https://en.wikipedia.org/wiki/Facebook +--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.enwiki.anonymous.Facebook --reporter statsv --timeline true --bodies true https://en.wikipedia.org/wiki/Facebook --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.test2wiki.anonymous.signup --reporter statsv --first true https://test2.wikipedia.org/w/index.php?title=Special:UserLogin=signup diff --git a/scripts/batch/mobile.txt b/scripts/batch/mobile.txt index 5d5dbf5..7d88ceb 100644 --- a/scripts/batch/mobile.txt +++ b/scripts/batch/mobile.txt @@ -11,7 +11,7 @@ # Example (make sure to change WMF_WPT_KEY) # $ WMF_WPT_KEY=SECRET_KEY STATSV_ENDPOINT=http://localhost WPT_MOBILE_RUNS=1 WMF_WPT_LOCATION=us-west-1 bin/index.js --batch ./scripts/batch/mobile.txt ---webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome-emulated-m --runs <%WPT_MOBILE_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.enwiki-mobile.anonymous.Facebook --emulateMobile true --connectivity 3GFast --reporter statsv --timeline true https://en.m.wikipedia.org/wiki/Facebook +--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome-emulated-m --runs <%WPT_MOBILE_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.enwiki-mobile.anonymous.Facebook --emulateMobile true --connectivity 3GFast --reporter statsv --timeline true --bodies true https://en.m.wikipedia.org/wiki/Facebook --webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>:Chrome --label chrome-emulated-m-2g --runs <%WPT_MOBILE_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.enwiki-mobile-2gslow.anonymous.Barack_Obama --emulateMobile true --bandwidthDown 35000 --bandwidthUp 32000 --latency 1300 --connectivity custom --reporter statsv --first true https://en.m.wikipedia.org/wiki/Barack_Obama -- To view, visit https://gerrit.wikimedia.org/r/308939 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id27464a67455e1e36de80ec99103d1dca923af9c Gerrit-PatchSet: 1 Gerrit-Project: performance/WebPageTest Gerrit-Branch: master Gerrit-Owner: PhedenskogGerrit-Reviewer: Gilles Gerrit-Reviewer: Krinkle 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/core[master]: Switch some callers to WaitConditionLoop
jenkins-bot has submitted this change and it was merged. Change subject: Switch some callers to WaitConditionLoop .. Switch some callers to WaitConditionLoop Also fixed up backwards documentation Change-Id: I00c36aa751a79ca86a754e049a6da78cbb417b81 --- M includes/db/DatabasePostgres.php M includes/filebackend/lockmanager/LockManager.php M includes/filebackend/lockmanager/MemcLockManager.php M includes/libs/WaitConditionLoop.php M includes/libs/objectcache/BagOStuff.php M tests/phpunit/includes/libs/WaitConditionLoopTest.php 6 files changed, 94 insertions(+), 70 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 9cd95a1..0a178de 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -1588,21 +1588,21 @@ */ public function lock( $lockName, $method, $timeout = 5 ) { $key = $this->addQuotes( $this->bigintFromLockName( $lockName ) ); - for ( $attempts = 1; $attempts <= $timeout; ++$attempts ) { - $result = $this->query( - "SELECT pg_try_advisory_lock($key) AS lockstatus", $method ); - $row = $this->fetchObject( $result ); - if ( $row->lockstatus === 't' ) { - parent::lock( $lockName, $method, $timeout ); // record - return true; - } else { - sleep( 1 ); - } - } + $loop = new WaitConditionLoop( + function () use ( $lockName, $key, $timeout, $method ) { + $res = $this->query( "SELECT pg_try_advisory_lock($key) AS lockstatus", $method ); + $row = $this->fetchObject( $res ); + if ( $row->lockstatus === 't' ) { + parent::lock( $lockName, $method, $timeout ); // record + return true; + } - wfDebug( __METHOD__ . " failed to acquire lock\n" ); + return WaitConditionLoop::CONDITION_CONTINUE; + }, + $timeout + ); - return false; + return ( $loop->invoke() === $loop::CONDITION_REACHED ); } /** diff --git a/includes/filebackend/lockmanager/LockManager.php b/includes/filebackend/lockmanager/LockManager.php index 567a298..a3cb3b1 100644 --- a/includes/filebackend/lockmanager/LockManager.php +++ b/includes/filebackend/lockmanager/LockManager.php @@ -103,17 +103,17 @@ */ final public function lockByType( array $pathsByType, $timeout = 0 ) { $pathsByType = $this->normalizePathsByType( $pathsByType ); - $msleep = [ 0, 50, 100, 300, 500 ]; // retry backoff times - $start = microtime( true ); - do { - $status = $this->doLockByType( $pathsByType ); - $elapsed = microtime( true ) - $start; - if ( $status->isOK() || $elapsed >= $timeout || $elapsed < 0 ) { - break; // success, timeout, or clock set back - } - usleep( 1e3 * ( next( $msleep ) ?: 1000 ) ); // use 1 sec after enough times - $elapsed = microtime( true ) - $start; - } while ( $elapsed < $timeout && $elapsed >= 0 ); + + $status = null; + $loop = new WaitConditionLoop( + function () use ( &$status, $pathsByType ) { + $status = $this->doLockByType( $pathsByType ); + + return $status->isOK() ?: WaitConditionLoop::CONDITION_CONTINUE; + }, + $timeout + ); + $loop->invoke(); return $status; } diff --git a/includes/filebackend/lockmanager/MemcLockManager.php b/includes/filebackend/lockmanager/MemcLockManager.php index cb5266a..2f17e27 100644 --- a/includes/filebackend/lockmanager/MemcLockManager.php +++ b/includes/filebackend/lockmanager/MemcLockManager.php @@ -276,6 +276,7 @@ * @return MemcachedBagOStuff|null */ protected function getCache( $lockSrv ) { + /** @var BagOStuff $memc */ $memc = null; if ( isset( $this->bagOStuffs[$lockSrv] ) ) { $memc = $this->bagOStuffs[$lockSrv]; @@ -337,20 +338,21 @@ // Try to quickly loop to acquire the keys, but back off after a few rounds. // This reduces memcached
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: LinkFilter: Fix return types in phpdoc
jenkins-bot has submitted this change and it was merged. Change subject: LinkFilter: Fix return types in phpdoc .. LinkFilter: Fix return types in phpdoc Change-Id: I870d348a1515ce9ad5b15fe65354919c46c96e54 --- M includes/LinkFilter.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/LinkFilter.php b/includes/LinkFilter.php index d86291a..7b3d72b 100644 --- a/includes/LinkFilter.php +++ b/includes/LinkFilter.php @@ -89,7 +89,7 @@ * * @param string $filterEntry Domainparts * @param string $protocol Protocol (default http://) -* @return array Array to be passed to Database::buildLike() or false on error +* @return array|bool Array to be passed to Database::buildLike() or false on error */ public static function makeLikeArray( $filterEntry, $protocol = 'http://' ) { $db = wfGetDB( DB_REPLICA ); -- To view, visit https://gerrit.wikimedia.org/r/308884 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I870d348a1515ce9ad5b15fe65354919c46c96e54 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Jforrester 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...CentralAuth[master]: Make shouldUseMasterDB() no longer check isSafeRequest()
jenkins-bot has submitted this change and it was merged. Change subject: Make shouldUseMasterDB() no longer check isSafeRequest() .. Make shouldUseMasterDB() no longer check isSafeRequest() This avoids DBPerformance warnings about master connections. The check was originally meant to be temporary while DB_MASTER and READ_LATEST flags were added, which was done a while ago. Change-Id: I4eb10817cccb40aa255909b77500d77c159e8e4b --- M includes/CentralAuthUser.php 1 file changed, 0 insertions(+), 7 deletions(-) Approvals: Krinkle: Looks good to me, but someone else must approve Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php index 51de808..0e61c60 100644 --- a/includes/CentralAuthUser.php +++ b/includes/CentralAuthUser.php @@ -243,13 +243,6 @@ if ( $this->mFromMaster === null ) { $this->mFromMaster = self::centralLBHasRecentMasterChanges(); - // Use the master DB on HTTP POST and CLI mode since: - // (a) State changes may need to occur for centralauth tables - // (b) Such requests route to the master datacenter, so using the master is fast - // @TODO: dependency inject this as a flag...there are *many* callers though... - if ( !RequestContext::getMain()->getRequest()->isSafeRequest() ) { - $this->mFromMaster = true; - } } return $this->mFromMaster; -- To view, visit https://gerrit.wikimedia.org/r/309243 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4eb10817cccb40aa255909b77500d77c159e8e4b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralAuth Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Anomie Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Legoktm 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/core[master]: FauxRequest: Add unit tests to expand code coverage
jenkins-bot has submitted this change and it was merged. Change subject: FauxRequest: Add unit tests to expand code coverage .. FauxRequest: Add unit tests to expand code coverage * Remove @covers for methods that don't exist (parent class). * Fix coverage for initHeaders() and setHeaders(). * Add tests and coverage for all other methods. Change-Id: Id9b6de31843d2e87c54f485beb4fbcbe6f4bf8f6 --- M includes/FauxRequest.php M tests/phpunit/includes/FauxRequestTest.php 2 files changed, 165 insertions(+), 11 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/FauxRequest.php b/includes/FauxRequest.php index 158c852..3b2283b 100644 --- a/includes/FauxRequest.php +++ b/includes/FauxRequest.php @@ -226,6 +226,7 @@ } /** +* @codeCoverageIgnore * @param array $extWhitelist * @return bool */ @@ -234,6 +235,7 @@ } /** +* @codeCoverageIgnore * @return string */ protected function getRawIP() { diff --git a/tests/phpunit/includes/FauxRequestTest.php b/tests/phpunit/includes/FauxRequestTest.php index 4622a38..a5d67de 100644 --- a/tests/phpunit/includes/FauxRequestTest.php +++ b/tests/phpunit/includes/FauxRequestTest.php @@ -1,8 +1,143 @@ setExpectedException( MWException::class, 'bogus data' ); + $req = new FauxRequest( 'x' ); + } + + /** +* @covers FauxRequest::__construct +*/ + public function testConstructInvalidSession() { + $this->setExpectedException( MWException::class, 'bogus session' ); + $req = new FauxRequest( [], false, 'x' ); + } + + /** +* @covers FauxRequest::getText +*/ + public function testGetText() { + $req = new FauxRequest( [ 'x' => 'Value' ] ); + $this->assertEquals( 'Value', $req->getText( 'x' ) ); + $this->assertEquals( '', $req->getText( 'z' ) ); + } + + /** +* @covers FauxRequest::getValues +*/ + public function testGetValues() { + $values = [ 'x' => 'Value', 'y' => '' ]; + $req = new FauxRequest( $values ); + $this->assertEquals( $values, $req->getValues() ); + } + + /** +* @covers FauxRequest::getQueryValues +*/ + public function testGetQueryValues() { + $values = [ 'x' => 'Value', 'y' => '' ]; + + $req = new FauxRequest( $values ); + $this->assertEquals( $values, $req->getQueryValues() ); + $req = new FauxRequest( $values, /*wasPosted*/ true ); + $this->assertEquals( [], $req->getQueryValues() ); + } + + /** +* @covers FauxRequest::getMethod +*/ + public function testGetMethod() { + $req = new FauxRequest( [] ); + $this->assertEquals( 'GET', $req->getMethod() ); + $req = new FauxRequest( [], /*wasPosted*/ true ); + $this->assertEquals( 'POST', $req->getMethod() ); + } + + /** +* @covers FauxRequest::wasPosted +*/ + public function testWasPosted() { + $req = new FauxRequest( [] ); + $this->assertFalse( $req->wasPosted() ); + $req = new FauxRequest( [], /*wasPosted*/ true ); + $this->assertTrue( $req->wasPosted() ); + } + + /** +* @covers FauxRequest::getCookie +* @covers FauxRequest::setCookie +* @covers FauxRequest::setCookies +*/ + public function testCookies() { + $req = new FauxRequest(); + $this->assertSame( null, $req->getCookie( 'z', '' ) ); + + $req->setCookie( 'x', 'Value', '' ); + $this->assertEquals( 'Value', $req->getCookie( 'x', '' ) ); + + $req->setCookies( [ 'x' => 'One', 'y' => 'Two' ], '' ); + $this->assertEquals( 'One', $req->getCookie( 'x', '' ) ); + $this->assertEquals( 'Two', $req->getCookie( 'y', '' ) ); + } + + /** +* @covers FauxRequest::getCookie +* @covers FauxRequest::setCookie +* @covers FauxRequest::setCookies +*/ + public function testCookiesDefaultPrefix() { + global $wgCookiePrefix; + $oldPrefix = $wgCookiePrefix; + $wgCookiePrefix = '_'; + + $req = new FauxRequest(); + $this->assertSame( null, $req->getCookie( 'z' ) ); + + $req->setCookie( 'x', 'Value' ); + $this->assertEquals( 'Value', $req->getCookie( 'x' ) ); + + $wgCookiePrefix = $oldPrefix; + } + + /** +* @covers FauxRequest::getRequestURL +*/ + public function testGetRequestURL() { + $req = new FauxRequest(); +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: FauxRequest: Add unit tests to expand code coverage
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/309502 Change subject: FauxRequest: Add unit tests to expand code coverage .. FauxRequest: Add unit tests to expand code coverage * Remove @covers for methods that don't exist (parent class). * Fix coverage for initHeaders() and setHeaders(). * Add tests and coverage for all other methods. Change-Id: Id9b6de31843d2e87c54f485beb4fbcbe6f4bf8f6 --- M includes/FauxRequest.php M tests/phpunit/includes/FauxRequestTest.php 2 files changed, 165 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/02/309502/1 diff --git a/includes/FauxRequest.php b/includes/FauxRequest.php index 158c852..3b2283b 100644 --- a/includes/FauxRequest.php +++ b/includes/FauxRequest.php @@ -226,6 +226,7 @@ } /** +* @codeCoverageIgnore * @param array $extWhitelist * @return bool */ @@ -234,6 +235,7 @@ } /** +* @codeCoverageIgnore * @return string */ protected function getRawIP() { diff --git a/tests/phpunit/includes/FauxRequestTest.php b/tests/phpunit/includes/FauxRequestTest.php index 4622a38..a5d67de 100644 --- a/tests/phpunit/includes/FauxRequestTest.php +++ b/tests/phpunit/includes/FauxRequestTest.php @@ -1,8 +1,143 @@ setExpectedException( MWException::class, 'bogus data' ); + $req = new FauxRequest( 'x' ); + } + + /** +* @covers FauxRequest::__construct +*/ + public function testConstructInvalidSession() { + $this->setExpectedException( MWException::class, 'bogus session' ); + $req = new FauxRequest( [], false, 'x' ); + } + + /** +* @covers FauxRequest::getText +*/ + public function testGetText() { + $req = new FauxRequest( [ 'x' => 'Value' ] ); + $this->assertEquals( 'Value', $req->getText( 'x' ) ); + $this->assertEquals( '', $req->getText( 'z' ) ); + } + + /** +* @covers FauxRequest::getValues +*/ + public function testGetValues() { + $values = [ 'x' => 'Value', 'y' => '' ]; + $req = new FauxRequest( $values ); + $this->assertEquals( $values, $req->getValues() ); + } + + /** +* @covers FauxRequest::getQueryValues +*/ + public function testGetQueryValues() { + $values = [ 'x' => 'Value', 'y' => '' ]; + + $req = new FauxRequest( $values ); + $this->assertEquals( $values, $req->getQueryValues() ); + $req = new FauxRequest( $values, /*wasPosted*/ true ); + $this->assertEquals( [], $req->getQueryValues() ); + } + + /** +* @covers FauxRequest::getMethod +*/ + public function testGetMethod() { + $req = new FauxRequest( [] ); + $this->assertEquals( 'GET', $req->getMethod() ); + $req = new FauxRequest( [], /*wasPosted*/ true ); + $this->assertEquals( 'POST', $req->getMethod() ); + } + + /** +* @covers FauxRequest::wasPosted +*/ + public function testWasPosted() { + $req = new FauxRequest( [] ); + $this->assertFalse( $req->wasPosted() ); + $req = new FauxRequest( [], /*wasPosted*/ true ); + $this->assertTrue( $req->wasPosted() ); + } + + /** +* @covers FauxRequest::getCookie +* @covers FauxRequest::setCookie +* @covers FauxRequest::setCookies +*/ + public function testCookies() { + $req = new FauxRequest(); + $this->assertSame( null, $req->getCookie( 'z', '' ) ); + + $req->setCookie( 'x', 'Value', '' ); + $this->assertEquals( 'Value', $req->getCookie( 'x', '' ) ); + + $req->setCookies( [ 'x' => 'One', 'y' => 'Two' ], '' ); + $this->assertEquals( 'One', $req->getCookie( 'x', '' ) ); + $this->assertEquals( 'Two', $req->getCookie( 'y', '' ) ); + } + + /** +* @covers FauxRequest::getCookie +* @covers FauxRequest::setCookie +* @covers FauxRequest::setCookies +*/ + public function testCookiesDefaultPrefix() { + global $wgCookiePrefix; + $oldPrefix = $wgCookiePrefix; + $wgCookiePrefix = '_'; + + $req = new FauxRequest(); + $this->assertSame( null, $req->getCookie( 'z' ) ); + + $req->setCookie( 'x', 'Value' ); + $this->assertEquals( 'Value', $req->getCookie( 'x' ) ); + + $wgCookiePrefix = $oldPrefix; + } + + /** +* @covers FauxRequest::getRequestURL +*/ + public function testGetRequestURL() { +
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Trivial bugfix followup to 4a586c3f6
BBlack has submitted this change and it was merged. Change subject: Trivial bugfix followup to 4a586c3f6 .. Trivial bugfix followup to 4a586c3f6 (Forgot to remove the removed argument) Bug: T100902 Change-Id: I89c59e21e8d4dfb8c4410cf02043fcda5303f009 --- M templates/varnish/geoip.inc.vcl.erb 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: BBlack: Verified; Looks good to me, approved diff --git a/templates/varnish/geoip.inc.vcl.erb b/templates/varnish/geoip.inc.vcl.erb index c2baede..c8d97f2 100644 --- a/templates/varnish/geoip.inc.vcl.erb +++ b/templates/varnish/geoip.inc.vcl.erb @@ -238,5 +238,5 @@ // Emits a Set-Cookie sub geoip_cookie { -C{geo_xcip_output(sp, false);}C +C{geo_xcip_output(sp);}C } -- To view, visit https://gerrit.wikimedia.org/r/309501 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I89c59e21e8d4dfb8c4410cf02043fcda5303f009 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlackGerrit-Reviewer: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Trivial bugfix followup to 4a586c3f6
BBlack has uploaded a new change for review. https://gerrit.wikimedia.org/r/309501 Change subject: Trivial bugfix followup to 4a586c3f6 .. Trivial bugfix followup to 4a586c3f6 (Forgot to remove the removed argument) Bug: T100902 Change-Id: I89c59e21e8d4dfb8c4410cf02043fcda5303f009 --- M templates/varnish/geoip.inc.vcl.erb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/01/309501/1 diff --git a/templates/varnish/geoip.inc.vcl.erb b/templates/varnish/geoip.inc.vcl.erb index c2baede..c8d97f2 100644 --- a/templates/varnish/geoip.inc.vcl.erb +++ b/templates/varnish/geoip.inc.vcl.erb @@ -238,5 +238,5 @@ // Emits a Set-Cookie sub geoip_cookie { -C{geo_xcip_output(sp, false);}C +C{geo_xcip_output(sp);}C } -- To view, visit https://gerrit.wikimedia.org/r/309501 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I89c59e21e8d4dfb8c4410cf02043fcda5303f009 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlack___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: text VCL: remove JSON output support
BBlack has submitted this change and it was merged. Change subject: text VCL: remove JSON output support .. text VCL: remove JSON output support Bug: T100902 Change-Id: I9158f52a5e24af750b876c1d1c1fc900f0cecb08 --- M templates/varnish/geoip.inc.vcl.erb M templates/varnish/text-frontend.inc.vcl.erb 2 files changed, 2 insertions(+), 60 deletions(-) Approvals: BBlack: Looks good to me, approved jenkins-bot: Verified diff --git a/templates/varnish/geoip.inc.vcl.erb b/templates/varnish/geoip.inc.vcl.erb index 40e7a1f..c2baede 100644 --- a/templates/varnish/geoip.inc.vcl.erb +++ b/templates/varnish/geoip.inc.vcl.erb @@ -141,38 +141,6 @@ _GEO_IDX_SIZE = 5, } geo_idx_t; -static const char json_fmt[] = -"Geo = {\"city\":\"%s\",\"country\":\"%s\",\"region\":\"%s\"," -"\"lat\":\"%s\",\"lon\":\"%s\",\"IP\":\"v4\"}"; - -static void geo_out_json(struct sess* sp, char** geo, bool failed) { -char out[255]; - -if (!failed) { -int out_size = snprintf(out, 255, json_fmt, -geo[GEO_IDX_CITY], -geo[GEO_IDX_COUNTRY], -geo[GEO_IDX_REGION], -geo[GEO_IDX_LAT], -geo[GEO_IDX_LON] -); -if (out_size >= 254) // Don't use truncated output -failed = true; -} - -if (failed) -strcpy(out, "Geo = {}"); - -VRT_synth_page(sp, 0, out, vrt_magic_string_end); -char* now = VRT_time_string(sp, VRT_r_now(sp)); -VRT_SetHdr(sp, HDR_OBJ, "\016Last-Modified:", - now, vrt_magic_string_end); -VRT_SetHdr(sp, HDR_OBJ, "\016Cache-Control:", - "private, max-age=86400, s-maxage=0", vrt_magic_string_end); -VRT_SetHdr(sp, HDR_OBJ, "\015Content-Type:", - "text/javascript", vrt_magic_string_end); -} - static void geo_out_cookie(struct sess* sp, char** geo) { char host_safe[50]; @@ -218,9 +186,8 @@ {"location", "longitude", NULL, NULL}, }; -static void geo_xcip_output(struct sess* sp, const bool json) { +static void geo_xcip_output(struct sess* sp) { int gai_error, mmdb_error; -bool failed = true; // this is just for the JSON case char ip[INET6_ADDRSTRLEN]; char* geo[_GEO_IDX_SIZE]; char* empty = "\0"; @@ -241,7 +208,6 @@ // from this point we have a lookup, it just may or may // not have a full set of useful fields. -failed = false; // Parse results into "geo" on the stack, which is always full of // pointers. The pointers are to empty strings if results are lacking. @@ -266,17 +232,9 @@ } out: -if (json) -geo_out_json(sp, geo, failed); -else -geo_out_cookie(sp, geo); +geo_out_cookie(sp, geo); } }C - -// Emits JSON -sub geoip_lookup { -C{geo_xcip_output(sp, true);}C -} // Emits a Set-Cookie sub geoip_cookie { diff --git a/templates/varnish/text-frontend.inc.vcl.erb b/templates/varnish/text-frontend.inc.vcl.erb index 77a8f22..5e5b593 100644 --- a/templates/varnish/text-frontend.inc.vcl.erb +++ b/templates/varnish/text-frontend.inc.vcl.erb @@ -65,14 +65,6 @@ // Disable Range requests for now. unset req.http.Range; - if (req.http.host == "geoiplookup.wikimedia.org") { - if (req.http.referer) { - error 668 "geoiplookup"; - } else { - error 403 "Forbidden"; - } - } - if (req.restarts == 0) { // Always set or clear X-Subdomain and X-Orig-Cookie unset req.http.X-Orig-Cookie; @@ -286,14 +278,6 @@ set obj.http.Connection = "keep-alive"; return (deliver); } - } - - // Support geoiplookup - if (obj.status == 668) { - call geoip_lookup; - set obj.status = 200; - set obj.http.Connection = "keep-alive"; - return (deliver); } // Support mobile redirects -- To view, visit https://gerrit.wikimedia.org/r/305421 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9158f52a5e24af750b876c1d1c1fc900f0cecb08 Gerrit-PatchSet: 11 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlackGerrit-Reviewer: BBlack Gerrit-Reviewer: Ema Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Increate "descriptionCacheExpiry" as this uses page_touched ...
jenkins-bot has submitted this change and it was merged. Change subject: Increate "descriptionCacheExpiry" as this uses page_touched in the key now .. Increate "descriptionCacheExpiry" as this uses page_touched in the key now Change-Id: Iecac1b4da3b7bb0fc1d7c3018bdcfa3cd02687a0 --- M wmf-config/filebackend-production.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/filebackend-production.php b/wmf-config/filebackend-production.php index 67e8960..58982ed 100644 --- a/wmf-config/filebackend-production.php +++ b/wmf-config/filebackend-production.php @@ -203,7 +203,7 @@ 'scriptDirUrl' => "https://test.wikipedia.org/w;, 'favicon' => "/static/favicon/black-globe.ico", 'fetchDescription' => true, - 'descriptionCacheExpiry' => 86400, + 'descriptionCacheExpiry' => 86400 * 7, 'wiki' => 'testwiki', 'initialCapital' => true, 'zones'=> [ // actual swift containers have 'local-*' @@ -229,7 +229,7 @@ 'scriptDirUrl' => "https://commons.wikimedia.org/w;, 'favicon' => "/static/favicon/commons.ico", 'fetchDescription' => true, - 'descriptionCacheExpiry' => 86400, + 'descriptionCacheExpiry' => 86400 * 7, 'wiki' => 'commonswiki', 'initialCapital' => true, 'zones'=> [ // actual swift containers have 'local-*' -- To view, visit https://gerrit.wikimedia.org/r/309500 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iecac1b4da3b7bb0fc1d7c3018bdcfa3cd02687a0 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Increate "descriptionCacheExpiry" as this uses page_touched ...
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/309500 Change subject: Increate "descriptionCacheExpiry" as this uses page_touched in the key now .. Increate "descriptionCacheExpiry" as this uses page_touched in the key now Change-Id: Iecac1b4da3b7bb0fc1d7c3018bdcfa3cd02687a0 --- M wmf-config/filebackend-production.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/00/309500/1 diff --git a/wmf-config/filebackend-production.php b/wmf-config/filebackend-production.php index 67e8960..58982ed 100644 --- a/wmf-config/filebackend-production.php +++ b/wmf-config/filebackend-production.php @@ -203,7 +203,7 @@ 'scriptDirUrl' => "https://test.wikipedia.org/w;, 'favicon' => "/static/favicon/black-globe.ico", 'fetchDescription' => true, - 'descriptionCacheExpiry' => 86400, + 'descriptionCacheExpiry' => 86400 * 7, 'wiki' => 'testwiki', 'initialCapital' => true, 'zones'=> [ // actual swift containers have 'local-*' @@ -229,7 +229,7 @@ 'scriptDirUrl' => "https://commons.wikimedia.org/w;, 'favicon' => "/static/favicon/commons.ico", 'fetchDescription' => true, - 'descriptionCacheExpiry' => 86400, + 'descriptionCacheExpiry' => 86400 * 7, 'wiki' => 'commonswiki', 'initialCapital' => true, 'zones'=> [ // actual swift containers have 'local-*' -- To view, visit https://gerrit.wikimedia.org/r/309500 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iecac1b4da3b7bb0fc1d7c3018bdcfa3cd02687a0 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable Flow on wikitech
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/309499 Change subject: Enable Flow on wikitech .. Enable Flow on wikitech These two wikis will use their own database for Flow, like we do for private wikis, like officewiki. Flow is only be enabled in Tools talk: namespace. Bug: T127792 Change-Id: I3b1d46e3b3150903814ef99c2ea345c485cc2d5e --- M dblists/nonflow.dblist M wmf-config/InitialiseSettings.php 2 files changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/99/309499/1 diff --git a/dblists/nonflow.dblist b/dblists/nonflow.dblist index 84ad529..568c939 100644 --- a/dblists/nonflow.dblist +++ b/dblists/nonflow.dblist @@ -4,5 +4,3 @@ jawikiversity loginwiki votewiki -labswiki -labtestwiki diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 834af60..718687a 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -15899,6 +15899,9 @@ 2301, // Gadget_talk from Gadgets 2303, // Gadget_definition_talk from Gadgets ], + 'wikitech' => [ + 117, // Tool talk - T127792 + ], ], // Enable editing other users posts by autoconfirmed @@ -15909,10 +15912,12 @@ 'wmgFlowDefaultWikiDb' => [ 'default' => 'flowdb', 'private' => false, + 'wikitech' => false, // T127792 ], 'wmgFlowCluster' => [ 'default' => 'extension1', 'private' => false, + 'wikitech' => false, // T127792 ], 'wmgFlowMaintenanceMode' => [ 'default' => false, -- To view, visit https://gerrit.wikimedia.org/r/309499 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3b1d46e3b3150903814ef99c2ea345c485cc2d5e Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Preload ResourceLoaderWikiModule::getTitleInfo in OutputPage
jenkins-bot has submitted this change and it was merged. Change subject: Preload ResourceLoaderWikiModule::getTitleInfo in OutputPage .. Preload ResourceLoaderWikiModule::getTitleInfo in OutputPage This avoids a separate query for each module. Bug: T46362 Change-Id: Ie109a8776cbdcd5928cbb59351f2cf94088c0c95 --- M includes/OutputPage.php 1 file changed, 15 insertions(+), 2 deletions(-) Approvals: Krinkle: Looks good to me, approved Aaron Schulz: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 6ae2a92..9b2d8da 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2679,16 +2679,29 @@ // Prepare exempt modules for buildExemptModules() $exemptGroups = [ 'site' => [], 'noscript' => [], 'private' => [], 'user' => [] ]; $exemptStates = []; - $moduleStyles = array_filter( $this->getModuleStyles( /*filter*/ true ), + $moduleStyles = $this->getModuleStyles( /*filter*/ true ); + + // Batch preload getTitleInfo for isKnownEmpty() calls below + $exemptModules = array_filter( $moduleStyles, + function ( $name ) use ( $rl, &$exemptGroups ) { + $module = $rl->getModule( $name ); + return $module && isset( $exemptGroups[ $module->getGroup() ] ); + } + ); + ResourceLoaderWikiModule::preloadTitleInfo( + $context, wfGetDB( DB_REPLICA ), $exemptModules ); + + // Filter out modules handled by buildExemptModules() + $moduleStyles = array_filter( $moduleStyles, function ( $name ) use ( $rl, $context, &$exemptGroups, &$exemptStates ) { $module = $rl->getModule( $name ); if ( $module ) { - $group = $module->getGroup(); if ( $name === 'user.styles' && $this->isUserCssPreview() ) { $exemptStates[$name] = 'ready'; // Special case in buildExemptModules() return false; } + $group = $module->getGroup(); if ( isset( $exemptGroups[$group] ) ) { $exemptStates[$name] = 'ready'; if ( !$module->isKnownEmpty( $context ) ) { -- To view, visit https://gerrit.wikimedia.org/r/309258 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie109a8776cbdcd5928cbb59351f2cf94088c0c95 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Update constants file
jenkins-bot has submitted this change and it was merged. Change subject: Update constants file .. Update constants file Change-Id: I3286ce6af33f18f854573c959b82ae2e4f52b8bf --- M tests/Defines.php 1 file changed, 10 insertions(+), 4 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved Jforrester: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/tests/Defines.php b/tests/Defines.php index c24b3c2..dbe7f23 100644 --- a/tests/Defines.php +++ b/tests/Defines.php @@ -46,13 +46,12 @@ * Valid database indexes * Operation-based indexes */ -define( 'DB_SLAVE', -1 ); # Read from the slave (or only server) +define( 'DB_REPLICA', -1 ); # Read from a replica (or only server) define( 'DB_MASTER', -2 );# Write to master (or only server) /**@}*/ # Obsolete aliases -define( 'DB_READ', -1 ); -define( 'DB_WRITE', -2 ); +define( 'DB_SLAVE', -1 ); /**@{ * Virtual namespaces; don't appear in the page database @@ -184,8 +183,9 @@ define( 'EDIT_MINOR', 4 ); define( 'EDIT_SUPPRESS_RC', 8 ); define( 'EDIT_FORCE_BOT', 16 ); -define( 'EDIT_DEFER_UPDATES', 32 ); +define( 'EDIT_DEFER_UPDATES', 32 ); // Unused since 1.27 define( 'EDIT_AUTOSUMMARY', 64 ); +define( 'EDIT_INTERNAL', 128 ); /**@}*/ /**@{ @@ -303,3 +303,9 @@ // for future use with the api, and for use by extensions define( 'CONTENT_FORMAT_XML', 'application/xml' ); /**@}*/ + +/**@{ + * Max string length for shell invocations; based on binfmts.h + */ +define( 'SHELL_MAX_ARG_STRLEN', '10' ); +/**@}*/ -- To view, visit https://gerrit.wikimedia.org/r/309256 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3286ce6af33f18f854573c959b82ae2e4f52b8bf Gerrit-PatchSet: 4 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Chad Gerrit-Reviewer: Jforrester 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...Kartographer[master]: PHP code cleanup
jenkins-bot has submitted this change and it was merged. Change subject: PHP code cleanup .. PHP code cleanup Followed idea's code suggestions. TODO: * Is private State::version still being used? Comments seem to indicate some sort of serialization * JsonSchema\Validator has two implementations: mediawiki/extensions/Kartographer/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php mediawiki/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php Change-Id: I70cd8e05cd687576efb4f7204cf92afbf6b3c16b --- M includes/ApiSanitizeMapData.php M includes/Hooks.php M includes/SpecialMap.php M includes/State.php M includes/Tag/TagHandler.php 5 files changed, 5 insertions(+), 10 deletions(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/ApiSanitizeMapData.php b/includes/ApiSanitizeMapData.php index cd5067a..b0b1148 100644 --- a/includes/ApiSanitizeMapData.php +++ b/includes/ApiSanitizeMapData.php @@ -37,6 +37,7 @@ } private function sanitizeJson( Title $title, $text ) { + /** @var Parser $wgParser */ global $wgParser; $parser = $wgParser->getFreshParser(); diff --git a/includes/Hooks.php b/includes/Hooks.php index c934c66..4dbf3b0 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -14,11 +14,6 @@ use ParserOutput; class Hooks { - private static $tags = [ - 'mapframe' => 'Kartographer\Tag\MapFrame::entryPoint', - 'maplink' => 'Kartographer\Tag\MapLink::entryPoint', - ]; - /** * ParserFirstCallInit hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/ParserFirstCallInit @@ -55,7 +50,7 @@ * @return bool */ /*public static function onRejectParserCacheValue( ParserOutput $po ) { - // One of these should be prsent in any output with old version of data + // One of these should be present in any output with old version of data if ( $po->getExtensionData( 'kartographer_valid' ) || $po->getExtensionData( 'kartographer_broken' ) ) { diff --git a/includes/SpecialMap.php b/includes/SpecialMap.php index 5203b9a..867d905 100644 --- a/includes/SpecialMap.php +++ b/includes/SpecialMap.php @@ -40,7 +40,7 @@ } $attributions = Html::rawElement( 'div', [ 'id' => 'mw-specialMap-attributions' ], - wfMessage( 'kartographer-attribution' )->title( $this->getTitle() )->parse() ); + wfMessage( 'kartographer-attribution' )->title( $this->getPageTitle() )->parse() ); $this->getOutput()->addHTML( Html::openElement( 'div', [ 'id' => 'mw-specialMap-container', 'class' => 'thumb' ] ) diff --git a/includes/State.php b/includes/State.php index f90741a..5c05e28 100644 --- a/includes/State.php +++ b/includes/State.php @@ -13,7 +13,7 @@ const VERSION = 1; /** @var int Version of this class, for checking after deserialization */ - private $version = self::VERSION; + private /** @noinspection PhpUnusedPrivateFieldInspection */ $version = self::VERSION; private $valid = false; private $broken = false; @@ -23,7 +23,7 @@ private $data = []; /** -* Retrieves an instance of self from ParserOutout, if present +* Retrieves an instance of self from ParserOutput, if present * * @param ParserOutput $output * @return self|null diff --git a/includes/Tag/TagHandler.php b/includes/Tag/TagHandler.php index f467fd0..00264b6 100644 --- a/includes/Tag/TagHandler.php +++ b/includes/Tag/TagHandler.php @@ -16,7 +16,6 @@ use Kartographer\State; use Language; use Parser; -use ParserOutput; use PPFrame; use Status; use stdClass; -- To view, visit https://gerrit.wikimedia.org/r/308926 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I70cd8e05cd687576efb4f7204cf92afbf6b3c16b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: YurikGerrit-Reviewer: MaxSem 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...SpamBlacklist[wmf/1.28.0-wmf.18]: Fix links passed to filter() for stashing to match edit checks
jenkins-bot has submitted this change and it was merged. Change subject: Fix links passed to filter() for stashing to match edit checks .. Fix links passed to filter() for stashing to match edit checks Change-Id: I8f1b2c4d3033015de0e9a6d58776fe0ad32c4775 --- M SpamBlacklistHooks.php M SpamBlacklist_body.php 2 files changed, 3 insertions(+), 1 deletion(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/SpamBlacklistHooks.php b/SpamBlacklistHooks.php index 52b97ef..cddb073 100644 --- a/SpamBlacklistHooks.php +++ b/SpamBlacklistHooks.php @@ -69,7 +69,7 @@ public static function onParserOutputStashForEdit( WikiPage $page, Content $content, ParserOutput $output ) { - $links = $output->getExternalLinks(); + $links = array_keys( $output->getExternalLinks() ); $spamObj = BaseBlacklist::getInstance( 'spam' ); $spamObj->warmCachesForFilter( $page->getTitle(), $links ); } diff --git a/SpamBlacklist_body.php b/SpamBlacklist_body.php index 137947a..c1b90e5 100644 --- a/SpamBlacklist_body.php +++ b/SpamBlacklist_body.php @@ -54,6 +54,8 @@ function filter( array $links, Title $title = null, $preventLog = false, $mode = 'check' ) { $statsd = MediaWikiServices::getInstance()->getStatsdDataFactory(); $cache = ObjectCache::getLocalClusterInstance(); + + sort( $links ); $key = $cache->makeKey( 'blacklist', $this->getBlacklistType(), -- To view, visit https://gerrit.wikimedia.org/r/309497 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f1b2c4d3033015de0e9a6d58776fe0ad32c4775 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SpamBlacklist Gerrit-Branch: wmf/1.28.0-wmf.18 Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz 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...SpamBlacklist[master]: Fix links passed to filter() for stashing to match edit checks
jenkins-bot has submitted this change and it was merged. Change subject: Fix links passed to filter() for stashing to match edit checks .. Fix links passed to filter() for stashing to match edit checks Change-Id: I8f1b2c4d3033015de0e9a6d58776fe0ad32c4775 --- M SpamBlacklistHooks.php M SpamBlacklist_body.php 2 files changed, 3 insertions(+), 1 deletion(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/SpamBlacklistHooks.php b/SpamBlacklistHooks.php index 52b97ef..cddb073 100644 --- a/SpamBlacklistHooks.php +++ b/SpamBlacklistHooks.php @@ -69,7 +69,7 @@ public static function onParserOutputStashForEdit( WikiPage $page, Content $content, ParserOutput $output ) { - $links = $output->getExternalLinks(); + $links = array_keys( $output->getExternalLinks() ); $spamObj = BaseBlacklist::getInstance( 'spam' ); $spamObj->warmCachesForFilter( $page->getTitle(), $links ); } diff --git a/SpamBlacklist_body.php b/SpamBlacklist_body.php index 137947a..c1b90e5 100644 --- a/SpamBlacklist_body.php +++ b/SpamBlacklist_body.php @@ -54,6 +54,8 @@ function filter( array $links, Title $title = null, $preventLog = false, $mode = 'check' ) { $statsd = MediaWikiServices::getInstance()->getStatsdDataFactory(); $cache = ObjectCache::getLocalClusterInstance(); + + sort( $links ); $key = $cache->makeKey( 'blacklist', $this->getBlacklistType(), -- To view, visit https://gerrit.wikimedia.org/r/309496 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f1b2c4d3033015de0e9a6d58776fe0ad32c4775 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/SpamBlacklist Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Jackmcbarn Gerrit-Reviewer: Legoktm 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...WikimediaMaintenance[master]: Create Flow tables with createExtensionTables
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/309498 Change subject: Create Flow tables with createExtensionTables .. Create Flow tables with createExtensionTables WMF regular wikis uses extension1 cluster for Echo, but private wikis and Wikitech uses their own database. This helper script could so be used in this later case. Bug: T145160 Change-Id: I56e5d4c1c9f0234196190d37168da04e2039e29a --- M createExtensionTables.php 1 file changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance refs/changes/98/309498/1 diff --git a/createExtensionTables.php b/createExtensionTables.php index 6bba929..8075aa4 100644 --- a/createExtensionTables.php +++ b/createExtensionTables.php @@ -32,7 +32,7 @@ } function execute() { - global $IP, $wgEchoCluster; + global $IP, $wgEchoCluster, $wmgFlowDefaultWikiDb; $dbw = $this->getDB( DB_MASTER ); $extension = $this->getArg( 0 ); @@ -58,6 +58,14 @@ $path = "$IP/extensions/FlaggedRevs/backend/schema/mysql"; break; + case 'flow': + if ( $wmgFlowDefaultWikiDb !== false ) { + $this->error( "This wiki uses $wmgFlowDefaultWikiDb for Flow tables. They don't need to be created on the project database, which is the scope of this script.", 1 ); + } + $files = array( 'flow.sql' ); + $path = "$IP/extensions/Flow"; + break; + case 'moodbar': $files = array( 'MoodBar.sql', -- To view, visit https://gerrit.wikimedia.org/r/309498 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I56e5d4c1c9f0234196190d37168da04e2039e29a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMaintenance Gerrit-Branch: master Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...SpamBlacklist[wmf/1.28.0-wmf.18]: Fix links passed to filter() for stashing to match edit checks
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/309497 Change subject: Fix links passed to filter() for stashing to match edit checks .. Fix links passed to filter() for stashing to match edit checks Change-Id: I8f1b2c4d3033015de0e9a6d58776fe0ad32c4775 --- M SpamBlacklistHooks.php M SpamBlacklist_body.php 2 files changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SpamBlacklist refs/changes/97/309497/1 diff --git a/SpamBlacklistHooks.php b/SpamBlacklistHooks.php index 52b97ef..cddb073 100644 --- a/SpamBlacklistHooks.php +++ b/SpamBlacklistHooks.php @@ -69,7 +69,7 @@ public static function onParserOutputStashForEdit( WikiPage $page, Content $content, ParserOutput $output ) { - $links = $output->getExternalLinks(); + $links = array_keys( $output->getExternalLinks() ); $spamObj = BaseBlacklist::getInstance( 'spam' ); $spamObj->warmCachesForFilter( $page->getTitle(), $links ); } diff --git a/SpamBlacklist_body.php b/SpamBlacklist_body.php index 137947a..c1b90e5 100644 --- a/SpamBlacklist_body.php +++ b/SpamBlacklist_body.php @@ -54,6 +54,8 @@ function filter( array $links, Title $title = null, $preventLog = false, $mode = 'check' ) { $statsd = MediaWikiServices::getInstance()->getStatsdDataFactory(); $cache = ObjectCache::getLocalClusterInstance(); + + sort( $links ); $key = $cache->makeKey( 'blacklist', $this->getBlacklistType(), -- To view, visit https://gerrit.wikimedia.org/r/309497 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f1b2c4d3033015de0e9a6d58776fe0ad32c4775 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SpamBlacklist Gerrit-Branch: wmf/1.28.0-wmf.18 Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...SpamBlacklist[master]: Sort links in filter() so the key is deterministic
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/309496 Change subject: Sort links in filter() so the key is deterministic .. Sort links in filter() so the key is deterministic Change-Id: I8f1b2c4d3033015de0e9a6d58776fe0ad32c4775 --- M SpamBlacklist_body.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SpamBlacklist refs/changes/96/309496/1 diff --git a/SpamBlacklist_body.php b/SpamBlacklist_body.php index 137947a..c1b90e5 100644 --- a/SpamBlacklist_body.php +++ b/SpamBlacklist_body.php @@ -54,6 +54,8 @@ function filter( array $links, Title $title = null, $preventLog = false, $mode = 'check' ) { $statsd = MediaWikiServices::getInstance()->getStatsdDataFactory(); $cache = ObjectCache::getLocalClusterInstance(); + + sort( $links ); $key = $cache->makeKey( 'blacklist', $this->getBlacklistType(), -- To view, visit https://gerrit.wikimedia.org/r/309496 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8f1b2c4d3033015de0e9a6d58776fe0ad32c4775 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SpamBlacklist Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...SpamBlacklist[master]: Actually use STASH_TTL constant
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/309495 Change subject: Actually use STASH_TTL constant .. Actually use STASH_TTL constant Change-Id: Ia50296919a5c8bdeb63496397c538f39d43c4d54 --- M SpamBlacklist_body.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SpamBlacklist refs/changes/95/309495/1 diff --git a/SpamBlacklist_body.php b/SpamBlacklist_body.php index 137947a..076c1cb 100644 --- a/SpamBlacklist_body.php +++ b/SpamBlacklist_body.php @@ -154,7 +154,7 @@ if ( $retVal === false ) { // Cache the typical negative results - $cache->set( $key, time(), $cache::TTL_MINUTE ); + $cache->set( $key, time(), self::STASH_TTL ); if ( $mode === 'stash' ) { $statsd->increment( 'spamblacklist.check-stash.store' ); } -- To view, visit https://gerrit.wikimedia.org/r/309495 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia50296919a5c8bdeb63496397c538f39d43c4d54 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SpamBlacklist Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Remove geoiplookup service IPs from LVS
BBlack has submitted this change and it was merged. Change subject: Remove geoiplookup service IPs from LVS .. Remove geoiplookup service IPs from LVS Bug: T100902 Change-Id: I960d9cc4ecbf1ce24d8d6c5ffd6262c302a31dc3 --- M hieradata/common/lvs/configuration.yaml 1 file changed, 0 insertions(+), 4 deletions(-) Approvals: BBlack: Verified; Looks good to me, approved diff --git a/hieradata/common/lvs/configuration.yaml b/hieradata/common/lvs/configuration.yaml index c67c41f..c90b97a 100644 --- a/hieradata/common/lvs/configuration.yaml +++ b/hieradata/common/lvs/configuration.yaml @@ -3,19 +3,15 @@ codfw: textlb: 208.80.153.224 textlb6: 2620:0:860:ed1a::1 - geoiplookuplb: 208.80.153.225 eqiad: textlb: 208.80.154.224 textlb6: 2620:0:861:ed1a::1 - geoiplookuplb: 208.80.154.225 esams: textlb: 91.198.174.192 textlb6: 2620:0:862:ed1a::1 - geoiplookuplb: 91.198.174.193 ulsfo: textlb: 198.35.26.96 textlb6: 2620:0:863:ed1a::1 - geoiplookuplb: 198.35.26.97 upload: _block002 codfw: uploadlb: 208.80.153.240 -- To view, visit https://gerrit.wikimedia.org/r/305420 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I960d9cc4ecbf1ce24d8d6c5ffd6262c302a31dc3 Gerrit-PatchSet: 11 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlackGerrit-Reviewer: BBlack 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/core[master]: Avoid user autocreation race condition caused by repeatable ...
jenkins-bot has submitted this change and it was merged. Change subject: Avoid user autocreation race condition caused by repeatable read .. Avoid user autocreation race condition caused by repeatable read AuthManager tries to check whether the user already exists if User::addToDatabase fails in autocreation, but since the same DB row was already checked a few lines earlier and this method is typically wrapped in an implicit transaction, it will just re-read the same snapshot and not do anything useful. addToDatabase already has a check for that so let's rely on that instead. Bug: T145131 Change-Id: I94a5e8b851dcf994f5f9e773edf4e9153a4a3535 --- M includes/auth/AuthManager.php M tests/phpunit/includes/auth/AuthManagerTest.php 2 files changed, 7 insertions(+), 7 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php index 992e70f..89a22f8 100644 --- a/includes/auth/AuthManager.php +++ b/includes/auth/AuthManager.php @@ -1679,14 +1679,12 @@ try { $status = $user->addToDatabase(); if ( !$status->isOk() ) { - // double-check for a race condition (T70012) - $localId = User::idFromName( $username, User::READ_LATEST ); - if ( $localId ) { + // Double-check for a race condition (T70012). We make use of the fact that when + // addToDatabase fails due to the user already existing, the user object gets loaded. + if ( $user->getId() ) { $this->logger->info( __METHOD__ . ': {username} already exists locally (race)', [ 'username' => $username, ] ); - $user->setId( $localId ); - $user->loadFromId( User::READ_LATEST ); if ( $login ) { $this->setSessionDataForUser( $user ); } diff --git a/tests/phpunit/includes/auth/AuthManagerTest.php b/tests/phpunit/includes/auth/AuthManagerTest.php index 788d304..f679f63 100644 --- a/tests/phpunit/includes/auth/AuthManagerTest.php +++ b/tests/phpunit/includes/auth/AuthManagerTest.php @@ -2709,9 +2709,11 @@ $session->clear(); $user = $this->getMock( 'User', [ 'addToDatabase' ] ); $user->expects( $this->once() )->method( 'addToDatabase' ) - ->will( $this->returnCallback( function () use ( $username ) { - $status = \User::newFromName( $username )->addToDatabase(); + ->will( $this->returnCallback( function () use ( $username, &$user ) { + $oldUser = \User::newFromName( $username ); + $status = $oldUser->addToDatabase(); $this->assertTrue( $status->isOK(), 'sanity check' ); + $user->setId( $oldUser->getId() ); return \Status::newFatal( 'userexists' ); } ) ); $user->setName( $username ); -- To view, visit https://gerrit.wikimedia.org/r/309476 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94a5e8b851dcf994f5f9e773edf4e9153a4a3535 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gergő TiszaGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Anomie Gerrit-Reviewer: Chad Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Remove labspuppet user creation from production-grants-m5.sq...
Andrew Bogott has submitted this change and it was merged. Change subject: Remove labspuppet user creation from production-grants-m5.sql.erb .. Remove labspuppet user creation from production-grants-m5.sql.erb I can't make this work without duplicating the user password all over the place in the private repo, which seems worse. Change-Id: Ia0064d327fa6b8d389815cc8d65cf5fd18d52a32 --- M manifests/role/mariadb.pp M templates/mariadb/production-grants-m5.sql.erb 2 files changed, 0 insertions(+), 4 deletions(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp index 54850ff..aafa9cc 100644 --- a/manifests/role/mariadb.pp +++ b/manifests/role/mariadb.pp @@ -47,7 +47,6 @@ $servermon_pass = $passwords::servermon::db_password $striker_pass= $passwords::striker::application_db_password $striker_admin_pass = $passwords::striker::admin_db_password -$labspuppet_pass = hiera('labspuppetbackend::mysql_password') file { '/etc/mysql/production-grants-shard.sql': ensure => present, diff --git a/templates/mariadb/production-grants-m5.sql.erb b/templates/mariadb/production-grants-m5.sql.erb index b143439..bef362d 100644 --- a/templates/mariadb/production-grants-m5.sql.erb +++ b/templates/mariadb/production-grants-m5.sql.erb @@ -139,8 +139,5 @@ -- labspuppetbackend user, will run on the labs puppetmaster host -- -CREATE USER 'labspuppet'@'208.80.154.92' -IDENTIFIED BY '<%= @labspuppet_pass %>'; - GRANT SELECT, INSERT, UPDATE, DELETE, ALTER ON `labspuppet`.* TO 'labspuppet'@'208.80.154.92'; -- To view, visit https://gerrit.wikimedia.org/r/309494 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia0064d327fa6b8d389815cc8d65cf5fd18d52a32 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew BogottGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Remove labspuppet user creation from production-grants-m5.sq...
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/309494 Change subject: Remove labspuppet user creation from production-grants-m5.sql.erb .. Remove labspuppet user creation from production-grants-m5.sql.erb I can't make this work without duplicating the user password all over the place in the private repo, which seems worse. Change-Id: Ia0064d327fa6b8d389815cc8d65cf5fd18d52a32 --- M manifests/role/mariadb.pp M templates/mariadb/production-grants-m5.sql.erb 2 files changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/94/309494/1 diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp index 54850ff..aafa9cc 100644 --- a/manifests/role/mariadb.pp +++ b/manifests/role/mariadb.pp @@ -47,7 +47,6 @@ $servermon_pass = $passwords::servermon::db_password $striker_pass= $passwords::striker::application_db_password $striker_admin_pass = $passwords::striker::admin_db_password -$labspuppet_pass = hiera('labspuppetbackend::mysql_password') file { '/etc/mysql/production-grants-shard.sql': ensure => present, diff --git a/templates/mariadb/production-grants-m5.sql.erb b/templates/mariadb/production-grants-m5.sql.erb index b143439..bef362d 100644 --- a/templates/mariadb/production-grants-m5.sql.erb +++ b/templates/mariadb/production-grants-m5.sql.erb @@ -139,8 +139,5 @@ -- labspuppetbackend user, will run on the labs puppetmaster host -- -CREATE USER 'labspuppet'@'208.80.154.92' -IDENTIFIED BY '<%= @labspuppet_pass %>'; - GRANT SELECT, INSERT, UPDATE, DELETE, ALTER ON `labspuppet`.* TO 'labspuppet'@'208.80.154.92'; -- To view, visit https://gerrit.wikimedia.org/r/309494 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia0064d327fa6b8d389815cc8d65cf5fd18d52a32 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: Remove geoiplookup DNS entries
BBlack has submitted this change and it was merged. Change subject: Remove geoiplookup DNS entries .. Remove geoiplookup DNS entries Bug: T100902 Change-Id: I896558663559c997a4de2d956b11a1f7417fbbd5 --- M config-geo M templates/153.80.208.in-addr.arpa M templates/154.80.208.in-addr.arpa M templates/174.198.91.in-addr.arpa M templates/26.35.198.in-addr.arpa M templates/wikimedia.org 6 files changed, 0 insertions(+), 20 deletions(-) Approvals: BBlack: Verified; Looks good to me, approved diff --git a/config-geo b/config-geo index 39e3915..268b67c 100644 --- a/config-geo +++ b/config-geo @@ -235,16 +235,6 @@ ulsfo => { addrs_v4 => 198.35.26.96, addrs_v6 => 2620:0:863:ed1a::1 } } } -geoiplookup-addrs => { -map => generic-map -service_types => up -dcmap => { -eqiad => 208.80.154.225 -codfw => 208.80.153.225 -esams => 91.198.174.193 -ulsfo => 198.35.26.97 -} -} upload-addrs => { map => generic-map service_types => up diff --git a/templates/153.80.208.in-addr.arpa b/templates/153.80.208.in-addr.arpa index 347e329..ef0257f 100644 --- a/templates/153.80.208.in-addr.arpa +++ b/templates/153.80.208.in-addr.arpa @@ -136,7 +136,6 @@ ; - - 208.80.153.224/29 (224-231) LVS Desktop 224 1H IN PTR text-lb.codfw.wikimedia.org. -225 1H IN PTR geoiplookup-lb.codfw.wikimedia.org. ; wrong subnet, but not important... 231 1H IN PTR ns1.wikimedia.org. diff --git a/templates/154.80.208.in-addr.arpa b/templates/154.80.208.in-addr.arpa index 1e634ec..46f37fb 100644 --- a/templates/154.80.208.in-addr.arpa +++ b/templates/154.80.208.in-addr.arpa @@ -163,7 +163,6 @@ ; - - 208.80.154.224/29 (224-231) LVS Desktop 224 1H IN PTR text-lb.eqiad.wikimedia.org. -225 1H IN PTR geoiplookup-lb.eqiad.wikimedia.org. ; - - 208.80.154.232/29 (232-239) LVS Mobile diff --git a/templates/174.198.91.in-addr.arpa b/templates/174.198.91.in-addr.arpa index 20ef033..f6872cc 100644 --- a/templates/174.198.91.in-addr.arpa +++ b/templates/174.198.91.in-addr.arpa @@ -43,7 +43,6 @@ ; - - 91.198.174.192/29 (192-199) LVS Desktop 192 1H IN PTR text-lb.esams.wikimedia.org. -193 1H IN PTR geoiplookup-lb.esams.wikimedia.org. ; - - 91.198.174.200/29 (200-207) LVS Mobile diff --git a/templates/26.35.198.in-addr.arpa b/templates/26.35.198.in-addr.arpa index 308ed45..0169668 100644 --- a/templates/26.35.198.in-addr.arpa +++ b/templates/26.35.198.in-addr.arpa @@ -31,7 +31,6 @@ ; - - 198.35.26.96/29 (96-103) LVS Desktop 96 1H IN PTR text-lb.ulsfo.wikimedia.org. -97 1H IN PTR geoiplookup-lb.ulsfo.wikimedia.org. ; - - 198.35.26.104/29 (104-111) LVS Mobile diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 9acd409..5048a7d 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -80,7 +80,6 @@ maps600 DYNA geoip!maps-addrs m 600 DYNA geoip!text-addrs misc-web-lb 600 DYNA geoip!misc-addrs -geoiplookup 600 DYNA geoip!geoiplookup-addrs donate 600 DYNA geoip!text-addrs 1H IN MX 10 mx1001 1H IN MX 50 mx2001 @@ -229,8 +228,6 @@ dns-rec-lb.eqiad1H IN A208.80.154.239 1H IN 2620:0:861:ed1a::3:fe -geoiplookup-lb.eqiad600 IN DYNA geoip!geoiplookup-addrs/eqiad - ; These legacy entries should eventually move to RESTBase cxserver600 IN DYNA geoip!text-addrs citoid 600 IN DYNA geoip!text-addrs @@ -248,7 +245,6 @@ upload-lb.ulsfo 600 IN DYNA geoip!upload-addrs/ulsfo maps-lb.ulsfo 600 IN DYNA geoip!maps-addrs/ulsfo misc-web-lb.ulsfo 600 IN DYNA geoip!misc-addrs/ulsfo -geoiplookup-lb.ulsfo600 IN DYNA geoip!geoiplookup-addrs/ulsfo donate-lb.ulsfo 600 IN DYNA geoip!text-addrs/ulsfo 1H IN MX 10mx1001 1H IN MX 50mx2001 @@ -261,14 +257,12 @@ maps-lb.codfw 600 IN DYNA geoip!maps-addrs/codfw misc-web-lb.codfw 600 IN DYNA geoip!misc-addrs/codfw donate-lb.codfw 600 IN DYNA geoip!text-addrs/codfw -geoiplookup-lb.codfw600 IN DYNA geoip!geoiplookup-addrs/codfw ;;; esams text-lb.esams 600 IN DYNA geoip!text-addrs/esams upload-lb.esams 600 IN DYNA geoip!upload-addrs/esams maps-lb.esams 600 IN DYNA geoip!maps-addrs/esams misc-web-lb.esams 600 IN DYNA geoip!misc-addrs/esams -geoiplookup-lb.esams600 IN DYNA geoip!geoiplookup-addrs/esams donate-lb.esams 600 IN DYNA geoip!text-addrs/esams 1H IN MX 10mx1001 1H IN MX 50mx2001 -- To view, visit https://gerrit.wikimedia.org/r/305422 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I896558663559c997a4de2d956b11a1f7417fbbd5 Gerrit-PatchSet: 6
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Don't show duplicate search results.
jenkins-bot has submitted this change and it was merged. Change subject: Don't show duplicate search results. .. Don't show duplicate search results. Bug: T143280 Change-Id: Idd95a05fbf11438b008286e649eabb882bff4f0d --- M app/src/main/java/org/wikipedia/search/SearchResultsFragment.java 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: jenkins-bot: Verified Niedzielski: Looks good to me, approved diff --git a/app/src/main/java/org/wikipedia/search/SearchResultsFragment.java b/app/src/main/java/org/wikipedia/search/SearchResultsFragment.java index b2907e6..bd8fc71 100644 --- a/app/src/main/java/org/wikipedia/search/SearchResultsFragment.java +++ b/app/src/main/java/org/wikipedia/search/SearchResultsFragment.java @@ -423,7 +423,14 @@ */ private void displayResults(List results) { for (SearchResult newResult : results) { -if (!totalResults.contains(newResult)) { +boolean contains = false; +for (SearchResult result : totalResults) { +if (newResult.getPageTitle().equals(result.getPageTitle())) { +contains = true; +break; +} +} +if (!contains) { totalResults.add(newResult); } } -- To view, visit https://gerrit.wikimedia.org/r/309319 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idd95a05fbf11438b008286e649eabb882bff4f0d Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: DbrantGerrit-Reviewer: BearND Gerrit-Reviewer: Brion VIBBER Gerrit-Reviewer: Mholloway Gerrit-Reviewer: Niedzielski 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/core[master]: InfoAction: Add a link to Special:ChangeContentModel if allowed
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/309492 Change subject: InfoAction: Add a link to Special:ChangeContentModel if allowed .. InfoAction: Add a link to Special:ChangeContentModel if allowed If the user is allowed to change the content model of the page, then add a link to it on ?action=info, next to the localized content model name. Change-Id: I084e8f390f90d29ed2e2d0f8ab43bcdfe8538ad1 --- M includes/actions/InfoAction.php M languages/i18n/en.json M languages/i18n/qqq.json 3 files changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/92/309492/1 diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 43bff87..c37bf03 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -202,6 +202,7 @@ $title = $this->getTitle(); $id = $title->getArticleID(); $config = $this->context->getConfig(); + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); $pageCounts = $this->pageCounts( $this->page ); @@ -279,9 +280,18 @@ . ' ' . $this->msg( 'parentheses', $pageLang )->escaped() ]; // Content model of the page + $modelHtml = htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) ); + // If the user can change it, add a link to Special:ChangeContentModel + if ( $user->isAllowed( 'editcontentmodel' ) ) { + $modelHtml .= ' ' . $this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink( + SpecialPage::getTitleValueFor( 'ChangeContentModel', $title->getPrefixedText() ), + $this->msg( 'pageinfo-content-model-change' )->text() + ) )->escaped(); + } + $pageInfo['header-basic'][] = [ $this->msg( 'pageinfo-content-model' ), - htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) ) + $modelHtml ]; // Search engine status diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 020f058..c8969a7 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -2810,6 +2810,7 @@ "pageinfo-article-id": "Page ID", "pageinfo-language": "Page content language", "pageinfo-content-model": "Page content model", + "pageinfo-content-model-change": "change", "pageinfo-robot-policy": "Indexing by robots", "pageinfo-robot-index": "Allowed", "pageinfo-robot-noindex": "Disallowed", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index 4d38ce7..562e3e5 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -2994,6 +2994,7 @@ "pageinfo-article-id": "The numeric identifier of the page.\n{{Identical|Page ID}}", "pageinfo-language": "Language in which the page content is written.", "pageinfo-content-model": "The model in which the page content is written.\n\nUsed as label at [{{fullurl:Main Page|action=info}} action=info]. Followed by one of the following messages:\n* {{msg-mw|Content-model-wikitext}}\n* {{msg-mw|Content-model-javascript}}\n* {{msg-mw|Content-model-css}}\n* {{msg-mw|Content-model-text}}", + "pageinfo-content-model-change": "Link text for a link to Special:ChangeContentModel. The link will be wrapped in parenthesis.", "pageinfo-robot-policy": "The search engine status of the page.\n\nUsed as label. Followed by any one of the following messages:\n*{{msg-mw|Pageinfo-robot-index}}\n*{{msg-mw|Pageinfo-robot-noindex}}", "pageinfo-robot-index": "An indication that the page is indexable by search engines, that is listed in their search results.\n\nPreceded by the label {{msg-mw|Pageinfo-robot-policy}}.\n{{Identical|Allowed}}", "pageinfo-robot-noindex": "An indication that the page is not indexable (that is, is not listed on the results page of a search engine).\n\nPreceded by the label {{msg-mw|Pageinfo-robot-policy}}.", -- To view, visit https://gerrit.wikimedia.org/r/309492 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I084e8f390f90d29ed2e2d0f8ab43bcdfe8538ad1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: test commit do not merge
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/309493 Change subject: test commit do not merge .. test commit do not merge Change-Id: I27264a49a9bddaacc8a8147f2331b803243707f4 --- M extension.json 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/93/309493/1 diff --git a/extension.json b/extension.json index a685988..0182aa1 100644 --- a/extension.json +++ b/extension.json @@ -67,8 +67,7 @@ "mediawiki.api", "mediawiki.Title", "mediawiki.Uri", - "mediawiki.RegExp", - "mediawiki.storage" + "mediawiki.RegExp" ], "targets": [ "desktop", -- To view, visit https://gerrit.wikimedia.org/r/309493 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27264a49a9bddaacc8a8147f2331b803243707f4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: Alex Monk___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...polloi[master]: Improve color palettes
Bearloga has submitted this change and it was merged. Change subject: Improve color palettes .. Improve color palettes Change-Id: I6a5cebdd73cb8c12a67c082c1db3268fddec38b4 --- M DESCRIPTION M NEWS.md M R/dygraphs.R A man/smart_palette.Rd 4 files changed, 45 insertions(+), 6 deletions(-) Approvals: Chelsyx: Verified; Looks good to me, approved diff --git a/DESCRIPTION b/DESCRIPTION index 896c1c5..73f148f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: polloi Type: Package Title: Common Functionality for Wikimedia Dashboards -Version: 0.1.5 +Version: 0.1.6 Date: 2016-08-22 Authors@R: c( person("Oliver", "Keyes", , "oke...@wikimedia.org", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 4d1fef5..580cdf6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +polloi 0.1.6 + +- Improved color palette. + polloi 0.1.5 - Added intelligent color palettes. diff --git a/R/dygraphs.R b/R/dygraphs.R index 1581b70..c04462d 100644 --- a/R/dygraphs.R +++ b/R/dygraphs.R @@ -9,12 +9,26 @@ #'@importFrom colorspace rainbow_hcl #'@export smart_palette <- function(n) { - if (n <= 9) { + if (n < 6) { return(brewer.pal(max(3, n), "Set1")) - } else if (n == 10) { -return(brewer.pal(10, "Paired")) - } else if (n <= 12) { -return(brewer.pal(n, "Set3")) + } else if (n < 9) { +return(brewer.pal(n + 1, "Set1")[-6]) + } else if (n <= 10) { +return(c("#00b769", "#d354be", "#436a00", "#0047a7", "#ffac3e", "#00dfe0", "#e5356f", "#01845d", "#ff8c80", "#ad5700")[1:n]) +# ^ made with http://tools.medialab.sciences-po.fr/iwanthue/ +# Settings: +# - Color space is 'colorblind friendly' +# - 10 colors +# - hard (force vector) instead of k-means + } else if (n == 11) { +return(brewer.pal(12, "Paired")[-11]) + } else if (n <= 14) { +return(c("#cd9c2e", "#b3467d", "#91b23e", "#6c81d9", "#45c097", "#5d398b", "#568435", "#ca75c7", "#c67b3a", "#9e3d45", "#64c471", "#d34b65", "#aa9747", "#bd523b")[1:n]) +# ^ made with http://tools.medialab.sciences-po.fr/iwanthue/ +# Settings: +# - Color space is 'colorblind friendly' +# - 14 colors +# - soft (k-means) } else { return(rainbow_hcl(n)) } diff --git a/man/smart_palette.Rd b/man/smart_palette.Rd new file mode 100644 index 000..7e005ff --- /dev/null +++ b/man/smart_palette.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dygraphs.R +\name{smart_palette} +\alias{smart_palette} +\title{Intelligently choose the correct color palette} +\usage{ +smart_palette(n) +} +\arguments{ +\item{n}{Number of colors to return (number of categories).} +} +\value{ +A character vector of \code{n} colors. +} +\description{ +Picks between 3 different color palettes based on number of + categories to visualize. For <13 categories, uses Set1, Paired, & Set3 + from RColorBrewer. For More than 12 categories, builds a HCL color + space-based palette. +} + -- To view, visit https://gerrit.wikimedia.org/r/309395 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6a5cebdd73cb8c12a67c082c1db3268fddec38b4 Gerrit-PatchSet: 3 Gerrit-Project: wikimedia/discovery/polloi Gerrit-Branch: master Gerrit-Owner: BearlogaGerrit-Reviewer: Bearloga Gerrit-Reviewer: Chelsyx ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Move hiera settings again
Andrew Bogott has submitted this change and it was merged. Change subject: Move hiera settings again .. Move hiera settings again This is pure superstition at this point. Change-Id: I55b0465515be2241e731ee5dadc9cee18470c158 --- A hieradata/hosts/labcontrol1001.yaml M hieradata/role/eqiad/labs/puppetmaster.yaml 2 files changed, 5 insertions(+), 6 deletions(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/hieradata/hosts/labcontrol1001.yaml b/hieradata/hosts/labcontrol1001.yaml new file mode 100644 index 000..6c2120e --- /dev/null +++ b/hieradata/hosts/labcontrol1001.yaml @@ -0,0 +1,5 @@ +labspuppetbackend::mysql_host: "m5-master.eqiad.wmnet" +labspuppetbackend::mysql_db: "labspuppet" +labspuppetbackend::mysql_username: "labspuppet" +labspuppetbackend::statsd_host: "labmon1001.eqiad.wmnet" +labspuppetbackend::statsd_prefix: "labs.puppetbackend" diff --git a/hieradata/role/eqiad/labs/puppetmaster.yaml b/hieradata/role/eqiad/labs/puppetmaster.yaml index 60a23d7..77b3ddd 100644 --- a/hieradata/role/eqiad/labs/puppetmaster.yaml +++ b/hieradata/role/eqiad/labs/puppetmaster.yaml @@ -1,7 +1 @@ puppetmaster::hiera_config: labs - -labspuppetbackend::mysql_host: "m5-master.eqiad.wmnet" -labspuppetbackend::mysql_db: "labspuppet" -labspuppetbackend::mysql_username: "labspuppet" -labspuppetbackend::statsd_host: "labmon1001.eqiad.wmnet" -labspuppetbackend::statsd_prefix: "labs.puppetbackend" -- To view, visit https://gerrit.wikimedia.org/r/309491 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I55b0465515be2241e731ee5dadc9cee18470c158 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew BogottGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Move hiera settings again
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/309491 Change subject: Move hiera settings again .. Move hiera settings again This is pure superstition at this point. Change-Id: I55b0465515be2241e731ee5dadc9cee18470c158 --- A hieradata/hosts/labcontrol1001.yaml M hieradata/role/eqiad/labs/puppetmaster.yaml 2 files changed, 5 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/91/309491/1 diff --git a/hieradata/hosts/labcontrol1001.yaml b/hieradata/hosts/labcontrol1001.yaml new file mode 100644 index 000..6c2120e --- /dev/null +++ b/hieradata/hosts/labcontrol1001.yaml @@ -0,0 +1,5 @@ +labspuppetbackend::mysql_host: "m5-master.eqiad.wmnet" +labspuppetbackend::mysql_db: "labspuppet" +labspuppetbackend::mysql_username: "labspuppet" +labspuppetbackend::statsd_host: "labmon1001.eqiad.wmnet" +labspuppetbackend::statsd_prefix: "labs.puppetbackend" diff --git a/hieradata/role/eqiad/labs/puppetmaster.yaml b/hieradata/role/eqiad/labs/puppetmaster.yaml index 60a23d7..77b3ddd 100644 --- a/hieradata/role/eqiad/labs/puppetmaster.yaml +++ b/hieradata/role/eqiad/labs/puppetmaster.yaml @@ -1,7 +1 @@ puppetmaster::hiera_config: labs - -labspuppetbackend::mysql_host: "m5-master.eqiad.wmnet" -labspuppetbackend::mysql_db: "labspuppet" -labspuppetbackend::mysql_username: "labspuppet" -labspuppetbackend::statsd_host: "labmon1001.eqiad.wmnet" -labspuppetbackend::statsd_prefix: "labs.puppetbackend" -- To view, visit https://gerrit.wikimedia.org/r/309491 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I55b0465515be2241e731ee5dadc9cee18470c158 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Grants for labspuppet (user for the labspuppetbackend tool)
Andrew Bogott has submitted this change and it was merged. Change subject: Grants for labspuppet (user for the labspuppetbackend tool) .. Grants for labspuppet (user for the labspuppetbackend tool) Change-Id: I0b9765f7aed99ad1b62608a3c7531a974c1d4430 --- M manifests/role/mariadb.pp M templates/mariadb/production-grants-m5.sql.erb 2 files changed, 9 insertions(+), 0 deletions(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/manifests/role/mariadb.pp b/manifests/role/mariadb.pp index aafa9cc..54850ff 100644 --- a/manifests/role/mariadb.pp +++ b/manifests/role/mariadb.pp @@ -47,6 +47,7 @@ $servermon_pass = $passwords::servermon::db_password $striker_pass= $passwords::striker::application_db_password $striker_admin_pass = $passwords::striker::admin_db_password +$labspuppet_pass = hiera('labspuppetbackend::mysql_password') file { '/etc/mysql/production-grants-shard.sql': ensure => present, diff --git a/templates/mariadb/production-grants-m5.sql.erb b/templates/mariadb/production-grants-m5.sql.erb index c516b5c..b143439 100644 --- a/templates/mariadb/production-grants-m5.sql.erb +++ b/templates/mariadb/production-grants-m5.sql.erb @@ -136,3 +136,11 @@ IDENTIFIED BY '<%= @striker_admin_pass %>'; GRANT ALL ON striker.* TO 'striker_admin'@'10.64.32.13' IDENTIFIED BY '<%= @striker_admin_pass %>'; + +-- labspuppetbackend user, will run on the labs puppetmaster host -- + +CREATE USER 'labspuppet'@'208.80.154.92' +IDENTIFIED BY '<%= @labspuppet_pass %>'; + +GRANT SELECT, INSERT, UPDATE, DELETE, ALTER +ON `labspuppet`.* TO 'labspuppet'@'208.80.154.92'; -- To view, visit https://gerrit.wikimedia.org/r/309414 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0b9765f7aed99ad1b62608a3c7531a974c1d4430 Gerrit-PatchSet: 4 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew BogottGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[wmf/1.28.0-wmf.18]: Don't use multiple return values
jenkins-bot has submitted this change and it was merged. Change subject: Don't use multiple return values .. Don't use multiple return values Contains 32d61eaad2d7a84dd3c6a004e1144e59bb613c85. Change-Id: I03d72769e01fa211a88c35ac260dcd3932adedd7 --- M composer.lock M extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua M extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua M extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua M extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseLibraryTests.lua M extensions/Wikibase/docs/lua.wiki M vendor/composer/installed.json 7 files changed, 119 insertions(+), 121 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.lock b/composer.lock index 157f38b..1975024 100644 --- a/composer.lock +++ b/composer.lock @@ -1460,12 +1460,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git;, -"reference": "f0e6045ccf0ca8209b4ce43b1f449a379223090e" +"reference": "32d61eaad2d7a84dd3c6a004e1144e59bb613c85" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/f0e6045ccf0ca8209b4ce43b1f449a379223090e;, -"reference": "f0e6045ccf0ca8209b4ce43b1f449a379223090e", +"url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/32d61eaad2d7a84dd3c6a004e1144e59bb613c85;, +"reference": "32d61eaad2d7a84dd3c6a004e1144e59bb613c85", "shasum": "" }, "require": { @@ -1539,7 +1539,7 @@ "wikibaserepo", "wikidata" ], -"time": "2016-09-06 16:42:26" +"time": "2016-09-08 22:57:05" }, { "name": "wikibase/wikimedia-badges", diff --git a/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua b/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua index 8bce497..ac2080a 100644 --- a/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua +++ b/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua @@ -53,21 +53,21 @@ langCode = langCode or mw.language.getContentLanguage():getCode() if langCode == nil then - return nil, nil + return nil end if entity[termType] == nil then - return nil, nil + return nil end local term = entity[termType][langCode] if term == nil then - return nil, nil + return nil end local actualLang = term.language or langCode - return term.value, actualLang + return term.value end -- Get the label for a given language code or the content language diff --git a/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua b/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua index 599f3c3..b025c71 100644 --- a/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua +++ b/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua @@ -156,7 +156,8 @@ return nil end - return php.getLabel( id ) + local label = php.getLabel( id ) + return label end -- Get the description for the given entity id, if specified, or of the @@ -172,7 +173,8 @@ return nil end - return php.getDescription( id ) + local description = php.getDescription( id ) + return description end -- Get the local sitelink title for the given entity id. diff --git a/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua b/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua index dbd88be..bc6d3dd 100644 --- a/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua +++ b/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua @@ -169,7 +169,7 @@ }, { name = 'mw.wikibase.entity.getLabel 1', func = testGetLabel, type='ToString', args = { 'de' }, - expect = { 'LabelDE', 'de' } + expect = { 'LabelDE' } }, { name = 'mw.wikibase.entity.getLabel 2', func = testGetLabel, type='ToString', args = { 'oooooo' }, @@
[MediaWiki-commits] [Gerrit] search/extra[master]: VersionedDocumentHandler should not return Changed if the ve...
jenkins-bot has submitted this change and it was merged. Change subject: VersionedDocumentHandler should not return Changed if the version is identical .. VersionedDocumentHandler should not return Changed if the version is identical If the version is the same we should not tell SuperDetectNoopScript that the value has changed otherwize the lucene doc will be updated even if none of the others fields have changed. Change-Id: Id2f4528f74b07a20d51d2774d52f6dafca45df73 --- M src/main/java/org/wikimedia/search/extra/superdetectnoop/VersionedDocumentHandler.java M src/test/java/org/wikimedia/search/extra/superdetectnoop/SuperDetectNoopScriptTest.java 2 files changed, 46 insertions(+), 4 deletions(-) Approvals: EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/src/main/java/org/wikimedia/search/extra/superdetectnoop/VersionedDocumentHandler.java b/src/main/java/org/wikimedia/search/extra/superdetectnoop/VersionedDocumentHandler.java index dac6fe8..d41d2dc 100644 --- a/src/main/java/org/wikimedia/search/extra/superdetectnoop/VersionedDocumentHandler.java +++ b/src/main/java/org/wikimedia/search/extra/superdetectnoop/VersionedDocumentHandler.java @@ -32,6 +32,16 @@ @Override public ChangeHandler.Result handle(Number oldVersion, Number newVersion) { -return ChangeHandler.NoopDocument.forBoolean(oldVersion.longValue() > newVersion.longValue(), newVersion); +if(oldVersion.longValue() == newVersion.longValue()) { +// If version is identical we should let other +// fields decide if the update is necessary +// otherwize it's like disabling the benefit +// of the super_noop_script, we won't update the fields +// but still update the lucene doc. +return ChangeHandler.CloseEnough.INSTANCE; +} else if(oldVersion.longValue() > newVersion.longValue()) { +return ChangeHandler.NoopDocument.INSTANCE; +} +return new Changed(newVersion); } } diff --git a/src/test/java/org/wikimedia/search/extra/superdetectnoop/SuperDetectNoopScriptTest.java b/src/test/java/org/wikimedia/search/extra/superdetectnoop/SuperDetectNoopScriptTest.java index 331ab57..debe88f 100644 --- a/src/test/java/org/wikimedia/search/extra/superdetectnoop/SuperDetectNoopScriptTest.java +++ b/src/test/java/org/wikimedia/search/extra/superdetectnoop/SuperDetectNoopScriptTest.java @@ -256,11 +256,43 @@ } @Test -public void dontNoopDocumentWithEqualVersion() throws IOException { +public void dontNoopDocumentWithEqualVersionAndDifferentData() throws IOException { indexSeedData(); -XContentBuilder b = x("int", 3, "documentVersion"); +XContentBuilder b = jsonBuilder().startObject(); +b.startObject("source"); +{ +b.field("string", "cheesecake"); +b.field("int", 3); +} +b.endObject(); +b.startObject("handlers"); +{ +b.field("int", "documentVersion"); +} +b.endObject(); +b.endObject(); update(b, true); } + +@Test +public void noopDocumentWithEqualVersionAndSameData() throws IOException { +indexSeedData(); +XContentBuilder b = jsonBuilder().startObject(); +b.startObject("source"); +{ +b.field("string", "cake"); +b.field("int", 3); +} +b.endObject(); +b.startObject("handlers"); +{ +b.field("int", "documentVersion"); +} +b.endObject(); +b.endObject(); +update(b, false); +} + @Test public void dontNoopDocumentWithMissingPrevVersion() throws IOException { @@ -313,7 +345,7 @@ } b.endObject(); b.endObject(); -Mapr = update(b, false); +update(b, false); } /** -- To view, visit https://gerrit.wikimedia.org/r/309316 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2f4528f74b07a20d51d2774d52f6dafca45df73 Gerrit-PatchSet: 1 Gerrit-Project: search/extra Gerrit-Branch: master Gerrit-Owner: DCausse Gerrit-Reviewer: EBernhardson 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...CirrusSearch[master]: Don't fail the whole reindexer thread when a single doc fails.
jenkins-bot has submitted this change and it was merged. Change subject: Don't fail the whole reindexer thread when a single doc fails. .. Don't fail the whole reindexer thread when a single doc fails. A single doc failure could cause the whole thread to fail, it can happen in cases where some docs contain invalid coordinates that are no longer accepted. We should not stop the whole thread. This patch adds support for bulk response exceptions and will retry only the docs that failed. Since it won't fail in case of failure we try to detect earlier if the resulting index can match the acceptable count deviation. This is to avoid flooding elastic with unecessary index request when we know we won't use the resulting index. Change-Id: I6e811cefe78a1cb7988fbfb6f9049134c14f084b --- M includes/Maintenance/Reindexer.php 1 file changed, 188 insertions(+), 72 deletions(-) Approvals: Cindy-the-browser-test-bot: Looks good to me, but someone else must approve EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Maintenance/Reindexer.php b/includes/Maintenance/Reindexer.php index 4d19561..8397a59 100644 --- a/includes/Maintenance/Reindexer.php +++ b/includes/Maintenance/Reindexer.php @@ -168,40 +168,47 @@ switch ( $forkResult ) { case 'child': - foreach ( $this->types as $i => $type ) { - $oldType = $this->oldTypes[$i]; - $this->reindexInternal( $type, $oldType, $processes, $fork->getChildNumber(), $chunkSize, $retryAttempts ); + $success = false; + try { + foreach ( $this->types as $i => $type ) { + $oldType = $this->oldTypes[$i]; + $this->reindexInternal( $type, $oldType, $processes, $fork->getChildNumber(), $chunkSize, $retryAttempts, $acceptableCountDeviation ); + } + $success = true; + } finally { + // We don't want the child to continue the script + die( $success ? 0 : 1 ); } - die( 0 ); case 'done': + // When done is returned all children have terminated this is handled by the ForkController break; default: $this->error( "Unexpected result while forking: $forkResult", 1 ); } - - $this->outputIndented( "Verifying counts..." ); - // We can't verify counts are exactly equal because they won't be - we still push updates into - // the old index while reindexing the new one. - foreach ( $this->types as $i => $type ) { - $oldType = $this->oldTypes[$i]; - $oldCount = (float) $oldType->count(); - $this->index->refresh(); - $newCount = (float) $type->count(); - $difference = $oldCount > 0 ? abs( $oldCount - $newCount ) / $oldCount : 0; - if ( $difference > $acceptableCountDeviation ) { - $this->output( "Not close enough! old=$oldCount new=$newCount difference=$difference\n" ); - $this->error( 'Failed to load index - counts not close enough. ' . - "old=$oldCount new=$newCount difference=$difference. " . - 'Check for warnings above.', 1 ); - } - } - $this->output( "done\n" ); } else { foreach ( $this->types as $i => $type ) { $oldType = $this->oldTypes[$i]; - $this->reindexInternal( $type, $oldType, 1, 1, $chunkSize, $retryAttempts ); + $this->reindexInternal( $type, $oldType, 1, 1, $chunkSize, $retryAttempts, $acceptableCountDeviation ); } } + + $this->outputIndented( "Verifying counts..." ); + // We can't verify counts are exactly equal because they won't be - we still push updates
[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs: move hiera settings around for the hiera god
Andrew Bogott has submitted this change and it was merged. Change subject: labs: move hiera settings around for the hiera god .. labs: move hiera settings around for the hiera god Change-Id: Id8348b7e71893c1ee6c373402473b1162f959eaf --- M hieradata/eqiad.yaml M hieradata/role/eqiad/labs/puppetmaster.yaml 2 files changed, 6 insertions(+), 6 deletions(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml index 8d53547..8c53f2e 100644 --- a/hieradata/eqiad.yaml +++ b/hieradata/eqiad.yaml @@ -98,12 +98,6 @@ labs_horizon_host: "californium.wikimedia.org" labs_host_ips: '10.64.20.0/24' -labspuppetbackend::mysql_host: "m5-master.eqiad.wmnet" -labspuppetbackend::mysql_db: "labspuppet" -labspuppetbackend::mysql_username: "labspuppet" -labspuppetbackend::statsd_host: "labmon1001.eqiad.wmnet" -labspuppetbackend::statsd_prefix: "labs.puppetbackend" - # These are the up-and-coming, better dns servers: labsdnsconfig: host: 'labs-ns0.wikimedia.org' diff --git a/hieradata/role/eqiad/labs/puppetmaster.yaml b/hieradata/role/eqiad/labs/puppetmaster.yaml index 77b3ddd..60a23d7 100644 --- a/hieradata/role/eqiad/labs/puppetmaster.yaml +++ b/hieradata/role/eqiad/labs/puppetmaster.yaml @@ -1 +1,7 @@ puppetmaster::hiera_config: labs + +labspuppetbackend::mysql_host: "m5-master.eqiad.wmnet" +labspuppetbackend::mysql_db: "labspuppet" +labspuppetbackend::mysql_username: "labspuppet" +labspuppetbackend::statsd_host: "labmon1001.eqiad.wmnet" +labspuppetbackend::statsd_prefix: "labs.puppetbackend" -- To view, visit https://gerrit.wikimedia.org/r/309489 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id8348b7e71893c1ee6c373402473b1162f959eaf Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: YuvipandaGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: When undoing an edit with api edit, allow overriding content...
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/309490 Change subject: When undoing an edit with api edit, allow overriding content model. .. When undoing an edit with api edit, allow overriding content model. This brings the api inline with web UI changes from Ic528f65d. Change-Id: Ib97eef38d228c4da4b062ee96dd926ee665b --- M includes/api/ApiEditPage.php 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/90/309490/1 diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 00daba9..5a73007 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -97,6 +97,7 @@ } else { $contentHandler = ContentHandler::getForModelID( $params['contentmodel'] ); } + $contentModel = $contentHandler->getModelID(); $name = $titleObj->getPrefixedDBkey(); $model = $contentHandler->getModelID(); @@ -265,8 +266,15 @@ if ( !$newContent ) { $this->dieUsageMsg( 'undo-failure' ); } - - $params['text'] = $newContent->serialize( $params['contentformat'] ); + // If we are reverting content model, the new content model + // might not support the current serialization format, in + // which case go back to the old serialization format. + if ( !$newContent->isSupportedFormat( $params['contentformat'] ) ) { + $contentFormat = $undoafterRev->getContentFormat(); + } + $params['text'] = $newContent->serialize( $contentFormat ); + // Override content model. + $contentModel = $newContent->getModel(); // If no summary was given and we only undid one rev, // use an autosummary @@ -288,7 +296,7 @@ $requestArray = [ 'wpTextbox1' => $params['text'], 'format' => $contentFormat, - 'model' => $contentHandler->getModelID(), + 'model' => $contentModel, 'wpEditToken' => $params['token'], 'wpIgnoreBlankSummary' => true, 'wpIgnoreBlankArticle' => true, -- To view, visit https://gerrit.wikimedia.org/r/309490 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib97eef38d228c4da4b062ee96dd926ee665b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Brian Wolff___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs: move hiera settings around for the hiera god
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/309489 Change subject: labs: move hiera settings around for the hiera god .. labs: move hiera settings around for the hiera god Change-Id: Id8348b7e71893c1ee6c373402473b1162f959eaf --- A hieradata/common/labspuppetbackend.yaml M hieradata/eqiad.yaml 2 files changed, 5 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/89/309489/1 diff --git a/hieradata/common/labspuppetbackend.yaml b/hieradata/common/labspuppetbackend.yaml new file mode 100644 index 000..0276683 --- /dev/null +++ b/hieradata/common/labspuppetbackend.yaml @@ -0,0 +1,5 @@ +mysql_host: "m5-master.eqiad.wmnet" +mysql_db: "labspuppet" +mysql_username: "labspuppet" +statsd_host: "labmon1001.eqiad.wmnet" +statsd_prefix: "labs.puppetbackend" diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml index 8d53547..8c53f2e 100644 --- a/hieradata/eqiad.yaml +++ b/hieradata/eqiad.yaml @@ -98,12 +98,6 @@ labs_horizon_host: "californium.wikimedia.org" labs_host_ips: '10.64.20.0/24' -labspuppetbackend::mysql_host: "m5-master.eqiad.wmnet" -labspuppetbackend::mysql_db: "labspuppet" -labspuppetbackend::mysql_username: "labspuppet" -labspuppetbackend::statsd_host: "labmon1001.eqiad.wmnet" -labspuppetbackend::statsd_prefix: "labs.puppetbackend" - # These are the up-and-coming, better dns servers: labsdnsconfig: host: 'labs-ns0.wikimedia.org' -- To view, visit https://gerrit.wikimedia.org/r/309489 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8348b7e71893c1ee6c373402473b1162f959eaf Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Popups[wmf/1.28.0-wmf.18]: Follow-up I6dac2911: ext.popups.core depends on mediawiki.st...
jenkins-bot has submitted this change and it was merged. Change subject: Follow-up I6dac2911: ext.popups.core depends on mediawiki.storage .. Follow-up I6dac2911: ext.popups.core depends on mediawiki.storage To stop TypeError: Cannot read property 'get' of undefined in Object.mw.popups.getEnabledState Change-Id: I8fb648e1e6a4921ba04752a4314cb5937485ac01 (cherry picked from commit 5574c98628eea33e97725c4eee1fe5b55e27b672) --- M extension.json 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index 0182aa1..a685988 100644 --- a/extension.json +++ b/extension.json @@ -67,7 +67,8 @@ "mediawiki.api", "mediawiki.Title", "mediawiki.Uri", - "mediawiki.RegExp" + "mediawiki.RegExp", + "mediawiki.storage" ], "targets": [ "desktop", -- To view, visit https://gerrit.wikimedia.org/r/309469 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8fb648e1e6a4921ba04752a4314cb5937485ac01 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: wmf/1.28.0-wmf.18 Gerrit-Owner: Alex MonkGerrit-Reviewer: Dereckson Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge master into deployment
jenkins-bot has submitted this change and it was merged. Change subject: Merge master into deployment .. Merge master into deployment 13ce4c11406929b260d5fcb188c48da997870cd1 Add missing "use" statement Change-Id: I955326abc0259dd898e21ad458b3f424ff77fb81 --- 0 files changed, 0 insertions(+), 0 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified -- To view, visit https://gerrit.wikimedia.org/r/309488 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I955326abc0259dd898e21ad458b3f424ff77fb81 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: AwightGerrit-Reviewer: Awight Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge master into deployment
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/309488 Change subject: Merge master into deployment .. Merge master into deployment 13ce4c11406929b260d5fcb188c48da997870cd1 Add missing "use" statement Change-Id: I955326abc0259dd898e21ad458b3f424ff77fb81 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/88/309488/1 -- To view, visit https://gerrit.wikimedia.org/r/309488 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I955326abc0259dd898e21ad458b3f424ff77fb81 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Add missing "use" statement
jenkins-bot has submitted this change and it was merged. Change subject: Add missing "use" statement .. Add missing "use" statement Change-Id: I61bb1f5a60a62146060a3bdbfa29a99831e2101c --- M sites/all/modules/queue2civicrm/fredge/PaymentsInitQueueConsumer.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/queue2civicrm/fredge/PaymentsInitQueueConsumer.php b/sites/all/modules/queue2civicrm/fredge/PaymentsInitQueueConsumer.php index 03e618a..a164129 100644 --- a/sites/all/modules/queue2civicrm/fredge/PaymentsInitQueueConsumer.php +++ b/sites/all/modules/queue2civicrm/fredge/PaymentsInitQueueConsumer.php @@ -1,5 +1,6 @@ https://gerrit.wikimedia.org/r/309485 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61bb1f5a60a62146060a3bdbfa29a99831e2101c Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: AwightGerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: admin: allow matrix.py to output a wikitext table
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/309337 Change subject: admin: allow matrix.py to output a wikitext table .. admin: allow matrix.py to output a wikitext table Like this one: https://www.mediawiki.org/wiki/Wikimedia_Release_Engineering_Team/Access_list Change-Id: I92aa98ce727fa49cc7b88d4cc0d7249ab470a587 --- M modules/admin/data/matrix.py 1 file changed, 24 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/37/309337/1 diff --git a/modules/admin/data/matrix.py b/modules/admin/data/matrix.py index 2900575..951eead 100755 --- a/modules/admin/data/matrix.py +++ b/modules/admin/data/matrix.py @@ -25,10 +25,25 @@ import yaml if len(sys.argv) <= 1: -print 'usage: matrix.py user1 [user2 ..]' +print 'usage: matrix.py [--wikitext] user1 [user2 ..]' sys.exit(1) users = sys.argv[1:] + +TOP_LEFT = 'grp/users' +HEADER_SEPARATOR = '\t' +HEADER_END = '' +ROW_SEPARATOR = '\t' +GROUP_BEGIN = '' +mode = 'plain' +if len(users) and users[0] == '--wikitext': +users = users[1:] +HEADER_SEPARATOR = '\n! ' +TOP_LEFT = '! ' + TOP_LEFT +HEADER_END = '\n' +ROW_SEPARATOR = '\n|' +GROUP_BEGIN = '|-\n|' +mode = 'wikitext' with open('data.yaml', 'r') as f: admins = yaml.safe_load(f) @@ -39,7 +54,9 @@ print 'Unknown user(s):', ', '.join(unknown) sys.exit(1) -print '\t'.join(['grp/users'] + users) +if mode == 'wikitext': +print '\n{| class="wikitable"' +print HEADER_SEPARATOR.join([TOP_LEFT] + users) + HEADER_END groups = admins.get('groups', {}) for group_name in sorted(groups.keys()): @@ -50,7 +67,10 @@ continue members = set(users) & set(group_members) -print '\t'.join( +print GROUP_BEGIN + ROW_SEPARATOR.join( [group_name] + -['OK' if u in members else '-' +['OK' if u in members else ' ' for u in users]) + +if mode == 'wikitext': +print '|}' \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/309337 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I92aa98ce727fa49cc7b88d4cc0d7249ab470a587 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Alex Monk___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Add missing "use" statement
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/309485 Change subject: Add missing "use" statement .. Add missing "use" statement Change-Id: I61bb1f5a60a62146060a3bdbfa29a99831e2101c --- M sites/all/modules/queue2civicrm/fredge/PaymentsInitQueueConsumer.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/85/309485/1 diff --git a/sites/all/modules/queue2civicrm/fredge/PaymentsInitQueueConsumer.php b/sites/all/modules/queue2civicrm/fredge/PaymentsInitQueueConsumer.php index 03e618a..a164129 100644 --- a/sites/all/modules/queue2civicrm/fredge/PaymentsInitQueueConsumer.php +++ b/sites/all/modules/queue2civicrm/fredge/PaymentsInitQueueConsumer.php @@ -1,5 +1,6 @@ https://gerrit.wikimedia.org/r/309485 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61bb1f5a60a62146060a3bdbfa29a99831e2101c Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Add security header filters
GWicke has uploaded a new change for review. https://gerrit.wikimedia.org/r/309486 Change subject: Add security header filters .. Add security header filters Update for the deployment of https://github.com/wikimedia/restbase/pull/665. Change-Id: I297623e6c3b990122d28dae0a33e3ad6a4b5ad46 --- M modules/restbase/templates/config.labs.yaml.erb M modules/restbase/templates/config.yaml.erb 2 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/86/309486/1 diff --git a/modules/restbase/templates/config.labs.yaml.erb b/modules/restbase/templates/config.labs.yaml.erb index 766b4ae..45f188e 100644 --- a/modules/restbase/templates/config.labs.yaml.erb +++ b/modules/restbase/templates/config.labs.yaml.erb @@ -62,6 +62,8 @@ root_spec: _spec title: "The RESTBase root" # Some more general RESTBase info + x-request-filters: +- path: lib/security_response_header_filter.js x-sub-request-filters: - type: default name: http diff --git a/modules/restbase/templates/config.yaml.erb b/modules/restbase/templates/config.yaml.erb index d350314..30ae58f 100644 --- a/modules/restbase/templates/config.yaml.erb +++ b/modules/restbase/templates/config.yaml.erb @@ -91,6 +91,8 @@ root_spec: _spec title: "The RESTBase root" # Some more general RESTBase info + x-request-filters: +- path: lib/security_response_header_filter.js x-sub-request-filters: - type: default name: http -- To view, visit https://gerrit.wikimedia.org/r/309486 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I297623e6c3b990122d28dae0a33e3ad6a4b5ad46 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: GWicke___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[wmf/1.28.0-wmf.18]: Don't use multiple return values
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/309487 Change subject: Don't use multiple return values .. Don't use multiple return values Contains 32d61eaad2d7a84dd3c6a004e1144e59bb613c85. Change-Id: I03d72769e01fa211a88c35ac260dcd3932adedd7 --- M composer.lock M extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua M extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua M extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua M extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseLibraryTests.lua M extensions/Wikibase/docs/lua.wiki M vendor/composer/installed.json 7 files changed, 119 insertions(+), 121 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/87/309487/1 diff --git a/composer.lock b/composer.lock index 157f38b..1975024 100644 --- a/composer.lock +++ b/composer.lock @@ -1460,12 +1460,12 @@ "source": { "type": "git", "url": "https://github.com/wikimedia/mediawiki-extensions-Wikibase.git;, -"reference": "f0e6045ccf0ca8209b4ce43b1f449a379223090e" +"reference": "32d61eaad2d7a84dd3c6a004e1144e59bb613c85" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/f0e6045ccf0ca8209b4ce43b1f449a379223090e;, -"reference": "f0e6045ccf0ca8209b4ce43b1f449a379223090e", +"url": "https://api.github.com/repos/wikimedia/mediawiki-extensions-Wikibase/zipball/32d61eaad2d7a84dd3c6a004e1144e59bb613c85;, +"reference": "32d61eaad2d7a84dd3c6a004e1144e59bb613c85", "shasum": "" }, "require": { @@ -1539,7 +1539,7 @@ "wikibaserepo", "wikidata" ], -"time": "2016-09-06 16:42:26" +"time": "2016-09-08 22:57:05" }, { "name": "wikibase/wikimedia-badges", diff --git a/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua b/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua index 8bce497..ac2080a 100644 --- a/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua +++ b/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua @@ -53,21 +53,21 @@ langCode = langCode or mw.language.getContentLanguage():getCode() if langCode == nil then - return nil, nil + return nil end if entity[termType] == nil then - return nil, nil + return nil end local term = entity[termType][langCode] if term == nil then - return nil, nil + return nil end local actualLang = term.language or langCode - return term.value, actualLang + return term.value end -- Get the label for a given language code or the content language diff --git a/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua b/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua index 599f3c3..b025c71 100644 --- a/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua +++ b/extensions/Wikibase/client/includes/DataAccess/Scribunto/mw.wikibase.lua @@ -156,7 +156,8 @@ return nil end - return php.getLabel( id ) + local label = php.getLabel( id ) + return label end -- Get the description for the given entity id, if specified, or of the @@ -172,7 +173,8 @@ return nil end - return php.getDescription( id ) + local description = php.getDescription( id ) + return description end -- Get the local sitelink title for the given entity id. diff --git a/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua b/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua index dbd88be..bc6d3dd 100644 --- a/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua +++ b/extensions/Wikibase/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua @@ -169,7 +169,7 @@ }, { name = 'mw.wikibase.entity.getLabel 1', func = testGetLabel, type='ToString', args = { 'de' }, - expect = { 'LabelDE', 'de' } + expect = { 'LabelDE' } }, { name = 'mw.wikibase.entity.getLabel 2', func = testGetLabel,
[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.28.0-wmf.18]: Switch to geojson for geoshapes srv
jenkins-bot has submitted this change and it was merged. Change subject: Switch to geojson for geoshapes srv .. Switch to geojson for geoshapes srv For now, use geojson instead of topojson. 4x traffic cost :( Bug: T144777 Change-Id: I5cf223c3c5292c68139bd67825a7c96b7a76378f --- M modules/box/Map.js 1 file changed, 11 insertions(+), 5 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/box/Map.js b/modules/box/Map.js index 97edacd..8df0a2b 100644 --- a/modules/box/Map.js +++ b/modules/box/Map.js @@ -242,14 +242,20 @@ uri.port = undefined; uri.path = '/geoshape'; uri.query.origin = location.protocol + '//' + location.host; + // HACK: workaround for T144777 + uri.query.getgeojson = 1; return $.getJSON( uri.toString() ).then( function ( geoshape ) { delete data.href; - data.type = 'FeatureCollection'; - data.features = []; - $.each( geoshape.objects, function ( key ) { - data.features.push( topojson.feature( geoshape, geoshape.objects[ key ] ) ); - } ); + + // HACK: workaround for T144777 - we should be using topojson instead + $.extend( data, geoshape ); + + // data.type = 'FeatureCollection'; + // data.features = []; + // $.each( geoshape.objects, function ( key ) { + // data.features.push( topojson.feature( geoshape, geoshape.objects[ key ] ) ); + // } ); } ); default: -- To view, visit https://gerrit.wikimedia.org/r/309481 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5cf223c3c5292c68139bd67825a7c96b7a76378f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: wmf/1.28.0-wmf.18 Gerrit-Owner: YurikGerrit-Reviewer: Dereckson Gerrit-Reviewer: MaxSem Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Quote the labspuppetbackend hiera settings.
Andrew Bogott has submitted this change and it was merged. Change subject: Quote the labspuppetbackend hiera settings. .. Quote the labspuppetbackend hiera settings. Will this help? Maybe. Change-Id: I4f3b608b0250a28c6e82aff58735b29de5969fce --- M hieradata/eqiad.yaml 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml index 0f83b3e..8d53547 100644 --- a/hieradata/eqiad.yaml +++ b/hieradata/eqiad.yaml @@ -98,11 +98,11 @@ labs_horizon_host: "californium.wikimedia.org" labs_host_ips: '10.64.20.0/24' -labspuppetbackend::mysql_host: m5-master.eqiad.wmnet -labspuppetbackend::mysql_db: labspuppet -labspuppetbackend::mysql_username: labspuppet -labspuppetbackend::statsd_host: labmon1001.eqiad.wmnet -labspuppetbackend::statsd_prefix: labs.puppetbackend +labspuppetbackend::mysql_host: "m5-master.eqiad.wmnet" +labspuppetbackend::mysql_db: "labspuppet" +labspuppetbackend::mysql_username: "labspuppet" +labspuppetbackend::statsd_host: "labmon1001.eqiad.wmnet" +labspuppetbackend::statsd_prefix: "labs.puppetbackend" # These are the up-and-coming, better dns servers: labsdnsconfig: -- To view, visit https://gerrit.wikimedia.org/r/309484 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f3b608b0250a28c6e82aff58735b29de5969fce Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew BogottGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[wmf/1.28.0-wmf.18]: Don't use multiple return values
jenkins-bot has submitted this change and it was merged. Change subject: Don't use multiple return values .. Don't use multiple return values This is a quick fix for the branch, we will probably do something "better" on master. Bug: T145138 Change-Id: Ib5894209f385349788846f8633df7ddd8a68bd15 --- M client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua M client/includes/DataAccess/Scribunto/mw.wikibase.lua M client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua M client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseLibraryTests.lua M docs/lua.wiki 5 files changed, 26 insertions(+), 28 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua index 8bce497..ac2080a 100644 --- a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua +++ b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua @@ -53,21 +53,21 @@ langCode = langCode or mw.language.getContentLanguage():getCode() if langCode == nil then - return nil, nil + return nil end if entity[termType] == nil then - return nil, nil + return nil end local term = entity[termType][langCode] if term == nil then - return nil, nil + return nil end local actualLang = term.language or langCode - return term.value, actualLang + return term.value end -- Get the label for a given language code or the content language diff --git a/client/includes/DataAccess/Scribunto/mw.wikibase.lua b/client/includes/DataAccess/Scribunto/mw.wikibase.lua index 599f3c3..b025c71 100644 --- a/client/includes/DataAccess/Scribunto/mw.wikibase.lua +++ b/client/includes/DataAccess/Scribunto/mw.wikibase.lua @@ -156,7 +156,8 @@ return nil end - return php.getLabel( id ) + local label = php.getLabel( id ) + return label end -- Get the description for the given entity id, if specified, or of the @@ -172,7 +173,8 @@ return nil end - return php.getDescription( id ) + local description = php.getDescription( id ) + return description end -- Get the local sitelink title for the given entity id. diff --git a/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua b/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua index dbd88be..bc6d3dd 100644 --- a/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua +++ b/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua @@ -169,7 +169,7 @@ }, { name = 'mw.wikibase.entity.getLabel 1', func = testGetLabel, type='ToString', args = { 'de' }, - expect = { 'LabelDE', 'de' } + expect = { 'LabelDE' } }, { name = 'mw.wikibase.entity.getLabel 2', func = testGetLabel, type='ToString', args = { 'oooooo' }, @@ -180,15 +180,15 @@ expect = "bad argument #1 to 'getLabel' (string, number or nil expected, got function)" }, { name = 'mw.wikibase.entity.getLabel 4 (content language)', func = testGetLabel, type='ToString', - expect = { 'LabelDE', 'de' } + expect = { 'LabelDE' } }, { name = 'mw.wikibase.entity.getLabel 5 (actual lang code)', func = testGetLabel, type='ToString', args = { 'en' }, - expect = { 'LabelDE-fallback', 'de' } + expect = { 'LabelDE-fallback' } }, { name = 'mw.wikibase.entity.getDescription 1', func = testGetDescription, type='ToString', args = { 'de' }, - expect = { 'DescriptionDE', 'de' } + expect = { 'DescriptionDE' } }, { name = 'mw.wikibase.entity.getDescription 2', func = testGetDescription, type='ToString', args = { 'oooooo' }, @@ -199,11 +199,11 @@ expect = "bad argument #1 to 'getDescription' (string, number or nil expected, got function)" }, { name = 'mw.wikibase.entity.getDescription 4 (content language)', func = testGetDescription, type='ToString', - expect = { 'DescriptionDE', 'de' } + expect = { 'DescriptionDE' } }, { name = 'mw.wikibase.entity.getDescription 5 (actual lang code)', func = testGetDescription, type='ToString', args = { 'en' }, - expect = { 'DescriptionDE-fallback', 'de' } + expect = { 'DescriptionDE-fallback' } }, { name = 'mw.wikibase.entity.getSitelink 1', func = testGetSitelink, type='ToString',
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Make 'Edit threshhold' notif appear regardless of title exis...
jenkins-bot has submitted this change and it was merged. Change subject: Make 'Edit threshhold' notif appear regardless of title existence .. Make 'Edit threshhold' notif appear regardless of title existence If a user recieves 'this is your X edit' they should get this notif regardless of whether the edit they created was deleted. We should make sure the title is there only for deciding whether or not to create a link for it; otherwise, the notification will just appear without a link to the revision. Change-Id: I00ed4278bb4e15b1e9ddfa2c3af8fad0540fc5f8 --- M includes/formatters/EditThresholdPresentationModel.php 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/formatters/EditThresholdPresentationModel.php b/includes/formatters/EditThresholdPresentationModel.php index 7857e68..5d724f5 100644 --- a/includes/formatters/EditThresholdPresentationModel.php +++ b/includes/formatters/EditThresholdPresentationModel.php @@ -11,13 +11,12 @@ } public function getPrimaryLink() { + if ( !$this->event->getTitle() ) { + return false; + } return array( 'url' => $this->event->getTitle()->getLocalURL(), 'label' => $this->msg( 'notification-link-thank-you-edit', $this->getViewingUserForGender() )->text() ); - } - - public function canRender() { - return $this->event->getTitle() !== null; } } -- To view, visit https://gerrit.wikimedia.org/r/309462 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I00ed4278bb4e15b1e9ddfa2c3af8fad0540fc5f8 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: MooeypooGerrit-Reviewer: Mattflaschen Gerrit-Reviewer: Mooeypoo Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Quote the labspuppetbackend hiera settings.
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/309484 Change subject: Quote the labspuppetbackend hiera settings. .. Quote the labspuppetbackend hiera settings. Will this help? Maybe. Change-Id: I4f3b608b0250a28c6e82aff58735b29de5969fce --- M hieradata/eqiad.yaml 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/84/309484/1 diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml index 0f83b3e..8d53547 100644 --- a/hieradata/eqiad.yaml +++ b/hieradata/eqiad.yaml @@ -98,11 +98,11 @@ labs_horizon_host: "californium.wikimedia.org" labs_host_ips: '10.64.20.0/24' -labspuppetbackend::mysql_host: m5-master.eqiad.wmnet -labspuppetbackend::mysql_db: labspuppet -labspuppetbackend::mysql_username: labspuppet -labspuppetbackend::statsd_host: labmon1001.eqiad.wmnet -labspuppetbackend::statsd_prefix: labs.puppetbackend +labspuppetbackend::mysql_host: "m5-master.eqiad.wmnet" +labspuppetbackend::mysql_db: "labspuppet" +labspuppetbackend::mysql_username: "labspuppet" +labspuppetbackend::statsd_host: "labmon1001.eqiad.wmnet" +labspuppetbackend::statsd_prefix: "labs.puppetbackend" # These are the up-and-coming, better dns servers: labsdnsconfig: -- To view, visit https://gerrit.wikimedia.org/r/309484 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f3b608b0250a28c6e82aff58735b29de5969fce Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CentralNotice[wmf_deploy]: Merge branch 'master' into wmf_deploy
AndyRussG has submitted this change and it was merged. Change subject: Merge branch 'master' into wmf_deploy .. Merge branch 'master' into wmf_deploy Change-Id: Ifc42755d52e8bdc79565832c30168ef0885e01ae --- 0 files changed, 0 insertions(+), 0 deletions(-) Approvals: AndyRussG: Verified; Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/309479 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifc42755d52e8bdc79565832c30168ef0885e01ae Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: wmf_deploy Gerrit-Owner: AndyRussGGerrit-Reviewer: AndyRussG ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] oojs/ui[master]: MediaWiki theme: Enhance button styles and align them to new...
VolkerE has uploaded a new change for review. https://gerrit.wikimedia.org/r/309483 Change subject: MediaWiki theme: Enhance button styles and align them to new color palette .. MediaWiki theme: Enhance button styles and align them to new color palette Together with aligning buttons to new WCAG 2.0 level AA compliant color palette we're also enhancing button appearance to address several issues: - simplifying visual distinction between input fields and buttons, - aligning icon/indicator with text color, - increasing contrast of disabled elements and widgets further for people with visual disabilities without negatively affecting distinction for others and - visually clarifying selected elements in ButtonSelect- and ToggleButtonWidget. Bug: T86047 Bug: T88038 Bug: T109915 Bug: T136590 Change-Id: Ic89d4c4adfc0ae07a81920e4797842677ad11c75 --- M php/themes/MediaWikiTheme.php M src/themes/mediawiki/MediaWikiTheme.js M src/themes/mediawiki/common.less M src/themes/mediawiki/elements.less M src/themes/mediawiki/tools.less M src/themes/mediawiki/widgets.less 6 files changed, 111 insertions(+), 48 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/83/309483/1 diff --git a/php/themes/MediaWikiTheme.php b/php/themes/MediaWikiTheme.php index 939b728..c3a1745 100644 --- a/php/themes/MediaWikiTheme.php +++ b/php/themes/MediaWikiTheme.php @@ -27,7 +27,7 @@ } elseif ( !$isFramed && $element->isDisabled() ) { // Frameless disabled button, always use black icon regardless of flags $variants['invert'] = false; - } else { + } elseif ( !$element->isDisabled() ) { // Any other kind of button, use the right colored icon if available $variants['progressive'] = $element->hasFlag( 'progressive' ); $variants['constructive'] = $element->hasFlag( 'constructive' ); diff --git a/src/themes/mediawiki/MediaWikiTheme.js b/src/themes/mediawiki/MediaWikiTheme.js index 07d2e6e..92ce306 100644 --- a/src/themes/mediawiki/MediaWikiTheme.js +++ b/src/themes/mediawiki/MediaWikiTheme.js @@ -40,7 +40,7 @@ } else if ( !isFramed && element.isDisabled() ) { // Frameless disabled button, always use black icon regardless of flags variants.invert = false; - } else { + } else if ( !element.isDisabled() ) { // Any other kind of button, use the right colored icon if available variants.progressive = element.hasFlag( 'progressive' ); variants.constructive = element.hasFlag( 'constructive' ); diff --git a/src/themes/mediawiki/common.less b/src/themes/mediawiki/common.less index 69287d7..1af09b8 100644 --- a/src/themes/mediawiki/common.less +++ b/src/themes/mediawiki/common.less @@ -3,17 +3,17 @@ @oo-ui-default-image-path: 'themes/mediawiki/images'; @background-color-default: #fff; -@background-color-default-hover: #eee; -@background-color-active: #999; +@background-color-default-hover: #eaecf0; +@background-color-default-active: #9aa0a7; @color-default: #222; @color-default-active: #000; @color-default-light: #fff; @color-emphasized: @color-default-active; -@color-placeholder: #595959; // aligns to WCAG 2.0 level AAA 7:1 contrast ratio +@color-placeholder: #54595d; // aligns to WCAG 2.0 level AAA 7:1 contrast ratio // Primary 'Progressive' and 'Destructive' Colors -@background-color-progressive: #ebf2ff; // equals rgba output in `fade( @color-progressive, 10% )` +@background-color-progressive: #eaf3ff; // equals rgba output in `fade( @color-progressive, 10% )` @background-color-progressive-hover: rgba( 41, 98, 204, 0.1 ); @color-progressive: #36c; // equals HSB 220°/75%/80% @color-progressive-hover: #447ff5; // equals HSB 220°/72%/96% @@ -27,14 +27,21 @@ @color-destructive-focus: @color-destructive; // Disabled Widgets -@background-color-disabled: #f3f3f3; -@background-color-disabled-filled: #ddd; -@color-disabled: #ccc; -@color-disabled-filled: #fff; -@opacity-disabled: 0.2; +@background-color-disabled: #eaecf0; +@background-color-disabled-filled: #c8ccd1; +@color-disabled: #7d8389; +@color-disabled-filled: @color-default-light; +@opacity-disabled: 0.53; // `0.53` equals `#7b7b7b` on background-color `#fff` +@opacity-disabled-filled: 1; +@opacity-disabled-indicator: 0.15; // equals `#c7c8cc` on background-color `#fff` +@opacity-disabled-tool: 0.3; // Invalid Widget (validation error feedback) @color-invalid: #f00; + +// "Framed" Widgets (Framed ButtonWidget, ToggleSwitchWidget...) +@background-color-framed: #f8f9fa; +@background-color-framed-hover: @background-color-default; //fade( @color-default, 10% ); // Toolbar, Tools & Menus
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Include labspuppetbackend on all Labs puppetmasters.
Andrew Bogott has submitted this change and it was merged. Change subject: Include labspuppetbackend on all Labs puppetmasters. .. Include labspuppetbackend on all Labs puppetmasters. Change-Id: I0cd94e514cd66ff7f9f2c45989411b0c96329975 --- M hieradata/eqiad.yaml M manifests/site.pp M modules/role/manifests/labs/puppetmaster.pp 3 files changed, 8 insertions(+), 2 deletions(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml index 8c53f2e..0f83b3e 100644 --- a/hieradata/eqiad.yaml +++ b/hieradata/eqiad.yaml @@ -98,6 +98,12 @@ labs_horizon_host: "californium.wikimedia.org" labs_host_ips: '10.64.20.0/24' +labspuppetbackend::mysql_host: m5-master.eqiad.wmnet +labspuppetbackend::mysql_db: labspuppet +labspuppetbackend::mysql_username: labspuppet +labspuppetbackend::statsd_host: labmon1001.eqiad.wmnet +labspuppetbackend::statsd_prefix: labs.puppetbackend + # These are the up-and-coming, better dns servers: labsdnsconfig: host: 'labs-ns0.wikimedia.org' diff --git a/manifests/site.pp b/manifests/site.pp index a1889d1..79868b2 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1194,8 +1194,6 @@ include base::firewall role(labs::openstack::nova::controller, labs::puppetmaster) -include labspuppetbackend - # Labtest is weird; the mysql server is on labtestcontrol2001. So # we need some special fw rules to allow that $designate = ipresolve(hiera('labs_designate_hostname'),4) diff --git a/modules/role/manifests/labs/puppetmaster.pp b/modules/role/manifests/labs/puppetmaster.pp index 23c634c..d7d9c99 100644 --- a/modules/role/manifests/labs/puppetmaster.pp +++ b/modules/role/manifests/labs/puppetmaster.pp @@ -82,4 +82,6 @@ remote_cert_cleaner => hiera('labs_certmanager_hostname'), } } + +include labspuppetbackend } -- To view, visit https://gerrit.wikimedia.org/r/309398 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0cd94e514cd66ff7f9f2c45989411b0c96329975 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew BogottGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Math[master]: VE: Make all edits 'quick edit' on mobile
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/309482 Change subject: VE: Make all edits 'quick edit' on mobile .. VE: Make all edits 'quick edit' on mobile Mobile doesn't really have room for the full dialog. Change-Id: I08f45c3b26bd88f75deb4dbd51435a109021f0fe --- M modules/ve-math/ve.ui.MWMathContextItem.js 1 file changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math refs/changes/82/309482/1 diff --git a/modules/ve-math/ve.ui.MWMathContextItem.js b/modules/ve-math/ve.ui.MWMathContextItem.js index a247672..a5f8d67 100644 --- a/modules/ve-math/ve.ui.MWMathContextItem.js +++ b/modules/ve-math/ve.ui.MWMathContextItem.js @@ -23,7 +23,10 @@ flags: [ 'progressive' ] } ); - this.actionButtons.addItems( [ this.quickEditButton ], 0 ); + // Don't show quick edit button in mobile as the primary action will be quick edit + if ( !this.context.isMobile() ) { + this.actionButtons.addItems( [ this.quickEditButton ], 0 ); + } this.quickEditButton.connect( this, { click: 'onInlineEditButtonClick' } ); @@ -58,6 +61,15 @@ this.context.getSurface().executeCommand( 'mathInspector' ); }; +/** + * @inheritdoc + */ +ve.ui.MWMathContextItem.prototype.getCommand = function () { + return this.context.getSurface().commandRegistry.lookup( + this.context.isMobile() ? 'mathInspector' : this.constructor.static.commandName + ); +}; + /* Registration */ ve.ui.contextItemFactory.register( ve.ui.MWMathContextItem ); -- To view, visit https://gerrit.wikimedia.org/r/309482 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I08f45c3b26bd88f75deb4dbd51435a109021f0fe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Math Gerrit-Branch: master Gerrit-Owner: Esanders___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment
jenkins-bot has submitted this change and it was merged. Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 55c83351b40c49b3e43a777e3052c39d369df02d Delete from pending db once the transaction is completed 69e5d0bc7edef6df48d44027c58741ebfa819fe7 Let DI globals come from configuration files. 5183cc439a410dd30618aa6d2a0188b8a7f03ea7 Import refunds by contribution ID Change-Id: Ife1b80962ac418b111d98fa1ce936d0875e764bb --- 0 files changed, 0 insertions(+), 0 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified -- To view, visit https://gerrit.wikimedia.org/r/309458 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ife1b80962ac418b111d98fa1ce936d0875e764bb Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: AwightGerrit-Reviewer: Awight 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...MsUpload[REL1_27]: Fix file summary message
Sophivorus has submitted this change and it was merged. Change subject: Fix file summary message .. Fix file summary message The summary is wikitext, `mw.msg` parses limited wikitext into HTML, which not only isn't the correct behaviour, but limits what wikitext can be used in the summary; primarily templates. Change-Id: I5dc384ddba4270c1f71005401e1bae073cd2b627 (cherry picked from commit ead03a7a42a3a369c37513f8220ed3c10a958d0f) --- M MsUpload.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Sophivorus: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/MsUpload.js b/MsUpload.js index e32fe73..46fd1cb 100755 --- a/MsUpload.js +++ b/MsUpload.js @@ -360,7 +360,7 @@ token: mw.user.tokens.get( 'editToken' ), action: 'upload', ignorewarnings: true, - comment: mw.msg( 'msu-comment' ), + comment: mw.message( 'msu-comment' ).plain(), format: 'json' }; // Set multipart_params $( '#' + file.id + ' .file-progress-state' ).text( '0%' ); -- To view, visit https://gerrit.wikimedia.org/r/306330 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5dc384ddba4270c1f71005401e1bae073cd2b627 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MsUpload Gerrit-Branch: REL1_27 Gerrit-Owner: MajrGerrit-Reviewer: Nischayn22 Gerrit-Reviewer: Ratin Gerrit-Reviewer: Sophivorus 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...Kartographer[master]: Switch to geojson for geoshapes srv
jenkins-bot has submitted this change and it was merged. Change subject: Switch to geojson for geoshapes srv .. Switch to geojson for geoshapes srv For now, use geojson instead of topojson. 4x traffic cost :( Bug: T144777 Change-Id: I5cf223c3c5292c68139bd67825a7c96b7a76378f --- M modules/box/Map.js 1 file changed, 11 insertions(+), 5 deletions(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/box/Map.js b/modules/box/Map.js index ccb81c5..619020d 100644 --- a/modules/box/Map.js +++ b/modules/box/Map.js @@ -242,14 +242,20 @@ uri.port = undefined; uri.path = '/geoshape'; uri.query.origin = location.protocol + '//' + location.host; + // HACK: workaround for T144777 + uri.query.getgeojson = 1; return $.getJSON( uri.toString() ).then( function ( geoshape ) { delete data.href; - data.type = 'FeatureCollection'; - data.features = []; - $.each( geoshape.objects, function ( key ) { - data.features.push( topojson.feature( geoshape, geoshape.objects[ key ] ) ); - } ); + + // HACK: workaround for T144777 - we should be using topojson instead + $.extend( data, geoshape ); + + // data.type = 'FeatureCollection'; + // data.features = []; + // $.each( geoshape.objects, function ( key ) { + // data.features.push( topojson.feature( geoshape, geoshape.objects[ key ] ) ); + // } ); } ); default: -- To view, visit https://gerrit.wikimedia.org/r/309478 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5cf223c3c5292c68139bd67825a7c96b7a76378f Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: YurikGerrit-Reviewer: MaxSem 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...Kartographer[wmf/1.28.0-wmf.18]: Switch to geojson for geoshapes srv
Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/309481 Change subject: Switch to geojson for geoshapes srv .. Switch to geojson for geoshapes srv For now, use geojson instead of topojson. 4x traffic cost :( Bug: T144777 Change-Id: I5cf223c3c5292c68139bd67825a7c96b7a76378f --- M modules/box/Map.js 1 file changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer refs/changes/81/309481/1 diff --git a/modules/box/Map.js b/modules/box/Map.js index 97edacd..8df0a2b 100644 --- a/modules/box/Map.js +++ b/modules/box/Map.js @@ -242,14 +242,20 @@ uri.port = undefined; uri.path = '/geoshape'; uri.query.origin = location.protocol + '//' + location.host; + // HACK: workaround for T144777 + uri.query.getgeojson = 1; return $.getJSON( uri.toString() ).then( function ( geoshape ) { delete data.href; - data.type = 'FeatureCollection'; - data.features = []; - $.each( geoshape.objects, function ( key ) { - data.features.push( topojson.feature( geoshape, geoshape.objects[ key ] ) ); - } ); + + // HACK: workaround for T144777 - we should be using topojson instead + $.extend( data, geoshape ); + + // data.type = 'FeatureCollection'; + // data.features = []; + // $.each( geoshape.objects, function ( key ) { + // data.features.push( topojson.feature( geoshape, geoshape.objects[ key ] ) ); + // } ); } ); default: -- To view, visit https://gerrit.wikimedia.org/r/309481 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5cf223c3c5292c68139bd67825a7c96b7a76378f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: wmf/1.28.0-wmf.18 Gerrit-Owner: Yurik___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Allow undoing edits that change content model if top
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/309480 Change subject: Allow undoing edits that change content model if top .. Allow undoing edits that change content model if top This allows people to revert content model changes using the undo button, provided that we are undoing the topmost edit (Otherwise it may get confusing if you try to undo an edit in the middle of the history that changes content model). Change-Id: Ic528f65d0dc581c4e241a22f19c512e02aeaa9e7 --- M includes/EditPage.php M includes/content/ContentHandler.php 2 files changed, 43 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/80/309480/1 diff --git a/includes/EditPage.php b/includes/EditPage.php index 4e9aeba..7e4e411 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -562,16 +562,29 @@ $revision = $this->mArticle->getRevisionFetched(); // Disallow editing revisions with content models different from the current one - if ( $revision && $revision->getContentModel() !== $this->contentModel ) { - $this->displayViewSourcePage( - $this->getContentObject(), - wfMessage( - 'contentmodelediterror', - $revision->getContentModel(), - $this->contentModel - )->plain() - ); - return; + // Undo edits being an exception in order to allow reverting content model changes. + if ( $revision + && $revision->getContentModel() !== $this->contentModel + ) { + $prevRev = null; + if ( $this->undidRev ) { + $undidRevObj = Revision::newFromId( $this->undidRev ); + $prevRev = $undidRevObj ? $undidRevObj->getPrevious() : null; + } + if ( !$this->undidRev + || !$prevRev + || $prevRev->getContentModel() !== $this->contentModel + ) { + $this->displayViewSourcePage( + $this->getContentObject(), + wfMessage( + 'contentmodelediterror', + $revision->getContentModel(), + $this->contentModel + )->plain() + ); + return; + } } $this->isConflict = false; @@ -1134,6 +1147,14 @@ $oldContent = $this->page->getContent( Revision::RAW ); $popts = ParserOptions::newFromUserAndLang( $wgUser, $wgContLang ); $newContent = $content->preSaveTransform( $this->mTitle, $wgUser, $popts ); + if ( $newContent->getModel() !== $oldContent->getModel() ) { + // The undo may change content + // model if its reverting the top + // edit. This can result in + // mismatched content model/format. + $this->contentModel = $newContent->getModel(); + $this->contentFormat = $oldrev->getContentFormat(); + } if ( $newContent->equals( $oldContent ) ) { # Tell the user that the undo results in no change, @@ -1264,9 +1285,11 @@ $handler = ContentHandler::getForModelID( $this->contentModel ); return $handler->makeEmptyContent(); - } else { + } elseif ( !$this->undidRev ) { // Content models should always be the same since we error - // out if they are different before this point. + // out if they are different before this point (in ->edit()). + // The exception being, during an undo, the current
[MediaWiki-commits] [Gerrit] mediawiki...CentralNotice[wmf_deploy]: Merge branch 'master' into wmf_deploy
AndyRussG has uploaded a new change for review. https://gerrit.wikimedia.org/r/309479 Change subject: Merge branch 'master' into wmf_deploy .. Merge branch 'master' into wmf_deploy Change-Id: Ifc42755d52e8bdc79565832c30168ef0885e01ae --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/79/309479/1 -- To view, visit https://gerrit.wikimedia.org/r/309479 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc42755d52e8bdc79565832c30168ef0885e01ae Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: wmf_deploy Gerrit-Owner: AndyRussG___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Switch to geojson for geoshapes srv
Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/309478 Change subject: Switch to geojson for geoshapes srv .. Switch to geojson for geoshapes srv Change-Id: I5cf223c3c5292c68139bd67825a7c96b7a76378f --- M modules/box/Map.js 1 file changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer refs/changes/78/309478/1 diff --git a/modules/box/Map.js b/modules/box/Map.js index ccb81c5..619020d 100644 --- a/modules/box/Map.js +++ b/modules/box/Map.js @@ -242,14 +242,20 @@ uri.port = undefined; uri.path = '/geoshape'; uri.query.origin = location.protocol + '//' + location.host; + // HACK: workaround for T144777 + uri.query.getgeojson = 1; return $.getJSON( uri.toString() ).then( function ( geoshape ) { delete data.href; - data.type = 'FeatureCollection'; - data.features = []; - $.each( geoshape.objects, function ( key ) { - data.features.push( topojson.feature( geoshape, geoshape.objects[ key ] ) ); - } ); + + // HACK: workaround for T144777 - we should be using topojson instead + $.extend( data, geoshape ); + + // data.type = 'FeatureCollection'; + // data.features = []; + // $.each( geoshape.objects, function ( key ) { + // data.features.push( topojson.feature( geoshape, geoshape.objects[ key ] ) ); + // } ); } ); default: -- To view, visit https://gerrit.wikimedia.org/r/309478 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5cf223c3c5292c68139bd67825a7c96b7a76378f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: Yurik___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[wmf/1.28.0-wmf.18]: Don't use multiple return values
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/309477 Change subject: Don't use multiple return values .. Don't use multiple return values This is a quick fix for the branch, we will probably do something "better" on master. Bug: T145138 Change-Id: Ib5894209f385349788846f8633df7ddd8a68bd15 --- M client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua M client/includes/DataAccess/Scribunto/mw.wikibase.lua M client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua M client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseLibraryTests.lua M docs/lua.wiki 5 files changed, 26 insertions(+), 28 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/77/309477/1 diff --git a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua index 8bce497..ac2080a 100644 --- a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua +++ b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua @@ -53,21 +53,21 @@ langCode = langCode or mw.language.getContentLanguage():getCode() if langCode == nil then - return nil, nil + return nil end if entity[termType] == nil then - return nil, nil + return nil end local term = entity[termType][langCode] if term == nil then - return nil, nil + return nil end local actualLang = term.language or langCode - return term.value, actualLang + return term.value end -- Get the label for a given language code or the content language diff --git a/client/includes/DataAccess/Scribunto/mw.wikibase.lua b/client/includes/DataAccess/Scribunto/mw.wikibase.lua index 599f3c3..b025c71 100644 --- a/client/includes/DataAccess/Scribunto/mw.wikibase.lua +++ b/client/includes/DataAccess/Scribunto/mw.wikibase.lua @@ -156,7 +156,8 @@ return nil end - return php.getLabel( id ) + local label = php.getLabel( id ) + return label end -- Get the description for the given entity id, if specified, or of the @@ -172,7 +173,8 @@ return nil end - return php.getDescription( id ) + local description = php.getDescription( id ) + return description end -- Get the local sitelink title for the given entity id. diff --git a/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua b/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua index dbd88be..bc6d3dd 100644 --- a/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua +++ b/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua @@ -169,7 +169,7 @@ }, { name = 'mw.wikibase.entity.getLabel 1', func = testGetLabel, type='ToString', args = { 'de' }, - expect = { 'LabelDE', 'de' } + expect = { 'LabelDE' } }, { name = 'mw.wikibase.entity.getLabel 2', func = testGetLabel, type='ToString', args = { 'oooooo' }, @@ -180,15 +180,15 @@ expect = "bad argument #1 to 'getLabel' (string, number or nil expected, got function)" }, { name = 'mw.wikibase.entity.getLabel 4 (content language)', func = testGetLabel, type='ToString', - expect = { 'LabelDE', 'de' } + expect = { 'LabelDE' } }, { name = 'mw.wikibase.entity.getLabel 5 (actual lang code)', func = testGetLabel, type='ToString', args = { 'en' }, - expect = { 'LabelDE-fallback', 'de' } + expect = { 'LabelDE-fallback' } }, { name = 'mw.wikibase.entity.getDescription 1', func = testGetDescription, type='ToString', args = { 'de' }, - expect = { 'DescriptionDE', 'de' } + expect = { 'DescriptionDE' } }, { name = 'mw.wikibase.entity.getDescription 2', func = testGetDescription, type='ToString', args = { 'oooooo' }, @@ -199,11 +199,11 @@ expect = "bad argument #1 to 'getDescription' (string, number or nil expected, got function)" }, { name = 'mw.wikibase.entity.getDescription 4 (content language)', func = testGetDescription, type='ToString', - expect = { 'DescriptionDE', 'de' } + expect = { 'DescriptionDE' } }, { name = 'mw.wikibase.entity.getDescription 5 (actual lang code)', func = testGetDescription, type='ToString', args = { 'en' }, - expect = { 'DescriptionDE-fallback', 'de' } + expect = { 'DescriptionDE-fallback' } }, { name =
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.18]: RollbackAction: Allow 'from' to be an empty string
jenkins-bot has submitted this change and it was merged. Change subject: RollbackAction: Allow 'from' to be an empty string .. RollbackAction: Allow 'from' to be an empty string Fix regression from 9af38c046c86, which made 'from' a required non-empty parameter where previously an empty value was allowed. The rollback links always include a 'from' parameter, but it is set to an empty string by Revision::getUserText if the current revision has its username hidden. Test plan: * Go to action=history, tick latest revision and "Change visibility". * Tick "Editor's username" and apply the change. * Hit "rollback" on the history page. * Before: "missing parameter" error. After: Success. Bug: T141985 Change-Id: I20d23e2aeec858f82231910c030c14ffa3af656f (cherry picked from commit f188c23ca8a105e4bae7cd2b874eb11d9c49b733) --- M includes/actions/RollbackAction.php M resources/src/mediawiki/page/rollback.js 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/actions/RollbackAction.php b/includes/actions/RollbackAction.php index 3dc611b..aa2858d 100644 --- a/includes/actions/RollbackAction.php +++ b/includes/actions/RollbackAction.php @@ -54,7 +54,7 @@ $user = $this->getUser(); $from = $request->getVal( 'from' ); $rev = $this->page->getRevision(); - if ( $from === null || $from === '' ) { + if ( $from === null ) { throw new ErrorPageError( 'rollbackfailed', 'rollback-missingparam' ); } if ( !$rev ) { diff --git a/resources/src/mediawiki/page/rollback.js b/resources/src/mediawiki/page/rollback.js index d973d07..1ff62ba 100644 --- a/resources/src/mediawiki/page/rollback.js +++ b/resources/src/mediawiki/page/rollback.js @@ -15,7 +15,7 @@ page = mw.util.getParamValue( 'title', url ), user = mw.util.getParamValue( 'from', url ); - if ( !page || !user ) { + if ( !page || user === null ) { // Let native browsing handle the link return true; } -- To view, visit https://gerrit.wikimedia.org/r/309388 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I20d23e2aeec858f82231910c030c14ffa3af656f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.18 Gerrit-Owner: KrinkleGerrit-Reviewer: Dereckson Gerrit-Reviewer: Jack Phoenix 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...Echo[master]: Follow-up 00e0b9f45d8: fix typo in method name
jenkins-bot has submitted this change and it was merged. Change subject: Follow-up 00e0b9f45d8: fix typo in method name .. Follow-up 00e0b9f45d8: fix typo in method name Bug: T145144 Change-Id: I7a517e2e9b011af1b3d3149f29cc34d5417599c0 --- M Hooks.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/Hooks.php b/Hooks.php index 88c5071..5968b04 100644 --- a/Hooks.php +++ b/Hooks.php @@ -1047,7 +1047,7 @@ $modifiedTimes['notifications-global'] = $lastUpdate; } - $modifiedTimes[ 'notifications-seen' ] = $notifUser->getGlobalMaxSeenTime(); + $modifiedTimes[ 'notifications-seen' ] = $notifUser->getGlobalSeenTime(); } } -- To view, visit https://gerrit.wikimedia.org/r/309474 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a517e2e9b011af1b3d3149f29cc34d5417599c0 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: Mattflaschen Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] maps...deploy[master]: Update kartotherian to 5f23087
Yurik has submitted this change and it was merged. Change subject: Update kartotherian to 5f23087 .. Update kartotherian to 5f23087 List of changes: xxx Update node module dependencies Change-Id: I816ae87c45aa0526e09f7c8746f98212520c6fd4 --- D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/.nyc_output/4c7e14da3c43f94043541a03adefbcab.json D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/.nyc_output/a34532ad923a680bc450f99a9263c5c9.json D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/coverage/lcov-report/base.css D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/coverage/lcov-report/index.html D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/coverage/lcov-report/inherits.js.html D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/coverage/lcov-report/prettify.css D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/coverage/lcov-report/prettify.js D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/coverage/lcov-report/sort-arrow-sprite.png D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/coverage/lcov-report/sorter.js D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/coverage/lcov.info M node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json D node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/inherits/test.js M node_modules/bunyan/node_modules/mv/node_modules/rimraf/node_modules/glob/node_modules/once/package.json M node_modules/kartotherian-autogen/package.json M node_modules/kartotherian-cassandra/package.json M node_modules/kartotherian-core/node_modules/xmldoc/package.json M node_modules/kartotherian-core/package.json M node_modules/kartotherian-demultiplexer/package.json M node_modules/kartotherian-geoshapes/geoshapes.js M node_modules/kartotherian-geoshapes/node_modules/topojson/.eslintrc M node_modules/kartotherian-geoshapes/node_modules/topojson/build/bundle.js M node_modules/kartotherian-geoshapes/node_modules/topojson/build/topojson.js M node_modules/kartotherian-geoshapes/node_modules/topojson/build/topojson.min.js D node_modules/kartotherian-geoshapes/node_modules/topojson/node_modules/d3-geo-projection/node_modules/brfs/node_modules/static-module/node_modules/duplexer2/node_modules/readable-stream/node_modules/inherits/.nyc_output/4c7e14da3c43f94043541a03adefbcab.json D node_modules/kartotherian-geoshapes/node_modules/topojson/node_modules/d3-geo-projection/node_modules/brfs/node_modules/static-module/node_modules/duplexer2/node_modules/readable-stream/node_modules/inherits/.nyc_output/a34532ad923a680bc450f99a9263c5c9.json D node_modules/kartotherian-geoshapes/node_modules/topojson/node_modules/d3-geo-projection/node_modules/brfs/node_modules/static-module/node_modules/duplexer2/node_modules/readable-stream/node_modules/inherits/coverage/lcov-report/base.css D node_modules/kartotherian-geoshapes/node_modules/topojson/node_modules/d3-geo-projection/node_modules/brfs/node_modules/static-module/node_modules/duplexer2/node_modules/readable-stream/node_modules/inherits/coverage/lcov-report/index.html D node_modules/kartotherian-geoshapes/node_modules/topojson/node_modules/d3-geo-projection/node_modules/brfs/node_modules/static-module/node_modules/duplexer2/node_modules/readable-stream/node_modules/inherits/coverage/lcov-report/inherits.js.html D node_modules/kartotherian-geoshapes/node_modules/topojson/node_modules/d3-geo-projection/node_modules/brfs/node_modules/static-module/node_modules/duplexer2/node_modules/readable-stream/node_modules/inherits/coverage/lcov-report/prettify.css D node_modules/kartotherian-geoshapes/node_modules/topojson/node_modules/d3-geo-projection/node_modules/brfs/node_modules/static-module/node_modules/duplexer2/node_modules/readable-stream/node_modules/inherits/coverage/lcov-report/prettify.js D node_modules/kartotherian-geoshapes/node_modules/topojson/node_modules/d3-geo-projection/node_modules/brfs/node_modules/static-module/node_modules/duplexer2/node_modules/readable-stream/node_modules/inherits/coverage/lcov-report/sort-arrow-sprite.png D node_modules/kartotherian-geoshapes/node_modules/topojson/node_modules/d3-geo-projection/node_modules/brfs/node_modules/static-module/node_modules/duplexer2/node_modules/readable-stream/node_modules/inherits/coverage/lcov-report/sorter.js D
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid user autocreation race condition caused by repeatable ...
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/309476 Change subject: Avoid user autocreation race condition caused by repeatable read .. Avoid user autocreation race condition caused by repeatable read AuthManager tries to check whether the user already exists if User::addToDatabase fails in autocreation, but since the same DB row was already checked a few lines earlier and this method is typically wrapped in an implicit transaction, it will just re-read the same snapshot and not do anything useful. addToDatabase already has a check for that so let's rely on that instead. Bug: T145131 Change-Id: I94a5e8b851dcf994f5f9e773edf4e9153a4a3535 --- M includes/auth/AuthManager.php 1 file changed, 3 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/76/309476/1 diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php index 992e70f..89a22f8 100644 --- a/includes/auth/AuthManager.php +++ b/includes/auth/AuthManager.php @@ -1679,14 +1679,12 @@ try { $status = $user->addToDatabase(); if ( !$status->isOk() ) { - // double-check for a race condition (T70012) - $localId = User::idFromName( $username, User::READ_LATEST ); - if ( $localId ) { + // Double-check for a race condition (T70012). We make use of the fact that when + // addToDatabase fails due to the user already existing, the user object gets loaded. + if ( $user->getId() ) { $this->logger->info( __METHOD__ . ': {username} already exists locally (race)', [ 'username' => $username, ] ); - $user->setId( $localId ); - $user->loadFromId( User::READ_LATEST ); if ( $login ) { $this->setSessionDataForUser( $user ); } -- To view, visit https://gerrit.wikimedia.org/r/309476 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94a5e8b851dcf994f5f9e773edf4e9153a4a3535 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.28.0-wmf.18]: Avoid DataUpdate::runUpdates() calls in jobs
jenkins-bot has submitted this change and it was merged. Change subject: Avoid DataUpdate::runUpdates() calls in jobs .. Avoid DataUpdate::runUpdates() calls in jobs This wraps them in transaction rounds they do not own, so they cannot commit and wait for replicas, causing lag. Change-Id: Id7c8aaf3f16dc257fb2421f5712a74cbe9e1e5ca --- M includes/jobqueue/jobs/DeleteLinksJob.php M includes/jobqueue/jobs/RefreshLinksJob.php 2 files changed, 4 insertions(+), 2 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/jobqueue/jobs/DeleteLinksJob.php b/includes/jobqueue/jobs/DeleteLinksJob.php index 8d565bd..5c0f89f 100644 --- a/includes/jobqueue/jobs/DeleteLinksJob.php +++ b/includes/jobqueue/jobs/DeleteLinksJob.php @@ -59,7 +59,7 @@ $update = new LinksDeletionUpdate( $page, $pageId, $timestamp ); $update->setTransactionTicket( $factory->getEmptyTransactionTicket( __METHOD__ ) ); - DataUpdate::runUpdates( [ $update ] ); + $update->doUpdate(); return true; } diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php b/includes/jobqueue/jobs/RefreshLinksJob.php index b0dcd57..a337da4 100644 --- a/includes/jobqueue/jobs/RefreshLinksJob.php +++ b/includes/jobqueue/jobs/RefreshLinksJob.php @@ -263,7 +263,9 @@ } } - DataUpdate::runUpdates( $updates ); + foreach ( $updates as $update ) { + $update->doUpdate(); + } InfoAction::invalidateCache( $title ); -- To view, visit https://gerrit.wikimedia.org/r/309467 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id7c8aaf3f16dc257fb2421f5712a74cbe9e1e5ca Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.18 Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Chad 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...VisualEditor[master]: Merge transclusion and transclusion.core RL modules
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/309475 Change subject: Merge transclusion and transclusion.core RL modules .. Merge transclusion and transclusion.core RL modules No real need for separation here. Change-Id: Ic97bb0a049c1c77e3063732911e2b690e8a3a317 --- M extension.json 1 file changed, 4 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/75/309475/1 diff --git a/extension.json b/extension.json index 45666c1..88f2bf4 100644 --- a/extension.json +++ b/extension.json @@ -1578,24 +1578,10 @@ "mobile" ] }, - "ext.visualEditor.mwtransclusion.core": { - "scripts": [ - "modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js", - "modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js" - ], - "styles": [ - "modules/ve-mw/ce/styles/nodes/ve.ce.MWTransclusionNode.css" - ], - "dependencies": [ - "ext.visualEditor.mwcore" - ], - "targets": [ - "desktop", - "mobile" - ] - }, "ext.visualEditor.mwtransclusion": { "scripts": [ + "modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js", + "modules/ve-mw/ce/nodes/ve.ce.MWTransclusionNode.js", "modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js", "modules/ve-mw/dm/models/ve.dm.MWTransclusionPartModel.js", "modules/ve-mw/dm/models/ve.dm.MWTransclusionContentModel.js", @@ -1621,6 +1607,7 @@ "modules/ve-mw/ui/contextitems/ve.ui.MWTransclusionContextItem.js" ], "styles": [ + "modules/ve-mw/ce/styles/nodes/ve.ce.MWTransclusionNode.css", "modules/ve-mw/ui/styles/widgets/ve.ui.MWParameterResultWidget.css", "modules/ve-mw/ui/styles/widgets/ve.ui.MWMoreParametersResultWidget.css", "modules/ve-mw/ui/styles/widgets/ve.ui.MWNoParametersResultWidget.css", @@ -1639,7 +1626,7 @@ ] }, "dependencies": [ - "ext.visualEditor.mwtransclusion.core", + "ext.visualEditor.mwcore", "mediawiki.jqueryMsg", "mediawiki.language", "mediawiki.widgets.UserInputWidget" -- To view, visit https://gerrit.wikimedia.org/r/309475 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic97bb0a049c1c77e3063732911e2b690e8a3a317 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits