[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Fix bogus stats where stashes counted as misses
jenkins-bot has submitted this change and it was merged. Change subject: Fix bogus stats where stashes counted as misses .. Fix bogus stats where stashes counted as misses Change-Id: Iefacd37f1470c99a04bb199651d8a73ae4da28fc --- M AbuseFilter.class.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php index 8ae0407..60e2978 100644 --- a/AbuseFilter.class.php +++ b/AbuseFilter.class.php @@ -915,13 +915,13 @@ } if ( is_array( $filter_matched ) ) { - if ( $isForEdit ) { + if ( $isForEdit && $mode !== 'stash' ) { $logger->info( __METHOD__ . ": cache hit for '$title' (key $stashKey)." ); $statsd->increment( 'abusefilter.check-stash.hit' ); } } else { $filter_matched = self::checkAllFilters( $vars, $group ); - if ( $isForEdit ) { + if ( $isForEdit && $mode !== 'stash' ) { $logger->info( __METHOD__ . ": cache miss for '$title' (key $stashKey)." ); $statsd->increment( 'abusefilter.check-stash.miss' ); } -- To view, visit https://gerrit.wikimedia.org/r/307468 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iefacd37f1470c99a04bb199651d8a73ae4da28fc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Jackmcbarn Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Victor Vasiliev 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]: toollabs: install pdf2djvu
Dzahn has submitted this change and it was merged. Change subject: toollabs: install pdf2djvu .. toollabs: install pdf2djvu Bug: T130138 Change-Id: Ib75973e95b59c3ab5794563a1dbeaf7ffb55f6d0 --- M modules/toollabs/manifests/exec_environ.pp 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/toollabs/manifests/exec_environ.pp b/modules/toollabs/manifests/exec_environ.pp index d690aba..44f1f7e 100644 --- a/modules/toollabs/manifests/exec_environ.pp +++ b/modules/toollabs/manifests/exec_environ.pp @@ -305,6 +305,7 @@ 'openbabel', # T68995 'p7zip-full', # requested by Betacommand and danilo to decompress 7z files 'pdf2svg', # T70092. +'pdf2djvu',# T130138 'pdftk', # T67048. 'phantomjs', # T68928 'phpunit', -- To view, visit https://gerrit.wikimedia.org/r/304788 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib75973e95b59c3ab5794563a1dbeaf7ffb55f6d0 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Merlijn van DeenGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: Coren Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Rush Gerrit-Reviewer: Yuvipanda Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...PerformanceInspector[master]: Sort images by size
Phedenskog has uploaded a new change for review. https://gerrit.wikimedia.org/r/307472 Change subject: Sort images by size .. Sort images by size It's more logical to sort the images by size as we do with modules, instead of sorting them by when they appear on the page. Bug: T144253 Change-Id: Ib6a295bfe4cb0ff379c558947ea0e5f9df796a10 --- M modules/collectors/ext.PerformanceInspector.imagesize.js 1 file changed, 9 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PerformanceInspector refs/changes/72/307472/1 diff --git a/modules/collectors/ext.PerformanceInspector.imagesize.js b/modules/collectors/ext.PerformanceInspector.imagesize.js index 6557875..cbe75f4 100644 --- a/modules/collectors/ext.PerformanceInspector.imagesize.js +++ b/modules/collectors/ext.PerformanceInspector.imagesize.js @@ -55,17 +55,21 @@ $.when.apply( $, promises ).done( function () { var values = arguments, + sizeRaw, i; for ( i = 0; i < values.length; i++ ) { + sizeRaw = Number( values[ i ].contentLength ); images.push( { - name: getImageName( values[ i ].url.substring( values[ i ].url.lastIndexOf( '/' ) + 1 ) ), - url: values[ i ].url, - size: humanSize( Number( values[ i ].contentLength ) ), - warning: values[ i ].contentLength > warningLimitInBytes ? true : false - } ); + name: getImageName( values[ i ].url.substring( values[ i ].url.lastIndexOf( '/' ) + 1 ) ), + url: values[ i ].url, + sizeRaw: sizeRaw, + size: humanSize( sizeRaw ), + warning: values[ i ].contentLength > warningLimitInBytes ? true : false + } ); totalSize += Number( values[ i ].contentLength ); } + images.sort( function ( a, b ) { return b.sizeRaw - a.sizeRaw;} ); deferred.resolve( { summary: { imagesSummary: mw.msg( 'performanceinspector-modules-summary-images', images.length, humanSize( totalSize ), warnings ) -- To view, visit https://gerrit.wikimedia.org/r/307472 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6a295bfe4cb0ff379c558947ea0e5f9df796a10 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PerformanceInspector Gerrit-Branch: master Gerrit-Owner: Phedenskog___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] oojs/ui[master]: docs: IndexLayout: Fix ReferenceError in code sample
Prtksxna has uploaded a new change for review. https://gerrit.wikimedia.org/r/307471 Change subject: docs: IndexLayout: Fix ReferenceError in code sample .. docs: IndexLayout: Fix ReferenceError in code sample Change-Id: Ieab8cd9b55a541d244f232771fe3c401910283db --- M src/layouts/IndexLayout.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/71/307471/1 diff --git a/src/layouts/IndexLayout.js b/src/layouts/IndexLayout.js index a639413..3d83c65 100644 --- a/src/layouts/IndexLayout.js +++ b/src/layouts/IndexLayout.js @@ -20,7 +20,7 @@ * }; * * var card1 = new CardOneLayout( 'one' ), - * card2 = new CardLayout( 'two', { label: 'Card two' } ); + * card2 = new OO.ui.CardLayout( 'two', { label: 'Card two' } ); * * card2.$element.append( 'Second card' ); * -- To view, visit https://gerrit.wikimedia.org/r/307471 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieab8cd9b55a541d244f232771fe3c401910283db Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Prtksxna___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mw.loader: Use requestAnimationFrame for addEmbeddedCSS()
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/307470 Change subject: mw.loader: Use requestAnimationFrame for addEmbeddedCSS() .. mw.loader: Use requestAnimationFrame for addEmbeddedCSS() setTimeout is fairly inefficient for this purpose as it tends to schedule for further in the future than rAF would. And even then, it happens at a bad time for the browser with regards to style changes. Instead, use rAF, which typically executes earlier and at the point where the browser is expecting style changes. This makes top and bottom modules finish execution earlier by having their styles applied sooner. Change-Id: Ie4e7464aa811fa8ea4e4f115696f0bddbd28737b --- M resources/src/mediawiki/mediawiki.js 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/70/307470/1 diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index 0c0d3a4..6426480 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -858,7 +858,8 @@ cssBuffer = '', cssBufferTimer = null, cssCallbacks = $.Callbacks(), - isIE9 = document.documentMode === 9; + isIE9 = document.documentMode === 9, + rAF = window.requestAnimationFrame || setTimeout; function getMarker() { if ( !marker ) { @@ -930,10 +931,9 @@ if ( !cssBuffer || cssText.slice( 0, '@import'.length ) !== '@import' ) { // Linebreak for somewhat distinguishable sections cssBuffer += '\n' + cssText; - // TODO: Using requestAnimationFrame would perform better by not injecting - // styles while the browser is busy painting. if ( !cssBufferTimer ) { - cssBufferTimer = setTimeout( function () { + cssBufferTimer = rAF( function () { + // Wrap in anonymous function that takes no arguments // Support: Firefox < 13 // Firefox 12 has non-standard behaviour of passing a number // as first argument to a setTimeout callback. -- To view, visit https://gerrit.wikimedia.org/r/307470 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie4e7464aa811fa8ea4e4f115696f0bddbd28737b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/debian[master]: Add missing php-xml dependency
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/307469 Change subject: Add missing php-xml dependency .. Add missing php-xml dependency Change-Id: I701f8f5a5fdb30fb82a916c2c36985bc9ed28390 Closes: #835912 --- M debian/control 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/debian refs/changes/69/307469/1 diff --git a/debian/control b/debian/control index 9c378a8..f5850a4 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ Package: mediawiki Architecture: all -Depends: apache2 | httpd, php, php-mysql | php-pgsql | php-sqlite3 | php-mysqlnd, php-common (>= 5.5.0+dfsg-10~), php-mbstring, mime-support, libjs-jquery, mediawiki-classes, ${misc:Depends} +Depends: apache2 | httpd, php, php-mysql | php-pgsql | php-sqlite3 | php-mysqlnd, php-common (>= 5.5.0+dfsg-10~), php-mbstring, php-xml, mime-support, libjs-jquery, mediawiki-classes, ${misc:Depends} Recommends: mysql-server | postgresql-contrib, php-cli, php-intl, php-curl, php-wikidiff2, python Suggests: imagemagick | php-gd, memcached, clamav, php-apcu, hhvm Breaks: fusionforge-plugin-mediawiki (<< 5.2~rc1+1~), -- To view, visit https://gerrit.wikimedia.org/r/307469 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I701f8f5a5fdb30fb82a916c2c36985bc9ed28390 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/debian Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...AbuseFilter[master]: Fix bogus stats where stashes counted as misses
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/307468 Change subject: Fix bogus stats where stashes counted as misses .. Fix bogus stats where stashes counted as misses Change-Id: Iefacd37f1470c99a04bb199651d8a73ae4da28fc --- M AbuseFilter.class.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/68/307468/1 diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php index 8ae0407..60e2978 100644 --- a/AbuseFilter.class.php +++ b/AbuseFilter.class.php @@ -915,13 +915,13 @@ } if ( is_array( $filter_matched ) ) { - if ( $isForEdit ) { + if ( $isForEdit && $mode !== 'stash' ) { $logger->info( __METHOD__ . ": cache hit for '$title' (key $stashKey)." ); $statsd->increment( 'abusefilter.check-stash.hit' ); } } else { $filter_matched = self::checkAllFilters( $vars, $group ); - if ( $isForEdit ) { + if ( $isForEdit && $mode !== 'stash' ) { $logger->info( __METHOD__ . ": cache miss for '$title' (key $stashKey)." ); $statsd->increment( 'abusefilter.check-stash.miss' ); } -- To view, visit https://gerrit.wikimedia.org/r/307468 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iefacd37f1470c99a04bb199651d8a73ae4da28fc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...SpamBlacklist[master]: Fix bogus stats where stashes counted as misses
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/307467 Change subject: Fix bogus stats where stashes counted as misses .. Fix bogus stats where stashes counted as misses Also renew stash values if they will expire soon. Change-Id: I36771f5736f80546aac99409463293c7699fb5de --- M SpamBlacklist_body.php 1 file changed, 19 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SpamBlacklist refs/changes/67/307467/1 diff --git a/SpamBlacklist_body.php b/SpamBlacklist_body.php index 35ad323..7473dd0 100644 --- a/SpamBlacklist_body.php +++ b/SpamBlacklist_body.php @@ -7,6 +7,8 @@ use \MediaWiki\MediaWikiServices; class SpamBlacklist extends BaseBlacklist { + const STASH_TTL = 60; + const STASH_AGE_DYING = 30; /** * Changes to external links, for logging purposes @@ -45,10 +47,11 @@ * @param boolean $preventLog Whether to prevent logging of hits. Set to true when * the action is testing the links rather than attempting to save them * (e.g. the API spamblacklist action) +* @param string $mode Either 'check' or 'stash' * * @return string[]|bool Matched text(s) if the edit should not be allowed; false otherwise */ - function filter( array $links, Title $title = null, $preventLog = false ) { + function filter( array $links, Title $title = null, $preventLog = false, $mode = 'check' ) { $statsd = MediaWikiServices::getInstance()->getStatsdDataFactory(); $cache = ObjectCache::getLocalClusterInstance(); $key = $cache->makeKey( @@ -59,11 +62,19 @@ (string)$title ); // Skip blacklist checks if nothing matched during edit stashing... - if ( $cache->get( $key ) ) { - $statsd->increment( 'spamblacklist.check-stash.hit' ); - return false; - } else { - $statsd->increment( 'spamblacklist.check-stash.miss' ); + $knownNonMatchAsOf = $cache->get( $key ); + if ( $mode === 'check' ) { + if ( $knownNonMatchAsOf ) { + $statsd->increment( 'spamblacklist.check-stash.hit' ); + + return false; + } else { + $statsd->increment( 'spamblacklist.check-stash.miss' ); + } + } elseif ( $mode === 'stash' ) { + if ( ( time() - $knownNonMatchAsOf ) < self::STASH_AGE_DYING ) { + return false; // OK; not about to expire soon + } } $blacklists = $this->getBlacklists(); @@ -143,7 +154,7 @@ if ( $retVal === false ) { // Cache the typical negative results - $cache->set( $key, 1, $cache::TTL_MINUTE ); + $cache->set( $key, time(), $cache::TTL_MINUTE ); $statsd->increment( 'spamblacklist.check-stash.store' ); } @@ -264,7 +275,7 @@ } public function warmCachesForFilter( Title $title, array $entries ) { - $this->filter( $entries, $title, true /* no logging */ ); + $this->filter( $entries, $title, true /* no logging */, 'stash' ); } /** -- To view, visit https://gerrit.wikimedia.org/r/307467 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I36771f5736f80546aac99409463293c7699fb5de Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SpamBlacklist Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...openssl[wmf-1.1]: openssl (1.1.0-1~wmf1) jessie-wikimedia; urgency=medium
BBlack has uploaded a new change for review. https://gerrit.wikimedia.org/r/307466 Change subject: openssl (1.1.0-1~wmf1) jessie-wikimedia; urgency=medium .. openssl (1.1.0-1~wmf1) jessie-wikimedia; urgency=medium * Added local chapoly preference hack patch -- Brandon BlackTue, 30 Aug 2016 02:23:57 + Change-Id: Ia8598278cf06a5f14ba3de343349f4f949b16ac0 --- M debian/changelog 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/openssl refs/changes/66/307466/1 diff --git a/debian/changelog b/debian/changelog index 66f1a3a..0c7805d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +openssl (1.1.0-1~wmf1) jessie-wikimedia; urgency=medium + + * Added local chapoly preference hack patch + + -- Brandon Black Tue, 30 Aug 2016 02:23:57 + + openssl (1.1.0-1) experimental; urgency=medium [ Kurt Roeckx ] -- To view, visit https://gerrit.wikimedia.org/r/307466 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8598278cf06a5f14ba3de343349f4f949b16ac0 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/openssl Gerrit-Branch: wmf-1.1 Gerrit-Owner: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...openssl[wmf-1.1]: Add local chapoly preference hack patch
BBlack has uploaded a new change for review. https://gerrit.wikimedia.org/r/307465 Change subject: Add local chapoly preference hack patch .. Add local chapoly preference hack patch Change-Id: I3d78bced70591c095866aeff74e9910be93b9887 --- A debian/patches/chapoly-prefhack.patch M debian/patches/series 2 files changed, 58 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/openssl refs/changes/65/307465/1 diff --git a/debian/patches/chapoly-prefhack.patch b/debian/patches/chapoly-prefhack.patch new file mode 100644 index 000..80d873a --- /dev/null +++ b/debian/patches/chapoly-prefhack.patch @@ -0,0 +1,57 @@ +diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c +index e94ee83..75d5435 100644 +--- a/ssl/s3_lib.c b/ssl/s3_lib.c +@@ -3582,6 +3582,7 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, + STACK_OF(SSL_CIPHER) *prio, *allow; + int i, ii, ok; + unsigned long alg_k, alg_a, mask_k, mask_a; ++int use_chapoly = 0; + + /* Let's see which ciphers we can support */ + +@@ -3614,9 +3615,31 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, + if (s->options & SSL_OP_CIPHER_SERVER_PREFERENCE || tls1_suiteb(s)) { + prio = srvr; + allow = clnt; ++/* ++ * Search client ciphersuite subset 'ECDHE-*', turning on server-side ++ * chapoly support iff chapoly is higher than AES-GCM (which may not ++ * even exist!) within. This is intended to be used with a server ++ * preference that starts out with chapoly before aesgcm: ++ * ECDHE-RSA-CHACHA20-POLY1305 (and/or ECDSA) ++ * ECDHE-RSA-AES128-GCM-SHA256 (and/or ECDSA and/or AES256) ++ * ... lesser compatibility options ... ++ */ ++for (i = 0; i < sk_SSL_CIPHER_num(clnt); i++) { ++c = sk_SSL_CIPHER_value(clnt, i); ++if (c->algorithm_mkey == SSL_kEECDH) { ++if (c->algorithm_enc == SSL_AES128GCM ++|| c->algorithm_enc == SSL_AES256GCM) { ++break; ++} else if (c->algorithm_enc == SSL_CHACHA20POLY1305) { ++use_chapoly = 1; ++break; ++} ++} ++} + } else { + prio = clnt; + allow = srvr; ++use_chapoly = 1; + } + + tls1_set_cert_validity(s); +@@ -3634,6 +3657,12 @@ const SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, + DTLS_VERSION_GT(s->version, c->max_dtls))) + continue; + ++/* Skip chapoly unless turned on above */ ++if (c->algorithm_enc == SSL_CHACHA20POLY1305 ++&& c->algorithm_mkey == SSL_kEECDH ++&& !use_chapoly) ++continue; ++ + mask_k = s->s3->tmp.mask_k; + mask_a = s->s3->tmp.mask_a; + #ifndef OPENSSL_NO_SRP diff --git a/debian/patches/series b/debian/patches/series index 5b5a83d..132ed71 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ pic.patch c_rehash-compat.patch #padlock_conf.patch +chapoly-prefhack.patch -- To view, visit https://gerrit.wikimedia.org/r/307465 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d78bced70591c095866aeff74e9910be93b9887 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/openssl Gerrit-Branch: wmf-1.1 Gerrit-Owner: BBlack___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mw.widgets.CategoryCapsuleItemWidget: Handle titles not norm...
jenkins-bot has submitted this change and it was merged. Change subject: mw.widgets.CategoryCapsuleItemWidget: Handle titles not normalized in JS code .. mw.widgets.CategoryCapsuleItemWidget: Handle titles not normalized in JS code Bug: T139130 Change-Id: If20941fb381a01aab01b971e1093a53b76c96f66 --- M resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js 1 file changed, 13 insertions(+), 5 deletions(-) Approvals: Anomie: Looks good to me, but someone else must approve Jforrester: Looks good to me, but someone else must approve Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js b/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js index 946823d..4d86cfd 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js +++ b/resources/src/mediawiki.widgets/mw.widgets.CategoryCapsuleItemWidget.js @@ -52,13 +52,21 @@ prop: [ 'info' ], titles: titles } ).done( function ( response ) { + var + normalized = {}, + pages = {}; + $.each( response.query.normalized || [], function ( index, data ) { + normalized[ data.fromencoded ? decodeURIComponent( data.from ) : data.from ] = data.to; + } ); $.each( response.query.pages, function ( index, page ) { - var title = new ForeignTitle( page.title ).getPrefixedText(); - cache.existenceCache[ title ] = !page.missing; - if ( !queue[ title ] ) { - // Debugging for T139130 - throw new Error( 'No queue for "' + title + '", requested "' + titles.join( '|' ) + '"' ); + pages[ page.title ] = !page.missing; + } ); + $.each( titles, function ( index, title ) { + var normalizedTitle = title; + while ( normalized[ normalizedTitle ] ) { + normalizedTitle = normalized[ normalizedTitle ]; } + cache.existenceCache[ title ] = pages[ normalizedTitle ]; queue[ title ].resolve( cache.existenceCache[ title ] ); } ); } ); -- To view, visit https://gerrit.wikimedia.org/r/306547 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If20941fb381a01aab01b971e1093a53b76c96f66 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz DziewońskiGerrit-Reviewer: Anomie Gerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: Jack Phoenix 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/core[master]: API: Warn when input parameters are normalized
jenkins-bot has submitted this change and it was merged. Change subject: API: Warn when input parameters are normalized .. API: Warn when input parameters are normalized If a client submits data that is not NFC-normalized Unicode or that contains C0 controls other than HT, LF, and CR, it gets normalized before the API ever sees it. Which can lead to difficult-to-handle bugs when, for example, a title is subject to normalization so the client can't find the specific title it submitted anywhere in the response (T139130). This patch does two things: * Detects when normalization was applied to an input value (at the MediaWiki level, anyway; if PHP or earlier does it we're just out of luck) and add a warning to that effect. * For ApiPageSet's 'titles' parameter, split into the individual titles and add them to the 'normalized' list in the response. This requires encoding the pre-normalized strings to avoid ApiResult's own normalization. Bug: T29849 Bug: T144071 Change-Id: I215fd3edd7a5e1b45292e60768bf6dd5ad7f34de --- M RELEASE-NOTES-1.28 M includes/api/ApiBase.php M includes/api/ApiPageSet.php M includes/api/i18n/en.json M tests/phpunit/includes/api/ApiBaseTest.php M tests/phpunit/includes/api/ApiPageSetTest.php M tests/phpunit/includes/api/query/ApiQueryTest.php 7 files changed, 82 insertions(+), 4 deletions(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28 index 58d9a07..416b2d5 100644 --- a/RELEASE-NOTES-1.28 +++ b/RELEASE-NOTES-1.28 @@ -90,6 +90,12 @@ * (T141960) Multi-valued parameters may now be separated using U+001F (Unit Separator) instead of the pipe character. This will be useful if some of the multiple values need to contain pipes, e.g. for action=options. +* The API will now warn if input is not NFC-normalized Unicode or if it + contains invalid characters. +* The 'normalized' list output by action=query and other modules that use + ApiPageSet may contain entries where the 'from' value is percent-encoded as + the raw value cannot be represented in a valid API response. These are + indicated by a 'fromencoded' boolean alongside the existing 'from' parameter. === Action API internal changes in 1.28 === * Added a new hook, 'ApiMakeParserOptions', to allow extensions to better diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index ca89091..55d2430 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1020,6 +1020,11 @@ ); } } + + // Check for NFC normalization, and warn + if ( $rawValue !== $value ) { + $this->handleParamNormalization( $paramName, $value, $rawValue ); + } } if ( isset( $value ) && ( $multi || is_array( $type ) ) ) { @@ -1166,6 +1171,22 @@ } /** +* Handle when a parameter was Unicode-normalized +* @since 1.28 +* @param string $paramName Unprefixed parameter name +* @param string $value Input that will be used. +* @param string $rawValue Input before normalization. +*/ + protected function handleParamNormalization( $paramName, $value, $rawValue ) { + $encParamName = $this->encodeParamName( $paramName ); + $this->setWarning( + "The value passed for '$encParamName' contains invalid or non-normalized data. " + . 'Textual data should be valid, NFC-normalized Unicode without ' + . 'C0 control characters other than HT (\\t), LF (\\n), and CR (\\r).' + ); + } + + /** * Split a multi-valued parameter string, like explode() * @since 1.28 * @param string $value diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index 90438d4..ed229cb 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -495,10 +495,14 @@ * @since 1.21 */ public function getNormalizedTitlesAsResult( $result = null ) { + global $wgContLang; + $values = []; foreach ( $this->getNormalizedTitles() as $rawTitleStr => $titleStr ) { + $encode = ( $wgContLang->normalize( $rawTitleStr ) !== $rawTitleStr ); $values[] = [ - 'from' => $rawTitleStr, + 'fromencoded' => $encode, + 'from' => $encode ? rawurlencode( $rawTitleStr ) : $rawTitleStr, 'to' => $titleStr ]; } @@ -1403,6 +1407,23 @@ return $result; } + protected function
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: API: Use U+001F (Unit Separator) for separating multi-valued...
jenkins-bot has submitted this change and it was merged. Change subject: API: Use U+001F (Unit Separator) for separating multi-valued parameters .. API: Use U+001F (Unit Separator) for separating multi-valued parameters When a multi-valued parameter's value begins with U+001F, the values will be split on that character instead of pipes. This will be useful for things such as action=options= or meta=allmessages=. Since MediaWiki doesn't otherwise accept C0 control characters (WebRequest::getVal() replaces them with �), there's no possibility that this will conflict with a literal use of U+001F. Special:ApiSandbox and mw.Api are updated to make use of this, with the latter having an option to disable the behavior in case something is depending on [ 'foo', 'bar|baz' ] turning into 'foo|bar|baz'. Pipe is still used as the separator when the value doesn't begin with U+001F, and will be forever since it's generally more human-friendly and is needed for backwards compatibility with basically every API client in existence. The requirement that the value begin with U+001F, rather than simply contain U+001F, is to avoid clients having to somehow special-case "param=foo|bar" where that's intended to be a single value "foo|bar" rather than two values "foo" and "bar". Bug: T141960 Change-Id: I45f69997667b48887a2b67e93906364a652ace5a --- M RELEASE-NOTES-1.28 M includes/WebRequest.php M includes/api/ApiBase.php M includes/api/i18n/en.json M resources/src/mediawiki.special/mediawiki.special.apisandbox.js M resources/src/mediawiki/api.js M resources/src/mediawiki/api/options.js M tests/phpunit/includes/api/ApiBaseTest.php M tests/phpunit/includes/api/MockApi.php M tests/qunit/suites/resources/mediawiki.api/mediawiki.api.options.test.js 10 files changed, 257 insertions(+), 15 deletions(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28 index d31943d..58d9a07 100644 --- a/RELEASE-NOTES-1.28 +++ b/RELEASE-NOTES-1.28 @@ -47,6 +47,9 @@ collation, you will need to run the updateCollation.php maintenance script. * Two new codes have been added to #time parser function: "xit" for days in current month, and "xiz" for days passed in the year, both in Iranian calendar. +* mw.Api has a new option, useUS, to use U+001F (Unit Separator) when + appropriate for sending multi-valued parameters. This defaults to true when + the mw.Api instance seems to be for the local wiki. === External library changes in 1.28 === @@ -84,6 +87,9 @@ action=createaccount, action=linkaccount, and action=changeauthenticationdata in the query string is now deprecated and outputs a warning. They should be submitted in the POST body instead. +* (T141960) Multi-valued parameters may now be separated using U+001F (Unit Separator) + instead of the pipe character. This will be useful if some of the multiple + values need to contain pipes, e.g. for action=options. === Action API internal changes in 1.28 === * Added a new hook, 'ApiMakeParserOptions', to allow extensions to better diff --git a/includes/WebRequest.php b/includes/WebRequest.php index b5c57ee..1e27f98 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -395,6 +395,32 @@ } /** +* Fetch a scalar from the input without normalization, or return $default +* if it's not set. +* +* Unlike self::getVal(), this does not perform any normalization on the +* input value. +* +* @since 1.28 +* @param string $name +* @param string|null $default Optional default +* @return string +*/ + public function getRawVal( $name, $default = null ) { + $name = strtr( $name, '.', '_' ); // See comment in self::getGPCVal() + if ( isset( $this->data[$name] ) && !is_array( $this->data[$name] ) ) { + $val = $this->data[$name]; + } else { + $val = $default; + } + if ( is_null( $val ) ) { + return $val; + } else { + return (string)$val; + } + } + + /** * Fetch a scalar from the input or return $default if it's not set. * Returns a string. Arrays are discarded. Useful for * non-freeform text inputs (e.g. predefined internal text keys diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 66c1b53..ca89091 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1000,6 +1000,26 @@ $type = $this->getModuleManager()->getNames( $paramName ); } } + + $request = $this->getMain()->getRequest(); + $rawValue = $request->getRawVal(
[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Add a server-side MessagePoster for Flow
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/307464 Change subject: Add a server-side MessagePoster for Flow .. Add a server-side MessagePoster for Flow This allows clients to post to a discussion page without knowing the underlying discussion system. Bug: T123522 Change-Id: I654c50482d70051323b312a5cb213f9db72e999e Depends-On: I9fa6ab7389ed3cee3dbac7ee7046627588d5860a --- M Flow.php M autoload.php A includes/FlowMessagePoster.php A tests/phpunit/FlowMessagePosterTest.php 4 files changed, 218 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/64/307464/1 diff --git a/Flow.php b/Flow.php index 8d85c12..39d3ec9 100644 --- a/Flow.php +++ b/Flow.php @@ -418,3 +418,6 @@ // Enable/Disable Opt-in beta feature $wgFlowEnableOptInBetaFeature = false; + +// Register our IMessagePoster +$wgContentModelMessagePosters[CONTENT_MODEL_FLOW_BOARD] = Flow\FlowMessagePoster::class; diff --git a/autoload.php b/autoload.php index c8cb997..8977854 100644 --- a/autoload.php +++ b/autoload.php @@ -3,9 +3,10 @@ // @codingStandardsIgnoreFile global $wgAutoloadClasses; -$wgAutoloadClasses += array( +$wgAutoloadClasses += [ 'ExternalStoreFlowMock' => __DIR__ . '/tests/phpunit/Mock/ExternalStoreFlowMock.php', 'FlowHooks' => __DIR__ . '/Hooks.php', + 'FlowMessagePosterTest' => __DIR__ . '/tests/phpunit/FlowMessagePosterTest.php', 'Flow\\Actions\\EditAction' => __DIR__ . '/includes/Actions/EditAction.php', 'Flow\\Actions\\FlowAction' => __DIR__ . '/includes/Actions/Action.php', 'Flow\\Actions\\PurgeAction' => __DIR__ . '/includes/Actions/PurgeAction.php', @@ -135,6 +136,7 @@ 'Flow\\Exception\\WrongNumberArgumentsException' => __DIR__ . '/includes/Exception/ExceptionHandling.php', 'Flow\\FlowActions' => __DIR__ . '/includes/FlowActions.php', 'Flow\\FlowEnabledOnTalkpagePresentationModel' => __DIR__ . '/includes/Notifications/FlowEnabledOnTalkpagePresentationModel.php', + 'Flow\\FlowMessagePoster' => __DIR__ . '/includes/FlowMessagePoster.php', 'Flow\\FlowPresentationModel' => __DIR__ . '/includes/Notifications/FlowPresentationModel.php', 'Flow\\Formatter\\AbstractFormatter' => __DIR__ . '/includes/Formatter/AbstractFormatter.php', 'Flow\\Formatter\\AbstractQuery' => __DIR__ . '/includes/Formatter/AbstractQuery.php', @@ -403,4 +405,4 @@ 'MaintenanceDebugLogger' => __DIR__ . '/maintenance/MaintenanceDebugLogger.php', 'Pimple\\Container' => __DIR__ . '/vendor/Pimple/Container.php', 'Pimple\\ServiceProviderInterface' => __DIR__ . '/vendor/Pimple/ServiceProviderInterface.php', -); +]; diff --git a/includes/FlowMessagePoster.php b/includes/FlowMessagePoster.php new file mode 100644 index 000..c562f9a --- /dev/null +++ b/includes/FlowMessagePoster.php @@ -0,0 +1,69 @@ +boardTitle = $boardTitle; + + $this->workflowLoaderFactory = Container::get( 'factory.loader.workflow' ); + } + + public function post( User $user, $topicTitle, $body, $bot = false ) { + $status = Status::newGood(); + + $derivativeContext = new DerivativeContext( RequestContext::getMain() ); + $derivativeContext->setUser( $user ); + + $loader = $this->workflowLoaderFactory->createWorkflowLoader( $this->boardTitle ); + $blocks = $loader->getBlocks(); + + $action = 'new-topic'; + $params = [ + 'topiclist' => [ + 'topic' => $topicTitle, + 'content' => $body, + 'format' => 'wikitext', + ], + ]; + + $blocksToCommit = $loader->handleSubmit( + $derivativeContext, + $action, + $params + ); + + foreach( $blocks as $block ) { + if ( $block->hasErrors() ) { + $errors = $block->getErrors(); + + foreach( $errors as $errorKey ) { + $status->fatal( $block->getErrorMessage( $errorKey ) ); + } + } + } + + $loader->commit( $blocksToCommit ); + + if ( !$status->isGood() ) { + throw new MWException( $status->getMessage()->text() ); + } + } +} diff --git a/tests/phpunit/FlowMessagePosterTest.php b/tests/phpunit/FlowMessagePosterTest.php new file mode 100644 index 000..92883d5 --- /dev/null +++ b/tests/phpunit/FlowMessagePosterTest.php @@ -0,0 +1,142 @@ +tablesUsed = array_merge( + $this->tablesUsed, + [
[MediaWiki-commits] [Gerrit] operations/puppet[production]: cassandra: add ssl monitoring only for ssl-enabled hosts
Dzahn has submitted this change and it was merged. Change subject: cassandra: add ssl monitoring only for ssl-enabled hosts .. cassandra: add ssl monitoring only for ssl-enabled hosts Bug: T120662 Change-Id: Ib9fcf8ce260b08d44585c570138232eb71c88fb2 --- M modules/cassandra/manifests/instance/monitoring.pp 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Elukey: Looks good to me, but someone else must approve Eevans: Looks good to me, but someone else must approve jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/cassandra/manifests/instance/monitoring.pp b/modules/cassandra/manifests/instance/monitoring.pp index ae97eac..14806a1 100644 --- a/modules/cassandra/manifests/instance/monitoring.pp +++ b/modules/cassandra/manifests/instance/monitoring.pp @@ -36,8 +36,7 @@ } # SSL cert expiration monitoring (T120662) -# but only on restbase* hosts -if $::hostname =~ /^restbase/ { +if hiera('cassandra::tls_cluster_name', '') { monitoring::service { "${service_name}-ssl": description => "${service_name} SSL ${listen_address}:7001", check_command => "check_ssl_http_on_host_port!${::hostname}-${instance_name}!${listen_address}!7001", -- To view, visit https://gerrit.wikimedia.org/r/307251 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9fcf8ce260b08d44585c570138232eb71c88fb2 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Filippo GiunchediGerrit-Reviewer: Alexandros Kosiaris Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Eevans Gerrit-Reviewer: Elukey Gerrit-Reviewer: Filippo Giunchedi Gerrit-Reviewer: Gehel 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]: Include PRESEND updates in ChronologyProtector positions
jenkins-bot has submitted this change and it was merged. Change subject: Include PRESEND updates in ChronologyProtector positions .. Include PRESEND updates in ChronologyProtector positions This updates are PRESEND for reason, so users should see them on the next page view. Otherwise, they would be POSTSEND. Change-Id: I533de550f6dd3e4b75507c2d25b1a05f7ac1301d --- M includes/MediaWiki.php 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Krinkle: Looks good to me, but someone else must approve Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 2a00900..4c48f36 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -571,13 +571,14 @@ // Abort if any transaction was too big [ 'maxWriteDuration' => $config->get( 'MaxUserDBWriteDuration' ) ] ); - // Record ChronologyProtector positions - $factory->shutdown(); - wfDebug( __METHOD__ . ': all transactions committed' ); DeferredUpdates::doUpdates( 'enqueue', DeferredUpdates::PRESEND ); wfDebug( __METHOD__ . ': pre-send deferred updates completed' ); + // Record ChronologyProtector positions + $factory->shutdown(); + wfDebug( __METHOD__ . ': all transactions committed' ); + // Set a cookie to tell all CDN edge nodes to "stick" the user to the DC that handles this // POST request (e.g. the "master" data center). Also have the user briefly bypass CDN so // ChronologyProtector works for cacheable URLs. -- To view, visit https://gerrit.wikimedia.org/r/307228 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I533de550f6dd3e4b75507c2d25b1a05f7ac1301d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Anomie Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: Gilles Gerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: installserver: put aptrepo role also on install2001
Dzahn has submitted this change and it was merged. Change subject: installserver: put aptrepo role also on install2001 .. installserver: put aptrepo role also on install2001 Let install2001 also use the role that sets up the APT repo, so it's like install1001, which is going to replace carbon. As T132757 says we'll want them to match and possibly make APT HA later. Change-Id: Ia86aa856c8fb004067991395d5527ba9f66bf10e --- M manifests/site.pp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/manifests/site.pp b/manifests/site.pp index bcc0041..58be244 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1294,7 +1294,7 @@ } node 'install2001.wikimedia.org' { -role installserver::tftp_server, installserver::dhcp +role installserver::tftp_server, installserver::dhcp, aptrepo::wikimedia $cluster = 'misc' $ganglia_aggregator = true -- To view, visit https://gerrit.wikimedia.org/r/306713 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia86aa856c8fb004067991395d5527ba9f66bf10e Gerrit-PatchSet: 4 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: DzahnGerrit-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...tools-webservice[master]: webservice: Warn when using lighttpd-precise
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/307463 Change subject: webservice: Warn when using lighttpd-precise .. webservice: Warn when using lighttpd-precise Bug: T143282 Change-Id: Id0b86b326ba1669b162c4887ee5c6a00b72539d1 --- M scripts/webservice 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/software/tools-webservice refs/changes/63/307463/1 diff --git a/scripts/webservice b/scripts/webservice index 2d0462d..096d241 100755 --- a/scripts/webservice +++ b/scripts/webservice @@ -97,6 +97,13 @@ args.release = 'trusty' if args.type is None: args.type = tool.manifest.get('web', 'lighttpd') +if args.type == 'lighttpd-precise': +print('*' * 78, file=sys.stderr) +print( +'NOTICE: Precise hosts are being deprecated from Tool Labs\n\t' + 'https://wikitech.wikimedia.org/wiki/Tools_Precise_deprecation', +file=sys.stderr) +print('*' * 78, file=sys.stderr) acceptable_types = GridEngineBackend.CONFIG.keys() elif backend == 'kubernetes': if args.release is not None: -- To view, visit https://gerrit.wikimedia.org/r/307463 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id0b86b326ba1669b162c4887ee5c6a00b72539d1 Gerrit-PatchSet: 1 Gerrit-Project: operations/software/tools-webservice 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...CentralAuth[master]: Convert CentralAuthUser to using getWithSetCallback()
jenkins-bot has submitted this change and it was merged. Change subject: Convert CentralAuthUser to using getWithSetCallback() .. Convert CentralAuthUser to using getWithSetCallback() This simplifies some code and allows for the use of WAN cache versioning. Change-Id: I333af82b3f78048fd93da477d7a31f48eddeacda --- M includes/CentralAuthUser.php M tests/phpunit/CentralAuthUserUsingDatabaseTest.php 2 files changed, 76 insertions(+), 83 deletions(-) Approvals: Krinkle: Looks good to me, but someone else must approve Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/CentralAuthUser.php b/includes/CentralAuthUser.php index b959073..51de808 100644 --- a/includes/CentralAuthUser.php +++ b/includes/CentralAuthUser.php @@ -22,7 +22,6 @@ */ /*private*/ var $mName; /*private*/ var $mStateDirty = false; - /*private*/ var $mVersion = 6; /*private*/ var $mDelayInvalidation = 0; var $mAttachedArray, $mEmail, $mEmailAuthenticated, $mHomeWiki, $mHidden, $mLocked, $mAttachedList, $mAuthenticationTimestamp; @@ -51,9 +50,10 @@ # avoid unserialize() overhead 'mAttachedList', - 'mCasToken', - 'mVersion', + 'mCasToken' ); + + const VERSION = 7; const HIDDEN_NONE = ''; const HIDDEN_LISTS = 'lists'; @@ -333,11 +333,11 @@ * Does not clear $this->mName, so the state information can be reloaded with loadState() */ protected function resetState() { - unset( $this->mGlobalId ); - unset( $this->mGroups ); - unset( $this->mAttachedArray ); - unset( $this->mAttachedList ); - unset( $this->mHomeWiki ); + $this->mGlobalId = null; + $this->mGroups = null; + $this->mAttachedArray = null; + $this->mAttachedList = null; + $this->mHomeWiki = null; } /** @@ -360,31 +360,11 @@ } // Check the cache (unless the master was requested via READ_LATEST) - if ( !$recache && $this->mFromMaster !== true && $this->loadFromCache() ) { - return; + if ( !$recache && $this->mFromMaster !== true ) { + $this->loadFromCache(); + } else { + $this->loadFromDatabase(); } - - wfDebugLog( 'CentralAuthVerbose', "Loading state for global user {$this->mName} from DB" ); - - $fromMaster = $this->shouldUseMasterDB(); - $db = $this->getSafeReadDB(); // matches $fromMaster above - - $queryInfo = self::selectQueryInfo(); - - $row = $db->selectRow( - $queryInfo['tables'], - $queryInfo['fields'], - array( 'gu_name' => $this->mName ) + $queryInfo['where'], - __METHOD__, - $queryInfo['options'], - $queryInfo['joinConds'] - ); - - $renameUserStatus = new GlobalRenameUserStatus( $this->mName ); - $renameUser = $renameUserStatus->getNames( null, $fromMaster ? 'master' : 'slave' ); - - $this->loadFromRow( $row, $renameUser, $fromMaster ); - $this->saveToCache(); } /** @@ -436,6 +416,29 @@ $this->mGroups = array_keys( $groups ); } + protected function loadFromDatabase() { + wfDebugLog( 'CentralAuthVerbose', "Loading state for global user {$this->mName} from DB" ); + + $fromMaster = $this->shouldUseMasterDB(); + $db = $this->getSafeReadDB(); // matches $fromMaster above + + $queryInfo = self::selectQueryInfo(); + + $row = $db->selectRow( + $queryInfo['tables'], + $queryInfo['fields'], + array( 'gu_name' => $this->mName ) + $queryInfo['where'], + __METHOD__, + $queryInfo['options'], + $queryInfo['joinConds'] + ); + + $renameUserStatus = new GlobalRenameUserStatus( $this->mName ); + $renameUser = $renameUserStatus->getNames( null, $fromMaster ? 'master' : 'slave' ); + + $this->loadFromRow( $row, $renameUser, $fromMaster ); + } + /** * Load user state from a joined globaluser/localuser row * @@ -480,22 +483,32 @@ /** * Load data from memcached * -* @param $cache array * @return bool */ - protected function loadFromCache( $cache = null ) { - if ( $cache == null ) { - $cache =
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Set logoImagePHID and wordmarkText in fixed_settings.yaml
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/307462 Change subject: Set logoImagePHID and wordmarkText in fixed_settings.yaml .. Set logoImagePHID and wordmarkText in fixed_settings.yaml This is for the new phabricator update and is required for the update otherwise we loose the wikimedia logo. https://phabricator.wikimedia.org/F4414835 Change-Id: Id0e3059704420d978ac94b1a7c41f73d73b71392 --- M modules/phabricator/data/fixed_settings.yaml A modules/phabricator/files/logo/wmf-logo.png 2 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/62/307462/1 diff --git a/modules/phabricator/data/fixed_settings.yaml b/modules/phabricator/data/fixed_settings.yaml index 487aa86..2a1e2de 100644 --- a/modules/phabricator/data/fixed_settings.yaml +++ b/modules/phabricator/data/fixed_settings.yaml @@ -5,6 +5,9 @@ # in Phabricator but only for administrators. If you do not have the ability to restart the # associated daemons do not merge changes to this file. +logoImagePHID: 'PHID-FILE-rs3pf2brupiulr6zcnrg' +wordmarkText: 'Wikimedia' + ui.footer-items: - {name: 'Content licensed under Creative Commons Attribution-ShareAlike 3.0 (CC-BY-SA) unless otherwise noted; code licensed under GNU General Public License (GPL) or other open source licenses. By using this site, you agree to the Terms of Use and Privacy Policy.'} - {href: 'https://www.wikimediafoundation.org/', name: Wikimedia Foundation} diff --git a/modules/phabricator/files/logo/wmf-logo.png b/modules/phabricator/files/logo/wmf-logo.png new file mode 100644 index 000..74c0f9e --- /dev/null +++ b/modules/phabricator/files/logo/wmf-logo.png Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/307462 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id0e3059704420d978ac94b1a7c41f73d73b71392 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] labs/toollabs[master]: jsub: Add warnings for precise deprecation
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/307461 Change subject: jsub: Add warnings for precise deprecation .. jsub: Add warnings for precise deprecation * Warn users who are not specifying a release of the upcoming change of default from precise to trusty. * Warn users who are specifying release=precise of upcoming removal of precise hosts from the job grid. Bug: T143282 Change-Id: I4503bd7df9eb00c5c0034586ff5e118e906eb56f --- M jobutils/bin/jsub 1 file changed, 45 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs refs/changes/61/307461/1 diff --git a/jobutils/bin/jsub b/jobutils/bin/jsub index 888434d..349ce8c 100755 --- a/jobutils/bin/jsub +++ b/jobutils/bin/jsub @@ -18,6 +18,8 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +from __future__ import print_function + import argparse import copy import os @@ -28,6 +30,10 @@ import sys import textwrap import time + + +AVAILABLE_RELEASES = ['precise', 'trusty'] +DEFAULT_RELEASE = 'precise' class NonAbbreviatingArgumentParser(argparse.ArgumentParser): @@ -182,12 +188,11 @@ def argparse_resource(value): """Validate qsub's '-l resource=value,...' arguments.""" -releases = ['precise', 'trusty'] for label, val in split_l(value): -if label == 'release' and val not in releases: +if label == 'release' and val not in AVAILABLE_RELEASES: raise argparse.ArgumentTypeError( 'invalid release=%s. Expected release=[%s].' % ( -val, '|'.join(releases))) +val, '|'.join(AVAILABLE_RELEASES))) return value @@ -211,13 +216,19 @@ def _process_l(self, namespace, values): """Process qsub's insane '-l resource=value,...' options. -We intercept h_vmem=value and virtual_free=value arguments and instead -adjust the mem argument value. Other resource=value pairs are stored -unaltered except they are expanded so each 'resource=value' pair is -attached to its own '-l' flag. +Some settings are intercepted and processed specially: +* h_vmem=value : adjust '-mem' +* virtual_free=value : adjust '-mem' +* release=value : adjust '-release' + +Other resource=value pairs are stored unaltered except they are +expanded so each 'resource=value' pair is attached to its own '-l' +flag. """ for resource, value in split_l(values): -if resource == 'h_vmem': +if resource == 'release': +setattr(namespace, 'release', value) +elif resource == 'h_vmem': vmem = argparse_memkb(value) if vmem > namespace.mem: setattr(namespace, 'mem', vmem) @@ -421,6 +432,9 @@ '-umask', type=argparse_octal, default=0007 if os.geteuid() > 5 else 0077, help="Set umask for output files if they don't exist") +parser.add_argument( +'-release', choices=AVAILABLE_RELEASES, action='store', metavar='OS', +help='Choose operating system version required by this job') return parser @@ -594,6 +608,24 @@ if args.once and is_running(args.jobname): die("there is a job named '%s' already active" % args.jobname) +if not args.release: +args.release = DEFAULT_RELEASE +print('*' * 78, file=sys.stderr) +print( +'WARNING: No `-l release=...` argument provided.' +'\n\tDefault release will change from precise to trusty in ' +'October 2016.' + '\n\thttps://wikitech.wikimedia.org/wiki/Tools_Precise_deprecation', +file=sys.stderr) +print('*' * 78, file=sys.stderr) +elif args.release == 'precise': +print('*' * 78, file=sys.stderr) +print( +'NOTICE: Precise hosts are being deprecated from Tool Labs' + '\n\thttps://wikitech.wikimedia.org/wiki/Tools_Precise_deprecation', +file=sys.stderr) +print('*' * 78, file=sys.stderr) + # Build argument list for calling qsub qsub_args = args.qsub_args or [] qsub_args.extend([ @@ -602,7 +634,9 @@ '-o', args.log_out, '-M', args.mailto, '-N', args.jobname, -'-hard', '-l', 'h_vmem=%dk' % args.mem, +'-hard', +'-l', 'h_vmem=%dk' % args.mem, +'-l', 'release=%s' % args.release, '-q', args.queue, '-b', as_qsub_bool(args.binary), ]) @@ -627,8 +661,8 @@ else: qsub_args.extend(job) -qsub = make_cmd(os.environ.get('JOBUTILS_QSUB', '/usr/bin/qsub'), -qsub_args) +qsub = make_cmd( +os.environ.get('JOBUTILS_QSUB', '/usr/bin/qsub'), qsub_args) try: proc
[MediaWiki-commits] [Gerrit] analytics/discovery-stats[production]: Merge branch 'master' into production
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/307460 Change subject: Merge branch 'master' into production .. Merge branch 'master' into production Change-Id: I5660938114cbcc742139ddd8851278b5a5b9fc51 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/discovery-stats refs/changes/60/307460/1 -- To view, visit https://gerrit.wikimedia.org/r/307460 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5660938114cbcc742139ddd8851278b5a5b9fc51 Gerrit-PatchSet: 1 Gerrit-Project: analytics/discovery-stats Gerrit-Branch: production Gerrit-Owner: MaxSem___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Create unit tests for ResourceLoaderContext
jenkins-bot has submitted this change and it was merged. Change subject: resourceloader: Create unit tests for ResourceLoaderContext .. resourceloader: Create unit tests for ResourceLoaderContext * Fix up one last use of global config vars in this class. Other places in this class already used $rl->getConfig(). This way we don't inherit all of MediaWikiTestCase. * Add unit tests covering all of ResourceLoaderContext except expandModuleNames and getImageObj (tested in better places already with the right @covers). * Increase coverage for expandModuleNames(), add missing case of when modules are not in alphabetical order. Change-Id: Id19b084d37a6c3a77b36e03509adffb6b156fee1 --- M includes/resourceloader/ResourceLoaderContext.php A tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php M tests/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php M tests/phpunit/includes/resourceloader/ResourceLoaderTest.php 4 files changed, 163 insertions(+), 4 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/resourceloader/ResourceLoaderContext.php b/includes/resourceloader/ResourceLoaderContext.php index 79b71df..30fe3ae 100644 --- a/includes/resourceloader/ResourceLoaderContext.php +++ b/includes/resourceloader/ResourceLoaderContext.php @@ -175,8 +175,7 @@ // Stricter version of RequestContext::sanitizeLangCode() if ( !Language::isValidBuiltInCode( $lang ) ) { wfDebug( "Invalid user language code\n" ); - global $wgLanguageCode; - $lang = $wgLanguageCode; + $lang = $this->getResourceLoader()->getConfig()->get( 'LanguageCode' ); } $this->language = $lang; } diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php new file mode 100644 index 000..1093039 --- /dev/null +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php @@ -0,0 +1,107 @@ + false, + 'DefaultSkin' => 'fallback', + 'LanguageCode' => 'nl', + ] ) ); + } + + public function testEmpty() { + $ctx = new ResourceLoaderContext( $this->getResourceLoader(), new FauxRequest( [] ) ); + + // Request parameters + $this->assertEquals( [], $ctx->getModules() ); + $this->assertEquals( 'nl', $ctx->getLanguage() ); + $this->assertEquals( false, $ctx->getDebug() ); + $this->assertEquals( null, $ctx->getOnly() ); + $this->assertEquals( 'fallback', $ctx->getSkin() ); + $this->assertEquals( null, $ctx->getUser() ); + + // Misc + $this->assertEquals( 'ltr', $ctx->getDirection() ); + $this->assertEquals( 'nl|fallback', $ctx->getHash() ); + $this->assertInstanceOf( User::class, $ctx->getUserObj() ); + } + + public function testDummy() { + $this->assertInstanceOf( + ResourceLoaderContext::class, + ResourceLoaderContext::newDummyContext() + ); + } + + public function testAccessors() { + $ctx = new ResourceLoaderContext( $this->getResourceLoader(), new FauxRequest( [] ) ); + $this->assertInstanceOf( WebRequest::class, $ctx->getRequest() ); + $this->assertInstanceOf( \Psr\Log\LoggerInterface::class, $ctx->getLogger() ); + } + + public function testTypicalRequest() { + $ctx = new ResourceLoaderContext( $this->getResourceLoader(), new FauxRequest( [ + 'debug' => 'false', + 'lang' => 'zh', + 'modules' => 'foo|foo.quux,baz,bar|baz.quux', + 'only' => 'styles', + 'skin' => 'fallback', + ] ) ); + + // Request parameters + $this->assertEquals( + $ctx->getModules(), + [ 'foo', 'foo.quux', 'foo.baz', 'foo.bar', 'baz.quux' ] + ); + $this->assertEquals( false, $ctx->getDebug() ); + $this->assertEquals( 'zh', $ctx->getLanguage() ); + $this->assertEquals( 'styles', $ctx->getOnly() ); + $this->assertEquals( 'fallback', $ctx->getSkin() ); + $this->assertEquals( null, $ctx->getUser() ); + + // Misc + $this->assertEquals( 'ltr', $ctx->getDirection() ); + $this->assertEquals( 'zh|fallback|||styles|', $ctx->getHash() ); + } + + public function
[MediaWiki-commits] [Gerrit] oojs/ui[master]: MediaWiki theme: Unify disabled & not-supported SelectFile d...
VolkerE has uploaded a new change for review. https://gerrit.wikimedia.org/r/307459 Change subject: MediaWiki theme: Unify disabled & not-supported SelectFile drop target .. MediaWiki theme: Unify disabled & not-supported SelectFile drop target Removing dashed border from disabled SelectFileWidget's drop target as it's indicating possible activity. Unifying border style with not supported widget. Also improving Less inheritance. Change-Id: Ie6519da0b5474b16b737fc0e793fdc90acc5aefb --- M src/themes/mediawiki/widgets.less 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/59/307459/1 diff --git a/src/themes/mediawiki/widgets.less b/src/themes/mediawiki/widgets.less index dd90c54..c66c4dc 100644 --- a/src/themes/mediawiki/widgets.less +++ b/src/themes/mediawiki/widgets.less @@ -295,7 +295,7 @@ } } - &-empty.oo-ui-selectFileWidget-dropTarget { + &-empty.oo-ui-widget-enabled.oo-ui-selectFileWidget-dropTarget { background-color: #eee; border-style: dashed; } -- To view, visit https://gerrit.wikimedia.org/r/307459 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6519da0b5474b16b737fc0e793fdc90acc5aefb Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: VolkerE___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CentralAuth[master]: Merge checkLocalNames.php into checkLocalUsers.php
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/307458 Change subject: Merge checkLocalNames.php into checkLocalUsers.php .. Merge checkLocalNames.php into checkLocalUsers.php This will make the recently added options (--user, --allwikis, --delete-nowiki) available and make maintenance less annoying. Also fix some code style issues since we are touching almost every line anyway. Change-Id: I061d0553bdd1307baa4c806954c7919ec8ddc085 --- D maintenance/checkLocalNames.php M maintenance/checkLocalUser.php 2 files changed, 73 insertions(+), 194 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth refs/changes/58/307458/1 diff --git a/maintenance/checkLocalNames.php b/maintenance/checkLocalNames.php deleted file mode 100644 index 8a16443..000 --- a/maintenance/checkLocalNames.php +++ /dev/null @@ -1,142 +0,0 @@ -mDescription = "Checks the contents of the localnames table and deletes invalid entries"; - $this->start = microtime( true ); - $this->deleted = 0; - $this->total = 0; - $this->dryrun = true; - $this->wiki = null; - $this->verbose = false; - $this->batchSize = 1000; - - $this->addOption( 'delete', 'Performs delete operations on the offending entries', false, false ); - $this->addOption( 'wiki', 'If specified, only runs against local names from this wiki', false, true, 'u' ); - $this->addOption( 'verbose', 'Prints more information', false, true, 'v' ); - } - - public function execute() { - - $centralMaster = CentralAuthUtils::getCentralDB(); - $centralSlave = CentralAuthUtils::getCentralSlaveDB(); - - if ( $this->getOption( 'delete', false ) !== false ) { - $this->dryrun = false; - } - - $wiki = $this->getOption( 'wiki', false ); - if ( $wiki !== false ) { - $this->wiki = $wiki; - } - - if ( $this->getOption( 'verbose', false ) !== false ) { - $this->verbose = true; - } - - // since the keys on localnames are not conducive to batch operations and - // because of the database shards, grab a list of the wikis and we will - // iterate from there - $wikis = array(); - if ( !is_null( $this->wiki ) ) { - $wikis[] = $this->wiki; - } else { - $result = $centralSlave->select( - 'localnames', - array( 'ln_wiki' ), - "", - __METHOD__, - array( -"DISTINCT", -"ORDER BY" => "ln_wiki ASC" - ) - ); - - foreach( $result as $row ) { - $wikis[] = $row->ln_wiki; - } - } - - // iterate through the wikis - foreach( $wikis as $wiki ) { - $localdb = wfGetDB( DB_SLAVE , array(), $wiki ); - $lastUsername = ""; - - $this->output( "Checking localnames for $wiki ...\n" ); - - // batch query localnames from the wiki - do{ - $this->output( "\t ... querying from '$lastUsername'\n" ); - $result = $centralSlave->select( - 'localnames', - array( 'ln_name' ), - array( -"ln_wiki" => $wiki, -"ln_name > " . $centralSlave->addQuotes( $lastUsername ) - ), - __METHOD__, - array( -"LIMIT" => $this->batchSize, -"ORDER BY" => "ln_name ASC" - ) - ); - - // iterate through each of the localnames to confirm that a local user - foreach( $result as $u ){ - $localUser = $localdb->select( - 'user', - array( 'user_name' ), - array( "user_name" => $u->ln_name ), -
[MediaWiki-commits] [Gerrit] analytics/discovery-stats[master]: Refactor the logging command
Yurik has submitted this change and it was merged. Change subject: Refactor the logging command .. Refactor the logging command Change-Id: I6b504c6ff6f382313b8a3e053245075629a1377f --- M tracking-category-count.php 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Yurik: Verified; Looks good to me, approved diff --git a/tracking-category-count.php b/tracking-category-count.php index f8594fd..66534a3 100644 --- a/tracking-category-count.php +++ b/tracking-category-count.php @@ -22,8 +22,11 @@ } $key = str_replace( '%WIKI%', $wiki, $config->categories[$metric] ); +$packet = "$metric $count `date +%s`"; +$nc = "nc -q0 {$config->graphiteHost} {$config->graphitePort}"; +$command = "echo \"$packet\" | $nc"; -exec( "echo \"$metric $count `date +%s`\" | nc -q0 {$config->graphiteHost} {$config->graphitePort}" ); +exec( $command ); } $matrix = new SiteMatrix; -- To view, visit https://gerrit.wikimedia.org/r/307448 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6b504c6ff6f382313b8a3e053245075629a1377f Gerrit-PatchSet: 1 Gerrit-Project: analytics/discovery-stats Gerrit-Branch: master Gerrit-Owner: MaxSemGerrit-Reviewer: Yurik ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] analytics/discovery-stats[master]: Fix metric name
Yurik has submitted this change and it was merged. Change subject: Fix metric name .. Fix metric name Change-Id: Ib767e6bc0673cd73af9413439e3ac8f56a870a9d --- M tracking-category-count.php 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Yurik: Verified; Looks good to me, approved diff --git a/tracking-category-count.php b/tracking-category-count.php index 66534a3..e43dd6e 100644 --- a/tracking-category-count.php +++ b/tracking-category-count.php @@ -15,17 +15,20 @@ $categoryKeys = array_keys( $config->categories ); function recordToGraphite( $wiki, $metric, $count ) { -global $config; +global $config, $debug; if ( !$config->graphiteHost || !$config->graphitePort ) { return; } $key = str_replace( '%WIKI%', $wiki, $config->categories[$metric] ); -$packet = "$metric $count `date +%s`"; +$packet = "$key $count `date +%s`"; $nc = "nc -q0 {$config->graphiteHost} {$config->graphitePort}"; $command = "echo \"$packet\" | $nc"; +if ( $debug ) { +echo "$command\n"; +} exec( $command ); } -- To view, visit https://gerrit.wikimedia.org/r/307457 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib767e6bc0673cd73af9413439e3ac8f56a870a9d Gerrit-PatchSet: 1 Gerrit-Project: analytics/discovery-stats Gerrit-Branch: master Gerrit-Owner: MaxSemGerrit-Reviewer: Yurik ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] analytics/discovery-stats[master]: Fix graphite port
Yurik has submitted this change and it was merged. Change subject: Fix graphite port .. Fix graphite port Change-Id: Iecbe06dba7ed0ed82d0c0ac8ebd4c0cb63b908a8 --- M config.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Yurik: Verified; Looks good to me, approved diff --git a/config.json b/config.json index 1f7abaf..8c3c83c 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "graphiteHost": "graphite.eqiad.wmnet", -"graphitePort": 8126, +"graphitePort": 2003, "categories": { "kartographer-tracking-category": "kartographer.pages.%WIKI%.hourly", "graph-tracking-category": "graph.pages.%WIKI%.hourly" -- To view, visit https://gerrit.wikimedia.org/r/307449 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iecbe06dba7ed0ed82d0c0ac8ebd4c0cb63b908a8 Gerrit-PatchSet: 1 Gerrit-Project: analytics/discovery-stats Gerrit-Branch: master Gerrit-Owner: MaxSemGerrit-Reviewer: Yurik ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] analytics/discovery-stats[master]: Remove unused uses
Yurik has submitted this change and it was merged. Change subject: Remove unused uses .. Remove unused uses Change-Id: I94a01b53f8e72c9ba26f80fefdcb6a2025aae2da --- M tracking-category-count.php 1 file changed, 0 insertions(+), 4 deletions(-) Approvals: Yurik: Verified; Looks good to me, approved diff --git a/tracking-category-count.php b/tracking-category-count.php index 3bf8a86..f8594fd 100644 --- a/tracking-category-count.php +++ b/tracking-category-count.php @@ -2,10 +2,6 @@ namespace DiscoveryStats; -use Liuggio\StatsdClient\StatsdClient; -use Liuggio\StatsdClient\Sender\SocketSender; -use Liuggio\StatsdClient\Service\StatsdService; - require_once( 'vendor/autoload.php' ); $wikiBlacklist = [ -- To view, visit https://gerrit.wikimedia.org/r/307447 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94a01b53f8e72c9ba26f80fefdcb6a2025aae2da Gerrit-PatchSet: 1 Gerrit-Project: analytics/discovery-stats Gerrit-Branch: master Gerrit-Owner: MaxSemGerrit-Reviewer: Yurik ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fixing dry-run logic in updateCollation.php
jenkins-bot has submitted this change and it was merged. Change subject: Fixing dry-run logic in updateCollation.php .. Fixing dry-run logic in updateCollation.php Currently if you run updateCollation.php in dry-run mode, it ignores the other parameters and doesn't give you a row estimate. Now it will behave the same as an actual run (just without making any changes to the database). Change-Id: I25a9751d8ab7554e7975e5f08122dd1ddaaf40a7 --- M maintenance/updateCollation.php 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index 922cc87..930f533 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -101,7 +101,7 @@ 'STRAIGHT_JOIN' // per T58041 ]; - if ( $force || $dryRun ) { + if ( $force ) { $collationConds = []; } else { if ( $this->hasOption( 'previous-collation' ) ) { @@ -132,7 +132,11 @@ return; } - $this->output( "Fixing collation for $count rows.\n" ); + if ( $dryRun ) { + $this->output( "$count rows would be updated.\n" ); + } else { + $this->output( "Fixing collation for $count rows.\n" ); + } wfWaitForSlaves(); } $count = 0; -- To view, visit https://gerrit.wikimedia.org/r/307452 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I25a9751d8ab7554e7975e5f08122dd1ddaaf40a7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: KaldariGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Brian Wolff Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Parent5446 Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move some DB error classes with the rest as type DBUnexpecte...
jenkins-bot has submitted this change and it was merged. Change subject: Move some DB error classes with the rest as type DBUnexpectedError .. Move some DB error classes with the rest as type DBUnexpectedError Change-Id: I97d61d32495e6d88ce274772369390c76d7ff3c4 --- M autoload.php M includes/db/DatabaseError.php M includes/db/loadbalancer/LBFactory.php 3 files changed, 20 insertions(+), 18 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 39102fd..dec7219 100644 --- a/autoload.php +++ b/autoload.php @@ -297,7 +297,7 @@ 'CsvStatsOutput' => __DIR__ . '/maintenance/language/StatOutputs.php', 'CurlHttpRequest' => __DIR__ . '/includes/HttpFunctions.php', 'DBAccessBase' => __DIR__ . '/includes/dao/DBAccessBase.php', - 'DBAccessError' => __DIR__ . '/includes/db/loadbalancer/LBFactory.php', + 'DBAccessError' => __DIR__ . '/includes/db/DatabaseError.php', 'DBAccessObjectUtils' => __DIR__ . '/includes/dao/DBAccessObjectUtils.php', 'DBConnRef' => __DIR__ . '/includes/db/DBConnRef.php', 'DBConnectionError' => __DIR__ . '/includes/db/DatabaseError.php', @@ -308,7 +308,7 @@ 'DBMasterPos' => __DIR__ . '/includes/db/DatabaseUtility.php', 'DBQueryError' => __DIR__ . '/includes/db/DatabaseError.php', 'DBReadOnlyError' => __DIR__ . '/includes/db/DatabaseError.php', - 'DBReplicationWaitError' => __DIR__ . '/includes/db/loadbalancer/LBFactory.php', + 'DBReplicationWaitError' => __DIR__ . '/includes/db/DatabaseError.php', 'DBSiteStore' => __DIR__ . '/includes/site/DBSiteStore.php', 'DBTransactionError' => __DIR__ . '/includes/db/DatabaseError.php', 'DBUnexpectedError' => __DIR__ . '/includes/db/DatabaseError.php', diff --git a/includes/db/DatabaseError.php b/includes/db/DatabaseError.php index 4cd02b1..cfae74f 100644 --- a/includes/db/DatabaseError.php +++ b/includes/db/DatabaseError.php @@ -470,3 +470,21 @@ */ class DBTransactionError extends DBExpectedError { } + +/** + * Exception class for attempted DB access + * @ingroup Database + */ +class DBAccessError extends DBUnexpectedError { + public function __construct() { + parent::__construct( "Mediawiki tried to access the database via wfGetDB(). " . + "This is not allowed, because database access has been disabled." ); + } +} + +/** + * Exception class for replica DB wait timeouts + * @ingroup Database + */ +class DBReplicationWaitError extends DBUnexpectedError { +} diff --git a/includes/db/loadbalancer/LBFactory.php b/includes/db/loadbalancer/LBFactory.php index 84f7fcb..dfa4c29 100644 --- a/includes/db/loadbalancer/LBFactory.php +++ b/includes/db/loadbalancer/LBFactory.php @@ -539,19 +539,3 @@ } } - -/** - * Exception class for attempted DB access - */ -class DBAccessError extends MWException { - public function __construct() { - parent::__construct( "Mediawiki tried to access the database via wfGetDB(). " . - "This is not allowed, because database access has been disabled." ); - } -} - -/** - * Exception class for replica DB wait timeouts - */ -class DBReplicationWaitError extends Exception { -} -- To view, visit https://gerrit.wikimedia.org/r/307444 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I97d61d32495e6d88ce274772369390c76d7ff3c4 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-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] wikimedia...crm[master]: Don't pollute $msg with pending_id
jenkins-bot has submitted this change and it was merged. Change subject: Don't pollute $msg with pending_id .. Don't pollute $msg with pending_id We use pending_id to delete the database row, but we don't need to merge it in to the donation message Bug: T122641 Change-Id: Iabc837bb156d44899b32ed87171136b7f9dcdb92 --- M sites/all/modules/queue2civicrm/queue2civicrm.module 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/queue2civicrm/queue2civicrm.module b/sites/all/modules/queue2civicrm/queue2civicrm.module index 7833ec3..276a705 100644 --- a/sites/all/modules/queue2civicrm/queue2civicrm.module +++ b/sites/all/modules/queue2civicrm/queue2civicrm.module @@ -329,6 +329,9 @@ // info than the pending db. if ( $data ) { $msg = $msg + $data; +// $data has a pending_id key for ease of deletion, +// but $msg doesn't need it +unset( $msg['pending_id'] ); } return $data; } -- To view, visit https://gerrit.wikimedia.org/r/307445 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iabc837bb156d44899b32ed87171136b7f9dcdb92 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger 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]: LinksUpdate: Add functions returning changed page properties
jenkins-bot has submitted this change and it was merged. Change subject: LinksUpdate: Add functions returning changed page properties .. LinksUpdate: Add functions returning changed page properties This adds getAddedProperties and getRemovedProperties functions to LinksUpdate. They are available only after the update, so for extensions in the LinksUpdateComplete hook. This is useful for example if an extension caches a page property; if the property gets changed it may want to purge the cache. This is similar to the getAddedLinks and getRemovedLinks functions. Change-Id: I0c73b3d181f32502da75687857ae9aeff731f559 --- M includes/deferred/LinksUpdate.php 1 file changed, 34 insertions(+), 3 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index 5e02c5c..ec7360e 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -80,6 +80,16 @@ private $linkDeletions = null; /** +* @var null|array Added properties if calculated. +*/ + private $propertyInsertions = null; + + /** +* @var null|array Deleted properties if calculated. +*/ + private $propertyDeletions = null; + + /** * @var User|null */ private $user; @@ -234,12 +244,13 @@ # Page properties $existing = $this->getExistingProperties(); - $propertiesDeletes = $this->getPropertyDeletions( $existing ); - $this->incrTableUpdate( 'page_props', 'pp', $propertiesDeletes, + $this->propertyDeletions = $this->getPropertyDeletions( $existing ); + $this->incrTableUpdate( 'page_props', 'pp', $this->propertyDeletions, $this->getPropertyInsertions( $existing ) ); # Invalidate the necessary pages - $changed = $propertiesDeletes + array_diff_assoc( $this->mProperties, $existing ); + $this->propertyInsertions = array_diff_assoc( $this->mProperties, $existing ); + $changed = $this->propertyDeletions + $this->propertyInsertions; $this->invalidateProperties( $changed ); # Refresh links of all pages including this page @@ -1017,6 +1028,26 @@ } /** +* Fetch page properties added by this LinksUpdate. +* Only available after the update is complete. +* @since 1.28 +* @return null|array +*/ + public function getAddedProperties() { + return $this->propertyInsertions; + } + + /** +* Fetch page properties removed by this LinksUpdate. +* Only available after the update is complete. +* @since 1.28 +* @return null|array +*/ + public function getRemovedProperties() { + return $this->propertyDeletions; + } + + /** * Update links table freshness */ protected function updateLinksTimestamp() { -- To view, visit https://gerrit.wikimedia.org/r/267406 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c73b3d181f32502da75687857ae9aeff731f559 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: CenariumGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Addshore Gerrit-Reviewer: Cenarium Gerrit-Reviewer: Daniel Kinzler Gerrit-Reviewer: Jdlrobson Gerrit-Reviewer: Luke081515 Gerrit-Reviewer: Manybubbles Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Clarify when tokenizing sync vs async
jenkins-bot has submitted this change and it was merged. Change subject: Clarify when tokenizing sync vs async .. Clarify when tokenizing sync vs async Change-Id: Ic5c67070130238c11d6277d8685a13bbe49006cc --- M lib/api/apiUtils.js M lib/html2wt/escapeWikitext.js M lib/wt2html/pegTokenizer.pegjs.txt M lib/wt2html/tokenizer.js M lib/wt2html/tt/AttributeExpander.js M lib/wt2html/tt/TokenStreamPatcher.js 6 files changed, 37 insertions(+), 63 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/api/apiUtils.js b/lib/api/apiUtils.js index e82a998..5996352 100644 --- a/lib/api/apiUtils.js +++ b/lib/api/apiUtils.js @@ -197,7 +197,7 @@ // '{{subst' using the template token's tsr. apiUtils.substTopLevelTemplates = function(env, target, wt) { var tokenizer = new PegTokenizer(env); - var tokens = tokenizer.tokenize(wt, null, null, true); + var tokens = tokenizer.tokenizeSync(wt, null, null, true); var tsrIncr = 0; for (var i = 0; i < tokens.length; i++) { if (tokens[i].name === 'template') { diff --git a/lib/html2wt/escapeWikitext.js b/lib/html2wt/escapeWikitext.js index e49aecd..56cd406 100644 --- a/lib/html2wt/escapeWikitext.js +++ b/lib/html2wt/escapeWikitext.js @@ -193,7 +193,7 @@ // Tokenize string and pop EOFTk WEHP.tokenizeStr = function(str, sol) { - var tokens = this.tokenizer.tokenize(str, null, null, true, sol); + var tokens = this.tokenizer.tokenizeSync(str, null, null, true, sol); console.assert(tokens.pop().constructor === pd.EOFTk, 'Expected EOF token!'); return tokens; }; @@ -993,7 +993,7 @@ var tkSrc = arg.substring(da.tsr[0], da.tsr[1]); // Replace pipe by an entity. This is not completely safe. if (t.name === 'extlink' || t.name === 'urllink') { - var tkBits = this.tokenizer.tokenize(tkSrc, + var tkBits = this.tokenizer.tokenizeSync(tkSrc, "tplarg_or_template_or_bust", null, true); /* jshint loopfunc: true */ tkBits.forEach(function(bit) { diff --git a/lib/wt2html/pegTokenizer.pegjs.txt b/lib/wt2html/pegTokenizer.pegjs.txt index e8128db..abb4ac7 100644 --- a/lib/wt2html/pegTokenizer.pegjs.txt +++ b/lib/wt2html/pegTokenizer.pegjs.txt @@ -1081,7 +1081,7 @@ } else if (isIncludeTag) { // Parse ext-content, strip eof, and shift tsr var extContent = dp.src.substring(dp.tagWidths[0], dp.src.length - dp.tagWidths[1]); -var extContentToks = (new PegTokenizer(env)).tokenize(extContent); +var extContentToks = (new PegTokenizer(env)).tokenizeSync(extContent); if (dp.tagWidths[1] > 0) { extContentToks = Util.stripEOFTkfromTokens(extContentToks); } @@ -1950,7 +1950,7 @@ } // Tokenize include content in a new tokenizer -var inclContentToks = (new PegTokenizer(env)).tokenize(inclContent); +var inclContentToks = (new PegTokenizer(env)).tokenizeSync(inclContent); inclContentToks = Util.stripEOFTkfromTokens(inclContentToks); // Shift tsr diff --git a/lib/wt2html/tokenizer.js b/lib/wt2html/tokenizer.js index c5abb37..885e050 100644 --- a/lib/wt2html/tokenizer.js +++ b/lib/wt2html/tokenizer.js @@ -63,7 +63,6 @@ PegTokenizer.prototype.src = ''; PegTokenizer.prototype.initTokenizer = function() { - // Construct a singleton static tokenizer. var pegSrcPath = path.join(__dirname, 'pegTokenizer.pegjs.txt'); this.src = fs.readFileSync(pegSrcPath, 'utf8'); @@ -223,7 +222,7 @@ * the earliest possible opportunity. */ PegTokenizer.prototype.process = function(text) { - this._processText(text, false); + this.tokenizeAsync(text); }; /** @@ -239,13 +238,6 @@ PegTokenizer.prototype.setSourceOffsets = function(start, end) { this.offsets.startOffset = start; this.offsets.endOffset = end; -}; - -/* - * Process text synchronously -- the text is tokenized in one shot - */ -PegTokenizer.prototype.processSync = function(text) { - this._processText(text, true); }; PegTokenizer.prototype._tokenize = function(text, args) { @@ -265,18 +257,13 @@ * Consumers are supposed to register with PegTokenizer before calling * process(). */ -PegTokenizer.prototype._processText = function(text, fullParse) { +PegTokenizer.prototype.tokenizeAsync = function(text) { if (!this.tokenizer) { this.initTokenizer(); } // ensure we're processing text text = String(text || ""); - - // Some input normalization: force a trailing newline - // if ( text.substring(text.length
[MediaWiki-commits] [Gerrit] analytics/discovery-stats[master]: Fix metric name
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/307457 Change subject: Fix metric name .. Fix metric name Change-Id: Ib767e6bc0673cd73af9413439e3ac8f56a870a9d --- M tracking-category-count.php 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/discovery-stats refs/changes/57/307457/1 diff --git a/tracking-category-count.php b/tracking-category-count.php index 66534a3..e43dd6e 100644 --- a/tracking-category-count.php +++ b/tracking-category-count.php @@ -15,17 +15,20 @@ $categoryKeys = array_keys( $config->categories ); function recordToGraphite( $wiki, $metric, $count ) { -global $config; +global $config, $debug; if ( !$config->graphiteHost || !$config->graphitePort ) { return; } $key = str_replace( '%WIKI%', $wiki, $config->categories[$metric] ); -$packet = "$metric $count `date +%s`"; +$packet = "$key $count `date +%s`"; $nc = "nc -q0 {$config->graphiteHost} {$config->graphitePort}"; $command = "echo \"$packet\" | $nc"; +if ( $debug ) { +echo "$command\n"; +} exec( $command ); } -- To view, visit https://gerrit.wikimedia.org/r/307457 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib767e6bc0673cd73af9413439e3ac8f56a870a9d Gerrit-PatchSet: 1 Gerrit-Project: analytics/discovery-stats 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...parsoid[master]: Use Util.processContentInPipeline in Frame.expand
jenkins-bot has submitted this change and it was merged. Change subject: Use Util.processContentInPipeline in Frame.expand .. Use Util.processContentInPipeline in Frame.expand Change-Id: Ied613bf5a130d09f68a0b0c153745160c2c89bc3 --- M lib/wt2html/TokenTransformManager.js 1 file changed, 23 insertions(+), 19 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/wt2html/TokenTransformManager.js b/lib/wt2html/TokenTransformManager.js index 86e8842..73239a9 100644 --- a/lib/wt2html/TokenTransformManager.js +++ b/lib/wt2html/TokenTransformManager.js @@ -1440,32 +1440,36 @@ // - not in a template use context Ex: {{ .. | {{ here }} | .. }} // - the attribute use is wrappable Ex: [[ ... | {{ .. link text }} ]] - var pipelineOpts = { - isInclude: this.depth > 0, - wrapTemplates: options.wrapTemplates, - inTemplate: options.inTemplate, + var opts = { + // XXX: use input type + pipelineType: this.manager.attributeType || 'tokens/x-mediawiki', + pipelineOpts: { + isInclude: this.depth > 0, + wrapTemplates: options.wrapTemplates, + inTemplate: options.inTemplate, + }, }; - var pipeline = this.manager.pipeFactory.getPipeline( - // XXX: use input type - this.manager.attributeType || 'tokens/x-mediawiki', - pipelineOpts - ); - pipeline.setFrame(this, null); // In the name of interface simplicity, we accumulate all emitted // chunks in a single accumulator. var eventState = { options: options, accum: [], cb: cb }; - pipeline.addListener('chunk', - this.onThunkEvent.bind(this, eventState, true)); - pipeline.addListener('end', - this.onThunkEvent.bind(this, eventState, false)); + opts.chunkCB = this.onThunkEvent.bind(this, eventState, true); + opts.endCB = this.onThunkEvent.bind(this, eventState, false); + + opts.tplArgs = { + name: null, + cacheKey: this.title, + }; + + var content; if (lastItem(chunk).constructor === EOFTk) { - pipeline.process(chunk, this.title); + content = chunk; } else { - var newChunk = JSUtils.pushArray(chunk, this._eofTkList); - newChunk.rank = chunk.rank; - pipeline.process(newChunk, this.title); + content = JSUtils.pushArray(chunk, this._eofTkList); + content.rank = chunk.rank; } + + Util.processContentInPipeline(this.manager.env, this, content, opts); } else { throw "Frame.expand: Unsupported output type " + outType; } @@ -1485,7 +1489,7 @@ this.manager.env.dp('Frame.onThunkEvent accum:', state.accum); } else { this.manager.env.dp('Frame.onThunkEvent:', state.accum); - state.cb (state.accum); + state.cb(state.accum); } }; -- To view, visit https://gerrit.wikimedia.org/r/307021 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied613bf5a130d09f68a0b0c153745160c2c89bc3 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: ArlolraGerrit-Reviewer: Cscott Gerrit-Reviewer: Subramanya Sastry Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Rename helper to Util.promiseToProcessContent
jenkins-bot has submitted this change and it was merged. Change subject: Rename helper to Util.promiseToProcessContent .. Rename helper to Util.promiseToProcessContent * This is also pulled out of https://gerrit.wikimedia.org/r/#/c/264026/ * The blacklist change is because async.map is parallel and the extra .then changes the ordering, I assume. Change-Id: Ibed37f4917310634895b4d6800b5c47343cf5257 --- M lib/utils/Util.js M tests/parserTests-blacklist.js 2 files changed, 26 insertions(+), 25 deletions(-) Approvals: Arlolra: Looks good to me, approved Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/utils/Util.js b/lib/utils/Util.js index 92f4257..eb355d3 100644 --- a/lib/utils/Util.js +++ b/lib/utils/Util.js @@ -1100,22 +1100,18 @@ }, /** -* Processes an array of tokens all the way to DOM. -* Currently used internally within this file. +* A promise returning wrapper around processContentInPipeline that +* resolves with the docuemnt. */ - _processTokensToDOM: function(env, frame, tokens, opts, cb) { + promiseToProcessContent: function(env, frame, content, opts, cb) { cb = JSUtils.mkPromised(cb); - this.processContentInPipeline( - env, - frame, - tokens.concat([new pd.EOFTk()]), { - pipelineType: "tokens/x-mediawiki/expanded", - pipelineOpts: opts.pipelineOpts, - srcOffsets: opts ? opts.srcOffsets : undefined, - // processContentInPipeline has no error callback :( - documentCB: function(dom) { cb(null, dom); }, - } - ); + Util.processContentInPipeline(env, frame, content, { + pipelineType: opts.pipelineType, + pipelineOpts: opts.pipelineOpts, + srcOffsets: opts ? opts.srcOffsets : undefined, + // processContentInPipeline has no error callback :( + documentCB: function(dom) { cb(null, dom); }, + }); return cb.promise; }, @@ -1147,11 +1143,11 @@ */ expandValuesToDOM: function(env, frame, vals, wrapTemplates, finalCB) { if (!DU) { DU = require('./DOMUtils.js').DOMUtils; } - var self = this; async.map(vals, function(v, cb) { if (Array.isArray(v.html)) { // Set up pipeline options var opts = { + pipelineType: 'tokens/x-mediawiki/expanded', pipelineOpts: { attrExpansion: true, noPWrapping: true, @@ -1159,15 +1155,20 @@ wrapTemplates: wrapTemplates, }, }; - self._processTokensToDOM(env, frame, v.html, opts, function(err, dom) { - if (!err) { - // Since we aren't at the top level, data attrs - // were not applied in cleanup. However, tmp - // was stripped. - v.html = DU.ppToXML(dom.body, { innerXML: true }); - } - cb(err, v); - }); + var content = v.html.concat([new pd.EOFTk()]); + Util.promiseToProcessContent(env, frame, content, opts) + .then(function(dom) { + // Since we aren't at the top level, data attrs + // were not applied in cleanup. However, tmp + // was stripped. + v.html = DU.ppToXML(dom.body, { innerXML: true }); + return v; + }) + .catch(function(err) { + env.log('error', 'Expanding values to DOM', err); + return v; + }) + .nodify(cb); } else { cb(null, v); } diff --git a/tests/parserTests-blacklist.js
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Add text/python to files.viewable-mime-types
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/307456 Change subject: Add text/python to files.viewable-mime-types .. Add text/python to files.viewable-mime-types Change-Id: Ifd4a6484be5b9aab8b1b30e7a2ed49b0609597e7 --- M modules/phabricator/data/fixed_settings.yaml 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/56/307456/2 diff --git a/modules/phabricator/data/fixed_settings.yaml b/modules/phabricator/data/fixed_settings.yaml index 487aa86..a85be89 100644 --- a/modules/phabricator/data/fixed_settings.yaml +++ b/modules/phabricator/data/fixed_settings.yaml @@ -30,7 +30,8 @@ 'application/ogg': 'application/ogg' 'audio/mpeg': 'audio/mpeg' 'text/x-php': 'text/plain; charset=utf-8' - + 'text/x-python': 'text/plain; charset=utf-8' + files.image-mime-types: 'image/jpeg': true 'image/jpg': true -- To view, visit https://gerrit.wikimedia.org/r/307456 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd4a6484be5b9aab8b1b30e7a2ed49b0609597e7 Gerrit-PatchSet: 2 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] operations/mediawiki-config[master]: Content namespaces configuration for lt.wikipedia
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/307455 Change subject: Content namespaces configuration for lt.wikipedia .. Content namespaces configuration for lt.wikipedia The Lithuanian Wikipedia Sąrašas namespace is dedicated to lists. As such, it should be considered as a content namespace, and benefits from the Visual Editor. Bug: T144118 Change-Id: I2d80ca828b133357d3cd4f9aa1017dac8178cfe6 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/55/307455/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 0e7c1bd..1888192 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -11155,6 +11155,7 @@ '+itwikivoyage' => [ 100, 104 ], // T57620 '+kowikisource' => [ 100 ], '+lawikisource' => [ 102 ], + '+ltwikipedia' => [ 104 ], // T144118 '+mediawikiwiki' => [ 100, 102, 104, 106 ], // Manuals, extensions, Api & skin - T86391 '+metawiki' => [ NS_HELP ], // T45687 '+mlwikisource' => [ 100 ], -- To view, visit https://gerrit.wikimedia.org/r/307455 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d80ca828b133357d3cd4f9aa1017dac8178cfe6 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...VisualEditor[master]: Update VE core submodule to master (599c6e1)
jenkins-bot has submitted this change and it was merged. Change subject: Update VE core submodule to master (599c6e1) .. Update VE core submodule to master (599c6e1) New changes: 5195713 Make ve.dm.IndexValueStore ordered, append-only and slicable 8fbad4d Localisation updates from https://translatewiki.net. ce10786 Use super property to call parent methods 9f20e05 Rename overlapsRange to isTouching 7e0e13a Fix typo in plain text file handler (extension -> extensions) 599c6e1 ElementLinearData: don't sanitize away newlines within Change-Id: I6837b71a4270bbdfb8c15e9027f721c3f85ea907 --- M lib/ve 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Esanders: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/ve b/lib/ve index 632f0a9..599c6e1 16 --- a/lib/ve +++ b/lib/ve @@ -1 +1 @@ -Subproject commit 632f0a9572d19214e9524308bc64be72f71002dc +Subproject commit 599c6e1581ac8f0b89770e060c71a7e649df80f4 -- To view, visit https://gerrit.wikimedia.org/r/307453 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6837b71a4270bbdfb8c15e9027f721c3f85ea907 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: JforresterGerrit-Reviewer: Esanders Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Display a message when API fail due to session end
jenkins-bot has submitted this change and it was merged. Change subject: Display a message when API fail due to session end .. Display a message when API fail due to session end Bug: T144231 Change-Id: I3ced44de097ba5b17d9edb91d4e3c527a5f18f03 --- M Resources.php M modules/controller/mw.echo.Controller.js M modules/ui/mw.echo.ui.NotificationBadgeWidget.js M modules/ui/mw.echo.ui.NotificationsInboxWidget.js M modules/ui/mw.echo.ui.NotificationsWrapper.js 5 files changed, 50 insertions(+), 6 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/Resources.php b/Resources.php index 32afbe2..ba6e078 100644 --- a/Resources.php +++ b/Resources.php @@ -196,6 +196,7 @@ ), 'messages' => array( 'echo-api-failure', + 'echo-notification-loginrequired', 'echo-api-failure-cross-wiki', ), 'targets' => array( 'desktop', 'mobile' ), diff --git a/modules/controller/mw.echo.Controller.js b/modules/controller/mw.echo.Controller.js index 85228a0..59cb771 100644 --- a/modules/controller/mw.echo.Controller.js +++ b/modules/controller/mw.echo.Controller.js @@ -226,7 +226,16 @@ controller.manager.getLocalCounter().update(); return dateItemIds; - } ); + } ) + .then( + null, + function ( errCode, errObj ) { + return { + errCode: errCode, + errInfo: OO.getProp( errObj, 'error', 'info' ) + }; + } + ); }; /** * Fetch notifications from the local API and update the notifications list. diff --git a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js index c81e59c..9a5d6b9 100644 --- a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js +++ b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js @@ -357,8 +357,14 @@ } }, // Failure - function () { - widget.notificationsWidget.resetLoadingOption( mw.msg( 'echo-api-failure' ) ); + function ( errorObj ) { + if ( errorObj.errCode === 'notlogin-required' ) { + // Login required message + widget.notificationsWidget.resetLoadingOption( mw.msg( 'echo-notification-loginrequired' ) ); + } else { + // Generic API failure message + widget.notificationsWidget.resetLoadingOption( mw.msg( 'echo-api-failure' ) ); + } } ) .then( this.emit.bind( this, 'finishLoading' ) ) diff --git a/modules/ui/mw.echo.ui.NotificationsInboxWidget.js b/modules/ui/mw.echo.ui.NotificationsInboxWidget.js index 20dd730..4e1df77 100644 --- a/modules/ui/mw.echo.ui.NotificationsInboxWidget.js +++ b/modules/ui/mw.echo.ui.NotificationsInboxWidget.js @@ -29,6 +29,8 @@ this.$overlay = config.$overlay || this.$element; this.limit = config.limit || 25; + this.error = false; + // A notice or error message widget this.noticeMessageWidget = new OO.ui.LabelWidget( { classes: [ 'mw-echo-ui-notificationsInboxWidget-notice' ] @@ -236,6 +238,7 @@ } this.pushPending(); + this.error = false; return fetchPromise .then( // Success @@ -245,8 +248,21 @@ widget.controller.updateSeenTimeForCurrentSource(); }, // Failure - this.popPending.bind( this ) - ); + function ( errObj ) { + var msg; + if ( errObj.errCode === 'notlogin-required' ) { + // Login required message + msg = mw.msg( 'echo-notification-loginrequired' ); + } else { +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Create unit tests for ResourceLoaderContext
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/307454 Change subject: resourceloader: Create unit tests for ResourceLoaderContext .. resourceloader: Create unit tests for ResourceLoaderContext * Fix up one last use of global config vars in this class. Other places in this class already used $rl->getConfig(). This way we don't inherit all of MediaWikiTestCase. * Add unit tests covering all of ResourceLoaderContext except expandModuleNames and getImageObj (tested in better places already with the right @covers). * Increase coverage for expandModuleNames(), add missing case of when modules are not in alphabetical order. Change-Id: Id19b084d37a6c3a77b36e03509adffb6b156fee1 --- M includes/resourceloader/ResourceLoaderContext.php A tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php M tests/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php M tests/phpunit/includes/resourceloader/ResourceLoaderTest.php 4 files changed, 164 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/54/307454/1 diff --git a/includes/resourceloader/ResourceLoaderContext.php b/includes/resourceloader/ResourceLoaderContext.php index 79b71df..30fe3ae 100644 --- a/includes/resourceloader/ResourceLoaderContext.php +++ b/includes/resourceloader/ResourceLoaderContext.php @@ -175,8 +175,7 @@ // Stricter version of RequestContext::sanitizeLangCode() if ( !Language::isValidBuiltInCode( $lang ) ) { wfDebug( "Invalid user language code\n" ); - global $wgLanguageCode; - $lang = $wgLanguageCode; + $lang = $this->getResourceLoader()->getConfig()->get( 'LanguageCode' ); } $this->language = $lang; } diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php new file mode 100644 index 000..fefb989 --- /dev/null +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php @@ -0,0 +1,108 @@ + false, + 'DefaultSkin' => 'fallback', + 'LanguageCode' => 'nl', + ] ) ); + } + + public function testEmpty() { + $ctx = new ResourceLoaderContext( $this->getResourceLoader(), new FauxRequest( [] ) ); + + // Request parameters + $this->assertEquals( [], $ctx->getModules() ); + $this->assertEquals( 'nl', $ctx->getLanguage() ); + $this->assertEquals( false, $ctx->getDebug() ); + $this->assertEquals( null, $ctx->getOnly() ); + $this->assertEquals( 'fallback', $ctx->getSkin() ); + $this->assertEquals( null, $ctx->getUser() ); + + // Misc + $this->assertEquals( 'ltr', $ctx->getDirection() ); + $this->assertEquals( 'nl|fallback', $ctx->getHash() ); + $this->assertInstanceOf( User::class, $ctx->getUserObj() ); + } + + public function testDummy() { + $this->assertInstanceOf( + ResourceLoaderContext::class, + ResourceLoaderContext::newDummyContext() + ); + } + + public function testAccessors() { + $ctx = new ResourceLoaderContext( $this->getResourceLoader(), new FauxRequest( [] ) ); + $this->assertInstanceOf( WebRequest::class, $ctx->getRequest() ); + $this->assertInstanceOf( \Psr\Log\LoggerInterface::class, $ctx->getLogger() ); + } + + public function testTypicalRequest() { + $ctx = new ResourceLoaderContext( $this->getResourceLoader(), new FauxRequest( [ + 'debug' => 'false', + 'lang' => 'zh', + 'modules' => 'foo|foo.quux,baz,bar|baz.quux', + 'only' => 'styles', + 'skin' => 'fallback', + ] ) ); + + // Request parameters + $this->assertEquals( + $ctx->getModules(), + [ 'foo', 'foo.quux', 'foo.baz', 'foo.bar', 'baz.quux' ] + ); + $this->assertEquals( false, $ctx->getDebug() ); + $this->assertEquals( 'zh', $ctx->getLanguage() ); + $this->assertEquals( 'styles', $ctx->getOnly() ); + $this->assertEquals( 'fallback', $ctx->getSkin() ); + $this->assertEquals( null, $ctx->getUser() ); + + // Misc + $this->assertEquals( 'ltr', $ctx->getDirection() ); + $this->assertEquals( 'zh|fallback|||styles|', $ctx->getHash() ); +
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Update VE core submodule to master (599c6e1)
Jforrester has uploaded a new change for review. https://gerrit.wikimedia.org/r/307453 Change subject: Update VE core submodule to master (599c6e1) .. Update VE core submodule to master (599c6e1) New changes: 5195713 Make ve.dm.IndexValueStore ordered, append-only and slicable 8fbad4d Localisation updates from https://translatewiki.net. ce10786 Use super property to call parent methods 9f20e05 Rename overlapsRange to isTouching 7e0e13a Fix typo in plain text file handler (extension -> extensions) 599c6e1 ElementLinearData: don't sanitize away newlines within Change-Id: I6837b71a4270bbdfb8c15e9027f721c3f85ea907 --- M lib/ve 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/53/307453/1 diff --git a/lib/ve b/lib/ve index 632f0a9..599c6e1 16 --- a/lib/ve +++ b/lib/ve @@ -1 +1 @@ -Subproject commit 632f0a9572d19214e9524308bc64be72f71002dc +Subproject commit 599c6e1581ac8f0b89770e060c71a7e649df80f4 -- To view, visit https://gerrit.wikimedia.org/r/307453 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6837b71a4270bbdfb8c15e9027f721c3f85ea907 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Jforrester___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: ElementLinearData: don't sanitize away newlines within
jenkins-bot has submitted this change and it was merged. Change subject: ElementLinearData: don't sanitize away newlines within .. ElementLinearData: don't sanitize away newlines within We were assuming that newlines are semantically meaningless. This is generally true, unless we're inside a preformatted block, in which case they do matter. In that case, let them be. Bug: T132006 Change-Id: I84ccf3b4bdaf4b0fb8f2baf7c87eaf8bcddf518b --- M src/dm/lineardata/ve.dm.ElementLinearData.js M tests/dm/lineardata/ve.dm.ElementLinearData.test.js 2 files changed, 17 insertions(+), 1 deletion(-) Approvals: Esanders: Looks good to me, approved jenkins-bot: Verified diff --git a/src/dm/lineardata/ve.dm.ElementLinearData.js b/src/dm/lineardata/ve.dm.ElementLinearData.js index c44af65..58f300c 100644 --- a/src/dm/lineardata/ve.dm.ElementLinearData.js +++ b/src/dm/lineardata/ve.dm.ElementLinearData.js @@ -1112,7 +1112,9 @@ // Remove plain newline characters, as they are semantically meaningless // and will confuse the user. Firefox adds these automatically when copying // line-wrapped HTML. T104790 - if ( this.getCharacterData( i ) === '\n' ) { + // However, don't remove them if we're in a situation where they might + // actually be meaningful -- i.e. if we're inside a . T132006 + if ( this.getCharacterData( i ) === '\n' && !ve.dm.nodeFactory.doesNodeHaveSignificantWhitespace( type ) ) { if ( this.getCharacterData( i + 1 ).match( /\s/ ) || this.getCharacterData( i - 1 ).match( /\s/ ) ) { // If whitespace-adjacent, remove the newline to avoid double spaces this.splice( i, 1 ); diff --git a/tests/dm/lineardata/ve.dm.ElementLinearData.test.js b/tests/dm/lineardata/ve.dm.ElementLinearData.test.js index c73ee08..ad738b2 100644 --- a/tests/dm/lineardata/ve.dm.ElementLinearData.test.js +++ b/tests/dm/lineardata/ve.dm.ElementLinearData.test.js @@ -1690,6 +1690,20 @@ msg: 'Newline characters are stripped and replaced with spaces where necessary' }, { + html: 'Foo\nBar\n Baz \nQuux', + data: [ + { type: 'paragraph' }, + 'F', 'o', 'o', ' ', 'B', 'a', 'r', + { type: '/paragraph' }, + { type: 'preformatted' }, + 'B', 'a', 'z', ' ', '\n', 'Q', 'u', 'u', 'x', + { type: '/preformatted' }, + { type: 'internalList' }, + { type: '/internalList' } + ], + msg: 'Newline characters are not stripped when they are meaningful' + }, + { html: 'Foo \n\t Bar', data: [ { type: 'paragraph' }, -- To view, visit https://gerrit.wikimedia.org/r/307324 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I84ccf3b4bdaf4b0fb8f2baf7c87eaf8bcddf518b Gerrit-PatchSet: 2 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: DLynchGerrit-Reviewer: DLynch Gerrit-Reviewer: Esanders Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fixing dry-run logic in updateCollation.php
Kaldari has uploaded a new change for review. https://gerrit.wikimedia.org/r/307452 Change subject: Fixing dry-run logic in updateCollation.php .. Fixing dry-run logic in updateCollation.php Currently if you run updateCollation.php in dry-run mode, it ignores the other parameters and doesn't give you a row estimate. Now it will behave the same as an actual run (just without making any changes to the database). Change-Id: I25a9751d8ab7554e7975e5f08122dd1ddaaf40a7 --- M maintenance/updateCollation.php 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/52/307452/1 diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index 922cc87..930f533 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -101,7 +101,7 @@ 'STRAIGHT_JOIN' // per T58041 ]; - if ( $force || $dryRun ) { + if ( $force ) { $collationConds = []; } else { if ( $this->hasOption( 'previous-collation' ) ) { @@ -132,7 +132,11 @@ return; } - $this->output( "Fixing collation for $count rows.\n" ); + if ( $dryRun ) { + $this->output( "$count rows would be updated.\n" ); + } else { + $this->output( "Fixing collation for $count rows.\n" ); + } wfWaitForSlaves(); } $count = 0; -- To view, visit https://gerrit.wikimedia.org/r/307452 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I25a9751d8ab7554e7975e5f08122dd1ddaaf40a7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Kaldari___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make WikiPage::doDeleteArticle more robust
jenkins-bot has submitted this change and it was merged. Change subject: Make WikiPage::doDeleteArticle more robust .. Make WikiPage::doDeleteArticle more robust When it becomes impossible to load the content of a page due to some error or misconfiguration, we still want to be able to delete that page. This change makes WikiPage::doDeleteArticle more robust by catching any exceptions that may be thrown while trying to load the page content during the deletion process. See T128466 for context. Change-Id: I19f2d16850a3c1af5b504a70a27b9bf1330bc68d --- M docs/hooks.txt M includes/page/WikiPage.php 2 files changed, 28 insertions(+), 5 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/docs/hooks.txt b/docs/hooks.txt index c0c01f4..a1c30eb7 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -606,7 +606,7 @@ &$user: the user that deleted the article $reason: the reason the article was deleted $id: id of the article that was deleted -$content: the Content of the deleted page +$content: the Content of the deleted page (or null, when deleting a broken page) $logEntry: the ManualLogEntry used to record the deletion 'ArticleEditUpdateNewTalk': Before updating user_newtalk when a user talk page @@ -3621,7 +3621,8 @@ specific to a content model should be provided by the respective Content's getDeletionUpdates() method. $page: the WikiPage -$content: the Content to generate updates for +$content: the Content to generate updates for (or null, if the Content could not be loaded +due to an error) &$updates: the array of DataUpdate objects. Hook function may want to add to it. 'XmlDumpWriterOpenPage': Called at the end of XmlDumpWriter::openPage, to allow diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index a416d56..ba20c10 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2848,7 +2848,14 @@ // unless they actually try to catch exceptions (which is rare). // we need to remember the old content so we can use it to generate all deletion updates. - $content = $this->getContent( Revision::RAW ); + try { + $content = $this->getContent( Revision::RAW ); + } catch ( Exception $ex ) { + wfLogWarning( __METHOD__ . ': failed to load content during deletion! ' + . $ex->getMessage() ); + + $content = null; + } // Bitfields to further suppress the content if ( $suppress ) { @@ -2982,8 +2989,16 @@ * may already return null when the page proper was deleted. */ public function doDeleteUpdates( $id, Content $content = null ) { + try { + $countable = $this->isCountable(); + } catch ( Exception $ex ) { + // fallback for deleting broken pages for which we cannot load the content for + // some reason. Note that doDeleteArticleReal() already logged this problem. + $countable = false; + } + // Update site status - DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, - (int)$this->isCountable(), -1 ) ); + DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, - (int)$countable, -1 ) ); // Delete pagelinks, update secondary indexes, etc $updates = $this->getDeletionUpdates( $content ); @@ -3575,7 +3590,14 @@ if ( !$content ) { // load content object, which may be used to determine the necessary updates. // XXX: the content may not be needed to determine the updates. - $content = $this->getContent( Revision::RAW ); + try { + $content = $this->getContent( Revision::RAW ); + } catch ( Exception $ex ) { + // If we can't load the content, something is wrong. Perhaps that's why + // the user is trying to delete the page, so let's not fail in that case. + // Note that doDeleteArticleReal() will already have logged an issue with + // loading the content. + } } if ( !$content ) { -- To view, visit https://gerrit.wikimedia.org/r/296059 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I19f2d16850a3c1af5b504a70a27b9bf1330bc68d Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Daniel KinzlerGerrit-Reviewer: Aaron Schulz
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Don't treat certain image placeholders as block
jenkins-bot has submitted this change and it was merged. Change subject: Don't treat certain image placeholders as block .. Don't treat certain image placeholders as block If an image is inside a span treat it as an inline element. This preserves spacing between the image and any text elements avoiding a line break. Bug: T143558 Change-Id: I90eed415ca0f59709fb97d56f11c419e34809fc3 --- M resources/skins.minerva.base.styles/images.less 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Bmansurov: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/skins.minerva.base.styles/images.less b/resources/skins.minerva.base.styles/images.less index 063a2e1..f594c3a 100644 --- a/resources/skins.minerva.base.styles/images.less +++ b/resources/skins.minerva.base.styles/images.less @@ -5,6 +5,12 @@ @placeholderBackgroundColor: @grayLightest; .lazy-image-placeholder { + // If the placeholder itself is inside an inline element do not use block + // See https://phabricator.wikimedia.org/T143558 + span & { + display: inline; + } + // The image placeholder for shouldn't show for no-js devices .client-nojs & { display: none; -- To view, visit https://gerrit.wikimedia.org/r/306479 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I90eed415ca0f59709fb97d56f11c419e34809fc3 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: JdlrobsonGerrit-Reviewer: Bmansurov Gerrit-Reviewer: Jdlrobson 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]: Floor slave lag before display
jenkins-bot has submitted this change and it was merged. Change subject: Floor slave lag before display .. Floor slave lag before display Seeing slave lags like 15.309758901596 looks scary Change-Id: Ie564670448311364b8492af6b82943312118dc29 --- M includes/OutputPage.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/OutputPage.php b/includes/OutputPage.php index eb3040c..74ade3e 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2547,6 +2547,7 @@ public function showLagWarning( $lag ) { $config = $this->getConfig(); if ( $lag >= $config->get( 'SlaveLagWarning' ) ) { + $lag = floor( $lag ); // floor to avoid nano seconds to display $message = $lag < $config->get( 'SlaveLagCritical' ) ? 'lag-warn-normal' : 'lag-warn-high'; -- To view, visit https://gerrit.wikimedia.org/r/305868 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie564670448311364b8492af6b82943312118dc29 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Add Əlavə namespace to az.wiktionary
jenkins-bot has submitted this change and it was merged. Change subject: Add Əlavə namespace to az.wiktionary .. Add Əlavə namespace to az.wiktionary Bug: T143851 Change-Id: I7f1f1108e35185bb910837990198288f3469f575 --- M wmf-config/InitialiseSettings.php 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 60e8df4..0e7c1bd 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -5859,6 +5859,10 @@ 100 => 'Ætēaca', 101 => 'Ætēacmōtung', ], + 'azwiktionary' => [ + 100 => 'Əlavə', // Appendix - T143851 + 101 => 'Əlavə_müzakirəsi', + ], 'bgwiktionary' => [ 100 => 'Словоформи', 101 => 'Словоформи_беседа' -- To view, visit https://gerrit.wikimedia.org/r/307108 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f1f1108e35185bb910837990198288f3469f575 Gerrit-PatchSet: 2 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...ORES[wmf/1.28.0-wmf.16]: Improvements to purging cache:
jenkins-bot has submitted this change and it was merged. Change subject: Improvements to purging cache: .. Improvements to purging cache: - Do not clean based on oresc_rev, do it based on oresc_id - Clean when oresc_model doesn't exist in ores_model table Bug: T144216 Change-Id: I2799461543801bb85d4150dd34262a8503c91bfb --- M includes/Cache.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Cache.php b/includes/Cache.php index e5baebf..2f2a38f 100644 --- a/includes/Cache.php +++ b/includes/Cache.php @@ -98,12 +98,12 @@ 'oresm_name' => $model, ]; if ( !$isEverything ) { - $conditions[] = 'oresm_is_current != 1'; + $conditions[] = '(oresm_is_current != 1 OR oresm_is_current IS NULL)'; } do { $ids = $dbr->selectFieldValues( $tables, - 'oresc_rev', + 'oresc_id', $conditions, __METHOD__, [ 'LIMIT' => $batchSize ], @@ -111,7 +111,7 @@ ); if ( $ids ) { $dbw->delete( 'ores_classification', - [ 'oresc_rev' => $ids ], + [ 'oresc_id' => $ids ], __METHOD__ ); wfWaitForSlaves(); -- To view, visit https://gerrit.wikimedia.org/r/307438 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2799461543801bb85d4150dd34262a8503c91bfb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ORES Gerrit-Branch: wmf/1.28.0-wmf.16 Gerrit-Owner: LadsgroupGerrit-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...Echo[master]: Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c
jenkins-bot has submitted this change and it was merged. Change subject: Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c .. Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c That changes the signature. Change-Id: I1dc9f0240ae4b27e51e170f31911fea4f5225625 --- M scripts/gen-autoload.php 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/gen-autoload.php b/scripts/gen-autoload.php index 64f92b1..74a73c0 100644 --- a/scripts/gen-autoload.php +++ b/scripts/gen-autoload.php @@ -19,7 +19,12 @@ $generator->readFile( $file ); } - $generator->generateAutoload( basename( __DIR__ ) . '/' . basename( __FILE__ ) ); + $target = $generator->getTargetFileInfo(); + + file_put_contents( + $target['filename'], + $generator->getAutoload( basename( __DIR__ ) . '/' . basename( __FILE__ ) ) + ); echo "Done.\n\n"; } -- To view, visit https://gerrit.wikimedia.org/r/307451 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1dc9f0240ae4b27e51e170f31911fea4f5225625 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: MattflaschenGerrit-Reviewer: Catrope Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c
jenkins-bot has submitted this change and it was merged. Change subject: Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c .. Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c That changes the signature. Change-Id: I8612e7acac6fe83b253d6a229c391599f8d6d4cc --- M scripts/gen-autoload.php 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/scripts/gen-autoload.php b/scripts/gen-autoload.php index 9ea48ab..04c8dfd 100644 --- a/scripts/gen-autoload.php +++ b/scripts/gen-autoload.php @@ -14,7 +14,12 @@ // read entire maint dir, move helper to includes? to core? $generator->readFile( $base . '/maintenance/MaintenanceDebugLogger.php' ); - $generator->generateAutoload( basename( __DIR__ ) . '/' . basename( __FILE__ ) ); + $target = $generator->getTargetFileInfo(); + + file_put_contents( + $target['filename'], + $generator->getAutoload( basename( __DIR__ ) . '/' . basename( __FILE__ ) ) + ); echo "Done.\n\n"; } -- To view, visit https://gerrit.wikimedia.org/r/307450 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8612e7acac6fe83b253d6a229c391599f8d6d4cc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: MattflaschenGerrit-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]: EditSubmitButtonLabelPublish: Temporarily don't do this
jenkins-bot has submitted this change and it was merged. Change subject: EditSubmitButtonLabelPublish: Temporarily don't do this .. EditSubmitButtonLabelPublish: Temporarily don't do this Waiting on further discussion. Change-Id: I5387d504e06cd44649a4cb8b293d36fb00a01693 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 9a514e3..60e8df4 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -14077,7 +14077,7 @@ // This should be set to true for all public WMF wikis, and any changes should be discussed // with Editing before they are done due to the legal implications. 'wgEditSubmitButtonLabelPublish' => [ - 'default' => true, // T131132 + 'default' => false, // T131132; temporarily not set 'private' => false, // Private wikis are not public 'wikinews' => false,// Done in local {{int:Copyrightwarning}}s instead. ], -- To view, visit https://gerrit.wikimedia.org/r/307446 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5387d504e06cd44649a4cb8b293d36fb00a01693 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: JforresterGerrit-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] operations/mediawiki-config[master]: ores: Update thresholds
jenkins-bot has submitted this change and it was merged. Change subject: ores: Update thresholds .. ores: Update thresholds Bug: T144101 Change-Id: I4c2ef2b0b27681cd585a10e4bbc49d43db50a968 --- M wmf-config/InitialiseSettings.php 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index dfa30ce..9a514e3 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -17029,14 +17029,14 @@ ], 'wgOresDamagingThresholds' => [ 'default' => [ 'hard' => 0.5, 'soft' => 0.7 ], - 'fawiki' => [ 'hard' => 0.12, 'soft' => 0.45 ], // T130211 - 'wikidatawiki' => [ 'hard' => 0.8, 'soft' => 0.96 ], // T130212 - 'nlwiki' => [ 'hard' => 0.3, 'soft' => 0.72 ], // T139432 - 'ruwiki' => [ 'hard' => 0.44, 'soft' => 0.69 ], // T139541 - 'ptwiki' => [ 'hard' => 0.22, 'soft' => 0.48 ], // T139692 - 'trwiki' => [ 'hard' => 0.22, 'soft' => 0.49 ], // T139992 - 'plwiki' => [ 'hard' => 0.11, 'soft' => 0.40 ], // T140005 - 'enwiki' => [ 'hard' => 0.14, 'soft' => 0.43 ], // T140003 + 'fawiki' => [ 'hard' => 0.07, 'soft' => 0.37 ], // T130211 + 'wikidatawiki' => [ 'hard' => 0.92, 'soft' => 0.97 ], // T130212 + 'nlwiki' => [ 'hard' => 0.39, 'soft' => 0.75 ], // T139432 + 'ruwiki' => [ 'hard' => 0.50, 'soft' => 0.73 ], // T139541 + 'ptwiki' => [ 'hard' => 0.24, 'soft' => 0.57 ], // T139692 + 'trwiki' => [ 'hard' => 0.20, 'soft' => 0.58 ], // T139992 + 'plwiki' => [ 'hard' => 0.19, 'soft' => 0.41 ], // T140005 + 'enwiki' => [ 'hard' => 0.17, 'soft' => 0.49 ], // T140003 ], 'wgOresEnabledNamespaces' => [ 'default' => [], -- To view, visit https://gerrit.wikimedia.org/r/307437 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4c2ef2b0b27681cd585a10e4bbc49d43db50a968 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: LadsgroupGerrit-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...Echo[master]: Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/307451 Change subject: Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c .. Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c That changes the signature. Change-Id: I1dc9f0240ae4b27e51e170f31911fea4f5225625 --- M scripts/gen-autoload.php 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/51/307451/1 diff --git a/scripts/gen-autoload.php b/scripts/gen-autoload.php index 64f92b1..74a73c0 100644 --- a/scripts/gen-autoload.php +++ b/scripts/gen-autoload.php @@ -19,7 +19,12 @@ $generator->readFile( $file ); } - $generator->generateAutoload( basename( __DIR__ ) . '/' . basename( __FILE__ ) ); + $target = $generator->getTargetFileInfo(); + + file_put_contents( + $target['filename'], + $generator->getAutoload( basename( __DIR__ ) . '/' . basename( __FILE__ ) ) + ); echo "Done.\n\n"; } -- To view, visit https://gerrit.wikimedia.org/r/307451 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1dc9f0240ae4b27e51e170f31911fea4f5225625 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo 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...Flow[master]: Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/307450 Change subject: Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c .. Fix autoloader for I3a426b92892f4c00cab33a13f6a717751120367c That changes the signature. Change-Id: I8612e7acac6fe83b253d6a229c391599f8d6d4cc --- M scripts/gen-autoload.php 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/50/307450/1 diff --git a/scripts/gen-autoload.php b/scripts/gen-autoload.php index 9ea48ab..04c8dfd 100644 --- a/scripts/gen-autoload.php +++ b/scripts/gen-autoload.php @@ -14,7 +14,12 @@ // read entire maint dir, move helper to includes? to core? $generator->readFile( $base . '/maintenance/MaintenanceDebugLogger.php' ); - $generator->generateAutoload( basename( __DIR__ ) . '/' . basename( __FILE__ ) ); + $target = $generator->getTargetFileInfo(); + + file_put_contents( + $target['filename'], + $generator->getAutoload( basename( __DIR__ ) . '/' . basename( __FILE__ ) ) + ); echo "Done.\n\n"; } -- To view, visit https://gerrit.wikimedia.org/r/307450 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8612e7acac6fe83b253d6a229c391599f8d6d4cc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow 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] analytics/discovery-stats[master]: Refactor the logging command
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/307448 Change subject: Refactor the logging command .. Refactor the logging command Change-Id: I6b504c6ff6f382313b8a3e053245075629a1377f --- M tracking-category-count.php 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/discovery-stats refs/changes/48/307448/1 diff --git a/tracking-category-count.php b/tracking-category-count.php index f8594fd..66534a3 100644 --- a/tracking-category-count.php +++ b/tracking-category-count.php @@ -22,8 +22,11 @@ } $key = str_replace( '%WIKI%', $wiki, $config->categories[$metric] ); +$packet = "$metric $count `date +%s`"; +$nc = "nc -q0 {$config->graphiteHost} {$config->graphitePort}"; +$command = "echo \"$packet\" | $nc"; -exec( "echo \"$metric $count `date +%s`\" | nc -q0 {$config->graphiteHost} {$config->graphitePort}" ); +exec( $command ); } $matrix = new SiteMatrix; -- To view, visit https://gerrit.wikimedia.org/r/307448 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6b504c6ff6f382313b8a3e053245075629a1377f Gerrit-PatchSet: 1 Gerrit-Project: analytics/discovery-stats 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] analytics/discovery-stats[master]: Fix graphite port
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/307449 Change subject: Fix graphite port .. Fix graphite port Change-Id: Iecbe06dba7ed0ed82d0c0ac8ebd4c0cb63b908a8 --- M config.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/discovery-stats refs/changes/49/307449/1 diff --git a/config.json b/config.json index 1f7abaf..8c3c83c 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "graphiteHost": "graphite.eqiad.wmnet", -"graphitePort": 8126, +"graphitePort": 2003, "categories": { "kartographer-tracking-category": "kartographer.pages.%WIKI%.hourly", "graph-tracking-category": "graph.pages.%WIKI%.hourly" -- To view, visit https://gerrit.wikimedia.org/r/307449 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iecbe06dba7ed0ed82d0c0ac8ebd4c0cb63b908a8 Gerrit-PatchSet: 1 Gerrit-Project: analytics/discovery-stats 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] analytics/discovery-stats[master]: Remove unused uses
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/307447 Change subject: Remove unused uses .. Remove unused uses Change-Id: I94a01b53f8e72c9ba26f80fefdcb6a2025aae2da --- M tracking-category-count.php 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/discovery-stats refs/changes/47/307447/1 diff --git a/tracking-category-count.php b/tracking-category-count.php index 3bf8a86..f8594fd 100644 --- a/tracking-category-count.php +++ b/tracking-category-count.php @@ -2,10 +2,6 @@ namespace DiscoveryStats; -use Liuggio\StatsdClient\StatsdClient; -use Liuggio\StatsdClient\Sender\SocketSender; -use Liuggio\StatsdClient\Service\StatsdService; - require_once( 'vendor/autoload.php' ); $wikiBlacklist = [ -- To view, visit https://gerrit.wikimedia.org/r/307447 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94a01b53f8e72c9ba26f80fefdcb6a2025aae2da Gerrit-PatchSet: 1 Gerrit-Project: analytics/discovery-stats 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/core[master]: resourceloader: Add test coverage for DerivativeResourceLoad...
jenkins-bot has submitted this change and it was merged. Change subject: resourceloader: Add test coverage for DerivativeResourceLoaderContext .. resourceloader: Add test coverage for DerivativeResourceLoaderContext * Re-order method tests to match source class. * Add @covers. * Add tests to make coverage 100%. Change-Id: I46bdb66bc08120a82d44208a39d2dd6b7de18de1 --- M tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php 1 file changed, 78 insertions(+), 30 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php b/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php index 90c9f38..0be04ef 100644 --- a/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php +++ b/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php @@ -2,11 +2,11 @@ /** * @group ResourceLoader + * @covers DerivativeResourceLoaderContext */ class DerivativeResourceLoaderContextTest extends PHPUnit_Framework_TestCase { - protected static function getResourceLoaderContext() { - $resourceLoader = new ResourceLoader(); + protected static function getContext() { $request = new FauxRequest( [ 'lang' => 'zh', 'modules' => 'test.context', @@ -14,42 +14,76 @@ 'skin' => 'fallback', 'target' => 'test', ] ); - return new ResourceLoaderContext( $resourceLoader, $request ); + return new ResourceLoaderContext( new ResourceLoader(), $request ); } - public function testGet() { - $context = self::getResourceLoaderContext(); - $derived = new DerivativeResourceLoaderContext( $context ); + public function testGetInherited() { + $derived = new DerivativeResourceLoaderContext( self::getContext() ); + // Request parameters + $this->assertEquals( $derived->getDebug(), false ); $this->assertEquals( $derived->getLanguage(), 'zh' ); $this->assertEquals( $derived->getModules(), [ 'test.context' ] ); $this->assertEquals( $derived->getOnly(), 'scripts' ); $this->assertEquals( $derived->getSkin(), 'fallback' ); + $this->assertEquals( $derived->getUser(), null ); + + // Misc + $this->assertEquals( $derived->getDirection(), 'ltr' ); $this->assertEquals( $derived->getHash(), 'zh|fallback|||scripts|' ); } - public function testSetLanguage() { - $context = self::getResourceLoaderContext(); - $derived = new DerivativeResourceLoaderContext( $context ); - - $derived->setLanguage( 'nl' ); - $this->assertEquals( $derived->getLanguage(), 'nl' ); - - $derived->setLanguage( 'he' ); - $this->assertEquals( $derived->getDirection(), 'rtl' ); - } - - public function testSetModules() { - $context = self::getResourceLoaderContext(); - $derived = new DerivativeResourceLoaderContext( $context ); + public function testModules() { + $derived = new DerivativeResourceLoaderContext( self::getContext() ); $derived->setModules( [ 'test.override' ] ); $this->assertEquals( $derived->getModules(), [ 'test.override' ] ); } - public function testSetOnly() { - $context = self::getResourceLoaderContext(); + public function testLanguage() { + $context = self::getContext(); $derived = new DerivativeResourceLoaderContext( $context ); + + $derived->setLanguage( 'nl' ); + $this->assertEquals( $derived->getLanguage(), 'nl' ); + } + + public function testDirection() { + $derived = new DerivativeResourceLoaderContext( self::getContext() ); + + $derived->setLanguage( 'nl' ); + $this->assertEquals( $derived->getDirection(), 'ltr' ); + + $derived->setLanguage( 'he' ); + $this->assertEquals( $derived->getDirection(), 'rtl' ); + + $derived->setDirection( 'ltr' ); + $this->assertEquals( $derived->getDirection(), 'ltr' ); + } + + public function testSkin() { + $derived = new DerivativeResourceLoaderContext( self::getContext() ); + + $derived->setSkin( 'override' ); + $this->assertEquals( $derived->getSkin(), 'override' ); + } + + public function testUser() { + $derived = new DerivativeResourceLoaderContext(
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: EditSubmitButtonLabelPublish: Temporarily don't do this
Jforrester has uploaded a new change for review. https://gerrit.wikimedia.org/r/307446 Change subject: EditSubmitButtonLabelPublish: Temporarily don't do this .. EditSubmitButtonLabelPublish: Temporarily don't do this Waiting on further discussion. Change-Id: I5387d504e06cd44649a4cb8b293d36fb00a01693 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/46/307446/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index dfa30ce..b8fb424 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -14077,7 +14077,7 @@ // This should be set to true for all public WMF wikis, and any changes should be discussed // with Editing before they are done due to the legal implications. 'wgEditSubmitButtonLabelPublish' => [ - 'default' => true, // T131132 + 'default' => false, // T131132; temporarily not set 'private' => false, // Private wikis are not public 'wikinews' => false,// Done in local {{int:Copyrightwarning}}s instead. ], -- To view, visit https://gerrit.wikimedia.org/r/307446 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5387d504e06cd44649a4cb8b293d36fb00a01693 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Jforrester___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Don't pollute $msg with pending_id
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/307445 Change subject: Don't pollute $msg with pending_id .. Don't pollute $msg with pending_id We use pending_id to delete the database row, but we don't need to merge it in to the donation message Bug: T122641 Change-Id: Iabc837bb156d44899b32ed87171136b7f9dcdb92 --- M sites/all/modules/queue2civicrm/queue2civicrm.module 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/45/307445/1 diff --git a/sites/all/modules/queue2civicrm/queue2civicrm.module b/sites/all/modules/queue2civicrm/queue2civicrm.module index 7833ec3..276a705 100644 --- a/sites/all/modules/queue2civicrm/queue2civicrm.module +++ b/sites/all/modules/queue2civicrm/queue2civicrm.module @@ -329,6 +329,9 @@ // info than the pending db. if ( $data ) { $msg = $msg + $data; +// $data has a pending_id key for ease of deletion, +// but $msg doesn't need it +unset( $msg['pending_id'] ); } return $data; } -- To view, visit https://gerrit.wikimedia.org/r/307445 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iabc837bb156d44899b32ed87171136b7f9dcdb92 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Ejegg___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Use DB_SLAVE in TemporaryPasswordPrimaryAuthenticationProvider
jenkins-bot has submitted this change and it was merged. Change subject: Use DB_SLAVE in TemporaryPasswordPrimaryAuthenticationProvider .. Use DB_SLAVE in TemporaryPasswordPrimaryAuthenticationProvider Barring ChronologyProtector failure (which itself falls back to waitForReplication) on account creation, this should be fine. Change-Id: I94be86c8f56e9e98a9d06814b33a9f08a9228db6 --- M includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Anomie: Looks good to me, but someone else must approve Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php index ed94c1a..c338284 100644 --- a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php +++ b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php @@ -126,8 +126,8 @@ return AuthenticationResponse::newAbstain(); } - $dbw = wfGetDB( DB_MASTER ); - $row = $dbw->selectRow( + $dbr = wfGetDB( DB_SLAVE ); + $row = $dbr->selectRow( 'user', [ 'user_id', 'user_newpassword', 'user_newpass_time', @@ -165,8 +165,8 @@ return false; } - $dbw = wfGetDB( DB_MASTER ); - $row = $dbw->selectRow( + $dbr = wfGetDB( DB_SLAVE ); + $row = $dbr->selectRow( 'user', [ 'user_newpassword', 'user_newpass_time' ], [ 'user_name' => $username ], -- To view, visit https://gerrit.wikimedia.org/r/307147 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94be86c8f56e9e98a9d06814b33a9f08a9228db6 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Anomie Gerrit-Reviewer: Gergő Tisza 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]: Move some DB error classes with the rest as type DBUnexpecte...
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/307444 Change subject: Move some DB error classes with the rest as type DBUnexpectedError .. Move some DB error classes with the rest as type DBUnexpectedError Change-Id: I97d61d32495e6d88ce274772369390c76d7ff3c4 --- M autoload.php M includes/db/DatabaseError.php M includes/db/loadbalancer/LBFactory.php 3 files changed, 20 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/44/307444/1 diff --git a/autoload.php b/autoload.php index 39102fd..dec7219 100644 --- a/autoload.php +++ b/autoload.php @@ -297,7 +297,7 @@ 'CsvStatsOutput' => __DIR__ . '/maintenance/language/StatOutputs.php', 'CurlHttpRequest' => __DIR__ . '/includes/HttpFunctions.php', 'DBAccessBase' => __DIR__ . '/includes/dao/DBAccessBase.php', - 'DBAccessError' => __DIR__ . '/includes/db/loadbalancer/LBFactory.php', + 'DBAccessError' => __DIR__ . '/includes/db/DatabaseError.php', 'DBAccessObjectUtils' => __DIR__ . '/includes/dao/DBAccessObjectUtils.php', 'DBConnRef' => __DIR__ . '/includes/db/DBConnRef.php', 'DBConnectionError' => __DIR__ . '/includes/db/DatabaseError.php', @@ -308,7 +308,7 @@ 'DBMasterPos' => __DIR__ . '/includes/db/DatabaseUtility.php', 'DBQueryError' => __DIR__ . '/includes/db/DatabaseError.php', 'DBReadOnlyError' => __DIR__ . '/includes/db/DatabaseError.php', - 'DBReplicationWaitError' => __DIR__ . '/includes/db/loadbalancer/LBFactory.php', + 'DBReplicationWaitError' => __DIR__ . '/includes/db/DatabaseError.php', 'DBSiteStore' => __DIR__ . '/includes/site/DBSiteStore.php', 'DBTransactionError' => __DIR__ . '/includes/db/DatabaseError.php', 'DBUnexpectedError' => __DIR__ . '/includes/db/DatabaseError.php', diff --git a/includes/db/DatabaseError.php b/includes/db/DatabaseError.php index 4cd02b1..9ebe748 100644 --- a/includes/db/DatabaseError.php +++ b/includes/db/DatabaseError.php @@ -470,3 +470,21 @@ */ class DBTransactionError extends DBExpectedError { } + +/** + * @ingroup Database + * Exception class for attempted DB access + */ +class DBAccessError extends DBUnexpectedError { + public function __construct() { + parent::__construct( "Mediawiki tried to access the database via wfGetDB(). " . + "This is not allowed, because database access has been disabled." ); + } +} + +/** + * @ingroup Database + * Exception class for replica DB wait timeouts + */ +class DBReplicationWaitError extends DBUnexpectedError { +} diff --git a/includes/db/loadbalancer/LBFactory.php b/includes/db/loadbalancer/LBFactory.php index 84f7fcb..dfa4c29 100644 --- a/includes/db/loadbalancer/LBFactory.php +++ b/includes/db/loadbalancer/LBFactory.php @@ -539,19 +539,3 @@ } } - -/** - * Exception class for attempted DB access - */ -class DBAccessError extends MWException { - public function __construct() { - parent::__construct( "Mediawiki tried to access the database via wfGetDB(). " . - "This is not allowed, because database access has been disabled." ); - } -} - -/** - * Exception class for replica DB wait timeouts - */ -class DBReplicationWaitError extends Exception { -} -- To view, visit https://gerrit.wikimedia.org/r/307444 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I97d61d32495e6d88ce274772369390c76d7ff3c4 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...Echo[master]: Fix font size for notifications dotdotdot menu in Monobook
jenkins-bot has submitted this change and it was merged. Change subject: Fix font size for notifications dotdotdot menu in Monobook .. Fix font size for notifications dotdotdot menu in Monobook Change-Id: Ie75ad192204a652885a82b0021340410b69864f4 --- M Resources.php A modules/styles/mw.echo.ui.overlay.monobook.less 2 files changed, 11 insertions(+), 0 deletions(-) Approvals: Mooeypoo: Looks good to me, approved jenkins-bot: Verified diff --git a/Resources.php b/Resources.php index 32afbe2..8f18715 100644 --- a/Resources.php +++ b/Resources.php @@ -105,6 +105,9 @@ 'minerva' => array( 'styles/mw.echo.ui.overlay.minerva.less', ), + 'monobook' => array( + 'styles/mw.echo.ui.overlay.monobook.less', + ) ), 'dependencies' => array( 'ext.echo.logger', diff --git a/modules/styles/mw.echo.ui.overlay.monobook.less b/modules/styles/mw.echo.ui.overlay.monobook.less new file mode 100644 index 000..c67c251 --- /dev/null +++ b/modules/styles/mw.echo.ui.overlay.monobook.less @@ -0,0 +1,8 @@ +.mw-echo-ui-overlay { + // We need the overlay to be adjusted for: + // #globalWrapper 127% + // .pBody 95% + // .portlet ul 95% + // .mw-echo-ui-notificationBadgeButtonPopupWidget > .oo-ui-popupWidget 0.875/0.75em + font-size: 1.27*0.95*0.95*0.875/0.75em; +} -- To view, visit https://gerrit.wikimedia.org/r/307442 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie75ad192204a652885a82b0021340410b69864f4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: Catrope 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] mediawiki...Echo[master]: Override white background on hover for links in Monobook
jenkins-bot has submitted this change and it was merged. Change subject: Override white background on hover for links in Monobook .. Override white background on hover for links in Monobook p-personal links have a white background on hover, and links inside the notifications popup were inheriting that CSS rule. Bug: T144063 Change-Id: I3868e418ab8cce8e5ff6f7cc10e042907cb1e8df --- M modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Mooeypoo: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less b/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less index 1cef525..c77317c 100644 --- a/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less +++ b/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less @@ -6,6 +6,9 @@ &, .oo-ui-popupWidget a.oo-ui-buttonElement-button { color: #333; } + a { + background-color: initial; + } // Badge > .oo-ui-buttonElement-button { &:hover { -- To view, visit https://gerrit.wikimedia.org/r/307431 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3868e418ab8cce8e5ff6f7cc10e042907cb1e8df Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: Catrope 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] mediawiki...RelatedArticles[master]: Cache `morelike` requrests
jenkins-bot has submitted this change and it was merged. Change subject: Cache `morelike` requrests .. Cache `morelike` requrests The cache length is 24 hours. Bug: T126455 Change-Id: Icd328f70ced16cc43fc0ad62c8a1f49ce71d6369 --- M resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jdlrobson: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js b/resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js index a935621..46e77fc 100644 --- a/resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js +++ b/resources/ext.relatedArticles.readMore.gateway/RelatedPagesGateway.js @@ -77,6 +77,7 @@ parameters.gsrnamespace = '0'; parameters.gsrlimit = limit; parameters.gsrqiprofile = 'classic_noboostlinks'; + parameters.smaxage = 86400; // 24 hours } else { return $.Deferred().resolve( [] ); } -- To view, visit https://gerrit.wikimedia.org/r/307361 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icd328f70ced16cc43fc0ad62c8a1f49ce71d6369 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/RelatedArticles Gerrit-Branch: master Gerrit-Owner: BmansurovGerrit-Reviewer: Jdlrobson 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...RelatedArticles[master]: Add documentation
jenkins-bot has submitted this change and it was merged. Change subject: Add documentation .. Add documentation Bug: T127068 Change-Id: I5b640f8fe90cb2b07e7e5113e5dff398684c0c68 --- M includes/FooterHooks.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jdlrobson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/FooterHooks.php b/includes/FooterHooks.php index fae595f..862a9b7 100644 --- a/includes/FooterHooks.php +++ b/includes/FooterHooks.php @@ -41,6 +41,7 @@ * to the output when: * * +* The page is not a disambiguation page * $wgRelatedArticlesShowInFooter is truthy * On mobile, the output is being rendered with * SkinMinervaBeta -- To view, visit https://gerrit.wikimedia.org/r/307363 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5b640f8fe90cb2b07e7e5113e5dff398684c0c68 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/RelatedArticles Gerrit-Branch: master Gerrit-Owner: BmansurovGerrit-Reviewer: Jdlrobson 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]: Split up testHelpers.inc, break off fuzz testing
Tim Starling has uploaded a new change for review. https://gerrit.wikimedia.org/r/307443 Change subject: Split up testHelpers.inc, break off fuzz testing .. Split up testHelpers.inc, break off fuzz testing * Split up testHelpers.inc into one class per file, with the file named after the class per the usual convention. Put them in tests/parser since they are all parser-related, even though a couple are reused by other unit tests. * Also rename parserTest.inc and parserTestsParserHook.php to follow the usual convention, and split off ParserTestResultNormalizer * Move fuzz testing out to its own maintenance script. It's really not helpful to have fuzz testing, which is designed to run forever, exposed as a PHPUnit test. * Temporarily switched a couple of ParserTest methods from private to public to support fuzz testing from a separate class -- I plan on replacing this interface in a subsequent commit. Change-Id: Ib1a07e109ec1005bff2751b78eb4de35f2dfc472 --- M tests/TestsAutoLoader.php A tests/parser/DbTestPreviewer.php A tests/parser/DbTestRecorder.php A tests/parser/DelayedParserTest.php A tests/parser/DjVuSupport.php A tests/parser/ITestRecorder.php R tests/parser/ParserTest.php R tests/parser/ParserTestParserHook.php A tests/parser/ParserTestResultNormalizer.php A tests/parser/TestFileDataProvider.php A tests/parser/TestFileIterator.php A tests/parser/TestRecorder.php A tests/parser/TidySupport.php A tests/parser/fuzzTest.php M tests/parserTests.php M tests/phpunit/includes/parser/NewParserTest.php D tests/testHelpers.inc 17 files changed, 1,369 insertions(+), 1,301 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/43/307443/1 diff --git a/tests/TestsAutoLoader.php b/tests/TestsAutoLoader.php index 5488280..4858703 100644 --- a/tests/TestsAutoLoader.php +++ b/tests/TestsAutoLoader.php @@ -26,18 +26,6 @@ $wgAutoloadClasses += [ - # tests - 'DbTestPreviewer' => "$testDir/testHelpers.inc", - 'DbTestRecorder' => "$testDir/testHelpers.inc", - 'DelayedParserTest' => "$testDir/testHelpers.inc", - 'ParserTestResult' => "$testDir/parser/ParserTestResult.php", - 'TestFileIterator' => "$testDir/testHelpers.inc", - 'TestFileDataProvider' => "$testDir/testHelpers.inc", - 'TestRecorder' => "$testDir/testHelpers.inc", - 'ITestRecorder' => "$testDir/testHelpers.inc", - 'DjVuSupport' => "$testDir/testHelpers.inc", - 'TidySupport' => "$testDir/testHelpers.inc", - # tests/phpunit 'MediaWikiTestCase' => "$testDir/phpunit/MediaWikiTestCase.php", 'MediaWikiPHPUnitTestListener' => "$testDir/phpunit/MediaWikiPHPUnitTestListener.php", @@ -142,11 +130,21 @@ 'DummySessionProvider' => "$testDir/phpunit/mocks/session/DummySessionProvider.php", # tests/parser - 'NewParserTest' => "$testDir/phpunit/includes/parser/NewParserTest.php", + 'DbTestPreviewer' => "$testDir/parser/DbTestPreviewer.php", + 'DbTestRecorder' => "$testDir/parser/DbTestRecorder.php", + 'DelayedParserTest' => "$testDir/parser/DelayedParserTest.php", + 'DjVuSupport' => "$testDir/parser/DjVuSupport.php", + 'ITestRecorder' => "$testDir/parser/ITestRecorder.php", 'MediaWikiParserTest' => "$testDir/phpunit/includes/parser/MediaWikiParserTest.php", - 'ParserTest' => "$testDir/parser/parserTest.inc", - 'ParserTestResultNormalizer' => "$testDir/parser/parserTest.inc", - 'ParserTestParserHook' => "$testDir/parser/parserTestsParserHook.php", + 'NewParserTest' => "$testDir/phpunit/includes/parser/NewParserTest.php", + 'ParserTest' => "$testDir/parser/ParserTest.php", + 'ParserTestParserHook' => "$testDir/parser/ParserTestParserHook.php", + 'ParserTestResult' => "$testDir/parser/ParserTestResult.php", + 'ParserTestResultNormalizer' => "$testDir/parser/ParserTestResultNormalizer.php", + 'TestFileDataProvider' => "$testDir/parser/TestFileDataProvider.php", + 'TestFileIterator' => "$testDir/parser/TestFileIterator.php", + 'TestRecorder' => "$testDir/parser/TestRecorder.php", + 'TidySupport' => "$testDir/parser/TidySupport.php", # tests/phpunit/includes/site 'SiteTest' => "$testDir/phpunit/includes/site/SiteTest.php", diff --git a/tests/parser/DbTestPreviewer.php b/tests/parser/DbTestPreviewer.php new file mode 100644 index 000..2412254 --- /dev/null +++ b/tests/parser/DbTestPreviewer.php @@ -0,0 +1,228 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + * @ingroup Testing + */ + +class DbTestPreviewer extends TestRecorder { + protected $lb; // /< Database load balancer + protected $db; // /< Database connection to the main DB + protected $curRun; // /< run ID number for the current run + protected $prevRun; // /< run ID number for the previous run, if any + protected
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Fix font size for notifications dotdotdot menu in Monobook
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/307442 Change subject: Fix font size for notifications dotdotdot menu in Monobook .. Fix font size for notifications dotdotdot menu in Monobook Change-Id: Ie75ad192204a652885a82b0021340410b69864f4 --- M Resources.php A modules/styles/mw.echo.ui.overlay.monobook.less 2 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/42/307442/1 diff --git a/Resources.php b/Resources.php index 32afbe2..8f18715 100644 --- a/Resources.php +++ b/Resources.php @@ -105,6 +105,9 @@ 'minerva' => array( 'styles/mw.echo.ui.overlay.minerva.less', ), + 'monobook' => array( + 'styles/mw.echo.ui.overlay.monobook.less', + ) ), 'dependencies' => array( 'ext.echo.logger', diff --git a/modules/styles/mw.echo.ui.overlay.monobook.less b/modules/styles/mw.echo.ui.overlay.monobook.less new file mode 100644 index 000..c67c251 --- /dev/null +++ b/modules/styles/mw.echo.ui.overlay.monobook.less @@ -0,0 +1,8 @@ +.mw-echo-ui-overlay { + // We need the overlay to be adjusted for: + // #globalWrapper 127% + // .pBody 95% + // .portlet ul 95% + // .mw-echo-ui-notificationBadgeButtonPopupWidget > .oo-ui-popupWidget 0.875/0.75em + font-size: 1.27*0.95*0.95*0.875/0.75em; +} -- To view, visit https://gerrit.wikimedia.org/r/307442 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie75ad192204a652885a82b0021340410b69864f4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Catrope___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Flow[master]: Notification title fixes
jenkins-bot has submitted this change and it was merged. Change subject: Notification title fixes .. Notification title fixes - Make sure to display truncated titles for topics and board names - Change 'page' to 'topic' in the unwatch topic confirmation Bug: T132975 Change-Id: I7ad9dd5b4361f8a3914e9138ff1c603acb7aaeaa --- M i18n/en.json M includes/Notifications/FlowPresentationModel.php 2 files changed, 4 insertions(+), 3 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index 9b11510..65d7c3f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -19,7 +19,7 @@ "notification-dynamic-actions-flow-board-unwatch-confirmation-description": "This will not affect individual topics you are watching. You can watch [$2 this page] anytime.", "notification-dynamic-actions-flow-topic-unwatch": "Stop watching this topic", "notification-dynamic-actions-flow-topic-unwatch-confirmation": "You are no longer watching \"$1\"", - "notification-dynamic-actions-flow-topic-unwatch-confirmation-description": "You can watch [$2 this page] anytime.", + "notification-dynamic-actions-flow-topic-unwatch-confirmation-description": "You can watch [$2 this topic] anytime.", "flow-desc": "Workflow management system", "flow-talk-taken-over-comment": "/* This page has been converted into a Flow discussion board */", "log-name-flow": "Flow activity log", diff --git a/includes/Notifications/FlowPresentationModel.php b/includes/Notifications/FlowPresentationModel.php index 7cf837c..c510f98 100644 --- a/includes/Notifications/FlowPresentationModel.php +++ b/includes/Notifications/FlowPresentationModel.php @@ -173,6 +173,7 @@ $query = array( 'action' => 'unwatch' ); $link = $this->getWatchActionLink( $title ); $type = $isTopic ? 'topic' : 'board'; + $stringPageTitle = $isTopic ? $this->getTopicTitle() : $this->getTruncatedTitleText( $title ); if ( $this->isUserTalkPage() || !$this->getUser()->isWatched( $title ) ) { return null; @@ -185,7 +186,7 @@ 'title' => $this ->msg( 'notification-dynamic-actions-flow-' . $type . '-unwatch-confirmation' ) ->params( - $title->getPrefixedText(), + $stringPageTitle, $title->getFullURL() ) ->parse(), @@ -194,7 +195,7 @@ 'description' => $this ->msg( 'notification-dynamic-actions-flow-' . $type . '-unwatch-confirmation-description' ) ->params( - $title->getPrefixedText(), + $stringPageTitle, $title->getFullURL() ) ->parse(), -- To view, visit https://gerrit.wikimedia.org/r/307440 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7ad9dd5b4361f8a3914e9138ff1c603acb7aaeaa Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: MooeypooGerrit-Reviewer: Catrope Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: database: Clean up profiling code in DatabaseBase
jenkins-bot has submitted this change and it was merged. Change subject: database: Clean up profiling code in DatabaseBase .. database: Clean up profiling code in DatabaseBase This cuts down on conditionals and ScopedCallback use. Change-Id: Ie478c613b062e45120cdd626f9fb9de09594c638 --- M includes/db/Database.php M tests/phpunit/includes/db/DatabaseMysqlBaseTest.php M tests/phpunit/includes/db/DatabaseTestHelper.php 3 files changed, 16 insertions(+), 12 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/Database.php b/includes/db/Database.php index e07836b..874e9c4 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -201,6 +201,8 @@ /** @var int[] Prior mFlags values */ private $priorFlags = []; + /** @var Profiler */ + protected $profiler; /** @var TransactionProfiler */ protected $trxProfiler; @@ -320,10 +322,6 @@ * @return TransactionProfiler */ protected function getTransactionProfiler() { - if ( !$this->trxProfiler ) { - $this->trxProfiler = new TransactionProfiler(); - } - return $this->trxProfiler; } @@ -583,13 +581,17 @@ $this->mForeign = $foreign; - if ( isset( $params['trxProfiler'] ) ) { - $this->trxProfiler = $params['trxProfiler']; // override - } + $this->profiler = isset( $params['profiler'] ) + ? $params['profiler'] + : Profiler::instance(); // @TODO: remove global state + $this->trxProfiler = isset( $params['trxProfiler'] ) + ? $params['trxProfiler'] + : new TransactionProfiler(); if ( $user ) { $this->open( $server, $user, $password, $dbName ); } + } /** @@ -939,13 +941,10 @@ # Include query transaction state $queryProf .= $this->mTrxShortId ? " [TRX#{$this->mTrxShortId}]" : ""; - $profiler = Profiler::instance(); - if ( !( $profiler instanceof ProfilerStub ) ) { - $queryProfSection = $profiler->scopedProfileIn( $queryProf ); - } - $startTime = microtime( true ); + $this->profiler->profileIn( $queryProf ); $ret = $this->doQuery( $commentedSql ); + $this->profiler->profileOut( $queryProf ); $queryRuntime = microtime( true ) - $startTime; unset( $queryProfSection ); // profile out (if set) diff --git a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php index bc7542a..607f25c 100644 --- a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php +++ b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php @@ -31,6 +31,8 @@ class FakeDatabaseMysqlBase extends DatabaseMysqlBase { // From DatabaseBase function __construct() { + $this->profiler = new ProfilerStub( [] ); + $this->trxProfiler = new TransactionProfiler(); } protected function closeConnection() { diff --git a/tests/phpunit/includes/db/DatabaseTestHelper.php b/tests/phpunit/includes/db/DatabaseTestHelper.php index aa8b8e8..d6ca596 100644 --- a/tests/phpunit/includes/db/DatabaseTestHelper.php +++ b/tests/phpunit/includes/db/DatabaseTestHelper.php @@ -27,6 +27,9 @@ public function __construct( $testName ) { $this->testName = $testName; + + $this->profiler = new ProfilerStub( [] ); + $this->trxProfiler = new TransactionProfiler(); } /** -- To view, visit https://gerrit.wikimedia.org/r/307339 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie478c613b062e45120cdd626f9fb9de09594c638 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-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...VisualEditor[master]: Avoid master queries from getUserPermissionsErrors()
jenkins-bot has submitted this change and it was merged. Change subject: Avoid master queries from getUserPermissionsErrors() .. Avoid master queries from getUserPermissionsErrors() Change-Id: I4f5bcd7e89a78f8b52bce445a83deb1581ec1641 --- M ApiVisualEditor.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved Jforrester: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php index 799db49..d332825 100644 --- a/ApiVisualEditor.php +++ b/ApiVisualEditor.php @@ -468,7 +468,7 @@ } // Permission notice - $permErrors = $title->getUserPermissionsErrors( 'create', $user ); + $permErrors = $title->getUserPermissionsErrors( 'create', $user, 'quick' ); if ( $permErrors && !$title->exists() ) { $notices[] = $this->msg( 'permissionserrorstext-withaction', 1, $this->msg( 'action-createpage' ) -- To view, visit https://gerrit.wikimedia.org/r/307137 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f5bcd7e89a78f8b52bce445a83deb1581ec1641 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Alex Monk Gerrit-Reviewer: Catrope 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] labs...wikibugs2[master]: Add grrrit-wm project to #wikimedia-releng channel
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/307441 Change subject: Add grrrit-wm project to #wikimedia-releng channel .. Add grrrit-wm project to #wikimedia-releng channel Change-Id: I6ec4ca2834e9af0fa7f6a4ae928c2d184ff147ac --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 refs/changes/41/307441/1 -- To view, visit https://gerrit.wikimedia.org/r/307441 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ec4ca2834e9af0fa7f6a4ae928c2d184ff147ac Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master 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[master]: Notification title fixes
Mooeypoo has uploaded a new change for review. https://gerrit.wikimedia.org/r/307440 Change subject: Notification title fixes .. Notification title fixes - Make sure to display truncated titles for topics and board names - Change 'page' to 'topic' in the unwatch topic confirmation Bug: T132975 Change-Id: I7ad9dd5b4361f8a3914e9138ff1c603acb7aaeaa --- M i18n/en.json M includes/Notifications/FlowPresentationModel.php 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/40/307440/1 diff --git a/i18n/en.json b/i18n/en.json index 9b11510..65d7c3f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -19,7 +19,7 @@ "notification-dynamic-actions-flow-board-unwatch-confirmation-description": "This will not affect individual topics you are watching. You can watch [$2 this page] anytime.", "notification-dynamic-actions-flow-topic-unwatch": "Stop watching this topic", "notification-dynamic-actions-flow-topic-unwatch-confirmation": "You are no longer watching \"$1\"", - "notification-dynamic-actions-flow-topic-unwatch-confirmation-description": "You can watch [$2 this page] anytime.", + "notification-dynamic-actions-flow-topic-unwatch-confirmation-description": "You can watch [$2 this topic] anytime.", "flow-desc": "Workflow management system", "flow-talk-taken-over-comment": "/* This page has been converted into a Flow discussion board */", "log-name-flow": "Flow activity log", diff --git a/includes/Notifications/FlowPresentationModel.php b/includes/Notifications/FlowPresentationModel.php index 7cf837c..c510f98 100644 --- a/includes/Notifications/FlowPresentationModel.php +++ b/includes/Notifications/FlowPresentationModel.php @@ -173,6 +173,7 @@ $query = array( 'action' => 'unwatch' ); $link = $this->getWatchActionLink( $title ); $type = $isTopic ? 'topic' : 'board'; + $stringPageTitle = $isTopic ? $this->getTopicTitle() : $this->getTruncatedTitleText( $title ); if ( $this->isUserTalkPage() || !$this->getUser()->isWatched( $title ) ) { return null; @@ -185,7 +186,7 @@ 'title' => $this ->msg( 'notification-dynamic-actions-flow-' . $type . '-unwatch-confirmation' ) ->params( - $title->getPrefixedText(), + $stringPageTitle, $title->getFullURL() ) ->parse(), @@ -194,7 +195,7 @@ 'description' => $this ->msg( 'notification-dynamic-actions-flow-' . $type . '-unwatch-confirmation-description' ) ->params( - $title->getPrefixedText(), + $stringPageTitle, $title->getFullURL() ) ->parse(), -- To view, visit https://gerrit.wikimedia.org/r/307440 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ad9dd5b4361f8a3914e9138ff1c603acb7aaeaa Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow 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] labs...wikibugs2[master]: Add GerritBot project to #wikimedia-releng channel
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/307439 Change subject: Add GerritBot project to #wikimedia-releng channel .. Add GerritBot project to #wikimedia-releng channel Change-Id: I0aec8ad0f632684cc62e2279643a6c3a435718f0 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 refs/changes/39/307439/1 -- To view, visit https://gerrit.wikimedia.org/r/307439 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0aec8ad0f632684cc62e2279643a6c3a435718f0 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Paladox___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ORES[wmf/1.28.0-wmf.16]: Improvements to purging cache:
Ladsgroup has uploaded a new change for review. https://gerrit.wikimedia.org/r/307438 Change subject: Improvements to purging cache: .. Improvements to purging cache: - Do not clean based on oresc_rev, do it based on oresc_id - Clean when oresc_model doesn't exist in ores_model table Bug: T144216 Change-Id: I2799461543801bb85d4150dd34262a8503c91bfb --- M includes/Cache.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES refs/changes/38/307438/1 diff --git a/includes/Cache.php b/includes/Cache.php index e5baebf..2f2a38f 100644 --- a/includes/Cache.php +++ b/includes/Cache.php @@ -98,12 +98,12 @@ 'oresm_name' => $model, ]; if ( !$isEverything ) { - $conditions[] = 'oresm_is_current != 1'; + $conditions[] = '(oresm_is_current != 1 OR oresm_is_current IS NULL)'; } do { $ids = $dbr->selectFieldValues( $tables, - 'oresc_rev', + 'oresc_id', $conditions, __METHOD__, [ 'LIMIT' => $batchSize ], @@ -111,7 +111,7 @@ ); if ( $ids ) { $dbw->delete( 'ores_classification', - [ 'oresc_rev' => $ids ], + [ 'oresc_id' => $ids ], __METHOD__ ); wfWaitForSlaves(); -- To view, visit https://gerrit.wikimedia.org/r/307438 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2799461543801bb85d4150dd34262a8503c91bfb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ORES Gerrit-Branch: wmf/1.28.0-wmf.16 Gerrit-Owner: Ladsgroup___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...jouncebot[master]: Log error and privnotice messages
jenkins-bot has submitted this change and it was merged. Change subject: Log error and privnotice messages .. Log error and privnotice messages Make debugging irc connectivity issues easier by logging errors and private notices seen by the client. Bug: T144189 Change-Id: If5756ed9e26a349af6ea772c8bc75e242e89c41e --- M jouncebot.py 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Alex Monk: Looks good to me, approved jenkins-bot: Verified diff --git a/jouncebot.py b/jouncebot.py index d8bad9f..120f4a2 100755 --- a/jouncebot.py +++ b/jouncebot.py @@ -80,6 +80,12 @@ self.logger.info("Attempting to join channel %s", self.channel) conn.join(self.channel) +def on_error(self, conn, event): +self.logger.warning('%s: %s' % (event.source, event.arguments[0])) + +def on_privnotice(self, conn, event): +self.logger.warning('%s: %s' % (event.source, event.arguments[0])) + def on_join(self, conn, event): self.logger.info("Successfully joined channel %s" % event.target) -- To view, visit https://gerrit.wikimedia.org/r/307315 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If5756ed9e26a349af6ea772c8bc75e242e89c41e Gerrit-PatchSet: 2 Gerrit-Project: wikimedia/bots/jouncebot Gerrit-Branch: master Gerrit-Owner: BryanDavisGerrit-Reviewer: Alex Monk Gerrit-Reviewer: Greg Grossmeier 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]: ores: Update thresholds
Ladsgroup has uploaded a new change for review. https://gerrit.wikimedia.org/r/307437 Change subject: ores: Update thresholds .. ores: Update thresholds Bug: T144101 Change-Id: I4c2ef2b0b27681cd585a10e4bbc49d43db50a968 --- M wmf-config/InitialiseSettings.php 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/37/307437/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index dfa30ce..9a514e3 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -17029,14 +17029,14 @@ ], 'wgOresDamagingThresholds' => [ 'default' => [ 'hard' => 0.5, 'soft' => 0.7 ], - 'fawiki' => [ 'hard' => 0.12, 'soft' => 0.45 ], // T130211 - 'wikidatawiki' => [ 'hard' => 0.8, 'soft' => 0.96 ], // T130212 - 'nlwiki' => [ 'hard' => 0.3, 'soft' => 0.72 ], // T139432 - 'ruwiki' => [ 'hard' => 0.44, 'soft' => 0.69 ], // T139541 - 'ptwiki' => [ 'hard' => 0.22, 'soft' => 0.48 ], // T139692 - 'trwiki' => [ 'hard' => 0.22, 'soft' => 0.49 ], // T139992 - 'plwiki' => [ 'hard' => 0.11, 'soft' => 0.40 ], // T140005 - 'enwiki' => [ 'hard' => 0.14, 'soft' => 0.43 ], // T140003 + 'fawiki' => [ 'hard' => 0.07, 'soft' => 0.37 ], // T130211 + 'wikidatawiki' => [ 'hard' => 0.92, 'soft' => 0.97 ], // T130212 + 'nlwiki' => [ 'hard' => 0.39, 'soft' => 0.75 ], // T139432 + 'ruwiki' => [ 'hard' => 0.50, 'soft' => 0.73 ], // T139541 + 'ptwiki' => [ 'hard' => 0.24, 'soft' => 0.57 ], // T139692 + 'trwiki' => [ 'hard' => 0.20, 'soft' => 0.58 ], // T139992 + 'plwiki' => [ 'hard' => 0.19, 'soft' => 0.41 ], // T140005 + 'enwiki' => [ 'hard' => 0.17, 'soft' => 0.49 ], // T140003 ], 'wgOresEnabledNamespaces' => [ 'default' => [], -- To view, visit https://gerrit.wikimedia.org/r/307437 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4c2ef2b0b27681cd585a10e4bbc49d43db50a968 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Ladsgroup___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Horizon puppet panel: Clean up config and defaults
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/307436 Change subject: Horizon puppet panel: Clean up config and defaults .. Horizon puppet panel: Clean up config and defaults - Include PUPPET_CONFIG_BACKEND in local_settings.py - Use reasonable eqiad-local settings as setting defaults Change-Id: Ib8d8f1d269069cc56a16f385bcca9183f9f3ecc4 --- M modules/openstack/files/liberty/horizon/puppettab/puppet_config.py M modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py M modules/openstack/templates/liberty/horizon/local_settings.py.erb M modules/openstack/templates/mitaka/horizon/local_settings.py.erb 4 files changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/36/307436/1 diff --git a/modules/openstack/files/liberty/horizon/puppettab/puppet_config.py b/modules/openstack/files/liberty/horizon/puppettab/puppet_config.py index 4f1d6e4..8aa6bbc 100644 --- a/modules/openstack/files/liberty/horizon/puppettab/puppet_config.py +++ b/modules/openstack/files/liberty/horizon/puppettab/puppet_config.py @@ -33,7 +33,7 @@ self.tenant_id = tenant_id self.apiurl = getattr(settings, "PUPPET_CONFIG_BACKEND", - "http://labtestcontrol2001.wikimedia.org:8100/v1; + "http://labcontrol1001.wikimedia.org:8100/v1; ) self.refresh() diff --git a/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py b/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py index 45cffb4..066370c 100644 --- a/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py +++ b/modules/openstack/files/liberty/horizon/puppettab/puppet_roles.py @@ -72,7 +72,7 @@ if not roles: apiurl = getattr(settings, "PUPPETMASTER_API", - "https://labtestcontrol2001.wikimedia.org:8140/puppet; + "https://labcontrol1001.wikimedia.org:8140/puppet; ) roleurl = "%s/resource_types/role" % apiurl diff --git a/modules/openstack/templates/liberty/horizon/local_settings.py.erb b/modules/openstack/templates/liberty/horizon/local_settings.py.erb index b985ef7..62992b7 100644 --- a/modules/openstack/templates/liberty/horizon/local_settings.py.erb +++ b/modules/openstack/templates/liberty/horizon/local_settings.py.erb @@ -538,3 +538,4 @@ CONSOLE_TYPE = False PUPPETMASTER_API = "https://<%= @novaconfig['controller_hostname'] %>:8140/puppet" +PUPPET_CONFIG_BACKEND = "https://<%= @novaconfig['controller_hostname'] %>:8100/v1" diff --git a/modules/openstack/templates/mitaka/horizon/local_settings.py.erb b/modules/openstack/templates/mitaka/horizon/local_settings.py.erb index 2572dc3..62992b7 100644 --- a/modules/openstack/templates/mitaka/horizon/local_settings.py.erb +++ b/modules/openstack/templates/mitaka/horizon/local_settings.py.erb @@ -536,3 +536,6 @@ # Disable instance consoles for Horizon users CONSOLE_TYPE = False + +PUPPETMASTER_API = "https://<%= @novaconfig['controller_hostname'] %>:8140/puppet" +PUPPET_CONFIG_BACKEND = "https://<%= @novaconfig['controller_hostname'] %>:8100/v1" -- To view, visit https://gerrit.wikimedia.org/r/307436 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8d8f1d269069cc56a16f385bcca9183f9f3ecc4 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: End lazy loading reference experiments
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/307435 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(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/35/307435/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index dfa30ce..e85760e 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -14435,21 +14435,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: newchange Gerrit-Change-Id: I2055319fc76a947f86c4da66fb90c7916eb23f7b Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Jdlrobson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Don't remove selected content in beforePaste
Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/307434 Change subject: Don't remove selected content in beforePaste .. Don't remove selected content in beforePaste We now use SurfaceFragment#insertContent/Document in afterPaste which does a better job of preserving annotations. Bug: T121895 Change-Id: I1e1fee240d9ed7513ab56be163fd772c7aef30b5 --- M src/ce/ve.ce.Surface.js M tests/ce/ve.ce.Surface.test.js 2 files changed, 82 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor refs/changes/34/307434/1 diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js index 0f5a114..058bb2f 100644 --- a/src/ce/ve.ce.Surface.js +++ b/src/ce/ve.ce.Surface.js @@ -1756,7 +1756,7 @@ * @param {jQuery.Event} e Paste event */ ve.ce.Surface.prototype.beforePaste = function ( e ) { - var range, node, nodeRange, contextElement, nativeRange, + var range, startNode, endNode, contextElement, nativeRange, context, leftText, rightText, textNode, textStart, textEnd, selection = this.getModel().getSelection(), clipboardData = e.originalEvent.clipboardData, @@ -1765,11 +1765,8 @@ documentModel = surfaceModel.getDocument(); if ( selection instanceof ve.dm.LinearSelection ) { - // Pasting over a linear selection? Remove first. - fragment.removeContent(); range = fragment.getSelection().getRange(); } else if ( selection instanceof ve.dm.TableSelection ) { - // Selection removal is handled in after paste for tables (depends on pasted content) range = new ve.Range( selection.getRanges()[ 0 ].start ); } else { e.preventDefault(); @@ -1798,27 +1795,27 @@ this.$pasteTarget.empty(); // Get node from cursor position - node = documentModel.getBranchNodeFromOffset( range.start ); - if ( node.canContainContent() ) { + startNode = documentModel.getBranchNodeFromOffset( range.start ); + if ( startNode.canContainContent() ) { // If this is a content branch node, then add its DM HTML // to the paste target to give CE some context. textStart = textEnd = 0; - nodeRange = node.getRange(); - contextElement = node.getClonedElement(); + contextElement = startNode.getClonedElement(); // Make sure that context doesn't have any attributes that might confuse // the importantElement check in afterPaste. $( documentModel.getStore().value( contextElement.originalDomElementsIndex ) ).removeAttr( 'id typeof rel' ); context = [ contextElement ]; // If there is content to the left of the cursor, put a placeholder // character to the left of the cursor - if ( range.start > nodeRange.start ) { + if ( range.start > startNode.getRange().start ) { leftText = '☀'; context.push( leftText ); textStart = textEnd = 1; } // If there is content to the right of the cursor, put a placeholder // character to the right of the cursor - if ( range.end < nodeRange.end ) { + endNode = documentModel.getBranchNodeFromOffset( range.end ); + if ( range.end < endNode.getRange().end ) { rightText = '☂'; context.push( rightText ); } diff --git a/tests/ce/ve.ce.Surface.test.js b/tests/ce/ve.ce.Surface.test.js index 6305a53..10cbd35 100644 --- a/tests/ce/ve.ce.Surface.test.js +++ b/tests/ce/ve.ce.Surface.test.js @@ -1377,6 +1377,32 @@ msg: 'Text into paragraph' }, { + rangeOrSelection: new ve.Range( 4, 5 ), + pasteHtml: 'Bar', + expectedRangeOrSelection: new ve.Range( 7 ), + expectedOps: [ + [ + { type: 'retain', length: 4 }, + { + type: 'replace', + insert: [], + remove: [ 'o' ] + }, + { type: 'retain', length: docLen - 5 } + ], + [ + { type: 'retain', length: 4 }, +
[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 cbb5be4 Import info from pending DB, not AMQ 82f2357 Check for duplicates before re-queueing MISSING_PREDECESSOR Change-Id: Ic2fc86495133e6006810ba09d01ba4352072b1aa --- D sites/all/modules/queue2civicrm/tests/includes/Message.php D sites/all/modules/queue2civicrm/tests/phpunit/ProcessMessageTest.php 2 files changed, 0 insertions(+), 511 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/queue2civicrm/tests/includes/Message.php b/sites/all/modules/queue2civicrm/tests/includes/Message.php deleted file mode 100644 index 0e0b00a..000 --- a/sites/all/modules/queue2civicrm/tests/includes/Message.php +++ /dev/null @@ -1,181 +0,0 @@ -<<< HEAD (d04054 Update vendor submodule) -=== -data = $this->defaults; -$this->headers = array(); -$this->set( $values ); -} - -function set( $values ) { -if ( is_array( $values ) ) { -$this->data = $values + $this->data; -} - -$this->body = json_encode( $this->data ); -} - -function setHeaders( $values ) { -if ( is_array( $values ) ) { -$this->headers = array_merge( $this->headers, $values ); -} -} - -function getBody() { -return $this->data; -} - -function getHeaders() { -return $this->headers; -} - -function loadDefaults( $name ) { -if ( !$this->defaults ) { -$path = __DIR__ . "/../data/{$name}.json"; -$this->defaults = json_decode( file_get_contents( $path ), true ); -} -} - -/** - * Generates random data for queue and donation insertion testing - */ -public static function generateRandom() { -//language codes -$lang = array( 'en', 'de', 'fr' ); - -$currency_codes = array( 'USD', 'GBP', 'EUR', 'ILS' ); -shuffle( $currency_codes ); -$currency = ( mt_rand( 0, 1 ) ) ? 'USD' : $currency_codes[0]; - -$message = array( -'contribution_tracking_id' => '', -'optout' => mt_rand( 0, 1 ), -'anonymous' => mt_rand( 0, 1 ), -'comment' => mt_rand(), -'utm_source' => mt_rand(), -'utm_medium' => mt_rand(), -'utm_campaign' => mt_rand(), -'language' => $lang[array_rand( $lang )], -'email' => mt_rand() . '@example.com', -'first_name' => mt_rand(), -'middle_name' => mt_rand(), -'last_name' => mt_rand(), -'street_address' => mt_rand(), -'supplemental_address_1' => '', -'city' => 'San Francisco', -'state_province' => 'CA', -'country' => 'USA', -'countryID' => 'US', -'postal_code' => mt_rand( 2801, 9 ), -'gateway' => 'insert_test', -'gateway_txn_id' => mt_rand(), -'response' => mt_rand(), -'currency' => $currency, -'original_currency' => $currency_codes[0], -'original_gross' => mt_rand( 0, 1 ) / 100, -'fee' => '0', -'gross' => mt_rand( 0, 1 ) / 100, -'net' => mt_rand( 0, 1 ) / 100, -'date' => date( 'r' ), //time(), -); -return $message; -} -} - -class TransactionMessage extends Message { -protected $txn_id_key = 'gateway_txn_id'; - -function __construct( $values = array() ) { -$this->loadDefaults( "donation" ); - -parent::__construct( array( -$this->txn_id_key => mt_rand(), -'order_id' => mt_rand(), -) + $values ); - -$this->setHeaders( array( -"persistent" => 'true', -// FIXME: this might indicate a key error in our application code. -"correlation-id" => "{$this->data['gateway']}-{$this->data[$this->txn_id_key]}", -"JMSCorrelationID" => "{$this->data['gateway']}-{$this->data[$this->txn_id_key]}", -) ); -} - -function getGateway() { -return $this->data['gateway']; -} - -function getGatewayTxnId() { -return $this->data[$this->txn_id_key]; -} - -function get( $key ) { -return $this->data[$key]; -} -} - -class RefundMessage extends TransactionMessage { -function __construct( $values = array() ) { -$this->loadDefaults( "refund" ); - -$this->txn_id_key = 'gateway_refund_id'; - -parent::__construct( $values ); -} -} - -class RecurringPaymentMessage extends TransactionMessage { -function __construct( $values = array() ) { -$this->loadDefaults( "recurring_payment" ); - -$this->txn_id_key = 'txn_id'; - -parent::__construct( $values ); -} -} - -class
[MediaWiki-commits] [Gerrit] wikimedia...tools[master]: Make Paypal audit mirror to Redis
XenoRyet has uploaded a new change for review. https://gerrit.wikimedia.org/r/307433 Change subject: Make Paypal audit mirror to Redis .. Make Paypal audit mirror to Redis Add a new wrapper for talking to redis, and have the paypal parser push to redis as well as stomp. Bug: T130308 Change-Id: I6f16814234ac1a492d8cbdbe236d8d936f8122e3 --- M audit/paypal/SarFile.py M audit/paypal/TrrFile.py A queue/redis_wrap.py 3 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools refs/changes/33/307433/1 diff --git a/audit/paypal/SarFile.py b/audit/paypal/SarFile.py index f5f77ef..0c97753 100644 --- a/audit/paypal/SarFile.py +++ b/audit/paypal/SarFile.py @@ -6,6 +6,7 @@ from process.logging import Logger as log from process.globals import config from queue.stomp_wrap import Stomp +from queue.redis_wrap import Redis import ppreport from civicrm.civicrm import Civicrm @@ -116,3 +117,8 @@ self.stomp = Stomp() self.stomp.send('recurring', msg) + +if not self.redis: +self.redis = Redis() + +self.redis.send('recurring', msg) diff --git a/audit/paypal/TrrFile.py b/audit/paypal/TrrFile.py index 42db7f8..8527116 100644 --- a/audit/paypal/TrrFile.py +++ b/audit/paypal/TrrFile.py @@ -8,6 +8,7 @@ from process.logging import Logger as log from process.globals import config from queue.stomp_wrap import Stomp +from queue.redis_wrap import Redis import ppreport from civicrm.civicrm import Civicrm @@ -16,6 +17,7 @@ class TrrFile(object): VERSION = [4, 8] stomp = None +redis = None # FIXME: these are version 8 headers, we would fail on multi-part v4 files... column_headers = [ "Column Type", @@ -193,6 +195,11 @@ self.stomp.send(queue, msg) +if not self.redis: +self.redis = Redis() + +self.redis.send(queue, msg) + def normalize_recurring(self, msg): 'Synthesize a raw PayPal message' diff --git a/queue/redis_wrap.py b/queue/redis_wrap.py new file mode 100644 index 000..319851c --- /dev/null +++ b/queue/redis_wrap.py @@ -0,0 +1,23 @@ +from process.globals import config +from process.logging import Logger as log +import process.version_stamp + +import json +import redis + +class Redis(object): + +conn = None + +def __init__(self): +if not config.no_effect: +self.conn = redis.Redis(config.redis.server, config.redis.port) + + +def send(self, queue, msg): + +if config.no_effect: +log.info("not queueing message. " + json.dumps(msg)) +return + +self.conn.rpush(queue, msg) \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/307433 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6f16814234ac1a492d8cbdbe236d8d936f8122e3 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/tools Gerrit-Branch: master Gerrit-Owner: XenoRyet___ 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/307432 Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment cbb5be4 Import info from pending DB, not AMQ 82f2357 Check for duplicates before re-queueing MISSING_PREDECESSOR Change-Id: Ic2fc86495133e6006810ba09d01ba4352072b1aa --- D sites/all/modules/queue2civicrm/tests/includes/Message.php D sites/all/modules/queue2civicrm/tests/phpunit/ProcessMessageTest.php 2 files changed, 0 insertions(+), 511 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/32/307432/1 diff --git a/sites/all/modules/queue2civicrm/tests/includes/Message.php b/sites/all/modules/queue2civicrm/tests/includes/Message.php deleted file mode 100644 index 0e0b00a..000 --- a/sites/all/modules/queue2civicrm/tests/includes/Message.php +++ /dev/null @@ -1,181 +0,0 @@ -<<< HEAD (d04054 Update vendor submodule) -=== -data = $this->defaults; -$this->headers = array(); -$this->set( $values ); -} - -function set( $values ) { -if ( is_array( $values ) ) { -$this->data = $values + $this->data; -} - -$this->body = json_encode( $this->data ); -} - -function setHeaders( $values ) { -if ( is_array( $values ) ) { -$this->headers = array_merge( $this->headers, $values ); -} -} - -function getBody() { -return $this->data; -} - -function getHeaders() { -return $this->headers; -} - -function loadDefaults( $name ) { -if ( !$this->defaults ) { -$path = __DIR__ . "/../data/{$name}.json"; -$this->defaults = json_decode( file_get_contents( $path ), true ); -} -} - -/** - * Generates random data for queue and donation insertion testing - */ -public static function generateRandom() { -//language codes -$lang = array( 'en', 'de', 'fr' ); - -$currency_codes = array( 'USD', 'GBP', 'EUR', 'ILS' ); -shuffle( $currency_codes ); -$currency = ( mt_rand( 0, 1 ) ) ? 'USD' : $currency_codes[0]; - -$message = array( -'contribution_tracking_id' => '', -'optout' => mt_rand( 0, 1 ), -'anonymous' => mt_rand( 0, 1 ), -'comment' => mt_rand(), -'utm_source' => mt_rand(), -'utm_medium' => mt_rand(), -'utm_campaign' => mt_rand(), -'language' => $lang[array_rand( $lang )], -'email' => mt_rand() . '@example.com', -'first_name' => mt_rand(), -'middle_name' => mt_rand(), -'last_name' => mt_rand(), -'street_address' => mt_rand(), -'supplemental_address_1' => '', -'city' => 'San Francisco', -'state_province' => 'CA', -'country' => 'USA', -'countryID' => 'US', -'postal_code' => mt_rand( 2801, 9 ), -'gateway' => 'insert_test', -'gateway_txn_id' => mt_rand(), -'response' => mt_rand(), -'currency' => $currency, -'original_currency' => $currency_codes[0], -'original_gross' => mt_rand( 0, 1 ) / 100, -'fee' => '0', -'gross' => mt_rand( 0, 1 ) / 100, -'net' => mt_rand( 0, 1 ) / 100, -'date' => date( 'r' ), //time(), -); -return $message; -} -} - -class TransactionMessage extends Message { -protected $txn_id_key = 'gateway_txn_id'; - -function __construct( $values = array() ) { -$this->loadDefaults( "donation" ); - -parent::__construct( array( -$this->txn_id_key => mt_rand(), -'order_id' => mt_rand(), -) + $values ); - -$this->setHeaders( array( -"persistent" => 'true', -// FIXME: this might indicate a key error in our application code. -"correlation-id" => "{$this->data['gateway']}-{$this->data[$this->txn_id_key]}", -"JMSCorrelationID" => "{$this->data['gateway']}-{$this->data[$this->txn_id_key]}", -) ); -} - -function getGateway() { -return $this->data['gateway']; -} - -function getGatewayTxnId() { -return $this->data[$this->txn_id_key]; -} - -function get( $key ) { -return $this->data[$key]; -} -} - -class RefundMessage extends TransactionMessage { -function __construct( $values = array() ) { -$this->loadDefaults( "refund" ); - -$this->txn_id_key = 'gateway_refund_id'; - -parent::__construct( $values ); -} -} - -class RecurringPaymentMessage extends TransactionMessage { -function __construct( $values = array() ) { -$this->loadDefaults( "recurring_payment" ); - -$this->txn_id_key = 'txn_id'; - -
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Check for duplicates before re-queueing MISSING_PREDECESSOR
Ejegg has submitted this change and it was merged. Change subject: Check for duplicates before re-queueing MISSING_PREDECESSOR .. Check for duplicates before re-queueing MISSING_PREDECESSOR When we've got a missing pending db entry, don't re-queue the donation if it's already been added to Civi. Bug: T122641 Change-Id: Ic3c21cef7245de0e8b48cbc900ba1381549e0064 --- M sites/all/modules/queue2civicrm/queue2civicrm.module 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/queue2civicrm/queue2civicrm.module b/sites/all/modules/queue2civicrm/queue2civicrm.module index 9d5ece8..7833ec3 100644 --- a/sites/all/modules/queue2civicrm/queue2civicrm.module +++ b/sites/all/modules/queue2civicrm/queue2civicrm.module @@ -262,6 +262,16 @@ if ( isset( $msg['completion_message_id'] ) ) { $dbEntry = queue2civicrm_update_from_pending_db( $msg ); if ( !$dbEntry ) { +// If the contribution has already been imported, we don't want +// to re-queue this message, but drop it entirely. +if ( wmf_civicrm_get_contributions_from_gateway_id( +$msg['gateway'], $msg['gateway_txn_id'] +) ) { +throw new WmfException( +'DUPLICATE_CONTRIBUTION', +'Contribution already exists. Ignoring message.' +); +} // If the pending db row is missing, throw an exception that // tells dequeue_loop to requeue the incomplete message with a delay $errorMessage = "Message {$msg['gateway']}-{$msg['gateway_txn_id']} " . -- To view, visit https://gerrit.wikimedia.org/r/305577 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3c21cef7245de0e8b48cbc900ba1381549e0064 Gerrit-PatchSet: 2 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: On public wikis, show "Publish" rather than "Save" on edit p...
jenkins-bot has submitted this change and it was merged. Change subject: On public wikis, show "Publish" rather than "Save" on edit pages .. On public wikis, show "Publish" rather than "Save" on edit pages For Wikinewses, this is (at least for now) not going ahead due to conflicts with the name of the community-driven article-finalisation process. Bug: T131132 Depends-On: I4fbe54876095378a476399bf5e336c8df3e91e14 Change-Id: Ib7f544637017b485ad605e128c8eeb0946538c45 --- M wmf-config/InitialiseSettings.php 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 158d234..dfa30ce 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -14073,6 +14073,15 @@ 'stewardwiki' => true, ], +// Whether to show "Publish" rather than "Save" on the edit page (and related circumstances) +// This should be set to true for all public WMF wikis, and any changes should be discussed +// with Editing before they are done due to the legal implications. +'wgEditSubmitButtonLabelPublish' => [ + 'default' => true, // T131132 + 'private' => false, // Private wikis are not public + 'wikinews' => false,// Done in local {{int:Copyrightwarning}}s instead. +], + 'wmgCheckUserForceSummary' => [ 'default' => true, // T73457 ], -- To view, visit https://gerrit.wikimedia.org/r/306303 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib7f544637017b485ad605e128c8eeb0946538c45 Gerrit-PatchSet: 6 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: JforresterGerrit-Reviewer: Catrope Gerrit-Reviewer: Chad Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Jforrester Gerrit-Reviewer: MZMcBride 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]: prometheus: add aggregation rules for ops
Filippo Giunchedi has uploaded a new change for review. https://gerrit.wikimedia.org/r/307310 Change subject: prometheus: add aggregation rules for ops .. prometheus: add aggregation rules for ops Change-Id: I1fd1ea3e590651f0259fda82340ad62e7d365545 --- A modules/role/files/prometheus/rules_ops.conf M modules/role/manifests/prometheus/ops.pp 2 files changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/10/307310/1 diff --git a/modules/role/files/prometheus/rules_ops.conf b/modules/role/files/prometheus/rules_ops.conf new file mode 100644 index 000..2f81ef3 --- /dev/null +++ b/modules/role/files/prometheus/rules_ops.conf @@ -0,0 +1,17 @@ +# https://prometheus.io/docs/practices/rules/ + +instance:node_cpu:count = count(node_cpu{mode="idle",job="node"}) by (instance, cluster) + +cluster_device:network_transmit_bytes:rate5m = sum(rate(node_network_transmit_bytes{job="node"}[5m])) by (cluster,device) +cluster_device:network_receive_bytes:rate5m = sum(rate(node_network_receive_bytes{job="node"}[5m])) by (cluster,device) + +cluster_mode:cpu:rate5m = sum(rate(node_cpu{job="node"}[5m])) by (cluster, mode) + +cluster:memory_MemTotal:sum = sum(node_memory_MemTotal{job="node"}) by (cluster) +cluster:memory_MemCached:sum = sum(node_memory_MemCached{job="node"}) by (cluster) +cluster:memory_MemActive:sum = sum(node_memory_MemActive{job="node"}) by (cluster) + +cluster:load1:sum = sum(node_load1{job="node"}) by (cluster) +cluster:cpu:sum = sum(instance:node_cpu:count) by (cluster) +cluster:up:sum = sum(up{job="node"}) by (cluster) +cluster:up:count = count(up{job="node"}) by (cluster) diff --git a/modules/role/manifests/prometheus/ops.pp b/modules/role/manifests/prometheus/ops.pp index fbb3d11..388316e 100644 --- a/modules/role/manifests/prometheus/ops.pp +++ b/modules/role/manifests/prometheus/ops.pp @@ -4,6 +4,7 @@ include base::firewall $targets_path = '/srv/prometheus/ops/targets' +$rules_path = '/srv/prometheus/ops/rules' # Add one job for each of mysql 'group' (i.e. their broad function) # Each job will look for new files matching the glob and load the job @@ -89,4 +90,8 @@ file { "${targets_path}/mysql-labs_${::site}.yaml": source => "puppet:///modules/role/prometheus/mysql-labs_${::site}.yaml", } + +file { "${rules_path}/rules_ops.conf": +source => 'puppet:///modules/role/prometheus/rules_ops.conf', +} } -- To view, visit https://gerrit.wikimedia.org/r/307310 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1fd1ea3e590651f0259fda82340ad62e7d365545 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Filippo Giunchedi___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move HTTP 304 check from performRequest to ViewAction
jenkins-bot has submitted this change and it was merged. Change subject: Move HTTP 304 check from performRequest to ViewAction .. Move HTTP 304 check from performRequest to ViewAction * Follow-up to 8b141886edebc * The method is now called after the setCdnMaxage() call in performAction. * Allow any CDN urls for the title now, check $wgDebugToolbar, and allows caching redirects. The multi-step redirect case does not cache however, for simplicity. * Removed now-unused code in Article that calculated $timestamp. Change-Id: Ic4f4e3a79d7d386c2f15ca5b11dddf5c57ff9e9f --- M includes/MediaWiki.php M includes/actions/ViewAction.php M includes/page/Article.php 3 files changed, 34 insertions(+), 34 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 2a00900..77ac76a 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -286,16 +286,6 @@ // may still be a wikipage redirect to another article or URL. $article = $this->initializeArticle(); if ( is_object( $article ) ) { - $url = $request->getFullRequestURL(); // requested URL - if ( - $request->getMethod() === 'GET' && - $url === $article->getTitle()->getCanonicalURL() && - $article->checkTouched() && - $output->checkLastModified( $article->getTouched() ) - ) { - wfDebug( __METHOD__ . ": done 304\n" ); - return; - } $this->performAction( $article, $requestTitle ); } elseif ( is_string( $article ) ) { $output->redirect( $article ); diff --git a/includes/actions/ViewAction.php b/includes/actions/ViewAction.php index 3a24565..55507f5 100644 --- a/includes/actions/ViewAction.php +++ b/includes/actions/ViewAction.php @@ -41,6 +41,30 @@ } public function show() { + $config = $this->context->getConfig(); + + if ( + $config->get( 'DebugToolbar' ) == false && // don't let this get stuck on pages + $this->page->checkTouched() // page exists and is not a redirect + ) { + // Include any redirect in the last-modified calculation + $redirFromTitle = $this->page->getRedirectedFrom(); + if ( !$redirFromTitle ) { + $touched = $this->page->getTouched(); + } elseif ( $config->get( 'MaxRedirects' ) <= 1 ) { + $touched = max( $this->page->getTouched(), $redirFromTitle->getTouched() ); + } else { + // Don't bother following the chain and getting the max mtime + $touched = null; + } + + // Send HTTP 304 if the IMS matches or otherwise set expiry/last-modified headers + if ( $touched && $this->getOutput()->checkLastModified( $touched ) ) { + wfDebug( __METHOD__ . ": done 304\n" ); + return; + } + } + $this->page->view(); } } diff --git a/includes/page/Article.php b/includes/page/Article.php index b3a97f7..e299f7e 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -150,6 +150,15 @@ } /** +* Get the page this view was redirected from +* @return Title|null +* @since 1.28 +*/ + public function getRedirectedFrom() { + return $this->mRedirectedFrom; + } + + /** * Tell the page view functions that this view was redirected * from another page on the wiki. * @param Title $from @@ -467,7 +476,7 @@ * page of the given title. */ public function view() { - global $wgUseFileCache, $wgDebugToolbar, $wgMaxRedirects; + global $wgUseFileCache, $wgDebugToolbar; # Get variables from query string # As side effect this will load the revision and update the title @@ -520,29 +529,6 @@ # Try client and file cache if ( !$wgDebugToolbar && $oldid === 0 && $this->mPage->checkTouched() ) { - # Use the
[MediaWiki-commits] [Gerrit] mediawiki...PerformanceInspector[master]: Skip data: images and always use Number when getting humanSi...
jenkins-bot has submitted this change and it was merged. Change subject: Skip data: images and always use Number when getting humanSize bytes .. Skip data: images and always use Number when getting humanSize bytes Deploying on beta.wmflabs uncovered two bugs: We didn't skip getting the size for inline images and we tried converting the size as a String and not number. I'm not sure why I didn't get the second error on my local though. Change-Id: I86f1a40f582a1d481dc40464844362622e2743b1 --- M modules/collectors/ext.PerformanceInspector.imagesize.js 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/collectors/ext.PerformanceInspector.imagesize.js b/modules/collectors/ext.PerformanceInspector.imagesize.js index 2eb59cf..6557875 100644 --- a/modules/collectors/ext.PerformanceInspector.imagesize.js +++ b/modules/collectors/ext.PerformanceInspector.imagesize.js @@ -48,7 +48,7 @@ } for ( i = 0; i < img.length; i++ ) { - if ( img[ i ].currentSrc ) { + if ( img[ i ].currentSrc && img[ i ].currentSrc.indexOf( 'data:image' ) === -1 ) { promises.push( fetchContent( img[ i ].currentSrc ) ); } } @@ -60,7 +60,7 @@ images.push( { name: getImageName( values[ i ].url.substring( values[ i ].url.lastIndexOf( '/' ) + 1 ) ), url: values[ i ].url, - size: humanSize( values[ i ].contentLength ), + size: humanSize( Number( values[ i ].contentLength ) ), warning: values[ i ].contentLength > warningLimitInBytes ? true : false } ); -- To view, visit https://gerrit.wikimedia.org/r/307268 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I86f1a40f582a1d481dc40464844362622e2743b1 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/PerformanceInspector Gerrit-Branch: master Gerrit-Owner: PhedenskogGerrit-Reviewer: Krinkle Gerrit-Reviewer: Phedenskog Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Override white background on hover for links in Monobook
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/307431 Change subject: Override white background on hover for links in Monobook .. Override white background on hover for links in Monobook p-personal links have a white background on hover, and links inside the notifications popup were inheriting that CSS rule. Bug: T144063 Change-Id: I3868e418ab8cce8e5ff6f7cc10e042907cb1e8df --- M modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/31/307431/1 diff --git a/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less b/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less index 1cef525..c77317c 100644 --- a/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less +++ b/modules/styles/mw.echo.ui.NotificationBadgeWidget.monobook.less @@ -6,6 +6,9 @@ &, .oo-ui-popupWidget a.oo-ui-buttonElement-button { color: #333; } + a { + background-color: initial; + } // Badge > .oo-ui-buttonElement-button { &:hover { -- To view, visit https://gerrit.wikimedia.org/r/307431 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3868e418ab8cce8e5ff6f7cc10e042907cb1e8df Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Catrope___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: rabbitmq: add rabbitmqadmin for control via mgmt plugin
Rush has submitted this change and it was merged. Change subject: rabbitmq: add rabbitmqadmin for control via mgmt plugin .. rabbitmq: add rabbitmqadmin for control via mgmt plugin Change-Id: I49f48fccb48ff27b802f166678f749d85dd10d81 --- A modules/openstack/files/rabbitmq/rabbitmqadmin M modules/openstack/manifests/queue_server.pp 2 files changed, 974 insertions(+), 0 deletions(-) Approvals: Rush: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/openstack/files/rabbitmq/rabbitmqadmin b/modules/openstack/files/rabbitmq/rabbitmqadmin new file mode 100644 index 000..2f5e255 --- /dev/null +++ b/modules/openstack/files/rabbitmq/rabbitmqadmin @@ -0,0 +1,965 @@ +#!/usr/bin/env python + +# The contents of this file are subject to the Mozilla Public License +# Version 1.1 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations +# under the License. +# +# The Original Code is RabbitMQ Management Plugin. +# +# The Initial Developer of the Original Code is GoPivotal, Inc. +# Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved. + +import sys +if sys.version_info[0] < 2 or (sys.version_info[0] == 2 and sys.version_info[1] < 6): +print("Sorry, rabbitmqadmin requires at least Python 2.6.") +sys.exit(1) + +from optparse import OptionParser, TitledHelpFormatter +import urllib +import base64 +import json +import os +import socket + +if sys.version_info[0] == 2: +from ConfigParser import ConfigParser, NoSectionError +import httplib +import urlparse +from urllib import quote_plus +def b64(s): +return base64.b64encode(s) +else: +from configparser import ConfigParser, NoSectionError +import http.client as httplib +import urllib.parse as urlparse +from urllib.parse import quote_plus +def b64(s): +return base64.b64encode(s.encode('utf-8')).decode('utf-8') + +VERSION = '%%VSN%%' + +LISTABLE = {'connections': {'vhost': False, 'cols': ['name','user','channels']}, +'channels':{'vhost': False, 'cols': ['name', 'user']}, +'consumers': {'vhost': True}, +'exchanges': {'vhost': True, 'cols': ['name', 'type']}, +'queues': {'vhost': True, 'cols': ['name', 'messages']}, +'bindings':{'vhost': True, 'cols': ['source', 'destination', + 'routing_key']}, +'users': {'vhost': False}, +'vhosts': {'vhost': False, 'cols': ['name', 'messages']}, +'permissions': {'vhost': False}, +'nodes': {'vhost': False, 'cols': ['name','type','mem_used']}, +'parameters': {'vhost': False, 'json': ['value']}, +'policies':{'vhost': False, 'json': ['definition']}} + +SHOWABLE = {'overview': {'vhost': False, 'cols': ['rabbitmq_version', + 'cluster_name', + 'queue_totals.messages', + 'object_totals.queues']}} + +PROMOTE_COLUMNS = ['vhost', 'name', 'type', + 'source', 'destination', 'destination_type', 'routing_key'] + +URIS = { +'exchange': '/exchanges/{vhost}/{name}', +'queue': '/queues/{vhost}/{name}', +'binding': '/bindings/{vhost}/e/{source}/{destination_char}/{destination}', + 'binding_del':'/bindings/{vhost}/e/{source}/{destination_char}/{destination}/{properties_key}', +'vhost': '/vhosts/{name}', +'user': '/users/{name}', +'permission': '/permissions/{vhost}/{user}', +'parameter': '/parameters/{component}/{vhost}/{name}', +'policy': '/policies/{vhost}/{name}' +} + +DECLARABLE = { +'exchange': {'mandatory': ['name', 'type'], + 'json': ['arguments'], + 'optional': {'auto_delete': 'false', 'durable': 'true', + 'internal': 'false', 'arguments': {}}}, +'queue': {'mandatory': ['name'], + 'json': ['arguments'], + 'optional': {'auto_delete': 'false', 'durable': 'true', + 'arguments': {}, 'node': None}}, +'binding':{'mandatory': ['source', 'destination'], + 'json': ['arguments'], + 'optional': {'destination_type': 'queue', + 'routing_key': '', 'arguments': {}}}, +'vhost': {'mandatory': ['name'], + 'optional': {'tracing': None}}, +
[MediaWiki-commits] [Gerrit] operations/puppet[production]: openstack: remove old OpenDJ log file parser
Rush has submitted this change and it was merged. Change subject: openstack: remove old OpenDJ log file parser .. openstack: remove old OpenDJ log file parser Change-Id: If28dd377db05ef0cabb8957ad31d3446a5bceaf4 --- M modules/openstack/manifests/adminscripts.pp 1 file changed, 0 insertions(+), 9 deletions(-) Approvals: Rush: Verified; Looks good to me, approved diff --git a/modules/openstack/manifests/adminscripts.pp b/modules/openstack/manifests/adminscripts.pp index 529ed74..26d3ea0 100644 --- a/modules/openstack/manifests/adminscripts.pp +++ b/modules/openstack/manifests/adminscripts.pp @@ -33,15 +33,6 @@ group => 'root', } -# Log analysis tool -file { '/root/logstat.py': -ensure => present, -source => "puppet:///modules/openstack/${openstack_version}/virtscripts/logstat.py", -mode => '0755', -owner => 'root', -group => 'root', -} - # Set up keystone services (example script) file { '/root/prod-example.sh': ensure => present, -- To view, visit https://gerrit.wikimedia.org/r/307423 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If28dd377db05ef0cabb8957ad31d3446a5bceaf4 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: RushGerrit-Reviewer: Rush 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]: Disallow mismatched beginMasterChanges/commitMasterChanges
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/307430 Change subject: Disallow mismatched beginMasterChanges/commitMasterChanges .. Disallow mismatched beginMasterChanges/commitMasterChanges Change-Id: I76a8424e94370dc3776fdac1e974bf61fa69f071 --- M includes/db/loadbalancer/LBFactory.php 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/30/307430/1 diff --git a/includes/db/loadbalancer/LBFactory.php b/includes/db/loadbalancer/LBFactory.php index 7038eee..4c51557 100644 --- a/includes/db/loadbalancer/LBFactory.php +++ b/includes/db/loadbalancer/LBFactory.php @@ -237,7 +237,7 @@ if ( $this->trxRoundId !== false ) { throw new DBTransactionError( null, - "Transaction round '{$this->trxRoundId}' already started." + "$fname: transaction round '{$this->trxRoundId}' already started." ); } $this->trxRoundId = $fname; @@ -266,6 +266,12 @@ * @throws Exception */ public function commitMasterChanges( $fname = __METHOD__, array $options = [] ) { + if ( $this->trxRoundId !== false && $this->trxRoundId !== $fname ) { + throw new DBTransactionError( + null, + "$fname: transaction round '{$this->trxRoundId}' still running." + ); + } // Run pre-commit callbacks and suppress post-commit callbacks, aborting on failure $this->forEachLBCallMethod( 'finalizeMasterChanges' ); $this->trxRoundId = false; -- To view, visit https://gerrit.wikimedia.org/r/307430 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I76a8424e94370dc3776fdac1e974bf61fa69f071 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/core[master]: resourceloader: Add test coverage for DerivativeResourceLoad...
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/307429 Change subject: resourceloader: Add test coverage for DerivativeResourceLoaderContext .. resourceloader: Add test coverage for DerivativeResourceLoaderContext * Re-order method tests to match source class. * Add @covers. * Add tests to make coverage 100%. Change-Id: I46bdb66bc08120a82d44208a39d2dd6b7de18de1 --- M tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php 1 file changed, 78 insertions(+), 30 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/29/307429/1 diff --git a/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php b/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php index 90c9f38..9c07ce1 100644 --- a/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php +++ b/tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php @@ -2,11 +2,11 @@ /** * @group ResourceLoader + * @covers DerivativeResourceLoaderContext */ class DerivativeResourceLoaderContextTest extends PHPUnit_Framework_TestCase { - protected static function getResourceLoaderContext() { - $resourceLoader = new ResourceLoader(); + protected static function getContext() { $request = new FauxRequest( [ 'lang' => 'zh', 'modules' => 'test.context', @@ -14,42 +14,76 @@ 'skin' => 'fallback', 'target' => 'test', ] ); - return new ResourceLoaderContext( $resourceLoader, $request ); + return new ResourceLoaderContext( new ResourceLoader(), $request ); } - public function testGet() { - $context = self::getResourceLoaderContext(); - $derived = new DerivativeResourceLoaderContext( $context ); + public function testGetInherited() { + $derived = new DerivativeResourceLoaderContext( self::getContext() ); + // Request parameters + $this->assertEquals( $derived->getDebug(), false ); $this->assertEquals( $derived->getLanguage(), 'zh' ); $this->assertEquals( $derived->getModules(), [ 'test.context' ] ); $this->assertEquals( $derived->getOnly(), 'scripts' ); $this->assertEquals( $derived->getSkin(), 'fallback' ); + $this->assertEquals( $derived->getUser(), null); + + // Misc + $this->assertEquals( $derived->getDirection(), 'ltr' ); $this->assertEquals( $derived->getHash(), 'zh|fallback|||scripts|' ); } - public function testSetLanguage() { - $context = self::getResourceLoaderContext(); - $derived = new DerivativeResourceLoaderContext( $context ); - - $derived->setLanguage( 'nl' ); - $this->assertEquals( $derived->getLanguage(), 'nl' ); - - $derived->setLanguage( 'he' ); - $this->assertEquals( $derived->getDirection(), 'rtl' ); - } - - public function testSetModules() { - $context = self::getResourceLoaderContext(); - $derived = new DerivativeResourceLoaderContext( $context ); + public function testModules() { + $derived = new DerivativeResourceLoaderContext( self::getContext() ); $derived->setModules( [ 'test.override' ] ); $this->assertEquals( $derived->getModules(), [ 'test.override' ] ); } - public function testSetOnly() { - $context = self::getResourceLoaderContext(); + public function testLanguage() { + $context = self::getContext(); $derived = new DerivativeResourceLoaderContext( $context ); + + $derived->setLanguage( 'nl' ); + $this->assertEquals( $derived->getLanguage(), 'nl' ); + } + + public function testDirection() { + $derived = new DerivativeResourceLoaderContext( self::getContext() ); + + $derived->setLanguage( 'nl' ); + $this->assertEquals( $derived->getDirection(), 'ltr' ); + + $derived->setLanguage( 'he' ); + $this->assertEquals( $derived->getDirection(), 'rtl' ); + + $derived->setDirection( 'ltr' ); + $this->assertEquals( $derived->getDirection(), 'ltr' ); + } + + public function testSkin() { + $derived = new DerivativeResourceLoaderContext( self::getContext() ); + + $derived->setSkin( 'override' ); + $this->assertEquals( $derived->getSkin(), 'override' ); + } + + public function testUser() { + $derived = new
[MediaWiki-commits] [Gerrit] operations/puppet[production]: rabbitmq: add rabbitmqadmin for control via mgmt plugin
Rush has uploaded a new change for review. https://gerrit.wikimedia.org/r/307428 Change subject: rabbitmq: add rabbitmqadmin for control via mgmt plugin .. rabbitmq: add rabbitmqadmin for control via mgmt plugin Change-Id: I49f48fccb48ff27b802f166678f749d85dd10d81 --- A modules/openstack/files/rabbitmq/rabbitmqadmin M modules/openstack/manifests/queue_server.pp 2 files changed, 974 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/28/307428/1 diff --git a/modules/openstack/files/rabbitmq/rabbitmqadmin b/modules/openstack/files/rabbitmq/rabbitmqadmin new file mode 100644 index 000..2f5e255 --- /dev/null +++ b/modules/openstack/files/rabbitmq/rabbitmqadmin @@ -0,0 +1,965 @@ +#!/usr/bin/env python + +# The contents of this file are subject to the Mozilla Public License +# Version 1.1 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations +# under the License. +# +# The Original Code is RabbitMQ Management Plugin. +# +# The Initial Developer of the Original Code is GoPivotal, Inc. +# Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved. + +import sys +if sys.version_info[0] < 2 or (sys.version_info[0] == 2 and sys.version_info[1] < 6): +print("Sorry, rabbitmqadmin requires at least Python 2.6.") +sys.exit(1) + +from optparse import OptionParser, TitledHelpFormatter +import urllib +import base64 +import json +import os +import socket + +if sys.version_info[0] == 2: +from ConfigParser import ConfigParser, NoSectionError +import httplib +import urlparse +from urllib import quote_plus +def b64(s): +return base64.b64encode(s) +else: +from configparser import ConfigParser, NoSectionError +import http.client as httplib +import urllib.parse as urlparse +from urllib.parse import quote_plus +def b64(s): +return base64.b64encode(s.encode('utf-8')).decode('utf-8') + +VERSION = '%%VSN%%' + +LISTABLE = {'connections': {'vhost': False, 'cols': ['name','user','channels']}, +'channels':{'vhost': False, 'cols': ['name', 'user']}, +'consumers': {'vhost': True}, +'exchanges': {'vhost': True, 'cols': ['name', 'type']}, +'queues': {'vhost': True, 'cols': ['name', 'messages']}, +'bindings':{'vhost': True, 'cols': ['source', 'destination', + 'routing_key']}, +'users': {'vhost': False}, +'vhosts': {'vhost': False, 'cols': ['name', 'messages']}, +'permissions': {'vhost': False}, +'nodes': {'vhost': False, 'cols': ['name','type','mem_used']}, +'parameters': {'vhost': False, 'json': ['value']}, +'policies':{'vhost': False, 'json': ['definition']}} + +SHOWABLE = {'overview': {'vhost': False, 'cols': ['rabbitmq_version', + 'cluster_name', + 'queue_totals.messages', + 'object_totals.queues']}} + +PROMOTE_COLUMNS = ['vhost', 'name', 'type', + 'source', 'destination', 'destination_type', 'routing_key'] + +URIS = { +'exchange': '/exchanges/{vhost}/{name}', +'queue': '/queues/{vhost}/{name}', +'binding': '/bindings/{vhost}/e/{source}/{destination_char}/{destination}', + 'binding_del':'/bindings/{vhost}/e/{source}/{destination_char}/{destination}/{properties_key}', +'vhost': '/vhosts/{name}', +'user': '/users/{name}', +'permission': '/permissions/{vhost}/{user}', +'parameter': '/parameters/{component}/{vhost}/{name}', +'policy': '/policies/{vhost}/{name}' +} + +DECLARABLE = { +'exchange': {'mandatory': ['name', 'type'], + 'json': ['arguments'], + 'optional': {'auto_delete': 'false', 'durable': 'true', + 'internal': 'false', 'arguments': {}}}, +'queue': {'mandatory': ['name'], + 'json': ['arguments'], + 'optional': {'auto_delete': 'false', 'durable': 'true', + 'arguments': {}, 'node': None}}, +'binding':{'mandatory': ['source', 'destination'], + 'json': ['arguments'], + 'optional': {'destination_type': 'queue', + 'routing_key': '', 'arguments': {}}}, +'vhost': {'mandatory': ['name'], +
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Refactor common duplicate-checking code
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/307427 Change subject: Refactor common duplicate-checking code .. Refactor common duplicate-checking code Change-Id: Ief8692304645ec6b57f3697828d41ca56d40cb9e --- M sites/all/modules/queue2civicrm/queue2civicrm.module M sites/all/modules/wmf_civicrm/wmf_civicrm.module 2 files changed, 42 insertions(+), 29 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/27/307427/1 diff --git a/sites/all/modules/queue2civicrm/queue2civicrm.module b/sites/all/modules/queue2civicrm/queue2civicrm.module index 67f8337..e435b27 100644 --- a/sites/all/modules/queue2civicrm/queue2civicrm.module +++ b/sites/all/modules/queue2civicrm/queue2civicrm.module @@ -256,34 +256,30 @@ ); $cid = _queue2civicrm_log( $log ); -$dbEntry = false; -// If more information is available, find it from the pending database -// FIXME: replace completion_message_id with a boolean flag -if ( isset( $msg['completion_message_id'] ) ) { -$dbEntry = queue2civicrm_update_from_pending_db( $msg ); -if ( !$dbEntry ) { -// If the contribution has already been imported, we don't want -// to re-queue this message, but drop it entirely. -if ( wmf_civicrm_get_contributions_from_gateway_id( -$msg['gateway'], $msg['gateway_txn_id'] -) ) { -throw new WmfException( -'DUPLICATE_CONTRIBUTION', -'Contribution already exists. Ignoring message.' -); -} -// If the pending db row is missing, throw an exception that -// tells dequeue_loop to requeue the incomplete message with a delay -$errorMessage = "Message {$msg['gateway']}-{$msg['gateway_txn_id']} " . -"indicates a pending DB entry with order ID {$msg['order_id']}, " . -"but none was found. Requeueing."; -throw new WmfException( 'MISSING_PREDECESSOR', $errorMessage ); -} -} -$contribution = wmf_civicrm_contribution_message_import($msg); + $contribution = wmf_civicrm_contribution_message_import($msg); + $dbEntry = false; + // If more information is available, find it from the pending database + // FIXME: replace completion_message_id with a boolean flag + if ( isset( $msg['completion_message_id'] ) ) { + $dbEntry = queue2civicrm_update_from_pending_db( $msg ); + if ( !$dbEntry ) { + // If the contribution has already been imported, this check will + // throw an exception that says to drop it entirely, not re-queue. + wmf_civicrm_check_for_duplicates( + $msg['gateway'], $msg['gateway_txn_id'] + ); -// construct an array of useful info to invocations of queue2civicrm_import + // Otherwise, throw an exception that tells the queue consumer to + // requeue the incomplete message with a delay. + $errorMessage = "Message {$msg['gateway']}-{$msg['gateway_txn_id']} " . + "indicates a pending DB entry with order ID {$msg['order_id']}, " . + "but none was found. Requeueing."; + throw new WmfException( 'MISSING_PREDECESSOR', $errorMessage ); + } + } + + // construct an array of useful info to invocations of queue2civicrm_import $contribution_info = array( 'contribution_id' => $contribution['id'], 'contact_id' => $contribution['contact_id'], diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module b/sites/all/modules/wmf_civicrm/wmf_civicrm.module index f88e01c..4219774 100644 --- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module +++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module @@ -975,14 +975,31 @@ } //Now check to make sure this isn't going to be a duplicate message for this gateway. -if ( wmf_civicrm_get_contributions_from_gateway_id( $msg['gateway'], $msg['gateway_txn_id'] ) ) { -throw new WmfException( 'DUPLICATE_CONTRIBUTION', "Contribution already exists. Ignoring message." ); -} + wmf_civicrm_check_for_duplicates( $msg['gateway'], $msg['gateway_txn_id'] ); return $msg; } /** + * Throw an exception if a contribution already exists + * + * @param string $gateway + * @param string $gateway_txn_id + * @throws WmfException + */ +function wmf_civicrm_check_for_duplicates( $gateway, $gateway_txn_id ) { + $txn = wmf_civicrm_get_contributions_from_gateway_id( + $gateway, $gateway_txn_id + ); + if ( $txn ) { + throw new WmfException( +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: WIP: Add server-side MessagePoster
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/307426 Change subject: WIP: Add server-side MessagePoster .. WIP: Add server-side MessagePoster The purpose of this is to allow creating talk page topics without the client needing to know what talk page system is being used. It could support any talk page system identifiable by content model. A Flow implementation will be provided now in a separate commit. This supports both bot/system users (e.g. MassMessage), and use cases where the post is done as the current user (e.g. WikiLove). The bot flag is supported in the interface. A client-side implementation, mediawiki.messagePoster already exists. A few comment changes were also made here to be consistent with the server, and fix typos. Bug: T123522 Change-Id: I9fa6ab7389ed3cee3dbac7ee7046627588d5860a --- M autoload.php M includes/MediaWikiServices.php M includes/ServiceWiring.php A includes/messageposter/IMessagePoster.php A includes/messageposter/MessagePosterRegistry.php A includes/messageposter/WikitextMessagePoster.php M resources/src/mediawiki.messagePoster/mediawiki.messagePoster.MessagePoster.js M resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js M tests/phpunit/includes/MediaWikiServicesTest.php A tests/phpunit/includes/messageposter/MessagePosterRegistryTest.php A tests/phpunit/includes/messageposter/WikitextMessagePosterTest.php M tests/qunit/suites/resources/mediawiki/mediawiki.messagePoster.factory.test.js 12 files changed, 420 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/26/307426/1 diff --git a/autoload.php b/autoload.php index 39102fd..1e99333 100644 --- a/autoload.php +++ b/autoload.php @@ -861,6 +861,9 @@ 'MediaWiki\\Logger\\NullSpi' => __DIR__ . '/includes/debug/logger/NullSpi.php', 'MediaWiki\\Logger\\Spi' => __DIR__ . '/includes/debug/logger/Spi.php', 'MediaWiki\\MediaWikiServices' => __DIR__ . '/includes/MediaWikiServices.php', + 'MediaWiki\\MessagePoster\\IMessagePoster' => __DIR__ . '/includes/messageposter/IMessagePoster.php', + 'MediaWiki\\MessagePoster\\MessagePosterRegistry' => __DIR__ . '/includes/messageposter/MessagePosterRegistry.php', + 'MediaWiki\\MessagePoster\\WikitextMessagePoster' => __DIR__ . '/includes/messageposter/WikitextMessagePoster.php', 'MediaWiki\\Search\\ParserOutputSearchDataExtractor' => __DIR__ . '/includes/search/ParserOutputSearchDataExtractor.php', 'MediaWiki\\Services\\CannotReplaceActiveServiceException' => __DIR__ . '/includes/Services/CannotReplaceActiveServiceException.php', 'MediaWiki\\Services\\ContainerDisabledException' => __DIR__ . '/includes/Services/ContainerDisabledException.php', diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index 49891df..8fdf056 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -14,6 +14,7 @@ use MediaHandlerFactory; use MediaWiki\Linker\LinkRenderer; use MediaWiki\Linker\LinkRendererFactory; +use MediaWiki\MessagePoster\MessagePosterRegistry; use MediaWiki\Services\SalvageableService; use MediaWiki\Services\ServiceContainer; use MWException; @@ -523,6 +524,14 @@ /** * @since 1.28 +* @return MessagePosterRegistry +*/ + public function getMessagePosterRegistry() { + return $this->getService( 'MessagePosterRegistry' ); + } + + /** +* @since 1.28 * @return GenderCache */ public function getGenderCache() { diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 33569e6..5658bbf 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -187,6 +187,17 @@ } }, + 'MessagePosterRegistry' => function( MediaWikiServices $services ) { + $factory = new MediaWiki\MessagePoster\MessagePosterRegistry; + + $factory->register( + 'wikitext', + 'MediaWiki\MessagePoster\WikitextMessagePoster' + ); + + return $factory; + }, + 'GenderCache' => function( MediaWikiServices $services ) { return new GenderCache(); }, diff --git a/includes/messageposter/IMessagePoster.php b/includes/messageposter/IMessagePoster.php new file mode 100644 index 000..3c1b640 --- /dev/null +++ b/includes/messageposter/IMessagePoster.php @@ -0,0 +1,35 @@ +contentModelToClass[$contentModel] ) ) { + throw new MWException( 'Content model "' . $contentModel . '" is already registered' ); + } + + $this->contentModelToClass[$contentModel] = new ReflectionClass( $className ); + } + + /** +* Unregister a given content model. +* This is exposed for testing and
[MediaWiki-commits] [Gerrit] mediawiki...Vector[master]: vector.js: Calculate initial #p-cactions width lazily
jenkins-bot has submitted this change and it was merged. Change subject: vector.js: Calculate initial #p-cactions width lazily .. vector.js: Calculate initial #p-cactions width lazily Follows-up f354aafebc. Avoid forced style calculation during page load. Instead calculate in the very next animation frame. This is only a few ms later, but makes a big difference by doing this outside the critical path. Change-Id: I5805958781bf64d1e4a30f441ed7f57807072284 --- M vector.js 1 file changed, 14 insertions(+), 4 deletions(-) Approvals: Gilles: Looks good to me, but someone else must approve Jdlrobson: Looks good to me, approved jenkins-bot: Verified diff --git a/vector.js b/vector.js index 11b5193..5842701 100644 --- a/vector.js +++ b/vector.js @@ -8,7 +8,17 @@ */ var $cactions = $( '#p-cactions' ), $tabContainer = $( '#p-views ul' ), - originalDropdownWidth = $cactions.width(); + rAF = window.requestAnimationFrame || setTimeout, + // Avoid forced style calculation during page load + initialCactionsWidth = function () { + var width = $cactions.width(); + initialCactionsWidth = function () { + return width; + }; + return width; + }; + + rAF( initialCactionsWidth ); /** * Focus search input at the very end @@ -50,7 +60,7 @@ $cactions .removeClass( 'emptyPortlet' ) .find( 'h3' ) - .css( 'width', '1px' ).animate( { width: originalDropdownWidth }, 'normal' ); + .css( 'width', '1px' ).animate( { width: initialCactionsWidth() }, 'normal' ); } } ) .bind( 'beforeTabExpand', function () { @@ -75,7 +85,7 @@ // Maybe we can still expand? Account for the width of the "Actions" dropdown if the // expansion would hide it. if ( $cactions.find( 'li' ).length === 1 ) { - return distance >= eleWidth + 1 - originalDropdownWidth; + return distance >= eleWidth + 1 - initialCactionsWidth(); } else { return false; } @@ -91,7 +101,7 @@ // But only if the width of the tab to collapse is smaller than the width of the dropdown // we would have to insert. An example language where this happens is Lithuanian (lt). if ( $cactions.hasClass( 'emptyPortlet' ) ) { - return $tabContainer.children( 'li.collapsible:last' ).width() > originalDropdownWidth; + return $tabContainer.children( 'li.collapsible:last' ).width() > initialCactionsWidth(); } else { return true; } -- To view, visit https://gerrit.wikimedia.org/r/306869 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5805958781bf64d1e4a30f441ed7f57807072284 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/skins/Vector Gerrit-Branch: master Gerrit-Owner: KrinkleGerrit-Reviewer: Alex Monk Gerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Catrope Gerrit-Reviewer: Gilles Gerrit-Reviewer: Jdlrobson Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Revert "robh on vacation next week, remove from paging"
RobH has submitted this change and it was merged. Change subject: Revert "robh on vacation next week, remove from paging" .. Revert "robh on vacation next week, remove from paging" Rob is back to work. This reverts commit 7b053196599c2b72722ffd58f3c0b1e174f7fb59. Change-Id: I0967f9ba5632ceec2d1085ee290ba00f4b8022b8 --- M modules/nagios_common/files/contactgroups.cfg 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: RobH: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/nagios_common/files/contactgroups.cfg b/modules/nagios_common/files/contactgroups.cfg index d3b64e7..b630480 100644 --- a/modules/nagios_common/files/contactgroups.cfg +++ b/modules/nagios_common/files/contactgroups.cfg @@ -46,7 +46,7 @@ define contactgroup { contactgroup_name sms -members akosiaris,andrew,ariel,bblack,cmjohnson,dzahn,ema,faidon,fgiunchedi,jgreen,mark,otto,volans,springle,tstarling,rush,glavagetto,yuvipanda,jmm,jcrespo,team-operations,gehel,madhuvishy +members akosiaris,andrew,ariel,bblack,cmjohnson,dzahn,ema,faidon,fgiunchedi,jgreen,mark,otto,robh,volans,springle,tstarling,rush,glavagetto,yuvipanda,jmm,jcrespo,team-operations,gehel,madhuvishy } define contactgroup { -- To view, visit https://gerrit.wikimedia.org/r/307309 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0967f9ba5632ceec2d1085ee290ba00f4b8022b8 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: RobHGerrit-Reviewer: RobH Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits