[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make DeferredUpdates able to run DataUpdates
jenkins-bot has submitted this change and it was merged. Change subject: Make DeferredUpdates able to run DataUpdates .. Make DeferredUpdates able to run DataUpdates * Also make ErrorPageError exceptions display themselves in PRESEND mode. Before they were always suppressed. * Make DataUpdate::runUpdates() simply wrap DeferredUpdates::execute(). * Remove unused installDBListener() method, which was basically moved to Maintenance. * Enable DBO_TRX for DeferredUpdates::execute() in CLI mode * Also perform sub-DeferrableUpdate jobs right after their parent for better transaction locality. * Made rollbackMasterChangesAndLog() clear all master transactions/rounds, even if there are no changes yet. This keeps the state cleaner for continuing. * For sanity, avoid calling acquirePageLock() in link updates unless the transaction ticket is set. These locks are already redundant and weaker in range than the locks the Job classes that run them get. This helps guard against DBTransactionError. * Renamed $type to $stage to be more clear about the order. Change-Id: I1e90b56cc80041d70fb9158ac4f027285ad0f2c9 --- M includes/api/ApiPurge.php M includes/deferred/DataUpdate.php M includes/deferred/DeferredUpdates.php M includes/deferred/LinksDeletionUpdate.php M includes/deferred/LinksUpdate.php M includes/exception/MWExceptionHandler.php M tests/phpunit/includes/EditPageTest.php M tests/phpunit/includes/deferred/DeferredUpdatesTest.php 8 files changed, 222 insertions(+), 140 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index 822369a..f671103 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -91,7 +91,9 @@ # Update the links tables $updates = $content->getSecondaryDataUpdates( $title, null, $forceRecursiveLinkUpdate, $p_result ); - DataUpdate::runUpdates( $updates ); + foreach ( $updates as $update ) { + DeferredUpdates::addUpdate( $update, DeferredUpdates::PRESEND ); + } $r['linkupdate'] = true; diff --git a/includes/deferred/DataUpdate.php b/includes/deferred/DataUpdate.php index cad89b1..8d26460 100644 --- a/includes/deferred/DataUpdate.php +++ b/includes/deferred/DataUpdate.php @@ -44,50 +44,12 @@ /** * Convenience method, calls doUpdate() on every DataUpdate in the array. * -* This methods supports transactions logic by first calling beginTransaction() -* on all updates in the array, then calling doUpdate() on each, and, if all goes well, -* then calling commitTransaction() on each update. If an error occurs, -* rollbackTransaction() will be called on any update object that had beginTransaction() -* called but not yet commitTransaction(). -* -* This allows for limited transactional logic across multiple backends for storing -* secondary data. -* * @param DataUpdate[] $updates A list of DataUpdate instances * @param string $mode Use "enqueue" to use the job queue when possible [Default: run] -* @throws Exception|null +* @throws Exception +* @deprecated Since 1.28 Use DeferredUpdates::execute() */ public static function runUpdates( array $updates, $mode = 'run' ) { - if ( $mode === 'enqueue' ) { - // When possible, push updates as jobs instead of calling doUpdate() - $updates = self::enqueueUpdates( $updates ); - } - - foreach ( $updates as $update ) { - $update->doUpdate(); - } - } - - /** -* Enqueue jobs for every DataUpdate that support enqueueUpdate() -* and return the remaining DataUpdate objects (those that do not) -* -* @param DataUpdate[] $updates A list of DataUpdate instances -* @return DataUpdate[] -* @since 1.27 -*/ - protected static function enqueueUpdates( array $updates ) { - $remaining = []; - - foreach ( $updates as $update ) { - if ( $update instanceof EnqueueableDataUpdate ) { - $spec = $update->getAsJobSpecification(); - JobQueueGroup::singleton( $spec['wiki'] )->push( $spec['job'] ); - } else { - $remaining[] = $update; - } - } - -
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: ImageHistoryList: Remove 'wpEditToken' parameter from the "r...
jenkins-bot has submitted this change and it was merged. Change subject: ImageHistoryList: Remove 'wpEditToken' parameter from the "revert" link for files .. ImageHistoryList: Remove 'wpEditToken' parameter from the "revert" link for files The action=revert page does not use this parameter at all. (It displays a form with an entirely different token.) I think this has not been needed since cf6dd13faca23af5b6e3188445b84e05d620d499 (r91284). Change-Id: Ice5ecd2606a94a70321ede5304fee77fb1fb06c1 --- M includes/page/ImageHistoryList.php 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/page/ImageHistoryList.php b/includes/page/ImageHistoryList.php index 607357f..bb8ed24 100644 --- a/includes/page/ImageHistoryList.php +++ b/includes/page/ImageHistoryList.php @@ -180,7 +180,6 @@ [ 'action' => 'revert', 'oldimage' => $img, - 'wpEditToken' => $user->getEditToken( $img ) ] ); } -- To view, visit https://gerrit.wikimedia.org/r/308074 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ice5ecd2606a94a70321ede5304fee77fb1fb06c1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz DziewońskiGerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: gerrit: revert CSS change that fixed the diff being cutoff
Dzahn has submitted this change and it was merged. Change subject: gerrit: revert CSS change that fixed the diff being cutoff .. gerrit: revert CSS change that fixed the diff being cutoff It was too ugly. Per RoanKattouw Change-Id: Ib92df443b237101d9de60c184871261e5b3999a5 --- M modules/gerrit/files/etc/GerritSite.css 1 file changed, 0 insertions(+), 10 deletions(-) Approvals: Catrope: Looks good to me, but someone else must approve Dzahn: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/gerrit/files/etc/GerritSite.css b/modules/gerrit/files/etc/GerritSite.css index 0ccd7e7..d518e99 100644 --- a/modules/gerrit/files/etc/GerritSite.css +++ b/modules/gerrit/files/etc/GerritSite.css @@ -8,16 +8,6 @@ white-space: pre-wrap !important; } -/* - * Partially fix diff screen cutting off changes at the cost of ugleness - * can be reverted once upstream gerrit fixes it. - * - * Tracked at https://bugs.chromium.org/p/gerrit/issues/detail?id=4292 - */ -.com-google-gerrit-client-diff-DiffTable_BinderImpl_GenCss_style-difftable .CodeMirror pre span { - white-space: pre-wrap !important; -} - /** * General */ -- To view, visit https://gerrit.wikimedia.org/r/308095 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib92df443b237101d9de60c184871261e5b3999a5 Gerrit-PatchSet: 5 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: PaladoxGerrit-Reviewer: Catrope Gerrit-Reviewer: Chad Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Hashar 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] mediawiki/core[master]: Replace DataUpdate::doUpdates() callers in maintenance/
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/308127 Change subject: Replace DataUpdate::doUpdates() callers in maintenance/ .. Replace DataUpdate::doUpdates() callers in maintenance/ Change-Id: I51df9f419d6ea1e822fd0eef8c5dc4c43f9855e1 --- M maintenance/namespaceDupes.php M maintenance/refreshLinks.php 2 files changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/27/308127/1 diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index d6a9ba8..506bc9c 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -607,8 +607,8 @@ * accidentally introduce an assumption of title validity to the code we * are calling. */ - $updates = [ new LinksDeletionUpdate( $wikiPage ) ]; - DataUpdate::runUpdates( $updates ); + DeferredUpdates::addUpdate( new LinksDeletionUpdate( $wikiPage ) ); + DeferredUpdates::doUpdates(); return true; } diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index e91a3d3..95a49d6 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -237,8 +237,9 @@ return; } - $updates = $content->getSecondaryDataUpdates( $page->getTitle() ); - DataUpdate::runUpdates( $updates ); + foreach ( $content->getSecondaryDataUpdates( $page->getTitle() ) as $update ) { + DeferredUpdates::addUpdate( $update ); + } } /** -- To view, visit https://gerrit.wikimedia.org/r/308127 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I51df9f419d6ea1e822fd0eef8c5dc4c43f9855e1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CentralNotice[master]: Account for DB lag when refreshing cached ChoiceData
AndyRussG has uploaded a new change for review. https://gerrit.wikimedia.org/r/308126 Change subject: Account for DB lag when refreshing cached ChoiceData .. Account for DB lag when refreshing cached ChoiceData This fixes an apparent race condition in which ObjectCache cached ChoiceData is invalidated following a change in campaign or banner settings, then a client request causes a cache miss and the cache is re-set using a laggy DB slave, causing the caching and serving of old ChoiceData. See https://github.com/wikimedia/mediawiki/blob/ce504f2d19b7450c75f0a332089a720e2ea402ce/ includes/libs/objectcache/WANObjectCache.php#L665 Bug: T144393 Change-Id: Id4e46b653554d39ac5721c4327774ccfce63b734 --- M includes/ChoiceDataProvider.php 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice refs/changes/26/308126/1 diff --git a/includes/ChoiceDataProvider.php b/includes/ChoiceDataProvider.php index 0d765fb..0f7dd91 100644 --- a/includes/ChoiceDataProvider.php +++ b/includes/ChoiceDataProvider.php @@ -42,8 +42,17 @@ $choices = $cache->getWithSetCallback( $dataKey, self::CACHE_TTL, - function () use ( $project, $language ) { - return self::fetchChoices( $project, $language ); + function ( $oldValue, &$ttl, array &$setOpts ) + use ( $project, $language ) { + + $dbr = CNDatabase::getDb( DB_SLAVE ); + + // Account for slave lag to prevent a race condition when + // campaigns are updated, the cache is invalidated, and + // a client queries a yet-unsynced slave DBs + $setOpts += Database::getCacheSetOptions( $dbr ); + + return self::fetchChoices( $project, $language, $dbr ); }, [ 'checkKeys' => [ $checkKey ], @@ -59,11 +68,10 @@ } ); } - private static function fetchChoices( $project, $language ) { + private static function fetchChoices( $project, $language, $dbr ) { // For speed, we'll do our own queries instead of using methods in // Campaign and Banner. - $dbr = CNDatabase::getDb( DB_SLAVE ); $cache = ObjectCache::getMainWANInstance(); // Set up conditions -- To view, visit https://gerrit.wikimedia.org/r/308126 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id4e46b653554d39ac5721c4327774ccfce63b734 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CentralNotice Gerrit-Branch: master Gerrit-Owner: AndyRussG___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...latex_renderer[master]: Document some things on osx
Arlolra has uploaded a new change for review. https://gerrit.wikimedia.org/r/308125 Change subject: Document some things on osx .. Document some things on osx Change-Id: I69c88cfa6611dfd00bf3699d05598874e1bf3e35 --- M README.md 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer refs/changes/25/308125/1 diff --git a/README.md b/README.md index a429daa..be39638 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,15 @@ Hyperlinks in generated PDFs will not resolve correctly unless the target wiki has [$wgUsePathInfo] enabled. +OS X users can, + +``` +brew cask install mactex +brew install imagemagick poppler +``` + +and download the [FreeSerif.ttf](7) and [Linux Libertine O.otf](8). + ## Generating bundles You may wish to install the [mw-ocg-bundler] npm package to create bundles @@ -105,3 +114,5 @@ [4]: https://david-dm.org/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer [5]: https://david-dm.org/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer/dev-status.svg [6]: https://david-dm.org/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer#info=devDependencies +[7]: https://savannah.gnu.org/projects/freefont/ +[8]: http://www.linuxlibertine.org/ -- To view, visit https://gerrit.wikimedia.org/r/308125 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I69c88cfa6611dfd00bf3699d05598874e1bf3e35 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer Gerrit-Branch: master Gerrit-Owner: Arlolra___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Removing type hint for the same reason as before
jenkins-bot has submitted this change and it was merged. Change subject: Removing type hint for the same reason as before .. Removing type hint for the same reason as before Change-Id: I0881773779938b8dcafdee2694fe935be324bfbd --- M includes/content/CollaborationHubContent.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harej: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/content/CollaborationHubContent.php b/includes/content/CollaborationHubContent.php index 1bcf3e5..19a1997 100644 --- a/includes/content/CollaborationHubContent.php +++ b/includes/content/CollaborationHubContent.php @@ -607,7 +607,7 @@ * @param string $icon data: either an icon id or anything to use as a seed * @return string */ - protected function makeIcon( string $icon ) { + protected function makeIcon( $icon ) { // Keep this synced with the icons listed in the module in extension.json $iconsPreset = [ // Randomly selectable items -- To view, visit https://gerrit.wikimedia.org/r/308124 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0881773779938b8dcafdee2694fe935be324bfbd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: HarejGerrit-Reviewer: Harej 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]: Removing type hint for the same reason as before
Harej has uploaded a new change for review. https://gerrit.wikimedia.org/r/308124 Change subject: Removing type hint for the same reason as before .. Removing type hint for the same reason as before Change-Id: I0881773779938b8dcafdee2694fe935be324bfbd --- M includes/content/CollaborationHubContent.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit refs/changes/24/308124/1 diff --git a/includes/content/CollaborationHubContent.php b/includes/content/CollaborationHubContent.php index 1bcf3e5..19a1997 100644 --- a/includes/content/CollaborationHubContent.php +++ b/includes/content/CollaborationHubContent.php @@ -607,7 +607,7 @@ * @param string $icon data: either an icon id or anything to use as a seed * @return string */ - protected function makeIcon( string $icon ) { + protected function makeIcon( $icon ) { // Keep this synced with the icons listed in the module in extension.json $iconsPreset = [ // Randomly selectable items -- To view, visit https://gerrit.wikimedia.org/r/308124 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0881773779938b8dcafdee2694fe935be324bfbd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: Harej___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Refund "country" argument is option, omit it
jenkins-bot has submitted this change and it was merged. Change subject: Refund "country" argument is option, omit it .. Refund "country" argument is option, omit it We don't have this easily available, and the docs suggest it can be optional in our case, because we're always refunding an existing transaction. Bug: T144489 Change-Id: I76d8f62f1b16e452da6aa5bc1d21a8b2b227a7a4 --- M globalcollect_gateway/globalcollect.adapter.php M globalcollect_gateway/scripts/refund.php 2 files changed, 5 insertions(+), 7 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/globalcollect_gateway/globalcollect.adapter.php b/globalcollect_gateway/globalcollect.adapter.php index 99b2d49..33e5138 100644 --- a/globalcollect_gateway/globalcollect.adapter.php +++ b/globalcollect_gateway/globalcollect.adapter.php @@ -295,7 +295,6 @@ 'MERCHANTREFERENCE', 'AMOUNT', 'CURRENCYCODE', - 'COUNTRYCODE', ) ) ) diff --git a/globalcollect_gateway/scripts/refund.php b/globalcollect_gateway/scripts/refund.php index 04e17db..39dfba1 100644 --- a/globalcollect_gateway/scripts/refund.php +++ b/globalcollect_gateway/scripts/refund.php @@ -10,7 +10,7 @@ // Refunds credit card transactions listed in a file. // Currently takes a CSV with no header and columns in this order: -// order_id, merchant_reference, effort_id, payment_submethod, country, currency_code, amount +// order_id, merchant_reference, effort_id, payment_submethod, currency_code, amount class GlobalCollectRefundMaintenance extends Maintenance { public function __construct() { parent::__construct(); @@ -34,8 +34,8 @@ $this->error( 'Could not find refund file: ' . $filename, true ); } while ( $refund = fgetcsv( $file ) ) { - if ( count( $refund ) !== 7 ) { - $this->error( 'Refund lines must have exactly 7 fields', true ); + if ( count( $refund ) !== 6 ) { + $this->error( 'Refund lines must have exactly 6 fields: order_id, merchant_reference, effort_id, payment_submethod, currency_code, amount', true ); } $oid = $refund[0]; $effort_id = $refund[2]; @@ -47,9 +47,8 @@ 'effort_id' => $effort_id, 'payment_method' => 'cc', 'payment_submethod' => $refund[3], - 'country' => $refund[4], - 'currency_code' => $refund[5], - 'amount' => $refund[6], + 'currency_code' => $refund[4], + 'amount' => $refund[5], ), ); -- To view, visit https://gerrit.wikimedia.org/r/308114 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I76d8f62f1b16e452da6aa5bc1d21a8b2b227a7a4 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: AwightGerrit-Reviewer: AndyRussG Gerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Ejegg Gerrit-Reviewer: Ssmith Gerrit-Reviewer: XenoRyet 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]: Removing type hinting since it causes bizarre error
jenkins-bot has submitted this change and it was merged. Change subject: Removing type hinting since it causes bizarre error .. Removing type hinting since it causes bizarre error Change-Id: I6ff577dd20c14ae40b4d9f0ec20a2dee89028210 --- M includes/content/CollaborationHubContent.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harej: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/content/CollaborationHubContent.php b/includes/content/CollaborationHubContent.php index 5d88177..1bcf3e5 100644 --- a/includes/content/CollaborationHubContent.php +++ b/includes/content/CollaborationHubContent.php @@ -564,7 +564,7 @@ * @param $link string html of the link itself * @return string html */ - protected function makeEditSectionLink( string $link ) { + protected function makeEditSectionLink( $link ) { $html = Html::rawElement( 'span', [ 'class' => 'mw-editsection' ], -- To view, visit https://gerrit.wikimedia.org/r/308122 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ff577dd20c14ae40b4d9f0ec20a2dee89028210 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: HarejGerrit-Reviewer: Harej 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]: Removing errant whitespace
Harej has uploaded a new change for review. https://gerrit.wikimedia.org/r/308123 Change subject: Removing errant whitespace .. Removing errant whitespace Change-Id: I5a2c337d76f8dd7e891369b6c9d78e0e6205ecea --- M includes/content/CollaborationHubContent.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit refs/changes/23/308123/1 diff --git a/includes/content/CollaborationHubContent.php b/includes/content/CollaborationHubContent.php index 2e3fc23..1bcf3e5 100644 --- a/includes/content/CollaborationHubContent.php +++ b/includes/content/CollaborationHubContent.php @@ -1,5 +1,5 @@ https://gerrit.wikimedia.org/r/308123 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a2c337d76f8dd7e891369b6c9d78e0e6205ecea Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: Harej___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Removing type hinting since it causes bizarre error
Harej has uploaded a new change for review. https://gerrit.wikimedia.org/r/308122 Change subject: Removing type hinting since it causes bizarre error .. Removing type hinting since it causes bizarre error Change-Id: I6ff577dd20c14ae40b4d9f0ec20a2dee89028210 --- M includes/content/CollaborationHubContent.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit refs/changes/22/308122/1 diff --git a/includes/content/CollaborationHubContent.php b/includes/content/CollaborationHubContent.php index 5d88177..2e3fc23 100644 --- a/includes/content/CollaborationHubContent.php +++ b/includes/content/CollaborationHubContent.php @@ -1,5 +1,5 @@ 'mw-editsection' ], -- To view, visit https://gerrit.wikimedia.org/r/308122 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ff577dd20c14ae40b4d9f0ec20a2dee89028210 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: Harej___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Removed dead code
jenkins-bot has submitted this change and it was merged. Change subject: Removed dead code .. Removed dead code Change-Id: Iac8b6a59b5cf91e5c69d20a5825a50663273ab85 --- M repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php b/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php index 7afffea..11fe688 100644 --- a/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php +++ b/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php @@ -62,7 +62,7 @@ return $array; } - private function removePageInfoAttributes( array $result, $entityId = null ) { + private function removePageInfoAttributes( array $result ) { $attributesToRemove = array( 'pageid', 'lastrevid', 'modified', 'title', 'ns' ); foreach ( $attributesToRemove as $attributeToRemove ) { @@ -107,7 +107,7 @@ $module = $this->getApiModule( GetEntities::class, 'wbgetentities', $params ); $result = $this->executeApiModule( $module ); - $actual = $this->removePageInfoAttributes( $result, $entityId ); + $actual = $this->removePageInfoAttributes( $result ); $this->assertEquals( $this->getExpectedJson( 'getentities' ), $actual ); } @@ -125,7 +125,7 @@ $module = $this->getApiModule( SetLabel::class, 'wbsetlabel', $params, true ); $result = $this->executeApiModule( $module ); - $actual = $this->removePageInfoAttributes( $result, $entityId ); + $actual = $this->removePageInfoAttributes( $result ); $this->assertEquals( $this->getExpectedJson( 'setlabel' ), $actual ); @@ -138,7 +138,7 @@ $module = $this->getApiModule( SetLabel::class, 'wbsetlabel', $params, true ); $result = $this->executeApiModule( $module ); - $actual = $this->removePageInfoAttributes( $result, $entityId ); + $actual = $this->removePageInfoAttributes( $result ); $this->assertEquals( $this->getExpectedJson( 'setlabel-removed' ), $actual ); } -- To view, visit https://gerrit.wikimedia.org/r/308120 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac8b6a59b5cf91e5c69d20a5825a50663273ab85 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De DauwGerrit-Reviewer: Addshore Gerrit-Reviewer: Hoo man 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...GuidedTour[master]: Allow passing a jQuery-wrapped node to attachTo
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/308121 Change subject: Allow passing a jQuery-wrapped node to attachTo .. Allow passing a jQuery-wrapped node to attachTo Bug: T143297 Change-Id: I637d963b159175ab68184b35c7c3696ca821ce2a --- M modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js M modules/ext.guidedTour.lib/ext.guidedTour.lib.TourBuilder.js 2 files changed, 10 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GuidedTour refs/changes/21/308121/1 diff --git a/modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js b/modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js index dc3d4af..d8cb501 100644 --- a/modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js +++ b/modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js @@ -506,19 +506,19 @@ * value for key has an invalid type */ function getValueForSkin( options, key ) { - var value = options[key], type = $.type( value ); - if ( type === 'string' ) { + var value = options[ key ], type = $.type( value ); + if ( type === 'string' || value instanceof $ ) { return value; - } else if ( type === 'object' ) { - if ( value[skin] !== undefined ) { - return value[skin]; + } else if ( $.isPlainObject( value ) ) { + if ( value[ skin ] !== undefined ) { + return value[ skin ]; } else if ( value.fallback !== undefined ) { return value.fallback; } else { throw new gt.TourDefinitionError( 'No \'' + key + '\' value for skin \'' + skin + '\' or for \'fallback\'' ); } } else { - throw new gt.TourDefinitionError( 'Value for \'' + key + '\' must be an object or a string.' ); + throw new gt.TourDefinitionError( 'Value for \'' + key + '\' must be an object, a jQuery set, or a string.' ); } } diff --git a/modules/ext.guidedTour.lib/ext.guidedTour.lib.TourBuilder.js b/modules/ext.guidedTour.lib/ext.guidedTour.lib.TourBuilder.js index 567492f..070d94e 100644 --- a/modules/ext.guidedTour.lib/ext.guidedTour.lib.TourBuilder.js +++ b/modules/ext.guidedTour.lib/ext.guidedTour.lib.TourBuilder.js @@ -94,9 +94,10 @@ * The position is automatically horizontally flipped if needed (LTR/RTL * interfaces). * -* @param {string|Object} stepSpec.attachTo The selector for an element to -* attach to, or an object for that purpose with the same format as -* position +* @param {string|Object|jQuery} stepSpec.attachTo The selector for an element to +* attach to, a jQuery-wrapped node, or an object for that purpose with the same +* format as position. The values within the structure can also be selectors or +* jQuery-wrapped nodes. * * @param {Function} [stepSpec.onShow] Function to execute immediately * before the guider is shown. Using this for gt.parseDescription or -- To view, visit https://gerrit.wikimedia.org/r/308121 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I637d963b159175ab68184b35c7c3696ca821ce2a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GuidedTour Gerrit-Branch: master Gerrit-Owner: Mattflaschen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Removed dead code
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/308120 Change subject: Removed dead code .. Removed dead code Change-Id: Iac8b6a59b5cf91e5c69d20a5825a50663273ab85 --- M repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/20/308120/1 diff --git a/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php b/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php index 7afffea..11fe688 100644 --- a/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php +++ b/repo/tests/phpunit/includes/Api/ApiJsonFormatTest.php @@ -62,7 +62,7 @@ return $array; } - private function removePageInfoAttributes( array $result, $entityId = null ) { + private function removePageInfoAttributes( array $result ) { $attributesToRemove = array( 'pageid', 'lastrevid', 'modified', 'title', 'ns' ); foreach ( $attributesToRemove as $attributeToRemove ) { @@ -107,7 +107,7 @@ $module = $this->getApiModule( GetEntities::class, 'wbgetentities', $params ); $result = $this->executeApiModule( $module ); - $actual = $this->removePageInfoAttributes( $result, $entityId ); + $actual = $this->removePageInfoAttributes( $result ); $this->assertEquals( $this->getExpectedJson( 'getentities' ), $actual ); } @@ -125,7 +125,7 @@ $module = $this->getApiModule( SetLabel::class, 'wbsetlabel', $params, true ); $result = $this->executeApiModule( $module ); - $actual = $this->removePageInfoAttributes( $result, $entityId ); + $actual = $this->removePageInfoAttributes( $result ); $this->assertEquals( $this->getExpectedJson( 'setlabel' ), $actual ); @@ -138,7 +138,7 @@ $module = $this->getApiModule( SetLabel::class, 'wbsetlabel', $params, true ); $result = $this->executeApiModule( $module ); - $actual = $this->removePageInfoAttributes( $result, $entityId ); + $actual = $this->removePageInfoAttributes( $result ); $this->assertEquals( $this->getExpectedJson( 'setlabel-removed' ), $actual ); } -- To view, visit https://gerrit.wikimedia.org/r/308120 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac8b6a59b5cf91e5c69d20a5825a50663273ab85 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove myself from TravisCI email subscriptions
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/308119 Change subject: Remove myself from TravisCI email subscriptions .. Remove myself from TravisCI email subscriptions Change-Id: If3d6bebe08f0c12bcad42fabc1a686abff0a038b --- M .travis.yml 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/19/308119/1 diff --git a/.travis.yml b/.travis.yml index 4092bd0..02a06c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,6 @@ notifications: email: recipients: - - jeroended...@gmail.com - abraham.taheriv...@wikimedia.de on_success: change on_failure: always -- To view, visit https://gerrit.wikimedia.org/r/308119 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3d6bebe08f0c12bcad42fabc1a686abff0a038b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ocg-collection[master]: Smash the global promise
Arlolra has uploaded a new change for review. https://gerrit.wikimedia.org/r/308118 Change subject: Smash the global promise .. Smash the global promise * Also, allow me to override what node is named. Change-Id: If8904b24530f2bf066cc84f9caa1577dd60f5a25 --- M Makefile M unify-package-json.js 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/ocg-collection refs/changes/18/308118/1 diff --git a/Makefile b/Makefile index 5532455..b591b28 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,12 @@ +NODE?=/usr/bin/env nodejs + all: debug core: export LINK=g++ rm -f ./package.json npm install prfun semver - ./unify-package-json.js + $(NODE) ./unify-package-json.js npm install npm update npm dedupe diff --git a/unify-package-json.js b/unify-package-json.js index 74254f2..9dbfaf0 100755 --- a/unify-package-json.js +++ b/unify-package-json.js @@ -18,7 +18,7 @@ util = require( 'util' ); try { - require('prfun'); + require('prfun/smash'); } catch ( err ) { console.err( "The 'prfun' library could not be loaded. Please `npm install prfun`") } -- To view, visit https://gerrit.wikimedia.org/r/308118 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8904b24530f2bf066cc84f9caa1577dd60f5a25 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/ocg-collection Gerrit-Branch: master Gerrit-Owner: Arlolra___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Allow moderating resolved topic
jenkins-bot has submitted this change and it was merged. Change subject: Allow moderating resolved topic .. Allow moderating resolved topic * Add 'suppress' and 'delete' actions to resolved topic * Remove restrictions on moderating resolved topic * api tests Bug: T142779 Change-Id: I1e444f12464ab61e4fa9b69de17368b818bc69d5 --- M FlowActions.php M includes/Block/Topic.php M tests/phpunit/api/ApiFlowModeratePostTest.php M tests/phpunit/api/ApiFlowModerateTopicTest.php 4 files changed, 63 insertions(+), 12 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/FlowActions.php b/FlowActions.php index 1e01bac..fd53bc0 100644 --- a/FlowActions.php +++ b/FlowActions.php @@ -534,7 +534,7 @@ PostRevision::MODERATED_NONE => array( 'flow-lock', 'flow-delete', 'flow-suppress' ), ), 'links' => array( 'topic', 'topic-history', 'watch-topic', 'unwatch-topic', 'topic-revision' ), - 'actions' => array( 'edit-topic-summary', 'restore-topic' ), + 'actions' => array( 'edit-topic-summary', 'restore-topic', 'delete-topic', 'suppress-topic' ), 'history' => array( 'i18n-message' => 'flow-rev-message-locked-topic', 'i18n-params' => array( diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php index c44c8a7..5bcaa5e 100644 --- a/includes/Block/Topic.php +++ b/includes/Block/Topic.php @@ -112,17 +112,6 @@ return; } - // If the topic is locked, the only allowed action is to unlock it - if ( - $topicTitle->isLocked() - && ( - $this->action !== 'lock-topic' - || !in_array( $this->submitted['moderationState'], array( 'unlock', /* BC for unlock: */ 'reopen' ) ) - ) - ) { - $this->addError( 'moderate', $this->context->msg( 'flow-error-topic-is-locked' ) ); - } - switch( $this->action ) { case 'edit-title': $this->validateEditTitle(); diff --git a/tests/phpunit/api/ApiFlowModeratePostTest.php b/tests/phpunit/api/ApiFlowModeratePostTest.php index 9a21f90..15b562e 100644 --- a/tests/phpunit/api/ApiFlowModeratePostTest.php +++ b/tests/phpunit/api/ApiFlowModeratePostTest.php @@ -53,4 +53,35 @@ $this->assertArrayHasKey( 'format', $revision['moderateReason'], $debug ); $this->assertEquals( 'plaintext', $revision['moderateReason']['format'], $debug ); } + + public function testModeratePostInLockedTopic() { + $topic = $this->createTopic(); + + $data = $this->doApiRequest( array( + 'page' => $topic['topic-page'], + 'token' => $this->getEditToken(), + 'action' => 'flow', + 'submodule' => 'lock-topic', + 'cotmoderationState' => AbstractRevision::MODERATED_LOCKED, + 'cotreason' => '<>&{};' + ) ); + + $debug = json_encode( $data ); + $this->assertEquals( 'ok', $data[0]['flow']['lock-topic']['status'], $debug ); + $this->assertCount( 1, $data[0]['flow']['lock-topic']['committed'], $debug ); + + $data = $this->doApiRequest( array( + 'page' => $topic['topic-page'], + 'token' => $this->getEditToken(), + 'action' => 'flow', + 'submodule' => 'moderate-post', + 'mpmoderationState' => AbstractRevision::MODERATED_HIDDEN, + 'mppostId' => $topic['post-id'], + 'mpreason' => '<>&{};' + ) ); + + $debug = json_encode( $data ); + $this->assertEquals( 'ok', $data[0]['flow']['moderate-post']['status'], $debug ); + $this->assertCount( 1, $data[0]['flow']['moderate-post']['committed'], $debug ); + } } diff --git a/tests/phpunit/api/ApiFlowModerateTopicTest.php b/tests/phpunit/api/ApiFlowModerateTopicTest.php index 0efdd63..d65b0b0 100644 --- a/tests/phpunit/api/ApiFlowModerateTopicTest.php +++ b/tests/phpunit/api/ApiFlowModerateTopicTest.php @@ -77,4 +77,35 @@ $this->assertArrayHasKey( 'topicId', $logParams, $debug ); $this->assertEquals( $topic['topic-id'], $logParams['topicId'], $debug ); } + + public function testModerateLockedTopic() { + $topic = $this->createTopic(); + + $data = $this->doApiRequest( array( + 'page' => $topic['topic-page'], + 'token' => $this->getEditToken(), +
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Provide title when parsing wikitext
jenkins-bot has submitted this change and it was merged. Change subject: Provide title when parsing wikitext .. Provide title when parsing wikitext Bug: T141460 Change-Id: I802c9c4bf964a060e44f25a487b5aec6f7d8c6b6 --- M includes/DiscussionParser.php M includes/formatters/EventPresentationModel.php M includes/formatters/MentionPresentationModel.php M tests/phpunit/DiscussionParserTest.php 4 files changed, 23 insertions(+), 6 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php index aa56923..ff63282 100644 --- a/includes/DiscussionParser.php +++ b/includes/DiscussionParser.php @@ -135,14 +135,16 @@ $snippet = self::getTextSnippet( self::stripSignature( self::stripHeader( $action['content'] ), $title ), $wgLang, - 150 ); + 150, + $title ); break; case 'new-section-with-comment': $header = self::extractHeader( $action['content'] ); $snippet = self::getTextSnippet( self::stripSignature( self::stripHeader( $action['content'] ), $title ), $wgLang, - 150 ); + 150, + $title ); break; } if ( $header ) { @@ -1170,11 +1172,12 @@ * @param string $text * @param Language $lang * @param int $length default 150 +* @param Title|null $title Page from which the text snippet is being extracted * @return string */ - static function getTextSnippet( $text, Language $lang, $length = 150 ) { + static function getTextSnippet( $text, Language $lang, $length = 150, $title = null ) { // Parse wikitext - $html = MessageCache::singleton()->parse( $text )->getText(); + $html = MessageCache::singleton()->parse( $text, $title )->getText(); $plaintext = self::htmlToText( $html ); return $lang->truncate( $plaintext, $length ); } diff --git a/includes/formatters/EventPresentationModel.php b/includes/formatters/EventPresentationModel.php index e02f437..36850af 100644 --- a/includes/formatters/EventPresentationModel.php +++ b/includes/formatters/EventPresentationModel.php @@ -507,7 +507,7 @@ protected function getTruncatedSectionTitle( $section ) { return $this->language->embedBidi( $this->language->truncate( - EchoDiscussionParser::getTextSnippet( $section, $this->language ), + EchoDiscussionParser::getTextSnippet( $section, $this->language, 150, $this->event->getTitle() ), self::SECTION_TITLE_RECOMMENDED_LENGTH, '...', false diff --git a/includes/formatters/MentionPresentationModel.php b/includes/formatters/MentionPresentationModel.php index 21d365b..fe38ba8 100644 --- a/includes/formatters/MentionPresentationModel.php +++ b/includes/formatters/MentionPresentationModel.php @@ -63,7 +63,9 @@ $msg->plaintextParams( EchoDiscussionParser::getTextSnippet( $content, - $this->language + $this->language, + 150, + $this->event->getTitle() ) ); return $msg; diff --git a/tests/phpunit/DiscussionParserTest.php b/tests/phpunit/DiscussionParserTest.php index 6c206e1..3dc91bc 100644 --- a/tests/phpunit/DiscussionParserTest.php +++ b/tests/phpunit/DiscussionParserTest.php @@ -1586,4 +1586,16 @@ return "ParserFunctions not enabled"; } } + + public function testGetTextSnippet() { + $this->assertEquals( + 'Page001', + EchoDiscussionParser::getTextSnippet( + '[[:{{BASEPAGENAME}}]]', + Language::factory( 'en' ), + 150, + Title::newFromText( 'Page001' ) + ) + ); +
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Set wgMathFileBackend to false for wikitech wikis
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/308117 Change subject: Set wgMathFileBackend to false for wikitech wikis .. Set wgMathFileBackend to false for wikitech wikis The Math extension can use a storage backend defined in wgMathFileBackend. If a falsy value is given instead, it prepares a local filesystem backend using $wgMathDirectory. In change 5726e947, we customized this directory. This change allows the Math extension to use it. This is a follow-up for 3406ee0b. Bug: T126628 Change-Id: I2147bf4fe1cbdc246e62fa18e2366f9528cd82ad --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/17/308117/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index f8e8ce9..5f7af96 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -14229,7 +14229,7 @@ 'wgMathFileBackend' => [ 'default' => 'global-multiwrite', - 'wikitech' => 'local-backend', // T126338, T126628 + 'wikitech' => false, // T126338, T126628 ], 'wgMathPath' => [ -- To view, visit https://gerrit.wikimedia.org/r/308117 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2147bf4fe1cbdc246e62fa18e2366f9528cd82ad Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Provide title when parsing wikitext
Sbisson has uploaded a new change for review. https://gerrit.wikimedia.org/r/308115 Change subject: Provide title when parsing wikitext .. Provide title when parsing wikitext Bug: T141460 Change-Id: I802c9c4bf964a060e44f25a487b5aec6f7d8c6b6 --- M includes/DiscussionParser.php M includes/formatters/EventPresentationModel.php M includes/formatters/MentionPresentationModel.php M tests/phpunit/DiscussionParserTest.php 4 files changed, 23 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/15/308115/1 diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php index aa56923..ff63282 100644 --- a/includes/DiscussionParser.php +++ b/includes/DiscussionParser.php @@ -135,14 +135,16 @@ $snippet = self::getTextSnippet( self::stripSignature( self::stripHeader( $action['content'] ), $title ), $wgLang, - 150 ); + 150, + $title ); break; case 'new-section-with-comment': $header = self::extractHeader( $action['content'] ); $snippet = self::getTextSnippet( self::stripSignature( self::stripHeader( $action['content'] ), $title ), $wgLang, - 150 ); + 150, + $title ); break; } if ( $header ) { @@ -1170,11 +1172,12 @@ * @param string $text * @param Language $lang * @param int $length default 150 +* @param Title|null $title Page from which the text snippet is being extracted * @return string */ - static function getTextSnippet( $text, Language $lang, $length = 150 ) { + static function getTextSnippet( $text, Language $lang, $length = 150, $title = null ) { // Parse wikitext - $html = MessageCache::singleton()->parse( $text )->getText(); + $html = MessageCache::singleton()->parse( $text, $title )->getText(); $plaintext = self::htmlToText( $html ); return $lang->truncate( $plaintext, $length ); } diff --git a/includes/formatters/EventPresentationModel.php b/includes/formatters/EventPresentationModel.php index e02f437..36850af 100644 --- a/includes/formatters/EventPresentationModel.php +++ b/includes/formatters/EventPresentationModel.php @@ -507,7 +507,7 @@ protected function getTruncatedSectionTitle( $section ) { return $this->language->embedBidi( $this->language->truncate( - EchoDiscussionParser::getTextSnippet( $section, $this->language ), + EchoDiscussionParser::getTextSnippet( $section, $this->language, 150, $this->event->getTitle() ), self::SECTION_TITLE_RECOMMENDED_LENGTH, '...', false diff --git a/includes/formatters/MentionPresentationModel.php b/includes/formatters/MentionPresentationModel.php index 21d365b..fe38ba8 100644 --- a/includes/formatters/MentionPresentationModel.php +++ b/includes/formatters/MentionPresentationModel.php @@ -63,7 +63,9 @@ $msg->plaintextParams( EchoDiscussionParser::getTextSnippet( $content, - $this->language + $this->language, + 150, + $this->event->getTitle() ) ); return $msg; diff --git a/tests/phpunit/DiscussionParserTest.php b/tests/phpunit/DiscussionParserTest.php index 6c206e1..3dc91bc 100644 --- a/tests/phpunit/DiscussionParserTest.php +++ b/tests/phpunit/DiscussionParserTest.php @@ -1586,4 +1586,16 @@ return "ParserFunctions not enabled"; } } + + public function testGetTextSnippet() { + $this->assertEquals( + 'Page001', + EchoDiscussionParser::getTextSnippet( + '[[:{{BASEPAGENAME}}]]', + Language::factory( 'en' ), + 150, + Title::newFromText( 'Page001' )
[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Allow moderating resolved topic
Sbisson has uploaded a new change for review. https://gerrit.wikimedia.org/r/308116 Change subject: Allow moderating resolved topic .. Allow moderating resolved topic * Add 'suppress' and 'delete' actions to resolved topic * Remove restrictions on moderating resolved topic * api tests Bug: T142779 Change-Id: I1e444f12464ab61e4fa9b69de17368b818bc69d5 --- M FlowActions.php M includes/Block/Topic.php M tests/phpunit/api/ApiFlowModeratePostTest.php M tests/phpunit/api/ApiFlowModerateTopicTest.php 4 files changed, 63 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/16/308116/1 diff --git a/FlowActions.php b/FlowActions.php index 1e01bac..fd53bc0 100644 --- a/FlowActions.php +++ b/FlowActions.php @@ -534,7 +534,7 @@ PostRevision::MODERATED_NONE => array( 'flow-lock', 'flow-delete', 'flow-suppress' ), ), 'links' => array( 'topic', 'topic-history', 'watch-topic', 'unwatch-topic', 'topic-revision' ), - 'actions' => array( 'edit-topic-summary', 'restore-topic' ), + 'actions' => array( 'edit-topic-summary', 'restore-topic', 'delete-topic', 'suppress-topic' ), 'history' => array( 'i18n-message' => 'flow-rev-message-locked-topic', 'i18n-params' => array( diff --git a/includes/Block/Topic.php b/includes/Block/Topic.php index c44c8a7..5bcaa5e 100644 --- a/includes/Block/Topic.php +++ b/includes/Block/Topic.php @@ -112,17 +112,6 @@ return; } - // If the topic is locked, the only allowed action is to unlock it - if ( - $topicTitle->isLocked() - && ( - $this->action !== 'lock-topic' - || !in_array( $this->submitted['moderationState'], array( 'unlock', /* BC for unlock: */ 'reopen' ) ) - ) - ) { - $this->addError( 'moderate', $this->context->msg( 'flow-error-topic-is-locked' ) ); - } - switch( $this->action ) { case 'edit-title': $this->validateEditTitle(); diff --git a/tests/phpunit/api/ApiFlowModeratePostTest.php b/tests/phpunit/api/ApiFlowModeratePostTest.php index 9a21f90..15b562e 100644 --- a/tests/phpunit/api/ApiFlowModeratePostTest.php +++ b/tests/phpunit/api/ApiFlowModeratePostTest.php @@ -53,4 +53,35 @@ $this->assertArrayHasKey( 'format', $revision['moderateReason'], $debug ); $this->assertEquals( 'plaintext', $revision['moderateReason']['format'], $debug ); } + + public function testModeratePostInLockedTopic() { + $topic = $this->createTopic(); + + $data = $this->doApiRequest( array( + 'page' => $topic['topic-page'], + 'token' => $this->getEditToken(), + 'action' => 'flow', + 'submodule' => 'lock-topic', + 'cotmoderationState' => AbstractRevision::MODERATED_LOCKED, + 'cotreason' => '<>&{};' + ) ); + + $debug = json_encode( $data ); + $this->assertEquals( 'ok', $data[0]['flow']['lock-topic']['status'], $debug ); + $this->assertCount( 1, $data[0]['flow']['lock-topic']['committed'], $debug ); + + $data = $this->doApiRequest( array( + 'page' => $topic['topic-page'], + 'token' => $this->getEditToken(), + 'action' => 'flow', + 'submodule' => 'moderate-post', + 'mpmoderationState' => AbstractRevision::MODERATED_HIDDEN, + 'mppostId' => $topic['post-id'], + 'mpreason' => '<>&{};' + ) ); + + $debug = json_encode( $data ); + $this->assertEquals( 'ok', $data[0]['flow']['moderate-post']['status'], $debug ); + $this->assertCount( 1, $data[0]['flow']['moderate-post']['committed'], $debug ); + } } diff --git a/tests/phpunit/api/ApiFlowModerateTopicTest.php b/tests/phpunit/api/ApiFlowModerateTopicTest.php index 0efdd63..d65b0b0 100644 --- a/tests/phpunit/api/ApiFlowModerateTopicTest.php +++ b/tests/phpunit/api/ApiFlowModerateTopicTest.php @@ -77,4 +77,35 @@ $this->assertArrayHasKey( 'topicId', $logParams, $debug ); $this->assertEquals( $topic['topic-id'], $logParams['topicId'], $debug ); } + + public function testModerateLockedTopic() { + $topic = $this->createTopic(); + + $data = $this->doApiRequest( array( + 'page' => $topic['topic-page'], +
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[REL1_27]: Don't cause fatals on preferences page when default skin is ...
jenkins-bot has submitted this change and it was merged. Change subject: Don't cause fatals on preferences page when default skin is Minerva .. Don't cause fatals on preferences page when default skin is Minerva Refactor onGetPreferences hook for readability. Bug: T141099 Change-Id: I0830c31f4ec0153a64ce104585102b2578a9e18f --- M includes/MobileFrontend.hooks.php 1 file changed, 21 insertions(+), 7 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 2e83fef..5eed8b5 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -904,6 +904,23 @@ } /** +* Check whether Minerva has been enabled as a desktop skin via the Minerva +* beta feature. +* +* @param User $user +* +* @return bool +*/ + private static function hasEnabledMinervaBetaFeature( $user ) { + $config = MobileContext::singleton()->getMFConfig(); + $mfEnableMinervaBetaFeature = $config->get( 'MFEnableMinervaBetaFeature' ); + $canEnableMinervaFeature = class_exists( 'BetaFeatures' ) && $mfEnableMinervaBetaFeature; + + return $canEnableMinervaFeature && + BetaFeatures::isFeatureEnabled( $user, 'betafeatures-minerva' ); + } + + /** * GetPreferences hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/GetPreferences * @@ -913,8 +930,8 @@ * @return bool */ public static function onGetPreferences( $user, &$preferences ) { - $mfEnableMinervaBetaFeature = MobileContext::singleton()->getMFConfig() - ->get( 'MFEnableMinervaBetaFeature' ); + $config = MobileContext::singleton()->getMFConfig(); + $defaultSkin = $config->get( 'DefaultSkin' ); $definition = array( 'type' => 'api', 'default' => '', @@ -923,11 +940,8 @@ $preferences[SpecialMobileWatchlist::VIEW_OPTION_NAME] = $definition; // Remove the Minerva skin from the preferences unless Minerva has been enabled in - // BetaFeatures. - if ( !class_exists( 'BetaFeatures' ) - || !BetaFeatures::isFeatureEnabled( $user, 'betafeatures-minerva' ) - || !$mfEnableMinervaBetaFeature - ) { + // BetaFeatures provided that the user has not set it as the default skin. + if ( $defaultSkin !== 'minerva' && !self::hasEnabledMinervaBetaFeature( $user ) ) { // Preference key/values are backwards. The value is the name of the skin. The // key is the text+links to display. if ( !empty( $preferences['skin']['options'] ) ) { -- To view, visit https://gerrit.wikimedia.org/r/307963 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0830c31f4ec0153a64ce104585102b2578a9e18f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: REL1_27 Gerrit-Owner: PhuedxGerrit-Reviewer: Jdlrobson 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...MobileFrontend[REL1_27]: build: Pass --path vendor/bundle to bundle install
jenkins-bot has submitted this change and it was merged. Change subject: build: Pass --path vendor/bundle to bundle install .. build: Pass --path vendor/bundle to bundle install Force ruby dependencies to be installed to vendor/bundle instead of using the default root-owned installation path. And add .bundle to .gitignore while we're at it. Bug: T143601 Change-Id: I83c5423c968048b236c5374aa5c9e408b33a7d80 --- M .gitignore M package.json 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/.gitignore b/.gitignore index b19d449..706ea28 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ .DS_Store composer.lock tests/report +.bundle/ diff --git a/package.json b/package.json index 781e1f2..173b974 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "scripts": { "test": "grunt test && npm run doc", - "predoc": "bundle install", + "predoc": "bundle install --path vendor/bundle", "doc": "bundle exec jsduck" }, "dependencies": { -- To view, visit https://gerrit.wikimedia.org/r/307986 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I83c5423c968048b236c5374aa5c9e408b33a7d80 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: REL1_27 Gerrit-Owner: PhuedxGerrit-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] operations/mediawiki-config[master]: Customize wgMathDirectory for wikitech
jenkins-bot has submitted this change and it was merged. Change subject: Customize wgMathDirectory for wikitech .. Customize wgMathDirectory for wikitech MediaWiki servers use /mnt/upload7/math as directory to store Math files, but on Wikitech, we need a local directory. Bug: T126628 Change-Id: Ic5953ed8eb4b3c4c1b58152df21c716628c57bf5 --- M wmf-config/CommonSettings.php M wmf-config/InitialiseSettings.php 2 files changed, 5 insertions(+), 1 deletion(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index 8bfea6a..4ffe4f2 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -2334,7 +2334,6 @@ } elseif ( $wmgUseMathML && $wmgUseRestbaseVRS ) { $wgDefaultUserOptions['math'] = 'mathml'; } - $wgMathDirectory = '/mnt/upload7/math'; // just for sanity $wgUseMathJax = true; // This variable points to non-WMF servers by default. // Prevent accidental use. diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4e1aa33..f8e8ce9 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -14238,6 +14238,11 @@ 'labtestwiki' => '//labtestwikitech.wikimedia.org/w/images/math', // T126338, T126628 ], +'wgMathDirectory' => [ + 'default' => '/mnt/upload7/math', + 'wikitech' => '/srv/math-images', // T126628 +], + 'wmgUseMoodBar' => [ 'default' => false, // Do not enable on any further wikis, T131340 'nlwiki' => true, // T34202 -- To view, visit https://gerrit.wikimedia.org/r/308110 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic5953ed8eb4b3c4c1b58152df21c716628c57bf5 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: DerecksonGerrit-Reviewer: Dereckson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Make refund "country" argument optional
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/308114 Change subject: Make refund "country" argument optional .. Make refund "country" argument optional We don't have this easily available, and the docs suggest it can be optional in our case, because we're always refunding an existing transaction. Bug: T144489 Change-Id: I76d8f62f1b16e452da6aa5bc1d21a8b2b227a7a4 --- M globalcollect_gateway/scripts/refund.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/14/308114/1 diff --git a/globalcollect_gateway/scripts/refund.php b/globalcollect_gateway/scripts/refund.php index 04e17db..8c3d858 100644 --- a/globalcollect_gateway/scripts/refund.php +++ b/globalcollect_gateway/scripts/refund.php @@ -47,11 +47,15 @@ 'effort_id' => $effort_id, 'payment_method' => 'cc', 'payment_submethod' => $refund[3], - 'country' => $refund[4], 'currency_code' => $refund[5], 'amount' => $refund[6], ), ); + // Docs say that country is only requied "for orders that do not + // exist yet in WebCollect." + if ( $refund[4] ) { + $gateway_opts['external_data']['country'] = $refund[4]; + } $this->output( "Refunding transaction $oid\n" ); $adapter = new GlobalCollectAdapter( $gateway_opts ); -- To view, visit https://gerrit.wikimedia.org/r/308114 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I76d8f62f1b16e452da6aa5bc1d21a8b2b227a7a4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Fix notification page width responsiveness issues
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/308113 Change subject: Fix notification page width responsiveness issues .. Fix notification page width responsiveness issues Have the page hide the sidebar at 982px, when there is not enough room for both (and when vector switches down to SD). Make inbox responsive when resizing. Change-Id: I3daae156d1ebb0619090d466caa5138d0d98e937 --- M modules/echo.variables.less M modules/nojs/mw.echo.special.less M modules/styles/mw.echo.ui.DatedSubGroupListWidget.less M modules/styles/mw.echo.ui.NotificationItemWidget.less M modules/styles/mw.echo.ui.NotificationsInboxWidget.less 5 files changed, 13 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/13/308113/1 diff --git a/modules/echo.variables.less b/modules/echo.variables.less index f6f0b9a..f70cf4e 100644 --- a/modules/echo.variables.less +++ b/modules/echo.variables.less @@ -22,10 +22,9 @@ @specialpage-separation-unit: 0.7em; @specialpage-sidebar-width: 20em; -@specialpage-mobile-width-small: 320px; -@specialpage-mobile-width-medium: 768px; +@specialpage-hd-width: 982px; -@specialpage-width: 700px; +@specialpage-width: 1000px; @grey-light: #777; @grey-medium: #555; diff --git a/modules/nojs/mw.echo.special.less b/modules/nojs/mw.echo.special.less index 5b308b6..93bf6db 100644 --- a/modules/nojs/mw.echo.special.less +++ b/modules/nojs/mw.echo.special.less @@ -23,7 +23,7 @@ display: none; } -@media all and ( min-width: @specialpage-mobile-width-medium ) { +@media all and ( min-width: @specialpage-hd-width ) { .client-js #mw-content-text { margin-top: 2em; } @@ -165,7 +165,7 @@ margin: 0; } -@media all and ( max-width: @specialpage-mobile-width-medium ) { +@media all and ( max-width: @specialpage-hd-width - 1 ) { .pre-content.heading-holder { // Center 'preferences' in mobile special page text-align: center; diff --git a/modules/styles/mw.echo.ui.DatedSubGroupListWidget.less b/modules/styles/mw.echo.ui.DatedSubGroupListWidget.less index edd109f..a8fb3a4 100644 --- a/modules/styles/mw.echo.ui.DatedSubGroupListWidget.less +++ b/modules/styles/mw.echo.ui.DatedSubGroupListWidget.less @@ -4,7 +4,7 @@ // concatenation works inside the items. This is an issue // with css' table-layout, which notification items are // set to - width: @specialpage-width; + width: 100%; &-title { font-weight: normal; @@ -24,10 +24,7 @@ } } - @media all and ( max-width: @specialpage-mobile-width-medium ) { - // Make narrow - width: @specialpage-mobile-width-small; - + @media all and ( max-width: @specialpage-hd-width - 1 ) { .mw-echo-ui-subGroupListWidget-header-row-markAllReadButton { font-size: 0.8em; } @@ -39,10 +36,5 @@ &-title-secondary { display: none; } - } - - @media all and ( max-width: @specialpage-mobile-width-small ) { - // Make narrow with margin - width: @specialpage-mobile-width-small - 32px; } } diff --git a/modules/styles/mw.echo.ui.NotificationItemWidget.less b/modules/styles/mw.echo.ui.NotificationItemWidget.less index 1285a3a..795ff67 100644 --- a/modules/styles/mw.echo.ui.NotificationItemWidget.less +++ b/modules/styles/mw.echo.ui.NotificationItemWidget.less @@ -147,7 +147,7 @@ &-header { width: 100%; - @media all and ( min-width: @specialpage-mobile-width-medium ) { + @media all and ( min-width: @specialpage-hd-width ) { // On small screens, don't truncate position: absolute; .mw-echo-ui-mixin-one-line-truncated; diff --git a/modules/styles/mw.echo.ui.NotificationsInboxWidget.less b/modules/styles/mw.echo.ui.NotificationsInboxWidget.less index 20c50e5..adc51bb 100644 --- a/modules/styles/mw.echo.ui.NotificationsInboxWidget.less +++ b/modules/styles/mw.echo.ui.NotificationsInboxWidget.less @@ -1,6 +1,9 @@ @import '../echo.variables'; .mw-echo-ui-notificationsInboxWidget { - width: @specialpage-width; + display: table; + width: 100%; + max-width: @specialpage-width; + &-row { display: table-row; width: 100%; @@ -19,7 +22,7 @@ padding-right: 1em; vertical-align: top; - @media all and ( max-width:
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Create /srv/math-images on wikitech hosts
Dzahn has submitted this change and it was merged. Change subject: Create /srv/math-images on wikitech hosts .. Create /srv/math-images on wikitech hosts To deploy Math extension on Wikitech hosts, we need to write files. As it's not desired to connect to swift, we'll store files locally. Bug: T126628 Change-Id: If99e9ecdec634a4378fdef3dcfbeae7d54bf7373 --- M modules/role/manifests/labs/openstack/nova.pp 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Dzahn: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/role/manifests/labs/openstack/nova.pp b/modules/role/manifests/labs/openstack/nova.pp index cbee652..76c4743 100644 --- a/modules/role/manifests/labs/openstack/nova.pp +++ b/modules/role/manifests/labs/openstack/nova.pp @@ -113,6 +113,14 @@ check_command => 'check_wikitech_static', } +# For Math extensions file (T126628) +file { '/srv/math-images': +ensure => 'directory', +owner => 'www-data', +group => 'www-data', +mode => '0755', +} + class { '::nutcracker': mbuf_size => '64k', verbosity => 2, -- To view, visit https://gerrit.wikimedia.org/r/308112 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If99e9ecdec634a4378fdef3dcfbeae7d54bf7373 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: DerecksonGerrit-Reviewer: Alex Monk Gerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Create /srv/math-images on wikitech hosts
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/308112 Change subject: Create /srv/math-images on wikitech hosts .. Create /srv/math-images on wikitech hosts To deploy Math extension on Wikitech hosts, we need to write files. As it's not desired to connect to swift, we'll store files locally. Bug: T126628 Change-Id: If99e9ecdec634a4378fdef3dcfbeae7d54bf7373 --- M modules/role/manifests/labs/openstack/nova.pp 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/12/308112/1 diff --git a/modules/role/manifests/labs/openstack/nova.pp b/modules/role/manifests/labs/openstack/nova.pp index cbee652..76c4743 100644 --- a/modules/role/manifests/labs/openstack/nova.pp +++ b/modules/role/manifests/labs/openstack/nova.pp @@ -113,6 +113,14 @@ check_command => 'check_wikitech_static', } +# For Math extensions file (T126628) +file { '/srv/math-images': +ensure => 'directory', +owner => 'www-data', +group => 'www-data', +mode => '0755', +} + class { '::nutcracker': mbuf_size => '64k', verbosity => 2, -- To view, visit https://gerrit.wikimedia.org/r/308112 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If99e9ecdec634a4378fdef3dcfbeae7d54bf7373 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: google_api_proxy: Add role for Google-api-proxy Labs project
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/308111 Change subject: google_api_proxy: Add role for Google-api-proxy Labs project .. google_api_proxy: Add role for Google-api-proxy Labs project Add a role that can be used to provision one or more nginx reverse proxies in the Google-api-proxy Labs project. This project provides static outbound IP addresses for Tool Labs tools and other Labs projects that are using Google APIs. Expected to be used with wikitech managed hiera configuration similar to: role::google_api_proxy::instances: google-api-proxy.wmflabs.org: proxied: https://www.googleapis.com default: true googlevision-api-proxy.wmflabs.org: proxied: https://vision.googleapis.com Bug: T144290 Change-Id: I2fe92633d716b0bfb4f9b9928cd7bbc7d3977be0 --- A modules/external_proxy/manifests/instance.pp A modules/external_proxy/templates/instance.conf.erb A modules/role/manifests/google_api_proxy.pp 3 files changed, 91 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/11/308111/1 diff --git a/modules/external_proxy/manifests/instance.pp b/modules/external_proxy/manifests/instance.pp new file mode 100644 index 000..4cb92fd --- /dev/null +++ b/modules/external_proxy/manifests/instance.pp @@ -0,0 +1,28 @@ +# = Define: external_proxy::instance +# +# Provision an nginx vhost that acts as a reverse proxy to the given URL. +# +# == Parameters: +# [*proxied*] +# URL of proxied server. Example 'https://localhost:8443' +# [*acls*] +# Ordered list of nginx access control directives to apply. +# See https://nginx.org/en/docs/http/ngx_http_access_module. +# [*port*] +# Port that nginx should listen on. Default: 80. +# [*default*] +# Should this vhost be the default for Host values that are otherwise +# unhandled? Default: false. +# +define external_proxy::instance ( +$proxied, +$acls, +$port= 80, +$default = false, +){ +include ::nginx +nginx::site { $vhost: +content => template('external_proxy/instance.conf.erb'), +} +} +# vim:sw=4:ts=4:sts=4:ft=puppet: diff --git a/modules/external_proxy/templates/instance.conf.erb b/modules/external_proxy/templates/instance.conf.erb new file mode 100644 index 000..13938f7 --- /dev/null +++ b/modules/external_proxy/templates/instance.conf.erb @@ -0,0 +1,23 @@ +# This file is managed by Puppet. +# See modules/external_proxy/templates/instance.conf.erb +server { +listen <%= @port %><% if @default %> default_server<% end %>; +listen [::]:<%= @port %><% if @default %> default_server<% end %>; +server_name <%= @title %>; + +location / { +# Access control +<% @acls.each do |acl| -%> +<%= acl %> +<% end -%> + +# Act as a reverse proxy to <%= @proxied %> +proxy_http_version 1.1; +proxy_pass <%= @proxied %>; +# Rewrite Location headers in proxied responses +proxy_redirect <%= @proxied %>/ /; +# Rewrite Set-Cookie headers in proxied responses +proxy_cookie_domain <%= @proxied %> $host; + +} +} diff --git a/modules/role/manifests/google_api_proxy.pp b/modules/role/manifests/google_api_proxy.pp new file mode 100644 index 000..ba53526 --- /dev/null +++ b/modules/role/manifests/google_api_proxy.pp @@ -0,0 +1,40 @@ +# == Class: role::google_api_proxy +# +# Provision nginx reverse proxy vhosts for accessing Google API endpoints from +# inside Labs via a fixed IP address. +# +# == Parameters: +# [*instances*] +# A hash mapping vhost names to external_proxy::instance parameters. +# +# == Usage +# class { 'role::google_api_proxy' +# $instances => { +# 'google-api-proxy.wmflabs.org' => { +# 'proxied' => 'https://www.googleapis.com', +# 'default' => true, +# }, +# 'googlevision-api-proxy.wmflabs.org' => { +# 'proxied' => 'https://vision.googleapis.com', +# }, +# }, +# } +# +# filtertags: labs-project-google-api-proxy +class role::google_api_proxy ( +$instances, +) { +create_resources( +'::external_proxy::instance' +$instances, +{ +'acls': [ +'deny 10.68.21.68; # IP we see if XFF unwrapping didn't work', +'allow 10.68.16.0/21; # All of Labs', +'allow 127.0.0.1;', +'deny all;', +], +} +) +} +# vim:sw=4:ts=4:sts=4:ft=puppet: -- To view, visit https://gerrit.wikimedia.org/r/308111 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fe92633d716b0bfb4f9b9928cd7bbc7d3977be0 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BryanDavis___ MediaWiki-commits mailing list
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Remove unused CSS and icon for old preferences button
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused CSS and icon for old preferences button .. Remove unused CSS and icon for old preferences button Change-Id: I0ba1d1322c4c53fe7fefd92be85fd595198a63c9 --- D modules/icons/Preferences.png M modules/nojs/mw.echo.special.less 2 files changed, 0 insertions(+), 16 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/icons/Preferences.png b/modules/icons/Preferences.png deleted file mode 100644 index ff89242..000 --- a/modules/icons/Preferences.png +++ /dev/null Binary files differ diff --git a/modules/nojs/mw.echo.special.less b/modules/nojs/mw.echo.special.less index 5b308b6..7f2ec82 100644 --- a/modules/nojs/mw.echo.special.less +++ b/modules/nojs/mw.echo.special.less @@ -40,22 +40,6 @@ height: 19px; width: 19px; } - - #mw-echo-pref-link { - float: right; - margin: 5px 3px; - /* @embed */ - background-image: url(../icons/Preferences.png); - background-repeat: no-repeat; - background-position: 0 0; - filter: alpha(opacity=50); - opacity: 0.5; - - &:hover { - filter: alpha(opacity=100); - opacity: 1.0; - } - } } .mw-echo-date-section { -- To view, visit https://gerrit.wikimedia.org/r/308109 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ba1d1322c4c53fe7fefd92be85fd595198a63c9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: EsandersGerrit-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] operations/mediawiki-config[master]: Customize wgMathDirectory for wikitech
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/308110 Change subject: Customize wgMathDirectory for wikitech .. Customize wgMathDirectory for wikitech MediaWiki servers use /mnt/upload7/math as directory to store Math files, but on Wikitech, we need a local directory. Bug: T126628 Change-Id: Ic5953ed8eb4b3c4c1b58152df21c716628c57bf5 --- M wmf-config/CommonSettings.php M wmf-config/InitialiseSettings.php 2 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/10/308110/1 diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index 8bfea6a..4ffe4f2 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -2334,7 +2334,6 @@ } elseif ( $wmgUseMathML && $wmgUseRestbaseVRS ) { $wgDefaultUserOptions['math'] = 'mathml'; } - $wgMathDirectory = '/mnt/upload7/math'; // just for sanity $wgUseMathJax = true; // This variable points to non-WMF servers by default. // Prevent accidental use. diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 4e1aa33..f8e8ce9 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -14238,6 +14238,11 @@ 'labtestwiki' => '//labtestwikitech.wikimedia.org/w/images/math', // T126338, T126628 ], +'wgMathDirectory' => [ + 'default' => '/mnt/upload7/math', + 'wikitech' => '/srv/math-images', // T126628 +], + 'wmgUseMoodBar' => [ 'default' => false, // Do not enable on any further wikis, T131340 'nlwiki' => true, // T34202 -- To view, visit https://gerrit.wikimedia.org/r/308110 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic5953ed8eb4b3c4c1b58152df21c716628c57bf5 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Remove unused CSS and icon for old preferences button
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/308109 Change subject: Remove unused CSS and icon for old preferences button .. Remove unused CSS and icon for old preferences button Change-Id: I0ba1d1322c4c53fe7fefd92be85fd595198a63c9 --- D modules/icons/Preferences.png M modules/nojs/mw.echo.special.less 2 files changed, 0 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/09/308109/1 diff --git a/modules/icons/Preferences.png b/modules/icons/Preferences.png deleted file mode 100644 index ff89242..000 --- a/modules/icons/Preferences.png +++ /dev/null Binary files differ diff --git a/modules/nojs/mw.echo.special.less b/modules/nojs/mw.echo.special.less index 5b308b6..7f2ec82 100644 --- a/modules/nojs/mw.echo.special.less +++ b/modules/nojs/mw.echo.special.less @@ -40,22 +40,6 @@ height: 19px; width: 19px; } - - #mw-echo-pref-link { - float: right; - margin: 5px 3px; - /* @embed */ - background-image: url(../icons/Preferences.png); - background-repeat: no-repeat; - background-position: 0 0; - filter: alpha(opacity=50); - opacity: 0.5; - - &:hover { - filter: alpha(opacity=100); - opacity: 1.0; - } - } } .mw-echo-date-section { -- To view, visit https://gerrit.wikimedia.org/r/308109 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ba1d1322c4c53fe7fefd92be85fd595198a63c9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Esanders___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding license information for icons
jenkins-bot has submitted this change and it was merged. Change subject: Adding license information for icons .. Adding license information for icons Change-Id: I720dce9cb022726b03bbdef3fc5752b13804862b --- A modules/images/icons/LICENSE 1 file changed, 19 insertions(+), 0 deletions(-) Approvals: Harej: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/images/icons/LICENSE b/modules/images/icons/LICENSE new file mode 100644 index 000..4820eed --- /dev/null +++ b/modules/images/icons/LICENSE @@ -0,0 +1,19 @@ +Icons Copyright © 2015 Wikimedia Foundation + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +The Software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall the +authors or copyright holders be liable for any claim, damages or other +liability, whether in an action of contract, tort or otherwise, arising from, +out of or in connection with the Software or the use or other dealings in the +Software. -- To view, visit https://gerrit.wikimedia.org/r/308106 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I720dce9cb022726b03bbdef3fc5752b13804862b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: HarejGerrit-Reviewer: Brian Wolff Gerrit-Reviewer: Harej Gerrit-Reviewer: Isarra 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]: Convert 'generic' icon to SVG
jenkins-bot has submitted this change and it was merged. Change subject: Convert 'generic' icon to SVG .. Convert 'generic' icon to SVG Change-Id: I3a364720161ede8045c5a3f7cf51923966266c56 --- M Echo.php D modules/icons/Generic.png A modules/icons/generic.svg 3 files changed, 6 insertions(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/Echo.php b/Echo.php index aa13cf2..9d4e08f 100644 --- a/Echo.php +++ b/Echo.php @@ -327,7 +327,7 @@ // $wgEchoNotificationIcons['site']['url'] $wgEchoNotificationIcons = array( 'placeholder' => array( - 'path' => "$echoIconPath/Generic.png", + 'path' => "$echoIconPath/generic.svg", ), 'trash' => array( 'path' => "$echoIconPath/trash.svg", diff --git a/modules/icons/Generic.png b/modules/icons/Generic.png deleted file mode 100644 index 36a9fb1..000 --- a/modules/icons/Generic.png +++ /dev/null Binary files differ diff --git a/modules/icons/generic.svg b/modules/icons/generic.svg new file mode 100644 index 000..ec87a25 --- /dev/null +++ b/modules/icons/generic.svg @@ -0,0 +1,5 @@ + +http://www.w3.org/2000/svg; width="30" height="30" viewBox="0 0 30 30"> + + + -- To view, visit https://gerrit.wikimedia.org/r/278553 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3a364720161ede8045c5a3f7cf51923966266c56 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: EsandersGerrit-Reviewer: Catrope 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...WikimediaMaintenance[master]: Create cirrus indexes in both search clusters
EBernhardson has uploaded a new change for review. https://gerrit.wikimedia.org/r/308108 Change subject: Create cirrus indexes in both search clusters .. Create cirrus indexes in both search clusters Bug: T142181 Change-Id: I124e9aa182e25bea5181bbc6486726e4d2a41ed7 --- M addWiki.php 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance refs/changes/08/308108/1 diff --git a/addWiki.php b/addWiki.php index 63d2250..c7dbc7d 100644 --- a/addWiki.php +++ b/addWiki.php @@ -189,9 +189,12 @@ $this->setFundraisingLink( $domain, $lang ); # Create new search index - $searchIndex = $this->runChild( 'CirrusSearch\Maintenance\UpdateSearchIndexConfig' ); - $searchIndex->mOptions[ 'baseName' ] = $dbName; - $searchIndex->execute(); + foreach ( [ 'eqiad', 'codfw' ] as $cluster ) { + $searchIndex = $this->runChild( 'CirrusSearch\Maintenance\UpdateSearchIndexConfig' ); + $searchIndex->mOptions[ 'baseName' ] = $dbName; + $searchIndex->mOptions[ 'cluster' ] = $cluster; + $searchIndex->execute(); + } # Populate sites table $sitesPopulation = $this->runChild( -- To view, visit https://gerrit.wikimedia.org/r/308108 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I124e9aa182e25bea5181bbc6486726e4d2a41ed7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMaintenance Gerrit-Branch: master Gerrit-Owner: EBernhardson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMaintenance[wmf/1.28.0-wmf.3]: Create cirrus indexes in both search clusters
EBernhardson has uploaded a new change for review. https://gerrit.wikimedia.org/r/308107 Change subject: Create cirrus indexes in both search clusters .. Create cirrus indexes in both search clusters Bug: T142181 Change-Id: I124e9aa182e25bea5181bbc6486726e4d2a41ed7 --- M addWiki.php 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance refs/changes/07/308107/1 diff --git a/addWiki.php b/addWiki.php index 63d2250..c7dbc7d 100644 --- a/addWiki.php +++ b/addWiki.php @@ -189,9 +189,12 @@ $this->setFundraisingLink( $domain, $lang ); # Create new search index - $searchIndex = $this->runChild( 'CirrusSearch\Maintenance\UpdateSearchIndexConfig' ); - $searchIndex->mOptions[ 'baseName' ] = $dbName; - $searchIndex->execute(); + foreach ( [ 'eqiad', 'codfw' ] as $cluster ) { + $searchIndex = $this->runChild( 'CirrusSearch\Maintenance\UpdateSearchIndexConfig' ); + $searchIndex->mOptions[ 'baseName' ] = $dbName; + $searchIndex->mOptions[ 'cluster' ] = $cluster; + $searchIndex->execute(); + } # Populate sites table $sitesPopulation = $this->runChild( -- To view, visit https://gerrit.wikimedia.org/r/308107 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I124e9aa182e25bea5181bbc6486726e4d2a41ed7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMaintenance Gerrit-Branch: wmf/1.28.0-wmf.3 Gerrit-Owner: EBernhardson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...GuidedTour[master]: Don't actually flip direction of page for directionality uni...
jenkins-bot has submitted this change and it was merged. Change subject: Don't actually flip direction of page for directionality unit tests .. Don't actually flip direction of page for directionality unit tests This involves changing getShouldFlipHorizontally to take the two directionalities as parameters. The wrong values are still passed in when unrelated unit tests (that just call getShouldFlipHorizontally in the course of things) run (since the 'plain' QUnit page is not a MW page and is thus missing standard attributes). However, that doesn't affect anything, actual MW pages do the right thing, and the tests work. Change-Id: Ib73e60e52ba571c7f7fe6450d1412c964563d55b --- M modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js M modules/ext.guidedTour.lib/ext.guidedTour.lib.Tour.js M tests/qunit/ext.guidedTour.lib.tests.js 3 files changed, 45 insertions(+), 47 deletions(-) Approvals: Mooeypoo: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js b/modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js index eed270e..dc3d4af 100644 --- a/modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js +++ b/modules/ext.guidedTour.lib/ext.guidedTour.lib.Step.js @@ -840,15 +840,12 @@ * Initializes step, making it ready to be displayed. * Other methods call this after all augmentation is complete. * -* @param {boolean} shouldFlipHorizontally true to flip requested position -* horizontally before calling low-level guiders library, false otherwise -* * @return {jQuery.Promise} Promise that resolves successfully, except on AJAX failure * when mw.guidedTour.WikitextDescription or mw.Title are used for a description. * * @private */ - Step.prototype.initialize = function ( shouldFlipHorizontally ) { + Step.prototype.initialize = function () { var self = this, options = this.specification, passedInOnClose = options.onClose, passedInOnShow = options.onShow; @@ -911,7 +908,7 @@ if ( options.position !== undefined ) { options.position = getValueForSkin( options, 'position' ); - if ( shouldFlipHorizontally ) { + if ( this.tour.flipRTL ) { options.position = guiders.getFlippedPosition( options.position, { horizontal: true } ); diff --git a/modules/ext.guidedTour.lib/ext.guidedTour.lib.Tour.js b/modules/ext.guidedTour.lib/ext.guidedTour.lib.Tour.js index 7d26709..a11b6fa 100644 --- a/modules/ext.guidedTour.lib/ext.guidedTour.lib.Tour.js +++ b/modules/ext.guidedTour.lib/ext.guidedTour.lib.Tour.js @@ -115,6 +115,13 @@ */ this.cssClass = 'mw-guidedtour-tour-' + this.name; + /** +* Whether the tour should be flipped; see getShouldFlipHorizontally. +* +* Initialized in initialize() +*/ + this.flipRTL = null; + moduleName = internal.getTourModuleName( this.name ); /** @@ -135,30 +142,38 @@ this.isInitialized = false; } + // TODO: Change this to use before/after (T142267) /** * Determines whether guiders in this tour should be horizontally flipped due to LTR/RTL * * Considers the HTML element's dir attribute and body LTR/RTL classes in addition * to parameter. * +* We assume that all tours defined in extensions use LTR, as with CSS/LESS. +* +* We assume that tours defined on-wiki use their site's directionality. +* +* Examples: +* +* * A user on Arabic Wikipedia views an extension-defined tour in the default +* language for their wiki (Arabic). The tour is flipped. +* +* * A user on Hebrew Wikipedia writes a tour in the MediaWiki namespace. They +* view the tour in the default language (Hebrew). The tour is not flipped. +* +* * A user on English Wikipedia is browsing with the user language set to Farsi. +* They view an extension-defined tour. The tour is flipped. +* * @private * -* @param {boolean} isExtensionDefined true if the tour is extension-defined, -* false otherwise +* @param {'ltr'|'rtl'} interfaceDirection Direction the interface is being viewed +* in; can be changed by user preferences or uselang +* @param {'ltr'|'rtl'} siteDirection Main direction of site * * @return {boolean} true if steps should be flipped, false otherwise */ - Tour.prototype.getShouldFlipHorizontally =
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move run-on-add logic in DeferredUpdates to addUpdate()
jenkins-bot has submitted this change and it was merged. Change subject: Move run-on-add logic in DeferredUpdates to addUpdate() .. Move run-on-add logic in DeferredUpdates to addUpdate() Change-Id: I1b3ec21e07549f7250fa497f352fe1c131ddc88a --- M includes/deferred/DeferredUpdates.php 1 file changed, 11 insertions(+), 22 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index 48f1e8e..5918770 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -50,16 +50,26 @@ const BIG_QUEUE_SIZE = 100; /** -* Add an update to the deferred list +* Add an update to the deferred list to be run later by execute() +* +* In CLI mode, callback magic will also be used to run updates when safe * * @param DeferrableUpdate $update Some object that implements doUpdate() * @param integer $type DeferredUpdates constant (PRESEND or POSTSEND) (since 1.27) */ public static function addUpdate( DeferrableUpdate $update, $type = self::POSTSEND ) { + global $wgCommandLineMode; + if ( $type === self::PRESEND ) { self::push( self::$preSendUpdates, $update ); } else { self::push( self::$postSendUpdates, $update ); + } + + // Try to run the updates now if in CLI mode and no transaction is active. + // This covers scripts that don't/barely use the DB but make updates to other stores. + if ( $wgCommandLineMode ) { + self::tryOpportunisticExecute( 'run' ); } } @@ -96,8 +106,6 @@ } private static function push( array &$queue, DeferrableUpdate $update ) { - global $wgCommandLineMode; - if ( $update instanceof MergeableUpdate ) { $class = get_class( $update ); // fully-qualified class if ( isset( $queue[$class] ) ) { @@ -109,25 +117,6 @@ } } else { $queue[] = $update; - } - - // CLI scripts may forget to periodically flush these updates, - // so try to handle that rather than OOMing and losing them entirely. - // Try to run the updates as soon as there is no current wiki transaction. - static $waitingOnTrx = false; // de-duplicate callback - if ( $wgCommandLineMode && !$waitingOnTrx ) { - $lb = wfGetLB(); - $dbw = $lb->getAnyOpenConnection( $lb->getWriterIndex() ); - // Do the update as soon as there is no transaction - if ( $dbw && $dbw->trxLevel() ) { - $waitingOnTrx = true; - $dbw->onTransactionIdle( function() use ( &$waitingOnTrx ) { - DeferredUpdates::doUpdates(); - $waitingOnTrx = false; - } ); - } else { - self::doUpdates(); - } } } -- To view, visit https://gerrit.wikimedia.org/r/307979 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1b3ec21e07549f7250fa497f352fe1c131ddc88a Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CollaborationKit[master]: Adding license information for icons
Harej has uploaded a new change for review. https://gerrit.wikimedia.org/r/308106 Change subject: Adding license information for icons .. Adding license information for icons Change-Id: I720dce9cb022726b03bbdef3fc5752b13804862b --- A modules/images/icons/LICENSE 1 file changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CollaborationKit refs/changes/06/308106/1 diff --git a/modules/images/icons/LICENSE b/modules/images/icons/LICENSE new file mode 100644 index 000..4820eed --- /dev/null +++ b/modules/images/icons/LICENSE @@ -0,0 +1,19 @@ +Icons Copyright © 2015 Wikimedia Foundation + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +The Software is provided "as is", without warranty of any kind, express or +implied, including but not limited to the warranties of merchantability, +fitness for a particular purpose and noninfringement. In no event shall the +authors or copyright holders be liable for any claim, damages or other +liability, whether in an action of contract, tort or otherwise, arising from, +out of or in connection with the Software or the use or other dealings in the +Software. -- To view, visit https://gerrit.wikimedia.org/r/308106 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I720dce9cb022726b03bbdef3fc5752b13804862b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: Harej___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_27]: Always fail over to sync jobs when Special:RunJobs fails
jenkins-bot has submitted this change and it was merged. Change subject: Always fail over to sync jobs when Special:RunJobs fails .. Always fail over to sync jobs when Special:RunJobs fails * This makes sure that jobs run one way or another. Previously, the only time it had a fallback on error was when the socket creation failed. * Use canonical URL to avoid getting redirects or using URLs that don't work due to virtual hosts. * By default, do not use the special page if post-send updates are already supported (fastcgi and HHVM). * Also made a few cleanups and improved the logging. Bug: T68485 Bug: T107290 Change-Id: Ic2916099181ebeb5ae5143d444515db9ed13cee9 (cherry picked from commit 1cce2f77cd430bd783057850a93c911bba8d378e) (cherry picked from commit 6a9e507dc515c6116e691afc2148642bc5421b34) --- M includes/DefaultSettings.php M includes/MediaWiki.php 2 files changed, 58 insertions(+), 41 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 3d3335a..613c219 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -8028,7 +8028,10 @@ * execution finishes. * @since 1.23 */ -$wgRunJobsAsync = true; +$wgRunJobsAsync = ( + !function_exists( 'register_postsend_function' ) && + !function_exists( 'fastcgi_finish_request' ) +); /** * Number of rows to update per job diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 3dd7420..c882b0c 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -813,16 +813,18 @@ $runJobsLogger = LoggerFactory::getInstance( 'runJobs' ); + // Fall back to running the job(s) while the user waits if needed if ( !$this->config->get( 'RunJobsAsync' ) ) { - // Fall back to running the job here while the user waits $runner = new JobRunner( $runJobsLogger ); - $runner->run( [ 'maxJobs' => $n ] ); + $runner->run( [ 'maxJobs' => $n ] ); return; } + // Do not send request if there are probably no jobs try { - if ( !JobQueueGroup::singleton()->queuesHaveJobs( JobQueueGroup::TYPE_DEFAULT ) ) { - return; // do not send request if there are probably no jobs + $group = JobQueueGroup::singleton(); + if ( !$group->queuesHaveJobs( JobQueueGroup::TYPE_DEFAULT ) ) { + return; } } catch ( JobQueueError $e ) { MWExceptionHandler::logException( $e ); @@ -835,9 +837,8 @@ $query, $this->config->get( 'SecretKey' ) ); $errno = $errstr = null; - $info = wfParseUrl( $this->config->get( 'Server' ) ); - MediaWiki\suppressWarnings(); - $host = $info['host']; + $info = wfParseUrl( $this->config->get( 'CanonicalServer' ) ); + $host = $info ? $info['host'] : null; $port = 80; if ( isset( $info['scheme'] ) && $info['scheme'] == 'https' ) { $host = "tls://" . $host; @@ -846,47 +847,60 @@ if ( isset( $info['port'] ) ) { $port = $info['port']; } - $sock = fsockopen( + + MediaWiki\suppressWarnings(); + $sock = $host ? fsockopen( $host, $port, $errno, $errstr, - // If it takes more than 100ms to connect to ourselves there - // is a problem elsewhere. - 0.1 - ); + // If it takes more than 100ms to connect to ourselves there is a problem... + 0.100 + ) : false; MediaWiki\restoreWarnings(); - if ( !$sock ) { + + $invokedWithSuccess = true; + if ( $sock ) { + $special = SpecialPageFactory::getPage( 'RunJobs' ); + $url = $special->getPageTitle()->getCanonicalURL( $query ); + $req = ( + "POST $url HTTP/1.1\r\n" . + "Host: {$info['host']}\r\n" . + "Connection: Close\r\n" . + "Content-Length: 0\r\n\r\n" + ); + + $runJobsLogger->info( "Running $n job(s) via '$url'" ); + // Send a cron API request to be performed in the background. + // Give up if this
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable Math on wikitech
jenkins-bot has submitted this change and it was merged. Change subject: Enable Math on wikitech .. Enable Math on wikitech Analytics would like to be able to use the Math extension on Wikitech. As wikitech can't use global-multiwrite backend from silver, we use the local-backend instead to store files locally. Bug: T126338 Change-Id: I0b3f17021866b6a8461c6158d30505f8696afeb1 --- M wmf-config/InitialiseSettings.php 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Filippo Giunchedi: Looks good to me, but someone else must approve Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index a67d111..4e1aa33 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -14217,7 +14217,6 @@ // whether to use the Math extension 'wmgUseMath' => [ 'default' => true, // moved from MW core - 'wikitech' => false, 'loginwiki' => false, 'votewiki' => false, // T61702 ], @@ -14229,11 +14228,14 @@ ], 'wgMathFileBackend' => [ - 'default' => 'global-multiwrite' + 'default' => 'global-multiwrite', + 'wikitech' => 'local-backend', // T126338, T126628 ], 'wgMathPath' => [ 'default' => '//upload.wikimedia.org/math', + 'labswiki' => '//wikitech.wikimedia.org/w/images/math', // T126338, T126628 + 'labtestwiki' => '//labtestwikitech.wikimedia.org/w/images/math', // T126338, T126628 ], 'wmgUseMoodBar' => [ -- To view, visit https://gerrit.wikimedia.org/r/307494 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0b3f17021866b6a8461c6158d30505f8696afeb1 Gerrit-PatchSet: 4 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: DerecksonGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Alex Monk Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Filippo Giunchedi Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: remove commented out code
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/308102 Change subject: Hygiene: remove commented out code .. Hygiene: remove commented out code Change-Id: Ibfeb3541b03eaf1f96c2265d9512106aada0fca9 --- M app/src/androidTest/java/org/wikipedia/test/TranslationTests.java 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/02/308102/1 diff --git a/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java b/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java index 1f60266..18c26f4 100644 --- a/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java +++ b/app/src/androidTest/java/org/wikipedia/test/TranslationTests.java @@ -6,7 +6,6 @@ import android.test.ActivityInstrumentationTestCase2; import android.util.DisplayMetrics; import android.util.Log; -//import org.wikimedia.wikipedia.test.R; import org.wikipedia.R; import org.wikipedia.MainActivity; import org.wikipedia.model.BaseModel; -- To view, visit https://gerrit.wikimedia.org/r/308102 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibfeb3541b03eaf1f96c2265d9512106aada0fca9 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: simplify CardLargeHeaderView
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/308103 Change subject: Hygiene: simplify CardLargeHeaderView .. Hygiene: simplify CardLargeHeaderView • Fix title for RTL. • Remove unused subtitle. • Reduce View hierarchy depth. • Rename pageTitle to title. This View is generic and shouldn't assume an article title will be shown. Change-Id: Ie0bae4dd3b918e8e78aebf5c88bc24bf621e5c3b --- M app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java M app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java M app/src/main/java/org/wikipedia/feed/view/CardLargeHeaderView.java M app/src/main/res/layout/view_card_header_large.xml 4 files changed, 43 insertions(+), 60 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/03/308103/1 diff --git a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java index bbce74c..5d1ed1a 100644 --- a/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java +++ b/app/src/main/java/org/wikipedia/feed/becauseyouread/BecauseYouReadCardView.java @@ -43,8 +43,7 @@ .setCallback(getCallback()); header(header); CardLargeHeaderView largeHeader = new CardLargeHeaderView(getContext()) -.setPageTitle(card.pageTitle()) -.setSubtitle(card.subtitle()) +.setTitle(card.pageTitle()) .setImage(card.image()) .onClickListener(new SelectPageCallbackAdapter(card)); largeHeader(largeHeader); diff --git a/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java b/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java index 2908ac1..a5c8a63 100644 --- a/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java +++ b/app/src/main/java/org/wikipedia/feed/continuereading/ContinueReadingCardView.java @@ -37,7 +37,7 @@ .setCallback(getCallback()); header(header); CardLargeHeaderView largeHeader = new CardLargeHeaderView(getContext()) -.setPageTitle(card.title()) +.setTitle(card.title()) .setImage(card.image()) .onClickListener(new CardClickListener()); largeHeader(largeHeader); diff --git a/app/src/main/java/org/wikipedia/feed/view/CardLargeHeaderView.java b/app/src/main/java/org/wikipedia/feed/view/CardLargeHeaderView.java index 6fb67e3..18966f4 100644 --- a/app/src/main/java/org/wikipedia/feed/view/CardLargeHeaderView.java +++ b/app/src/main/java/org/wikipedia/feed/view/CardLargeHeaderView.java @@ -10,30 +10,27 @@ import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; import android.view.View; -import android.widget.FrameLayout; +import android.widget.RelativeLayout; import android.widget.TextView; import org.wikipedia.R; import org.wikipedia.views.FaceAndColorDetectImageView; -import org.wikipedia.views.GoneIfEmptyTextView; import butterknife.BindView; import butterknife.ButterKnife; -public class CardLargeHeaderView extends FrameLayout { +public class CardLargeHeaderView extends RelativeLayout { @BindView(R.id.view_card_header_large_background) View backgroundView; -@BindView(R.id.view_card_header_large_text_container) View textContainerView; @BindView(R.id.view_card_header_large_image) FaceAndColorDetectImageView imageView; -@BindView(R.id.view_card_header_large_page_title) TextView pageTitleView; -@BindView(R.id.view_card_header_large_subtitle) GoneIfEmptyTextView subtitleView; +@BindView(R.id.view_card_header_large_title) TextView titleView; public CardLargeHeaderView(Context context) { super(context); +resetBackgroundColor(); inflate(getContext(), R.layout.view_card_header_large, this); ButterKnife.bind(this); imageView.setOnImageLoadListener(new ImageLoadListener()); -resetBackgroundColor(); } @NonNull public CardLargeHeaderView setImage(@Nullable Uri uri) { @@ -42,32 +39,27 @@ return this; } -@NonNull public CardLargeHeaderView setSubtitle(@Nullable CharSequence subtitle) { -subtitleView.setText(subtitle == null ? null : subtitle.toString()); -return this; -} - -@NonNull public CardLargeHeaderView setPageTitle(@Nullable CharSequence title) { -pageTitleView.setText(title); +@NonNull public CardLargeHeaderView setTitle(@Nullable CharSequence title) { +titleView.setText(title); return this; } @NonNull public CardLargeHeaderView onClickListener(@Nullable OnClickListener listener) { -setOnClickListener(listener); +
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Update ViewTest to include system font size
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/308104 Change subject: Update ViewTest to include system font size .. Update ViewTest to include system font size Users may specify a font size multiplier. It's important that our Views are still usable under this configuration. Also some very light refactoring. Change-Id: I90e74878f49cbf5b4e6c7fd0afd808ac151adafe --- R app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-ltr-font1.0x-light.png C app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-rtl-font1.0x-light.png D app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-rtl-light.png R app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-480dp-en-ltr-font1.0x-light.png R app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-480dp-en-rtl-font1.0x-light.png R app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testSelect-120dp-en-ltr-font1.0x-dark.png C app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testSelect-120dp-en-ltr-font1.0x-light.png D app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testTheme-120dp-en-ltr-dark-deselected.png C app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testTheme-120dp-en-ltr-font1.0x-dark.png C app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testTheme-120dp-en-ltr-font1.0x-light.png D app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testTheme-120dp-en-ltr-light-deselected.png D app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testTheme-120dp-en-ltr-light-selected.png C app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testWidth-120dp-en-ltr-font1.0x-light.png A app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testWidth-120dp-en-ltr-font1.5x-light.png D app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testWidth-120dp-en-ltr-light.png A app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testWidth-720dp-en-ltr-font1.0x-light.png A app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testWidth-720dp-en-ltr-font1.5x-light.png D app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testWidth-720dp-en-ltr-light.png M app/src/androidTest/java/org/wikipedia/overhaul/navtab/NavTabViewTest.java M app/src/androidTest/java/org/wikipedia/test/ViewTest.java 20 files changed, 31 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/04/308104/1 diff --git a/app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-ltr-light.png b/app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-ltr-font1.0x-light.png similarity index 100% rename from app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-ltr-light.png rename to app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-ltr-font1.0x-light.png Binary files differ diff --git a/app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-ltr-light.png b/app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-rtl-font1.0x-light.png similarity index 100% copy from app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-ltr-light.png copy to app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-rtl-font1.0x-light.png Binary files differ diff --git a/app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-rtl-light.png b/app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-rtl-light.png deleted file mode 100644 index 09e1206..000 --- a/app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-120dp-en-rtl-light.png +++ /dev/null Binary files differ diff --git a/app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-480dp-en-ltr-light.png b/app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-480dp-en-ltr-font1.0x-light.png similarity index 100% rename from app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-480dp-en-ltr-light.png rename to app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-480dp-en-ltr-font1.0x-light.png Binary files differ diff --git a/app/screenshots-ref/org.wikipedia.overhaul.navtab.NavTabViewTest.testLayoutDirection-480dp-en-rtl-light.png
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Hygiene: remove unused constructors
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/308101 Change subject: Hygiene: remove unused constructors .. Hygiene: remove unused constructors All FeedCardViews are constructed in Javaland, not inflated. Remove unused and likely unsupported constructors. Change-Id: Ic159855c143be6edcff52167915fdc29a2945a36 --- M app/src/main/java/org/wikipedia/feed/view/FeedCardView.java 1 file changed, 0 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/01/308101/1 diff --git a/app/src/main/java/org/wikipedia/feed/view/FeedCardView.java b/app/src/main/java/org/wikipedia/feed/view/FeedCardView.java index 3d07566..c03f20d 100644 --- a/app/src/main/java/org/wikipedia/feed/view/FeedCardView.java +++ b/app/src/main/java/org/wikipedia/feed/view/FeedCardView.java @@ -4,21 +4,12 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.CardView; -import android.util.AttributeSet; public class FeedCardView extends CardView { @Nullable private FeedViewCallback callback; public FeedCardView(Context context) { super(context); -} - -public FeedCardView(Context context, AttributeSet attrs) { -super(context, attrs); -} - -public FeedCardView(Context context, AttributeSet attrs, int defStyleAttr) { -super(context, attrs, defStyleAttr); } @NonNull public FeedCardView setCallback(@Nullable FeedViewCallback callback) { -- To view, visit https://gerrit.wikimedia.org/r/308101 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic159855c143be6edcff52167915fdc29a2945a36 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Add CardLargeHeaderViewTest
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/308105 Change subject: Add CardLargeHeaderViewTest .. Add CardLargeHeaderViewTest Bug: T144401 Change-Id: I2da84116a5d4d2e85b6fd704fe61b6d00549406a --- A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testFocus-480dp-en-ltr-font1.0x-dark.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testFocus-480dp-en-ltr-font1.0x-light.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testLayoutDirection-480dp-en-ltr-font1.0x-light.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testLayoutDirection-480dp-en-rtl-font1.0x-light.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testTheme-480dp-en-ltr-font1.0x-dark.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testTheme-480dp-en-ltr-font1.0x-light.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.0x-light-image-long_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.0x-light-image-no_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.0x-light-image-short_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.0x-light-no_image-long_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.0x-light-no_image-no_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.0x-light-no_image-short_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.5x-light-image-long_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.5x-light-image-no_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.5x-light-image-short_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.5x-light-no_image-long_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.5x-light-no_image-no_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-320dp-en-ltr-font1.5x-light-no_image-short_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.0x-light-image-long_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.0x-light-image-no_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.0x-light-image-short_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.0x-light-no_image-long_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.0x-light-no_image-no_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.0x-light-no_image-short_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.5x-light-image-long_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.5x-light-image-no_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.5x-light-image-short_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.5x-light-no_image-long_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.5x-light-no_image-no_title.png A app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testWidth-480dp-en-ltr-font1.5x-light-no_image-short_title.png A app/src/androidTest/java/org/wikipedia/feed/view/CardLargeHeaderViewTest.java M app/src/androidTest/java/org/wikipedia/test/ViewTest.java 32 files changed, 106 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/05/308105/1 diff --git a/app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testFocus-480dp-en-ltr-font1.0x-dark.png b/app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testFocus-480dp-en-ltr-font1.0x-dark.png new file mode 100644 index 000..e30f47d --- /dev/null +++ b/app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testFocus-480dp-en-ltr-font1.0x-dark.png Binary files differ diff --git a/app/screenshots-ref/org.wikipedia.feed.view.CardLargeHeaderViewTest.testFocus-480dp-en-ltr-font1.0x-light.png
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: End lazy loading reference experiments
jenkins-bot has submitted this change and it was merged. Change subject: End lazy loading reference experiments .. End lazy loading reference experiments This is being put on hold for a while. We have collected enough data to assess this feature. Bug: T144240 Change-Id: I2055319fc76a947f86c4da66fb90c7916eb23f7b --- M wmf-config/InitialiseSettings.php 1 file changed, 0 insertions(+), 15 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index c8904a8..a67d111 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -14512,21 +14512,6 @@ 'base' => false, 'beta' => true, ], - // T136731 - 'thwiki' => [ - 'base' => true, - 'beta' => true, - ], - // T137822 - 'tlwiki' => [ - 'base' => true, - 'beta' => true, - ], - // T140197 - 'ruwiki' => [ - 'base' => true, - 'beta' => true, - ], ], 'wgMinervaUsePageActionBarV2' => [ -- To view, visit https://gerrit.wikimedia.org/r/307435 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2055319fc76a947f86c4da66fb90c7916eb23f7b Gerrit-PatchSet: 3 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: JdlrobsonGerrit-Reviewer: Dereckson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove $recursionGuard var from tryOpportunisticExecute()
jenkins-bot has submitted this change and it was merged. Change subject: Remove $recursionGuard var from tryOpportunisticExecute() .. Remove $recursionGuard var from tryOpportunisticExecute() Aside from there being no idle callback setting here, the old addUpdate() code that runs updates allows nesting updates. Make this support that for a few transitional commits. It will be changed later to simply order the sub-updates after their parent updates, keeping both outer scope for all updates and locality of related updates. Change-Id: I0ad4e9713a7893b981b7bb013e9db803eed663b2 --- M includes/deferred/DeferredUpdates.php 1 file changed, 10 insertions(+), 20 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index 5622f95..48f1e8e 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -195,29 +195,19 @@ * @since 1.28 */ public static function tryOpportunisticExecute( $mode = 'run' ) { - static $recursionGuard = false; - if ( $recursionGuard ) { - return false; // COMMITs trigger inside update loop and inside some updates + if ( !self::getBusyDbConnections() ) { + self::doUpdates( $mode ); + return true; } - try { - $recursionGuard = true; - if ( !self::getBusyDbConnections() ) { - self::doUpdates( $mode ); - return true; - } - - if ( self::pendingUpdatesCount() >= self::BIG_QUEUE_SIZE ) { - // If we cannot run the updates with outer transaction context, try to - // at least enqueue all the updates that support queueing to job queue - self::$preSendUpdates = self::enqueueUpdates( self::$preSendUpdates ); - self::$postSendUpdates = self::enqueueUpdates( self::$postSendUpdates ); - } - - return !self::pendingUpdatesCount(); - } finally { - $recursionGuard = false; + if ( self::pendingUpdatesCount() >= self::BIG_QUEUE_SIZE ) { + // If we cannot run the updates with outer transaction context, try to + // at least enqueue all the updates that support queueing to job queue + self::$preSendUpdates = self::enqueueUpdates( self::$preSendUpdates ); + self::$postSendUpdates = self::enqueueUpdates( self::$postSendUpdates ); } + + return !self::pendingUpdatesCount(); } /** -- To view, visit https://gerrit.wikimedia.org/r/307978 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ad4e9713a7893b981b7bb013e9db803eed663b2 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Set "run when DBs idle" DeferredUpdates logic in Maintenance
jenkins-bot has submitted this change and it was merged. Change subject: Set "run when DBs idle" DeferredUpdates logic in Maintenance .. Set "run when DBs idle" DeferredUpdates logic in Maintenance * This is a more robust version of the one inside DeferredUpdates (checking all DBs), which will be replaced in a later commit. * Make sure the listener is restored when the LB gets torn down in tests. Also, it should respect the $wgCommandLineMode value as tests can change it. Change-Id: I1e3faa5a058df44e2d27ab5ac185930867eb68ac --- M maintenance/Maintenance.php M tests/phpunit/MediaWikiTestCase.php 2 files changed, 33 insertions(+), 1 deletion(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 343687e..698fd9a 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -554,11 +554,38 @@ * @since 1.28 */ public function setTriggers() { + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + self::setLBFactoryTriggers( $lbFactory ); + } + + /** +* @param LBFactory $LBFactory +* @since 1.28 +*/ + public static function setLBFactoryTriggers( LBFactory $LBFactory ) { // Hook into period lag checks which often happen in long-running scripts $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); $lbFactory->setWaitForReplicationListener( __METHOD__, - [ 'DeferredUpdates', 'tryOpportunisticExecute' ] + function () { + global $wgCommandLineMode; + // Check config in case of JobRunner and unit tests + if ( $wgCommandLineMode ) { + DeferredUpdates::tryOpportunisticExecute( 'run' ); + } + } + ); + // Check for other windows to run them. A script may read or do a few writes + // to the master but mostly be writing to something else, like a file store. + $lbFactory->getMainLB()->setTransactionListener( + __METHOD__, + function ( $trigger ) { + global $wgCommandLineMode; + // Check config in case of JobRunner and unit tests + if ( $wgCommandLineMode && $trigger === IDatabase::TRIGGER_COMMIT ) { + DeferredUpdates::tryOpportunisticExecute( 'run' ); + } + } ); } diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 27f1454..541ac11 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -482,6 +482,11 @@ DeferredUpdates::clearPendingUpdates(); ObjectCache::getMainWANInstance()->clearProcessCache(); + // XXX: reset maintenance triggers + // Hook into period lag checks which often happen in long-running scripts + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + Maintenance::setLBFactoryTriggers( $lbFactory ); + ob_start( 'MediaWikiTestCase::wfResetOutputBuffersBarrier' ); } -- To view, visit https://gerrit.wikimedia.org/r/307975 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e3faa5a058df44e2d27ab5ac185930867eb68ac Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Krinkle 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...CirrusSearch[wmf/1.28.0-wmf.16]: Revert "Do not use the suggest reverse field if it's a non l...
jenkins-bot has submitted this change and it was merged. Change subject: Revert "Do not use the suggest reverse field if it's a non local search" .. Revert "Do not use the suggest reverse field if it's a non local search" No prod sites are running wmf.16 anymore, so this is unnecessary. This reverts commit 88b669ee80d7e4f0d390931caa0cb36541115e21. Change-Id: Ie3123eb2d807946a1a147959c8851edd30adf61b --- M includes/Query/FullTextQueryStringQueryBuilder.php 1 file changed, 3 insertions(+), 15 deletions(-) Approvals: EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Query/FullTextQueryStringQueryBuilder.php b/includes/Query/FullTextQueryStringQueryBuilder.php index 45decbb..9f22dfd 100644 --- a/includes/Query/FullTextQueryStringQueryBuilder.php +++ b/includes/Query/FullTextQueryStringQueryBuilder.php @@ -2,7 +2,6 @@ namespace CirrusSearch\Query; -use CirrusSearch\OtherIndexes; use CirrusSearch\SearchConfig; use CirrusSearch\Searcher; use CirrusSearch\Search\Escaper; @@ -223,7 +222,7 @@ if ( $showSuggestion ) { $searchContext->setSuggest( [ 'text' => $term, - 'suggest' => $this->buildSuggestConfig( 'suggest', $searchContext ), + 'suggest' => $this->buildSuggestConfig( 'suggest' ), ] ); } } @@ -260,10 +259,9 @@ * Build suggest config for $field. * * @param string $field field to suggest against -* @param SearchContext $searchContext * @return array[] array of Elastica configuration */ - private function buildSuggestConfig( $field, $searchContext ) { + private function buildSuggestConfig( $field ) { // check deprecated settings $suggestSettings = $this->config->get( 'CirrusSearchPhraseSuggestSettings' ); $maxErrors = $this->config->get( 'CirrusSearchPhraseSuggestMaxErrors' ); @@ -297,18 +295,8 @@ ], ], ]; - $extraIndexes = null; - if ( $searchContext->getNamespaces() ) { - $extraIndexes = OtherIndexes::getExtraIndexesForNamespaces( - $searchContext->getNamespaces() - ); - } // Add a second generator with the reverse field - // Only do this for local queries, we don't know if it's activated - // on other wikis. - if ( empty( $extraIndexes ) - && $this->config->getElement( 'CirrusSearchPhraseSuggestReverseField', 'use' ) - ) { + if ( $this->config->getElement( 'CirrusSearchPhraseSuggestReverseField', 'use' ) ) { $settings['phrase']['direct_generator'][] = [ 'field' => $field . '.reverse', 'suggest_mode' => $suggestSettings['mode'], -- To view, visit https://gerrit.wikimedia.org/r/308098 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie3123eb2d807946a1a147959c8851edd30adf61b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: wmf/1.28.0-wmf.16 Gerrit-Owner: EBernhardsonGerrit-Reviewer: DCausse Gerrit-Reviewer: EBernhardson Gerrit-Reviewer: Gehel Gerrit-Reviewer: Manybubbles 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...VisualEditor[master]: Add show preview to save dialog when in NWE
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/308100 Change subject: Add show preview to save dialog when in NWE .. Add show preview to save dialog when in NWE Bug: T142642 Change-Id: I679eaddfe9037dcf258d3ff7d1eaa44214f0e730 --- M extension.json M modules/ve-mw/init/ve.init.mw.ArticleTarget.js M modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js 3 files changed, 79 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/00/308100/1 diff --git a/extension.json b/extension.json index 92d2c0f..eecda8f 100644 --- a/extension.json +++ b/extension.json @@ -1202,6 +1202,7 @@ "publishpage", "savearticle", "savechanges", + "showpreview", "showtoc", "summary-preview", "toc", diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js index 23291f7..1eccdfe 100644 --- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js @@ -878,6 +878,34 @@ }; /** + * Handle clicks on the show preview button in the save dialog. + * + * @method + * @fires savePreview + */ +ve.init.mw.ArticleTarget.prototype.onSaveDialogPreview = function () { + var target = this; + if ( !this.saveDialog.$previewViewer.children().length ) { + this.emit( 'savePreview' ); + this.saveDialog.getActions().setAbilities( { approve: false } ); + this.saveDialog.pushPending(); + new mw.Api().post( { + action: 'visualeditor', + paction: 'parsefragment', + page: mw.config.get( 'wgRelevantPageName' ), + wikitext: this.getWikitextFromDocument( this.docToSave ) + } ).then( function ( response ) { + if ( ve.getProp( response, 'visualeditor', 'result' ) !== 'success' ) { + // TODO: handle failure + } + target.saveDialog.showPreview( response.visualeditor.content ); + } ); + } else { + this.saveDialog.swapPanel( 'preview' ); + } +}; + +/** * Handle completed serialize request for diff views for new page creations. * * @method @@ -1595,6 +1623,7 @@ target.saveDialog.connect( target, { save: 'onSaveDialogSave', review: 'onSaveDialogReview', + preview: 'onSaveDialogPreview', resolve: 'onSaveDialogResolveConflict', retry: 'onSaveDialogRetry', close: 'onSaveDialogClose' diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js index fb9699c..5edd1e1 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js @@ -57,17 +57,22 @@ { label: OO.ui.deferMsg( 'visualeditor-savedialog-label-resume-editing' ), flags: [ 'safe', 'back' ], - modes: [ 'save', 'review', 'conflict' ] + modes: [ 'save', 'review', 'preview', 'conflict' ] }, { action: 'review', label: OO.ui.deferMsg( 'visualeditor-savedialog-label-review' ), - modes: 'save' + modes: [ 'save', 'preview' ] + }, + { + action: 'preview', + label: OO.ui.deferMsg( 'showpreview' ), + modes: [ 'save', 'review' ] }, { action: 'approve', label: OO.ui.deferMsg( 'visualeditor-savedialog-label-review-good' ), - modes: 'review' + modes: [ 'review', 'preview' ] }, { action: 'resolve', @@ -89,6 +94,11 @@ /** * @event review * Emitted when the user clicks the review changes button + */ + +/** + * @event preview + * Emitted when the user clicks the show preview button */ /** @@ -116,6 +126,19 @@ }; /** + * Set preview content and show preview panel. + * + * @param {string} content Preview HTML + */ +ve.ui.MWSaveDialog.prototype.showPreview = function ( content ) { + this.$previewViewer.html( content ); + mw.hook( 'wikipage.content' ).fire( this.$previewViewer ); + this.actions.setAbilities( { approve: true } ); + this.popPending(); + this.swapPanel( 'preview' ); +}; + +/** * @inheritdoc */ ve.ui.MWSaveDialog.prototype.pushPending = function () { @@ -139,6 +162,7 @@ */
[MediaWiki-commits] [Gerrit] wikimedia...golden[master]: Generate invoke source and click position aggregates
Chelsyx has uploaded a new change for review. https://gerrit.wikimedia.org/r/308099 Change subject: Generate invoke source and click position aggregates .. Generate invoke source and click position aggregates To be added to search metrics dashboard Bug: T143726 Change-Id: Ib4fde72c1d3a898eab9256be89409790ff34afcd --- M search/app.R 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/golden refs/changes/99/308099/1 diff --git a/search/app.R b/search/app.R index c82f0bf..5e44f96 100644 --- a/search/app.R +++ b/search/app.R @@ -46,5 +46,28 @@ wmf::write_conditional(app_results, file.path(base_path, "app_event_counts.tsv")) wmf::write_conditional(load_times, file.path(base_path, "app_load_times.tsv")) + # Retrieve data for invoke source and click position + data2 <- wmf::build_query(fields = "SELECT SUBSTRING(timestamp, 1, 8) AS date, + event_action AS action, + userAgent, + event_source AS invoke_source, + event_position AS click_position", + date = date, + table = "MobileWikiAppSearch_15729321", + conditionals = "event_action IN ('click','start')") + data2 <- data.table::as.data.table(data2) + data2$date <- lubridate::ymd(data2$date) + data2$platform[grepl(x = data2$userAgent, pattern = "Android", fixed = TRUE)] <- "Android" + data2$platform[is.na(data2$platform)] <- "iOS" + data2 <- data2[,userAgent := NULL,] + + # Aggregate + source_count <- data2[data2$action=='start', j = list(events = .N), by = c("date","invoke_source")] + position_count <- data2[data2$action=='click', j = list(events = .N), by = c("date","click_position")] + + # Write out + wmf::write_conditional(source_count, file.path(base_path, "invoke_source_counts.tsv")) + wmf::write_conditional(position_count, file.path(base_path, "click_position_counts.tsv")) + return(invisible()) } -- To view, visit https://gerrit.wikimedia.org/r/308099 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib4fde72c1d3a898eab9256be89409790ff34afcd Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/golden Gerrit-Branch: master Gerrit-Owner: Chelsyx___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[wmf/1.28.0-wmf.16]: Revert "Do not use the suggest reverse field if it's a non l...
EBernhardson has uploaded a new change for review. https://gerrit.wikimedia.org/r/308098 Change subject: Revert "Do not use the suggest reverse field if it's a non local search" .. Revert "Do not use the suggest reverse field if it's a non local search" No prod sites are running wmf.16 anymore, so this is unnecessary. This reverts commit 88b669ee80d7e4f0d390931caa0cb36541115e21. Change-Id: Ie3123eb2d807946a1a147959c8851edd30adf61b --- M includes/Query/FullTextQueryStringQueryBuilder.php 1 file changed, 3 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch refs/changes/98/308098/1 diff --git a/includes/Query/FullTextQueryStringQueryBuilder.php b/includes/Query/FullTextQueryStringQueryBuilder.php index 45decbb..9f22dfd 100644 --- a/includes/Query/FullTextQueryStringQueryBuilder.php +++ b/includes/Query/FullTextQueryStringQueryBuilder.php @@ -2,7 +2,6 @@ namespace CirrusSearch\Query; -use CirrusSearch\OtherIndexes; use CirrusSearch\SearchConfig; use CirrusSearch\Searcher; use CirrusSearch\Search\Escaper; @@ -223,7 +222,7 @@ if ( $showSuggestion ) { $searchContext->setSuggest( [ 'text' => $term, - 'suggest' => $this->buildSuggestConfig( 'suggest', $searchContext ), + 'suggest' => $this->buildSuggestConfig( 'suggest' ), ] ); } } @@ -260,10 +259,9 @@ * Build suggest config for $field. * * @param string $field field to suggest against -* @param SearchContext $searchContext * @return array[] array of Elastica configuration */ - private function buildSuggestConfig( $field, $searchContext ) { + private function buildSuggestConfig( $field ) { // check deprecated settings $suggestSettings = $this->config->get( 'CirrusSearchPhraseSuggestSettings' ); $maxErrors = $this->config->get( 'CirrusSearchPhraseSuggestMaxErrors' ); @@ -297,18 +295,8 @@ ], ], ]; - $extraIndexes = null; - if ( $searchContext->getNamespaces() ) { - $extraIndexes = OtherIndexes::getExtraIndexesForNamespaces( - $searchContext->getNamespaces() - ); - } // Add a second generator with the reverse field - // Only do this for local queries, we don't know if it's activated - // on other wikis. - if ( empty( $extraIndexes ) - && $this->config->getElement( 'CirrusSearchPhraseSuggestReverseField', 'use' ) - ) { + if ( $this->config->getElement( 'CirrusSearchPhraseSuggestReverseField', 'use' ) ) { $settings['phrase']['direct_generator'][] = [ 'field' => $field . '.reverse', 'suggest_mode' => $suggestSettings['mode'], -- To view, visit https://gerrit.wikimedia.org/r/308098 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3123eb2d807946a1a147959c8851edd30adf61b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: wmf/1.28.0-wmf.16 Gerrit-Owner: EBernhardson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ZeroBanner[wmf/1.28.0-wmf.17]: Update router code
Dereckson has submitted this change and it was merged. Change subject: Update router code .. Update router code Router has moved to core, use it. Also run checkRoute method per documentation [1]. [1] https://github.com/wikimedia/mediawiki/blob/master/resources/lib/oojs-router/oojs-router.js#L104 Bug: T143425 Change-Id: Ic4fd397395e9ab361a95af4b10b740327db0163e (cherry picked from commit ca6c543caf62066ee306b06046df65392355a72e) --- M ZeroBanner.php M modules/interstitial.js M modules/zerobanner.interstitial/ZeroOverlay.js 3 files changed, 4 insertions(+), 3 deletions(-) Approvals: Dereckson: Verified; Looks good to me, approved diff --git a/ZeroBanner.php b/ZeroBanner.php index 68fec3a..441c115 100644 --- a/ZeroBanner.php +++ b/ZeroBanner.php @@ -95,8 +95,8 @@ $wgResourceModules['zerobanner'] = array( 'dependencies' => array( + 'mediawiki.router', 'mobile.settings', - 'mobile.startup', 'zerobanner.styles' ), 'localBasePath' => __DIR__, diff --git a/modules/interstitial.js b/modules/interstitial.js index 64dec2a..2dc60ae 100644 --- a/modules/interstitial.js +++ b/modules/interstitial.js @@ -1,7 +1,7 @@ /* global mw, jQuery */ ( function ( M, $ ) { 'use strict'; - var router = M.require( 'mobile.startup/router' ), + var router = require( 'mediawiki.router' ), settings = M.require( 'mobile.settings/settings' ); $( function () { @@ -224,4 +224,6 @@ } } ); + router.checkRoute(); + }( mw.mobileFrontend, jQuery ) ); diff --git a/modules/zerobanner.interstitial/ZeroOverlay.js b/modules/zerobanner.interstitial/ZeroOverlay.js index 98bb73d..f742d70 100644 --- a/modules/zerobanner.interstitial/ZeroOverlay.js +++ b/modules/zerobanner.interstitial/ZeroOverlay.js @@ -2,7 +2,6 @@ ( function( M, $, OO ) { 'use strict'; var settings = M.require( 'mobile.settings/settings' ), - router = M.require( 'mobile.startup/router' ), ContentOverlay = M.require( 'mobile.overlays/ContentOverlay' ), cfg = window && window.zeroGlobalConfig || false; -- To view, visit https://gerrit.wikimedia.org/r/307970 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic4fd397395e9ab361a95af4b10b740327db0163e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ZeroBanner Gerrit-Branch: wmf/1.28.0-wmf.17 Gerrit-Owner: JdlrobsonGerrit-Reviewer: Bmansurov Gerrit-Reviewer: Dereckson Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[wmf/1.28.0-wmf.17]: Ensure lazy image placeholders without height can be loaded
Dereckson has submitted this change and it was merged. Change subject: Ensure lazy image placeholders without height can be loaded .. Ensure lazy image placeholders without height can be loaded Bug: T143768 Change-Id: Ic396eacad0ab10e2e82f87369a1ef3dc2a8bd17c (cherry picked from commit e67b7ed6273faa104a390690d3ad24110220442c) --- M resources/mobile.startup/Skin.js 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Dereckson: Verified; Looks good to me, approved diff --git a/resources/mobile.startup/Skin.js b/resources/mobile.startup/Skin.js index 49da904..783c8ae 100644 --- a/resources/mobile.startup/Skin.js +++ b/resources/mobile.startup/Skin.js @@ -221,7 +221,9 @@ if ( mw.viewport.isElementCloseToViewport( placeholder, offset ) && - $placeholder.is( ':visible' ) + // If a placeholder is an inline element without a height attribute set it will record as hidden + // to circumvent this we also need to test the height (see T143768). + ( $placeholder.is( ':visible' ) || $placeholder.height() === 0 ) ) { self.loadImage( $placeholder ); return false; -- To view, visit https://gerrit.wikimedia.org/r/307971 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic396eacad0ab10e2e82f87369a1ef3dc2a8bd17c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: wmf/1.28.0-wmf.17 Gerrit-Owner: JdlrobsonGerrit-Reviewer: Dereckson Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...golden[master]: Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/wi...
Chelsyx has uploaded a new change for review. https://gerrit.wikimedia.org/r/308097 Change subject: Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/golden .. Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/golden Change-Id: I754363ce790327aaeb47dd305277bac80799d8c5 --- M search/app.R 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/golden refs/changes/97/308097/1 diff --git a/search/app.R b/search/app.R index 1772133..cdd14f7 100644 --- a/search/app.R +++ b/search/app.R @@ -3,11 +3,11 @@ # Retrieves data for the mobile web stuff we care about, drops it in the aggregate-datasets directory. Should be run on stat1002, /not/ on the datavis machine. -<<< HEAD (4a13ac Generate invoke source and click position aggregates) +<<< HEAD main <- function(date = NULL, table = "MobileWikiAppSearch_10641988", table2 = "MobileWikiAppSearch_15729321"){ === main <- function(date = NULL){ ->>> BRANCH (136d7e Ensures custom JARs are loaded) +>>> 136d7e1d8b2ebb67ea839c578d2b50bee04ce806 # Retrieve data using the query builder in ./common.R data <- rbind(wmf::build_query(fields = "SELECT SUBSTRING(timestamp, 1, 8) AS date, -- To view, visit https://gerrit.wikimedia.org/r/308097 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I754363ce790327aaeb47dd305277bac80799d8c5 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/golden Gerrit-Branch: master Gerrit-Owner: Chelsyx___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Gadgets[master]: Implement support for specifying type=styles
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/308096 Change subject: Implement support for specifying type=styles .. Implement support for specifying type=styles T87871 formally introduced the concept of a styles module, which sets mw.loader.state to "ready" when loaded through addModuleStyles(). Previously, addModuleStyles could not safely do that because a module might contain scripts, in which case mw.loader must still load the (rest) of the module (causes styles to load twice). When developing modules in MediaWiki core or extensions this is easily avoided by calling either addModules() or addModuleStyles(), not both. For Gadgets we call both as a workaround to allow users to provide styles (without causing a flash of unstyled content), but also to provide scripts with styles. Since we don't declare which one is intended (and some gadgets do both), we always loaded them both ways. This will no longer be allowed in the future (see T92459). The new 'type=styles' Gadget attribute promises to ResourceLoader that the gadget only contains styles. This will set mw.loader.state to "ready" for those, which means they won't load twice. Impact: * [Bug fix] When mw.loader requires a styles module that already loaded, it will load again. * [Feature] It is possible for a general scripts+styles gadgets to have a dependency on another gadget with styles. Previously this would cause the styles to load twice. * [Config] Specifying type=styles will load the module through addModuleStyles() only. Use this for modules that contain styles that relate to elements already on the page (e.g. when customising the skin, layout, or article content). * [Config] Specifying type=general will load the module through addModules() only. Use this if your module contains both scripts and styles and the styles only relate to elements created by the script. This means the styles do not need to be loaded separately through addModuleStyles() and will not apply to noscript mode. To make the transition easy, the default remains the same - with a few improvements: * Gadgets with only styles: We assume type=styles. This fixes the most common bug (styles loading twice) and requires no migration! * Gadgets with scripts (with or without styles): We assume type=general, but unless type=general was explicitly set we'll still load it both ways so that the styles apply directly on page load. If this is not needed, set type=general. If this is needed, then it should be to be two separate modules. We do not support a single module having two purposes (1: apply styles to the page, 2: provide scripts and styles). The styles module should be separated. If still wanted by default, it can be made hidden, and listed as dependency of the other module. The latter case is detected on page load and results in a console warning with a link to T42284. Bug: T42284 Bug: T92459 Change-Id: Ia3c9ddee243f710022144fc2884434350695699a --- M GadgetHooks.php M Gadgets_body.php M includes/GadgetResourceLoaderModule.php M includes/MediaWikiGadgetsDefinitionRepo.php M includes/content/GadgetDefinitionContentHandler.php M includes/content/GadgetDefinitionValidator.php M tests/phpunit/GadgetTest.php 7 files changed, 139 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gadgets refs/changes/96/308096/1 diff --git a/GadgetHooks.php b/GadgetHooks.php index a48d930..025b445 100644 --- a/GadgetHooks.php +++ b/GadgetHooks.php @@ -170,6 +170,7 @@ $lb = new LinkBatch(); $lb->setCaller( __METHOD__ ); $enabledLegacyGadgets = array(); + $typelessMixedGadgets = array(); /** * @var $gadget Gadget @@ -183,8 +184,15 @@ } if ( $gadget->isEnabled( $user ) && $gadget->isAllowed( $user ) ) { if ( $gadget->hasModule() ) { - $out->addModuleStyles( Gadget::getModuleName( $gadget->getName() ) ); - $out->addModules( Gadget::getModuleName( $gadget->getName() ) ); + if ( $gadget->getType() === 'styles' ) { + $out->addModuleStyles( Gadget::getModuleName( $gadget->getName() ) ); + } elseif ( $gadget->getType() === 'general' ) { + $out->addModules( Gadget::getModuleName( $gadget->getName() ) ); + } else { + $out->addModuleStyles( Gadget::getModuleName( $gadget->getName() ) ); + $out->addModules( Gadget::getModuleName(
[MediaWiki-commits] [Gerrit] mediawiki...Flow[wmf/1.28.0-wmf.17]: Pass full HTML documents into VE, not fragments
jenkins-bot has submitted this change and it was merged. Change subject: Pass full HTML documents into VE, not fragments .. Pass full HTML documents into VE, not fragments This prevents XML parsing errors in IE. Bug: T138356 Change-Id: Ib9bbaccfff9434452ac94bb66a7b076a734dde3d (cherry picked from commit cb37d884ba131807d7ee934b763871d3e9c5feda) --- M modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js b/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js index 2cc0eca..e3c6f7d 100644 --- a/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js +++ b/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js @@ -86,7 +86,8 @@ var widget = this, deferred = $.Deferred(); - this.target.loadHtml( content ); + // loadHtml expects a full document, but we were only given the body content + this.target.loadHtml( '' + content + '' ); this.target.once( 'surfaceReady', function () { var surface = widget.target.getSurface(); -- To view, visit https://gerrit.wikimedia.org/r/307820 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9bbaccfff9434452ac94bb66a7b076a734dde3d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: wmf/1.28.0-wmf.17 Gerrit-Owner: PaladoxGerrit-Reviewer: Catrope Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Hashar Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Mattflaschen Gerrit-Reviewer: Mooeypoo Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Enable Wikidata descriptions taglines on labs
jenkins-bot has submitted this change and it was merged. Change subject: Enable Wikidata descriptions taglines on labs .. Enable Wikidata descriptions taglines on labs The default rule is overriden by the generic nowikidatadescriptions rule in production. This will ensure labs shows them again in stable and that tests do not fail. Bug: T143345 Change-Id: Iee1bc85149c6527cf6d132e66936869b86e484e2 --- M wmf-config/InitialiseSettings-labs.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings-labs.php b/wmf-config/InitialiseSettings-labs.php index 7b88f3f..cb9ce27 100644 --- a/wmf-config/InitialiseSettings-labs.php +++ b/wmf-config/InitialiseSettings-labs.php @@ -537,7 +537,7 @@ // Test Wikidata descriptions on mobile: T127250 'wgMFDisplayWikibaseDescriptions' => [ - 'default' => [ + 'enwiki' => [ 'tagline' => true, 'search' => true, 'nearby' => true, 'watchlist' => true ] ], -- To view, visit https://gerrit.wikimedia.org/r/307967 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iee1bc85149c6527cf6d132e66936869b86e484e2 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: JdlrobsonGerrit-Reviewer: Dereckson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Revert change that fixed the diff being cutoff
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/308095 Change subject: Revert change that fixed the diff being cutoff .. Revert change that fixed the diff being cutoff It was too ugly and looks like it is fixed in gerrit 2.13. Per RoanKattouw Change-Id: Ib92df443b237101d9de60c184871261e5b3999a5 --- M modules/gerrit/files/etc/GerritSite.css 1 file changed, 0 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/95/308095/1 diff --git a/modules/gerrit/files/etc/GerritSite.css b/modules/gerrit/files/etc/GerritSite.css index 0ccd7e7..d518e99 100644 --- a/modules/gerrit/files/etc/GerritSite.css +++ b/modules/gerrit/files/etc/GerritSite.css @@ -8,16 +8,6 @@ white-space: pre-wrap !important; } -/* - * Partially fix diff screen cutting off changes at the cost of ugleness - * can be reverted once upstream gerrit fixes it. - * - * Tracked at https://bugs.chromium.org/p/gerrit/issues/detail?id=4292 - */ -.com-google-gerrit-client-diff-DiffTable_BinderImpl_GenCss_style-difftable .CodeMirror pre span { - white-space: pre-wrap !important; -} - /** * General */ -- To view, visit https://gerrit.wikimedia.org/r/308095 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib92df443b237101d9de60c184871261e5b3999a5 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Paladox___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Flow[wmf/1.28.0-wmf.17]: Protect against target.getSurface() returning null
jenkins-bot has submitted this change and it was merged. Change subject: Protect against target.getSurface() returning null .. Protect against target.getSurface() returning null This can now happen due to I5510bbe3. Bug: T139972 Change-Id: Ia9a171fd8f4800c50f116b13dbd00d8e098b47a9 (cherry picked from commit c8b6bde42326e92c7432bdf8398d2b6be6e6a3b7) --- M modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js 1 file changed, 7 insertions(+), 4 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js b/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js index 2cc0eca..f7183ed 100644 --- a/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js +++ b/modules/flow/ui/widgets/editor/editors/mw.flow.ui.VisualEditorWidget.js @@ -118,7 +118,7 @@ * @inheritdoc */ mw.flow.ui.VisualEditorWidget.prototype.focus = function () { - if ( this.target ) { + if ( this.target && this.target.getSurface() ) { this.target.getSurface().getView().focus(); } }; @@ -127,7 +127,7 @@ * @inheritdoc */ mw.flow.ui.VisualEditorWidget.prototype.moveCursorToEnd = function () { - if ( this.target ) { + if ( this.target && this.target.getSurface() ) { this.target.getSurface().getModel().selectLastContentOffset(); } }; @@ -139,7 +139,7 @@ var doc, html; // If we haven't fully loaded yet, just return nothing. - if ( !this.target ) { + if ( !this.target || !this.target.getSurface() ) { return ''; } @@ -163,6 +163,9 @@ * @inheritdoc */ mw.flow.ui.VisualEditorWidget.prototype.isEmpty = function () { + if ( !this.target || !this.target.getSurface() ) { + return true; + } return !this.target.getSurface().getModel().getDocument().data.hasContent(); }; @@ -173,7 +176,7 @@ */ mw.flow.ui.VisualEditorWidget.prototype.hasBeenChanged = function () { // If we haven't fully loaded yet, just return false - if ( !this.target ) { + if ( !this.target || !this.target.getSurface() ) { return false; } -- To view, visit https://gerrit.wikimedia.org/r/307869 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia9a171fd8f4800c50f116b13dbd00d8e098b47a9 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: wmf/1.28.0-wmf.17 Gerrit-Owner: PaladoxGerrit-Reviewer: 20after4 Gerrit-Reviewer: Catrope Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Hashar Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Mattflaschen Gerrit-Reviewer: Mooeypoo 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]: Disable phrase suggester for wikidata
jenkins-bot has submitted this change and it was merged. Change subject: Disable phrase suggester for wikidata .. Disable phrase suggester for wikidata This won't do anything until I3d77f33477 has been deployed. Bug: T143260 Change-Id: I15dd0ce74efd2cb2b97907aae450a49e55b321d7 --- M wmf-config/CirrusSearch-common.php M wmf-config/InitialiseSettings.php 2 files changed, 9 insertions(+), 0 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/CirrusSearch-common.php b/wmf-config/CirrusSearch-common.php index d9407f6..21e8a0b 100644 --- a/wmf-config/CirrusSearch-common.php +++ b/wmf-config/CirrusSearch-common.php @@ -472,6 +472,9 @@ // Enable completion suggester $wgCirrusSearchUseCompletionSuggester = $wmgCirrusSearchUseCompletionSuggester; +// Enable phrase suggester (did you mean) +$wgCirrusSearchEnablePhraseSuggest = $wmgCirrusSearchEnablePhraseSuggest; + // Configure ICU Folding $wgCirrusSearchUseIcuFolding = $wmgCirrusSearchUseIcuFolding; diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index a8a9d6d..c8904a8 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -16673,6 +16673,12 @@ 'wikidatawiki' => 'no', ], +// Enable phrase suggester (did you mean) on all wikis (except wikidata) +'wmgCirrusSearchEnablePhraseSuggest' => [ + 'default' => true, + 'wikidatawiki' => false +], + // wmgCirrusSearchRecycleCompletionSuggesterIndex @{ // Recycle suggester indices for small wikis (less than 100MB store size) 'wmgCirrusSearchRecycleCompletionSuggesterIndex' => [ -- To view, visit https://gerrit.wikimedia.org/r/306552 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I15dd0ce74efd2cb2b97907aae450a49e55b321d7 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: EBernhardsonGerrit-Reviewer: Dereckson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[wmf/1.28.0-wmf.17]: Update lib/ve submodule for Ib9bbaccfff9
jenkins-bot has submitted this change and it was merged. Change subject: Update lib/ve submodule for Ib9bbaccfff9 .. Update lib/ve submodule for Ib9bbaccfff9 Change-Id: I4d7934226c79c79012325c30765c7eb82805016a --- M lib/ve 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/ve b/lib/ve index 43d2a61..2de636c 16 --- a/lib/ve +++ b/lib/ve @@ -1 +1 @@ -Subproject commit 43d2a61e1c8a51054894ba266de692599a71f1e4 +Subproject commit 2de636cf2885de22f8ed88b95dd4353430016c04 -- To view, visit https://gerrit.wikimedia.org/r/307899 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4d7934226c79c79012325c30765c7eb82805016a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: wmf/1.28.0-wmf.17 Gerrit-Owner: CatropeGerrit-Reviewer: Dereckson 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...CirrusSearch[wmf/1.28.0-wmf.17]: Do not use the suggest reverse field if it's a non local search
jenkins-bot has submitted this change and it was merged. Change subject: Do not use the suggest reverse field if it's a non local search .. Do not use the suggest reverse field if it's a non local search We do not know if the reverse field is available on extra indices. We should not use it for such queries. Change-Id: Ia88618f38ad39ee58ed07b291f1b1ed67debd54a (cherry picked from commit e1cc2624243b3e9960428c9646bec1a13ea5d9b8) --- M includes/Query/FullTextQueryStringQueryBuilder.php 1 file changed, 15 insertions(+), 3 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Query/FullTextQueryStringQueryBuilder.php b/includes/Query/FullTextQueryStringQueryBuilder.php index 9f22dfd..45decbb 100644 --- a/includes/Query/FullTextQueryStringQueryBuilder.php +++ b/includes/Query/FullTextQueryStringQueryBuilder.php @@ -2,6 +2,7 @@ namespace CirrusSearch\Query; +use CirrusSearch\OtherIndexes; use CirrusSearch\SearchConfig; use CirrusSearch\Searcher; use CirrusSearch\Search\Escaper; @@ -222,7 +223,7 @@ if ( $showSuggestion ) { $searchContext->setSuggest( [ 'text' => $term, - 'suggest' => $this->buildSuggestConfig( 'suggest' ), + 'suggest' => $this->buildSuggestConfig( 'suggest', $searchContext ), ] ); } } @@ -259,9 +260,10 @@ * Build suggest config for $field. * * @param string $field field to suggest against +* @param SearchContext $searchContext * @return array[] array of Elastica configuration */ - private function buildSuggestConfig( $field ) { + private function buildSuggestConfig( $field, $searchContext ) { // check deprecated settings $suggestSettings = $this->config->get( 'CirrusSearchPhraseSuggestSettings' ); $maxErrors = $this->config->get( 'CirrusSearchPhraseSuggestMaxErrors' ); @@ -295,8 +297,18 @@ ], ], ]; + $extraIndexes = null; + if ( $searchContext->getNamespaces() ) { + $extraIndexes = OtherIndexes::getExtraIndexesForNamespaces( + $searchContext->getNamespaces() + ); + } // Add a second generator with the reverse field - if ( $this->config->getElement( 'CirrusSearchPhraseSuggestReverseField', 'use' ) ) { + // Only do this for local queries, we don't know if it's activated + // on other wikis. + if ( empty( $extraIndexes ) + && $this->config->getElement( 'CirrusSearchPhraseSuggestReverseField', 'use' ) + ) { $settings['phrase']['direct_generator'][] = [ 'field' => $field . '.reverse', 'suggest_mode' => $suggestSettings['mode'], -- To view, visit https://gerrit.wikimedia.org/r/307955 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia88618f38ad39ee58ed07b291f1b1ed67debd54a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: wmf/1.28.0-wmf.17 Gerrit-Owner: EBernhardsonGerrit-Reviewer: DCausse Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Gehel Gerrit-Reviewer: Manybubbles 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...CirrusSearch[wmf/1.28.0-wmf.16]: Do not use the suggest reverse field if it's a non local search
jenkins-bot has submitted this change and it was merged. Change subject: Do not use the suggest reverse field if it's a non local search .. Do not use the suggest reverse field if it's a non local search We do not know if the reverse field is available on extra indices. We should not use it for such queries. Change-Id: Ia88618f38ad39ee58ed07b291f1b1ed67debd54a (cherry picked from commit e1cc2624243b3e9960428c9646bec1a13ea5d9b8) --- M includes/Query/FullTextQueryStringQueryBuilder.php 1 file changed, 15 insertions(+), 3 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Query/FullTextQueryStringQueryBuilder.php b/includes/Query/FullTextQueryStringQueryBuilder.php index 9f22dfd..45decbb 100644 --- a/includes/Query/FullTextQueryStringQueryBuilder.php +++ b/includes/Query/FullTextQueryStringQueryBuilder.php @@ -2,6 +2,7 @@ namespace CirrusSearch\Query; +use CirrusSearch\OtherIndexes; use CirrusSearch\SearchConfig; use CirrusSearch\Searcher; use CirrusSearch\Search\Escaper; @@ -222,7 +223,7 @@ if ( $showSuggestion ) { $searchContext->setSuggest( [ 'text' => $term, - 'suggest' => $this->buildSuggestConfig( 'suggest' ), + 'suggest' => $this->buildSuggestConfig( 'suggest', $searchContext ), ] ); } } @@ -259,9 +260,10 @@ * Build suggest config for $field. * * @param string $field field to suggest against +* @param SearchContext $searchContext * @return array[] array of Elastica configuration */ - private function buildSuggestConfig( $field ) { + private function buildSuggestConfig( $field, $searchContext ) { // check deprecated settings $suggestSettings = $this->config->get( 'CirrusSearchPhraseSuggestSettings' ); $maxErrors = $this->config->get( 'CirrusSearchPhraseSuggestMaxErrors' ); @@ -295,8 +297,18 @@ ], ], ]; + $extraIndexes = null; + if ( $searchContext->getNamespaces() ) { + $extraIndexes = OtherIndexes::getExtraIndexesForNamespaces( + $searchContext->getNamespaces() + ); + } // Add a second generator with the reverse field - if ( $this->config->getElement( 'CirrusSearchPhraseSuggestReverseField', 'use' ) ) { + // Only do this for local queries, we don't know if it's activated + // on other wikis. + if ( empty( $extraIndexes ) + && $this->config->getElement( 'CirrusSearchPhraseSuggestReverseField', 'use' ) + ) { $settings['phrase']['direct_generator'][] = [ 'field' => $field . '.reverse', 'suggest_mode' => $suggestSettings['mode'], -- To view, visit https://gerrit.wikimedia.org/r/307954 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia88618f38ad39ee58ed07b291f1b1ed67debd54a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: wmf/1.28.0-wmf.16 Gerrit-Owner: EBernhardsonGerrit-Reviewer: DCausse Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Gehel Gerrit-Reviewer: Manybubbles 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...JsonConfig[wmf/1.28.0-wmf.17]: Convert JsonConfigModels and JsonConfigs to attributes
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/308094 Change subject: Convert JsonConfigModels and JsonConfigs to attributes .. Convert JsonConfigModels and JsonConfigs to attributes Bug: T144329 Change-Id: I5c954f76843e82a6979bf9bd0ac4236a4338ad78 (cherry picked from commit a51b97ad117ba51dde4c956358d3281dfb378455) --- M includes/JCApi.php M includes/JCContent.php M includes/JCSingleton.php 3 files changed, 19 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/JsonConfig refs/changes/94/308094/1 diff --git a/includes/JCApi.php b/includes/JCApi.php index 80d6693..149e159 100644 --- a/includes/JCApi.php +++ b/includes/JCApi.php @@ -50,8 +50,11 @@ $this->getMain()->setCacheMaxAge( 1 * 30 ); // seconds $this->getMain()->setCacheMode( 'public' ); - global $wgJsonConfigModels; - $result->addValue( null, 'models', $wgJsonConfigModels ); + $result->addValue( + null, + 'models', + \ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigModels' ) + ); $data = array(); foreach ( JCSingleton::getTitleMap() as $ns => $confs ) { diff --git a/includes/JCContent.php b/includes/JCContent.php index ba1e825..46fb6f1 100644 --- a/includes/JCContent.php +++ b/includes/JCContent.php @@ -197,9 +197,9 @@ protected function getView( $modelId ) { $view = $this->view; if ( $view === null ) { - global $wgJsonConfigModels; - if ( array_key_exists( $modelId, $wgJsonConfigModels ) ) { - $value = $wgJsonConfigModels[$modelId]; + $configModels = \ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigModels' ); + if ( array_key_exists( $modelId, $configModels ) ) { + $value = $configModels[$modelId]; if ( is_array( $value ) && array_key_exists( 'view', $value ) ) { $class = $value['view']; $view = new $class(); diff --git a/includes/JCSingleton.php b/includes/JCSingleton.php index 46181d0..8eacbe3 100644 --- a/includes/JCSingleton.php +++ b/includes/JCSingleton.php @@ -65,9 +65,13 @@ return; } $isInitialized = true; - global $wgNamespaceContentModels, $wgContentHandlers, $wgJsonConfigs, $wgJsonConfigModels; + global $wgNamespaceContentModels, $wgContentHandlers; list( self::$titleMap, self::$namespaces ) = self::parseConfiguration( - $wgNamespaceContentModels, $wgContentHandlers, $wgJsonConfigs, $wgJsonConfigModels ); + $wgNamespaceContentModels, + $wgContentHandlers, + \ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigs' ), + \ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigModels' ) + ); } /** @@ -379,10 +383,10 @@ } public static function getContentClass( $modelId ) { - global $wgJsonConfigModels; + $configModels = \ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigModels' ); $class = null; - if ( array_key_exists( $modelId, $wgJsonConfigModels ) ) { - $value = $wgJsonConfigModels[$modelId]; + if ( array_key_exists( $modelId, $configModels ) ) { + $value = $configModels[$modelId]; if ( is_array( $value ) ) { if ( !array_key_exists( 'class', $value ) ) { wfLogWarning( "JsonConfig: Invalid \$wgJsonConfigModels['$modelId'] array value, 'class' not found" ); @@ -573,8 +577,7 @@ } self::init(); - global $wgJsonConfigModels; - if ( array_key_exists( $modelId, $wgJsonConfigModels ) ) { + if ( array_key_exists( $modelId, \ExtensionRegistry::getInstance()->getAttribute( 'JsonConfigModels' ) ) ) { // This is one of our model IDs $handler = new JCContentHandler( $modelId ); return false; @@ -776,9 +779,8 @@ private static function jsonConfigIsStorage() { static $isStorage = null; if ( $isStorage === null ) { - global
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Clean up Special:Notifications output
jenkins-bot has submitted this change and it was merged. Change subject: Clean up Special:Notifications output .. Clean up Special:Notifications output Transform the php output to OOUI widgets. Bug: T129172 Change-Id: I65cb5f2a016fc2a3c33a0b1cd2f3f88ed963ab02 --- M includes/special/SpecialNotifications.php M modules/nojs/mw.echo.notifications.less 2 files changed, 78 insertions(+), 44 deletions(-) Approvals: Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/special/SpecialNotifications.php b/includes/special/SpecialNotifications.php index 7205466..741b97a 100644 --- a/includes/special/SpecialNotifications.php +++ b/includes/special/SpecialNotifications.php @@ -40,11 +40,16 @@ $pager->setLimit( $this->getRequest()->getVal( 'limit', self::DISPLAY_NUM ) ); $notifications = $pager->getNotifications(); + $noJSDiv = new OOUI\Tag(); + $noJSDiv->addClasses( [ 'mw-echo-special-nojs' ] ); + // If there are no notifications, display a message saying so if ( !$notifications ) { // Wrap this with nojs so it is still hidden if JS is loading - $msg = new OOUI\LabelWidget( [ 'label' => $this->msg( 'echo-none' )->text() ] ); - $out->addHTML( Html::rawElement( 'div', array( 'class' => 'mw-echo-special-nojs' ), $msg ) ); + $noJSDiv->appendContent( + new OOUI\LabelWidget( [ 'label' => $this->msg( 'echo-none' )->text() ] ) + ); + $out->addHTML( $noJSDiv ); $out->addModules( array( 'ext.echo.special' ) ); return; } @@ -64,20 +69,21 @@ $seenTime = $echoSeenTime->getTime(); $notifArray = array(); foreach ( $notif as $row ) { - $class = 'mw-echo-notification'; + if ( !$row['*'] ) { + continue; + } + + $classes = array( 'mw-echo-notification' ); + if ( !isset( $row['read'] ) ) { - $class .= ' mw-echo-notification-unread'; + $classes[] = 'mw-echo-notification-unread'; if ( !$row['targetpages'] ) { $unread[] = $row['id']; } } if ( $seenTime !== null && $row['timestamp']['mw'] > $seenTime ) { - $class .= ' mw-echo-notification-unseen'; - } - - if ( !$row['*'] ) { - continue; + $classes[] = 'mw-echo-notification-unseen'; } // Output the date header if it has not been displayed @@ -94,27 +100,39 @@ $notifArray[ $dateHeader ][ 'unread' ][] = $row['id']; } - $notifArray[ $dateHeader ][ 'notices' ][] = Html::rawElement( - 'li', - array( - 'class' => $class, + $li = new OOUI\Tag( 'li' ); + $li + ->addClasses( $classes ) + ->setAttributes( [ 'data-notification-category' => $row['category'], 'data-notification-event' => $row['id'], 'data-notification-type' => $row['type'] - ), - $row['*'] - ); + ] ) + ->appendContent( new OOUI\HtmlSnippet( $row['*'] ) ); + + // Store + $notifArray[ $dateHeader ][ 'notices' ][] = $li; } - // Build the HTML - $notices = ''; + // Build the list + $notices = new OOUI\Tag( 'ul' ); + $notices->addClasses( [ 'mw-echo-special-notifications' ] ); + $markReadSpecialPage = new SpecialNotificationsMarkRead(); foreach ( $notifArray as $section => $data ) { - $dateSectionText = Html::element( 'span', array( 'class' => 'mw-echo-date-section-text' ), $section ); - $sectionTitle = $dateSectionText; + // Heading + $heading = ( new OOUI\Tag( 'li' ) )->addClasses( [ 'mw-echo-date-section' ] ); + +
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add mw.wikibase.entity:getDescription
Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/308093 Change subject: Add mw.wikibase.entity:getDescription .. Add mw.wikibase.entity:getDescription Bug: T136501 Change-Id: I1395babe90cf8b3bec553c57e3bb1d27d9c317fe --- M client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua M client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua M docs/lua.wiki 3 files changed, 77 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/93/308093/1 diff --git a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua index 9aff983..f55a5cd 100644 --- a/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua +++ b/client/includes/DataAccess/Scribunto/mw.wikibase.entity.lua @@ -44,30 +44,48 @@ return entity end --- Get the label for a given language code +-- Get a term of a given type for a given language code or the content language. -- +-- @param {table} [entity] -- @param {string|number} [langCode] -methodtable.getLabel = function( entity, langCode ) - checkTypeMulti( 'getLabel', 1, langCode, { 'string', 'number', 'nil' } ) - +-- @param {string} [termType] +local getTerm = function( entity, langCode, termType ) langCode = langCode or mw.language.getContentLanguage():getCode() if langCode == nil then return nil, nil end - if entity.labels == nil then + if entity[termType] == nil then return nil, nil end - local label = entity.labels[langCode] + local term = entity[termType][langCode] - if label == nil then + if term == nil then return nil, nil end - local actualLang = label.language or langCode - return label.value, actualLang + local actualLang = term.language or langCode + return term.value, actualLang +end + +-- Get the label for a given language code or the content language +-- +-- @param {string|number} [langCode] +methodtable.getLabel = function( entity, langCode ) + checkTypeMulti( 'getLabel', 1, langCode, { 'string', 'number', 'nil' } ) + + return getTerm( entity, langCode, 'labels' ) +end + +-- Get the description for a given language code or the content language +-- +-- @param {string|number} [langCode] +methodtable.getDescription = function( entity, langCode ) + checkTypeMulti( 'getDescription', 1, langCode, { 'string', 'number', 'nil' } ) + + return getTerm( entity, langCode, 'descriptions' ) end -- Get the sitelink title linking to the given site id diff --git a/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua b/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua index 2dcc815..dbd88be 100644 --- a/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua +++ b/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseEntityLibraryTests.lua @@ -25,6 +25,15 @@ language = 'de' } }, + descriptions = { + de = { + value = 'DescriptionDE' + }, + en = { + value = 'DescriptionDE-fallback', + language = 'de' + } + }, sitelinks = { dewiki = { title = 'Deutsch' @@ -57,6 +66,10 @@ return getNewTestItem():getLabel( code ) end +local function testGetDescription( code ) + return getNewTestItem():getDescription( code ) +end + local function testGetSitelink( globalSiteId ) return getNewTestItem():getSitelink( globalSiteId ) end @@ -85,6 +98,10 @@ local function integrationTestGetLabel( langCode ) return mw.wikibase.getEntityObject():getLabel( langCode ) +end + +local function integrationTestGetDescription( langCode ) + return mw.wikibase.getEntityObject( 'Q32487' ):getDescription( langCode ) end local function integrationTestGetSitelink( globalSiteId ) @@ -169,6 +186,25 @@ args = { 'en' }, expect = { 'LabelDE-fallback', 'de' } }, + { name = 'mw.wikibase.entity.getDescription 1', func = testGetDescription, type='ToString', + args = { 'de' }, + expect = { 'DescriptionDE', 'de' } + }, + { name = 'mw.wikibase.entity.getDescription 2', func = testGetDescription, type='ToString', + args = { 'oooooo' }, + expect = { nil } + }, + { name = 'mw.wikibase.entity.getDescription 3', func = testGetDescription, type='ToString', + args = { function() end }, + expect = "bad argument #1 to 'getDescription' (string, number or nil expected, got function)" + }, + { name =
[MediaWiki-commits] [Gerrit] wikimedia...golden[master]: Generate invoke source and click position aggregates
Chelsyx has uploaded a new change for review. https://gerrit.wikimedia.org/r/308092 Change subject: Generate invoke source and click position aggregates .. Generate invoke source and click position aggregates To be added to search metrics dashboard Bug: T143726 Change-Id: Ib281b925fe8bab0d826e158b82228d8161f474ba --- M search/app.R 1 file changed, 25 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/discovery/golden refs/changes/92/308092/1 diff --git a/search/app.R b/search/app.R index 9b6a776..ee6d31b 100644 --- a/search/app.R +++ b/search/app.R @@ -3,7 +3,7 @@ # Retrieves data for the mobile web stuff we care about, drops it in the aggregate-datasets directory. Should be run on stat1002, /not/ on the datavis machine. -main <- function(date = NULL, table = "MobileWikiAppSearch_10641988"){ +main <- function(date = NULL, table = "MobileWikiAppSearch_10641988", table2 = "MobileWikiAppSearch_15729321"){ # Retrieve data using the query builder in ./common.R data <- wmf::build_query(fields = "SELECT SUBSTRING(timestamp, 1, 8) AS date, @@ -35,5 +35,29 @@ wmf::write_conditional(app_results, file.path(base_path, "app_event_counts.tsv")) wmf::write_conditional(load_times, file.path(base_path, "app_load_times.tsv")) + + # Retrieve data from a newer revision + data2 <- wmf::build_query(fields = "SELECT SUBSTRING(timestamp, 1, 8) AS date, + event_action AS action, + userAgent, + event_source AS invoke_source, + event_position AS click_position", + date = date, + table = table2, + conditionals = "event_action IN ('click','start')") + data2 <- data.table::as.data.table(data2) + data2$date <- lubridate::ymd(data2$date) + data2$platform[grepl(x = data2$userAgent, pattern = "Android", fixed = TRUE)] <- "Android" + data2$platform[is.na(data2$platform)] <- "iOS" + data2 <- data2[,userAgent := NULL,] + + # Aggregate + source_count <- data2[data2$action=='start', j = list(events = .N), by = c("date","invoke_source")] + position_count <- data2[data2$action=='click', j = list(events = .N), by = c("date","click_position")] + + # Write out + wmf::write_conditional(source_count, file.path(base_path, "invoke_source_counts.tsv")) + wmf::write_conditional(position_count, file.path(base_path, "click_position_counts.tsv")) + return(invisible()) } -- To view, visit https://gerrit.wikimedia.org/r/308092 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib281b925fe8bab0d826e158b82228d8161f474ba Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/discovery/golden Gerrit-Branch: master Gerrit-Owner: Chelsyx___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...FileAnnotations[master]: Quick code style improvements
jenkins-bot has submitted this change and it was merged. Change subject: Quick code style improvements .. Quick code style improvements I sorta threw everything into one function, this is a little nicer to read and work with. Change-Id: If682d809ceaffa5b638a8d7e4f3714b78fd07347 --- M ApiFileAnnotations.php 1 file changed, 297 insertions(+), 220 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/ApiFileAnnotations.php b/ApiFileAnnotations.php index 8fb4e35..5ac4e4f 100644 --- a/ApiFileAnnotations.php +++ b/ApiFileAnnotations.php @@ -47,9 +47,6 @@ $title ); - $parser = new Parser(); - $popts = ParserOptions::newFromUser( $this->getUser() ); - $page = WikiPage::factory( $faTitle ); $content = $page->getContent(); if ( !empty( $content ) ) { @@ -59,227 +56,20 @@ $annotations = $data->annotations; } + $parser = new Parser(); + $popts = ParserOptions::newFromUser( $this->getUser() ); + $annotationsData = []; if ( !empty( $annotations ) ) { foreach ( $annotations as $annotation ) { - $text = $annotation->content; - $annotationData = [ - 'text' => $text - ]; - - foreach ( $annotation as $key => $val ) { - if ( $key === 'content' ) { - continue; - } - - $annotationData[$key] = $val; - } - - if ( $shouldParse ) { - $presult = $parser->parse( $text, $faTitle, $popts ); - $annotationData['parsed'] = $presult->mText; - - // Check to see if we can return a special display for this annotation. - $dom = new DOMDocument(); - $domFragment = $dom->createDocumentFragment(); - $domFragment->appendXml( $presult->mText ); - - // The first element will always be a paragraph. Get its first child. - $possibleLink = $domFragment->firstChild->firstChild; - - // Check if it's a link element. - if ( $possibleLink->nodeType === XML_ELEMENT_NODE && $possibleLink->nodeName === 'a' ) { - // Find out if the link is something we care about. - $href = $possibleLink->attributes->getNamedItem( 'href' )->value; - - $commonsMatches = []; - $commonsCategoryMatch = preg_match( - '%^https?://commons.wikimedia.org.*(Category:.*)%', - $href, - $commonsMatches - ); - - $wpMatches = []; - $wpArticleMatch = preg_match( - '%^(https?://.*.wikipedia.org)/wiki/(.*)%', - $href, - $wpMatches - ); - - $wdMatches = []; - $wdEntityMatch =
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface Submodule
jenkins-bot has submitted this change and it was merged. Change subject: Update DonationInterface Submodule .. Update DonationInterface Submodule Change-Id: I45bafc8a7f3fb462b4f5481d124ceca3e2af6602 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 40f0c02..d4dd810 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 40f0c0231fdde5c9e7067d7f81ce972857f60b0a +Subproject commit d4dd81003d1c54e747f06d0cfbf855185d8a4de6 -- To view, visit https://gerrit.wikimedia.org/r/308090 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I45bafc8a7f3fb462b4f5481d124ceca3e2af6602 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyetGerrit-Reviewer: Awight Gerrit-Reviewer: XenoRyet 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...WikimediaEvents[master]: Add EventLogging for Special:RecentChanges filter usage
Mooeypoo has uploaded a new change for review. https://gerrit.wikimedia.org/r/308091 Change subject: Add EventLogging for Special:RecentChanges filter usage .. Add EventLogging for Special:RecentChanges filter usage As preparations for Collaboration team's Edit Review Improvements project, this commit sets up event logging schema and logging method for instrumenting how often various filters are used in the Special:RecentChanges page. See https://www.mediawiki.org/wiki/Edit_Review_Improvements Bug: T144331 Change-Id: I567b9a8874ea03a3e206964e748c2009c1698150 --- M WikimediaEventsHooks.php M extension.json 2 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents refs/changes/91/308091/1 diff --git a/WikimediaEventsHooks.php b/WikimediaEventsHooks.php index c51162f..5bccf06 100644 --- a/WikimediaEventsHooks.php +++ b/WikimediaEventsHooks.php @@ -552,4 +552,37 @@ public static function onAbuseFilterBuilder( &$builder ) { $builder['vars']['user_wpzero'] = 'user-wpzero'; } + + /** +* Fired when Special:RecentChanges has changed its query. +* +* @param array &$conds Array of 'where' conditionals for the query +* @param array &$tables Array of tables to be queries +* @param array &$join_conds Join conditions for the query +* @param array $opts FormOptions for the request +* @param array &$query_options Additional query options +* @param array &$select Array of fields to be fetched +*/ + public static function onSpecialRecentChangesFilters( $special, &$filters ) { + $logData = []; + + $knownFilters = [ + 'hideminor', + 'hidebots', + 'hideanons', + 'hidepatrolled', + 'hidemyself', + 'hideliu' + ]; + foreach ( $knownFilters as $filter ) { + $logData[ $filter ] = (bool)$special->getRequest()->getVal( $filter ); + } + + // Log the existing filters + EventLogging::logEvent( + 'RecentChangesFilters', + 15875945, + $logData + ); + } } diff --git a/extension.json b/extension.json index 499d0d4..7682569 100644 --- a/extension.json +++ b/extension.json @@ -70,6 +70,9 @@ ], "AbuseFilter-builder": [ "WikimediaEventsHooks::onAbuseFilterBuilder" + ], + "SpecialRecentChangesFilters": [ + "WikimediaEventsHooks::onSpecialRecentChangesFilters" ] }, "MessagesDirs": { -- To view, visit https://gerrit.wikimedia.org/r/308091 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I567b9a8874ea03a3e206964e748c2009c1698150 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaEvents Gerrit-Branch: master Gerrit-Owner: Mooeypoo___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...FileAnnotations[master]: Style better than a toddler with crayons
jenkins-bot has submitted this change and it was merged. Change subject: Style better than a toddler with crayons .. Style better than a toddler with crayons I excused my lack of styling by saying I would do it later, well, this should bring us closer to the mockups for the most part. Change-Id: I8120cfb8ee505526ea84effd5bfa10807c1098c2 --- M ApiFileAnnotations.php M resources/src/fileannotations.less 2 files changed, 66 insertions(+), 38 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/ApiFileAnnotations.php b/ApiFileAnnotations.php index 6fd5e54..8fb4e35 100644 --- a/ApiFileAnnotations.php +++ b/ApiFileAnnotations.php @@ -174,7 +174,7 @@ $annotationData['parsed'] = '' . $page['extract'] . - '' . + '' . ''; + + foreach ( $claims as $claimid => $claim ) { + switch ( $claimid ) { + case 'P18': + // Main image. Fetch imageinfo and render. + $imageApiDataStr = file_get_contents( + 'https://commons.wikimedia.org/w/api.php' . + '?action=query=imageinfo' . + '=File:' . urlencode( $claim[0]['mainsnak']['datavalue']['value'] ) . + '=url=200' . + '=200=json' + ); + + $imageApiData = json_decode( $imageApiDataStr, true ); + + $pages = $imageApiData['query']['pages']; + + $annotationData['parsed'] .= ''; + + foreach ( $pages as $id => $page ) { + // There's only one page. Add HTML here. + $info = $page['imageinfo'][0]; + $annotationData['parsed'] .= + '' . + '' . + ''; + break; + } + + $annotationData['parsed'] .= ''; + + default: + continue; + } + } + + $annotationData['parsed'] .= ''; +
[MediaWiki-commits] [Gerrit] mediawiki...FileAnnotations[master]: Add rendering for Wikipedia articles
jenkins-bot has submitted this change and it was merged. Change subject: Add rendering for Wikipedia articles .. Add rendering for Wikipedia articles Needs some style love that can come later. Change-Id: Id7f66b412becd98567e45b3576804771f5a7a3a0 --- M ApiFileAnnotations.php M resources/src/fileannotations.less 2 files changed, 52 insertions(+), 0 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/ApiFileAnnotations.php b/ApiFileAnnotations.php index ffbe666..ea7fe2e 100644 --- a/ApiFileAnnotations.php +++ b/ApiFileAnnotations.php @@ -100,6 +100,13 @@ $commonsMatches ); + $wpMatches = []; + $wpArticleMatch = preg_match( + '%^(https?://.*.wikipedia.org)/wiki/(.*)%', + $href, + $wpMatches + ); + if ( $commonsCategoryMatch === 1 ) { $categoryName = $commonsMatches[1]; @@ -136,6 +143,42 @@ '' . ''; } + + if ( $wpArticleMatch === 1 ) { + $articleName = $wpMatches[2]; + + $articleApiDataStr = file_get_contents( + $wpMatches[1] . + '/w/api.php?action=query' . + '=' . urlencode( $articleName ) . + '=pageimages|extracts' . + '=thumbnail|name' . + '=250' . + '=4' . + '=json' + ); + + $articleApiData = json_decode( $articleApiDataStr, true ); + + $pages = $articleApiData['query']['pages']; + + foreach ( $pages as $id => $page ) { + // There's only one page, so just do it here + $annotationData['parsed'] = + '' . + $page['extract'] . + '' . + '' . + '' . + ''; + } + } } } $annotationsData[] = $annotationData; diff --git a/resources/src/fileannotations.less b/resources/src/fileannotations.less index fce61cd..ebba43a 100644 --- a/resources/src/fileannotations.less +++ b/resources/src/fileannotations.less @@ -33,6 +33,15 @@ padding-bottom: 20px; } } + +
[MediaWiki-commits] [Gerrit] mediawiki...FileAnnotations[master]: Fetch data from Wikidata (and Commons)
jenkins-bot has submitted this change and it was merged. Change subject: Fetch data from Wikidata (and Commons) .. Fetch data from Wikidata (and Commons) This is just a framework, style commits are coming next. Change-Id: I5c99ec7145a202e0d4feb961e9378266ca046ce4 --- M ApiFileAnnotations.php 1 file changed, 93 insertions(+), 0 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/ApiFileAnnotations.php b/ApiFileAnnotations.php index ea7fe2e..6fd5e54 100644 --- a/ApiFileAnnotations.php +++ b/ApiFileAnnotations.php @@ -107,6 +107,13 @@ $wpMatches ); + $wdMatches = []; + $wdEntityMatch = preg_match( + '%https?://(www\.)?wikidata.org/.*(Q\d+)%', + $href, + $wdMatches + ); + if ( $commonsCategoryMatch === 1 ) { $categoryName = $commonsMatches[1]; @@ -179,6 +186,92 @@ ''; } } + + if ( $wdEntityMatch === 1 ) { + $entityId = $wdMatches[2]; + $currentLang = $this->getLanguage()->getCode(); + + $entityApiDataStr = file_get_contents( + 'https://www.wikidata.org/w/api.php' . + '?action=wbgetentities' . + '=' . $entityId . + '=en|' . $currentLang . + '=labels|descriptions|claims' . + '=json' + ); + + $entityApiData = json_decode( $entityApiDataStr, true ); + + $entity = $entityApiData['entities'][$entityId]; + + $labels = $entity['labels']; + $descriptions = $entity['descriptions']; + $claims = $entity['claims']; + + $annotationData['parsed'] = ''; + if ( isset( $labels[$currentLang] ) ) { + $annotationData['parsed'] .= + '' . + $labels[$currentLang]['value'] . + ''; + } elseif ( isset( $labels['en'] ) ) { + // Blatantly strange fallback, but we don't want to have + // no label...hopefully this works for 99% of things. + $annotationData['parsed'] .= + '' . + $labels['en']['value'] . + ''; +
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface Submodule
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/308090 Change subject: Update DonationInterface Submodule .. Update DonationInterface Submodule Change-Id: I45bafc8a7f3fb462b4f5481d124ceca3e2af6602 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/90/308090/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 40f0c02..d4dd810 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 40f0c0231fdde5c9e7067d7f81ce972857f60b0a +Subproject commit d4dd81003d1c54e747f06d0cfbf855185d8a4de6 -- To view, visit https://gerrit.wikimedia.org/r/308090 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I45bafc8a7f3fb462b4f5481d124ceca3e2af6602 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: XenoRyet___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...FileAnnotations[master]: Add special rendering for Commons categories
jenkins-bot has submitted this change and it was merged. Change subject: Add special rendering for Commons categories .. Add special rendering for Commons categories Still not the prettiest things in the world, but they work! Change-Id: If9e32838482e6672afe14b46e48f8d7ca749222a --- M ApiFileAnnotations.php M resources/src/fileannotations.less 2 files changed, 79 insertions(+), 0 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/ApiFileAnnotations.php b/ApiFileAnnotations.php index 0c1eaa6..ffbe666 100644 --- a/ApiFileAnnotations.php +++ b/ApiFileAnnotations.php @@ -79,6 +79,64 @@ if ( $shouldParse ) { $presult = $parser->parse( $text, $faTitle, $popts ); $annotationData['parsed'] = $presult->mText; + + // Check to see if we can return a special display for this annotation. + $dom = new DOMDocument(); + $domFragment = $dom->createDocumentFragment(); + $domFragment->appendXml( $presult->mText ); + + // The first element will always be a paragraph. Get its first child. + $possibleLink = $domFragment->firstChild->firstChild; + + // Check if it's a link element. + if ( $possibleLink->nodeType === XML_ELEMENT_NODE && $possibleLink->nodeName === 'a' ) { + // Find out if the link is something we care about. + $href = $possibleLink->attributes->getNamedItem( 'href' )->value; + + $commonsMatches = []; + $commonsCategoryMatch = preg_match( + '%^https?://commons.wikimedia.org.*(Category:.*)%', + $href, + $commonsMatches + ); + + if ( $commonsCategoryMatch === 1 ) { + $categoryName = $commonsMatches[1]; + + $imagesApiDataStr = file_get_contents( + 'https://commons.wikimedia.org/w/api.php?' . + 'action=query=imageinfo=categorymembers' . + '=file=' . + urlencode( $categoryName ) . + '=5=url=100' . + '=100=json' + ); + + $imagesApiData = json_decode( $imagesApiDataStr, true ); + + $pages = $imagesApiData['query']['pages']; + + $imagesHtml = ''; + + foreach ( $pages as $id => $page ) { + $info = $page['imageinfo'][0]; + $imagesHtml .= + '' . + '' . + ''; + } + + $imagesHtml .= ''; + + $annotationData['parsed'] = +
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Revert "Deploy Kartographer everywhere public"
jenkins-bot has submitted this change and it was merged. Change subject: Revert "Deploy Kartographer everywhere public" .. Revert "Deploy Kartographer everywhere public" Bug: T144062 This reverts commit 968f7555f016cc6f1b5de7d80d1f9385df9778f6. Change-Id: I80e6e8a99afb1ee7b05530f2cb0ebe0fdbfff073 --- M wmf-config/InitialiseSettings.php 1 file changed, 13 insertions(+), 2 deletions(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index fc4cef4..a8a9d6d 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -17361,8 +17361,19 @@ ], 'wmgUseKartographer' => [ - 'default' => true, - 'private' => false, + 'default' => false, + 'wikivoyage' => true, + 'commonswiki' => true, + 'wikidatawiki' => true, + 'testwiki' => true, + 'test2wiki' => true, + 'testwikidatawiki' => true, + 'mediawikiwiki' => true, + 'plwikimedia' => true, // T132510 + 'metawiki' => true, + 'cawiki' => true, + 'hewiki' => true, + 'mkwiki' => true, ], 'wgKartographerWikivoyageMode' => [ -- To view, visit https://gerrit.wikimedia.org/r/308088 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I80e6e8a99afb1ee7b05530f2cb0ebe0fdbfff073 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MaxSemGerrit-Reviewer: Florianschmidtwelzow 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...DonationInterface[deployment]: Reenable AmEx on Adyen form for France.
jenkins-bot has submitted this change and it was merged. Change subject: Reenable AmEx on Adyen form for France. .. Reenable AmEx on Adyen form for France. Bug:T144236 Change-Id: I04af37f2f6df65e4e79a80ae2fc18819c4b2dc61 --- M adyen_gateway/config/payment_submethods.yaml 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: XenoRyet: Looks good to me, approved jenkins-bot: Verified diff --git a/adyen_gateway/config/payment_submethods.yaml b/adyen_gateway/config/payment_submethods.yaml index d2d4a12..c540c24 100644 --- a/adyen_gateway/config/payment_submethods.yaml +++ b/adyen_gateway/config/payment_submethods.yaml @@ -32,6 +32,7 @@ US: true IL: true UA: true +FR: true group: cc logo: card-amex.png discover: -- To view, visit https://gerrit.wikimedia.org/r/308089 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I04af37f2f6df65e4e79a80ae2fc18819c4b2dc61 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyetGerrit-Reviewer: AndyRussG Gerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Ejegg Gerrit-Reviewer: Ssmith Gerrit-Reviewer: XenoRyet 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...FileAnnotations[master]: Discoverability improvements
jenkins-bot has submitted this change and it was merged. Change subject: Discoverability improvements .. Discoverability improvements Flash the annotations on mobile (currently useless, because MF won't load this extension...) Show the annotations until hovered over on desktop. Change-Id: I81f944e1e9cbb1f0b15ce69d7680cf6e60078892 --- M resources/src/fileannotations.js M resources/src/fileannotations.less 2 files changed, 73 insertions(+), 18 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved Jforrester: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/resources/src/fileannotations.js b/resources/src/fileannotations.js index 8266b91..caae39d 100644 --- a/resources/src/fileannotations.js +++ b/resources/src/fileannotations.js @@ -1,4 +1,4 @@ -( function ( $, mw ) { +( function ( $, mw, OO ) { var pageAnnotator, pageTitle = mw.Title.newFromText( mw.config.get( 'wgPageName' ) ), isFilePage = pageTitle.getNamespaceId() === 6, @@ -13,7 +13,6 @@ * @cfg {jQuery} $container The link that encloses the image. * @cfg {mw.Title} title Title of the file. * @cfg {boolean} [editing] Whether to enable editing annotations. -* @cfg {boolean} [alert] Whether to alert the user that there are annotations. */ function FileAnnotator( config ) { var offset, $annotationInfo, createButton, @@ -25,17 +24,11 @@ this.fileTitle = config.title; this.$img = this.$fileLink.find( 'img' ); this.editing = !!config.editing; - this.alert = !!config.alert; - if ( this.alert ) { - $annotationInfo = $( '' ) - .addClass( 'fileannotation-info' ) - .append( - $( '' ).text( mw.message( 'file-has-annotations' ).text() ) - ); + $annotationInfo = $( '' ) + .addClass( 'fileannotation-info' ); - this.$fileLink.after( $annotationInfo ); - } + this.$fileLink.after( $annotationInfo ); this.$container = $( '' ) .addClass( 'annotation-wrapper' ); @@ -53,7 +46,17 @@ this.annotationsTitle = mw.Title.newFromText( 'File_Annotations:' + this.fileTitle.getMain() ); - this.getAndRenderAnnotations(); + this.getAndRenderAnnotations().then( function () { + var $body = $( 'body' ); + + if ( $body.hasClass( 'mw-mobile-mode' ) ) { + annotator.whenInView( function () { + annotator.flashAnnotations(); + } ); + } else { + annotator.displayAnnotationsUntilHover(); + } + } ); if ( this.editing ) { this.getAnnotationsHTML().then( function ( data ) { @@ -464,11 +467,13 @@ /** * Get the annotations, and render them on the image. +* +* @return {jQuery.Promise} */ FileAnnotator.prototype.getAndRenderAnnotations = function () { var annotator = this; - this.getAnnotationsHTML( this.fileTitle ) + return this.getAnnotationsHTML( this.fileTitle ) .then( function ( data ) { var i, pageId = data.query.pageids[ 0 ], @@ -490,7 +495,31 @@ annotator.renderAnnotation( i, annotations[ i ], imageInfo, adjustRatioX, adjustRatioY ) ); } + + return $.Deferred().resolve(); } ); + }; + + FileAnnotator.prototype.displayAnnotationsUntilHover = function () { + var $container = this.$container; + + $container.addClass( 'force-show-annotations' ); + + $container.one( 'mouseenter', function () { + // Once the user hovers over the image once, let the annotations disappear + $container.removeClass( 'force-show-annotations' ); + } ); + }; + + FileAnnotator.prototype.flashAnnotations = function () { + var $container = this.$container; + + $container.addClass( 'force-show-annotations' ); + + setTimeout( function () { + // Let the annotations disappear after five seconds. + $container.removeClass( 'force-show-annotations' ); +
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Clean up entity usage API module code
jenkins-bot has submitted this change and it was merged. Change subject: Clean up entity usage API module code .. Clean up entity usage API module code Bug: T143118 Change-Id: I50e34ef891ffb89e9cbf1891cf7e5287ede19764 --- R client/includes/Api/ApiPropsEntityUsage.php R client/tests/phpunit/includes/Api/ApiPropsEntityUsageTest.php 2 files changed, 40 insertions(+), 17 deletions(-) Approvals: Hoo man: Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/Api/EntityUsage.php b/client/includes/Api/ApiPropsEntityUsage.php similarity index 84% rename from client/includes/Api/EntityUsage.php rename to client/includes/Api/ApiPropsEntityUsage.php index 4f1471c..51726b2 100644 --- a/client/includes/Api/EntityUsage.php +++ b/client/includes/Api/ApiPropsEntityUsage.php @@ -6,8 +6,10 @@ use ApiQuery; use ApiQueryBase; use ApiResult; -use Wikibase\Client\WikibaseClient; +use ResultWrapper; +use Wikibase\Client\RepoLinker; use Wikibase\Client\Usage\EntityUsage; +use Wikibase\Client\WikibaseClient; /** * API module to get the usage of entities. @@ -19,8 +21,19 @@ */ class ApiPropsEntityUsage extends ApiQueryBase { + /** +* @var RepoLinker|null +*/ + private $repoLinker = null; + + /** +* @param ApiQuery $query +* @param string $moduleName +*/ public function __construct( ApiQuery $query, $moduleName ) { parent::__construct( $query, $moduleName, 'wbeu' ); + + $this->repoLinker = WikibaseClient::getDefaultInstance()->newRepoLinker(); } public function execute() { @@ -31,17 +44,21 @@ } $prop = array_flip( (array)$params['prop'] ); - $wikibaseClient = WikibaseClient::getDefaultInstance(); - $repoLinker = $wikibaseClient->newRepoLinker(); - $this->formatResult( $res, $prop, $repoLinker, $params ); + $this->formatResult( $res, $params['limit'], $prop ); } - private function formatResult( $res, $prop, $repoLinker, $params ) { + /** +* @param ResultWrapper $res +* @param int $limit +* @param array $prop +*/ + private function formatResult( ResultWrapper $res, $limit, array $prop ) { $currentPageId = null; $entry = []; $count = 0; + foreach ( $res as $row ) { - if ( ++$count > $params['limit'] ) { + if ( ++$count > $limit ) { // We've reached the one extra which shows that // there are additional pages to be had. Stop here... $this->setContinueFromRow( $row ); @@ -63,7 +80,7 @@ } else { $entry[$row->eu_entity_id] = [ 'aspects' => [ $row->eu_aspect ] ]; if ( isset( $prop['url'] ) ) { - $entry[$row->eu_entity_id]['url'] = $repoLinker->getPageUrl( + $entry[$row->eu_entity_id]['url'] = $this->repoLinker->getPageUrl( 'Special:EntityData/' . $row->eu_entity_id ); } ApiResult::setIndexedTagName( @@ -76,10 +93,13 @@ if ( $entry ) { // Sanity // Flush out remaining ones - $fit = $this->addPageSubItems( $currentPageId, $entry ); + $this->addPageSubItems( $currentPageId, $entry ); } } + /** +* @param object $row +*/ private function setContinueFromRow( $row ) { $this->setContinueEnumParameter( 'continue', @@ -91,10 +111,15 @@ return 'public'; } - public function doQuery( $params ) { + /** +* @param array $params +* +* @return ResultWrapper|null +*/ + public function doQuery( array $params ) { $pages = $this->getPageSet()->getGoodTitles(); if ( !$pages ) { - return; + return null; } $this->addFields( [ diff --git a/client/tests/phpunit/includes/Api/EntityUsageTest.php b/client/tests/phpunit/includes/Api/ApiPropsEntityUsageTest.php similarity index 95% rename from client/tests/phpunit/includes/Api/EntityUsageTest.php rename to client/tests/phpunit/includes/Api/ApiPropsEntityUsageTest.php index c248916..a06aa74 100644 --- a/client/tests/phpunit/includes/Api/EntityUsageTest.php +++ b/client/tests/phpunit/includes/Api/ApiPropsEntityUsageTest.php @@ -24,7 +24,7 @@ * @license GPL-2.0+ * @author Amir Sarabadani */ -class
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Reenable AmEx on Adyen form for France.
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/308089 Change subject: Reenable AmEx on Adyen form for France. .. Reenable AmEx on Adyen form for France. Bug:T144236 Change-Id: I04af37f2f6df65e4e79a80ae2fc18819c4b2dc61 --- M adyen_gateway/config/payment_submethods.yaml 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/89/308089/1 diff --git a/adyen_gateway/config/payment_submethods.yaml b/adyen_gateway/config/payment_submethods.yaml index d2d4a12..c540c24 100644 --- a/adyen_gateway/config/payment_submethods.yaml +++ b/adyen_gateway/config/payment_submethods.yaml @@ -32,6 +32,7 @@ US: true IL: true UA: true +FR: true group: cc logo: card-amex.png discover: -- To view, visit https://gerrit.wikimedia.org/r/308089 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04af37f2f6df65e4e79a80ae2fc18819c4b2dc61 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: XenoRyet___ 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 "Deploy Kartographer everywhere public"
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/308088 Change subject: Revert "Deploy Kartographer everywhere public" .. Revert "Deploy Kartographer everywhere public" Bug: T144062 This reverts commit 968f7555f016cc6f1b5de7d80d1f9385df9778f6. Change-Id: I80e6e8a99afb1ee7b05530f2cb0ebe0fdbfff073 --- M wmf-config/InitialiseSettings.php 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/88/308088/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index c7eaa90..9def346 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -17361,8 +17361,19 @@ ], 'wmgUseKartographer' => [ - 'default' => true, - 'private' => false, + 'default' => false, + 'wikivoyage' => true, + 'commonswiki' => true, + 'wikidatawiki' => true, + 'testwiki' => true, + 'test2wiki' => true, + 'testwikidatawiki' => true, + 'mediawikiwiki' => true, + 'plwikimedia' => true, // T132510 + 'metawiki' => true, + 'cawiki' => true, + 'hewiki' => true, + 'mkwiki' => true, ], 'wgKartographerWikivoyageMode' => [ -- To view, visit https://gerrit.wikimedia.org/r/308088 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I80e6e8a99afb1ee7b05530f2cb0ebe0fdbfff073 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MaxSem___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Reenable AmEx on Adyen form for France.
jenkins-bot has submitted this change and it was merged. Change subject: Reenable AmEx on Adyen form for France. .. Reenable AmEx on Adyen form for France. Bug:T144236 Change-Id: I04af37f2f6df65e4e79a80ae2fc18819c4b2dc61 --- M adyen_gateway/config/payment_submethods.yaml 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/adyen_gateway/config/payment_submethods.yaml b/adyen_gateway/config/payment_submethods.yaml index d2d4a12..c540c24 100644 --- a/adyen_gateway/config/payment_submethods.yaml +++ b/adyen_gateway/config/payment_submethods.yaml @@ -32,6 +32,7 @@ US: true IL: true UA: true +FR: true group: cc logo: card-amex.png discover: -- To view, visit https://gerrit.wikimedia.org/r/307990 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I04af37f2f6df65e4e79a80ae2fc18819c4b2dc61 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: XenoRyetGerrit-Reviewer: AndyRussG Gerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Ejegg Gerrit-Reviewer: Ssmith 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[REL1_23]: Followup af6d9aba: $search is a string, not an object
jenkins-bot has submitted this change and it was merged. Change subject: Followup af6d9aba: $search is a string, not an object .. Followup af6d9aba: $search is a string, not an object Reusing variables means you end up turning a string to an object and then confuse yourself by trying to pass it as a string again. Change-Id: I82b5ca65864099c180d915055c43e6839bd4f4a2 (cherry picked from commit 1078340188890738f9abd73f95291d3348e2f71a) --- M includes/PrefixSearch.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Chad: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/PrefixSearch.php b/includes/PrefixSearch.php index 45c591a..a9179eb 100644 --- a/includes/PrefixSearch.php +++ b/includes/PrefixSearch.php @@ -37,8 +37,8 @@ * @return Array of strings */ public static function titleSearch( $search, $limit, $namespaces = array() ) { - $search = new StringPrefixSearch; - return $search->search( $search, $limit, $namespaces ); + $prefixSearch = new StringPrefixSearch; + return $prefixSearch->search( $search, $limit, $namespaces ); } /** -- To view, visit https://gerrit.wikimedia.org/r/305481 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I82b5ca65864099c180d915055c43e6839bd4f4a2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: REL1_23 Gerrit-Owner: Robert VogelGerrit-Reviewer: Chad 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] mediawiki...Kartographer[master]: Redo mapframe disabling
jenkins-bot has submitted this change and it was merged. Change subject: Redo mapframe disabling .. Redo mapframe disabling Looks like extension.json doesn't allow you to override arrays 8-O Change-Id: Idd82be8624c988ceacde6c62117ac7aa79b60b2d --- M extension.json M includes/Hooks.php 2 files changed, 5 insertions(+), 6 deletions(-) Approvals: BryanDavis: Looks good to me, approved Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index f8bbc27..5da73b7 100644 --- a/extension.json +++ b/extension.json @@ -374,7 +374,7 @@ "KartographerIconServer": "https://maps.wikimedia.org;, "KartographerFrameMode": "interactive", "KartographerUseMarkerStyle": false, - "KartographerEnableTags": [ "mapframe", "maplink" ] + "KartographerEnableMapFrame": true }, "TrackingCategories": [ "kartographer-tracking-category", diff --git a/includes/Hooks.php b/includes/Hooks.php index 07fdff1..c934c66 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -26,12 +26,11 @@ * @return bool */ public static function onParserFirstCallInit( Parser $parser ) { - global $wgKartographerEnableTags; + global $wgKartographerEnableMapFrame; - foreach ( $wgKartographerEnableTags as $tag ) { - if ( isset( self::$tags[$tag] ) ) { - $parser->setHook( $tag, self::$tags[$tag] ); - } + $parser->setHook( 'maplink', 'Kartographer\Tag\MapLink::entryPoint' ); + if ( $wgKartographerEnableMapFrame ) { + $parser->setHook( 'mapframe', 'Kartographer\Tag\MapFrame::entryPoint' ); } return true; -- To view, visit https://gerrit.wikimedia.org/r/308082 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idd82be8624c988ceacde6c62117ac7aa79b60b2d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: MaxSemGerrit-Reviewer: BryanDavis 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] wikimedia...crm[deployment]: Merge branch 'master' into deployment
jenkins-bot has submitted this change and it was merged. Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment d1213d0 Move payments-init queue off ActiveMQ eae39f7 Don't pollute $msg with pending_id 9bfa67e Fix constructor args for payments-init consumer Change-Id: I2ce94fa3943f2731f81b3d69f32365d587ddcbe3 --- M sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.info M sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.module D sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json D sites/all/modules/queue2civicrm/tests/data/payments-init.json 4 files changed, 0 insertions(+), 100 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.info b/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.info index 2aec405..04e8797 100644 --- a/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.info +++ b/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.info @@ -5,7 +5,4 @@ configure = admin/config/queue2civicrm/fredge_qc dependencies[] = queue2civicrm files[] = AntifraudQueueConsumer.php -<<< HEAD (1678e1 Fix the 8 contributions which would still re-try based on da) -=== files[] = PaymentsInitQueueConsumer.php ->>> BRANCH (8b2876 Fix the 8 contributions which would still re-try based on da) diff --git a/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.module b/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.module index 7f42339..d79537f 100644 --- a/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.module +++ b/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.module @@ -1,9 +1,6 @@ >> BRANCH (8b2876 Fix the 8 contributions which would still re-try based on da) use SmashPig\Core\Configuration; use SmashPig\Core\Context; @@ -79,21 +76,12 @@ //Let's start with the simplest possible division of labor $cycle_time = variable_get('fredge_batch_time', 0) / 2; -<<< HEAD (1678e1 Fix the 8 contributions which would still re-try based on da) - $processed = queue2civicrm_stomp()->dequeue_loop( -variable_get('fredge_payments_init_queue', '/queue/payments-init'), -false, -$cycle_time, -'fredge_payments_init_process_message' - ); -=== $paymentsInitConsumer = new PaymentsInitQueueConsumer( variable_get('fredge_payments_init_queue', 'payments-init'), $cycle_time ); $processed = $paymentsInitConsumer->dequeueMessages(); ->>> BRANCH (8b2876 Fix the 8 contributions which would still re-try based on da) $fraudQueueConsumer = new AntifraudQueueConsumer( variable_get('fredge_payments_antifraud_queue', 'payments-antifraud'), @@ -111,50 +99,6 @@ } /** -<<< HEAD (1678e1 Fix the 8 contributions which would still re-try based on da) - * Processes an individual payments-init message. - * - * @param $msg A STOMP message class. - * - */ -function fredge_payments_init_process_message($msg) { - $txnid = $msg->headers['correlation-id']; - watchdog('fredge', "Beginning processing of payments-init message for $txnid: " . json_encode($msg), array(), WATCHDOG_INFO); - - $body = json_decode($msg->body, TRUE); - - $id = 0; - $inserting = true; - - $dbs = wmf_civicrm_get_dbs(); - $dbs->push('fredge'); - $query = 'SELECT id FROM payments_initial WHERE contribution_tracking_id = :ct_id AND order_id = :order_id LIMIT 1'; - $result = db_query( $query, array( -':ct_id' => $body['contribution_tracking_id'], -':order_id' => $body['order_id'] - ) ); - if ( $result->rowCount() === 1 ){ -$id = $result->fetch()->id; -$inserting = false; - } - - $data = fredge_prep_data($body, 'payments_initial', $txnid, $inserting); - - if ( $inserting ) { -db_insert( 'payments_initial' ) - ->fields( $data ) - ->execute(); - } else { -db_update( 'payments_initial' ) - ->fields( $data ) - ->condition( 'id', $id ) - ->execute(); - } -} - -/** -=== ->>> BRANCH (8b2876 Fix the 8 contributions which would still re-try based on da) * Check a message against a table schema, and complain if it doesn't fit. Also * format date fields and discard fields with no matching column. * @param array $msg the array-converted message body diff --git a/sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json b/sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json deleted file mode 100644 index 5472480..000 --- a/sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "validation_action": "process", - "risk_score": "0.3", - "score_breakdown": { - "initial": "0", - "getCVVResult": "0.2", - "getAVSResult": "0", - "getScoreCountryMap": "0", - "getScoreUtmCampaignMap": "0", -
[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.28.0-wmf.17]: Redo mapframe disabling
jenkins-bot has submitted this change and it was merged. Change subject: Redo mapframe disabling .. Redo mapframe disabling Looks like extension.json doesn't allow you to override arrays 8-O Change-Id: Idd82be8624c988ceacde6c62117ac7aa79b60b2d --- M extension.json M includes/Hooks.php 2 files changed, 5 insertions(+), 6 deletions(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index ea345dd..d4d0bc9 100644 --- a/extension.json +++ b/extension.json @@ -373,7 +373,7 @@ "KartographerIconServer": "https://maps.wikimedia.org;, "KartographerFrameMode": "interactive", "KartographerUseMarkerStyle": false, - "KartographerEnableTags": [ "mapframe", "maplink" ] + "KartographerEnableMapFrame": true }, "TrackingCategories": [ "kartographer-tracking-category", diff --git a/includes/Hooks.php b/includes/Hooks.php index 07fdff1..c934c66 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -26,12 +26,11 @@ * @return bool */ public static function onParserFirstCallInit( Parser $parser ) { - global $wgKartographerEnableTags; + global $wgKartographerEnableMapFrame; - foreach ( $wgKartographerEnableTags as $tag ) { - if ( isset( self::$tags[$tag] ) ) { - $parser->setHook( $tag, self::$tags[$tag] ); - } + $parser->setHook( 'maplink', 'Kartographer\Tag\MapLink::entryPoint' ); + if ( $wgKartographerEnableMapFrame ) { + $parser->setHook( 'mapframe', 'Kartographer\Tag\MapFrame::entryPoint' ); } return true; -- To view, visit https://gerrit.wikimedia.org/r/308085 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idd82be8624c988ceacde6c62117ac7aa79b60b2d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: wmf/1.28.0-wmf.17 Gerrit-Owner: MaxSemGerrit-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] wikimedia...jouncebot[master]: Use normal messages rather than notices for help
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/308087 Change subject: Use normal messages rather than notices for help .. Use normal messages rather than notices for help This just randomly bugs me. I know that using notice for this is more proper to the IRC protocol spec, but all the clients I use actually ping on all in-channel notices. Change-Id: I4a699dd1bece54f8a1b5c347fd4034934aefca92 --- M jouncebot.py 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/bots/jouncebot refs/changes/87/308087/1 diff --git a/jouncebot.py b/jouncebot.py index 063ce09..f1f5ab8 100755 --- a/jouncebot.py +++ b/jouncebot.py @@ -132,7 +132,7 @@ def do_command_help(self, conn, event, cmd, source, nickmask): """Prints the list of all commands known to the server""" -self.multiline_notice( +self.multiline( conn, source, """ @@ -142,7 +142,7 @@ \x02Available commands:\x02""" ) for cmd in sorted(self.brain): -self.multiline_notice(conn, source, " %-7s %s" % ( +self.multiline(conn, source, " %-7s %s" % ( cmd.upper(), self.brain[cmd].__doc__)) def do_command_die(self, conn, event, cmd, nick, nickmask): @@ -194,7 +194,7 @@ self.connection.privmsg( self.channel, msg.format(owners=owners, event=event)) -def multiline_notice(self, conn, nick, text): +def multiline(self, conn, nick, text): lines = text.expandtabs().splitlines() indent = sys.maxint if lines[1:]: @@ -203,12 +203,12 @@ indent = min(indent, len(lines[1]) - len(stripped)) if lines[0] == '': del lines[0] -conn.notice(nick, lines[0][indent:]) +conn.privmsg(nick, lines[0][indent:]) else: -conn.notice(nick, lines[0]) +conn.privmsg(nick, lines[0]) for line in lines[1:]: -conn.notice(nick, line[indent:]) +conn.privmsg(nick, line[indent:]) if __name__ == "__main__": -- To view, visit https://gerrit.wikimedia.org/r/308087 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a699dd1bece54f8a1b5c347fd4034934aefca92 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/bots/jouncebot Gerrit-Branch: master Gerrit-Owner: BryanDavis___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: $wgKartographerEnableTags --> $wgKartographerEnableMapFrame
jenkins-bot has submitted this change and it was merged. Change subject: $wgKartographerEnableTags --> $wgKartographerEnableMapFrame .. $wgKartographerEnableTags --> $wgKartographerEnableMapFrame Change-Id: Icbcc234569ff1d21c4d6ca5f7072464f682389db --- M wmf-config/InitialiseSettings.php 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index c7eaa90..fc4cef4 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -17377,14 +17377,14 @@ 'wikivoyage' => true, ], -'wgKartographerEnableTags' => [ - 'default' => [ 'mapframe', 'maplink' ], - 'wikipedia' => [ 'maplink' ], - 'cawiki' => [ 'mapframe', 'maplink' ], - 'hewiki' => [ 'mapframe', 'maplink' ], - 'mkwiki' => [ 'mapframe', 'maplink' ], - 'testwiki' => [ 'mapframe', 'maplink' ], - 'test2wiki' => [ 'mapframe', 'maplink' ], +'wgKartographerEnableMapFrame' => [ + 'default' => true, + 'wikipedia' => false, + 'cawiki' => true, + 'hewiki' => true, + 'mkwiki' => true, + 'testwiki' => true, + 'test2wiki' => true, ], 'wmgUseOATHAuth' => [ -- To view, visit https://gerrit.wikimedia.org/r/308084 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icbcc234569ff1d21c4d6ca5f7072464f682389db Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MaxSemGerrit-Reviewer: Florianschmidtwelzow 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] wikimedia...jouncebot[master]: Add a "now" command
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/308086 Change subject: Add a "now" command .. Add a "now" command This comes up occasionally on irc as a desired feature, so let's implement it. The "now" command does a brute force scan of the event database and outputs a message for every event where start time if now or before and end time is now or later. Change-Id: I6960e576ac846b7e66106e556a9c303e09678cbc --- M deploypage.py M jouncebot.py 2 files changed, 21 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/bots/jouncebot refs/changes/86/308086/1 diff --git a/deploypage.py b/deploypage.py index 2f4a057..8baa661 100644 --- a/deploypage.py +++ b/deploypage.py @@ -98,7 +98,14 @@ return self.deploy_items def get_current_events(self): -pass +"""What is the set of DeployEvents overlapping the current time""" +ctime = datetime.datetime.now(pytz.utc) +found = [] +for k in self.deploy_items: +item = self.deploy_items[k] +if item.start <= ctime and item.end >= ctime: +found.append(item) +return found def get_next_events(self): """What are the first set of DeployEvents in the future""" diff --git a/jouncebot.py b/jouncebot.py index 063ce09..5f9b1ce 100755 --- a/jouncebot.py +++ b/jouncebot.py @@ -45,6 +45,7 @@ 'help': self.do_command_help, 'die': self.do_command_die, 'next': self.do_command_next, +'now': self.do_command_now, 'refresh': self.do_command_refresh, } if self.config['debug']: @@ -168,6 +169,18 @@ event.window, event.url)) +def do_command_now(self, conn, event, cmd, source, nickmask): +ctime = datetime.datetime.now(pytz.utc) +for event in self.deploy_page.get_current_events(): +td = ctime - event.end +conn.privmsg( +source, +"For the next %d hour(s) and %d minute(s): %s (%s)" % ( +td.days * 24 + td.seconds / 60 / 60, +td.seconds % (60 * 60) / 60, +event.window, +event.url)) + def do_command_debug(self, conn, event, cmd, source, nickmask): """Debugging commands""" if len(cmd) > 1 and cmd[1] == 'play events': -- To view, visit https://gerrit.wikimedia.org/r/308086 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6960e576ac846b7e66106e556a9c303e09678cbc Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/bots/jouncebot Gerrit-Branch: master Gerrit-Owner: BryanDavis___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove unused custom transaction logic from DataUpdate
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused custom transaction logic from DataUpdate .. Remove unused custom transaction logic from DataUpdate Change-Id: Ife65e4e90a35395e87f4f487f1cb871b67d92aa1 --- M includes/deferred/DataUpdate.php M includes/deferred/LinksDeletionUpdate.php M includes/deferred/LinksUpdate.php M includes/deferred/SqlDataUpdate.php M tests/phpunit/includes/deferred/LinksUpdateTest.php 5 files changed, 7 insertions(+), 135 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/deferred/DataUpdate.php b/includes/deferred/DataUpdate.php index 281ac24..cad89b1 100644 --- a/includes/deferred/DataUpdate.php +++ b/includes/deferred/DataUpdate.php @@ -24,10 +24,6 @@ /** * Abstract base class for update jobs that do something with some secondary * data extracted from article. - * - * @note subclasses should NOT start or commit transactions in their doUpdate() method, - * a transaction will automatically be wrapped around the update. If need be, - * subclasses can override the beginTransaction() and commitTransaction() methods. */ abstract class DataUpdate implements DeferrableUpdate { /** @var mixed Result from LBFactory::getEmptyTransactionTicket() */ @@ -43,30 +39,6 @@ */ public function setTransactionTicket( $ticket ) { $this->ticket = $ticket; - } - - /** -* Begin an appropriate transaction, if any. -* This default implementation does nothing. -*/ - public function beginTransaction() { - // noop - } - - /** -* Commit the transaction started via beginTransaction, if any. -* This default implementation does nothing. -*/ - public function commitTransaction() { - // noop - } - - /** -* Abort / roll back the transaction started via beginTransaction, if any. -* This default implementation does nothing. -*/ - public function rollbackTransaction() { - // noop } /** @@ -91,44 +63,8 @@ $updates = self::enqueueUpdates( $updates ); } - if ( !count( $updates ) ) { - return; // nothing to do - } - - $open_transactions = []; - $exception = null; - - try { - // begin transactions - foreach ( $updates as $update ) { - $update->beginTransaction(); - $open_transactions[] = $update; - } - - // do work - foreach ( $updates as $update ) { - $update->doUpdate(); - } - - // commit transactions - while ( count( $open_transactions ) > 0 ) { - $trans = array_pop( $open_transactions ); - $trans->commitTransaction(); - } - } catch ( Exception $ex ) { - $exception = $ex; - wfDebug( "Caught exception, will rethrow after rollback: " . - $ex->getMessage() . "\n" ); - } - - // rollback remaining transactions - while ( count( $open_transactions ) > 0 ) { - $trans = array_pop( $open_transactions ); - $trans->rollbackTransaction(); - } - - if ( $exception ) { - throw $exception; // rethrow after cleanup + foreach ( $updates as $update ) { + $update->doUpdate(); } } diff --git a/includes/deferred/LinksDeletionUpdate.php b/includes/deferred/LinksDeletionUpdate.php index ca3500e..d0b12a0 100644 --- a/includes/deferred/LinksDeletionUpdate.php +++ b/includes/deferred/LinksDeletionUpdate.php @@ -42,6 +42,8 @@ * @throws MWException */ function __construct( WikiPage $page, $pageId = null, $timestamp = null ) { + parent::__construct(); + $this->page = $page; if ( $pageId ) { $this->pageId = $pageId; // page ID at time of deletion diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index 6124a71..69f8d13 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -108,6 +108,8 @@ * @throws MWException */ function __construct( Title $title, ParserOutput $parserOutput, $recursive = true ) { + parent::__construct(); + $this->mTitle = $title;
[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.28.0-wmf.17]: Redo mapframe disabling
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/308085 Change subject: Redo mapframe disabling .. Redo mapframe disabling Looks like extension.json doesn't allow you to override arrays 8-O Change-Id: Idd82be8624c988ceacde6c62117ac7aa79b60b2d --- M extension.json M includes/Hooks.php 2 files changed, 5 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer refs/changes/85/308085/1 diff --git a/extension.json b/extension.json index ea345dd..d4d0bc9 100644 --- a/extension.json +++ b/extension.json @@ -373,7 +373,7 @@ "KartographerIconServer": "https://maps.wikimedia.org;, "KartographerFrameMode": "interactive", "KartographerUseMarkerStyle": false, - "KartographerEnableTags": [ "mapframe", "maplink" ] + "KartographerEnableMapFrame": true }, "TrackingCategories": [ "kartographer-tracking-category", diff --git a/includes/Hooks.php b/includes/Hooks.php index 07fdff1..c934c66 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -26,12 +26,11 @@ * @return bool */ public static function onParserFirstCallInit( Parser $parser ) { - global $wgKartographerEnableTags; + global $wgKartographerEnableMapFrame; - foreach ( $wgKartographerEnableTags as $tag ) { - if ( isset( self::$tags[$tag] ) ) { - $parser->setHook( $tag, self::$tags[$tag] ); - } + $parser->setHook( 'maplink', 'Kartographer\Tag\MapLink::entryPoint' ); + if ( $wgKartographerEnableMapFrame ) { + $parser->setHook( 'mapframe', 'Kartographer\Tag\MapFrame::entryPoint' ); } return true; -- To view, visit https://gerrit.wikimedia.org/r/308085 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd82be8624c988ceacde6c62117ac7aa79b60b2d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: wmf/1.28.0-wmf.17 Gerrit-Owner: MaxSem___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: $wgKartographerEnableTags --> $wgKartographerEnableMapFrame
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/308084 Change subject: $wgKartographerEnableTags --> $wgKartographerEnableMapFrame .. $wgKartographerEnableTags --> $wgKartographerEnableMapFrame Change-Id: Icbcc234569ff1d21c4d6ca5f7072464f682389db --- M wmf-config/InitialiseSettings.php 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/84/308084/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index c7eaa90..fc4cef4 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -17377,14 +17377,14 @@ 'wikivoyage' => true, ], -'wgKartographerEnableTags' => [ - 'default' => [ 'mapframe', 'maplink' ], - 'wikipedia' => [ 'maplink' ], - 'cawiki' => [ 'mapframe', 'maplink' ], - 'hewiki' => [ 'mapframe', 'maplink' ], - 'mkwiki' => [ 'mapframe', 'maplink' ], - 'testwiki' => [ 'mapframe', 'maplink' ], - 'test2wiki' => [ 'mapframe', 'maplink' ], +'wgKartographerEnableMapFrame' => [ + 'default' => true, + 'wikipedia' => false, + 'cawiki' => true, + 'hewiki' => true, + 'mkwiki' => true, + 'testwiki' => true, + 'test2wiki' => true, ], 'wmgUseOATHAuth' => [ -- To view, visit https://gerrit.wikimedia.org/r/308084 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icbcc234569ff1d21c4d6ca5f7072464f682389db Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MaxSem___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[deployment]: Merge branch 'master' into deployment
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/308083 Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment d1213d0 Move payments-init queue off ActiveMQ eae39f7 Don't pollute $msg with pending_id 9bfa67e Fix constructor args for payments-init consumer Change-Id: I2ce94fa3943f2731f81b3d69f32365d587ddcbe3 --- M sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.info M sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.module D sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json D sites/all/modules/queue2civicrm/tests/data/payments-init.json 4 files changed, 0 insertions(+), 100 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/83/308083/1 diff --git a/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.info b/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.info index 2aec405..04e8797 100644 --- a/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.info +++ b/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.info @@ -5,7 +5,4 @@ configure = admin/config/queue2civicrm/fredge_qc dependencies[] = queue2civicrm files[] = AntifraudQueueConsumer.php -<<< HEAD (1678e1 Fix the 8 contributions which would still re-try based on da) -=== files[] = PaymentsInitQueueConsumer.php ->>> BRANCH (8b2876 Fix the 8 contributions which would still re-try based on da) diff --git a/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.module b/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.module index 7f42339..d79537f 100644 --- a/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.module +++ b/sites/all/modules/queue2civicrm/fredge/wmf_fredge_qc.module @@ -1,9 +1,6 @@ >> BRANCH (8b2876 Fix the 8 contributions which would still re-try based on da) use SmashPig\Core\Configuration; use SmashPig\Core\Context; @@ -79,21 +76,12 @@ //Let's start with the simplest possible division of labor $cycle_time = variable_get('fredge_batch_time', 0) / 2; -<<< HEAD (1678e1 Fix the 8 contributions which would still re-try based on da) - $processed = queue2civicrm_stomp()->dequeue_loop( -variable_get('fredge_payments_init_queue', '/queue/payments-init'), -false, -$cycle_time, -'fredge_payments_init_process_message' - ); -=== $paymentsInitConsumer = new PaymentsInitQueueConsumer( variable_get('fredge_payments_init_queue', 'payments-init'), $cycle_time ); $processed = $paymentsInitConsumer->dequeueMessages(); ->>> BRANCH (8b2876 Fix the 8 contributions which would still re-try based on da) $fraudQueueConsumer = new AntifraudQueueConsumer( variable_get('fredge_payments_antifraud_queue', 'payments-antifraud'), @@ -111,50 +99,6 @@ } /** -<<< HEAD (1678e1 Fix the 8 contributions which would still re-try based on da) - * Processes an individual payments-init message. - * - * @param $msg A STOMP message class. - * - */ -function fredge_payments_init_process_message($msg) { - $txnid = $msg->headers['correlation-id']; - watchdog('fredge', "Beginning processing of payments-init message for $txnid: " . json_encode($msg), array(), WATCHDOG_INFO); - - $body = json_decode($msg->body, TRUE); - - $id = 0; - $inserting = true; - - $dbs = wmf_civicrm_get_dbs(); - $dbs->push('fredge'); - $query = 'SELECT id FROM payments_initial WHERE contribution_tracking_id = :ct_id AND order_id = :order_id LIMIT 1'; - $result = db_query( $query, array( -':ct_id' => $body['contribution_tracking_id'], -':order_id' => $body['order_id'] - ) ); - if ( $result->rowCount() === 1 ){ -$id = $result->fetch()->id; -$inserting = false; - } - - $data = fredge_prep_data($body, 'payments_initial', $txnid, $inserting); - - if ( $inserting ) { -db_insert( 'payments_initial' ) - ->fields( $data ) - ->execute(); - } else { -db_update( 'payments_initial' ) - ->fields( $data ) - ->condition( 'id', $id ) - ->execute(); - } -} - -/** -=== ->>> BRANCH (8b2876 Fix the 8 contributions which would still re-try based on da) * Check a message against a table schema, and complain if it doesn't fit. Also * format date fields and discard fields with no matching column. * @param array $msg the array-converted message body diff --git a/sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json b/sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json deleted file mode 100644 index 5472480..000 --- a/sites/all/modules/queue2civicrm/tests/data/payments-antifraud.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "validation_action": "process", - "risk_score": "0.3", - "score_breakdown": { - "initial": "0", - "getCVVResult": "0.2", - "getAVSResult": "0", - "getScoreCountryMap": "0", -
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Set some missing INTERNAL DB transaction flags and add wfWar...
jenkins-bot has submitted this change and it was merged. Change subject: Set some missing INTERNAL DB transaction flags and add wfWarn() calls .. Set some missing INTERNAL DB transaction flags and add wfWarn() calls Make TRANSACTION_INTERNAL set mTrxAutomatic rather that having callers have to do that individually. The warnings should actually make tests fail with backtraces, rather than often just having wrong things happen later. Change-Id: Ic247a7b42a686f170f7abe6ec584459f3db4ed69 --- M includes/db/Database.php 1 file changed, 15 insertions(+), 11 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/Database.php b/includes/db/Database.php index a864f0f..e5f21c4 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2330,12 +2330,12 @@ $ok = $this->insert( $table, $rows, $fname, [ 'IGNORE' ] ) && $ok; } catch ( Exception $e ) { if ( $useTrx ) { - $this->rollback( $fname ); + $this->rollback( $fname, self::FLUSHING_INTERNAL ); } throw $e; } if ( $useTrx ) { - $this->commit( $fname, self::TRANSACTION_INTERNAL ); + $this->commit( $fname, self::FLUSHING_INTERNAL ); } return $ok; @@ -2634,12 +2634,12 @@ $this->mTrxPreCommitCallbacks[] = [ $callback, wfGetCaller() ]; } else { // If no transaction is active, then make one for this callback - $this->begin( __METHOD__, self::TRANSACTION_INTERNAL ); + $this->startAtomic( __METHOD__ ); try { call_user_func( $callback ); - $this->commit( __METHOD__ ); + $this->endAtomic( __METHOD__ ); } catch ( Exception $e ) { - $this->rollback( __METHOD__ ); + $this->rollback( __METHOD__, self::FLUSHING_INTERNAL ); throw $e; } } @@ -2705,7 +2705,7 @@ // Some callbacks may use startAtomic/endAtomic, so make sure // their transactions are ended so other callbacks don't fail if ( $this->trxLevel() ) { - $this->rollback( __METHOD__ ); + $this->rollback( __METHOD__, self::FLUSHING_INTERNAL ); } } } @@ -2780,7 +2780,6 @@ final public function startAtomic( $fname = __METHOD__ ) { if ( !$this->mTrxLevel ) { $this->begin( $fname, self::TRANSACTION_INTERNAL ); - $this->mTrxAutomatic = true; // If DBO_TRX is set, a series of startAtomic/endAtomic pairs will result // in all changes being in one transaction to keep requests transactional. if ( !$this->getFlag( DBO_TRX ) ) { @@ -2811,7 +2810,7 @@ try { $res = call_user_func_array( $callback, [ $this, $fname ] ); } catch ( Exception $e ) { - $this->rollback( $fname ); + $this->rollback( $fname, self::FLUSHING_INTERNAL ); throw $e; } $this->endAtomic( $fname ); @@ -2833,11 +2832,14 @@ // @TODO: make this an exception at some point $msg = "$fname: Implicit transaction already active (from {$this->mTrxFname})."; wfLogDBError( $msg ); + wfWarn( $msg ); return; // join the main transaction set } } elseif ( $this->getFlag( DBO_TRX ) && $mode !== self::TRANSACTION_INTERNAL ) { // @TODO: make this an exception at some point - wfLogDBError( "$fname: Implicit transaction expected (DBO_TRX set)." ); + $msg = "$fname: Implicit transaction expected (DBO_TRX set)."; + wfLogDBError( $msg ); + wfWarn( $msg ); return; // let any writes be in the main transaction } @@ -2848,7 +2850,7 @@ $this->mTrxTimestamp = microtime( true ); $this->mTrxFname = $fname;
[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Redo mapframe disabling
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/308082 Change subject: Redo mapframe disabling .. Redo mapframe disabling Looks like extension.json doesn't allow you to override arrays 8-O Change-Id: Idd82be8624c988ceacde6c62117ac7aa79b60b2d --- M extension.json M includes/Hooks.php 2 files changed, 5 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer refs/changes/82/308082/1 diff --git a/extension.json b/extension.json index f8bbc27..5da73b7 100644 --- a/extension.json +++ b/extension.json @@ -374,7 +374,7 @@ "KartographerIconServer": "https://maps.wikimedia.org;, "KartographerFrameMode": "interactive", "KartographerUseMarkerStyle": false, - "KartographerEnableTags": [ "mapframe", "maplink" ] + "KartographerEnableMapFrame": true }, "TrackingCategories": [ "kartographer-tracking-category", diff --git a/includes/Hooks.php b/includes/Hooks.php index 07fdff1..c934c66 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -26,12 +26,11 @@ * @return bool */ public static function onParserFirstCallInit( Parser $parser ) { - global $wgKartographerEnableTags; + global $wgKartographerEnableMapFrame; - foreach ( $wgKartographerEnableTags as $tag ) { - if ( isset( self::$tags[$tag] ) ) { - $parser->setHook( $tag, self::$tags[$tag] ); - } + $parser->setHook( 'maplink', 'Kartographer\Tag\MapLink::entryPoint' ); + if ( $wgKartographerEnableMapFrame ) { + $parser->setHook( 'mapframe', 'Kartographer\Tag\MapFrame::entryPoint' ); } return true; -- To view, visit https://gerrit.wikimedia.org/r/308082 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd82be8624c988ceacde6c62117ac7aa79b60b2d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: MaxSem___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove redundant API tag in EntityUsage
jenkins-bot has submitted this change and it was merged. Change subject: Remove redundant API tag in EntityUsage .. Remove redundant API tag in EntityUsage Change-Id: Ic595545d9098623c5ec2dfd99ef15f5a099e8d24 --- M client/includes/Api/EntityUsage.php 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Thiemo Mättig (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/client/includes/Api/EntityUsage.php b/client/includes/Api/EntityUsage.php index 5123dff..4f1471c 100644 --- a/client/includes/Api/EntityUsage.php +++ b/client/includes/Api/EntityUsage.php @@ -69,7 +69,6 @@ ApiResult::setIndexedTagName( $entry[$row->eu_entity_id]['aspects'], 'aspect' ); - ApiResult::setIndexedTagName( $entry, 'entity' ); ApiResult::setArrayType( $entry, 'kvp', 'id' ); } -- To view, visit https://gerrit.wikimedia.org/r/307811 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic595545d9098623c5ec2dfd99ef15f5a099e8d24 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: LadsgroupGerrit-Reviewer: Addshore Gerrit-Reviewer: Aude Gerrit-Reviewer: Daniel Kinzler Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Thiemo Mättig (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...CollaborationKit[master]: Fix SpeciaCreateCollaborationHub so it actually works (wrong...
jenkins-bot has submitted this change and it was merged. Change subject: Fix SpeciaCreateCollaborationHub so it actually works (wrong content content for update content model) .. Fix SpeciaCreateCollaborationHub so it actually works (wrong content content for update content model) Should be an empty array always on create. Nothing else at present. Change-Id: I0507e85494b4f4bb63371e5845628ba9ce19e269 --- M i18n/en.json M includes/SpecialCreateCollaborationHub.php M includes/content/CollaborationHubContentHandler.php 3 files changed, 7 insertions(+), 11 deletions(-) Approvals: Isarra: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index 6c5f5b8..f7501e5 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -48,6 +48,6 @@ "collaborationkit-hub-missingpage-create": "Create feature", "collaborationkit-hub-subpage-view": "View", "collaborationkit-hub-subpage-remove": "Remove feature", - "collaborationkit-hub-edit-apierror": "API edit error", + "collaborationkit-hub-edit-apierror": "API edit error: $1", "collaborationkit-hub-edit-tojsonerror": "Error converting to JSON" } diff --git a/includes/SpecialCreateCollaborationHub.php b/includes/SpecialCreateCollaborationHub.php index 06c147f..0cbff26 100644 --- a/includes/SpecialCreateCollaborationHub.php +++ b/includes/SpecialCreateCollaborationHub.php @@ -71,11 +71,11 @@ 'cssclass' => 'mw-ck-sourceinput' ]; - $fields['description'] = [ + $fields['introduction'] = [ 'type' => 'textarea', 'rows' => 5, 'label-message' => 'collaborationkit-createhub-introduction', - 'cssclass' => 'mw-ck-descriptioninput' + 'cssclass' => 'mw-ck-introductioninput' ]; return $fields; @@ -112,11 +112,6 @@ return Status::newFatal( 'collaborationhkit-createhub-nopermission' ); } - $content = [ - 'type' => 'subpage-list', - 'items' => [] - ]; - // ACTUAL STUFF HERE if ( $data['content_source'] !== 'new' ) { // Importing from wikitext $source = Title::newFromText( $data['source'] ); @@ -152,8 +147,9 @@ $data['display_name'], $data['icon'], $data['colour'], - $data['description'], - $content, + $data['introduction'], + '', + [], $this->msg( 'collaborationkit-createhub-editsummary' )->inContentLanguage()->plain(), $this->getContext() ); diff --git a/includes/content/CollaborationHubContentHandler.php b/includes/content/CollaborationHubContentHandler.php index 4cef2b4..9dd3024 100644 --- a/includes/content/CollaborationHubContentHandler.php +++ b/includes/content/CollaborationHubContentHandler.php @@ -57,7 +57,7 @@ * @param string $colour * @param string $introduction * @param string $footer -* @param array|string $content +* @param array $content * @param string $summary Message key for edit summary * @param IContextSource $context The calling context * @return Status -- To view, visit https://gerrit.wikimedia.org/r/308080 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0507e85494b4f4bb63371e5845628ba9ce19e269 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CollaborationKit Gerrit-Branch: master Gerrit-Owner: IsarraGerrit-Reviewer: Isarra Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits