[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Strip everything before the first pf token
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406057 ) Change subject: Strip everything before the first pf token .. Strip everything before the first pf token In this isolate case, {{safesubst:#if:{{{1} only "subst:" is part of the same token as the prefix so `normalizeTarget` doesn't take care of remove the "safesubst:" The fix here is from noting that we wouldn't be at this place in the code if the target didn't normalize a canonical function name, so the contents before the prefix can be safely discarded. This is another patch along the line of 5608e83 and bcd5572 Bug: T185643 Change-Id: I7002804fcf5305ffb6c88d93c201d9e972f9037f --- M lib/wt2html/tt/TemplateHandler.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/wt2html/tt/TemplateHandler.js b/lib/wt2html/tt/TemplateHandler.js index bd00531..33968e4 100644 --- a/lib/wt2html/tt/TemplateHandler.js +++ b/lib/wt2html/tt/TemplateHandler.js @@ -473,7 +473,7 @@ if (canonicalFunctionName !== undefined) { // Extract toks that make up pfArg var pfArgToks; - var re = new RegExp(prefix, 'i'); + var re = new RegExp('^(.*?)' + prefix, 'i'); // Because of the lenient stringifying above, we need to find the prefix var i = targetToks.findIndex(function(t) { -- To view, visit https://gerrit.wikimedia.org/r/406057 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7002804fcf5305ffb6c88d93c201d9e972f9037f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra Gerrit-Reviewer: C. Scott Ananian Gerrit-Reviewer: Sbailey Gerrit-Reviewer: Subramanya Sastry 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]: Revert "mariadb: Depool es2011 for reimage"
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406132 ) Change subject: Revert "mariadb: Depool es2011 for reimage" .. Revert "mariadb: Depool es2011 for reimage" This reverts commit b425c808e6adca3b8aedac4a2216b51b91ff4955. Change-Id: I2b0e827dcd02b984057bb4657005c5a3bfe5dff1 --- M wmf-config/db-codfw.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Jcrespo: Looks good to me, approved diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php index 037ad9c..2887712 100644 --- a/wmf-config/db-codfw.php +++ b/wmf-config/db-codfw.php @@ -14,7 +14,7 @@ ]; $wmgOldExtTemplate = [ - # '10.192.16.171' => 1, # es2011, B1 11TB 128GB, being reimaged + '10.192.16.171' => 1, # es2011, B1 11TB 128GB '10.192.32.129' => 1, # es2012, C1 11TB 128GB '10.192.48.40' => 1, # es2013, D1 11TB 128GB ]; -- To view, visit https://gerrit.wikimedia.org/r/406132 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2b0e827dcd02b984057bb4657005c5a3bfe5dff1 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Jcrespo Gerrit-Reviewer: Jcrespo Gerrit-Reviewer: Marostegui Gerrit-Reviewer: Urbanecm Gerrit-Reviewer: Zoranzoki21 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...MultimediaViewer[master]: Unify SVG markup
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/388833 ) Change subject: Unify SVG markup .. Unify SVG markup Align SVG markup across Foundation products by: - unifying XML declaration, - removing unnecessary `standalone="no"` attribute as it's default, - removing unnecessary `enable-background` attribute as it got removed from standard - removing all SVG editor metadata - adding `width` and `height` attributes where missing, - removing all `g` group elements except where necessary for transforms, - putting attributes on `path`, - removing unnecessary ids and - unifying whitespace. Also - changing 'expand' and 'gear' icon colors to resemble general button style, - while at this renaming 'gear_gray' to 'gear' including CSS reference, - slightly adapt remaining colors to WikimediaUI color palette and - deleting unused, unreferenced icon files. Saving up to 79% file size before gzipping. Bug: T178867 Change-Id: I9e54a3a972903811f5205def05397383f3484d63 --- M resources/mmv/img/down.svg M resources/mmv/img/expand.svg A resources/mmv/img/gear.svg D resources/mmv/img/gear_gray.svg M resources/mmv/img/x_gray.svg M resources/mmv/mmv.bootstrap.less D resources/mmv/ui/img/angle-separator.svg D resources/mmv/ui/img/assessments.svg M resources/mmv/ui/img/cc.svg D resources/mmv/ui/img/commons.svg D resources/mmv/ui/img/commons_gray.svg M resources/mmv/ui/img/commons_white.svg M resources/mmv/ui/img/ellipsis_darkgray.svg M resources/mmv/ui/img/ellipsis_gray.svg M resources/mmv/ui/img/ellipsis_lightgray.svg M resources/mmv/ui/img/error-media-icon.svg M resources/mmv/ui/img/file.svg M resources/mmv/ui/img/gear.svg M resources/mmv/ui/img/grayscale.svg D resources/mmv/ui/img/horn_grey.svg M resources/mmv/ui/img/icon_mmv.svg M resources/mmv/ui/img/icon_page.svg M resources/mmv/ui/img/license.svg M resources/mmv/ui/img/link-hover.svg M resources/mmv/ui/img/link.svg M resources/mmv/ui/img/location.svg M resources/mmv/ui/img/mw-close.svg M resources/mmv/ui/img/mw-defullscreen-ltr.svg M resources/mmv/ui/img/mw-defullscreen-rtl.svg D resources/mmv/ui/img/mw-dezoom-ltr.svg D resources/mmv/ui/img/mw-dezoom-rtl.svg M resources/mmv/ui/img/mw-download.svg M resources/mmv/ui/img/mw-fullscreen-ltr.svg M resources/mmv/ui/img/mw-fullscreen-rtl.svg D resources/mmv/ui/img/mw-open-control-ltr.svg D resources/mmv/ui/img/mw-open-control-rtl.svg D resources/mmv/ui/img/mw-zoom-ltr.svg D resources/mmv/ui/img/mw-zoom-rtl.svg M resources/mmv/ui/img/next-ltr.svg M resources/mmv/ui/img/next-rtl.svg M resources/mmv/ui/img/open.svg M resources/mmv/ui/img/page.svg M resources/mmv/ui/img/pasting-hover.svg M resources/mmv/ui/img/pasting.svg M resources/mmv/ui/img/pd.svg M resources/mmv/ui/img/prev-ltr.svg M resources/mmv/ui/img/prev-rtl.svg D resources/mmv/ui/img/repo.svg M resources/mmv/ui/img/restrict-2257.svg M resources/mmv/ui/img/restrict-aus-reserve.svg M resources/mmv/ui/img/restrict-communist.svg M resources/mmv/ui/img/restrict-costume.svg M resources/mmv/ui/img/restrict-currency.svg M resources/mmv/ui/img/restrict-default.svg M resources/mmv/ui/img/restrict-design.svg M resources/mmv/ui/img/restrict-fan-art.svg M resources/mmv/ui/img/restrict-ihl.svg M resources/mmv/ui/img/restrict-insignia.svg M resources/mmv/ui/img/restrict-ita-mibac.svg M resources/mmv/ui/img/restrict-nazi.svg M resources/mmv/ui/img/restrict-personality.svg M resources/mmv/ui/img/time.svg M resources/mmv/ui/img/use-ltr.svg M resources/mmv/ui/img/use-rtl.svg M resources/mmv/ui/img/user-ltr.svg M resources/mmv/ui/img/user-rtl.svg M resources/mmv/ui/img/x_darkgreen.svg M resources/mmv/ui/img/x_gray.svg M viewer-ltr.svg M viewer-rtl.svg 70 files changed, 284 insertions(+), 2,371 deletions(-) Approvals: Prtksxna: Looks good to me, approved jenkins-bot: Verified -- To view, visit https://gerrit.wikimedia.org/r/388833 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e54a3a972903811f5205def05397383f3484d63 Gerrit-PatchSet: 11 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: master Gerrit-Owner: VolkerE Gerrit-Reviewer: Esanders Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Prtksxna 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] mediawiki...Flow[master]: OptInController catch both errors and exception
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406051 ) Change subject: OptInController catch both errors and exception .. OptInController catch both errors and exception The problem that is currently causing the opt-out to fail is not an Exception but an Error. Catching Throwable to make sure we revert the transations in all cases. Bug: T184670 Change-Id: Id0f4271d635094bf99f2fc8fa9cbbc4b08f07b46 --- M includes/Import/OptInController.php 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Import/OptInController.php b/includes/Import/OptInController.php index 49d9e84..c79f58d 100644 --- a/includes/Import/OptInController.php +++ b/includes/Import/OptInController.php @@ -6,7 +6,6 @@ use DateTimeZone; use DeferredUpdates; use DerivativeContext; -use Exception; use Flow\DbFactory; use Flow\Collection\HeaderCollection; use Flow\Content\BoardContent; @@ -124,18 +123,19 @@ } else { $logger->error( $outerMethod . ': unrecognized action: ' . $action ); } - } catch ( Exception $e ) { + } catch ( \Throwable $t ) { $logger->error( - $outerMethod . ' failed to {action} Flow on \'{talkpage}\' for user \'{user}\'. Exception: {exception}', + $outerMethod . ' failed to {action} Flow on \'{talkpage}\' for user \'{user}\'. {message} {trace}', [ 'action' => $action, 'talkpage' => $talkpage, 'user' => $user, - 'exception' => $e, + 'message' => $t->getMessage(), + 'trace' => $t->getTraceAsString(), ] ); // rollback both Flow and Core DBs - MWExceptionHandler::rollbackMasterChangesAndLog( $e ); + MWExceptionHandler::rollbackMasterChangesAndLog( $t ); $this->dbFactory->getDB( DB_MASTER )->rollback( $outerMethod ); } }, -- To view, visit https://gerrit.wikimedia.org/r/406051 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id0f4271d635094bf99f2fc8fa9cbbc4b08f07b46 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Sbisson Gerrit-Reviewer: Catrope 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]: Error if wiktionary creation attempted without using aawikti...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/391271 ) Change subject: Error if wiktionary creation attempted without using aawiktionary .. Error if wiktionary creation attempted without using aawiktionary Bug: T179863 Change-Id: I0e0f284f47c3baec01f52c02b710e1311cfbf28e --- M addWiki.php 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/addWiki.php b/addWiki.php index be26cbc..b5ac0a5 100644 --- a/addWiki.php +++ b/addWiki.php @@ -67,6 +67,13 @@ $domain = $this->getArg( 3 ); $languageNames = Language::fetchLanguageNames(); + if ( $siteGroup === 'wiktionary' && strpos( 'wiktionary', $this->getOption( 'wiki' ) ) === false ) { + $this->error( + 'Wiktionaries must be created using --wiki aawiktionary due to the need to load Cognate classes.', + true + ); + } + if ( !isset( $languageNames[$lang] ) ) { $this->fatalError( "Language $lang not found in Names.php" ); } -- To view, visit https://gerrit.wikimedia.org/r/391271 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e0f284f47c3baec01f52c02b710e1311cfbf28e Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/WikimediaMaintenance Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Reedy Gerrit-Reviewer: Thiemo Kreuz (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Load preferences js/css in mobile
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406125 ) Change subject: Load preferences js/css in mobile .. Load preferences js/css in mobile Change-Id: Idbf62486c787179ee67deb22e4644f4fc742d9db --- M resources/Resources.php 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/Resources.php b/resources/Resources.php index b494429..4405fe0 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -2112,6 +2112,7 @@ 'styles' => 'resources/src/mediawiki.special/mediawiki.special.pagesWithProp.css', ], 'mediawiki.special.preferences' => [ + 'targets' => [ 'desktop', 'mobile' ], 'scripts' => [ 'resources/src/mediawiki.special/mediawiki.special.preferences.confirmClose.js', 'resources/src/mediawiki.special/mediawiki.special.preferences.convertmessagebox.js', @@ -2132,6 +2133,7 @@ ], ], 'mediawiki.special.preferences.styles' => [ + 'targets' => [ 'desktop', 'mobile' ], 'styles' => 'resources/src/mediawiki.special/mediawiki.special.preferences.styles.css', ], 'mediawiki.special.recentchanges' => [ -- To view, visit https://gerrit.wikimedia.org/r/406125 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idbf62486c787179ee67deb22e4644f4fc742d9db Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Jdlrobson 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] mediawiki/core[master]: Use RevisionLookup and RevisionFactory interfaces in Revision
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/403117 ) Change subject: Use RevisionLookup and RevisionFactory interfaces in Revision .. Use RevisionLookup and RevisionFactory interfaces in Revision Lets not depend on the big blob that is RevisionStore. Try to bind to the nice interfaces that we have where possible. In the future RevisionStore should be split up further into it's individual interfaces. It looks like there are some more methods which should be moved to both RevisionLookup and RevisionFactory. See draft: I214c5952d4a0fad55ff4116e90eab9ac3ba54fd3 Change-Id: I8df61374e24abcf4a7e38e53647489b8ecc1fd77 --- M includes/MediaWikiServices.php M includes/Revision.php M includes/ServiceWiring.php M tests/phpunit/includes/MediaWikiServicesTest.php 4 files changed, 55 insertions(+), 11 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index 00767c7..c283793 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -15,6 +15,8 @@ use MediaWiki\Shell\CommandFactory; use MediaWiki\Storage\BlobStore; use MediaWiki\Storage\BlobStoreFactory; +use MediaWiki\Storage\RevisionFactory; +use MediaWiki\Storage\RevisionLookup; use MediaWiki\Storage\RevisionStore; use Wikimedia\Rdbms\LBFactory; use LinkCache; @@ -729,6 +731,22 @@ /** * @since 1.31 +* @return RevisionLookup +*/ + public function getRevisionLookup() { + return $this->getService( 'RevisionLookup' ); + } + + /** +* @since 1.31 +* @return RevisionFactory +*/ + public function getRevisionFactory() { + return $this->getService( 'RevisionFactory' ); + } + + /** +* @since 1.31 * @return PreferencesFactory */ public function getPreferencesFactory() { diff --git a/includes/Revision.php b/includes/Revision.php index 510c1ee..d5449b4 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -22,6 +22,8 @@ use MediaWiki\Storage\MutableRevisionRecord; use MediaWiki\Storage\RevisionAccessException; +use MediaWiki\Storage\RevisionFactory; +use MediaWiki\Storage\RevisionLookup; use MediaWiki\Storage\RevisionRecord; use MediaWiki\Storage\RevisionStore; use MediaWiki\Storage\RevisionStoreRecord; @@ -65,6 +67,20 @@ } /** +* @return RevisionLookup +*/ + protected static function getRevisionLookup() { + return MediaWikiServices::getInstance()->getRevisionLookup(); + } + + /** +* @return RevisionFactory +*/ + protected static function getRevisionFactory() { + return MediaWikiServices::getInstance()->getRevisionFactory(); + } + + /** * @param bool|string $wiki The ID of the target wiki database. Use false for the local wiki. * * @return SqlBlobStore @@ -97,7 +113,7 @@ * @return Revision|null */ public static function newFromId( $id, $flags = 0 ) { - $rec = self::getRevisionStore()->getRevisionById( $id, $flags ); + $rec = self::getRevisionLookup()->getRevisionById( $id, $flags ); return $rec === null ? null : new Revision( $rec, $flags ); } @@ -116,7 +132,7 @@ * @return Revision|null */ public static function newFromTitle( LinkTarget $linkTarget, $id = 0, $flags = 0 ) { - $rec = self::getRevisionStore()->getRevisionByTitle( $linkTarget, $id, $flags ); + $rec = self::getRevisionLookup()->getRevisionByTitle( $linkTarget, $id, $flags ); return $rec === null ? null : new Revision( $rec, $flags ); } @@ -135,7 +151,7 @@ * @return Revision|null */ public static function newFromPageId( $pageId, $revId = 0, $flags = 0 ) { - $rec = self::getRevisionStore()->getRevisionByPageId( $pageId, $revId, $flags ); + $rec = self::getRevisionLookup()->getRevisionByPageId( $pageId, $revId, $flags ); return $rec === null ? null : new Revision( $rec, $flags ); } @@ -184,7 +200,7 @@ } } - $rec = self::getRevisionStore()->newRevisionFromArchiveRow( $row, 0, $title, $overrides ); + $rec = self::getRevisionFactory()->newRevisionFromArchiveRow( $row, 0, $title, $overrides ); return new Revision( $rec, self::READ_NORMAL, $title ); } @@ -202,9 +218,9 @@ */ public static function newFromRow( $row ) { if ( is_array( $row ) ) { - $rec = self::getRevisionStore()->newMutableRevisionFromArray( $row ); + $rec = self::getRevision
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Extra tests for SqlBlobStore with 'windows-1252' legacy enco...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/403754 ) Change subject: Extra tests for SqlBlobStore with 'windows-1252' legacy encoding .. Extra tests for SqlBlobStore with 'windows-1252' legacy encoding Bug: T184749 Change-Id: Ida717dbe6ae742b3b61f0f09dc60712307c53a96 --- M tests/phpunit/includes/Storage/SqlBlobStoreTest.php 1 file changed, 35 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/includes/Storage/SqlBlobStoreTest.php b/tests/phpunit/includes/Storage/SqlBlobStoreTest.php index 6d2b09b..dbbef11 100644 --- a/tests/phpunit/includes/Storage/SqlBlobStoreTest.php +++ b/tests/phpunit/includes/Storage/SqlBlobStoreTest.php @@ -134,6 +134,18 @@ [ 'gzip', 'object' ], '2®Àþ2', ]; + yield 'T184749 (windows-1252 encoding), string in string out' => [ + 'windows-1252', + iconv( 'utf-8', 'windows-1252', "sammansättningar" ), + [], + 'sammansättningar', + ]; + yield 'T184749 (windows-1252 encoding), string in string out with gzip' => [ + 'windows-1252', + gzdeflate( iconv( 'utf-8', 'windows-1252', "sammansättningar" ) ), + [ 'gzip' ], + 'sammansättningar', + ]; } /** @@ -190,6 +202,7 @@ public function provideBlobs() { yield [ '' ]; yield [ 'someText' ]; + yield [ "sammansättningar" ]; } /** @@ -203,4 +216,26 @@ $this->assertSame( $blob, $store->getBlob( $address ) ); } + /** +* @dataProvider provideBlobs +* @covers \MediaWiki\Storage\SqlBlobStore::storeBlob +* @covers \MediaWiki\Storage\SqlBlobStore::getBlob +*/ + public function testSimpleStoreGetBlobSimpleRoundtripWindowsLegacyEncoding( $blob ) { + $store = $this->getBlobStore( 'windows-1252' ); + $address = $store->storeBlob( $blob ); + $this->assertSame( $blob, $store->getBlob( $address ) ); + } + + /** +* @dataProvider provideBlobs +* @covers \MediaWiki\Storage\SqlBlobStore::storeBlob +* @covers \MediaWiki\Storage\SqlBlobStore::getBlob +*/ + public function testSimpleStoreGetBlobSimpleRoundtripWindowsLegacyEncodingGzip( $blob ) { + $store = $this->getBlobStore( 'windows-1252', true ); + $address = $store->storeBlob( $blob ); + $this->assertSame( $blob, $store->getBlob( $address ) ); + } + } -- To view, visit https://gerrit.wikimedia.org/r/403754 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida717dbe6ae742b3b61f0f09dc60712307c53a96 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: Daniel Kinzler Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Reedy 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...LoginNotify[master]: Add @covers tag
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406116 ) Change subject: Add @covers tag .. Add @covers tag Change-Id: Ifb241ba3f2ec6c25eee812b5c36cc354e3164765 --- M tests/phpunit/LoginNotifyTests.php 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Yurik: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/LoginNotifyTests.php b/tests/phpunit/LoginNotifyTests.php index 9261a46..643fd95 100644 --- a/tests/phpunit/LoginNotifyTests.php +++ b/tests/phpunit/LoginNotifyTests.php @@ -5,6 +5,9 @@ use Wikimedia\TestingAccessWrapper; // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong +/** + * @covers \LoginNotify\LoginNotify + */ class LoginNotifyTests extends MediaWikiTestCase { private $inst; -- To view, visit https://gerrit.wikimedia.org/r/406116 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifb241ba3f2ec6c25eee812b5c36cc354e3164765 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LoginNotify Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: Yurik Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Add @covers tags
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406115 ) Change subject: Add @covers tags .. Add @covers tags Change-Id: I0633c93c9b9c9d048ad318e1c3ccaddf812d605e --- M tests/phpunit/ApiSanitizeMapDataTest.php M tests/phpunit/CoordFormatterTest.php M tests/phpunit/SimpleStyleParserTest.php M tests/phpunit/SpecialMapTest.php M tests/phpunit/ValidationTest.php 5 files changed, 5 insertions(+), 0 deletions(-) Approvals: Yurik: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/ApiSanitizeMapDataTest.php b/tests/phpunit/ApiSanitizeMapDataTest.php index cfafe99..d2a43c3 100644 --- a/tests/phpunit/ApiSanitizeMapDataTest.php +++ b/tests/phpunit/ApiSanitizeMapDataTest.php @@ -10,6 +10,7 @@ use UsageException; /** + * @covers \Kartographer\ApiSanitizeMapData * @group Kartographer */ class ApiSanitizeMapDataTest extends MediaWikiTestCase { diff --git a/tests/phpunit/CoordFormatterTest.php b/tests/phpunit/CoordFormatterTest.php index d7e52b0..8c2a530 100644 --- a/tests/phpunit/CoordFormatterTest.php +++ b/tests/phpunit/CoordFormatterTest.php @@ -7,6 +7,7 @@ use MediaWikiTestCase; /** + * @covers \Kartographer\CoordFormatter * @group Kartographer */ class CoordFormatterTest extends MediaWikiTestCase { diff --git a/tests/phpunit/SimpleStyleParserTest.php b/tests/phpunit/SimpleStyleParserTest.php index e46fbcb..0ff1788 100644 --- a/tests/phpunit/SimpleStyleParserTest.php +++ b/tests/phpunit/SimpleStyleParserTest.php @@ -9,6 +9,7 @@ use Title; /** + * @covers \Kartographer\SimpleStyleParser * @group Kartographer */ class SimpleStyleParserTest extends MediaWikiTestCase { diff --git a/tests/phpunit/SpecialMapTest.php b/tests/phpunit/SpecialMapTest.php index 4f2c79a..f1a067c 100644 --- a/tests/phpunit/SpecialMapTest.php +++ b/tests/phpunit/SpecialMapTest.php @@ -8,6 +8,7 @@ use Title; /** + * @covers \Kartographer\SpecialMap * @group Kartographer */ class SpecialMapTest extends MediaWikiTestCase { diff --git a/tests/phpunit/ValidationTest.php b/tests/phpunit/ValidationTest.php index 6153994..630de6c 100644 --- a/tests/phpunit/ValidationTest.php +++ b/tests/phpunit/ValidationTest.php @@ -10,6 +10,7 @@ use Title; /** + * @covers \Kartographer\SimpleStyleParser * @group Kartographer */ class ValidationTest extends MediaWikiTestCase { -- To view, visit https://gerrit.wikimedia.org/r/406115 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0633c93c9b9c9d048ad318e1c3ccaddf812d605e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: MaxSem Gerrit-Reviewer: Yurik Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Rearrange UsageDeduplicator implementation
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405896 ) Change subject: Rearrange UsageDeduplicator implementation .. Rearrange UsageDeduplicator implementation This is basically the exact same implementation, just moved around a bit. I found the way the code was previously arranged not that optimal. The code was spread out quite a lot. Significant changes are: * The actual deduplication intentionally replaces an array of usages with a single usage. This makes the later array_walk_recursive run faster because it does have less 1-element arrays to iterate. * The actual deduplication use &-references to manipulate the one array, instead of constantly constructing new ones. * Structuring is done in one step instead of two. $array[$foo][$bar][] works just fine here. * Note that labels and descriptions are not mentioned any more! The same deduplication logic is applied to all aspects, not only labels and descriptions. This might be a mistake, but no test fails. If you think this is a mistake, please add a test that demonstrates why. Bug: T178079 Change-Id: Ic8ec86088d49b5979a78e99d2cafce5f6c86f94d --- M client/includes/Usage/UsageDeduplicator.php 1 file changed, 39 insertions(+), 45 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/Usage/UsageDeduplicator.php b/client/includes/Usage/UsageDeduplicator.php index 8c7e4ce..8a5fe66 100644 --- a/client/includes/Usage/UsageDeduplicator.php +++ b/client/includes/Usage/UsageDeduplicator.php @@ -12,81 +12,75 @@ /** * @param EntityUsage[] $usages +* * @return EntityUsage[] */ public function deduplicate( array $usages ) { $structuredUsages = $this->structureUsages( $usages ); - - foreach ( $structuredUsages as $entityId => $usages ) { - $structuredUsages[$entityId] = $this->deduplicateUsagesPerEntity( $usages ); - } - - // Flatten the structured array - $return = []; - array_walk_recursive( - $structuredUsages, - function ( EntityUsage $usage ) use ( &$return ) { - $return[$usage->getIdentityString()] = $usage; - } - ); - return $return; + $structuredUsages = $this->deduplicateStructuredUsages( $structuredUsages ); + return $this->flattenStructuredUsages( $structuredUsages ); } /** * @param EntityUsage[] $usages -* @return array[] +* +* @return array[][] three-dimensional array of +* [ $entityId => [ $aspectKey => [ EntityUsage $usage, … ], … ], … ] */ private function structureUsages( array $usages ) { $structuredUsages = []; - foreach ( $usages as $usage ) { - $entityId = $usage->getEntityId(); - $structuredUsages[$entityId->getSerialization()][] = $usage; - } - return array_map( [ $this, 'structureUsagesPerEntity' ], $structuredUsages ); - } - - /** -* @param EntityUsage[] $usages -* @return array[] -*/ - private function structureUsagesPerEntity( array $usages ) { - $structuredUsages = [ - EntityUsage::DESCRIPTION_USAGE => [], - EntityUsage::LABEL_USAGE => [], - ]; foreach ( $usages as $usage ) { + $entityId = $usage->getEntityId()->getSerialization(); $aspect = $usage->getAspect(); - $structuredUsages[$aspect][] = $usage; + $structuredUsages[$entityId][$aspect][] = $usage; } return $structuredUsages; } /** -* @param array[] $usages +* @param array[][] $structuredUsages +* * @return array[] */ - private function deduplicateUsagesPerEntity( array $usages ) { - $usages[EntityUsage::DESCRIPTION_USAGE] = $this->deduplicatePerType( - $usages[EntityUsage::DESCRIPTION_USAGE] - ); - $usages[EntityUsage::LABEL_USAGE] = $this->deduplicatePerType( - $usages[EntityUsage::LABEL_USAGE] - ); - return $usages; + private function deduplicateStructuredUsages( array $structuredUsages ) { + foreach ( $structuredUsages as &$usagesPerEntity ) { + foreach ( $usagesPerEntity as &$usagesPerAspect ) { + $this->deduplicatePerAspect( $usagesPerAspect ); + } + } + +
[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Stop clearing tplInfo if don't find a table for fostered con...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406049 ) Change subject: Stop clearing tplInfo if don't find a table for fostered content .. Stop clearing tplInfo if don't find a table for fostered content Also, remove some commented out code that should have gone with dd4bda7 Fixes the following and others, http://localhost:8000/en.wikipedia.org/v3/page/html/Phulwari_(Vidhan_Sabha_constituency)/793701085 http://localhost:8000/en.wikipedia.org/v3/page/html/User%3ADylanrocks96%2Fsandbox/776441874 Bug: T185346 Change-Id: Ib3c635715ed8936e514e4e8f2f725ab345921f76 --- M lib/wt2html/pp/processors/linter.js 1 file changed, 5 insertions(+), 15 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/wt2html/pp/processors/linter.js b/lib/wt2html/pp/processors/linter.js index 7d093e4..55206a7 100644 --- a/lib/wt2html/pp/processors/linter.js +++ b/lib/wt2html/pp/processors/linter.js @@ -377,15 +377,19 @@ */ function logFosteredContent(env, node, dp, tplInfo) { var maybeTable = node.nextSibling; + var clear = false; + while (maybeTable && !DU.hasNodeName(maybeTable, 'table')) { if (tplInfo && maybeTable === tplInfo.last) { - tplInfo.clear = true; + clear = true; } maybeTable = maybeTable.nextSibling; } if (!maybeTable) { return null; + } else if (clear && tplInfo) { + tplInfo.clear = true; } // In pathological cases, we might walk past fostered nodes @@ -832,21 +836,7 @@ function logWikitextFixups(node, env, tplInfo) { var dp = DU.getDataParsoid(node); - /* -* Turn this off since this is wasted processing -* that is not really actionable at this time. -* - if (tplInfo && tplInfo.first === node) { - // Log transclusions with more than one part - logTransclusions(env, node, dp, tplInfo); - } - */ - logTreeBuilderFixup(env, node, dp, tplInfo); - // Turning this off for now since - // (a) this needs fixing (b) not exposed in linter extension output yet - // (c) this is source of error logspam in kibana - // logIgnoredTableAttr(env, node, dp, tplInfo); logDeletableTables(env, node, dp, tplInfo); // For T161341 logBadPWrapping(env, node, dp, tplInfo);// For T161306 logObsoleteHTMLTags(env, node, dp, tplInfo); -- To view, visit https://gerrit.wikimedia.org/r/406049 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib3c635715ed8936e514e4e8f2f725ab345921f76 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra Gerrit-Reviewer: C. Scott Ananian Gerrit-Reviewer: Sbailey Gerrit-Reviewer: Subramanya Sastry 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...Gadgets[master]: Fix PHPDocs of GadgetDefinitionContent::getDeletionUpdates
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406031 ) Change subject: Fix PHPDocs of GadgetDefinitionContent::getDeletionUpdates .. Fix PHPDocs of GadgetDefinitionContent::getDeletionUpdates DataUpdate is a specific implementation (currently the only one), while DeferrableUpdate is the interface. Binding against the interface is enough, and what the base classes already do. I'm also removing a line of meaningless documentation. "Creates an instance of this class" is a general description that is true for all constructors. Change-Id: Ia6dc86b078628db5e0ab68ef46bf0396567b767c --- M includes/GadgetResourceLoaderModule.php M includes/content/GadgetDefinitionContent.php 2 files changed, 1 insertion(+), 3 deletions(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/GadgetResourceLoaderModule.php b/includes/GadgetResourceLoaderModule.php index e1b2602..13d16cd 100644 --- a/includes/GadgetResourceLoaderModule.php +++ b/includes/GadgetResourceLoaderModule.php @@ -16,8 +16,6 @@ private $gadget; /** -* Creates an instance of this class -* * @param array $options */ public function __construct( array $options ) { diff --git a/includes/content/GadgetDefinitionContent.php b/includes/content/GadgetDefinitionContent.php index b5aa7cf..cede38d 100644 --- a/includes/content/GadgetDefinitionContent.php +++ b/includes/content/GadgetDefinitionContent.php @@ -97,7 +97,7 @@ /** * @param WikiPage $page * @param ParserOutput $parserOutput -* @return DataUpdate[] +* @return DeferrableUpdate[] */ public function getDeletionUpdates( WikiPage $page, ParserOutput $parserOutput = null ) { return array_merge( -- To view, visit https://gerrit.wikimedia.org/r/406031 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia6dc86b078628db5e0ab68ef46bf0396567b767c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Gadgets Gerrit-Branch: master Gerrit-Owner: Thiemo Kreuz (WMDE) Gerrit-Reviewer: Legoktm 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] wikidata...rdf[master]: Add timeout to Wikibase requests
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405825 ) Change subject: Add timeout to Wikibase requests .. Add timeout to Wikibase requests Bug: T179239 Change-Id: Ib027a457a10a268ed365b11390cf03308bcb7b84 --- M tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java 1 file changed, 26 insertions(+), 1 deletion(-) Approvals: Smalyshev: Looks good to me, approved jenkins-bot: Verified Gehel: Looks good to me, but someone else must approve diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java b/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java index b7d3e16..ae1a703 100644 --- a/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java +++ b/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java @@ -30,6 +30,7 @@ import org.apache.http.NameValuePair; import org.apache.http.client.HttpRequestRetryHandler; import org.apache.http.client.ServiceUnavailableRetryStrategy; +import org.apache.http.client.config.RequestConfig; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; @@ -79,6 +80,14 @@ private static final Logger log = LoggerFactory.getLogger(WikibaseRepository.class); /** + * Timeout for communications to Wikidata, in ms. + */ +private static final String TIMEOUT_MILLIS = "5000"; +/** + * Request timeout property. + */ +public static final String TIMEOUT_PROPERTY = WikibaseRepository.class + ".timeout"; +/** * How many retries allowed on error. */ private static final int RETRIES = 3; @@ -104,6 +113,19 @@ .setUserAgent("Wikidata Query Service Updater") .build(); +/** + * Configured timeout for requests. + */ +private final int requestTimeout = Integer +.parseInt(System.getProperty(TIMEOUT_PROPERTY, TIMEOUT_MILLIS)); + +/** + * Request configuration including timeout. + */ +private final RequestConfig configWithTimeout = RequestConfig.custom() +.setSocketTimeout(requestTimeout) +.setConnectTimeout(requestTimeout) +.setConnectionRequestTimeout(requestTimeout).build(); /** * Builds uris to get stuff from wikibase. */ @@ -236,8 +258,10 @@ throws RetryableException { URI uri = uris.recentChanges(nextStartTime, lastContinue, batchSize); log.debug("Polling for changes from {}", uri); +HttpGet request = new HttpGet(uri); +request.setConfig(configWithTimeout); try { -return checkApi(getJson(new HttpGet(uri), RecentChangeResponse.class)); +return checkApi(getJson(request, RecentChangeResponse.class)); } catch (UnknownHostException | SocketException e) { // We want to bail on this, since it happens to be sticky for some reason throw new RuntimeException(e); @@ -264,6 +288,7 @@ StatementCollector collector = new StatementCollector(); parser.setRDFHandler(new NormalizingRdfHandler(collector)); HttpGet request = new HttpGet(uri); +request.setConfig(configWithTimeout); try { try (CloseableHttpResponse response = client.execute(request)) { if (response.getStatusLine().getStatusCode() == 404) { -- To view, visit https://gerrit.wikimedia.org/r/405825 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib027a457a10a268ed365b11390cf03308bcb7b84 Gerrit-PatchSet: 2 Gerrit-Project: wikidata/query/rdf Gerrit-Branch: master Gerrit-Owner: Smalyshev Gerrit-Reviewer: Gehel Gerrit-Reviewer: Smalyshev Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/config[master]: Move Internet Explorer tests in WebPageTest to own test files
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/404925 ) Change subject: Move Internet Explorer tests in WebPageTest to own test files .. Move Internet Explorer tests in WebPageTest to own test files By moving the tests, it will make it easier to deploy the Linux agent side by side with the current agent by only changing Jenkins configuration. Needs https://gerrit.wikimedia.org/r/#/c/404918/ Bug: T175240 Depends-On: I786ea6153a26364c9880b314826695094a022d71 Change-Id: I534c6f9fc3ce9c43131a5db928567848e0b8bd07 --- M jjb/misc.yaml 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Krinkle: Looks good to me, approved Hashar: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/jjb/misc.yaml b/jjb/misc.yaml index ed5bfa1..6fe8082 100644 --- a/jjb/misc.yaml +++ b/jjb/misc.yaml @@ -330,6 +330,8 @@ RESULT+=$? ./bin/index.js --batch ./scripts/batch/desktop.txt RESULT+=$? +./bin/index.js --batch ./scripts/batch/desktop-ie.txt +RESULT+=$? ./bin/index.js --batch ./scripts/batch/login-mobile.txt RESULT+=$? ./bin/index.js --batch ./scripts/batch/login-desktop.txt @@ -338,6 +340,8 @@ RESULT+=$? ./bin/index.js --batch ./scripts/batch/second-view-desktop.txt RESULT+=$? +./bin/index.js --batch ./scripts/batch/second-view-desktop-ie.txt +RESULT+=$? exit $RESULT publishers: - webpagetest-irc -- To view, visit https://gerrit.wikimedia.org/r/404925 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I534c6f9fc3ce9c43131a5db928567848e0b8bd07 Gerrit-PatchSet: 4 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Phedenskog Gerrit-Reviewer: Gilles Gerrit-Reviewer: Hashar Gerrit-Reviewer: Imarlier Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Paladox Gerrit-Reviewer: Phedenskog 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]: Move Internet Explorer tests to own test files.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/404918 ) Change subject: Move Internet Explorer tests to own test files. .. Move Internet Explorer tests to own test files. By moving all IE tests to separate files, we can setup the new runs by only adding a extra job in Jenkins for the Linux agent. Bug: T175240 Change-Id: I786ea6153a26364c9880b314826695094a022d71 --- A scripts/batch/desktop-ie.txt M scripts/batch/desktop.txt A scripts/batch/second-view-desktop-ie.txt M scripts/batch/second-view-desktop.txt M test/rulethemall.sh 5 files changed, 46 insertions(+), 13 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/batch/desktop-ie.txt b/scripts/batch/desktop-ie.txt new file mode 100644 index 000..2449fed --- /dev/null +++ b/scripts/batch/desktop-ie.txt @@ -0,0 +1,29 @@ +## This batch file contains runs testing Wikipedia desktop using WebPageTest +## for Internet Explorer 11. The IE tests is in it own file to make it +## easy to move to Linux test agents. + +# To run this you need to set the following environment variables: +# WMF_WPT_KEY - The secret API key for our WebPageTest instance +# STATSV_ENDPOINT - The endpoint of where we send the statsv data +# WPT_RUNS - The number of runs per test +# WMF_WPT_LOCATION - The AWS location to run the test example: us-west-1 + +# Example (make sure to change WMF_WPT_KEY) +# $ 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 + +--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.enwiki.anonymous.Facebook --reporter statsv --first true https://en.wikipedia.org/wiki/Facebook + +--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.enwiki.anonymous.Barack_Obama --reporter statsv --first true https://en.wikipedia.org/wiki/Barack_Obama + +# Test the portal page +--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11-portals --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.portals.anonymous.wikipedia_org --reporter statsv --first true https://www.wikipedia.org/ + +--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11-portals-beta --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.portals-beta.anonymous.wikipedia_org --reporter statsv --first true https://www.wikipedia.beta.wmflabs.org/ + +### WIKIDATA + +--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.wikidatawiki.anonymous.Main_Page --reporter statsv --first true https://www.wikidata.org/wiki/Wikidata:Main_Page + +--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11 --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace webpagetest.wikidatawiki.anonymous.Berlin --first true https://www.wikidata.org/wiki/Q64 + +--webPageTestKey <%WMF_WPT_KEY> --webPageTestHost wpt.wmftest.org --median SpeedIndex --location <%WMF_WPT_LOCATION>_IE11 --label ie11-beta --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --reporter statsv --namespace webpagetest.wikidatawiki-beta.anonymous.Italy --first true https://wikidata.beta.wmflabs.org/wiki/Q15905 diff --git a/scripts/batch/desktop.txt b/scripts/batch/desktop.txt index 51fa048..2151e69 100644 --- a/scripts/batch/desktop.txt +++ b/scripts/batch/desktop.txt @@ -1,4 +1,5 @@ ## This batch file contains runs testing Wikipedia desktop using WebPageTest +## for Chrome and Firefox. # To run this you need to set the following environment variables: # WMF_WPT_KEY - The secret API key for our WebPageTest instance @@ -12,14 +13,10 @@ # Test Facebook page --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>_IE11 --label ie11 --runs <%WPT_RUNS> --endpoint <%STATSV_ENDPOINT> --namespace webpagetest.enwiki.anonymous.Facebook --reporter statsv
[MediaWiki-commits] [Gerrit] integration/docroot[master]: cover: Convert coverage sub-nav from breadcrumbs to nav-tabs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405995 ) Change subject: cover: Convert coverage sub-nav from breadcrumbs to nav-tabs .. cover: Convert coverage sub-nav from breadcrumbs to nav-tabs Breadcrumbs are mainly intended as a way to go from a subpage back to an ancestor. Not as a way of going to a subpage. Given the similarity, it looks somewhat confusing to see the breadcrumbs visually end with 'MediaWiki extensions' when the user isn't actually on that page. Nav-tabs seems like a more appropiate fit within the building blocks that Bootstrap provides. Change-Id: Ic7b0cf9d76ed79f12074adf07d054e1fd2456746 --- M shared/CoveragePage.php 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Krinkle: Looks good to me, approved Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/shared/CoveragePage.php b/shared/CoveragePage.php index 5314f43..81583ec 100644 --- a/shared/CoveragePage.php +++ b/shared/CoveragePage.php @@ -52,18 +52,18 @@ if ( $this->pageName === 'Test coverage' ) { $href = $this->fixNavUrl( '/cover-extensions/' ); $breadcrumbs = << - Coverage home + + Coverage home MediaWiki extensions - + HTML; } else { $href = $this->fixNavUrl( '/cover/' ); $breadcrumbs = << + Coverage home - MediaWiki extensions - + MediaWiki extensions + HTML; } $this->addHtmlContent( $breadcrumbs ); -- To view, visit https://gerrit.wikimedia.org/r/405995 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic7b0cf9d76ed79f12074adf07d054e1fd2456746 Gerrit-PatchSet: 3 Gerrit-Project: integration/docroot Gerrit-Branch: master Gerrit-Owner: Krinkle Gerrit-Reviewer: Hashar Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: mariadb: Depool es2011 for reimage
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406060 ) Change subject: mariadb: Depool es2011 for reimage .. mariadb: Depool es2011 for reimage We are going to test es2011 as the first ES storage with stretch/ MariaDB 10.1. As they are very large servers, we will reimage them without removing its data. Change-Id: I8849063daa383cd1f90762f8b35acccb44d80f1f --- M wmf-config/db-codfw.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Jcrespo: Looks good to me, approved diff --git a/wmf-config/db-codfw.php b/wmf-config/db-codfw.php index 2887712..037ad9c 100644 --- a/wmf-config/db-codfw.php +++ b/wmf-config/db-codfw.php @@ -14,7 +14,7 @@ ]; $wmgOldExtTemplate = [ - '10.192.16.171' => 1, # es2011, B1 11TB 128GB + # '10.192.16.171' => 1, # es2011, B1 11TB 128GB, being reimaged '10.192.32.129' => 1, # es2012, C1 11TB 128GB '10.192.48.40' => 1, # es2013, D1 11TB 128GB ]; -- To view, visit https://gerrit.wikimedia.org/r/406060 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8849063daa383cd1f90762f8b35acccb44d80f1f Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Jcrespo Gerrit-Reviewer: Jcrespo Gerrit-Reviewer: Urbanecm Gerrit-Reviewer: Zoranzoki21 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]: Simplify documentation headers of includes/widgets/…Widget.p...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/400584 ) Change subject: Simplify documentation headers of includes/widgets/…Widget.php files .. Simplify documentation headers of includes/widgets/…Widget.php files Most notably: The documentation header repeats the file name. This appears to be fully automatically generated, but does not add helpful information. Change-Id: I9edf15dd25ef6cc52fe931fffde69f0bd9042474 --- M includes/widget/ComplexNamespaceInputWidget.php M includes/widget/ComplexTitleInputWidget.php M includes/widget/DateInputWidget.php M includes/widget/DateTimeInputWidget.php M includes/widget/NamespaceInputWidget.php M includes/widget/SearchInputWidget.php M includes/widget/SelectWithInputWidget.php M includes/widget/TitleInputWidget.php M includes/widget/UserInputWidget.php M includes/widget/UsersMultiselectWidget.php 10 files changed, 41 insertions(+), 63 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/widget/ComplexNamespaceInputWidget.php b/includes/widget/ComplexNamespaceInputWidget.php index 69844d9..5f5d1cd 100644 --- a/includes/widget/ComplexNamespaceInputWidget.php +++ b/includes/widget/ComplexNamespaceInputWidget.php @@ -1,15 +1,13 @@ https://gerrit.wikimedia.org/r/400584 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9edf15dd25ef6cc52fe931fffde69f0bd9042474 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Thiemo Kreuz (WMDE) Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Thiemo Kreuz (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] CLDRPluralRuleParser[master]: tests: Update phpunit and enable coverage for all classes
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406055 ) Change subject: tests: Update phpunit and enable coverage for all classes .. tests: Update phpunit and enable coverage for all classes The structure of the Evaluator is that there is a single class that serves as the main entry point, and everything else is called internally, so at this point we might as well allow coverage of all classes from our current tests, which are essentially integration tests. This is normally achieved by disabling 'forceCoversAnnotation', but that is disabled by default and wasn't enabled. The reason the test coverage report was behaving this way was due to the presence of one @covers annotation, which I removed. Also: * Minor phpunit update. * Remove redundant variable assignment in test. * Add 'composer cover' command. * Add /coverage to gitignore. * Add visibility to tests. Change-Id: I9f671dbf5b575799570db307df3fa310fad7976f --- M .gitignore M composer.json M tests/EvaluatorTest.php 3 files changed, 12 insertions(+), 17 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/.gitignore b/.gitignore index de4a392..a37efea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +/coverage /vendor /composer.lock diff --git a/composer.json b/composer.json index f71a4b0..db5ce9f 100644 --- a/composer.json +++ b/composer.json @@ -24,11 +24,11 @@ } }, "require": { - "php": ">=5.3.3" + "php": ">=5.5.9" }, "require-dev": { "jakub-onderka/php-parallel-lint": "^0.9.0.0", - "phpunit/phpunit": "^4.7.7.0", + "phpunit/phpunit": "^4.8", "mediawiki/mediawiki-codesniffer": "15.0.0" }, "scripts": { @@ -37,6 +37,7 @@ "phpunit $PHPUNIT_ARGS", "phpcs -p" ], + "cover": "phpunit --coverage-html coverage/", "fix": [ "phpcbf" ] diff --git a/tests/EvaluatorTest.php b/tests/EvaluatorTest.php index cc44f37..3243d4d 100644 --- a/tests/EvaluatorTest.php +++ b/tests/EvaluatorTest.php @@ -8,28 +8,25 @@ use CLDRPluralRuleParser\Evaluator; -/** - * @covers \CLDRPluralRuleParser\Evaluator - */ class EvaluatorTest extends \PHPUnit_Framework_TestCase { /** -* @dataProvider validTestCases +* @dataProvider provideValidCases */ - function testValidRules( $expected, $rules, $number, $comment ) { + public function testValidRules( $expected, $rules, $number, $comment ) { $result = Evaluator::evaluate( $number, (array)$rules ); $this->assertEquals( $expected, $result, $comment ); } /** -* @dataProvider invalidTestCases +* @dataProvider provideInvalidCases * @expectedException CLDRPluralRuleParser\Error */ - function testInvalidRules( $rules, $comment ) { + public function testInvalidRules( $rules, $comment ) { Evaluator::evaluate( 1, (array)$rules ); } - function validTestCases() { - $tests = [ + public static function provideValidCases() { + return [ # expected, rule, number, comment [ 0, 'n is 1', 1, 'integer number and is' ], [ 0, 'n is 1', "1", 'string integer number and is' ], @@ -139,17 +136,13 @@ array( 1, 'v = 0 and i % 10 = 2..4 and i % 100 != 12..14 or f % 10 = 2..4 and f % 100 != 12..14', '10.0', 'bs other' ), // @codingStandardsIgnoreEnd ]; - - return $tests; } - function invalidTestCases() { - $tests = [ + public static function provideInvalidCases() { + return [ [ 'n mod mod 5 is 1', 'mod mod' ], [ 'n', 'just n' ], [ 'n is in 5', 'is in' ], ]; - - return $tests; } } -- To view, visit https://gerrit.wikimedia.org/r/406055 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9f671dbf5b575799570db307df3fa310fad7976f Gerrit-PatchSet: 1 Gerrit-Project: CLDRPluralRuleParser Gerrit-Branch: master Gerrit-Owner: Krinkle 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...GoogleDocTag[master]: Convert GoogleDocTag to use extension registration
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406016 ) Change subject: Convert GoogleDocTag to use extension registration .. Convert GoogleDocTag to use extension registration Bug: T185621 Change-Id: I00b6b8867fae24c736bfb302daf65841828dc13f --- M GoogleDocTag.php A extension.json 2 files changed, 36 insertions(+), 14 deletions(-) Approvals: Mainframe98: Looks good to me, but someone else must approve Sophivorus: Looks good to me, approved jenkins-bot: Verified diff --git a/GoogleDocTag.php b/GoogleDocTag.php index 3e5635f..68a88bf 100644 --- a/GoogleDocTag.php +++ b/GoogleDocTag.php @@ -1,16 +1,15 @@ __FILE__, - 'name' => 'GoogleDocTag', - 'descriptionmsg' => 'googledoctag-desc', - 'author' => array( 'Reddo', 'Luis Felipe Schenone' ), - 'version'=> '0.4.0', - 'url'=> 'http://www.mediawiki.org/wiki/Extension:GoogleDocTag', -); - -$wgMessagesDirs['GoogleDocTag'] = __DIR__ . '/i18n'; - -$wgAutoloadClasses['GoogleDocTag'] = __DIR__ . '/GoogleDocTag.body.php'; - -$wgHooks['ParserFirstCallInit'][] = 'GoogleDocTag::setParserHook'; +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'GoogleDocTag' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['GoogleDocTag'] = __DIR__ . '/i18n'; + wfWarn( + 'Deprecated PHP entry point used for the GoogleDocTag extension. ' . + 'Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); + return; +} else { + die( 'This version of the GoogleDocTag extension requires MediaWiki 1.29+' ); +} diff --git a/extension.json b/extension.json new file mode 100644 index 000..90fb327 --- /dev/null +++ b/extension.json @@ -0,0 +1,23 @@ +{ + "name": "GoogleDocTag", + "version": "0.5.0", + "author": [ + "Reddo", + "Luis Felipe Schenone" + ], + "url": "http://www.mediawiki.org/wiki/Extension:GoogleDocTag";, + "descriptionmsg": "googledoctag-desc", + "type": "parserhook", + "MessagesDirs": { + "GoogleDocTag": [ + "i18n" + ] + }, + "AutoloadClasses": { + "GoogleDocTag": "GoogleDocTag.body.php" + }, + "Hooks": { + "ParserFirstCallInit": "GoogleDocTag::setParserHook" + }, + "manifest_version": 2 +} -- To view, visit https://gerrit.wikimedia.org/r/406016 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I00b6b8867fae24c736bfb302daf65841828dc13f Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/GoogleDocTag Gerrit-Branch: master Gerrit-Owner: Jayprakash12345 <0freerunn...@gmail.com> Gerrit-Reviewer: Felipeschenone Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Jayprakash12345 <0freerunn...@gmail.com> Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Mainframe98 Gerrit-Reviewer: MarcoAurelio 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/core[master]: poolcounter: Fix type hint for PoolWorkArticleView::getParse...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406038 ) Change subject: poolcounter: Fix type hint for PoolWorkArticleView::getParserOutput .. poolcounter: Fix type hint for PoolWorkArticleView::getParserOutput Change-Id: Ib6a71e198481cf2a0230b3f8721c019ef3c7288c --- M includes/poolcounter/PoolWorkArticleView.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/poolcounter/PoolWorkArticleView.php b/includes/poolcounter/PoolWorkArticleView.php index 17b62d7..7b888ab 100644 --- a/includes/poolcounter/PoolWorkArticleView.php +++ b/includes/poolcounter/PoolWorkArticleView.php @@ -79,7 +79,7 @@ /** * Get the ParserOutput from this object, or false in case of failure * -* @return ParserOutput +* @return ParserOutput|bool */ public function getParserOutput() { return $this->parserOutput; -- To view, visit https://gerrit.wikimedia.org/r/406038 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6a71e198481cf2a0230b3f8721c019ef3c7288c Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Thiemo Kreuz (WMDE) Gerrit-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] mediawiki...Wikibase[master]: Move path array prepending logic to ClaimDifferenceVisualizer
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/403963 ) Change subject: Move path array prepending logic to ClaimDifferenceVisualizer .. Move path array prepending logic to ClaimDifferenceVisualizer With this patch I am making the prepended path a private implementation detail of the ClaimDifferenceVisualizer class, and remove it entirely from DifferencesSnakVisualizer where it was before. That solves all concerns I had with the original patch Ia4bebd8: * The $path is not passed so deeply into code that does not really need to know anything about it. * Many of the optional $path parameters are gone. I had multiple reason to do it this way and would like to explain them, if needed. One reason is that a method called "getPropertyHeader" should only do exactly that: return the substring that describes a property. Note this patch does not change anything that is needed for I50eb048. The code I am touching in this patch is not used outside of the Wikibase code base. Bug: T182424 Change-Id: I0408672f42b9822f0fe380d8f692b15a7d64f73d --- M repo/includes/Diff/ClaimDifferenceVisualizer.php M repo/includes/Diff/DifferencesSnakVisualizer.php M repo/tests/phpunit/includes/Diff/ClaimDifferenceVisualizerTest.php M repo/tests/phpunit/includes/Diff/DifferencesSnakVisualizerTest.php 4 files changed, 81 insertions(+), 93 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/repo/includes/Diff/ClaimDifferenceVisualizer.php b/repo/includes/Diff/ClaimDifferenceVisualizer.php index d75f9a6..1828309 100644 --- a/repo/includes/Diff/ClaimDifferenceVisualizer.php +++ b/repo/includes/Diff/ClaimDifferenceVisualizer.php @@ -55,6 +55,7 @@ Statement $baseStatement, array $path = [] ) { + $headerPrefix = $path ? implode( ' / ', $path ) . ' / ' : ''; $newestMainSnak = $baseStatement->getMainSnak(); $oldestMainSnak = $newestMainSnak; $html = ''; @@ -63,40 +64,40 @@ if ( $mainSnakChange !== null ) { $oldestMainSnak = $mainSnakChange->getOldValue() ?: $newestMainSnak; $html .= $this->visualizeMainSnakChange( + $headerPrefix, $mainSnakChange, $oldestMainSnak, - $newestMainSnak, - $path + $newestMainSnak ); } $rankChange = $claimDifference->getRankChange(); if ( $rankChange !== null ) { $html .= $this->visualizeRankChange( + $headerPrefix, $rankChange, $oldestMainSnak, - $newestMainSnak, - $path + $newestMainSnak ); } $qualifierChanges = $claimDifference->getQualifierChanges(); if ( $qualifierChanges !== null ) { $html .= $this->visualizeQualifierChanges( + $headerPrefix, $qualifierChanges, $oldestMainSnak, - $newestMainSnak, - $path + $newestMainSnak ); } $referenceChanges = $claimDifference->getReferenceChanges(); if ( $referenceChanges !== null ) { $html .= $this->visualizeReferenceChanges( + $headerPrefix, $referenceChanges, $oldestMainSnak, - $newestMainSnak, - $path + $newestMainSnak ); } @@ -132,22 +133,22 @@ } /** +* @param string $headerPrefix * @param DiffOpChange $mainSnakChange * @param Snak $oldestMainSnak The old main snak, if present; otherwise, the new main snak * @param Snak $newestMainSnak The new main snak, if present; otherwise, the old main snak -* @param string[] $path The path to prepend in the header * * @return string HTML */ private function visualizeMainSnakChange( + $headerPrefix, DiffOpChange $mainSnakChange, Snak $oldestMainSnak, - Snak $newestMainSnak, - array $path + Snak $newestMainSnak
[MediaWiki-commits] [Gerrit] integration/docroot[master]: cover: Add sort=cover parameter to coverage report
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405996 ) Change subject: cover: Add sort=cover parameter to coverage report .. cover: Add sort=cover parameter to coverage report When enabled, the sorting changes from alphabetical by name, to be ascending by coverage percentage. This helps identify projects with low code coverage, and as potential area to contribute. Change-Id: I4ff4bb7191ad8579427cf74fd865fe23b85b234d --- M .phpcs.xml M shared/CoveragePage.php 2 files changed, 33 insertions(+), 1 deletion(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/.phpcs.xml b/.phpcs.xml index 311ca42..44a6bd0 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -11,6 +11,7 @@ + . diff --git a/shared/CoveragePage.php b/shared/CoveragePage.php index 8bb60e5..5314f43 100644 --- a/shared/CoveragePage.php +++ b/shared/CoveragePage.php @@ -47,6 +47,8 @@ $results = glob( $this->coverageDir . '/*/clover.xml' ); $this->embedCSS( file_get_contents( __DIR__ . '/cover.css' ) ); + $sort = isset( $_GET['sort'] ) ? (string)$_GET['sort'] : null; + if ( $this->pageName === 'Test coverage' ) { $href = $this->fixNavUrl( '/cover-extensions/' ); $breadcrumbs = <addHtmlContent( $sortNav ); $this->addHtmlContent( '' ); $html = ''; + $clovers = []; foreach ( $results as $clover ) { - $info = $this->parseClover( $clover ); + $clovers[$clover] = $this->parseClover( $clover ); + } + if ( isset( $_GET['sort'] ) && $_GET['sort'] === 'cov' ) { + // Order by coverage, ascending + uasort( $clovers, function ( $a, $b ) { + if ( $a['percent'] === $b['percent'] ) { + return 0; + } + return ( $a['percent'] < $b['percent'] ) ? -1 : 1; + } ); + } + foreach ( $clovers as $clover => $info ) { $dirName = htmlspecialchars( basename( dirname( $clover ) ) ); $percent = (string)round( $info['percent'] ); $color = $this->getLevelColor( $info['percent'] ); -- To view, visit https://gerrit.wikimedia.org/r/405996 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4ff4bb7191ad8579427cf74fd865fe23b85b234d Gerrit-PatchSet: 4 Gerrit-Project: integration/docroot Gerrit-Branch: master Gerrit-Owner: Krinkle Gerrit-Reviewer: Hashar Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Paladox Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/docroot[master]: cover: Fix cover-extension breadcrumbs to work on different ...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405986 ) Change subject: cover: Fix cover-extension breadcrumbs to work on different mount paths .. cover: Fix cover-extension breadcrumbs to work on different mount paths For local dev. Matches logic we use in top nav already. Change-Id: Ifcd41842ca5944ef29ca6c4d04d4e466fb69271c --- M shared/CoveragePage.php M shared/Page.php 2 files changed, 13 insertions(+), 6 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified Objections: Reedy: There's a problem with this change, please improve diff --git a/shared/CoveragePage.php b/shared/CoveragePage.php index 67d583a..8bb60e5 100644 --- a/shared/CoveragePage.php +++ b/shared/CoveragePage.php @@ -48,16 +48,18 @@ $this->embedCSS( file_get_contents( __DIR__ . '/cover.css' ) ); if ( $this->pageName === 'Test coverage' ) { + $href = $this->fixNavUrl( '/cover-extensions/' ); $breadcrumbs = << Coverage home - MediaWiki extensions + MediaWiki extensions HTML; } else { + $href = $this->fixNavUrl( '/cover/' ); $breadcrumbs = << - Coverage home + Coverage home MediaWiki extensions HTML; diff --git a/shared/Page.php b/shared/Page.php index 801aa40..c82aa7a 100644 --- a/shared/Page.php +++ b/shared/Page.php @@ -248,15 +248,20 @@ ); } + protected function fixNavUrl( $href ) { + if ( $href[0] === '/' ) { + // Expand relatively so that it works even if the site is mounted in a sub directory. + $href = substr( $this->getRootPath(), 0, -1 ) . $href; + } + return $href; + } + protected function getNavHtml() { $html = ''; $cur = $this->getRequestPath(); foreach ( $this->getNavItems() as $href => $text ) { $active = ( $href === "/$cur" ? ' class="active"' : '' ); - if ( $href[0] === '/' ) { - // Expand relatively so that it works even if the site is mounted in a sub directory. - $href = substr( $this->getRootPath(), 0, -1 ) . $href; - } + $href = $this->fixNavUrl( $href ); $html .= '' . htmlspecialchars( $text ) . ''; } $html .= ''; -- To view, visit https://gerrit.wikimedia.org/r/405986 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifcd41842ca5944ef29ca6c4d04d4e466fb69271c Gerrit-PatchSet: 2 Gerrit-Project: integration/docroot Gerrit-Branch: master Gerrit-Owner: Krinkle Gerrit-Reviewer: Hashar Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Paladox Gerrit-Reviewer: Reedy 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...WikibaseQualityConstraints[master]: Check “difference within range” on qualifiers and references
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405293 ) Change subject: Check “difference within range” on qualifiers and references .. Check “difference within range” on qualifiers and references To implement this, we can simply use Context::getSnakGroup(), since the semantics of that method are to ignore deprecated statements, just like DiffWithinRangeChecker also used to do. Bug: T175565 Change-Id: I21c4b0ec82baf461b38aca0022db3fbf70ebb651 --- M src/ConstraintCheck/Checker/DiffWithinRangeChecker.php M tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php 2 files changed, 50 insertions(+), 15 deletions(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php b/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php index 1b25f17..de4e80d 100644 --- a/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php +++ b/src/ConstraintCheck/Checker/DiffWithinRangeChecker.php @@ -61,9 +61,8 @@ public function getSupportedContextTypes() { return [ Context::TYPE_STATEMENT => CheckResult::STATUS_COMPLIANCE, - // TODO T175565 - Context::TYPE_QUALIFIER => CheckResult::STATUS_TODO, - Context::TYPE_REFERENCE => CheckResult::STATUS_TODO, + Context::TYPE_QUALIFIER => CheckResult::STATUS_COMPLIANCE, + Context::TYPE_REFERENCE => CheckResult::STATUS_COMPLIANCE, ]; } @@ -73,9 +72,8 @@ public function getDefaultContextTypes() { return [ Context::TYPE_STATEMENT, - // TODO T175565 - // Context::TYPE_QUALIFIER, - // Context::TYPE_REFERENCE, + Context::TYPE_QUALIFIER, + Context::TYPE_REFERENCE, ]; } @@ -156,19 +154,15 @@ list( $min, $max, $property, $parameters ) = $this->parseConstraintParameters( $constraint ); // checks only the first occurrence of the referenced property (this constraint implies a single value constraint on that property) - /** @var Statement $otherStatement */ - foreach ( $context->getEntity()->getStatements() as $otherStatement ) { - $otherMainSnak = $otherStatement->getMainSnak(); - + foreach ( $context->getSnakGroup() as $otherSnak ) { if ( - !$property->equals( $otherStatement->getPropertyId() ) || - $otherStatement->getRank() === Statement::RANK_DEPRECATED || - !$otherMainSnak instanceof PropertyValueSnak + !$property->equals( $otherSnak->getPropertyId() ) || + !$otherSnak instanceof PropertyValueSnak ) { continue; } - $subtrahend = $otherMainSnak->getDataValue(); + $subtrahend = $otherSnak->getDataValue(); if ( $subtrahend->getType() === $minuend->getType() ) { $diff = $this->rangeInYears( $min, $max ) ? $this->rangeCheckerHelper->getDifferenceInYears( $minuend, $subtrahend ) : @@ -183,7 +177,7 @@ $message->rawParams( $this->constraintParameterRenderer->formatEntityId( $context->getSnak()->getPropertyId(), Role::PREDICATE ), $this->constraintParameterRenderer->formatDataValue( $minuend, Role::OBJECT ), - $this->constraintParameterRenderer->formatEntityId( $otherStatement->getPropertyId(), Role::PREDICATE ), + $this->constraintParameterRenderer->formatEntityId( $otherSnak->getPropertyId(), Role::PREDICATE ), $this->constraintParameterRenderer->formatDataValue( $subtrahend, Role::OBJECT ) ); if ( $min !== null ) { diff --git a/tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php b/tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php index afe2459..acb6c6a 100644 --- a/tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php +++ b/tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php @@ -5,7 +5,11 @@ use DataValues\TimeValue; use DataValues\UnboundedQuantityValue; use Wikibase\DataModel\Entity\PropertyId; +use Wikibase\
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Add tests for ItemIdSnakValue
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406041 ) Change subject: Add tests for ItemIdSnakValue .. Add tests for ItemIdSnakValue Change-Id: Ic3e84dfe44983a80499049472e3b62047223f7c9 --- M src/ConstraintCheck/ItemIdSnakValue.php A tests/phpunit/ItemIdSnakValueTest.php 2 files changed, 166 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/src/ConstraintCheck/ItemIdSnakValue.php b/src/ConstraintCheck/ItemIdSnakValue.php index 977dbb1..706e27f 100644 --- a/src/ConstraintCheck/ItemIdSnakValue.php +++ b/src/ConstraintCheck/ItemIdSnakValue.php @@ -130,6 +130,7 @@ * Get the item ID contained in this {@link ItemIdSnakValue}. * Only valid if {@link isValue} is true. * +* @throws DomainException if this value does not contain an item ID * @return ItemId */ public function getItemId() { diff --git a/tests/phpunit/ItemIdSnakValueTest.php b/tests/phpunit/ItemIdSnakValueTest.php new file mode 100644 index 000..fda55a1 --- /dev/null +++ b/tests/phpunit/ItemIdSnakValueTest.php @@ -0,0 +1,165 @@ +assertTrue( $value->isValue() ); + $this->assertFalse( $value->isSomeValue() ); + $this->assertFalse( $value->isNoValue() ); + $this->assertSame( $itemId, $value->getItemId() ); + } + + public function testSomeValue() { + $value = ItemIdSnakValue::someValue(); + + $this->assertFalse( $value->isValue() ); + $this->assertTrue( $value->isSomeValue() ); + $this->assertFalse( $value->isNoValue() ); + + $this->setExpectedException( DomainException::class ); + $value->getItemId(); + } + + public function testNoValue() { + $value = ItemIdSnakValue::noValue(); + + $this->assertFalse( $value->isValue() ); + $this->assertFalse( $value->isSomeValue() ); + $this->assertTrue( $value->isNoValue() ); + + $this->setExpectedException( DomainException::class ); + $value->getItemId(); + } + + public function testFromSnak_ItemId() { + $itemId = new ItemId( 'Q1' ); + $snak = new PropertyValueSnak( + new PropertyId( 'P100' ), + new EntityIdValue( $itemId ) + ); + + $value = ItemIdSnakValue::fromSnak( $snak ); + + $this->assertTrue( $value->isValue() ); + $this->assertSame( $itemId, $value->getItemId() ); + } + + public function testFromSnak_PropertyId() { + $propertyId = new PropertyId( 'P1' ); + $snak = new PropertyValueSnak( + new PropertyId( 'P100' ), + new EntityIdValue( $propertyId ) + ); + + $this->setExpectedException( InvalidArgumentException::class ); + $value = ItemIdSnakValue::fromSnak( $snak ); + } + + public function testFromSnak_String() { + $snak = new PropertyValueSnak( + new PropertyId( 'P100' ), + new StringValue( 'Q1' ) + ); + + $this->setExpectedException( InvalidArgumentException::class ); + $value = ItemIdSnakValue::fromSnak( $snak ); + } + + public function testFromSnak_SomeValue() { + $snak = new PropertySomeValueSnak( new PropertyId( 'P100' ) ); + + $value = ItemIdSnakValue::fromSnak( $snak ); + + $this->assertTrue( $value->isSomeValue() ); + } + + public function testFromSnak_NoValue() { + $snak = new PropertyNoValueSnak( new PropertyId( 'P100' ) ); + + $value = ItemIdSnakValue::fromSnak( $snak ); + + $this->assertTrue( $value->isNoValue() ); + } + + public function testMatchesSnak_ItemId() { + $itemId = new ItemId( 'Q1' ); + $snak = new PropertyValueSnak( + new PropertyId( 'P100' ), + new EntityIdValue( $itemId ) + ); + + $this->assertTrue( ItemIdSnakValue::fromItemId( $itemId )->matchesSnak( $snak ) ); + $this->assertFalse( ItemIdSnakValue::someValue()->matchesSnak( $snak ) ); + $this->assertFalse( ItemIdSnakValue::noValue()->matchesSnak( $snak ) ); + } + + public function testMatchesSnak_PropertyId() { + $itemId = new ItemId( 'Q1' ); + $propertyId = new PropertyId( 'P1' ); + $snak = new PropertyValueSnak( + new PropertyId( 'P100' ), + new EntityIdValue( $propertyId ) + ); + + $this->assertF
[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Add Help Link page in Extension:Newsletter's Special Pages
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/402807 ) Change subject: Add Help Link page in Extension:Newsletter's Special Pages .. Add Help Link page in Extension:Newsletter's Special Pages Bug: T184415 Change-Id: I48e8d5b2d7520074a7cea9c8ab3fbfbd4061af3f --- M includes/specials/SpecialNewsletterCreate.php M includes/specials/SpecialNewsletters.php 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: 01tonythomas: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specials/SpecialNewsletterCreate.php b/includes/specials/SpecialNewsletterCreate.php index e1252e9..80644db 100644 --- a/includes/specials/SpecialNewsletterCreate.php +++ b/includes/specials/SpecialNewsletterCreate.php @@ -18,6 +18,7 @@ } public function execute( $par ) { + $this->addHelpLink( 'Help:Extension:Newsletter' ); $this->requireLogin(); parent::execute( $par ); $this->getOutput()->setSubtitle( diff --git a/includes/specials/SpecialNewsletters.php b/includes/specials/SpecialNewsletters.php index 524cd13..cb853d6 100644 --- a/includes/specials/SpecialNewsletters.php +++ b/includes/specials/SpecialNewsletters.php @@ -21,6 +21,7 @@ public function execute( $par ) { $this->setHeaders(); + $this->addHelpLink( 'Help:Extension:Newsletter' ); $out = $this->getOutput(); $out->addModuleStyles( 'ext.newsletter.newsletters.styles' ); -- To view, visit https://gerrit.wikimedia.org/r/402807 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I48e8d5b2d7520074a7cea9c8ab3fbfbd4061af3f Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Jayprakash12345 <0freerunn...@gmail.com> Gerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com> Gerrit-Reviewer: Aklapper Gerrit-Reviewer: Jayprakash12345 <0freerunn...@gmail.com> Gerrit-Reviewer: Qgil 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...TimedMediaHandler[master]: Blacklist ogv.js's wasm on iOS 11.2.5 as well
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405989 ) Change subject: Blacklist ogv.js's wasm on iOS 11.2.5 as well .. Blacklist ogv.js's wasm on iOS 11.2.5 as well Work around upstream breakage in webkit. Change-Id: I95dcdbfc78d28ce2d53c01d460b344c1e3dc4da9 --- M resources/ext.tmh.player.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified TheDJ: Looks good to me, approved diff --git a/resources/ext.tmh.player.js b/resources/ext.tmh.player.js index 4260aaa..0528af6 100644 --- a/resources/ext.tmh.player.js +++ b/resources/ext.tmh.player.js @@ -137,7 +137,7 @@ base: mw.OgvJsSupport.basePath(), // Disable WebAssembly on iOS 11.2.2, where it's broken. - wasm: ( typeof WebAssembly === 'object' ) && !( navigator.userAgent.match( /(iPhone|iPad); CPU OS 11_2_2/ ) ) + wasm: ( typeof WebAssembly === 'object' ) && !( navigator.userAgent.match( /(iPhone|iPad); CPU OS 11_2_[2-5]/ ) ) }; globalConfig.techOrder.push( 'ogvjs' ); } -- To view, visit https://gerrit.wikimedia.org/r/405989 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95dcdbfc78d28ce2d53c01d460b344c1e3dc4da9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Brion VIBBER Gerrit-Reviewer: TheDJ 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]: Fix called function case in a bunch of places
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405386 ) Change subject: Fix called function case in a bunch of places .. Fix called function case in a bunch of places Change-Id: If1e392290a5bab3bce389f7da692e53a748b8aff --- M includes/EditPage.php M includes/Feed.php M includes/Storage/RevisionStore.php M includes/Title.php M includes/api/ApiComparePages.php M includes/api/ApiOptions.php M includes/libs/mime/XmlTypeCheck.php 7 files changed, 11 insertions(+), 11 deletions(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/includes/EditPage.php b/includes/EditPage.php index 72c3c14..5dc0720 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3727,7 +3727,7 @@ return new OOUI\ButtonWidget( [ 'id' => 'mw-editform-cancel', - 'href' => $this->getContextTitle()->getLinkUrl( $cancelParams ), + 'href' => $this->getContextTitle()->getLinkURL( $cancelParams ), 'label' => new OOUI\HtmlSnippet( $this->context->msg( 'cancel' )->parse() ), 'framed' => false, 'infusable' => true, diff --git a/includes/Feed.php b/includes/Feed.php index 92eec08..86e9bee 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -88,7 +88,7 @@ * @return string */ public function getUniqueID() { - $id = $this->getUniqueIDUnescaped(); + $id = $this->getUniqueIdUnescaped(); if ( $id ) { return $this->xmlEncode( $id ); } @@ -383,7 +383,7 @@ "title" => $item->getTitle(), "url" => $this->xmlEncode( wfExpandUrl( $item->getUrlUnescaped(), PROTO_CURRENT ) ), "permalink" => $item->rssIsPermalink, - "uniqueID" => $item->getUniqueId(), + "uniqueID" => $item->getUniqueID(), "description" => $item->getDescription(), "date" => $this->xmlEncode( $this->formatTime( $item->getDate() ) ), "author" => $item->getAuthor() @@ -433,7 +433,7 @@ // uses htmlentities, which does not work with XML $templateParams = [ 'language' => $this->xmlEncode( $this->getLanguage() ), - 'feedID' => $this->getFeedID(), + 'feedID' => $this->getFeedId(), 'title' => $this->getTitle(), 'url' => $this->xmlEncode( wfExpandUrl( $this->getUrlUnescaped(), PROTO_CURRENT ) ), 'selfUrl' => $this->getSelfUrl(), @@ -474,7 +474,7 @@ // Manually escaping rather than letting Mustache do it because Mustache // uses htmlentities, which does not work with XML $templateParams = [ - "uniqueID" => $item->getUniqueId(), + "uniqueID" => $item->getUniqueID(), "title" => $item->getTitle(), "mimeType" => $this->xmlEncode( $wgMimeType ), "url" => $this->xmlEncode( wfExpandUrl( $item->getUrlUnescaped(), PROTO_CURRENT ) ), diff --git a/includes/Storage/RevisionStore.php b/includes/Storage/RevisionStore.php index f8481fe..79ecec6 100644 --- a/includes/Storage/RevisionStore.php +++ b/includes/Storage/RevisionStore.php @@ -190,7 +190,7 @@ // rev_id is defined as NOT NULL, but this revision may not yet have been inserted. if ( !$title && $revId !== null && $revId > 0 ) { - $dbr = $this->getDbConnectionRef( $dbMode ); + $dbr = $this->getDBConnectionRef( $dbMode ); // @todo: Title::getSelectFields(), or Title::getQueryInfo(), or something like that $row = $dbr->selectRow( [ 'revision', 'page' ], diff --git a/includes/Title.php b/includes/Title.php index 9aad401..c4cf434 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1812,10 +1812,10 @@ if ( $this->isExternal() ) { $target = SpecialPage::getTitleFor( 'GoToInterwiki', - $this->getPrefixedDBKey() + $this->getPrefixedDBkey() ); } - return $target->getFullUrl( $query, false, $proto ); + return $target->getFullURL( $query, false, $proto ); } /** diff --git a/includes/api/ApiComparePages.php b/includes/api/ApiComparePages.php index 375fc18..93c35d3 100644 --- a/includes/api/ApiComparePages.php +++ b/includes/api/ApiCompareP
[MediaWiki-commits] [Gerrit] mediawiki...ORES[master]: Don't cache when sql model lookup returns empty
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406039 ) Change subject: Don't cache when sql model lookup returns empty .. Don't cache when sql model lookup returns empty Bug: T184938 Change-Id: If744f0ea35cc62e8cb1b85d134519e2bf257b872 --- M includes/Storage/SqlModelLookup.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/includes/Storage/SqlModelLookup.php b/includes/Storage/SqlModelLookup.php index d17f0e3..884a158 100644 --- a/includes/Storage/SqlModelLookup.php +++ b/includes/Storage/SqlModelLookup.php @@ -71,7 +71,7 @@ } private function getModelData() { - if ( $this->modelData === null ) { + if ( $this->modelData === null || $this->modelData === [] ) { $this->modelData = []; $result = $this->loadBalancer->getConnection( DB_REPLICA )->select( 'ores_model', -- To view, visit https://gerrit.wikimedia.org/r/406039 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If744f0ea35cc62e8cb1b85d134519e2bf257b872 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ORES Gerrit-Branch: master Gerrit-Owner: Ladsgroup Gerrit-Reviewer: Awight Gerrit-Reviewer: Thiemo Kreuz (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Change namespace from …\Test to …\Tests
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406043 ) Change subject: Change namespace from …\Test to …\Tests .. Change namespace from …\Test to …\Tests Both \WikibaseQuality\ConstraintReport\Test and \WikibaseQuality\ConstraintReport\Tests were in use; the plural form seems to be the standard in Wikibase, so let’s settle on that. Change-Id: I721ea0db2164f2e1db706f7f7c6bc690e029c516 --- M tests/phpunit/Cache/CachedArrayTest.php M tests/phpunit/Cache/CachedBoolTest.php M tests/phpunit/Cache/CachedCheckConstraintsResponseTest.php M tests/phpunit/Cache/CachedEntityIdsTest.php M tests/phpunit/Cache/CachedQueryResultsTest.php M tests/phpunit/Cache/CachingMetadataTest.php M tests/phpunit/Cache/DependencyMetadataTest.php M tests/phpunit/Cache/MetadataTest.php M tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php M tests/phpunit/Checker/ConnectionChecker/ConflictsWithCheckerTest.php M tests/phpunit/Checker/ConnectionChecker/ConnectionCheckerHelperTest.php M tests/phpunit/Checker/ConnectionChecker/InverseCheckerTest.php M tests/phpunit/Checker/ConnectionChecker/ItemCheckerTest.php M tests/phpunit/Checker/ConnectionChecker/SymmetricCheckerTest.php M tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php M tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php M tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php M tests/phpunit/Checker/QualifierChecker/MandatoryQualifiersCheckerTest.php M tests/phpunit/Checker/QualifierChecker/QualifierCheckerTest.php M tests/phpunit/Checker/QualifierChecker/QualifiersCheckerTest.php M tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php M tests/phpunit/Checker/RangeChecker/RangeCheckerHelperTest.php M tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php M tests/phpunit/Checker/ReferenceCheckerTest.php M tests/phpunit/Checker/TypeChecker/TypeCheckerHelperTest.php M tests/phpunit/Checker/TypeChecker/TypeCheckerTest.php M tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php M tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php M tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php M tests/phpunit/Checker/ValueCountChecker/UniqueValueCheckerTest.php M tests/phpunit/Checker/ValueCountChecker/ValueCountCheckerHelperTest.php M tests/phpunit/Checker/ValueOnlyCheckerTest.php M tests/phpunit/ConstraintReportFactoryTest.php M tests/phpunit/Context/MainSnakContextTest.php M tests/phpunit/Context/QualifierContextTest.php M tests/phpunit/Context/ReferenceContextTest.php M tests/phpunit/DelegatingConstraintCheckerTest.php M tests/phpunit/Helper/ConstraintParameterParserTest.php M tests/phpunit/Helper/LoggingHelperTest.php M tests/phpunit/Helper/SparqlHelperTest.php M tests/phpunit/Result/CheckResultTest.php 41 files changed, 41 insertions(+), 43 deletions(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/tests/phpunit/Cache/CachedArrayTest.php b/tests/phpunit/Cache/CachedArrayTest.php index d635bf8..0469b49 100644 --- a/tests/phpunit/Cache/CachedArrayTest.php +++ b/tests/phpunit/Cache/CachedArrayTest.php @@ -1,6 +1,6 @@ https://gerrit.wikimedia.org/r/406043 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I721ea0db2164f2e1db706f7f7c6bc690e029c516 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Thiemo Kreuz (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Make maintenance script testable
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406036 ) Change subject: Make maintenance script testable .. Make maintenance script testable Use Maintenance::getConfig(), which has a corresponding setter which tests can use, instead of getting the config from the services directly. Move code to get the PropertyInfoLookup, and to instantiate the UpdateConstraintsTableJob, into the constructor, where it is stored in private member variables which tests can then later override (using TestingAccessWrapper to get around the access restrictions). And to make sure we can actually find the class in the tests, register its containing directory in the autoload namespaces. Also removes the use of Maintenance::error()’s deprecated $die parameter. There is a fatalError() function we could use instead, but in that case we could completely terminate the tests, which isn’t what we want. Instead, simply return from execute(). Change-Id: I57f5a102f542db0b59347ec82fe85277ffb95560 --- M extension.json M maintenance/ImportConstraintStatements.php 2 files changed, 29 insertions(+), 6 deletions(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/extension.json b/extension.json index bc3d7c8..e60e04d 100644 --- a/extension.json +++ b/extension.json @@ -422,6 +422,7 @@ }, "AutoloadNamespaces": { "WikibaseQuality\\ConstraintReport\\": "src/", + "WikibaseQuality\\ConstraintReport\\Maintenance\\": "maintenance/", "WikibaseQuality\\ConstraintReport\\Tests\\": "tests/phpunit/" }, "manifest_version": 2 diff --git a/maintenance/ImportConstraintStatements.php b/maintenance/ImportConstraintStatements.php index 2a17564..db942c3 100644 --- a/maintenance/ImportConstraintStatements.php +++ b/maintenance/ImportConstraintStatements.php @@ -4,14 +4,16 @@ use Maintenance; use Title; -use MediaWiki\MediaWikiServices; +use Wikibase\Lib\Store\PropertyInfoLookup; use WikibaseQuality\ConstraintReport\UpdateConstraintsTableJob; use Wikibase\Repo\WikibaseRepo; +// @codeCoverageIgnoreStart $basePath = getenv( "MW_INSTALL_PATH" ) !== false ? getenv( "MW_INSTALL_PATH" ) : __DIR__ . "/../../.."; require_once $basePath . "/maintenance/Maintenance.php"; +// @codeCoverageIgnoreEnd /** * Runs {@link UpdateConstraintsTableJob} once for every property. @@ -20,22 +22,42 @@ */ class ImportConstraintStatements extends Maintenance { + /** +* @var PropertyInfoLookup +*/ + private $propertyInfoLookup; + + /** +* @var callable +* @param string $propertyIdSerialization +* @return UpdateConstraintsTableJob +*/ + private $newUpdateConstraintsTableJob; + public function __construct() { parent::__construct(); + $repo = WikibaseRepo::getDefaultInstance(); + $this->propertyInfoLookup = $repo->getStore()->getPropertyInfoLookup(); + $this->newUpdateConstraintsTableJob = function ( $propertyIdSerialization ) { + return UpdateConstraintsTableJob::newFromGlobalState( + Title::newMainPage(), + [ 'propertyId' => $propertyIdSerialization ] + ); + }; $this->addDescription( 'Imports property constraints from statements on properties' ); } public function execute() { - if ( !MediaWikiServices::getInstance()->getMainConfig()->get( 'WBQualityConstraintsEnableConstraintsImportFromStatements' ) ) { - $this->error( 'Constraint statements are not enabled. Aborting.', 1 ); + if ( !$this->getConfig()->get( 'WBQualityConstraintsEnableConstraintsImportFromStatements' ) ) { + $this->error( 'Constraint statements are not enabled. Aborting.' ); + return; } - $propertyInfoLookup = WikibaseRepo::getDefaultInstance()->getStore()->getPropertyInfoLookup(); - foreach ( $propertyInfoLookup->getAllPropertyInfo() as $propertyIdSerialization => $info ) { + foreach ( $this->propertyInfoLookup->getAllPropertyInfo() as $propertyIdSerialization => $info ) { $this->output( sprintf( 'Importing constraint statements for % 6s... ', $propertyIdSerialization ), $propertyIdSerialization ); $startTime = microtime( true ); - $job = UpdateConstraintsTableJob::newFromGlobalState( Title::newMainPage(), [ 'propertyId' => $propertyIdSerialization ] ); + $job = call_user_func( $this->newUpdateConstraintsTableJob, $propertyIdSerialization ); $job->run(); $endTime = m
[MediaWiki-commits] [Gerrit] mediawiki...FileImporter[master]: Handle file revisions that contain a missing image file
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/403179 ) Change subject: Handle file revisions that contain a missing image file .. Handle file revisions that contain a missing image file Merge only when https://gerrit.wikimedia.org/r/#/c/403174/ is merged and deployed. Bug: T179645 Change-Id: Ia354f24315b89279a010dee494ca82ee9049e7d5 --- M i18n/en.json M i18n/qqq.json M src/Remote/MediaWiki/ApiDetailRetriever.php 3 files changed, 6 insertions(+), 0 deletions(-) Approvals: WMDE-Fisch: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index 2ad222e..484209a 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -49,5 +49,6 @@ "fileimporter-revision-removed-text": "Suppressed text removed by FileImporter.", "fileimporter-revision-removed-comment": "Suppressed comment removed by FileImporter.", "fileimporter-in-beta": "File import is in beta mode: We tested it carefully but it still might have some problems. If you encounter problems, please [//www.mediawiki.org/w/index.php?title=Extension_talk:FileImporter report them on our help page] - ideally with a step by step way to reproduce the problem, so we can understand and fix it.", + "fileimporter-filemissinginrevision": "Can't import file because at least one of its revisions is missing an image file.", "fileimporter-filetoolarge": "The file you are currently trying to import exceeds the maximum file size limit." } \ No newline at end of file diff --git a/i18n/qqq.json b/i18n/qqq.json index fcd6857..b4443be 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -52,5 +52,6 @@ "fileimporter-revision-removed-text": "Text inserted if the original text is suppressed.", "fileimporter-revision-removed-comment": "Text inserted as a revision comment if the original comment is suppressed.", "fileimporter-in-beta": "Text shown when the special page is loaded warning the user that the extension is in beta.", + "fileimporter-filemissinginrevision": "Error message shown when the file contains at least one revision with a missing image file.", "fileimporter-filetoolarge": "Text shown when a user tries to upload a file (or file revision) which exceeds the maximum file size limit." } diff --git a/src/Remote/MediaWiki/ApiDetailRetriever.php b/src/Remote/MediaWiki/ApiDetailRetriever.php index 5c7679c..762d83b 100644 --- a/src/Remote/MediaWiki/ApiDetailRetriever.php +++ b/src/Remote/MediaWiki/ApiDetailRetriever.php @@ -296,6 +296,10 @@ throw new LocalizedImportException( 'fileimporter-cantimportfilehidden' ); } + if ( array_key_exists( 'filemissing', $revisionInfo ) ) { + throw new LocalizedImportException( 'fileimporter-filemissinginrevision' ); + } + if ( array_key_exists( 'userhidden', $revisionInfo ) ) { $revisionInfo['user'] = $wgFileImporterAccountForSuppressedUsername; } -- To view, visit https://gerrit.wikimedia.org/r/403179 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia354f24315b89279a010dee494ca82ee9049e7d5 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/FileImporter Gerrit-Branch: master Gerrit-Owner: Andrew-WMDE Gerrit-Reviewer: Addshore Gerrit-Reviewer: Andrew-WMDE Gerrit-Reviewer: Siebrand Gerrit-Reviewer: Tobias Gritschacher Gerrit-Reviewer: WMDE-Fisch 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...GeoData[master]: Rename GeoDataMathTest --> MathTest, like the class being te...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/345612 ) Change subject: Rename GeoDataMathTest --> MathTest, like the class being tested .. Rename GeoDataMathTest --> MathTest, like the class being tested Change-Id: I9a17cafd56290e40dc96bd3ae60d69554866f4ec --- R tests/phpunit/MathTest.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/tests/phpunit/GeoDataMathTest.php b/tests/phpunit/MathTest.php similarity index 96% rename from tests/phpunit/GeoDataMathTest.php rename to tests/phpunit/MathTest.php index 0212609..27f3895 100644 --- a/tests/phpunit/GeoDataMathTest.php +++ b/tests/phpunit/MathTest.php @@ -11,7 +11,7 @@ * * @group GeoData */ -class GeoDataMathTest extends MediaWikiTestCase { +class MathTest extends MediaWikiTestCase { /** * @covers \GeoData\Math::distance * @dataProvider getDistanceData -- To view, visit https://gerrit.wikimedia.org/r/345612 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9a17cafd56290e40dc96bd3ae60d69554866f4ec Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/GeoData Gerrit-Branch: master Gerrit-Owner: MaxSem Gerrit-Reviewer: EBernhardson Gerrit-Reviewer: Thiemo Kreuz (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Set $_SERVER['SERVER_NAME'] to the value set by --server
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/260376 ) Change subject: Set $_SERVER['SERVER_NAME'] to the value set by --server .. Set $_SERVER['SERVER_NAME'] to the value set by --server For wiki families that use the "Wikimedia Method" to have domain dependant wikis the server variable 'SERVER_NAME' might be used to get the database name. c.f. https://www.mediawiki.org/wiki/Manual:Wiki_family#Wikimedia_Method This change sets $_SERVER['SERVER_NAME'] to the commandline option passed as --server to enable the correct loading of the LocalSettings.php Change-Id: I7e5c009c2403f6c93e81422a8376d7deee4d2b5a --- M maintenance/Maintenance.php 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 174b973..ec54993 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -1170,6 +1170,9 @@ "must exist and be readable in the source directory.\n" . "Use --conf to specify it.", true ); } + if ( isset( $this->mOptions['server'] ) ) { + $_SERVER['SERVER_NAME'] = $this->mOptions['server']; + } $wgCommandLineMode = true; return $settingsFile; -- To view, visit https://gerrit.wikimedia.org/r/260376 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7e5c009c2403f6c93e81422a8376d7deee4d2b5a Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Physikerwelt Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Parent5446 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...WikibaseQualityConstraints[master]: Use InMemoryEntityLookup instead of JsonFileEntityLookup
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/404715 ) Change subject: Use InMemoryEntityLookup instead of JsonFileEntityLookup .. Use InMemoryEntityLookup instead of JsonFileEntityLookup Bug: T168240 Change-Id: I649302db640f3ba55d013d5391b6048e1647e3d1 --- D tests/phpunit/Job/P2.json M tests/phpunit/Job/UpdateConstraintsTableJobTest.php 2 files changed, 18 insertions(+), 36 deletions(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/tests/phpunit/Job/P2.json b/tests/phpunit/Job/P2.json deleted file mode 100644 index 22ee7e0..000 --- a/tests/phpunit/Job/P2.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "id": "P2", - "type": "property", - "datatype": "wikibase-item", - "aliases": {}, - "labels": { -"en": { - "language": "en", - "value": "my property" -} - }, - "claims": { -"P2302": [ - { -"id": "P2$484b7eaf-e86c-4f25-91dc-7ae19f8be8de", -"mainsnak": { - "snaktype": "value", - "property": "P2302", - "datatype": "wikibase-item", - "datavalue": { -"value": { - "entity-type": "item", - "numeric-id": 19474404, - "id": "Q19474404" -}, -"type": "wikibase-entityid" - } -}, -"type": "statement", -"rank": "normal" - } -] - } -} diff --git a/tests/phpunit/Job/UpdateConstraintsTableJobTest.php b/tests/phpunit/Job/UpdateConstraintsTableJobTest.php index 054d3c3..2ad3a3d 100644 --- a/tests/phpunit/Job/UpdateConstraintsTableJobTest.php +++ b/tests/phpunit/Job/UpdateConstraintsTableJobTest.php @@ -21,7 +21,6 @@ use WikibaseQuality\ConstraintReport\ConstraintRepository; use WikibaseQuality\ConstraintReport\Tests\DefaultConfig; use WikibaseQuality\ConstraintReport\UpdateConstraintsTableJob; -use WikibaseQuality\Tests\Helper\JsonFileEntityLookup; use Wikibase\Repo\WikibaseRepo; /** @@ -312,13 +311,30 @@ } public function testRun() { + $config = $this->getDefaultConfig(); + $propertyConstraintId = $config->get( 'WBQualityConstraintsPropertyConstraintId' ); + $singleValueConstraintId = $config->get( 'WBQualityConstraintsSingleValueConstraintId' ); + $property = new Property( + new PropertyId( 'P2' ), + null, + 'wikibase-item', + new StatementList( + NewStatement::forProperty( $propertyConstraintId ) + ->withValue( new ItemId( $singleValueConstraintId ) ) + ->withGuid( 'P2$484b7eaf-e86c-4f25-91dc-7ae19f8be8de' ) + ->build() + ) + ); + $entityLookup = new InMemoryEntityLookup(); + $entityLookup->addEntity( $property ); + $job = new UpdateConstraintsTableJob( Title::newFromText( 'constraintsTableUpdate' ), [], 'P2', $this->getDefaultConfig(), new ConstraintRepository(), - new JsonFileEntityLookup( __DIR__ ), + $entityLookup, WikibaseRepo::getDefaultInstance()->getBaseDataModelSerializerFactory()->newSnakSerializer() ); -- To view, visit https://gerrit.wikimedia.org/r/404715 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I649302db640f3ba55d013d5391b6048e1647e3d1 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Thiemo Kreuz (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add missing Maintenance import
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406034 ) Change subject: Add missing Maintenance import .. Add missing Maintenance import Without this import, the @var Maintenance comment on $maintenance doesn’t refer to the right class. Change-Id: I2b5efa422f3e9d50f2132658b04ea2814af61954 --- M tests/phpunit/maintenance/MaintenanceBaseTestCase.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/tests/phpunit/maintenance/MaintenanceBaseTestCase.php b/tests/phpunit/maintenance/MaintenanceBaseTestCase.php index 9d73a51..bdcf7e5 100644 --- a/tests/phpunit/maintenance/MaintenanceBaseTestCase.php +++ b/tests/phpunit/maintenance/MaintenanceBaseTestCase.php @@ -2,6 +2,7 @@ namespace MediaWiki\Tests\Maintenance; +use Maintenance; use MediaWikiTestCase; use Wikimedia\TestingAccessWrapper; -- To view, visit https://gerrit.wikimedia.org/r/406034 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2b5efa422f3e9d50f2132658b04ea2814af61954 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Thiemo Kreuz (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Add a @covers tag to the only test
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406032 ) Change subject: Add a @covers tag to the only test .. Add a @covers tag to the only test Change-Id: I16b047c965e2ebcf47576ba8b0a462d9da5783be --- M tests/phpunit/includes/PF_FormPrinterTest.php 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/includes/PF_FormPrinterTest.php b/tests/phpunit/includes/PF_FormPrinterTest.php index 098a403..41919b3 100644 --- a/tests/phpunit/includes/PF_FormPrinterTest.php +++ b/tests/phpunit/includes/PF_FormPrinterTest.php @@ -1,6 +1,7 @@ https://gerrit.wikimedia.org/r/406032 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I16b047c965e2ebcf47576ba8b0a462d9da5783be Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageForms Gerrit-Branch: master Gerrit-Owner: Thiemo Kreuz (WMDE) Gerrit-Reviewer: Ladsgroup 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...ORES[master]: Take advantage of MaintenanceBaseTestCase
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/404677 ) Change subject: Take advantage of MaintenanceBaseTestCase .. Take advantage of MaintenanceBaseTestCase Change-Id: I9581adc5141873da201ee5b86914e7119179ce81 --- M tests/phpunit/maintenance/PopulateDatabaseTest.php M tests/phpunit/maintenance/PurgeScoreCacheTest.php 2 files changed, 24 insertions(+), 18 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/maintenance/PopulateDatabaseTest.php b/tests/phpunit/maintenance/PopulateDatabaseTest.php index 402f331..d7d5f81 100644 --- a/tests/phpunit/maintenance/PopulateDatabaseTest.php +++ b/tests/phpunit/maintenance/PopulateDatabaseTest.php @@ -2,6 +2,7 @@ namespace ORES\Tests\Maintenance; +use MediaWiki\Tests\Maintenance\MaintenanceBaseTestCase; use ORES\Maintenance\PopulateDatabase; use ORES\Tests\MockOresServiceBuilder; @@ -12,7 +13,11 @@ * @group Database * @covers ORES\Maintenance\PopulateDatabase */ -class PopulateDatabaseTest extends \MediaWikiTestCase { +class PopulateDatabaseTest extends MaintenanceBaseTestCase { + + public function getMaintenanceClass() { + return PopulateDatabase::class; + } public function setUp() { parent::setUp(); @@ -21,8 +26,6 @@ 'ores_model', 'recentchanges', ]; - - $this->maintenance = new PopulateDatabase(); TestHelper::clearOresTables(); TestHelper::insertModelData(); @@ -158,9 +161,6 @@ foreach ( $oresContents as $revId => $scores ) { TestHelper::insertOresData( $revId, $scores ); } - - // FIXME: Write a base maintenance test case that suppresses output. - $argv = array_merge( $argv, [ '--quiet' ] ); $this->maintenance->loadWithArgv( $argv ); $this->maintenance->execute(); diff --git a/tests/phpunit/maintenance/PurgeScoreCacheTest.php b/tests/phpunit/maintenance/PurgeScoreCacheTest.php index 3dafa78..478e2ed 100644 --- a/tests/phpunit/maintenance/PurgeScoreCacheTest.php +++ b/tests/phpunit/maintenance/PurgeScoreCacheTest.php @@ -3,6 +3,7 @@ namespace ORES\Tests\Maintenance; use MediaWiki\MediaWikiServices; +use MediaWiki\Tests\Maintenance\MaintenanceBaseTestCase; use ORES\Maintenance\PurgeScoreCache; @@ -25,7 +26,11 @@ * @group Database * @covers ORES\Maintenance\PurgeScoreCache */ -class PurgeScoreCacheTest extends \MediaWikiTestCase { +class PurgeScoreCacheTest extends MaintenanceBaseTestCase { + + public function getMaintenanceClass() { + return PurgeScoreCache::class; + } public function setUp() { parent::setUp(); @@ -33,8 +38,6 @@ 'ores_classification', 'ores_model', ]; - - $this->maintenance = new PurgeScoreCache(); TestHelper::clearOresTables(); TestHelper::insertModelData(); @@ -45,9 +48,6 @@ public function testPurgeScoreCache_emptyDb() { TestHelper::clearOresTables(); - - // FIXME: Shouldn't be necessary once we capture output. - $this->maintenance->loadWithArgv( [ '--quiet' ] ); $this->maintenance->execute(); @@ -62,7 +62,7 @@ 'damaging' => 0.1, ] ); - $this->maintenance->loadWithArgv( [ '--quiet', '--model', 'not_a_thing' ] ); + $this->maintenance->loadWithArgv( [ '--model', 'not_a_thing' ] ); $this->maintenance->execute(); @@ -79,6 +79,8 @@ 'oresc_probability' => '0.100', 'oresc_model' => (string)TestHelper::DAMAGING, ] ], iterator_to_array( $remainingScores, false ) ); + + $this->expectOutputRegex( '/skipping \'not_a_thing\' model/' ); } public function testPurgeScoreCache_all() { @@ -88,7 +90,7 @@ 'damaging' => 0.1, ] ); - $this->maintenance->loadWithArgv( [ '--quiet', '--all' ] ); + $this->maintenance->loadWithArgv( [ '--all' ] ); $this->maintenance->execute(); @@ -100,6 +102,10 @@ ); $this->assertEquals( [], iterator_to_array( $remainingScores, false ) ); + + $pattern = '/skipping \'reverted\'.+' + . 'purging scores from all model versions from \'damaging\'/s'; + $this->expectOutputRegex( $pattern ); } public function testPurgeScoreCache_oldModels() { @@ -108,8 +114,6 @@ TestHelper::DAMAGING_OLD => 0.2, 'damaging
[MediaWiki-commits] [Gerrit] mediawiki...BetaFeatures[master]: Add missing @covers tags to existing test cases
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406030 ) Change subject: Add missing @covers tags to existing test cases .. Add missing @covers tags to existing test cases This is quite trivial, I believe. No need to fiddle with function-level @covers tags here. Change-Id: I12027f6f98952cc8fdca5722dc75ac5c300105af --- M tests/phpunit/AutoEnrollmentTest.php M tests/phpunit/DependentFeatureTest.php M tests/phpunit/HTMLFeatureFieldTest.php M tests/phpunit/HTMLHorizontalRuleTest.php M tests/phpunit/HTMLTextBlockTest.php M tests/phpunit/HooksRunTest.php M tests/phpunit/NewHTMLCheckFieldTest.php M tests/phpunit/PreferenceHandlingTest.php 8 files changed, 16 insertions(+), 0 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/AutoEnrollmentTest.php b/tests/phpunit/AutoEnrollmentTest.php index 3b801dd..b7c6a61 100644 --- a/tests/phpunit/AutoEnrollmentTest.php +++ b/tests/phpunit/AutoEnrollmentTest.php @@ -24,6 +24,8 @@ */ /** + * @covers \BetaFeaturesHooks::getPreferences + * * @group BetaFeatures */ class AutoEnrollmentTest extends BetaFeaturesTestCase { diff --git a/tests/phpunit/DependentFeatureTest.php b/tests/phpunit/DependentFeatureTest.php index bc9f8bf..8e486b0 100644 --- a/tests/phpunit/DependentFeatureTest.php +++ b/tests/phpunit/DependentFeatureTest.php @@ -24,6 +24,8 @@ */ /** + * @covers \BetaFeaturesHooks::getPreferences + * * @group BetaFeatures */ class DependentFeatureTest extends BetaFeaturesTestCase { diff --git a/tests/phpunit/HTMLFeatureFieldTest.php b/tests/phpunit/HTMLFeatureFieldTest.php index 3266e7f..b69ec16 100644 --- a/tests/phpunit/HTMLFeatureFieldTest.php +++ b/tests/phpunit/HTMLFeatureFieldTest.php @@ -24,6 +24,8 @@ */ /** + * @covers \HTMLFeatureField + * * @group BetaFeatures */ class HTMLFeatureFieldTest extends MediaWikiTestCase { diff --git a/tests/phpunit/HTMLHorizontalRuleTest.php b/tests/phpunit/HTMLHorizontalRuleTest.php index 5b27836..2b3ce41 100644 --- a/tests/phpunit/HTMLHorizontalRuleTest.php +++ b/tests/phpunit/HTMLHorizontalRuleTest.php @@ -24,6 +24,8 @@ */ /** + * @covers \HTMLHorizontalRuleField + * * @group BetaFeatures */ class HTMLHorizontalRuleFieldTest extends MediaWikiTestCase { diff --git a/tests/phpunit/HTMLTextBlockTest.php b/tests/phpunit/HTMLTextBlockTest.php index 3de29c8..8b4fb63 100644 --- a/tests/phpunit/HTMLTextBlockTest.php +++ b/tests/phpunit/HTMLTextBlockTest.php @@ -24,6 +24,8 @@ */ /** + * @covers \HTMLTextBlockField + * * @group BetaFeatures */ class HTMLTextBlockFieldTest extends MediaWikiTestCase { diff --git a/tests/phpunit/HooksRunTest.php b/tests/phpunit/HooksRunTest.php index 15727e0..99e8265 100644 --- a/tests/phpunit/HooksRunTest.php +++ b/tests/phpunit/HooksRunTest.php @@ -24,6 +24,8 @@ */ /** + * @covers \BetaFeaturesHooks::getPreferences + * * @group BetaFeatures */ class HooksRunTest extends MediaWikiTestCase { diff --git a/tests/phpunit/NewHTMLCheckFieldTest.php b/tests/phpunit/NewHTMLCheckFieldTest.php index 0f07b15..5b9bc42 100644 --- a/tests/phpunit/NewHTMLCheckFieldTest.php +++ b/tests/phpunit/NewHTMLCheckFieldTest.php @@ -24,6 +24,8 @@ */ /** + * @covers \NewHTMLCheckField + * * @group BetaFeatures */ class NewHTMLCheckFieldTest extends MediaWikiTestCase { diff --git a/tests/phpunit/PreferenceHandlingTest.php b/tests/phpunit/PreferenceHandlingTest.php index a36532f..a522c80 100644 --- a/tests/phpunit/PreferenceHandlingTest.php +++ b/tests/phpunit/PreferenceHandlingTest.php @@ -24,6 +24,8 @@ */ /** + * @covers \BetaFeaturesHooks::getPreferences + * * @group BetaFeatures */ class PreferenceHandlingTest extends BetaFeaturesTestCase { -- To view, visit https://gerrit.wikimedia.org/r/406030 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I12027f6f98952cc8fdca5722dc75ac5c300105af Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BetaFeatures Gerrit-Branch: master Gerrit-Owner: Thiemo Kreuz (WMDE) Gerrit-Reviewer: Ladsgroup 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...GeoData[master]: Add missing @covers tags to existing test cases
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406029 ) Change subject: Add missing @covers tags to existing test cases .. Add missing @covers tags to existing test cases I'm intentionally adding both class-level as well as function-level @covers tags: * I am adding function-level @covers when it is obvious a test case is meant to test this single function only. Everything else would be accidential coverage, which I don't want. * I'm adding @covers on the class level when it is obvious which class is under test. This is helpful because there are some test cases that test a whole feature set of a class, and not only a specific method. This is obviously not possible for "misc" test cases. Change-Id: Ic7d5b8b2e81cf09753a2f7bf73dfd2304f69b1b6 --- M tests/phpunit/BoundingBoxTest.php M tests/phpunit/CoordTest.php M tests/phpunit/GeoDataMathTest.php M tests/phpunit/GeoFeatureTest.php M tests/phpunit/GeoSearchTest.php M tests/phpunit/GlobeTest.php M tests/phpunit/MiscGeoDataTest.php M tests/phpunit/ParseCoordTest.php M tests/phpunit/TagTest.php 9 files changed, 30 insertions(+), 1 deletion(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/BoundingBoxTest.php b/tests/phpunit/BoundingBoxTest.php index 29fc5fb..09cc178 100644 --- a/tests/phpunit/BoundingBoxTest.php +++ b/tests/phpunit/BoundingBoxTest.php @@ -6,10 +6,13 @@ use MediaWikiTestCase; /** + * @covers \GeoData\BoundingBox + * * @group GeoData */ class BoundingBoxTest extends MediaWikiTestCase { /** +* @covers \GeoData\BoundingBox::center * @dataProvider provideCenter */ public function testCenter( $latExpected, $lonExpected, $lat1, $lon1, $lat2, $lon2 ) { diff --git a/tests/phpunit/CoordTest.php b/tests/phpunit/CoordTest.php index e8a52e7..a696415 100644 --- a/tests/phpunit/CoordTest.php +++ b/tests/phpunit/CoordTest.php @@ -8,12 +8,15 @@ use MediaWikiTestCase; /** + * @covers \GeoData\Coord + * * @todo: More tests * @group GeoData */ class CoordTest extends MediaWikiTestCase { /** +* @covers \GeoData\Coord::equalsTo * @dataProvider provideEquals * @param Coord $coord1 * @param Coord $coord2 @@ -112,6 +115,7 @@ } /** +* @covers \GeoData\Coord::fullyEqualsTo * @dataProvider provideFullyEquals * * @param Coord $coord1 @@ -237,6 +241,9 @@ return array_merge( $this->provideAlwaysEqualCoords(), $testCases ); } + /** +* @covers \GeoData\Coord::bboxAround +*/ public function testBboxAround() { for ( $i = 0; $i < 90; $i += 5 ) { $coord = new Coord( $i, $i ); @@ -249,6 +256,7 @@ } /** +* @covers \GeoData\Coord::getGlobeObj * @dataProvider provideGlobeObj */ public function testGlobeObj( $name, Globe $expected ) { diff --git a/tests/phpunit/GeoDataMathTest.php b/tests/phpunit/GeoDataMathTest.php index d867f7c..0212609 100644 --- a/tests/phpunit/GeoDataMathTest.php +++ b/tests/phpunit/GeoDataMathTest.php @@ -7,10 +7,13 @@ use MediaWikiTestCase; /** + * @covers \GeoData\Math + * * @group GeoData */ class GeoDataMathTest extends MediaWikiTestCase { /** +* @covers \GeoData\Math::distance * @dataProvider getDistanceData */ public function testDistance( $lat1, $lon1, $lat2, $lon2, $dist, $name ) { @@ -29,6 +32,8 @@ } /** +* @covers \GeoData\Coord::bboxAround +* @covers \GeoData\Math::wrapAround * @dataProvider getRectData * @todo: test directly now that this function is public */ diff --git a/tests/phpunit/GeoFeatureTest.php b/tests/phpunit/GeoFeatureTest.php index 2799887..3a76901 100644 --- a/tests/phpunit/GeoFeatureTest.php +++ b/tests/phpunit/GeoFeatureTest.php @@ -11,7 +11,7 @@ use Wikimedia\Rdbms\LoadBalancer; /** - * Test GeoFeature functions. + * @covers \GeoData\CirrusGeoFeature * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -93,6 +93,7 @@ } /** +* @covers \GeoData\CirrusGeoFeature::parseDistance * @dataProvider parseDistanceProvider */ public function testParseDistance( $expected, $distance ) { @@ -162,6 +163,7 @@ } /** +* @covers \GeoData\CirrusGeoFeature::parseGeoNearby * @dataProvider parseGeoNearbyProvider */ public function testParseGeoNearby( $expected, $value ) { @@ -244,6 +246,7 @@ } /** +* @covers \GeoData\CirrusGeoFeature::parseGeoNearbyTitle * @dataProvider parseGeoNearbyTitleProvider */ publi
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Fix smaller mistakes in UsageDeduplicator
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405895 ) Change subject: Fix smaller mistakes in UsageDeduplicator .. Fix smaller mistakes in UsageDeduplicator Bug: T178079 Change-Id: I72fe1aeb3df2d36f322e6579994584f88aa0e4a8 --- M client/includes/Usage/UsageDeduplicator.php M client/tests/phpunit/includes/Usage/UsageDeduplicatorTest.php 2 files changed, 27 insertions(+), 12 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/Usage/UsageDeduplicator.php b/client/includes/Usage/UsageDeduplicator.php index 10c5feb..8c7e4ce 100644 --- a/client/includes/Usage/UsageDeduplicator.php +++ b/client/includes/Usage/UsageDeduplicator.php @@ -25,9 +25,8 @@ $return = []; array_walk_recursive( $structuredUsages, - function( $a ) use ( &$return ) { - /* @var EntityUsage $a */ - $return[$a->getIdentityString()] = $a; + function ( EntityUsage $usage ) use ( &$return ) { + $return[$usage->getIdentityString()] = $usage; } ); return $return; @@ -65,8 +64,8 @@ } /** -* @param EntityUsage[] $usages -* @return EntityUsage[] +* @param array[] $usages +* @return array[] */ private function deduplicateUsagesPerEntity( array $usages ) { $usages[EntityUsage::DESCRIPTION_USAGE] = $this->deduplicatePerType( diff --git a/client/tests/phpunit/includes/Usage/UsageDeduplicatorTest.php b/client/tests/phpunit/includes/Usage/UsageDeduplicatorTest.php index cf2041e..a536369 100644 --- a/client/tests/phpunit/includes/Usage/UsageDeduplicatorTest.php +++ b/client/tests/phpunit/includes/Usage/UsageDeduplicatorTest.php @@ -31,19 +31,35 @@ $q2DescriptionFa = new EntityUsage( $q2, EntityUsage::DESCRIPTION_USAGE, 'fa' ); return [ - [ [ $q1LabelEn, $q1Label ], [ $q1Label ] ], - [ [ $q1LabelEn ], [ $q1LabelEn ] ], - [ [ $q1LabelEn, $q1Label, $q2Description, $q1All ], [ $q1Label, $q1All, $q2Description ] ], - [ [ $q1LabelEn, $q2Label, $q1Statement ], [ $q1LabelEn, $q1Statement, $q2Label ] ], - [ [ $q2DescriptionFa, $q2Description, $q1All ], [ $q2Description, $q1All ] ], + [ + [ $q1LabelEn, $q1Label ], + [ $q1Label ] + ], + [ + [ $q1LabelEn ], + [ $q1LabelEn ] + ], + [ + [ $q1Label, $q1LabelEn, $q2Description, $q1All ], + [ $q1Label, $q2Description, $q1All ] + ], + [ + [ $q1LabelEn, $q2Label, $q1Statement ], + [ $q1LabelEn, $q2Label, $q1Statement ] + ], + [ + [ $q2Description, $q2DescriptionFa, $q1All ], + [ $q2Description, $q1All ] + ], ]; } /** -* @covers \Wikibase\Client\Usage\UsageDeduplicator::deduplicate * @dataProvider provideDeduplicate +* @param EntityUsage[] $usages +* @param EntityUsage[] $output */ - public function testDeduplicate( $usages, $output ) { + public function testDeduplicate( array $usages, array $output ) { $expected = []; foreach ( $output as $usage ) { $expected[$usage->getIdentityString()] = $usage; -- To view, visit https://gerrit.wikimedia.org/r/405895 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I72fe1aeb3df2d36f322e6579994584f88aa0e4a8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Kreuz (WMDE) Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Lucas Werkmeister (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Don’t use NewStatement to build standalone snaks
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405897 ) Change subject: Don’t use NewStatement to build standalone snaks .. Don’t use NewStatement to build standalone snaks Using NewStatement::…->build()->getMainSnak() just to construct a Snak is a cute trick, sure, but it’s actually longer than just constructing the PropertyId and Snak objects directly :) Bug: T168240 Change-Id: I67bcadf917073b7619bd90cdbfe0e3cb6a06ae1f --- M tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php M tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php M tests/phpunit/Context/QualifierContextTest.php M tests/phpunit/Context/ReferenceContextTest.php 4 files changed, 43 insertions(+), 36 deletions(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php b/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php index 683b37d..0b71096 100644 --- a/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php +++ b/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php @@ -2,7 +2,10 @@ namespace WikibaseQuality\ConstraintReport\Test\ValueCountChecker; +use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Reference; +use Wikibase\DataModel\Snak\PropertyNoValueSnak; +use Wikibase\DataModel\Snak\PropertySomeValueSnak; use Wikibase\Repo\Tests\NewItem; use Wikibase\Repo\Tests\NewStatement; use WikibaseQuality\ConstraintReport\Constraint; @@ -78,8 +81,8 @@ } public function testMultiValueConstraint_One_Qualifier() { - $qualifier1 = NewStatement::noValueFor( 'P1' )->build()->getMainSnak(); - $qualifier2 = NewStatement::noValueFor( 'P2' )->build()->getMainSnak(); + $qualifier1 = new PropertyNoValueSnak( new PropertyId( 'P1' ) ); + $qualifier2 = new PropertyNoValueSnak( new PropertyId( 'P2' ) ); $statement = NewStatement::someValueFor( 'P10' )->build(); $statement->getQualifiers()->addSnak( $qualifier1 ); $statement->getQualifiers()->addSnak( $qualifier2 ); @@ -94,8 +97,8 @@ } public function testMultiValueConstraint_Two_Reference() { - $referenceSnak1 = NewStatement::noValueFor( 'P1' )->build()->getMainSnak(); - $referenceSnak2 = NewStatement::someValueFor( 'P1' )->build()->getMainSnak(); + $referenceSnak1 = new PropertyNoValueSnak( new PropertyId( 'P1' ) ); + $referenceSnak2 = new PropertySomeValueSnak( new PropertyId( 'P1' ) ); $reference = new Reference( [ $referenceSnak1, $referenceSnak2 ] ); $statement = NewStatement::someValueFor( 'P10' )->build(); $statement->getReferences()->addReference( $reference ); diff --git a/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php b/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php index 6afd45d..4a0e53c 100644 --- a/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php +++ b/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php @@ -2,7 +2,10 @@ namespace WikibaseQuality\ConstraintReport\Test\ValueCountChecker; +use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Reference; +use Wikibase\DataModel\Snak\PropertyNoValueSnak; +use Wikibase\DataModel\Snak\PropertySomeValueSnak; use Wikibase\Repo\Tests\NewItem; use Wikibase\Repo\Tests\NewStatement; use WikibaseQuality\ConstraintReport\Constraint; @@ -78,8 +81,8 @@ } public function testSingleValueConstraint_One_Qualifier() { - $qualifier1 = NewStatement::noValueFor( 'P1' )->build()->getMainSnak(); - $qualifier2 = NewStatement::noValueFor( 'P2' )->build()->getMainSnak(); + $qualifier1 = new PropertyNoValueSnak( new PropertyId( 'P1' ) ); + $qualifier2 = new PropertyNoValueSnak( new PropertyId( 'P2' ) ); $statement = NewStatement::someValueFor( 'P10' )->build(); $statement->getQualifiers()->addSnak( $qualifier1 ); $statement->getQualifiers()->addSnak( $qualifier2 ); @@ -94,8 +97,8 @@ } public function testSingleValueConstraint_Two_Reference() { - $referenceSnak1 = NewStatement::noValueFor( 'P1' )->build()->getMainSnak(); - $referenceSnak2 = NewStatement::someValueFor( 'P1' )->build()->getMainSnak(); + $referenceSnak1 = new PropertyNoValueSnak( new PropertyId( 'P1' ) ); + $referenceSnak2 = new PropertySomeValueSnak( new PropertyId( 'P1' ) ); $reference = new Reference( [ $referenceSnak1, $referenceSnak2 ] ); $statement = NewStatement::someValueFor( 'P10' )->build(); $statement->getRe
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Expand ReferenceContextTest::testGetSnakGroup
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405893 ) Change subject: Expand ReferenceContextTest::testGetSnakGroup .. Expand ReferenceContextTest::testGetSnakGroup This expands the test for ReferenceContext::getSnakGroup() to make sure that the function doesn’t look at qualifiers of the statement, or any any part of completely unrelated other statements. Previously, we only checked that the function didn’t look at other references. Bug: T168240 Change-Id: Idc7b6d44e10c4b0b9471f915474cd4d136daa4dc --- M tests/phpunit/Context/ReferenceContextTest.php 1 file changed, 16 insertions(+), 5 deletions(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/tests/phpunit/Context/ReferenceContextTest.php b/tests/phpunit/Context/ReferenceContextTest.php index 5d9ec29..2d25500 100644 --- a/tests/phpunit/Context/ReferenceContextTest.php +++ b/tests/phpunit/Context/ReferenceContextTest.php @@ -6,6 +6,8 @@ use Wikibase\DataModel\Reference; use Wikibase\DataModel\ReferenceList; use Wikibase\DataModel\Snak\PropertyNoValueSnak; +use Wikibase\DataModel\Snak\PropertySomeValueSnak; +use Wikibase\DataModel\Snak\SnakList; use Wikibase\DataModel\Statement\Statement; use Wikibase\Repo\Tests\NewItem; use Wikibase\Repo\Tests\NewStatement; @@ -85,17 +87,26 @@ public function testGetSnakGroup() { $referenceSnak1 = NewStatement::noValueFor( 'P100' )->build()->getMainSnak(); $referenceSnak2 = NewStatement::someValueFor( 'P200' )->build()->getMainSnak(); + $referenceSnak3 = NewStatement::noValueFor( 'P300' )->build()->getMainSnak(); + $referenceSnak4 = NewStatement::someValueFor( 'P400' )->build()->getMainSnak(); $reference1 = new Reference( [ $referenceSnak1, $referenceSnak2 ] ); - $reference2 = new Reference( [ new PropertyNoValueSnak( new PropertyId( 'P300' ) ) ] ); - $statement = new Statement( + $reference2 = new Reference( [ $referenceSnak3 ] ); + $reference3 = new Reference( [ $referenceSnak4 ] ); + $statement1 = new Statement( new PropertyNoValueSnak( new PropertyId( 'P1' ) ), - null, + /* qualifiers = */ new SnakList( [ $referenceSnak3 ] ), new ReferenceList( [ $reference1, $reference2 ] ) ); + $statement2 = new Statement( + new PropertySomeValueSnak( new PropertyId( 'P2' ) ), + null, + new ReferenceList( [ $reference2, $reference3 ] ) + ); $entity = NewItem::withId( 'Q1' ) - ->andStatement( $statement ) + ->andStatement( $statement1 ) + ->andStatement( $statement2 ) ->build(); - $context = new ReferenceContext( $entity, $statement, $reference1, $referenceSnak1 ); + $context = new ReferenceContext( $entity, $statement1, $reference1, $referenceSnak1 ); $snakGroup = $context->getSnakGroup(); -- To view, visit https://gerrit.wikimedia.org/r/405893 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idc7b6d44e10c4b0b9471f915474cd4d136daa4dc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Thiemo Kreuz (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityExternalValidation[master]: Update Coveralls URLs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406024 ) Change subject: Update Coveralls URLs .. Update Coveralls URLs See WikibaseQualityConstraints commit d5c47c137f (change I64bc71d98e). (Coveralls isn’t currently enabled for this project, but updating the URLs doesn’t hurt, either.) Also fixes the missing trailing newline. Change-Id: I33b8798c8a4957d33648b18de5930eb1790f19a9 --- M README.md 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: jenkins-bot: Verified Thiemo Kreuz (WMDE): Looks good to me, approved diff --git a/README.md b/README.md index d8ff63b..e7311f4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Wikibase Quality External Validation [![Build Status](https://travis-ci.org/wikimedia/mediawiki-extensions-WikibaseQualityExternalValidation.svg?branch=master)] (https://travis-ci.org/wikimedia/mediawiki-extensions-WikibaseQualityExternalValidation) -[![Coverage Status](https://coveralls.io/repos/wikimedia/mediawiki-extensions-WikibaseQualityExternalValidation/badge.svg)] -(https://coveralls.io/r/wikimedia/mediawiki-extensions-WikibaseQualityExternalValidation) +[![Coverage Status](https://coveralls.io/repos/github/wikimedia/mediawiki-extensions-WikibaseQualityExternalValidation/badge.svg)] +(https://coveralls.io/github/wikimedia/mediawiki-extensions-WikibaseQualityExternalValidation) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-WikibaseQualityExternalValidation/badges/quality-score.png?b=master)] (https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-WikibaseQualityExternalValidation/?branch=master) @@ -53,4 +53,4 @@ * Last but not least, you need to fill the tables that contain external data - for that you need the [dump converter script](https://github.com/WikidataQuality/DumpConverter). Follow the instruction in the README to create a tar file (that contains a number of csv files). -Run `php maintenance/runScript.php extensions/ExternalValidation/maintenance/UpdateExternalData.php --tar-file `. \ No newline at end of file +Run `php maintenance/runScript.php extensions/ExternalValidation/maintenance/UpdateExternalData.php --tar-file `. -- To view, visit https://gerrit.wikimedia.org/r/406024 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33b8798c8a4957d33648b18de5930eb1790f19a9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Thiemo Kreuz (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: Hook/SkinTemplateOutputPageBeforeExec: 2 new functions to ap...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405862 ) Change subject: Hook/SkinTemplateOutputPageBeforeExec: 2 new functions to append/merge .. Hook/SkinTemplateOutputPageBeforeExec: 2 new functions to append/merge fields in $template->data array These fiels are used to provide data for BlueSpiceSkin. The functions prevent notice if field is not definded before setting an value. Change-Id: Ic4e235be04d65edfe99f544b44e6fef671a35e40 --- M src/Hook/SkinTemplateOutputPageBeforeExec.php 1 file changed, 28 insertions(+), 0 deletions(-) Approvals: Pwirth: Looks good to me, approved jenkins-bot: Verified diff --git a/src/Hook/SkinTemplateOutputPageBeforeExec.php b/src/Hook/SkinTemplateOutputPageBeforeExec.php index 3cee34b..649f60d 100644 --- a/src/Hook/SkinTemplateOutputPageBeforeExec.php +++ b/src/Hook/SkinTemplateOutputPageBeforeExec.php @@ -71,4 +71,32 @@ $this->skin = $skin; $this->template = &$template; } + + + /** +* +* @param string $fieldName +* @param array $item +*/ + protected function mergeSkinDataArray( $fieldName, $item ) { + if( !isset( $this->template->data[$fieldName] ) ) { + $this->template->data[$fieldName] = []; + } + + $this->template->data[$fieldName] = array_merge( $this->template->data[$fieldName], $item ); + } + + /** +* +* @param string $fieldName +* @param array $item +*/ + protected function appendSkinDataArray( $fieldName, $item ) { + if( !isset( $this->template->data[$fieldName] ) ) { + $this->template->data[$fieldName] = []; + } + + $this->template->data[$fieldName][] = $item; + } + } \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/405862 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic4e235be04d65edfe99f544b44e6fef671a35e40 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Dvogel hallowelt Gerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: Robert Vogel Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: CommentNode: Protect against call after teardown
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406013 ) Change subject: CommentNode: Protect against call after teardown .. CommentNode: Protect against call after teardown Change-Id: I276cc64e522556f482f9fc7d0bb43f32d521defa --- M src/ce/nodes/ve.ce.CommentNode.js 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Divec: Looks good to me, approved jenkins-bot: Verified diff --git a/src/ce/nodes/ve.ce.CommentNode.js b/src/ce/nodes/ve.ce.CommentNode.js index 210a931..a2030e3 100644 --- a/src/ce/nodes/ve.ce.CommentNode.js +++ b/src/ce/nodes/ve.ce.CommentNode.js @@ -95,7 +95,13 @@ * @inheritdoc */ ve.ce.CommentNode.prototype.createInvisibleIcon = function () { - var icon = new OO.ui.ButtonWidget( { + var icon; + // Check the node hasn't been destroyed, as this method is + // called after an rAF in ve.ce.FocusableNode + if ( !this.getModel() ) { + return; + } + icon = new OO.ui.ButtonWidget( { classes: [ 've-ce-focusableNode-invisibleIcon' ], framed: false, icon: this.constructor.static.iconWhenInvisible, -- To view, visit https://gerrit.wikimedia.org/r/406013 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I276cc64e522556f482f9fc7d0bb43f32d521defa Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders Gerrit-Reviewer: Divec 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...mobileapps[master]: Hygiene: fix diff tests
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406015 ) Change subject: Hygiene: fix diff tests .. Hygiene: fix diff tests mw-redirect classes were added to a few links. Change-Id: Ife970e33459b64e3af7175deb355d03fbdf838a8 --- M test/diff/results/page_formatted-enwiki-User%3ABSitzmann_(WMF)_MCS_Test_Frankenstein.json M test/diff/results/page_mobile-sections-enwiki-User%3ABSitzmann_(WMF)_MCS_Test_Frankenstein.json 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: jenkins-bot: Verified Mholloway: Looks good to me, approved diff --git "a/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json" "b/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json" index 3dc7cf4..11b309d 100644 --- "a/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json" +++ "b/test/diff/results/page_formatted-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json" @@ -82,14 +82,14 @@ }, { "id": 9, -"text": "\n\n\n\n\n\nAnvil of Crom (sample)\nhttps://upload.wikimedia.org/wikipedia/en/0/0d/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg\"; type=\"audio/ogg; codecs="vorbis"\" data-title=\"Original Ogg file (65 kbps)\" data-shorttitle=\"Ogg source\">https://upload.wikimedia.org/wikipedia/en/transcoded/0/0d/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg.mp3\"; type=\"audio/mpeg\" data-title=\"MP3\" data-shorttitle=\"MP3\">\n\nProblems playing this file? See media help.\n\n", +"text": "\n\n\n\n\n\nAnvil of Crom (sample)\nhttps://upload.wikimedia.org/wikipedia/en/0/0d/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg\"; type=\"audio/ogg; codecs="vorbis"\" data-title=\"Original Ogg file (65 kbps)\" data-shorttitle=\"Ogg source\">https://upload.wikimedia.org/wikipedia/en/transcoded/0/0d/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg.mp3\"; type=\"audio/mpeg\" data-title=\"MP3\" data-shorttitle=\"MP3\">\n\nProblems playing this file? See media help.\n\n", "toclevel": 1, "line": "Audio", "anchor": "Audio" }, { "id": 10, -"text": "\n\n\n\n\n\nThe Dilbert Principle\nhttps://upload.wikimedia.org/wikipedia/commons/6/6d/The_Dilbert_Principle.ogg\"; type=\"audio/ogg; codecs="vorbis"\" data-title=\"Original Ogg file (56 kbps)\" data-shorttitle=\"Ogg source\">https://upload.wikimedia.org/wikipedia/commons/transcoded/6/6d/The_Dilbert_Principle.ogg/The_Dilbert_Principle.ogg.mp3\"; type=\"audio/mpeg\" data-title=\"MP3\" data-shorttitle=\"MP3\">\n\nProblems playing this file? See media help.\n\n", +"text": "\n\n\n\n\n\nThe Dilbert Principle\nhttps://upload.wikimedia.org/wikipedia/commons/6/6d/The_Dilbert_Principle.ogg\"; type=\"audio/ogg; codecs="vorbis"\" data-title=\"Original Ogg file (56 kbps)\" data-shorttitle=\"Ogg source\">https://upload.wikimedia.org/wikipedia/commons/transcoded/6/6d/The_Dilbert_Principle.ogg/The_Dilbert_Principle.ogg.mp3\"; type=\"audio/mpeg\" data-title=\"MP3\" data-shorttitle=\"MP3\">\n\nProblems playing this file? See media help.\n\n", "toclevel": 1, "line": "Spoken Wikipedia", "anchor": "Spoken_Wikipedia" diff --git "a/test/diff/results/page_mobile-sections-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json" "b/test/diff/results/page_mobile-sections-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json" index 3cd4804..b7fc1cf 100644 --- "a/test/diff/results/page_mobile-sections-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json" +++ "b/test/diff/results/page_mobile-sections-enwiki-User%3ABSitzmann_\050WMF\051_MCS_Test_Frankenstein.json" @@ -236,14 +236,14 @@ }, { "id": 9, -"text": "\n\n\n\n\n\nAnvil of Crom (sample)\nhttps://upload.wikimedia.org/wikipedia/en/0/0d/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg\"; type=\"audio/ogg; codecs="vorbis"\" data-title=\"Original Ogg file (65 kbps)\" data-shorttitle=\"Ogg source\">https://upload.wikimedia.org/wikipedia/en/transcoded/0/0d/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg.mp3\"; type=\"audio/mpeg\" data-title=\"MP3\" data-shorttitle=\"MP3\">\n\nProblems playing this file? See media help.\n\n", +"text": "\n\n\n\n\n\nAnvil of Crom (sample)\nhttps://upload.wikimedia.org/wikipedia/en/0/0d/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg\"; type=\"audio/ogg; codecs="vorbis"\" data-title=\"Original Ogg file (65 kbps)\" data-shorttitle=\"Ogg source\">https://upload.wikimedia.org/wikipedia/en/transcoded/0/0d/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg/Anvil_of_Crom_%28sample%29_by_Basil_Poledouris.ogg.mp3\
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Hygiene: fix jsdoc in extractLeadIntroduction
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405351 ) Change subject: Hygiene: fix jsdoc in extractLeadIntroduction .. Hygiene: fix jsdoc in extractLeadIntroduction Change-Id: I1268821bfcf65470202ca76ff21143236772f63a --- M lib/transformations/extractLeadIntroduction.js 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: jenkins-bot: Verified Mholloway: Looks good to me, approved diff --git a/lib/transformations/extractLeadIntroduction.js b/lib/transformations/extractLeadIntroduction.js index 7661b2c..0157f73 100644 --- a/lib/transformations/extractLeadIntroduction.js +++ b/lib/transformations/extractLeadIntroduction.js @@ -3,22 +3,22 @@ const NodeType = require('../nodeType'); const _ = require('underscore'); -/* +/** * Check whether a node has any content. - * @param {!DOMElement} node - * @return {!Boolean} whether the node is empty after all whitespace is stripped. + * @param {!Element} node + * @return {!boolean} whether the node is empty after all whitespace is stripped. */ function isEmpty(node) { return node.textContent.trim().length === 0; } -/* +/** * Extracts the first non-empty paragraph from an article and any * nodes that follow it that are not themselves paragraphs. * @param {!Document} doc representing article - * @param {Boolean} removeNodes when set the lead introduction will + * @param {boolean} removeNodes when set the lead introduction will * be removed from the input DOM tree. - * @return {String} representing article introduction + * @return {string} representing article introduction */ function extractLeadIntroduction(doc, removeNodes) { let p = ''; -- To view, visit https://gerrit.wikimedia.org/r/405351 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1268821bfcf65470202ca76ff21143236772f63a Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: BearND Gerrit-Reviewer: Fjalapeno Gerrit-Reviewer: Jdlrobson Gerrit-Reviewer: Mholloway Gerrit-Reviewer: Mhurd Gerrit-Reviewer: Ppchelko Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: rebaser: Only apply artificial delay to submitChange events
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405927 ) Change subject: rebaser: Only apply artificial delay to submitChange events .. rebaser: Only apply artificial delay to submitChange events For debugging, delaying welcomeNewClient and disconnect is unhelpful. Events without their own delay still wait for prior delayed events to complete. Change-Id: I259f0012a7c2ffe8f827d6547a195c0b08c46c65 --- M rebaser/server.js 1 file changed, 9 insertions(+), 5 deletions(-) Approvals: Esanders: Looks good to me, approved jenkins-bot: Verified diff --git a/rebaser/server.js b/rebaser/server.js index 2bf6280..d9bca0c 100644 --- a/rebaser/server.js +++ b/rebaser/server.js @@ -146,10 +146,13 @@ } ); } -function addStep( docName, generatorFunc ) { - var pending = Promise.resolve( pendingForDoc.get( docName ) ), - delayPromise = wait( artificialDelay ); - pending = Promise.all( [ pending, delayPromise ] ) +function addStep( docName, generatorFunc, addDelay ) { + var pending, + parallel = [ Promise.resolve( pendingForDoc.get( docName ) ) ]; + if ( addDelay && artificialDelay > 0 ) { + parallel.push( wait( artificialDelay ) ); + } + pending = Promise.all( parallel ) .then( function () { return ve.spawn( generatorFunc ); } ) @@ -165,7 +168,8 @@ }; function handleEvent( context, eventName, data ) { - addStep( context.docName, handlers[ eventName ]( context, data ) ); + var addDelay = eventName === 'submitChange'; + addStep( context.docName, handlers[ eventName ]( context, data ), addDelay ); } function makeConnectionHandler( docName ) { -- To view, visit https://gerrit.wikimedia.org/r/405927 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I259f0012a7c2ffe8f827d6547a195c0b08c46c65 Gerrit-PatchSet: 2 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Divec Gerrit-Reviewer: Esanders Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Failing test case for losing annotations
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405994 ) Change subject: Failing test case for losing annotations .. Failing test case for losing annotations Change-Id: I5ca3d475760e14f3ece788107f3a002a17729ec9 --- M src/dm/ve.dm.Change.js M tests/dm/ve.dm.RebaseServer.test.js 2 files changed, 124 insertions(+), 11 deletions(-) Approvals: Divec: Looks good to me, approved jenkins-bot: Verified diff --git a/src/dm/ve.dm.Change.js b/src/dm/ve.dm.Change.js index a582371..4d18362 100644 --- a/src/dm/ve.dm.Change.js +++ b/src/dm/ve.dm.Change.js @@ -690,21 +690,17 @@ /** * Remove change transactions from history * - * @param {ve.dm.Document} documentModel + * @param {ve.dm.Document} doc * @throws {Error} If this change does not end at the top of the history */ -ve.dm.Change.prototype.removeFromHistory = function ( documentModel ) { - var storeLength; - if ( this.start + this.getLength() !== documentModel.completeHistory.length ) { +ve.dm.Change.prototype.removeFromHistory = function ( doc ) { + if ( this.start + this.getLength() !== doc.completeHistory.length ) { throw new Error( 'this ends at ' + ( this.start + this.getLength() ) + - ' but history ends at ' + documentModel.completeHistory.length ); + ' but history ends at ' + doc.completeHistory.length ); } - documentModel.completeHistory.length -= this.transactions.length; - storeLength = documentModel.store.getLength(); - this.stores.forEach( function ( store ) { - storeLength -= store.getLength(); - } ); - documentModel.store.truncate( storeLength ); + doc.completeHistory.length -= this.transactions.length; + doc.storeLengthAtHistoryLength -= this.transactions.length; + doc.store.truncate( doc.storeLengthAtHistoryLength[ doc.completeHistory.length ] ); }; /** diff --git a/tests/dm/ve.dm.RebaseServer.test.js b/tests/dm/ve.dm.RebaseServer.test.js index aa6b9ec..637062e 100644 --- a/tests/dm/ve.dm.RebaseServer.test.js +++ b/tests/dm/ve.dm.RebaseServer.test.js @@ -282,6 +282,123 @@ [ '1', 'deliver' ], [ 'server', 'assertHist', 'abXYZ' ] ] + }, + { + name: 'Double client-side rebase with annotation and other preceding transaction', + initialData: [ + { type: 'paragraph' }, + { type: '/paragraph' }, + { type: 'internalList' }, + { type: '/internalList' } + ], + clients: [ '1', '2' ], + ops: [ + // Client 1 applies a local change that inserts 'Q' + [ '1', 'apply', [ + [ 'insert', 1, [ 'Q' ], 3 ] + ] ], + + // Client 2 submits two changes + [ '2', 'apply', [ + [ 'insert', 1, [ 'a' ], 3 ] + ] ], + [ '2', 'submit' ], + [ '2', 'apply', [ + [ 'insert', 2, [ 'b' ], 3 ] + ] ], + [ '2', 'submit' ], + + // Client 1 rebases its local change over client 2's first change + [ '2', 'deliver' ], + [ 'server', 'assertHist', 'a' ], + [ '1', 'receive' ], + [ '1', 'assertHist', 'a/Q!' ], + // Client 1 submits its local change + [ '1', 'submit' ], + + // Client 1 applies a local change that introduces an annotation + [ '1', 'apply', { + start: 1, + transactions: [ + { + operations: [ + { type: 'retain', length: 2 }, + { type: 'replace', remove: [], insert: [ +
[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [bugfix] Make transferbot.py use source interwiki in edit su...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405977 ) Change subject: [bugfix] Make transferbot.py use source interwiki in edit summary .. [bugfix] Make transferbot.py use source interwiki in edit summary Bug: T185603 Change-Id: I713eeb7cbd528faae2aa5ccb0bc5e98b7b4dea87 --- M scripts/transferbot.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved Zoranzoki21: Looks good to me, but someone else must approve diff --git a/scripts/transferbot.py b/scripts/transferbot.py index 6b6f229..e727e64 100755 --- a/scripts/transferbot.py +++ b/scripts/transferbot.py @@ -134,7 +134,7 @@ 'gen_args': gen_args, 'prefix': prefix}) for page in gen: -summary = "Moved page from %s" % page.title(asLink=True) +summary = 'Moved page from %s' % page.title(asLink=True, insite=tosite) targetpage = pywikibot.Page(tosite, prefix + page.title()) edithistpage = pywikibot.Page(tosite, prefix + page.title() + '/edithistory') -- To view, visit https://gerrit.wikimedia.org/r/405977 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I713eeb7cbd528faae2aa5ccb0bc5e98b7b4dea87 Gerrit-PatchSet: 3 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Dvorapa Gerrit-Reviewer: Dalba Gerrit-Reviewer: Framawiki Gerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Xqt Gerrit-Reviewer: Zoranzoki21 Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Revert "Add vcr cassettes for some classes in wikibase_tests...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406010 ) Change subject: Revert "Add vcr cassettes for some classes in wikibase_tests.py" .. Revert "Add vcr cassettes for some classes in wikibase_tests.py" Wikidata job is failing on travis-ci: https://travis-ci.org/wikimedia/pywikibot/jobs/332124662 This reverts commit 7bc840c690aff853b4e109b924b18f3d953ecf2c. Change-Id: I19926f79dba6ce358764195380e3c8000eebf89b --- D tests/cassettes/wikidata.wikidata/TestNamespaces.test_empty_wikibase_page.yaml D tests/cassettes/wikidata.wikidata/TestNamespaces.test_item_unknown_namespace.yaml D tests/cassettes/wikidata.wikidata/TestNamespaces.test_wikibase_namespace_selection.yaml D tests/cassettes/wikidata.wikidata/TestRedirects.test_normal_item.yaml D tests/cassettes/wikidata.wikidata/TestRedirects.test_redirect_item.yaml D tests/cassettes/wikipedia.af/TestLinks.test_iterlinks_filtering.yaml M tests/wikibase_tests.py 7 files changed, 0 insertions(+), 2,363 deletions(-) Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/406010 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I19926f79dba6ce358764195380e3c8000eebf89b Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Dalba Gerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Rafidaslam Gerrit-Reviewer: Xqt Gerrit-Reviewer: Zoranzoki21 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...Collection[master]: Add @covers tags
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406000 ) Change subject: Add @covers tags .. Add @covers tags Change-Id: I002484ea45adae69bd58be83b011831d89e8d5d8 --- M tests/phpunit/SpecialCollectionTest.php M tests/phpunit/includes/BookRendererTest.php M tests/phpunit/includes/DataProviderTest.php M tests/phpunit/includes/HeadingCounterTest.php 4 files changed, 16 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/SpecialCollectionTest.php b/tests/phpunit/SpecialCollectionTest.php index c84643c..33f9cb3 100644 --- a/tests/phpunit/SpecialCollectionTest.php +++ b/tests/phpunit/SpecialCollectionTest.php @@ -2,9 +2,14 @@ namespace MediaWiki\Extensions\Collection; +use MediaWikiCoversValidator; use SpecialCollection; +/** + * @covers SpecialCollection + */ class SpecialCollectionTest extends \PHPUnit_Framework_TestCase { + use MediaWikiCoversValidator; public function provideMoveItemInCollection() { return [ diff --git a/tests/phpunit/includes/BookRendererTest.php b/tests/phpunit/includes/BookRendererTest.php index a46d704..d50ccdb 100644 --- a/tests/phpunit/includes/BookRendererTest.php +++ b/tests/phpunit/includes/BookRendererTest.php @@ -7,6 +7,9 @@ use TemplateParser; use Title; +/** + * @covers \MediaWiki\Extensions\Collection\BookRenderer + */ class BookRendererTest extends MediaWikiTestCase { const TEMPLATE_DIR = '/../../../templates'; diff --git a/tests/phpunit/includes/DataProviderTest.php b/tests/phpunit/includes/DataProviderTest.php index 91dbddc..76b8e8a 100644 --- a/tests/phpunit/includes/DataProviderTest.php +++ b/tests/phpunit/includes/DataProviderTest.php @@ -7,6 +7,9 @@ use Title; use VirtualRESTServiceClient; +/** + * @covers \MediaWiki\Extensions\Collection\DataProvider + */ class DataProviderTest extends MediaWikiTestCase { /** diff --git a/tests/phpunit/includes/HeadingCounterTest.php b/tests/phpunit/includes/HeadingCounterTest.php index 917e537..fdb3718 100644 --- a/tests/phpunit/includes/HeadingCounterTest.php +++ b/tests/phpunit/includes/HeadingCounterTest.php @@ -3,8 +3,13 @@ namespace MediaWiki\Extensions\Collection; use LogicException; +use MediaWikiCoversValidator; +/** + * @covers \MediaWiki\Extensions\Collection\HeadingCounter + */ class HeadingCounterTest extends \PHPUnit_Framework_TestCase { + use MediaWikiCoversValidator; /** * @dataProvider provideIncrementAndGet -- To view, visit https://gerrit.wikimedia.org/r/406000 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I002484ea45adae69bd58be83b011831d89e8d5d8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: C. Scott Ananian Gerrit-Reviewer: Jforrester 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...Echo[master]: Add @covers tags
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406006 ) Change subject: Add @covers tags .. Add @covers tags Change-Id: Ib8cf432b58470c9218519639379c83254acef1c8 --- M tests/phpunit/AttributeManagerTest.php M tests/phpunit/BundlerTest.php M tests/phpunit/ContainmentSetTest.php M tests/phpunit/DiffParserTest.php M tests/phpunit/DiscussionParserTest.php M tests/phpunit/EchoDbFactoryTest.php M tests/phpunit/HooksTest.php M tests/phpunit/NotifUserTest.php M tests/phpunit/UserLocatorTest.php M tests/phpunit/api/ApiEchoMarkReadTest.php M tests/phpunit/api/ApiEchoNotificationsTest.php M tests/phpunit/cache/TitleLocalCacheTest.php M tests/phpunit/controller/NotificationControllerTest.php M tests/phpunit/gateway/UserNotificationGatewayTest.php M tests/phpunit/iterator/FilteredSequentialIteratorTest.php M tests/phpunit/maintenance/SupressionMaintenanceTest.php M tests/phpunit/mapper/AbstractMapperTest.php M tests/phpunit/mapper/EventMapperTest.php M tests/phpunit/mapper/NotificationMapperTest.php M tests/phpunit/mapper/TargetPageMapperTest.php M tests/phpunit/model/NotificationTest.php M tests/phpunit/model/TargetPageTest.php 22 files changed, 52 insertions(+), 3 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/AttributeManagerTest.php b/tests/phpunit/AttributeManagerTest.php index f9b0c93..25fd443 100644 --- a/tests/phpunit/AttributeManagerTest.php +++ b/tests/phpunit/AttributeManagerTest.php @@ -1,5 +1,8 @@ https://gerrit.wikimedia.org/r/406006 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8cf432b58470c9218519639379c83254acef1c8 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Legoktm 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] pywikibot/core[master]: [bugfix][TEST] cc: Get cleanUpSectionHeaders working with tabs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405539 ) Change subject: [bugfix][TEST] cc: Get cleanUpSectionHeaders working with tabs .. [bugfix][TEST] cc: Get cleanUpSectionHeaders working with tabs + limit heading level to MediaWiki's maximum of 6 + fix regex for headings containing equal sign + replace actual tab character in tests by escape sequence Bug: T185392 Change-Id: I0bafdf3db015d3bca7622219085307d524b51ee7 --- M pywikibot/cosmetic_changes.py M tests/cosmetic_changes_tests.py 2 files changed, 8 insertions(+), 2 deletions(-) Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py index 009eed5..a3dee44 100755 --- a/pywikibot/cosmetic_changes.py +++ b/pywikibot/cosmetic_changes.py @@ -649,7 +649,7 @@ return text return textlib.replaceExcept( text, -r'(?m)^(={1,7}) *(?P[^=]+?) *\1 *\r?\n', +r'(?m)^(={1,6})[ \t]*(?P.*[^\s=])[ \t]*\1[ \t]*\r?\n', r'\1 \g \1%s' % config.LS, ['comment', 'math', 'nowiki', 'pre']) diff --git a/tests/cosmetic_changes_tests.py b/tests/cosmetic_changes_tests.py index 6e22088..64c6a34 100644 --- a/tests/cosmetic_changes_tests.py +++ b/tests/cosmetic_changes_tests.py @@ -72,7 +72,7 @@ self.cct.removeUselessSpaces(' Foo bar ')) # tab self.assertEqual('Fo bar', - self.cct.removeUselessSpaces('Fo bar ')) + self.cct.removeUselessSpaces('Fo bar\t')) def test_removeNonBreakingSpaceBeforePercent(self): """Test removeNonBreakingSpaceBeforePercent method.""" @@ -83,6 +83,12 @@ """Test cleanUpSectionHeaders method.""" self.assertEqual('=== Header ===\n', self.cct.cleanUpSectionHeaders('===Header===\n')) +# tab +self.assertEqual('=== Header ===\n', + self.cct.cleanUpSectionHeaders('===Header===\t\n')) +# tabs inside +self.assertEqual('=== Header ===\n', + self.cct.cleanUpSectionHeaders('===\tHeader\t===\n')) def test_putSpacesInLists(self): """Test putSpacesInLists method.""" -- To view, visit https://gerrit.wikimedia.org/r/405539 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0bafdf3db015d3bca7622219085307d524b51ee7 Gerrit-PatchSet: 5 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Dvorapa Gerrit-Reviewer: Dalba Gerrit-Reviewer: Dvorapa Gerrit-Reviewer: Framawiki Gerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Magul Gerrit-Reviewer: TerraCodes Gerrit-Reviewer: Thiemo Kreuz (WMDE) Gerrit-Reviewer: Xqt Gerrit-Reviewer: Zoranzoki21 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]: Public API for the tempWikitextEditor
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405746 ) Change subject: Public API for the tempWikitextEditor .. Public API for the tempWikitextEditor Allows users to know when the widget has been constructed, and access it (e.g. to set an initial selection) Bug: T185279 Change-Id: I3678996bcf644cc889dd168ac3ce48b5c3633ec1 --- M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: DLynch: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js index 7ca66e2..0119981 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js @@ -137,6 +137,8 @@ // but hopefully this temporary textarea won't be visible for too long. tempWikitextEditor.adjustSize().moveCursorToStart(); ve.track( 'mwedit.ready', { mode: 'source' } ); + mw.libs.ve.tempWikitextEditor = tempWikitextEditor; + mw.hook( 've.wikitextInteractive' ).fire(); } function syncTempWikitextEditor() { @@ -161,7 +163,7 @@ function teardownTempWikitextEditor() { // Destroy widget and placeholder tempWikitextEditor.$element.remove(); - tempWikitextEditor = null; + mw.libs.ve.tempWikitextEditor = tempWikitextEditor = null; tempWikitextEditorData = null; $toolbarPlaceholder.remove(); $toolbarPlaceholder = null; @@ -392,6 +394,8 @@ if ( mode === 'visual' ) { // 'mwedit.ready' has already been fired for source mode in setupTempWikitextEditor ve.track( 'mwedit.ready', { mode: mode } ); + } else if ( !tempWikitextEditor ) { + mw.hook( 've.wikitextInteractive' ).fire(); } ve.track( 'mwedit.loaded', { mode: mode } ); } ) -- To view, visit https://gerrit.wikimedia.org/r/405746 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3678996bcf644cc889dd168ac3ce48b5c3633ec1 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders Gerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: DLynch 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]: Sync tempWikitextEditor just before building target, not on ...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405943 ) Change subject: Sync tempWikitextEditor just before building target, not on every change .. Sync tempWikitextEditor just before building target, not on every change Also ensure tempWikitextEditor is always torn down, even if target setup fails. Change-Id: Idc30a9dc00491b8c85353d73cb9ff70afea1d51c --- M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js M modules/ve-mw/init/ve.init.mw.ArticleTarget.js M modules/ve-mw/init/ve.init.mw.TempWikitextEditorWidget.js 4 files changed, 47 insertions(+), 26 deletions(-) Approvals: DLynch: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js index d9f9d40..7ca66e2 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js @@ -21,7 +21,7 @@ var conf, tabMessages, uri, pageExists, viewUri, veEditUri, veEditSourceUri, isViewPage, isEditPage, pageCanLoadEditor, init, targetPromise, enable, tempdisable, autodisable, tabPreference, enabledForUser, initialWikitext, oldId, - isLoading, tempWikitextEditor, $toolbarPlaceholder, + isLoading, tempWikitextEditor, tempWikitextEditorData, $toolbarPlaceholder, editModes = { edit: 'visual' }, @@ -101,24 +101,20 @@ init.$loading.detach(); } if ( tempWikitextEditor ) { - // eslint-disable-next-line no-use-before-define - ve.init.target.toolbarSetupDeferred.then( teardownTempWikitextEditor ); + if ( ve.init && ve.init.target ) { + // eslint-disable-next-line no-use-before-define + ve.init.target.toolbarSetupDeferred.then( teardownTempWikitextEditor ); + } else { + // Target didn't get created. Teardown editor anyway. + // eslint-disable-next-line no-use-before-define + teardownTempWikitextEditor(); + } } } function setupTempWikitextEditor( data ) { - tempWikitextEditor = new mw.libs.ve.MWTempWikitextEditorWidget( { - value: data.content, - onChange: function () { - // Write changes back to response data object, - // which will be used to construct the surface. - data.content = tempWikitextEditor.getValue(); - // TODO: Consider writing changes using a - // transaction so they can be undone. - // For now, just mark surface as pre-modified - data.fromEditedState = true; - } - } ); + tempWikitextEditor = new mw.libs.ve.MWTempWikitextEditorWidget( { value: data.content } ); + tempWikitextEditorData = data; // Create an equal-height placeholder for the toolbar to avoid vertical jump // when the real toolbar is ready. @@ -143,18 +139,30 @@ ve.track( 'mwedit.ready', { mode: 'source' } ); } + function syncTempWikitextEditor() { + var newContent = tempWikitextEditor.getValue(); + + if ( newContent !== tempWikitextEditorData.content ) { + // Write changes back to response data object, + // which will be used to construct the surface. + tempWikitextEditorData.content = newContent; + // TODO: Consider writing changes using a + // transaction so they can be undone. + // For now, just mark surface as pre-modified + tempWikitextEditorData.fromEditedState = true; + } + + // Store the last-seen selection and pass to the target + tempWikitextEditorData.initialSourceRange = tempWikitextEditor.getRange(); + + tempWikitextEditor.$element.prop( 'readonly', true ); + } + function teardownTempWikitextEditor() { - var range, - nativeRange = tempWikitextEditor.getRange(), - surfaceModel = ve.init.target.getSurface().getModel(); - - // Transfer the last-seen selection to the VE surface -
[MediaWiki-commits] [Gerrit] mediawiki...ConfirmEdit[master]: Add @covers tags
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406002 ) Change subject: Add @covers tags .. Add @covers tags Change-Id: I1e99261acb13c86e96c1b2dd1cb61918ebc660c2 --- M tests/phpunit/CaptchaAuthenticationRequestTest.php M tests/phpunit/CaptchaPreAuthenticationProviderTest.php M tests/phpunit/HTMLFancyCaptchaFieldTest.php M tests/phpunit/HTMLReCaptchaFieldTest.php M tests/phpunit/HTMLReCaptchaNoCaptchaFieldTest.php M tests/phpunit/HTMLSubmittedValueFieldTest.php M tests/phpunit/QuestyCaptchaTest.php M tests/phpunit/ReCaptchaAuthenticationRequestTest.php M tests/phpunit/ReCaptchaNoCaptchaAuthenticationRequestTest.php M tests/phpunit/SimpleCaptcha/CaptchaTest.php 10 files changed, 28 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/CaptchaAuthenticationRequestTest.php b/tests/phpunit/CaptchaAuthenticationRequestTest.php index 31f8ab0..380716f 100644 --- a/tests/phpunit/CaptchaAuthenticationRequestTest.php +++ b/tests/phpunit/CaptchaAuthenticationRequestTest.php @@ -2,6 +2,9 @@ use MediaWiki\Auth\AuthenticationRequestTestCase; +/** + * @covers CaptchaAuthenticationRequest + */ class CaptchaAuthenticationRequestTest extends AuthenticationRequestTestCase { public function setUp() { parent::setUp(); diff --git a/tests/phpunit/CaptchaPreAuthenticationProviderTest.php b/tests/phpunit/CaptchaPreAuthenticationProviderTest.php index eb06f5a..8e56c36 100644 --- a/tests/phpunit/CaptchaPreAuthenticationProviderTest.php +++ b/tests/phpunit/CaptchaPreAuthenticationProviderTest.php @@ -5,6 +5,7 @@ use Wikimedia\TestingAccessWrapper; /** + * @covers CaptchaPreAuthenticationProvider * @group Database */ class CaptchaPreAuthenticationProviderTest extends MediaWikiTestCase { diff --git a/tests/phpunit/HTMLFancyCaptchaFieldTest.php b/tests/phpunit/HTMLFancyCaptchaFieldTest.php index 9c3bbe3..37fa727 100644 --- a/tests/phpunit/HTMLFancyCaptchaFieldTest.php +++ b/tests/phpunit/HTMLFancyCaptchaFieldTest.php @@ -2,6 +2,9 @@ require_once __DIR__ . '/../../FancyCaptcha/HTMLFancyCaptchaField.php'; +/** + * @covers HTMLFancyCaptchaField + */ class HTMLFancyCaptchaFieldTest extends PHPUnit_Framework_TestCase { public function testGetHTML() { $html = $this->getForm( [ 'imageUrl' => 'https://example.com/' ] )->getHTML( false ); diff --git a/tests/phpunit/HTMLReCaptchaFieldTest.php b/tests/phpunit/HTMLReCaptchaFieldTest.php index 0ec600f..0754cd7 100644 --- a/tests/phpunit/HTMLReCaptchaFieldTest.php +++ b/tests/phpunit/HTMLReCaptchaFieldTest.php @@ -2,6 +2,9 @@ require_once __DIR__ . '/../../ReCaptcha/HTMLReCaptchaField.php'; +/** + * @covers HTMLReCaptchaField + */ class HTMLReCaptchaFieldTest extends PHPUnit_Framework_TestCase { public function testSubmit() { $form = new HTMLForm( [ diff --git a/tests/phpunit/HTMLReCaptchaNoCaptchaFieldTest.php b/tests/phpunit/HTMLReCaptchaNoCaptchaFieldTest.php index 206f8fa..cc14e36 100644 --- a/tests/phpunit/HTMLReCaptchaNoCaptchaFieldTest.php +++ b/tests/phpunit/HTMLReCaptchaNoCaptchaFieldTest.php @@ -2,6 +2,9 @@ require_once __DIR__ . '/../../ReCaptchaNoCaptcha/HTMLReCaptchaNoCaptchaField.php'; +/** + * @covers HTMLReCaptchaNoCaptchaField + */ class HTMLReCaptchaNoCaptchaFieldTest extends PHPUnit_Framework_TestCase { public function testSubmit() { $form = new HTMLForm( [ diff --git a/tests/phpunit/HTMLSubmittedValueFieldTest.php b/tests/phpunit/HTMLSubmittedValueFieldTest.php index 8fa114c..4029a8c 100644 --- a/tests/phpunit/HTMLSubmittedValueFieldTest.php +++ b/tests/phpunit/HTMLSubmittedValueFieldTest.php @@ -2,6 +2,9 @@ require_once __DIR__ . '/../../ReCaptcha/HTMLSubmittedValueField.php'; +/** + * @covers HTMLSubmittedValueField + */ class HTMLSubmittedValueFieldTest extends PHPUnit_Framework_TestCase { public function testSubmit() { $form = new HTMLForm( [ diff --git a/tests/phpunit/QuestyCaptchaTest.php b/tests/phpunit/QuestyCaptchaTest.php index 5a9480a..e76469b 100644 --- a/tests/phpunit/QuestyCaptchaTest.php +++ b/tests/phpunit/QuestyCaptchaTest.php @@ -1,5 +1,8 @@ https://gerrit.wikimedia.org/r/406002 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e99261acb13c86e96c1b2dd1cb61918ebc660c2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ConfirmEdit Gerrit-Branch: master Gerrit-Owner: Legoktm 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...EmailAuth[master]: Add @covers tags
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406007 ) Change subject: Add @covers tags .. Add @covers tags Change-Id: I563018db8baaeba1066537a42435df90d42eee3d --- M tests/phpunit/EmailAuthAuthenticationRequestTest.php M tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php 2 files changed, 6 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/EmailAuthAuthenticationRequestTest.php b/tests/phpunit/EmailAuthAuthenticationRequestTest.php index 82c8db8..2e0280f 100644 --- a/tests/phpunit/EmailAuthAuthenticationRequestTest.php +++ b/tests/phpunit/EmailAuthAuthenticationRequestTest.php @@ -4,6 +4,9 @@ use MediaWiki\Auth\AuthenticationRequestTestCase; +/** + * @covers \MediaWiki\Extensions\EmailAuth\EmailAuthAuthenticationRequest + */ class EmailAuthAuthenticationRequestTest extends AuthenticationRequestTestCase { protected function getInstance( array $args = [] ) { return new EmailAuthAuthenticationRequest(); diff --git a/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php b/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php index a237eba..5ef6f1d 100644 --- a/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php +++ b/tests/phpunit/EmailAuthSecondaryAuthenticationProviderTest.php @@ -12,6 +12,9 @@ use User; use Wikimedia\TestingAccessWrapper; +/** + * @covers \MediaWiki\Extensions\EmailAuth\EmailAuthSecondaryAuthenticationProvider + */ class EmailAuthSecondaryAuthenticationProviderTest extends MediaWikiTestCase { /** @var EmailAuthSecondaryAuthenticationProvider|PHPUnit_Framework_MockObject_MockObject */ protected $provider; -- To view, visit https://gerrit.wikimedia.org/r/406007 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I563018db8baaeba1066537a42435df90d42eee3d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EmailAuth Gerrit-Branch: master Gerrit-Owner: Legoktm 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...ExtensionDistributor[master]: Tweak @covers tags
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406008 ) Change subject: Tweak @covers tags .. Tweak @covers tags Change-Id: I0d83aa5b93696c21e0583f48cae5a494701690f4 --- M tests/phpunit/specials/SpecialExtensionDistributorTest.php M tests/phpunit/specials/SpecialSkinDistributorTest.php 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/specials/SpecialExtensionDistributorTest.php b/tests/phpunit/specials/SpecialExtensionDistributorTest.php index 2a4b28d..2e7cdb9 100644 --- a/tests/phpunit/specials/SpecialExtensionDistributorTest.php +++ b/tests/phpunit/specials/SpecialExtensionDistributorTest.php @@ -2,6 +2,7 @@ /** * @covers SpecialExtensionDistributor + * @covers SpecialBaseDistributor * * @group SpecialPage * diff --git a/tests/phpunit/specials/SpecialSkinDistributorTest.php b/tests/phpunit/specials/SpecialSkinDistributorTest.php index 698c459..7344359 100644 --- a/tests/phpunit/specials/SpecialSkinDistributorTest.php +++ b/tests/phpunit/specials/SpecialSkinDistributorTest.php @@ -2,6 +2,7 @@ /** * @covers SpecialSkinDistributor + * @covers SpecialBaseDistributor * * @group SpecialPage * -- To view, visit https://gerrit.wikimedia.org/r/406008 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0d83aa5b93696c21e0583f48cae5a494701690f4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ExtensionDistributor Gerrit-Branch: master Gerrit-Owner: Legoktm 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...ContentTranslation[master]: Add @covers tag
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406004 ) Change subject: Add @covers tag .. Add @covers tag Change-Id: Idd3ee3ad400854973933f80da5d0ff5e307aa1ea --- M tests/phpunit/DateManipulatorTest.php 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/DateManipulatorTest.php b/tests/phpunit/DateManipulatorTest.php index 4446104..db818a6 100644 --- a/tests/phpunit/DateManipulatorTest.php +++ b/tests/phpunit/DateManipulatorTest.php @@ -6,6 +6,9 @@ use ContentTranslation\DateManipulator; +/** + * @covers \ContentTranslation\DateManipulator + */ class DateManipulatorTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { $this->assertInstanceOf( -- To view, visit https://gerrit.wikimedia.org/r/406004 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idd3ee3ad400854973933f80da5d0ff5e307aa1ea Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Legoktm 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...CookieWarning[master]: Add @covers tag
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/406005 ) Change subject: Add @covers tag .. Add @covers tag Change-Id: Ie424a310f6a30c820cb692fa2ddcb25087868837 --- M tests/phpunit/includes/CookieWarning.hooksTest.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/includes/CookieWarning.hooksTest.php b/tests/phpunit/includes/CookieWarning.hooksTest.php index 115c3cc..e7e46af 100644 --- a/tests/phpunit/includes/CookieWarning.hooksTest.php +++ b/tests/phpunit/includes/CookieWarning.hooksTest.php @@ -1,5 +1,6 @@ https://gerrit.wikimedia.org/r/406005 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie424a310f6a30c820cb692fa2ddcb25087868837 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CookieWarning Gerrit-Branch: master Gerrit-Owner: Legoktm 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...CollaborationKit[master]: Add @covers tags
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405998 ) Change subject: Add @covers tags .. Add @covers tags Change-Id: I6301074db667e2ac12bb4954b813d55def939ea3 --- M tests/phpunit/CollaborationHubContentHandlerTest.php M tests/phpunit/CollaborationHubContentTest.php M tests/phpunit/CollaborationHubTOCTest.php M tests/phpunit/CollaborationKitImageTest.php M tests/phpunit/CollaborationListContentHandlerTest.php M tests/phpunit/CollaborationListContentTest.php 6 files changed, 18 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/CollaborationHubContentHandlerTest.php b/tests/phpunit/CollaborationHubContentHandlerTest.php index c3a93e1..6ef6889 100644 --- a/tests/phpunit/CollaborationHubContentHandlerTest.php +++ b/tests/phpunit/CollaborationHubContentHandlerTest.php @@ -2,6 +2,9 @@ use Wikimedia\TestingAccessWrapper; +/** + * @covers CollaborationHubContentHandler + */ class CollaborationHubContentHandlerTest extends MediaWikiTestCase { /** diff --git a/tests/phpunit/CollaborationHubContentTest.php b/tests/phpunit/CollaborationHubContentTest.php index bdd3cce..d0f3ee5 100644 --- a/tests/phpunit/CollaborationHubContentTest.php +++ b/tests/phpunit/CollaborationHubContentTest.php @@ -2,6 +2,9 @@ use Wikimedia\TestingAccessWrapper; +/** + * @covers CollaborationHubContent + */ class CollaborationHubContentTest extends MediaWikiTestCase { private $content; diff --git a/tests/phpunit/CollaborationHubTOCTest.php b/tests/phpunit/CollaborationHubTOCTest.php index 4751900..5bb5f7d 100644 --- a/tests/phpunit/CollaborationHubTOCTest.php +++ b/tests/phpunit/CollaborationHubTOCTest.php @@ -2,6 +2,9 @@ use Wikimedia\TestingAccessWrapper; +/** + * @covers CollaborationHubTOC + */ class CollaborationHubTOCTest extends MediaWikiTestCase { /** diff --git a/tests/phpunit/CollaborationKitImageTest.php b/tests/phpunit/CollaborationKitImageTest.php index 0e60e10..2f89644 100644 --- a/tests/phpunit/CollaborationKitImageTest.php +++ b/tests/phpunit/CollaborationKitImageTest.php @@ -2,6 +2,9 @@ use Wikimedia\TestingAccessWrapper; +/** + * @covers CollaborationKitImage + */ class CollaborationKitImageTest extends MediaWikiTestCase { private $str; diff --git a/tests/phpunit/CollaborationListContentHandlerTest.php b/tests/phpunit/CollaborationListContentHandlerTest.php index 9c4c03b..0c0dcd9 100644 --- a/tests/phpunit/CollaborationListContentHandlerTest.php +++ b/tests/phpunit/CollaborationListContentHandlerTest.php @@ -2,6 +2,9 @@ use Wikimedia\TestingAccessWrapper; +/** + * @covers CollaborationListContentHandler + */ class CollaborationListContentHandlerTest extends MediaWikiTestCase { /** diff --git a/tests/phpunit/CollaborationListContentTest.php b/tests/phpunit/CollaborationListContentTest.php index 15c1aeb..35111fc 100644 --- a/tests/phpunit/CollaborationListContentTest.php +++ b/tests/phpunit/CollaborationListContentTest.php @@ -2,6 +2,9 @@ use Wikimedia\TestingAccessWrapper; +/** + * @covers CollaborationListContent + */ class CollaborationListContentTest extends MediaWikiTestCase { private $content; -- To view, visit https://gerrit.wikimedia.org/r/405998 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6301074db667e2ac12bb4954b813d55def939ea3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: Legoktm 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...Thanks[master]: revthank: Clarify confirmation message and change yes/no mes...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405381 ) Change subject: revthank: Clarify confirmation message and change yes/no messages .. revthank: Clarify confirmation message and change yes/no messages Bug: T159302 Change-Id: I49ac7d644f207fe76a49efd650b727e33049b3af --- M extension.json M i18n/en.json M modules/ext.thanks.revthank.js 3 files changed, 4 insertions(+), 2 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/extension.json b/extension.json index 5e30b49..89dbae3 100644 --- a/extension.json +++ b/extension.json @@ -76,7 +76,7 @@ "thanks-confirmation2", "thanks-thank-tooltip-no", "thanks-thank-tooltip-yes", - "ok", + "thanks-button-thank", "cancel" ], "dependencies": [ diff --git a/i18n/en.json b/i18n/en.json index 80d8501..50464f4 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -22,7 +22,7 @@ "thanks-thank-tooltip": "{{GENDER:$1|Send}} a thank you notification to this {{GENDER:$2|user}}", "thanks-thank-tooltip-no": "{{GENDER:$1|Cancel}} the thank you notification", "thanks-thank-tooltip-yes": "{{GENDER:$1|Send}} the thank you notification", - "thanks-confirmation2": "{{GENDER:$1|Send}} public thanks for this edit?", + "thanks-confirmation2": "All thanks are public. {{GENDER:$1|Send}} thanks?", "thanks-thanked-notice": "{{GENDER:$3|You}} thanked $1 for {{GENDER:$2|his|her|their}} edit.", "thanks": "Send thanks", "thanks-submit": "Send thanks", diff --git a/modules/ext.thanks.revthank.js b/modules/ext.thanks.revthank.js index e577d28..cf4e5c3 100644 --- a/modules/ext.thanks.revthank.js +++ b/modules/ext.thanks.revthank.js @@ -64,7 +64,9 @@ $thankLink.confirmable( { i18n: { confirm: mw.msg( 'thanks-confirmation2', mw.user ), + no: mw.msg( 'cancel' ), noTitle: mw.msg( 'thanks-thank-tooltip-no', mw.user ), + yes: mw.msg( 'thanks-button-thank', mw.user, $thankLink.data( 'recipient-gender' ) ), yesTitle: mw.msg( 'thanks-thank-tooltip-yes', mw.user ) }, handler: function ( e ) { -- To view, visit https://gerrit.wikimedia.org/r/405381 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I49ac7d644f207fe76a49efd650b727e33049b3af Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Thanks Gerrit-Branch: master Gerrit-Owner: Catrope Gerrit-Reviewer: Catrope Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.31.0-wmf.17]: NWE: Don't attempt to set selection on unattached textarea
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405933 ) Change subject: NWE: Don't attempt to set selection on unattached textarea .. NWE: Don't attempt to set selection on unattached textarea Prevents an exception being thrown in Firefox <= 52. Bug: T185304 Change-Id: Ic9a43e3cf12d4cc566cebb328f8e807e464af634 (cherry picked from commit f2568c8d7db19b8ad594bbcff11194ed6e062677) --- M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js M modules/ve-mw/init/ve.init.mw.TempWikitextEditorWidget.js 2 files changed, 11 insertions(+), 1 deletion(-) Approvals: Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js index a737d41..832dadc 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js @@ -139,7 +139,8 @@ // Resize the textarea to fit content. We could do this more often (e.g. on change) // but hopefully this temporary textarea won't be visible for too long. - tempWikitextEditor.adjustSize().focus(); + // Support: Firefox =< 52 + tempWikitextEditor.adjustSize().moveCursorToStart(); ve.track( 'mwedit.ready', { mode: 'source' } ); } diff --git a/modules/ve-mw/init/ve.init.mw.TempWikitextEditorWidget.js b/modules/ve-mw/init/ve.init.mw.TempWikitextEditorWidget.js index 829ef78..5bc228c 100644 --- a/modules/ve-mw/init/ve.init.mw.TempWikitextEditorWidget.js +++ b/modules/ve-mw/init/ve.init.mw.TempWikitextEditorWidget.js @@ -34,9 +34,18 @@ } ) .val( config.value ) .on( 'input', config.onChange ); +}; +/** + * Focus the input and move the cursor to the start. + * + * @chainable + */ +mw.libs.ve.MWTempWikitextEditorWidget.prototype.moveCursorToStart = function () { // Move cursor to start this.$element[ 0 ].setSelectionRange( 0, 0 ); + this.focus(); + return this; }; /** -- To view, visit https://gerrit.wikimedia.org/r/405933 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic9a43e3cf12d4cc566cebb328f8e807e464af634 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: wmf/1.31.0-wmf.17 Gerrit-Owner: Jforrester Gerrit-Reviewer: Esanders Gerrit-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] mediawiki/vagrant[master]: MWMultiVersion: don't add --wiki is it's already present
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405976 ) Change subject: MWMultiVersion: don't add --wiki is it's already present .. MWMultiVersion: don't add --wiki is it's already present Otherwise, stuff like SiteConfiguration::getConfig() breaks Change-Id: I5d7a257e7e7875b87b529cf8c698de73cc807be6 --- M puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb b/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb index f8ecf8f..9b2db18 100644 --- a/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb +++ b/puppet/modules/mediawiki/templates/docroot/w/MWMultiVersion.php.erb @@ -186,8 +186,10 @@ global $IP; if ( strpos( $script, "{$IP}/" ) === 0 ) { $script = substr( $script, strlen( "{$IP}/" ) ); - $wiki = wfWikiId(); - array_unshift( $params, "--wiki=$wiki" ); + if ( strpos( $params[0], '--wiki' ) !== 0 ) { + $wiki = wfWikiId(); + array_unshift( $params, "--wiki=$wiki" ); + } $options['wrapper'] = __DIR__ . '/MWScript.php'; } return true; -- To view, visit https://gerrit.wikimedia.org/r/405976 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5d7a257e7e7875b87b529cf8c698de73cc807be6 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: MaxSem Gerrit-Reviewer: BryanDavis Gerrit-Reviewer: Dduvall 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]: Use jQuery 3 .catch( fn ) instead of .then( null, fn )
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405988 ) Change subject: Use jQuery 3 .catch( fn ) instead of .then( null, fn ) .. Use jQuery 3 .catch( fn ) instead of .then( null, fn ) Change-Id: I676eec0acf25690c2b2dd0b9a414be5fee887395 --- M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js index d9f9d40..48ea296 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js @@ -207,8 +207,7 @@ mw.libs.ve.targetLoader.addPlugin( function () { // Run VisualEditorPreloadModules, but if they fail, we still want to continue // loading, so convert failure to success - return mw.loader.using( conf.preloadModules ).then( - null, + return mw.loader.using( conf.preloadModules ).catch( function () { return $.Deferred().resolve(); } -- To view, visit https://gerrit.wikimedia.org/r/405988 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I676eec0acf25690c2b2dd0b9a414be5fee887395 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński 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...ArticleCreationWorkflow[master]: Add @covers tag
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405997 ) Change subject: Add @covers tag .. Add @covers tag Change-Id: I390ce3ee59e607c329249363d11cdde26c83a23c --- M tests/phpunit/WorkflowTest.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/WorkflowTest.php b/tests/phpunit/WorkflowTest.php index 9c79f19..ec20cd9 100644 --- a/tests/phpunit/WorkflowTest.php +++ b/tests/phpunit/WorkflowTest.php @@ -12,6 +12,7 @@ use User; /** + * @covers \ArticleCreationWorkflow\Workflow * @group ArticleCreationWorkflow */ class WorkflowTest extends MediaWikiTestCase { -- To view, visit https://gerrit.wikimedia.org/r/405997 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I390ce3ee59e607c329249363d11cdde26c83a23c Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/ArticleCreationWorkflow Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: Reedy 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...Thanks[master]: revthank: Embed gender of thanks recipients in the page
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405380 ) Change subject: revthank: Embed gender of thanks recipients in the page .. revthank: Embed gender of thanks recipients in the page That way we don't have to do an API request to get the gender, and we'll also be able to use gender-sensitive messages in the confirmation step. Bug: T159302 Change-Id: I9097bd976f8da1632577a3f4438b9f1186baca88 --- M Thanks.hooks.php M modules/ext.thanks.revthank.js 2 files changed, 8 insertions(+), 15 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/Thanks.hooks.php b/Thanks.hooks.php index a55c7fb..e325d98 100644 --- a/Thanks.hooks.php +++ b/Thanks.hooks.php @@ -113,6 +113,7 @@ 'href' => SpecialPage::getTitleFor( 'Thanks', $rev->getId() )->getFullURL(), 'title' => $tooltip, 'data-revision-id' => $rev->getId(), + 'data-recipient-gender' => $recipient->getOption( 'gender' ) ?: 'unknown', ], wfMessage( 'thanks-thank', $wgUser, $recipient->getName() )->text() ); diff --git a/modules/ext.thanks.revthank.js b/modules/ext.thanks.revthank.js index 872703d..e577d28 100644 --- a/modules/ext.thanks.revthank.js +++ b/modules/ext.thanks.revthank.js @@ -36,11 +36,9 @@ .then( // Success function () { - var username = $thankLink.closest( - source === 'history' ? 'li' : 'td' - ).find( 'a.mw-userlink' ).text(); - // Get the user who was thanked (for gender purposes) - return mw.thanks.getUserGender( username ); + $thankElement.before( mw.message( 'thanks-thanked', mw.user, $thankLink.data( 'recipient-gender' ) ).escaped() ); + $thankElement.remove(); + mw.thanks.thanked.push( $thankLink ); }, // Fail function ( errorCode ) { @@ -57,31 +55,25 @@ OO.ui.alert( mw.msg( 'thanks-error-undefined', errorCode ) ); } } - ) - .then( function ( recipientGender ) { - $thankElement.before( mw.message( 'thanks-thanked', mw.user, recipientGender ).escaped() ); - $thankElement.remove(); - mw.thanks.thanked.push( $thankLink ); - } ); + ); } function addActionToLinks( $content ) { + var $thankLink = $content.find( 'a.mw-thanks-thank-link' ); if ( mw.config.get( 'thanks-confirmation-required' ) ) { - $content.find( 'a.mw-thanks-thank-link' ).confirmable( { + $thankLink.confirmable( { i18n: { confirm: mw.msg( 'thanks-confirmation2', mw.user ), noTitle: mw.msg( 'thanks-thank-tooltip-no', mw.user ), yesTitle: mw.msg( 'thanks-thank-tooltip-yes', mw.user ) }, handler: function ( e ) { - var $thankLink = $( this ); e.preventDefault(); sendThanks( $thankLink, $thankLink.closest( '.jquery-confirmable-wrapper' ) ); } } ); } else { - $content.find( 'a.mw-thanks-thank-link' ).click( function ( e ) { - var $thankLink = $( this ); + $thankLink.click( function ( e ) { e.preventDefault(); sendThanks( $thankLink, $thankLink ); } ); -- To view, visit https://gerrit.wikimedia.org/r/405380 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9097bd976f8da1632577a3f4438b9f1186baca88 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Thanks Gerrit-Branch: master Gerrit-Owner: Catrope Gerrit-Reviewer: Catrope Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <>
[MediaWiki-commits] [Gerrit] mediawiki...TextExtracts[master]: Fix and add @covers tags
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405983 ) Change subject: Fix and add @covers tags .. Fix and add @covers tags Change-Id: Ifa11ee418e016c103fb0ac6b32a790a2977aec8d --- M tests/phpunit/ApiQueryExtractsTest.php M tests/phpunit/ExtractFormatterTest.php 2 files changed, 5 insertions(+), 1 deletion(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/ApiQueryExtractsTest.php b/tests/phpunit/ApiQueryExtractsTest.php index 6c8d317..ebebfcb 100644 --- a/tests/phpunit/ApiQueryExtractsTest.php +++ b/tests/phpunit/ApiQueryExtractsTest.php @@ -1,14 +1,17 @@ getMockBuilder( 'IContextSource' ) ->disableOriginalConstructor() diff --git a/tests/phpunit/ExtractFormatterTest.php b/tests/phpunit/ExtractFormatterTest.php index 60a8ef3..6c491cc 100644 --- a/tests/phpunit/ExtractFormatterTest.php +++ b/tests/phpunit/ExtractFormatterTest.php @@ -8,6 +8,7 @@ use TextExtracts\ExtractFormatter; /** + * @covers \TextExtracts\ExtractFormatter * @group TextExtracts */ class ExtractFormatterTest extends MediaWikiTestCase { -- To view, visit https://gerrit.wikimedia.org/r/405983 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifa11ee418e016c103fb0ac6b32a790a2977aec8d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TextExtracts Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Pmiazga 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...AdvancedSearch[master]: Add @covers tag
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405985 ) Change subject: Add @covers tag .. Add @covers tag Change-Id: Iffaf2b5be32fbf14bdbc785c90fb5dd5302906c7 --- M tests/phpunit/MimeTypeConfiguratorTest.php 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/MimeTypeConfiguratorTest.php b/tests/phpunit/MimeTypeConfiguratorTest.php index d8d02dd..be01c4a 100644 --- a/tests/phpunit/MimeTypeConfiguratorTest.php +++ b/tests/phpunit/MimeTypeConfiguratorTest.php @@ -6,6 +6,9 @@ use PHPUnit\Framework\TestCase; use PHPUnit_Framework_MockObject_MockObject; +/** + * @covers \AdvancedSearch\MimeTypeConfigurator + */ class MimeTypeConfiguratorTest extends TestCase { const EXT_SINGLE_MIMETYPE = 'singletype'; -- To view, visit https://gerrit.wikimedia.org/r/405985 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iffaf2b5be32fbf14bdbc785c90fb5dd5302906c7 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/AdvancedSearch Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: Addshore Gerrit-Reviewer: Andrew-WMDE Gerrit-Reviewer: Reedy Gerrit-Reviewer: Tobias Gritschacher Gerrit-Reviewer: WMDE-Fisch 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...TimedMediaHandler[master]: Update video.js to v6
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405088 ) Change subject: Update video.js to v6 .. Update video.js to v6 * update video.js to 6.6.0 * switched from videojs-resolution-switcher to videojs-resolution-switcher-v6 * res switcher icon is still broken, but switching works * removed videojs-replay, video.js natively does this now * updated volume config * patched videojs-ogvjs to fix WebM support * hack WebAssembly off for iOS 11.2.2 * patched videojs-responsive-layout for IE 11 and VJS 6 * fixed spacing for JS checks Bug: T165815 Change-Id: I6a0a45e4b84c72fb8535ee86a71221f68284aefd --- M Gruntfile.js M TimedMediaHandlerHooks.php M package.json A patches/videojs-ogvjs-webm.patch A patches/videojs-responsive-classes.patch A patches/videojs-responsive-layout-ie11.patch D patches/videojs.defaults.patch M resources/ext.tmh.player.js M resources/mw-info-button/mw-info-button.js M resources/videojs-ogvjs/videojs-ogvjs.js D resources/videojs-replay/lang/en.js D resources/videojs-replay/videojs-replay.css D resources/videojs-replay/videojs-replay.js M resources/videojs-resolution-switcher/videojs-resolution-switcher.js M resources/videojs-responsive-layout/videojs-responsive-layout.js A resources/videojs-responsive-layout/videojs-responsive-layout.min.js M resources/videojs/font/VideoJS.eot M resources/videojs/font/VideoJS.svg M resources/videojs/font/VideoJS.ttf M resources/videojs/font/VideoJS.woff M resources/videojs/lang/ar.js M resources/videojs/lang/de.js M resources/videojs/lang/el.js M resources/videojs/lang/en.js M resources/videojs/lang/es.js M resources/videojs/lang/fa.js M resources/videojs/lang/fr.js A resources/videojs/lang/gl.js A resources/videojs/lang/he.js M resources/videojs/lang/nl.js M resources/videojs/lang/pl.js A resources/videojs/lang/pt-PT.js M resources/videojs/lang/ru.js A resources/videojs/lang/sk.js M resources/videojs/lang/tr.js M resources/videojs/lang/uk.js M resources/videojs/lang/vi.js M resources/videojs/lang/zh-CN.js M resources/videojs/lang/zh-TW.js M resources/videojs/video-js.css M resources/videojs/video-js.swf M resources/videojs/video.js 42 files changed, 23,959 insertions(+), 22,357 deletions(-) Approvals: jenkins-bot: Verified TheDJ: Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/405088 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6a0a45e4b84c72fb8535ee86a71221f68284aefd Gerrit-PatchSet: 8 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Brion VIBBER Gerrit-Reviewer: Brion VIBBER Gerrit-Reviewer: TheDJ Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] oojs/ui[master]: Toolbars: Replace $.width with clientWidth/offsetWidth
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405931 ) Change subject: Toolbars: Replace $.width with clientWidth/offsetWidth .. Toolbars: Replace $.width with clientWidth/offsetWidth Bug: T185599 Change-Id: I8f36244f1d605424594c1a61b5d107b3075213fa --- M src/Toolbar.js 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/src/Toolbar.js b/src/Toolbar.js index 7720b5d..559bc2a 100644 --- a/src/Toolbar.js +++ b/src/Toolbar.js @@ -388,7 +388,7 @@ OO.ui.Toolbar.prototype.onWindowResize = function () { this.$element.toggleClass( 'oo-ui-toolbar-narrow', - this.$bar.width() <= this.getNarrowThreshold() + this.$bar[ 0 ].clientWidth <= this.getNarrowThreshold() ); }; @@ -401,7 +401,7 @@ */ OO.ui.Toolbar.prototype.getNarrowThreshold = function () { if ( this.narrowThreshold === null ) { - this.narrowThreshold = this.$group.width() + this.$actions.width(); + this.narrowThreshold = this.$group[ 0 ].offsetWidth + this.$actions[ 0 ].offsetWidth; } return this.narrowThreshold; }; -- To view, visit https://gerrit.wikimedia.org/r/405931 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f36244f1d605424594c1a61b5d107b3075213fa Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Esanders Gerrit-Reviewer: Bartosz Dziewoński 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]: Add a hook into LanguageConverter#getPreferredVariant() to a...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/367326 ) Change subject: Add a hook into LanguageConverter#getPreferredVariant() to allow extensions to pull the desired variant from cookies (or other such source) .. Add a hook into LanguageConverter#getPreferredVariant() to allow extensions to pull the desired variant from cookies (or other such source) Example implementation using this hook: wikiHow's ChineseVariantSelector extension, installed on zh.wikihow.com, which uses cookies to store the preferred language variant, allowing anonymous users to change the language variant without registering/logging in. Change-Id: I5295a26578b45a8d51f2b7550938088fec18404f --- M docs/hooks.txt M languages/LanguageConverter.php 2 files changed, 9 insertions(+), 0 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/docs/hooks.txt b/docs/hooks.txt index 3ff3365..c21ce8a 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1662,6 +1662,13 @@ 'GetIP': modify the ip of the current user (called only once). &$ip: string holding the ip as determined so far +'GetLangPreferredVariant': Called in LanguageConverter#getPreferredVariant() to + allow fetching the language variant code from cookies or other such + alternative storage. +&$req: language variant from the URL (string) or boolean false if no variant + was specified in the URL; the value of this variable comes from + LanguageConverter#getURLVariant() + 'GetLinkColours': modify the CSS class of an array of page links. $linkcolour_ids: array of prefixed DB keys of the pages linked to, indexed by page_id. diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 6d0368c..d9e64b4 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -160,6 +160,8 @@ $req = $this->getURLVariant(); + Hooks::run( 'GetLangPreferredVariant', [ &$req ] ); + if ( $wgUser->isSafeToLoad() && $wgUser->isLoggedIn() && !$req ) { $req = $this->getUserVariant(); } elseif ( !$req ) { -- To view, visit https://gerrit.wikimedia.org/r/367326 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5295a26578b45a8d51f2b7550938088fec18404f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Jack Phoenix Gerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Brian Wolff Gerrit-Reviewer: C. Scott Ananian Gerrit-Reviewer: Liangent Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Toolbars: Replace $.height with clientHeight/offsetHeight
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405940 ) Change subject: Toolbars: Replace $.height with clientHeight/offsetHeight .. Toolbars: Replace $.height with clientHeight/offsetHeight Bug: T185599 Change-Id: I43fbce8f221553e9ae03f8385f39a19de01e8eb7 --- M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index 2b16d96..3f4fddf 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -256,7 +256,8 @@ } else { setTimeout( function () { toolbar.$element - .css( 'height', toolbar.$bar.outerHeight() ) + // Avoid $bar[ 0 ].offsetHeight as this returns null in IE9 when $bar is position:fixed + .css( 'height', toolbar.$bar[ 0 ].clientHeight ) .addClass( 've-init-mw-desktopArticleTarget-toolbar-open' ); setTimeout( function () { // Clear to allow growth during use and when resizing window @@ -1151,7 +1152,8 @@ return deferred.resolve().promise(); } - this.toolbar.$element.css( 'height', this.toolbar.$bar.outerHeight() ); + // Avoid $bar[ 0 ].offsetHeight as this returns null in IE9 when $bar is position:fixed + this.toolbar.$element.css( 'height', this.toolbar.$bar[ 0 ].clientHeight ); setTimeout( function () { target.toolbar.$element .css( 'height', '0' ) -- To view, visit https://gerrit.wikimedia.org/r/405940 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43fbce8f221553e9ae03f8385f39a19de01e8eb7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders Gerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Toolbars: Replace $.width with clientWidth/offsetWidth
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405934 ) Change subject: Toolbars: Replace $.width with clientWidth/offsetWidth .. Toolbars: Replace $.width with clientWidth/offsetWidth Bug: T185599 Change-Id: Id32e38f85eb11f4574ef72ce45df06dde43251b4 --- M src/ui/ve.ui.PositionedTargetToolbar.js 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/src/ui/ve.ui.PositionedTargetToolbar.js b/src/ui/ve.ui.PositionedTargetToolbar.js index 5cc557c..e429d43 100644 --- a/src/ui/ve.ui.PositionedTargetToolbar.js +++ b/src/ui/ve.ui.PositionedTargetToolbar.js @@ -104,7 +104,7 @@ */ ve.ui.PositionedTargetToolbar.prototype.calculateOffset = function () { this.elementOffset = this.$element.offset(); - this.elementOffset.right = this.$window.width() - this.$element.outerWidth() - this.elementOffset.left; + this.elementOffset.right = document.documentElement.clientWidth - this.$element[ 0 ].offsetWidth - this.elementOffset.left; }; /** @@ -133,7 +133,7 @@ */ ve.ui.PositionedTargetToolbar.prototype.float = function () { if ( !this.floating ) { - this.height = this.$element.height(); + this.height = this.$element[ 0 ].offsetHeight; // When switching into floating mode, set the height of the wrapper and // move the bar to the same offset as the in-flow element this.$element -- To view, visit https://gerrit.wikimedia.org/r/405934 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id32e38f85eb11f4574ef72ce45df06dde43251b4 Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders Gerrit-Reviewer: Bartosz Dziewoński 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]: Phan: resolve and reenable PhanAccessMethodProtected
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405908 ) Change subject: Phan: resolve and reenable PhanAccessMethodProtected .. Phan: resolve and reenable PhanAccessMethodProtected Change-Id: I2bd7c787012f4f54600f3289d9d0d725f87788bc --- M includes/Preferences.php M includes/libs/filebackend/FileBackendMultiWrite.php M includes/preferences/DefaultPreferencesFactory.php M tests/phan/config.php 4 files changed, 6 insertions(+), 3 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Preferences.php b/includes/Preferences.php index f08b155..f65b2ce 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -303,6 +303,8 @@ /** * Handle the form submission if everything validated properly * +* @deprecated since 1.31, use PreferencesFactory +* * @param array $formData * @param PreferencesForm $form * @return bool|Status|string diff --git a/includes/libs/filebackend/FileBackendMultiWrite.php b/includes/libs/filebackend/FileBackendMultiWrite.php index f8ca7e5..9c367af 100644 --- a/includes/libs/filebackend/FileBackendMultiWrite.php +++ b/includes/libs/filebackend/FileBackendMultiWrite.php @@ -87,6 +87,9 @@ * This will apply such updates post-send for web requests. Note that * any checks from "syncChecks" are still synchronous. * +* Bogus warning +* @suppress PhanAccessMethodProtected +* * @param array $config * @throws FileBackendError */ diff --git a/includes/preferences/DefaultPreferencesFactory.php b/includes/preferences/DefaultPreferencesFactory.php index 0391b30..a23d644 100644 --- a/includes/preferences/DefaultPreferencesFactory.php +++ b/includes/preferences/DefaultPreferencesFactory.php @@ -1617,7 +1617,7 @@ * @param PreferencesForm $form * @return bool|Status|string */ - protected function legacySaveFormData( $formData, PreferencesForm $form ) { + public function legacySaveFormData( $formData, PreferencesForm $form ) { return $this->saveFormData( $formData, $form ); } diff --git a/tests/phan/config.php b/tests/phan/config.php index 52a565c..84132b9 100644 --- a/tests/phan/config.php +++ b/tests/phan/config.php @@ -294,8 +294,6 @@ * to this black-list to inhibit them from being reported. */ 'suppress_issue_types' => [ - // approximate error count: 1 - "PhanAccessMethodProtected", // approximate error count: 29 "PhanCommentParamOnEmptyParamList", // approximate error count: 33 -- To view, visit https://gerrit.wikimedia.org/r/405908 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2bd7c787012f4f54600f3289d9d0d725f87788bc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: MaxSem Gerrit-Reviewer: Brian Wolff Gerrit-Reviewer: Samwilson 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/lucene-explain-parser[master]: Fix license to match https://spdx.org/licenses/
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405979 ) Change subject: Fix license to match https://spdx.org/licenses/ .. Fix license to match https://spdx.org/licenses/ Change-Id: I6b16a5ef4ea92bac830aa7c2269929b757f97c0d --- M composer.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Smalyshev: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.json b/composer.json index 5a01e7f..b4b0380 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "wikimedia/lucene-explain-parser", "description": "Parsing and pretty-printing Lucene explain data", "type": "library", -"license": "Apache 2.0", +"license": "Apache-2.0", "require": { "php": ">=5.5.9" }, "autoload": { "psr-4": { -- To view, visit https://gerrit.wikimedia.org/r/405979 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6b16a5ef4ea92bac830aa7c2269929b757f97c0d Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/lucene-explain-parser Gerrit-Branch: master Gerrit-Owner: Smalyshev Gerrit-Reviewer: Smalyshev Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Improve @covers tags
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405978 ) Change subject: Improve @covers tags .. Improve @covers tags Change-Id: I3df3698b5d3f3eae95db8c740c611f365ff9cb31 --- M tests/phpunit/parserTest.php 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/tests/phpunit/parserTest.php b/tests/phpunit/parserTest.php index d3b998e..7dd13a2 100644 --- a/tests/phpunit/parserTest.php +++ b/tests/phpunit/parserTest.php @@ -25,6 +25,12 @@ * @licence GNU GPL v2+ * @author Marius Hoch < h...@online.de > */ + +/** + * @covers AbuseFilterCachingParser + * @covers AbuseFilterParser + * @covers AbuseFilterTokenizer + */ class AbuseFilterParserTest extends MediaWikiTestCase { /** * @return AbuseFilterParser @@ -38,7 +44,7 @@ } /** -* @return [AbuseFilterParser] +* @return AbuseFilterParser[] */ static function getParsers() { static $parsers = null; -- To view, visit https://gerrit.wikimedia.org/r/405978 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3df3698b5d3f3eae95db8c740c611f365ff9cb31 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Legoktm Gerrit-Reviewer: Jackmcbarn 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] VisualEditor/VisualEditor[master]: ve.ui.DesktopContext: Remove unused CSS
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405936 ) Change subject: ve.ui.DesktopContext: Remove unused CSS .. ve.ui.DesktopContext: Remove unused CSS We don't use the CSS class .oo-ui-context-menu on anything. Change-Id: I9c2db64fe300f8104a509a79b3621253356e5f02 --- M src/ui/styles/ve.ui.DesktopContext.css 1 file changed, 0 insertions(+), 4 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/src/ui/styles/ve.ui.DesktopContext.css b/src/ui/styles/ve.ui.DesktopContext.css index bce557d..0b62f08 100644 --- a/src/ui/styles/ve.ui.DesktopContext.css +++ b/src/ui/styles/ve.ui.DesktopContext.css @@ -55,7 +55,3 @@ .ve-ui-surface-dir-rtl .ve-ui-desktopContext > .oo-ui-popupWidget:not( .oo-ui-popupWidget-anchored ) .oo-ui-popupWidget-popup { margin-left: 0.5em; } - -.ve-ui-desktopContext > .oo-ui-popupWidget:not( .oo-ui-popupWidget-anchored ) .oo-ui-context-menu { - right: 0; -} -- To view, visit https://gerrit.wikimedia.org/r/405936 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9c2db64fe300f8104a509a79b3621253356e5f02 Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński Gerrit-Reviewer: Bartosz Dziewoński 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...Flow[master]: Change "comment" to "post" in English messages
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/401747 ) Change subject: Change "comment" to "post" in English messages .. Change "comment" to "post" in English messages Bug: T144630 Change-Id: I02770a384e0d57c95a80cdf81290af66323ae3ab --- M i18n/en.json 1 file changed, 18 insertions(+), 18 deletions(-) Approvals: Sbisson: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index 7982702..5a53bb9 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -57,22 +57,22 @@ "flow-topic-collapse-siderail": "Read at full width", "flow-topic-expand-siderail": "Read at fixed width", "flow-edit-header-link": "Edit description", - "flow-post-moderated-toggle-hide-show": "Show comment {{GENDER:$1|hidden}} by $2", - "flow-post-moderated-toggle-delete-show": "Show comment {{GENDER:$1|deleted}} by $2", - "flow-post-moderated-toggle-suppress-show": "Show comment {{GENDER:$1|suppressed}} by $2", - "flow-post-moderated-toggle-hide-hide": "Hide comment {{GENDER:$1|hidden}} by $2", - "flow-post-moderated-toggle-delete-hide": "Hide comment {{GENDER:$1|deleted}} by $2", - "flow-post-moderated-toggle-suppress-hide": "Hide comment {{GENDER:$1|suppressed}} by $2", + "flow-post-moderated-toggle-hide-show": "Show post {{GENDER:$1|hidden}} by $2", + "flow-post-moderated-toggle-delete-show": "Show post {{GENDER:$1|deleted}} by $2", + "flow-post-moderated-toggle-suppress-show": "Show post {{GENDER:$1|suppressed}} by $2", + "flow-post-moderated-toggle-hide-hide": "Hide post {{GENDER:$1|hidden}} by $2", + "flow-post-moderated-toggle-delete-hide": "Hide post {{GENDER:$1|deleted}} by $2", + "flow-post-moderated-toggle-suppress-hide": "Hide post {{GENDER:$1|suppressed}} by $2", "flow-topic-moderated-reason-prefix": "Reason:", - "flow-hide-post-content": "This comment was {{GENDER:$1|hidden}} by $1 ([$2 history])", + "flow-hide-post-content": "This post was {{GENDER:$1|hidden}} by $1 ([$2 history])", "flow-hide-title-content": "This topic was {{GENDER:$1|hidden}} by $1", "flow-hide-header-content": "{{GENDER:$1|Hidden}} by $2", "flow-hide-usertext": "$1", - "flow-delete-post-content": "This comment was {{GENDER:$1|deleted}} by $1 ([$2 history])", + "flow-delete-post-content": "This post was {{GENDER:$1|deleted}} by $1 ([$2 history])", "flow-delete-title-content": "This topic was {{GENDER:$1|deleted}} by $1", "flow-delete-header-content": "{{GENDER:$1|Deleted}} by $2", "flow-delete-usertext": "$1", - "flow-suppress-post-content": "This comment was {{GENDER:$1|suppressed}} by $1 ([$2 history])", + "flow-suppress-post-content": "This post was {{GENDER:$1|suppressed}} by $1 ([$2 history])", "flow-suppress-title-content": "This topic was {{GENDER:$1|suppressed}} by $1", "flow-suppress-header-content": "{{GENDER:$1|Suppressed}} by $2", "flow-suppress-usertext": "Username suppressed", @@ -226,7 +226,7 @@ "flow-edit-title-submit-anonymously": "Change title anonymously", "flow-edit-post-submit": "Submit changes", "flow-edit-post-submit-anonymously": "Submit changes anonymously", - "flow-rev-message-edit-post": "$1 {{GENDER:$2|edited}} a [$3 comment] on \"$4\"", + "flow-rev-message-edit-post": "$1 {{GENDER:$2|edited}} a [$3 post] on \"$4\"", "flow-rev-message-edit-post-recentchanges": "$1", "flow-rev-message-edit-post-recentchanges-summary": "{{GENDER:$2|Edited}} a post", "flow-rev-message-edit-post-contributions": "", @@ -251,14 +251,14 @@ "flow-rev-message-create-topic-summary-irc": "$2 {{GENDER:$2|created}} topic summary on $3", "flow-rev-message-edit-topic-summary": "$1 {{GENDER:$2|edited}} topic summary on $3", "flow-rev-message-edit-topic-summary-irc": "$2 {{GENDER:$2|edited}} topic summary on $3", - "flow-rev-message-hid-post": "$1 {{GENDER:$2|hid}} a [$4 comment] on \"$6\" ($5)", - "flow-rev-message-hid-post-irc": "$2 {{GENDER:$2|hid}} a comment on \"$6\" ($5)", - "flow-rev-message-deleted-post": "$1 {{GENDER:$2|deleted}} a [$4 comment] on \"$6\" ($5)", - "flow-rev-message-deleted-post-irc": "$2 {{GENDER:$2|deleted}} a comment on \"$6\" ($5)", - "flow-rev-message-suppressed-post": "$1 {{GENDER:$2|suppressed}} a [$4 comment] on \"$6\" ($5)", - "flow-rev-message-suppressed-post-irc": "$2 {{GENDER:$2|suppressed}} a comment on \"$6\" ($5)", - "flow-rev-message-restored-post": "$1 {{GENDER:$2|restored}} a [$4 comment] on \"$6\" ($5)", - "flow-rev-message-restored-post-irc": "$2 {{GENDER:$2|restored}} a comment on \"$6\" ($5)", + "flow-rev-message-hid-post": "$1 {{GENDER:$2|hid}} a [$4 post] on \"$6\" ($5)", + "flow-
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove dot from summary used by fixDoubleRedirects.php
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405920 ) Change subject: Remove dot from summary used by fixDoubleRedirects.php .. Remove dot from summary used by fixDoubleRedirects.php Bug: T185592 Change-Id: Iae6ab7787fcf8150f738cf361c545c796ce84f16 --- M languages/i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 42ea35c..4cabfda 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1916,7 +1916,7 @@ "doubleredirects-summary": "", "doubleredirectstext": "This page lists pages that redirect to other redirect pages.\nEach row contains links to the first and second redirect, as well as the target of the second redirect, which is usually the \"real\" target page to which the first redirect should point.\nCrossed out entries have been solved.", "double-redirect-fixed-move": "[[$1]] has been moved.\nIt was automatically updated and now it redirects to [[$2]].", - "double-redirect-fixed-maintenance": "Automatically fixing double redirect from [[$1]] to [[$2]] in a maintenance job.", + "double-redirect-fixed-maintenance": "Automatically fixing double redirect from [[$1]] to [[$2]] in a maintenance job", "double-redirect-fixer": "Redirect fixer", "brokenredirects": "Broken redirects", "brokenredirects-summary": "", -- To view, visit https://gerrit.wikimedia.org/r/405920 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iae6ab7787fcf8150f738cf361c545c796ce84f16 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: MarcoAurelio Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Don’t load gadget when not in edit mode
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405904 ) Change subject: Don’t load gadget when not in edit mode .. Don’t load gadget when not in edit mode If Wikibase is not in edit mode – for example, because we’re on a diff page, or on an older revision – don’t show constraint reports either. (Note that wbIsEditView is a page-wide property, independent of user permissions: if a registered user lacks permissions to edit a protected page, it still makes sense to show them constraint violations, since they can at least alert others to them on talk pages or project chat.) Bug: T184623 Change-Id: Ic169e8e34ae2a291f24b17c6fab680af161be6e7 --- M modules/gadget-skip.js M modules/gadget.js M src/WikibaseQualityConstraintsHooks.php 3 files changed, 6 insertions(+), 3 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/gadget-skip.js b/modules/gadget-skip.js index 3921674..cdc2b58 100644 --- a/modules/gadget-skip.js +++ b/modules/gadget-skip.js @@ -1 +1 @@ -return !mw.config.exists( 'wbEntityId' ) || mw.config.get( 'wgMFMode' ); +return !mw.config.exists( 'wbEntityId' ) || mw.config.get( 'wgMFMode' ) || !mw.config.get( 'wbIsEditView' ); diff --git a/modules/gadget.js b/modules/gadget.js index da4d542..0983a7d 100644 --- a/modules/gadget.js +++ b/modules/gadget.js @@ -291,8 +291,8 @@ entityId = mw.config.get( 'wbEntityId' ); - if ( entityId === null || mw.config.get( 'wgMFMode' ) ) { - // no entity or mobile frontend, skip + if ( entityId === null || mw.config.get( 'wgMFMode' ) || !mw.config.get( 'wbIsEditView' ) ) { + // no entity, mobile frontend, or not editing (diff, oldid, …) – skip return; } diff --git a/src/WikibaseQualityConstraintsHooks.php b/src/WikibaseQualityConstraintsHooks.php index 1dd1de7..71f32af 100644 --- a/src/WikibaseQualityConstraintsHooks.php +++ b/src/WikibaseQualityConstraintsHooks.php @@ -132,6 +132,9 @@ if ( !$out->getUser()->isLoggedIn() ) { return; } + if ( !$out->getJsConfigVars()['wbIsEditView'] ) { + return; + } if ( self::isGadgetEnabledForUserName( $out->getUser()->getName(), time() ) ) { $out->addModules( 'wikibase.quality.constraints.gadget' ); -- To view, visit https://gerrit.wikimedia.org/r/405904 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic169e8e34ae2a291f24b17c6fab680af161be6e7 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/config[master]: Run coverage for a bunch of MediaWiki extensions
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405941 ) Change subject: Run coverage for a bunch of MediaWiki extensions .. Run coverage for a bunch of MediaWiki extensions I checked that these all have "includes" and "tests/phpunit" directories. Change-Id: I1987f2934d1e1359905ece396c1dd73ba365c939 --- M zuul/layout.yaml 1 file changed, 97 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/zuul/layout.yaml b/zuul/layout.yaml index f7daffb..415de3f 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -2811,6 +2811,8 @@ - name: extension-gate - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/AccountInfo template: @@ -2837,6 +2839,8 @@ - name: extension-unittests-generic - name: mediawiki-core-qunit-selenium-jessie - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/AdminLinks template: @@ -2895,6 +2899,8 @@ - name: extension-qunit-composer experimental: - mwext-mw-selenium-composer-jessie +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/Arrays template: @@ -2916,6 +2922,8 @@ - name: extension-gate - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/BaseHooks template: @@ -2926,6 +2934,8 @@ template: - name: mwgate-npm - name: extension-unittests-generic +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/BlameMaps template: @@ -2953,6 +2963,8 @@ template: - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/Buggy template: @@ -2973,6 +2985,8 @@ template: - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/CategoryTagSorter template: @@ -3085,6 +3099,8 @@ template: - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/CodeEditor template: @@ -3114,6 +3130,7 @@ postmerge: - mwext-doxygen-publish - mwext-jsduck-publish + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/CollapsibleVector template: @@ -3124,6 +3141,8 @@ template: - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/Collection/OfflineContentGenerator template: @@ -3165,12 +3184,16 @@ - name: extension-gate - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/ContentTranslation template: - name: mwgate-npm - name: extension-unittests-generic - name: extension-qunit-generic +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/ContributionScores template: @@ -3323,6 +3346,8 @@ template: - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/DonationInterface template: @@ -3370,6 +3395,8 @@ - name: mediawiki-core-qunit-selenium-jessie - name: mwext-ruby-jessie - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/EditAccount template: @@ -3410,6 +3437,8 @@ template: - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/Elastica template: @@ -3427,6 +3456,8 @@ template: - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/EmailAuthorization template: @@ -3447,6 +3478,8 @@ template: - name: extension-unittests-non-voting - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - name: mediawiki/extensions/EventLogging template: @@ -3456,6 +3489,7 @@ - name: extension-jsduck - name: mwgate-npm postmerge: + - mwext-phpunit-coverage-publish - mwext-jsduck-publish - name: eventlogging @@ -3482,6 +3516,8 @@ template: - name: extension-unittests-generic - name: mwgate-npm +postmerge: + - mwext-phpunit-coverage-publish - na
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Update Coveralls URLs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405916 ) Change subject: Update Coveralls URLs .. Update Coveralls URLs Change-Id: I64bc71d98ea5a36aa5a7e5932a80731bbec3334e --- M README.md 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index 4b39354..3545455 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ [travis-badge]: https://travis-ci.org/wikimedia/mediawiki-extensions-WikibaseQualityConstraints.svg?branch=master [travis]: https://travis-ci.org/wikimedia/mediawiki-extensions-WikibaseQualityConstraints -[coveralls-badge]: https://coveralls.io/repos/wikimedia/mediawiki-extensions-WikibaseQualityConstraints/badge.svg -[coveralls]: https://coveralls.io/r/wikimedia/mediawiki-extensions-WikibaseQualityConstraints +[coveralls-badge]: https://coveralls.io/repos/github/wikimedia/mediawiki-extensions-WikibaseQualityConstraints/badge.svg +[coveralls]: https://coveralls.io/github/wikimedia/mediawiki-extensions-WikibaseQualityConstraints [scrutinizer-badge]: https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-WikibaseQualityConstraints/badges/quality-score.png?b=master [scrutinizer]: https://scrutinizer-ci.com/g/wikimedia/mediawiki-extensions-WikibaseQualityConstraints/?branch=master [wbq]: https://github.com/wikimedia/mediawiki-extensions-WikibaseQuality.git -- To view, visit https://gerrit.wikimedia.org/r/405916 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64bc71d98ea5a36aa5a7e5932a80731bbec3334e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: ve.dm.Change: Truncate stores as well as transactions on con...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405926 ) Change subject: ve.dm.Change: Truncate stores as well as transactions on conflict .. ve.dm.Change: Truncate stores as well as transactions on conflict Change-Id: I5e07579ded9715384875a2d83498d54a9eb0f808 --- M src/dm/ve.dm.Change.js M tests/dm/ve.dm.Change.test.js 2 files changed, 44 insertions(+), 6 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/src/dm/ve.dm.Change.js b/src/dm/ve.dm.Change.js index 5ff3bdf..a582371 100644 --- a/src/dm/ve.dm.Change.js +++ b/src/dm/ve.dm.Change.js @@ -432,6 +432,7 @@ if ( rebases[ 0 ] === null ) { rejected = uncommitted.mostRecent( uncommitted.start + i ); transactionsB.length = i; + storesB.length = i; selectionsB = {}; break bLoop; } @@ -658,16 +659,13 @@ */ ve.dm.Change.prototype.unapplyTo = function ( surface ) { var doc = surface.documentModel, - historyLength = doc.completeHistory.length - this.getLength(), - storeLength = doc.store.getLength(); - this.stores.forEach( function ( store ) { - storeLength -= store.getLength(); - } ); + historyLength = doc.completeHistory.length - this.getLength(); this.transactions.slice().reverse().forEach( function ( tx ) { surface.change( tx.reversed() ); } ); doc.completeHistory.length = historyLength; - doc.store.truncate( storeLength ); + doc.storeLengthAtHistoryLength.length = historyLength + 1; + doc.store.truncate( doc.storeLengthAtHistoryLength[ historyLength ] ); }; /** diff --git a/tests/dm/ve.dm.Change.test.js b/tests/dm/ve.dm.Change.test.js index dc9aea1..f82c31f 100644 --- a/tests/dm/ve.dm.Change.test.js +++ b/tests/dm/ve.dm.Change.test.js @@ -276,6 +276,46 @@ ); } ); +QUnit.test( 'Rebase with conflicting annotations', function ( assert ) { + var setBold, remove, result, + origData = [ { type: 'paragraph' }, 'A', { type: '/paragraph' } ], + newSurface = function () { + return new ve.dm.Surface( + ve.dm.example.createExampleDocumentFromData( origData ) + ); + }, + surface = newSurface(), + doc = surface.documentModel, + TxRemove = ve.dm.TransactionBuilder.static.newFromRemoval, + TxAnnotate = ve.dm.TransactionBuilder.static.newFromAnnotation, + b = ve.dm.example.bold, + emptyStore = new ve.dm.IndexValueStore(), + bStore = new ve.dm.IndexValueStore( [ b ] ); + + assert.expect( 3 ); + + // Canonical history: text gets removed + remove = new ve.dm.Change( 1, [ TxRemove( doc, new ve.Range( 1, 2 ) ) ], [ emptyStore ], {} ); + // Doomed conflicting history: text gets bolded + setBold = new ve.dm.Change( 1, [ TxAnnotate( doc, new ve.Range( 1, 2 ), 'set', b ) ], [ bStore ], {} ); + result = ve.dm.Change.static.rebaseUncommittedChange( remove, setBold ); + assert.deepEqual( + result.rebased.serialize(), + new ve.dm.Change( 2, [], [], {} ).serialize(), + 'Nothing got rebased' + ); + assert.deepEqual( + result.rejected.serialize(), + setBold.serialize(), + 'setBold got rejected' + ); + assert.deepEqual( + result.transposedHistory.serialize(), + remove.serialize(), + 'remove got transposed' + ); +} ); + QUnit.test( 'Serialize/deserialize', function ( assert ) { var origData = [ { type: 'paragraph' }, 'b', 'a', 'r', { type: '/paragraph' } ], newSurface = function () { -- To view, visit https://gerrit.wikimedia.org/r/405926 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5e07579ded9715384875a2d83498d54a9eb0f808 Gerrit-PatchSet: 2 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Divec Gerrit-Reviewer: Catrope 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...Variables[master]: Convert to extension registration
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/372769 ) Change subject: Convert to extension registration .. Convert to extension registration Converted Extension:Variables to the current version of extension registration, raising mimimum MediaWiki version to 1.29. The ExtVariables class was transfered to it's own file as recommended. Removed now unused functions like getDir() and the unneeded VERSION constant on the way. Bug: T173625 Change-Id: I0a6f75da5d394cdc5a61f2d3902d671f10dbb090 --- M COPYING M Variables.php D Variables.settings.php A Variables_body.php A extension.json M i18n/en.json M i18n/qqq.json 7 files changed, 368 insertions(+), 406 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/COPYING b/COPYING index de01985..7e781f7 100644 --- a/COPYING +++ b/COPYING @@ -2,6 +2,7 @@ Copyright (c) 2007by Tom Hempel Copyright (c) 2008by Xiloynaha Copyright (c) 2009 - 2012 by Daniel Werner < danwe...@web.de > +Copyright (c) 2017by MGChecker < hgasu...@gmail.com > Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/Variables.php b/Variables.php index 84d6c90..ddf0adf 100644 --- a/Variables.php +++ b/Variables.php @@ -1,375 +1,10 @@ https://www.mediawiki.org/wiki/Extension:Variables - * Support: https://www.mediawiki.org/wiki/Extension_talk:Variables - * Source code: https://phabricator.wikimedia.org/diffusion/EVAR/ - * - * @license: ISC License - * @author: Rob Adams - * @author: Tom Hempel - * @author: Xiloynaha - * @author: Daniel Werner < danwe...@web.de > - * - * @file Variables.php - * @ingroup Variables - */ - -// Ensure that the script cannot be executed outside of MediaWiki. -if ( !defined( 'MEDIAWIKI' ) ) { -die( 'This is an extension to MediaWiki and cannot be run standalone.' ); -} - -// Display extension properties on MediaWiki. -$wgExtensionCredits['parserhook'][] = array( - 'path' => __FILE__, - 'name' => 'Variables', - 'descriptionmsg' => 'variables-desc', - 'version' => ExtVariables::VERSION, - 'author' => array( - 'Rob Adams', - 'Tom Hempel', - 'Xiloynaha', - '[https://www.mediawiki.org/wiki/User:Danwe Daniel Werner]', - '...' - ), - 'url' => 'https://www.mediawiki.org/wiki/Extension:Variables', - 'license-name' => 'ISC' -); - -// language files: -$wgMessagesDirs['Variables'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['VariablesMagic'] = ExtVariables::getDir() . '/Variables.i18n.magic.php'; - -// hooks registration: -$wgHooks['ParserFirstCallInit'][] = 'ExtVariables::init'; -$wgHooks['ParserClearState'][] = 'ExtVariables::onParserClearState'; -$wgHooks['InternalParseBeforeSanitize'][] = 'ExtVariables::onInternalParseBeforeSanitize'; - -// parser tests registration: -$wgParserTestFiles[] = ExtVariables::getDir() . '/tests/mwparsertests/Variables.txt'; - -// Include the settings file: -require_once ExtVariables::getDir() . '/Variables.settings.php'; - - -/** - * Extension class with basic extension information. This class serves as static - * class with the static parser functions but also als variables store instance - * as object assigned to a Parser object. - */ -class ExtVariables { - - /** -* Version of the 'Variables' extension. -* -* @since 1.4 -* -* @var string -*/ - const VERSION = '2.2.0'; - - /** -* Internal store for variable values -* -* @private -* @var array -*/ - public $mVariables = array(); - - /** -* Array with all names of variables requested by '#var_final'. Key of the values is the -* stripSateId of the strip-item placed where the final var should appear. -* -* @since 2.0 -* -* @private -* @var array -*/ - public $mFinalizedVars = array(); - - /** -* Variables extensions own private StripState manager to manage '#final_var' placeholders -* and their replacement with the final var value or a defined default. -* -* @since 2.0 -* -* @private -* @var StripState -*/ - public $mFinalizedVarsStripState; - - /** -* Sets up parser functions -* -* @since 1.4 -*/ - public static function init( Parser &$parser ) { - - /* -* store for variables per parser object. This will solve several bugs related to -* 'ParserClearState' hook clearing all variables early in combination with certain -* other extensions. (since v2.0) -*/ - $parser->mExtVariabl
[MediaWiki-commits] [Gerrit] integration/config[master]: Remove jobs for 'generator-wikimedia-php-library'
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405930 ) Change subject: Remove jobs for 'generator-wikimedia-php-library' .. Remove jobs for 'generator-wikimedia-php-library' Repo is being archived. Bug: T174416 Change-Id: I10cf297edf8c1f28f172121ae10e485cba175093 --- M zuul/layout.yaml 1 file changed, 0 insertions(+), 4 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 3f56ec8..f7daffb 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -7917,10 +7917,6 @@ - search-mjolnir-tox-docker - search-mjolnir-maven - - name: generator-wikimedia-php-library -template: - - name: npm-docker - - name: oojs/core test: - oojs-core-jsduck-jessie -- To view, visit https://gerrit.wikimedia.org/r/405930 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I10cf297edf8c1f28f172121ae10e485cba175093 Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Krinkle 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...WikibaseQualityConstraints[master]: Workaround for coveralls bug #61
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405928 ) Change subject: Workaround for coveralls bug #61 .. Workaround for coveralls bug #61 See https://github.com/php-coveralls/php-coveralls/issues/61 Change-Id: I3ecd95700616d5b684170d59d3409a9bd1d6ad92 --- M build/travis/after_script.sh 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Lucas Werkmeister (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/build/travis/after_script.sh b/build/travis/after_script.sh index a37904a..9d2fbff 100755 --- a/build/travis/after_script.sh +++ b/build/travis/after_script.sh @@ -2,4 +2,8 @@ cd ../wiki/extensions/WikibaseQualityConstraints +export CI_BUILD_NUMBER="$TRAVIS_BUILD_NUMBER" +export CI_PULL_REQUEST="$TRAVIS_PULL_REQUEST" +export CI_BRANCH="$TRAVIS_BRANCH" + php vendor/bin/php-coveralls -v -- To view, visit https://gerrit.wikimedia.org/r/405928 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ecd95700616d5b684170d59d3409a9bd1d6ad92 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Ladsgroup Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Lucas Werkmeister (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Create factory for MWHttpRequest
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/404602 ) Change subject: Create factory for MWHttpRequest .. Create factory for MWHttpRequest This will allow classes that need MWHttpRequest to inject HttpRequestFactory and thus make it overridable and testable. Also made MWHttpRequest abstract class since it doesn't implement execute anyway. Maybe a good idea to move execute to an abstract method? Change-Id: I5c0e035542ff5f791a21a95ed13bed4cea6906d0 --- M autoload.php M includes/MediaWikiServices.php M includes/ServiceWiring.php A includes/http/HttpRequestFactory.php M includes/http/MWHttpRequest.php M tests/integration/includes/http/MWHttpRequestTestCase.php M tests/phpunit/includes/MediaWikiServicesTest.php 7 files changed, 108 insertions(+), 36 deletions(-) Approvals: Legoktm: Looks good to me, approved Addshore: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 5d6104c..3302415 100644 --- a/autoload.php +++ b/autoload.php @@ -878,6 +878,7 @@ 'MediaWiki\\EditPage\\TextboxBuilder' => __DIR__ . '/includes/editpage/TextboxBuilder.php', 'MediaWiki\\Edit\\PreparedEdit' => __DIR__ . '/includes/edit/PreparedEdit.php', 'MediaWiki\\HeaderCallback' => __DIR__ . '/includes/HeaderCallback.php', + 'MediaWiki\\Http\\HttpRequestFactory' => __DIR__ . '/includes/http/HttpRequestFactory.php', 'MediaWiki\\Interwiki\\ClassicInterwikiLookup' => __DIR__ . '/includes/interwiki/ClassicInterwikiLookup.php', 'MediaWiki\\Interwiki\\InterwikiLookup' => __DIR__ . '/includes/interwiki/InterwikiLookup.php', 'MediaWiki\\Interwiki\\InterwikiLookupAdapter' => __DIR__ . '/includes/interwiki/InterwikiLookupAdapter.php', diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index 5b173cd..00767c7 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -10,6 +10,7 @@ use GlobalVarConfig; use Hooks; use IBufferingStatsdDataFactory; +use MediaWiki\Http\HttpRequestFactory; use MediaWiki\Preferences\PreferencesFactory; use MediaWiki\Shell\CommandFactory; use MediaWiki\Storage\BlobStore; @@ -734,6 +735,14 @@ return $this->getService( 'PreferencesFactory' ); } + /** +* @since 1.31 +* @return HttpRequestFactory +*/ + public function getHttpRequestFactory() { + return $this->getService( 'HttpRequestFactory' ); + } + /// // NOTE: When adding a service getter here, don't forget to add a test // case for it in MediaWikiServicesTest::provideGetters() and in diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 79e5b84..dab3b5c 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -508,6 +508,10 @@ return new DefaultPreferencesFactory( $config, $wgContLang, $authManager, $linkRenderer ); }, + 'HttpRequestFactory' => function ( MediaWikiServices $services ) { + return new \MediaWiki\Http\HttpRequestFactory(); + }, + /// // NOTE: When adding a service here, don't forget to add a getter function // in the MediaWikiServices class. The convenience getter should just call diff --git a/includes/http/HttpRequestFactory.php b/includes/http/HttpRequestFactory.php new file mode 100644 index 000..80f9b68 --- /dev/null +++ b/includes/http/HttpRequestFactory.php @@ -0,0 +1,82 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + */ +namespace MediaWiki\Http; + +use CurlHttpRequest; +use DomainException; +use Http; +use MediaWiki\Logger\LoggerFactory; +use MWHttpRequest; +use PhpHttpRequest; +use Profiler; + +/** + * Factory creating MWHttpRequest objects. + */ +class HttpRequestFactory { + + /** +* Generate a new MWHttpRequest object +* @param string $url Url to use +* @param array $options (optional) extra params to pass (see Http::request()) +* @param string $caller The method making this request, for profiling +* @throws DomainException +* @return MWHttpRequest +* @see MWHttpRequest::__construct +*/ + public function create( $url, array $options = [], $caller = __METHOD__ ) { + if ( !Http::$httpEngine ) { + Http::$httpEngine = function_exists( 'curl_init' ) ? 'curl' : 'php'; + } elseif ( Http::$httpEngine == 'curl' && !function_exists( 'curl_init' ) ) { + throw new DomainException( __METHOD__ . ': curl (http://php.net/curl) is not installed, but' . + ' Http::$httpEngine is set to "curl"' ); + } +
[MediaWiki-commits] [Gerrit] mediawiki...cookiecutter-library[master]: Use SPDX 3.0 license identifiers
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405919 ) Change subject: Use SPDX 3.0 license identifiers .. Use SPDX 3.0 license identifiers Change-Id: If755ec10a96e0b76a615de894d61f2345dc470cd --- M cookiecutter.json M {{ cookiecutter.library_name }}/COPYING M {{ cookiecutter.library_name }}/src/{{ cookiecutter.library_name }}.php 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/cookiecutter.json b/cookiecutter.json index 2aaec28..7f4de62 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -3,5 +3,5 @@ "description": "A short description about your library", "author_name": "Your Name", "author_email": "yourem...@domain.ext", - "license": "GPL-2.0+" + "license": "GPL-2.0-or-later" } diff --git "a/\173\173 cookiecutter.library_name \175\175/COPYING" "b/\173\173 cookiecutter.library_name \175\175/COPYING" index f7bcde1..49a4e1f 100644 --- "a/\173\173 cookiecutter.library_name \175\175/COPYING" +++ "b/\173\173 cookiecutter.library_name \175\175/COPYING" @@ -1,4 +1,4 @@ -{% if cookiecutter.license == 'GPL-2.0' or cookiecutter.license == 'GPL-2.0+' %} +{% if cookiecutter.license == 'GPL-2.0-only' or cookiecutter.license == 'GPL-2.0-or-later' %} GNU GENERAL PUBLIC LICENSE Version 2, June 1991 diff --git "a/\173\173 cookiecutter.library_name \175\175/src/\173\173 cookiecutter.library_name \175\175.php" "b/\173\173 cookiecutter.library_name \175\175/src/\173\173 cookiecutter.library_name \175\175.php" index 450b934..6fee715 100644 --- "a/\173\173 cookiecutter.library_name \175\175/src/\173\173 cookiecutter.library_name \175\175.php" +++ "b/\173\173 cookiecutter.library_name \175\175/src/\173\173 cookiecutter.library_name \175\175.php" @@ -1,4 +1,4 @@ -https://gerrit.wikimedia.org/r/405919 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If755ec10a96e0b76a615de894d61f2345dc470cd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/tools/cookiecutter-library Gerrit-Branch: master Gerrit-Owner: Legoktm 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...cookiecutter-library[master]: Generate a README.md file
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405918 ) Change subject: Generate a README.md file .. Generate a README.md file This is based off of the one from the CDB library. Change-Id: I61a0d897b5431a71bede4d5e09cf17ec58ffa774 --- M hooks/post_gen_project.py A {{ cookiecutter.library_name }}/README.md 2 files changed, 53 insertions(+), 8 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index a7bbe8a..0e0aa13 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -57,13 +57,18 @@ return new -with open('composer.json', 'r') as f: -text = f.read() +def replace_composer_name(fname): +with open(fname, 'r') as f: +text = f.read() -text = text.replace( -'!!COMPOSER_NAME!!', -'wikimedia/' + composerify_name(library_name) -) +text = text.replace( +'!!COMPOSER_NAME!!', +'wikimedia/' + composerify_name(library_name) +) -with open('composer.json', 'w') as f: -f.write(text) +with open(fname, 'w') as f: +f.write(text) + + +replace_composer_name('composer.json') +replace_composer_name('README.md') diff --git "a/\173\173 cookiecutter.library_name \175\175/README.md" "b/\173\173 cookiecutter.library_name \175\175/README.md" new file mode 100644 index 000..8587b73 --- /dev/null +++ "b/\173\173 cookiecutter.library_name \175\175/README.md" @@ -0,0 +1,40 @@ +[![Latest Stable Version]](https://packagist.org/packages/!!COMPOSER_NAME!!) [![License]](https://packagist.org/packages/!!COMPOSER_NAME!!) + +{{ cookiecutter.library_name }} += + +FILL THIS IN + +Additional documentation about the library can be found on +[MediaWiki.org](https://www.mediawiki.org/wiki/{{ cookiecutter.library_name }}). + + +Usage +- + +// Fill this in + + +Running tests +- + +composer install --prefer-dist +composer test + + +History +--- + +Review and update this section. +This library was first introduced in [MediaWiki 1.16][] ([r52203][]). It was +split out of the MediaWiki codebase and published as an independent library +during the [MediaWiki 1.25][] development cycle. + + +--- +[MediaWiki 1.16]: https://www.mediawiki.org/wiki/MediaWiki_1.16 +[r52203]: https://www.mediawiki.org/wiki/Special:Code/MediaWiki/52203 +[MediaWiki 1.25]: https://www.mediawiki.org/wiki/MediaWiki_1.25 +[Latest Stable Version]: https://poser.pugx.org/!!COMPOSER_NAME!!/v/stable.svg +[License]: https://poser.pugx.org/!!COMPOSER_NAME!!/license.svg + -- To view, visit https://gerrit.wikimedia.org/r/405918 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61a0d897b5431a71bede4d5e09cf17ec58ffa774 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/tools/cookiecutter-library Gerrit-Branch: master Gerrit-Owner: Legoktm 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...cookiecutter-library[master]: Move phpcs.xml to .phpcs.xml
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405912 ) Change subject: Move phpcs.xml to .phpcs.xml .. Move phpcs.xml to .phpcs.xml Change-Id: I73d0ff2db7304433226b08e430d8c2b1f398817f --- M hooks/post_gen_project.py M {{ cookiecutter.library_name }}/.gitattributes R {{ cookiecutter.library_name }}/.phpcs.xml 3 files changed, 2 insertions(+), 2 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 04fe5e3..a7bbe8a 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -25,7 +25,7 @@ # Would be nice if we didnt need to hardcode these... 'jakub-onderka/php-parallel-lint': '0.9.2', 'jakub-onderka/php-console-highlighter': '0.3.2', -'mediawiki/mediawiki-codesniffer': '13.0.0', +'mediawiki/mediawiki-codesniffer': '15.0.0', 'mediawiki/minus-x': '0.2.1', 'phpunit/phpunit': '4.8.36', } diff --git "a/\173\173 cookiecutter.library_name \175\175/.gitattributes" "b/\173\173 cookiecutter.library_name \175\175/.gitattributes" index b6fe658..749e6a3 100644 --- "a/\173\173 cookiecutter.library_name \175\175/.gitattributes" +++ "b/\173\173 cookiecutter.library_name \175\175/.gitattributes" @@ -5,6 +5,6 @@ .travis.yml export-ignore Doxyfile export-ignore composer.json export-ignore -phpcs.xml export-ignore +.phpcs.xml export-ignore phpunit.xml.dist export-ignore tests/ export-ignore diff --git "a/\173\173 cookiecutter.library_name \175\175/phpcs.xml" "b/\173\173 cookiecutter.library_name \175\175/.phpcs.xml" similarity index 100% rename from "\173\173 cookiecutter.library_name \175\175/phpcs.xml" rename to "\173\173 cookiecutter.library_name \175\175/.phpcs.xml" -- To view, visit https://gerrit.wikimedia.org/r/405912 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73d0ff2db7304433226b08e430d8c2b1f398817f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/tools/cookiecutter-library Gerrit-Branch: master Gerrit-Owner: Legoktm 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] VisualEditor/VisualEditor[master]: Disable undo/usurp within SurfaceSynchronizer
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405838 ) Change subject: Disable undo/usurp within SurfaceSynchronizer .. Disable undo/usurp within SurfaceSynchronizer Change-Id: Ic5dc470e444288ea41b2ed2a35fc82e078e3fe0b --- M src/dm/ve.dm.SurfaceSynchronizer.js 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/src/dm/ve.dm.SurfaceSynchronizer.js b/src/dm/ve.dm.SurfaceSynchronizer.js index 0f51f1b..853c4b4 100644 --- a/src/dm/ve.dm.SurfaceSynchronizer.js +++ b/src/dm/ve.dm.SurfaceSynchronizer.js @@ -27,6 +27,10 @@ // Properties this.surface = surface; + // HACK disable undo/redo + this.surface.canUndo = this.surface.canRedo = function () { + return false; + }; this.doc = surface.documentModel; this.store = this.doc.getStore(); this.authorSelections = {}; @@ -45,7 +49,8 @@ this.socket.on( 'newChange', this.onNewChange.bind( this ) ); this.socket.on( 'nameChange', this.onNameChange.bind( this ) ); this.socket.on( 'authorDisconnect', this.onAuthorDisconnect.bind( this ) ); - this.tryUsurp(); + // TODO: unbreak then re-enable usurp + // this.tryUsurp(); // Events this.doc.connect( this, { -- To view, visit https://gerrit.wikimedia.org/r/405838 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic5dc470e444288ea41b2ed2a35fc82e078e3fe0b Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Divec Gerrit-Reviewer: Catrope 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]: ExtensionRegistry: Properly detect if a global is already set
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405925 ) Change subject: ExtensionRegistry: Properly detect if a global is already set .. ExtensionRegistry: Properly detect if a global is already set $foo = null; isset( $foo ); will yield false. Sometimes we want to explicitly set a config to null, but ExtensionRegistry is then overriding this variable with the default value. This is no consistent with the old workflow: require_once the extension and then override the setting with null. Bug: T128661 Change-Id: I0654c9369a596e84591fcaa9643703e6b4ccf57e --- M includes/registration/ExtensionRegistry.php M tests/phpunit/includes/registration/ExtensionRegistryTest.php 2 files changed, 13 insertions(+), 1 deletion(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index 6308461..ae1ab58 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -291,7 +291,7 @@ // Optimistic: If the global is not set, or is an empty array, replace it entirely. // Will be O(1) performance. - if ( !isset( $GLOBALS[$key] ) || ( is_array( $GLOBALS[$key] ) && !$GLOBALS[$key] ) ) { + if ( !array_key_exists( $key, $GLOBALS ) || ( is_array( $GLOBALS[$key] ) && !$GLOBALS[$key] ) ) { $GLOBALS[$key] = $val; continue; } diff --git a/tests/phpunit/includes/registration/ExtensionRegistryTest.php b/tests/phpunit/includes/registration/ExtensionRegistryTest.php index 9b57e1c..5916b45 100644 --- a/tests/phpunit/includes/registration/ExtensionRegistryTest.php +++ b/tests/phpunit/includes/registration/ExtensionRegistryTest.php @@ -287,6 +287,18 @@ ], ], ], + [ + 'global is null before', + [ + 'NullGlobal' => null, + ], + [ + 'NullGlobal' => 'not-null' + ], + [ + 'NullGlobal' => null + ], + ], ]; } } -- To view, visit https://gerrit.wikimedia.org/r/405925 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0654c9369a596e84591fcaa9643703e6b4ccf57e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Hoo man Gerrit-Reviewer: Addshore Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Reedy 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...WikibaseQualityConstraints[master]: Fix coveralls settings
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405924 ) Change subject: Fix coveralls settings .. Fix coveralls settings See https://docs.coveralls.io/supported-ci-services Change-Id: I3d8f1e448c6ab50dfe35ad85eea36137e6056137 --- M .coveralls.yml 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/.coveralls.yml b/.coveralls.yml index f6e9ef4..29d884b 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1 +1,2 @@ coverage_clover: build/logs/clover.xml +service_name: travis-ci -- To view, visit https://gerrit.wikimedia.org/r/405924 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3d8f1e448c6ab50dfe35ad85eea36137e6056137 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Ladsgroup Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Make Default list sticky, regardless of sorting.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405917 ) Change subject: Make Default list sticky, regardless of sorting. .. Make Default list sticky, regardless of sorting. Change-Id: I9b70809192d3f67f51edd2ae20c0a69a8784719f --- M app/src/main/java/org/wikipedia/readinglist/database/ReadingList.java 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Cooltey: Looks good to me, approved diff --git a/app/src/main/java/org/wikipedia/readinglist/database/ReadingList.java b/app/src/main/java/org/wikipedia/readinglist/database/ReadingList.java index 4a93581..eeb7818 100644 --- a/app/src/main/java/org/wikipedia/readinglist/database/ReadingList.java +++ b/app/src/main/java/org/wikipedia/readinglist/database/ReadingList.java @@ -159,5 +159,17 @@ default: break; } +// make the Default list sticky on top, regardless of sorting. +ReadingList defaultList = null; +for (ReadingList list : lists) { +if (list.isDefault()) { +defaultList = list; +break; +} +} +if (defaultList != null) { +lists.remove(defaultList); +lists.add(0, defaultList); +} } } -- To view, visit https://gerrit.wikimedia.org/r/405917 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b70809192d3f67f51edd2ae20c0a69a8784719f Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Dbrant Gerrit-Reviewer: Brion VIBBER Gerrit-Reviewer: Cooltey Gerrit-Reviewer: Sharvaniharan 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]: Add collation for Abkhaz (ab)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/399537 ) Change subject: Add collation for Abkhaz (ab) .. Add collation for Abkhaz (ab) * Adding new class AbkhazUppercaseCollation, mapped to 'uppercase-ab'. * Extended CustomUppercaseCollation with support for sorting digraphs and for alphabets larger than 64 letters (up to 4096). Bug: T183430 Change-Id: I16d44568e44d7ef5b39c38b1a6257b9fe10a34d4 --- M autoload.php A includes/collation/AbkhazUppercaseCollation.php M includes/collation/Collation.php M includes/collation/CustomUppercaseCollation.php M tests/phpunit/includes/collation/CustomUppercaseCollationTest.php 5 files changed, 132 insertions(+), 17 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 6b8387b..47c04b9 100644 --- a/autoload.php +++ b/autoload.php @@ -6,6 +6,7 @@ $wgAutoloadLocalClasses = [ 'APCBagOStuff' => __DIR__ . '/includes/libs/objectcache/APCBagOStuff.php', 'APCUBagOStuff' => __DIR__ . '/includes/libs/objectcache/APCUBagOStuff.php', + 'AbkhazUppercaseCollation' => __DIR__ . '/includes/collation/AbkhazUppercaseCollation.php', 'AbstractContent' => __DIR__ . '/includes/content/AbstractContent.php', 'Action' => __DIR__ . '/includes/actions/Action.php', 'ActiveUsersPager' => __DIR__ . '/includes/specials/pagers/ActiveUsersPager.php', diff --git a/includes/collation/AbkhazUppercaseCollation.php b/includes/collation/AbkhazUppercaseCollation.php new file mode 100644 index 000..e0ea237 --- /dev/null +++ b/includes/collation/AbkhazUppercaseCollation.php @@ -0,0 +1,93 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @since 1.31 + * + * @file + */ + +class AbkhazUppercaseCollation extends CustomUppercaseCollation { + + public function __construct() { + parent::__construct( [ + 'А', + 'Б', + 'В', + 'Г', + 'Гь', + 'Гә', + 'Ҕ', + 'Ҕь', + 'Ҕә', + 'Д', + 'Дә', + 'Е', + 'Ж', + 'Жь', + 'Жә', + 'З', + 'Ӡ', + 'Ӡә', + 'И', + 'К', + 'Кь', + 'Кә', + 'Қ', + 'Қь', + 'Қә', + 'Ҟ', + 'Ҟь', + 'Ҟә', + 'Л', + 'М', + 'Н', + 'О', + 'П', + 'Ҧ', + 'Р', + 'С', + 'Т', + 'Тә', + 'Ҭ', + 'Ҭә', + 'У', + 'Ф', + 'Х', + 'Хь', + 'Хә', + 'Ҳ', + 'Ҳә', + 'Ц', + 'Цә', + 'Ҵ', + 'Ҵә', + 'Ч', + 'Ҷ', + 'Ҽ', + 'Ҿ', + 'Ш', + 'Шь', + 'Шә', + 'Ы', + 'Ҩ', + 'Џ', + 'Џь', + 'ь', + 'ә', + ], Language::factory( 'ab' ) ); + } +} diff --git a/includes/collation/Collation.php b/includes/collation/Collation.php index 7171a21..30cae5a 100644 --- a/includes/collation/Collation.php +++ b/includes/collation/Collation.php @@ -65,6 +65,8 @@ return new CollationEt; case 'xx-uca-fa': return new CollationFa; + case 'uppercase-ab': + return new AbkhazUppercaseCollation; case 'uppercase-ba': return new BashkirUppercaseCollation; case 'uppercase-se': diff --git a/includes/collation/CustomUppercaseCollation.php b/includes/collation/CustomUppercaseCollation.php index 301972d..170d5c2 100644 --- a/includes/collation/CustomUppercaseCollation.php +++ b/includes/collation/CustomUppercaseCollation.php @@ -32,6 +32,7 @@ * conflicts with other people using private use area) * * This does not support fancy things like secondary differences, etc. + * (It supports digraphs,