[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move LoadMonitorMySQL to LoadMonitor
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310733 Change subject: Move LoadMonitorMySQL to LoadMonitor .. Move LoadMonitorMySQL to LoadMonitor * The LoadMonitor interface is now ILoadMonitor. * Nothing in this code was MySQL specific. Now any DB type can benefit from a LoadMonitor. Change-Id: I272a72cd55a70f99a866d518d44cb3bcaca91b9e --- M includes/libs/rdbms/loadbalancer/LoadBalancer.php A includes/libs/rdbms/loadmonitor/ILoadMonitor.php M includes/libs/rdbms/loadmonitor/LoadMonitor.php M includes/libs/rdbms/loadmonitor/LoadMonitorMySQL.php M includes/libs/rdbms/loadmonitor/LoadMonitorNull.php 5 files changed, 198 insertions(+), 163 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/33/310733/1 diff --git a/includes/libs/rdbms/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php index 903c160..1c37389 100644 --- a/includes/libs/rdbms/loadbalancer/LoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/LoadBalancer.php @@ -43,7 +43,7 @@ /** @var string The LoadMonitor subclass name */ private $mLoadMonitorClass; - /** @var LoadMonitor */ + /** @var ILoadMonitor */ private $mLoadMonitor; /** @var BagOStuff */ private $srvCache; @@ -188,7 +188,7 @@ /** * Get a LoadMonitor instance * -* @return LoadMonitor +* @return ILoadMonitor */ private function getLoadMonitor() { if ( !isset( $this->mLoadMonitor ) ) { diff --git a/includes/libs/rdbms/loadmonitor/ILoadMonitor.php b/includes/libs/rdbms/loadmonitor/ILoadMonitor.php new file mode 100644 index 000..e355c03 --- /dev/null +++ b/includes/libs/rdbms/loadmonitor/ILoadMonitor.php @@ -0,0 +1,65 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + * @ingroup Database + */ +use Psr\Log\LoggerAwareInterface; + +/** + * An interface for database load monitoring + * + * @ingroup Database + */ +interface ILoadMonitor extends LoggerAwareInterface { + /** +* Construct a new LoadMonitor with a given LoadBalancer parent +* +* @param ILoadBalancer $lb LoadBalancer this instance serves +* @param BagOStuff $sCache Local server memory cache +* @param BagOStuff $cCache Local cluster memory cache +*/ + public function __construct( ILoadBalancer $lb, BagOStuff $sCache, BagOStuff $cCache ); + + /** +* Perform pre-connection load ratio adjustment. +* @param int[] &$loads +* @param string|bool $group The selected query group. Default: false +* @param string|bool $domain Default: false +*/ + public function scaleLoads( &$loads, $group = false, $domain = false ); + + /** +* Get an estimate of replication lag (in seconds) for each server +* +* Values may be "false" if replication is too broken to estimate +* +* @param integer[] $serverIndexes +* @param string $domain +* +* @return array Map of (server index => float|int|bool) +*/ + public function getLagTimes( $serverIndexes, $domain ); + + /** +* Clear any process and persistent cache of lag times +* @since 1.27 +*/ + public function clearCaches(); +} diff --git a/includes/libs/rdbms/loadmonitor/LoadMonitor.php b/includes/libs/rdbms/loadmonitor/LoadMonitor.php index 460746b..1da8f4e 100644 --- a/includes/libs/rdbms/loadmonitor/LoadMonitor.php +++ b/includes/libs/rdbms/loadmonitor/LoadMonitor.php @@ -1,7 +1,5 @@ parent = $lb; + $this->srvCache = $srvCache; + $this->mainCache = $cache; + $this->replLogger = new \Psr\Log\NullLogger(); + } - /** -* Get an estimate of replication lag (in seconds) for each server -* -* Values may be "false" if replication is too broken to estimate -* -* @param integer[] $serverIndexes -* @param string $domain -* -* @return array Map of (server index => float|int|bool) -*/ - public function getLagTimes( $serverIndexes, $domain ); + public function setLogger( LoggerInterface $logger ) { + $this->replLogger = $logger; + } - /** -* Clear any process and persistent cache of lag times -* @since 1.27 -*/ - public function clearCaches(); + public function scaleLoads( &$loads, $group = false, $domain = false ) { + } + + public function getLagTimes( $serverIndexes, $domain ) { + if ( count( $serverIndexes ) == 1 && reset( $serverIndexes ) == 0 ) { + # Single server only, just return zero without caching + return [ 0 => 0 ]; + } + + $key = $this->getLagTimeCacheKey(); +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove unused LBFactoryFake class
jenkins-bot has submitted this change and it was merged. Change subject: Remove unused LBFactoryFake class .. Remove unused LBFactoryFake class Change-Id: I88acf72fc32c7e3c9bead81d11c5adfd8dff6151 --- M autoload.php M includes/db/loadbalancer/LBFactory.php D includes/db/loadbalancer/LBFactoryFake.php M tests/phpunit/includes/db/LBFactoryTest.php 4 files changed, 0 insertions(+), 52 deletions(-) Approvals: Tim Starling: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 1ebf728..d46d2ce 100644 --- a/autoload.php +++ b/autoload.php @@ -654,7 +654,6 @@ 'KkConverter' => __DIR__ . '/languages/classes/LanguageKk.php', 'KuConverter' => __DIR__ . '/languages/classes/LanguageKu.php', 'LBFactory' => __DIR__ . '/includes/db/loadbalancer/LBFactory.php', - 'LBFactoryFake' => __DIR__ . '/includes/db/loadbalancer/LBFactoryFake.php', 'LBFactoryMulti' => __DIR__ . '/includes/db/loadbalancer/LBFactoryMulti.php', 'LBFactorySimple' => __DIR__ . '/includes/db/loadbalancer/LBFactorySimple.php', 'LBFactorySingle' => __DIR__ . '/includes/db/loadbalancer/LBFactorySingle.php', diff --git a/includes/db/loadbalancer/LBFactory.php b/includes/db/loadbalancer/LBFactory.php index 9eda742..6fd1550 100644 --- a/includes/db/loadbalancer/LBFactory.php +++ b/includes/db/loadbalancer/LBFactory.php @@ -138,7 +138,6 @@ 'LBFactory_Simple' => 'LBFactorySimple', 'LBFactory_Single' => 'LBFactorySingle', 'LBFactory_Multi' => 'LBFactoryMulti', - 'LBFactory_Fake' => 'LBFactoryFake', ]; $class = $config['class']; diff --git a/includes/db/loadbalancer/LBFactoryFake.php b/includes/db/loadbalancer/LBFactoryFake.php deleted file mode 100644 index 5cd1d4b..000 --- a/includes/db/loadbalancer/LBFactoryFake.php +++ /dev/null @@ -1,49 +0,0 @@ -http://www.gnu.org/copyleft/gpl.html - * - * @file - * @ingroup Database - */ - -/** - * LBFactory class that throws an error on any attempt to use it. - * This will typically be done via wfGetDB(). - * Call LBFactory::disableBackend() to start using this, and - * LBFactory::enableBackend() to return to normal behavior - */ -class LBFactoryFake extends LBFactory { - public function newMainLB( $wiki = false ) { - throw new DBAccessError; - } - - public function getMainLB( $wiki = false ) { - throw new DBAccessError; - } - - protected function newExternalLB( $cluster, $wiki = false ) { - throw new DBAccessError; - } - - public function getExternalLB( $cluster, $wiki = false ) { - throw new DBAccessError; - } - - public function forEachLB( $callback, array $params = [] ) { - } -} diff --git a/tests/phpunit/includes/db/LBFactoryTest.php b/tests/phpunit/includes/db/LBFactoryTest.php index 862ec42..364a6c2 100644 --- a/tests/phpunit/includes/db/LBFactoryTest.php +++ b/tests/phpunit/includes/db/LBFactoryTest.php @@ -54,7 +54,6 @@ [ 'LBFactorySimple', 'LBFactory_Simple' ], [ 'LBFactorySingle', 'LBFactory_Single' ], [ 'LBFactoryMulti', 'LBFactory_Multi' ], - [ 'LBFactoryFake', 'LBFactory_Fake' ], ]; } -- To view, visit https://gerrit.wikimedia.org/r/310731 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I88acf72fc32c7e3c9bead81d11c5adfd8dff6151 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Parent5446 Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Only store the full country code if it is on our valid list.
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/310732 Change subject: Only store the full country code if it is on our valid list. .. Only store the full country code if it is on our valid list. If the country code is not on the list then prefer the 2 digit code. This means 'en' is better than 'en_NO (Norwegian English). Separately we will look to remove the invalid options we already have in our DB. If neither are valid store the full thing to make it easier to find them Bug: T96410 Change-Id: Ie7e8a958c2496a738ce738dd827b7ed04b2d9fbd --- M sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php M sites/all/modules/wmf_civicrm/wmf_civicrm.module 2 files changed, 124 insertions(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/32/310732/1 diff --git a/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php b/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php index c3ad868..86e8901 100644 --- a/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php +++ b/sites/all/modules/wmf_civicrm/tests/phpunit/ImportMessageTest.php @@ -103,7 +103,6 @@ 'return' => 'name', )), $expected['contact'][$renamedField]); } - } if ( !empty( $expected['contact_custom_values'] ) ) { @@ -141,35 +140,7 @@ 'payment_method' => 'cc', ), array( -'contribution' => array( -'address_id' => '', -'amount_level' => '', -'campaign_id' => '', -'cancel_date' => '', -'cancel_reason' => '', -'check_number' => '', -'contribution_page_id' => '', -'contribution_recur_id' => '', -'contribution_status_id' => '1', -'contribution_type_id' => $contribution_type_cash, -'currency' => 'USD', -'fee_amount' => '0', -'invoice_id' => '', -'is_pay_later' => '', -'is_test' => '', -'net_amount' => '1.23', -'non_deductible_amount' => '', -'payment_instrument_id' => $payment_instrument_cc, -'receipt_date' => '', -'receive_date' => '2012050100', -'source' => 'USD 1.23', -'thankyou_date' => '', -'total_amount' => '1.23', -'trxn_id' => "TEST_GATEWAY {$gateway_txn_id}", -'financial_type_id' => $contribution_type_cash, -'creditnote_id' => '', -'tax_amount' => '', -), +'contribution' => $this->getBaseContribution($gateway_txn_id), ), ), @@ -219,6 +190,7 @@ 'email' => 'nob...@wikimedia.org', 'first_name' => 'First', 'fee' => '0.03', +'preferred_language' => 'en_US', 'gateway' => 'test_gateway', 'gateway_txn_id' => $gateway_txn_id, 'gift_source' => 'Legacy Gift', @@ -246,6 +218,7 @@ 'middle_name' => 'Middle', 'prefix' => $new_prefix, 'suffix' => 'Sr.', +'preferred_language' => 'en_US', ), 'contribution' => array( 'address_id' => '', @@ -296,8 +269,57 @@ ), ), ), + // Invalid language suffix for valid short lang. + 'invalid language suffix' => array( +array( + 'currency' => 'USD', + 'date' => '2012-05-01 00:00:00', + 'email' => 'nob...@wikimedia.org', + 'gateway' => 'test_gateway', + 'gateway_txn_id' => $gateway_txn_id, + 'gross' => '1.23', + 'payment_method' => 'cc', + 'preferred_language' => 'en_ZZ', + 'name_prefix' => $new_prefix, + 'name_suffix' => 'Sr.', +), +array( + 'contact' => array( +'preferred_language' => 'en', +'prefix' => $new_prefix, +'suffix' => 'Sr.', + ), + 'contribution' => $this->getBaseContribution($gateway_txn_id), +), + ), -// Organization contribution + // Invalid language suffix for invalid short lang. + 'invalid
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove unused LBFactoryFake class
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310731 Change subject: Remove unused LBFactoryFake class .. Remove unused LBFactoryFake class Change-Id: I88acf72fc32c7e3c9bead81d11c5adfd8dff6151 --- M autoload.php M includes/db/loadbalancer/LBFactory.php D includes/db/loadbalancer/LBFactoryFake.php M tests/phpunit/includes/db/LBFactoryTest.php 4 files changed, 0 insertions(+), 52 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/31/310731/1 diff --git a/autoload.php b/autoload.php index 1ebf728..d46d2ce 100644 --- a/autoload.php +++ b/autoload.php @@ -654,7 +654,6 @@ 'KkConverter' => __DIR__ . '/languages/classes/LanguageKk.php', 'KuConverter' => __DIR__ . '/languages/classes/LanguageKu.php', 'LBFactory' => __DIR__ . '/includes/db/loadbalancer/LBFactory.php', - 'LBFactoryFake' => __DIR__ . '/includes/db/loadbalancer/LBFactoryFake.php', 'LBFactoryMulti' => __DIR__ . '/includes/db/loadbalancer/LBFactoryMulti.php', 'LBFactorySimple' => __DIR__ . '/includes/db/loadbalancer/LBFactorySimple.php', 'LBFactorySingle' => __DIR__ . '/includes/db/loadbalancer/LBFactorySingle.php', diff --git a/includes/db/loadbalancer/LBFactory.php b/includes/db/loadbalancer/LBFactory.php index 9eda742..6fd1550 100644 --- a/includes/db/loadbalancer/LBFactory.php +++ b/includes/db/loadbalancer/LBFactory.php @@ -138,7 +138,6 @@ 'LBFactory_Simple' => 'LBFactorySimple', 'LBFactory_Single' => 'LBFactorySingle', 'LBFactory_Multi' => 'LBFactoryMulti', - 'LBFactory_Fake' => 'LBFactoryFake', ]; $class = $config['class']; diff --git a/includes/db/loadbalancer/LBFactoryFake.php b/includes/db/loadbalancer/LBFactoryFake.php deleted file mode 100644 index 5cd1d4b..000 --- a/includes/db/loadbalancer/LBFactoryFake.php +++ /dev/null @@ -1,49 +0,0 @@ -http://www.gnu.org/copyleft/gpl.html - * - * @file - * @ingroup Database - */ - -/** - * LBFactory class that throws an error on any attempt to use it. - * This will typically be done via wfGetDB(). - * Call LBFactory::disableBackend() to start using this, and - * LBFactory::enableBackend() to return to normal behavior - */ -class LBFactoryFake extends LBFactory { - public function newMainLB( $wiki = false ) { - throw new DBAccessError; - } - - public function getMainLB( $wiki = false ) { - throw new DBAccessError; - } - - protected function newExternalLB( $cluster, $wiki = false ) { - throw new DBAccessError; - } - - public function getExternalLB( $cluster, $wiki = false ) { - throw new DBAccessError; - } - - public function forEachLB( $callback, array $params = [] ) { - } -} diff --git a/tests/phpunit/includes/db/LBFactoryTest.php b/tests/phpunit/includes/db/LBFactoryTest.php index 862ec42..364a6c2 100644 --- a/tests/phpunit/includes/db/LBFactoryTest.php +++ b/tests/phpunit/includes/db/LBFactoryTest.php @@ -54,7 +54,6 @@ [ 'LBFactorySimple', 'LBFactory_Simple' ], [ 'LBFactorySingle', 'LBFactory_Single' ], [ 'LBFactoryMulti', 'LBFactory_Multi' ], - [ 'LBFactoryFake', 'LBFactory_Fake' ], ]; } -- To view, visit https://gerrit.wikimedia.org/r/310731 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88acf72fc32c7e3c9bead81d11c5adfd8dff6151 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...parsoid[master]: Use a secure variable so that forks don't spam us
jenkins-bot has submitted this change and it was merged. Change subject: Use a secure variable so that forks don't spam us .. Use a secure variable so that forks don't spam us * This was generated with, travis encrypt -r wikimedia/parsoid parsing-t...@wikimedia.org Change-Id: I155b5a141c57d45dc48b200e6c2d1b263e0ca919 --- M .travis.yml 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/.travis.yml b/.travis.yml index 7f83c85..3f633ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,4 @@ notifications: email: -- parsing-t...@wikimedia.org +- secure: "UPDzE/JcwvnoewrGVuuVrX0TFz2Q5PYkS2xxA45FRiCPvc2KxVvC9YX0xOKklm6iiiyH95lKRgAD8D53gg1tJmpR2+Z2BAfvfyy41MDB9P5ufwn9NoulmrLFLWCQxf+fqmT1qjyle4pql44y8nN7PCejn1Zkz4pko29bz0c3Blg=" -- To view, visit https://gerrit.wikimedia.org/r/310730 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I155b5a141c57d45dc48b200e6c2d1b263e0ca919 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: ArlolraGerrit-Reviewer: Arlolra Gerrit-Reviewer: C. Scott Ananian Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Subramanya Sastry Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Use a secure variable so that forks don't spam us
Arlolra has uploaded a new change for review. https://gerrit.wikimedia.org/r/310730 Change subject: Use a secure variable so that forks don't spam us .. Use a secure variable so that forks don't spam us * This was generated with, travis encrypt -r wikimedia/parsoid parsing-t...@wikimedia.org Change-Id: I155b5a141c57d45dc48b200e6c2d1b263e0ca919 --- M .travis.yml 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/30/310730/1 diff --git a/.travis.yml b/.travis.yml index 7f83c85..3f633ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,4 @@ notifications: email: -- parsing-t...@wikimedia.org +- secure: "UPDzE/JcwvnoewrGVuuVrX0TFz2Q5PYkS2xxA45FRiCPvc2KxVvC9YX0xOKklm6iiiyH95lKRgAD8D53gg1tJmpR2+Z2BAfvfyy41MDB9P5ufwn9NoulmrLFLWCQxf+fqmT1qjyle4pql44y8nN7PCejn1Zkz4pko29bz0c3Blg=" -- To view, visit https://gerrit.wikimedia.org/r/310730 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I155b5a141c57d45dc48b200e6c2d1b263e0ca919 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: puppet::self::gitclone: Get gitdir from puppetmaster::base_repo
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/310729 Change subject: puppet::self::gitclone: Get gitdir from puppetmaster::base_repo .. puppet::self::gitclone: Get gitdir from puppetmaster::base_repo To be compatible with conftool::master Change-Id: I574088f7048874e49ac3f825e9212a14c1f3bcb6 --- M modules/puppet/manifests/self/gitclone.pp 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/29/310729/1 diff --git a/modules/puppet/manifests/self/gitclone.pp b/modules/puppet/manifests/self/gitclone.pp index 4994c99..1b8c3e1 100644 --- a/modules/puppet/manifests/self/gitclone.pp +++ b/modules/puppet/manifests/self/gitclone.pp @@ -3,12 +3,10 @@ # for use by puppet::self::masters. # class puppet::self::gitclone { -$gitdir = '/var/lib/git' $volatiledir = '/var/lib/puppet/volatile' -class { '::puppetmaster::base_repo': -gitdir => $gitdir, -} +require ::puppetmaster::base_repo +$gitdir = $::puppetmaster::base_repo::gitdir file { "${gitdir}/labs": ensure => directory, -- To view, visit https://gerrit.wikimedia.org/r/310729 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I574088f7048874e49ac3f825e9212a14c1f3bcb6 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Alex Monk___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid MWException and wf* log methods in DatabaseBase
jenkins-bot has submitted this change and it was merged. Change subject: Avoid MWException and wf* log methods in DatabaseBase .. Avoid MWException and wf* log methods in DatabaseBase Change-Id: Idc418ae1088f87d6416e2552976d94f7d1e8f5db --- M includes/db/Database.php M includes/db/DatabaseMssql.php M includes/db/DatabaseSqlite.php M includes/db/loadbalancer/LBFactoryMulti.php M includes/db/loadbalancer/LBFactorySimple.php M includes/libs/rdbms/loadbalancer/LoadBalancer.php 6 files changed, 35 insertions(+), 35 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/Database.php b/includes/db/Database.php index e68a8f2..0c357cc 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -69,6 +69,8 @@ protected $connLogger; /** @var LoggerInterface */ protected $queryLogger; + /** @var callback Error logging callback */ + protected $errorLogger; /** @var resource Database connection */ protected $mConn = null; @@ -319,7 +321,7 @@ * @param array $p An array of options to pass to the constructor. *Valid options are: host, user, password, dbname, flags, tablePrefix, schema, driver * @return IDatabase|null If the database driver or extension cannot be found -* @throws MWException +* @throws InvalidArgumentException If the database driver or extension cannot be found */ final public static function factory( $dbType, $p = [] ) { global $wgCommandLineMode; @@ -355,7 +357,7 @@ $driver = $dbType; } if ( $driver === false ) { - throw new MWException( __METHOD__ . + throw new InvalidArgumentException( __METHOD__ . " no viable database extension found for type '$dbType'" ); } @@ -389,6 +391,11 @@ } if ( isset( $p['queryLogger'] ) ) { $conn->queryLogger = $p['queryLogger']; + } + if ( isset( $p['errorLogger'] ) ) { + $conn->errorLogger = $p['errorLogger']; + } else { + $conn->errorLogger = [ MWExceptionHandler::class, 'logException' ]; } } else { $conn = null; @@ -741,7 +748,7 @@ protected function installErrorHandler() { $this->mPHPError = false; $this->htmlErrors = ini_set( 'html_errors', '0' ); - set_error_handler( [ $this, 'connectionErrorHandler' ] ); + set_error_handler( [ $this, 'connectionerrorLogger' ] ); } /** @@ -766,12 +773,12 @@ * @param int $errno * @param string $errstr */ - public function connectionErrorHandler( $errno, $errstr ) { + public function connectionerrorLogger( $errno, $errstr ) { $this->mPHPError = $errstr; } /** -* Create a log context to pass to wfLogDBError or other logging functions. +* Create a log context to pass to PSR logging functions. * * @param array $extras Additional data to add to context * @return array @@ -790,11 +797,6 @@ public function close() { if ( $this->mConn ) { if ( $this->trxLevel() ) { - if ( !$this->mTrxAutomatic ) { - wfWarn( "Transaction still in progress (from {$this->mTrxFname}), " . - " performing implicit commit before closing connection!" ); - } - $this->commit( __METHOD__, self::FLUSHING_INTERNAL ); } @@ -948,7 +950,8 @@ if ( $this->reconnect() ) { $msg = __METHOD__ . ": lost connection to {$this->getServer()}; reconnected"; $this->connLogger->warning( $msg ); - $this->queryLogger->warning( "$msg:\n" . wfBacktrace( true ) ); + $this->queryLogger->warning( + "$msg:\n" . ( new RuntimeException() )->getTraceAsString() ); if ( !$recoverable ) { # Callers may catch the exception and continue to use the DB @@ -1097,7 +1100,7 @@ $this->queryLogger->debug( "SQL ERROR (ignored): $error\n" ); } else { $sql1line = mb_substr( str_replace( "\n", "\\n", $sql ), 0, 5 * 1024 ); -
[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: Avoid deprecated LBFactory::singleton() in tests
jenkins-bot has submitted this change and it was merged. Change subject: Avoid deprecated LBFactory::singleton() in tests .. Avoid deprecated LBFactory::singleton() in tests Change-Id: Id9c39e9332270f34979db74b251c8f834cce7057 --- M extensions/Wikibase/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/Wikibase/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php b/extensions/Wikibase/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php index ab0a78d..3abdfaa 100644 --- a/extensions/Wikibase/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php +++ b/extensions/Wikibase/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php @@ -13,6 +13,7 @@ use Wikibase\Client\RecentChanges\RecentChangeFactory; use Wikibase\Client\WikibaseClient; use Wikimedia\Assert\Assert; +use \MediaWiki\MediaWikiServices; /** * @since 0.5 @@ -90,7 +91,7 @@ return new self( $context->getRequest(), $context->getUser(), - LBFactory::singleton()->getMainLB(), + MediaWikiServices::getInstance()->getDBLoadBalancer(), $specialPageName, $settings->getSetting( 'showExternalRecentChanges' ) ); -- To view, visit https://gerrit.wikimedia.org/r/310728 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id9c39e9332270f34979db74b251c8f834cce7057 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikidata Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Addshore Gerrit-Reviewer: Aude Gerrit-Reviewer: Tobias Gritschacher Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: Avoid deprecated LBFactory::singleton() in tests
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310728 Change subject: Avoid deprecated LBFactory::singleton() in tests .. Avoid deprecated LBFactory::singleton() in tests Change-Id: Id9c39e9332270f34979db74b251c8f834cce7057 --- M extensions/Wikibase/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/28/310728/1 diff --git a/extensions/Wikibase/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php b/extensions/Wikibase/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php index ab0a78d..3abdfaa 100644 --- a/extensions/Wikibase/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php +++ b/extensions/Wikibase/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php @@ -13,6 +13,7 @@ use Wikibase\Client\RecentChanges\RecentChangeFactory; use Wikibase\Client\WikibaseClient; use Wikimedia\Assert\Assert; +use \MediaWiki\MediaWikiServices; /** * @since 0.5 @@ -90,7 +91,7 @@ return new self( $context->getRequest(), $context->getUser(), - LBFactory::singleton()->getMainLB(), + MediaWikiServices::getInstance()->getDBLoadBalancer(), $specialPageName, $settings->getSetting( 'showExternalRecentChanges' ) ); -- To view, visit https://gerrit.wikimedia.org/r/310728 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id9c39e9332270f34979db74b251c8f834cce7057 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikidata 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: Move 'site' and 'user' logic to makeModuleRe...
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/310727 Change subject: resourceloader: Move 'site' and 'user' logic to makeModuleResponse .. resourceloader: Move 'site' and 'user' logic to makeModuleResponse * Keep this out of makeLoaderImplementScript() to keep it more generic and to simplify future refactoring. * Remove now-broken test case that asserted that the output varies by global debug mode. * Make the test responsible for wrapping in XmlJsCode. Previously this magically happened because the module name was "user" in the last test case. Change-Id: I527d01926fb6e4ce68c931695d830cdb9ceb608c --- M includes/resourceloader/ResourceLoader.php M tests/phpunit/includes/resourceloader/ResourceLoaderTest.php 2 files changed, 28 insertions(+), 29 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/27/310727/1 diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 97a86c3..db26dd8 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -1031,9 +1031,23 @@ $strContent = isset( $styles['css'] ) ? implode( '', $styles['css'] ) : ''; break; default: + $scripts = isset( $content['scripts'] ) ? $content['scripts'] : ''; + if ( is_string( $scripts ) ) { + if ( $name === 'site' || $name === 'user' ) { + // Legacy scripts that run in the global scope without closure. + // Transport as string instructs mw.loader.implement to use globalEval. + // Minify manually here, because general response minification is not + // effective due it being a string literal, not a function. (T107377) + if ( !ResourceLoader::inDebugMode() ) { + $scripts = self::filter( 'minify-js', $scripts ); + } + } else { + $scripts = new XmlJsCode( $scripts ); + } + } $strContent = self::makeLoaderImplementScript( $name, - isset( $content['scripts'] ) ? $content['scripts'] : '', + $scripts, isset( $content['styles'] ) ? $content['styles'] : [], isset( $content['messagesBlob'] ) ? new XmlJsCode( $content['messagesBlob'] ) : [], isset( $content['templates'] ) ? $content['templates'] : [] @@ -1112,7 +1126,8 @@ * Return JS code that calls mw.loader.implement with given module properties. * * @param string $name Module name -* @param mixed $scripts List of URLs to JavaScript files or String of JavaScript code +* @param string|array|XmlJsCode $scripts JavaScript code to be wrapped in a closure, +* list of URLs to JavaScript files, or raw JavaScript code as XmlJsCode. * @param mixed $styles Array of CSS strings keyed by media type, or an array of lists of URLs * to CSS files keyed by media type * @param mixed $messages List of messages associated with this module. May either be an @@ -1126,19 +1141,10 @@ public static function makeLoaderImplementScript( $name, $scripts, $styles, $messages, $templates ) { - if ( is_string( $scripts ) ) { - // Site and user module are a legacy scripts that run in the global scope (no closure). - // Transportation as string instructs mw.loader.implement to use globalEval. - if ( $name === 'site' || $name === 'user' ) { - // Minify manually because the general makeModuleResponse() minification won't be - // effective here due to the script being a string instead of a function. (T107377) -
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move various DB helper classes to /libs/rdbms
jenkins-bot has submitted this change and it was merged. Change subject: Move various DB helper classes to /libs/rdbms .. Move various DB helper classes to /libs/rdbms Change-Id: I0724f1acce4f6c43b1f0983fa119e628e7c53ba5 --- M autoload.php M includes/db/DatabaseMssql.php M includes/db/DatabaseMysqlBase.php M includes/db/DatabaseOracle.php M includes/db/DatabasePostgres.php M includes/db/DatabaseSqlite.php D includes/db/DatabaseUtility.php R includes/libs/rdbms/database/DBConnRef.php A includes/libs/rdbms/database/position/DBMasterPos.php A includes/libs/rdbms/database/position/MySQLMasterPos.php A includes/libs/rdbms/database/resultwrapper/FakeResultWrapper.php A includes/libs/rdbms/database/resultwrapper/MssqlResultWrapper.php A includes/libs/rdbms/database/resultwrapper/ResultWrapper.php A includes/libs/rdbms/encasing/Blob.php A includes/libs/rdbms/encasing/LikeMatch.php A includes/libs/rdbms/encasing/MssqlBlob.php A includes/libs/rdbms/encasing/PostgresBlob.php A includes/libs/rdbms/field/Field.php A includes/libs/rdbms/field/MssqlField.php A includes/libs/rdbms/field/MySQLField.php A includes/libs/rdbms/field/ORAField.php A includes/libs/rdbms/field/SQLiteField.php 22 files changed, 812 insertions(+), 846 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 759c715..1ebf728 100644 --- a/autoload.php +++ b/autoload.php @@ -189,7 +189,7 @@ 'BitmapHandler' => __DIR__ . '/includes/media/Bitmap.php', 'BitmapHandler_ClientOnly' => __DIR__ . '/includes/media/Bitmap_ClientOnly.php', 'BitmapMetadataHandler' => __DIR__ . '/includes/media/BitmapMetadataHandler.php', - 'Blob' => __DIR__ . '/includes/db/DatabaseUtility.php', + 'Blob' => __DIR__ . '/includes/libs/rdbms/encasing/Blob.php', 'Block' => __DIR__ . '/includes/Block.php', 'BlockLevelPass' => __DIR__ . '/includes/parser/BlockLevelPass.php', 'BlockListPager' => __DIR__ . '/includes/specials/pagers/BlockListPager.php', @@ -299,13 +299,13 @@ 'DBAccessBase' => __DIR__ . '/includes/dao/DBAccessBase.php', 'DBAccessError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBAccessObjectUtils' => __DIR__ . '/includes/dao/DBAccessObjectUtils.php', - 'DBConnRef' => __DIR__ . '/includes/libs/rdbms/database/RBConnRef.php', + 'DBConnRef' => __DIR__ . '/includes/libs/rdbms/database/DBConnRef.php', 'DBConnectionError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBExpectedError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBFileJournal' => __DIR__ . '/includes/filebackend/filejournal/DBFileJournal.php', 'DBLockManager' => __DIR__ . '/includes/filebackend/lockmanager/DBLockManager.php', - 'DBMasterPos' => __DIR__ . '/includes/db/DatabaseUtility.php', + 'DBMasterPos' => __DIR__ . '/includes/libs/rdbms/database/position/DBMasterPos.php', 'DBQueryError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBReadOnlyError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBReplicationWaitError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', @@ -440,7 +440,7 @@ 'FakeAuthTemplate' => __DIR__ . '/includes/specialpage/LoginSignupSpecialPage.php', 'FakeConverter' => __DIR__ . '/languages/FakeConverter.php', 'FakeMaintenance' => __DIR__ . '/maintenance/Maintenance.php', - 'FakeResultWrapper' => __DIR__ . '/includes/db/DatabaseUtility.php', + 'FakeResultWrapper' => __DIR__ . '/includes/libs/rdbms/database/resultwrapper/FakeResultWrapper.php', 'FatalError' => __DIR__ . '/includes/exception/FatalError.php', 'FauxRequest' => __DIR__ . '/includes/FauxRequest.php', 'FauxResponse' => __DIR__ . '/includes/WebResponse.php', @@ -448,7 +448,7 @@ 'FeedUtils' => __DIR__ . '/includes/FeedUtils.php', 'FetchText' => __DIR__ . '/maintenance/fetchText.php', 'FewestrevisionsPage' => __DIR__ . '/includes/specials/SpecialFewestrevisions.php', - 'Field' => __DIR__ . '/includes/db/DatabaseUtility.php', + 'Field' => __DIR__ . '/includes/libs/rdbms/field/Field.php', 'File' => __DIR__ . '/includes/filerepo/file/File.php', 'FileAwareNodeVisitor' => __DIR__ . '/maintenance/findDeprecated.php', 'FileBackend' => __DIR__ . '/includes/filebackend/FileBackend.php', @@ -715,7 +715,7 @@ 'LegacyLogFormatter' => __DIR__ . '/includes/logging/LogFormatter.php', 'License' => __DIR__ . '/includes/Licenses.php', 'Licenses' => __DIR__ . '/includes/Licenses.php', - 'LikeMatch' => __DIR__ . '/includes/db/DatabaseUtility.php', + 'LikeMatch' => __DIR__ . '/includes/libs/rdbms/encasing/LikeMatch.php',
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Avoid deprecated LBFactory::singleton() in tests
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310726 Change subject: Avoid deprecated LBFactory::singleton() in tests .. Avoid deprecated LBFactory::singleton() in tests Change-Id: Ic6dadd663826cfe95593c9b85ee06e22ac5ffbfb --- M client/includes/Hooks/ChangesListSpecialPageHookHandlers.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/26/310726/1 diff --git a/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php b/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php index ab0a78d..97f7df6 100644 --- a/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php +++ b/client/includes/Hooks/ChangesListSpecialPageHookHandlers.php @@ -13,6 +13,7 @@ use Wikibase\Client\RecentChanges\RecentChangeFactory; use Wikibase\Client\WikibaseClient; use Wikimedia\Assert\Assert; +use \MediaWiki\MediaWikiServices; /** * @since 0.5 @@ -90,7 +91,7 @@ return new self( $context->getRequest(), $context->getUser(), - LBFactory::singleton()->getMainLB(), + MediaWikiServices::getInstance()->getDBLoadBalancer(); $specialPageName, $settings->getSetting( 'showExternalRecentChanges' ) ); -- To view, visit https://gerrit.wikimedia.org/r/310726 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic6dadd663826cfe95593c9b85ee06e22ac5ffbfb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase 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]: Move LoadBalancer to /libs/rdbms
jenkins-bot has submitted this change and it was merged. Change subject: Move LoadBalancer to /libs/rdbms .. Move LoadBalancer to /libs/rdbms Change-Id: Ic87f1cc84ba44be20f345944406e1d8a34be1c96 --- M autoload.php R includes/libs/rdbms/loadbalancer/LoadBalancer.php 2 files changed, 1 insertion(+), 1 deletion(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index c5a62da..759c715 100644 --- a/autoload.php +++ b/autoload.php @@ -728,7 +728,7 @@ 'ListToggle' => __DIR__ . '/includes/ListToggle.php', 'ListVariants' => __DIR__ . '/maintenance/language/listVariants.php', 'ListredirectsPage' => __DIR__ . '/includes/specials/SpecialListredirects.php', - 'LoadBalancer' => __DIR__ . '/includes/db/loadbalancer/LoadBalancer.php', + 'LoadBalancer' => __DIR__ . '/includes/libs/rdbms/loadbalancer/LoadBalancer.php', 'LoadBalancerSingle' => __DIR__ . '/includes/db/loadbalancer/LBFactorySingle.php', 'LoadMonitor' => __DIR__ . '/includes/libs/rdbms/loadmonitor/LoadMonitor.php', 'LoadMonitorMySQL' => __DIR__ . '/includes/libs/rdbms/loadmonitor/LoadMonitorMySQL.php', diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/libs/rdbms/loadbalancer/LoadBalancer.php similarity index 100% rename from includes/db/loadbalancer/LoadBalancer.php rename to includes/libs/rdbms/loadbalancer/LoadBalancer.php -- To view, visit https://gerrit.wikimedia.org/r/310512 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic87f1cc84ba44be20f345944406e1d8a34be1c96 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...examples[master]: Change Commit
Himavarshini has uploaded a new change for review. https://gerrit.wikimedia.org/r/310725 Change subject: Change Commit .. Change Commit Change-Id: I523ba3403adef25bf7ddeea2c8b9623faaa3d7e5 --- M Example/Example.php 1 file changed, 21 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/examples refs/changes/25/310725/1 diff --git a/Example/Example.php b/Example/Example.php index 4d35a95..958fe93 100644 --- a/Example/Example.php +++ b/Example/Example.php @@ -1,3 +1,7 @@ +ey name of the message containing the description. + 'descriptionmsg' => 'example-desc', +); + __FILE__, +'path' => __FILE__, - // Name of your Extension: - 'name' => 'Example', +// Name of your Extension: +'name' => 'Example', - // Sometime other patches contributors and minor authors are not worth - // mentionning, you can use the special case '...' to output a localised - // message 'and others...'. - 'author' => array( - 'Jane Doe', - 'George Foo', - '...' - ), +// Sometime other patches contributors and minor authors are not worth +// mentionning, you can use the special case '...' to output a localised +// message 'and others...'. +'author' => array( +'Jane Doe', +'George Foo', +'...' +), - 'version' => '0.1.0', +'version' => '0.1.0', - // The extension homepage. www.mediawiki.org will be happy to host - // your extension homepage. - 'url' => 'https://www.mediawiki.org/wiki/Extension:Example', +// The extension homepage. www.mediawiki.org will be happy to host +// your extension homepage. +'url' => 'https://www.mediawiki.org/wiki/Extension:Example', +//Change added is tis line - # Key name of the message containing the description. - 'descriptionmsg' => 'example-desc', -); - +# K /* Setup */ // Initialize an easy to use shortcut: -- To view, visit https://gerrit.wikimedia.org/r/310725 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I523ba3403adef25bf7ddeea2c8b9623faaa3d7e5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/examples Gerrit-Branch: master Gerrit-Owner: Himavarshini___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Fix: The topic name is revision-visibility-change
Mobrovac has submitted this change and it was merged. Change subject: Fix: The topic name is revision-visibility-change .. Fix: The topic name is revision-visibility-change Change-Id: Iaec4f943add5eb6608edea2e684a0fb7f13bacac --- M scap/templates/config.yaml.j2 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mobrovac: Verified; Looks good to me, approved diff --git a/scap/templates/config.yaml.j2 b/scap/templates/config.yaml.j2 index 9d2fdfd..a032417 100644 --- a/scap/templates/config.yaml.j2 +++ b/scap/templates/config.yaml.j2 @@ -215,7 +215,7 @@ redirect: false revision_visibility_change: - topic: mediawiki.revision-visibility-set + topic: mediawiki.revision-visibility-change ignore: status: - 403 # When the revision is hidden 403 will be returned by RESTBase, it's a valid situation -- To view, visit https://gerrit.wikimedia.org/r/310555 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaec4f943add5eb6608edea2e684a0fb7f13bacac Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/change-propagation/deploy Gerrit-Branch: master Gerrit-Owner: MobrovacGerrit-Reviewer: Mobrovac Gerrit-Reviewer: Ppchelko ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Change DatabaseBase => IDatabase in /db where possible
jenkins-bot has submitted this change and it was merged. Change subject: Change DatabaseBase => IDatabase in /db where possible .. Change DatabaseBase => IDatabase in /db where possible Change-Id: Ia0a049cd4294c5a39aa9ed228d4eb5b15736ea1f --- M includes/db/CloneDatabase.php M includes/db/Database.php M includes/db/DatabaseMssql.php M includes/db/DatabaseMysqlBase.php M includes/db/DatabaseOracle.php M includes/db/DatabasePostgres.php M includes/db/DatabaseSqlite.php M includes/db/DatabaseUtility.php M includes/db/loadbalancer/LBFactorySingle.php M includes/db/loadbalancer/LoadBalancer.php M includes/libs/rdbms/database/IDatabase.php M includes/libs/rdbms/database/RBConnRef.php 12 files changed, 65 insertions(+), 68 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 97d59d8..caca7e2 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -43,13 +43,13 @@ /** * Constructor * -* @param DatabaseBase $db A database subclass +* @param IDatabase $db A database subclass * @param array $tablesToClone An array of tables to clone, unprefixed * @param string $newTablePrefix Prefix to assign to the tables * @param string $oldTablePrefix Prefix on current tables, if not $wgDBprefix * @param bool $dropCurrentTables */ - public function __construct( DatabaseBase $db, array $tablesToClone, + public function __construct( IDatabase $db, array $tablesToClone, $newTablePrefix, $oldTablePrefix = '', $dropCurrentTables = true ) { $this->db = $db; @@ -131,7 +131,7 @@ global $wgDBprefix; wfGetLBFactory()->forEachLB( function( LoadBalancer $lb ) use ( $prefix ) { $lb->setDomainPrefix( $prefix ); - $lb->forEachOpenConnection( function ( DatabaseBase $db ) use ( $prefix ) { + $lb->forEachOpenConnection( function ( IDatabase $db ) use ( $prefix ) { $db->tablePrefix( $prefix ); } ); } ); diff --git a/includes/db/Database.php b/includes/db/Database.php index 109dbfe..e68a8f2 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -231,7 +231,7 @@ * connection object, by specifying no parameters to __construct(). This * feature is deprecated and should be removed. * -* DatabaseBase subclasses should not be constructed directly in external +* IDatabase classes should not be constructed directly in external * code. DatabaseBase::factory() should be used instead. * * @param array $params Parameters passed from DatabaseBase::factory() @@ -301,7 +301,7 @@ /** * Given a DB type, construct the name of the appropriate child class of -* DatabaseBase. This is designed to replace all of the manual stuff like: +* IDatabase. This is designed to replace all of the manual stuff like: *$class = 'Database' . ucfirst( strtolower( $dbType ) ); * as well as validate against the canonical list of DB types we have * @@ -318,8 +318,8 @@ * @param string $dbType A possible DB type * @param array $p An array of options to pass to the constructor. *Valid options are: host, user, password, dbname, flags, tablePrefix, schema, driver -* @throws MWException If the database driver or extension cannot be found -* @return DatabaseBase|null DatabaseBase subclass or null +* @return IDatabase|null If the database driver or extension cannot be found +* @throws MWException */ final public static function factory( $dbType, $p = [] ) { global $wgCommandLineMode; @@ -368,7 +368,7 @@ ]; $class = 'Database' . ucfirst( $driver ); - if ( class_exists( $class ) && is_subclass_of( $class, 'DatabaseBase' ) ) { + if ( class_exists( $class ) && is_subclass_of( $class, 'IDatabase' ) ) { // Resolve some defaults for b/c $p['host'] = isset( $p['host'] ) ? $p['host'] : false; $p['user'] = isset( $p['user'] ) ? $p['user'] : false; @@ -398,7 +398,7 @@ } public function setLogger( LoggerInterface $logger ) { - $this->quertLogger = $logger; + $this->queryLogger = $logger; } public function getServerInfo() { @@ -494,12 +494,6 @@ } } - /** -* Set a lazy-connecting DB handle to the master DB (for replication status purposes) -* -* @param IDatabase $conn -* @since
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Remove handling for bad data (language = '_' as we are clean...
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/310724 Change subject: Remove handling for bad data (language = '_' as we are cleaning that up .. Remove handling for bad data (language = '_' as we are cleaning that up Bug: T96410 Change-Id: I796d2e859da7d25dd8316dd795012cbd2397d066 --- M sites/all/modules/thank_you/thank_you.module 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/24/310724/1 diff --git a/sites/all/modules/thank_you/thank_you.module b/sites/all/modules/thank_you/thank_you.module index 69b0ccc..714ffc5 100644 --- a/sites/all/modules/thank_you/thank_you.module +++ b/sites/all/modules/thank_you/thank_you.module @@ -324,7 +324,7 @@ } $locale = $contact['preferred_language']; -if ( !$locale or substr( $locale, 0, 1 ) === '_' ) { +if ( !$locale ) { watchdog( 'thank_you', "Donor language unknown. Defaulting to English...", NULL, WATCHDOG_INFO ); $locale = 'en'; } -- To view, visit https://gerrit.wikimedia.org/r/310724 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I796d2e859da7d25dd8316dd795012cbd2397d066 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/config[master]: mediawiki: Merge parsertests job back into main phpunit job
jenkins-bot has submitted this change and it was merged. Change subject: mediawiki: Merge parsertests job back into main phpunit job .. mediawiki: Merge parsertests job back into main phpunit job This was originally separated because the parser tests were too slow. Since recent refactoring they are much much faster. By accident, the refactor also broke --exclude-group=ParserTests (fixed in I8131c3b13). This meant that for the past week we've already been running parser tests in the main phpunit jobs as well. And still, it wasn't the slowest job. Change-Id: Ic2934746be68c06c1fc747e93f4fa73200eba652 --- M jjb/mediawiki.yaml M zuul/layout.yaml 2 files changed, 4 insertions(+), 81 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/jjb/mediawiki.yaml b/jjb/mediawiki.yaml index 1342e29..033b930 100644 --- a/jjb/mediawiki.yaml +++ b/jjb/mediawiki.yaml @@ -105,7 +105,7 @@ publishers: - mw-teardown -# Runs all MediaWiki tests under hhvm on Nodepool instances +# Runs all MediaWiki PHPUnit tests on Nodepool - job-template: name: 'mediawiki-phpunit-{phpflavor}-{image}' node: ci-{image}-wikimedia @@ -124,43 +124,13 @@ - mw-install-mysql - mw-apply-settings - mw-fetch-composer-dev - # ParserTests tests are run via 'mediawiki-phpunit-parsertests-phpflavor' - - shell: "PHPUNIT_EXCLUDE_GROUP=ParserTests /srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" + - shell: "/srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" publishers: - phpunit-junit-2 - archive-log-dir - castor-save -# Only runs the 'parsertests' MediaWiki test suite on Nodepool instances -# Complements 'mediawiki-phpunit-{phpflavor}-{image}' -- job-template: -name: 'mediawiki-parsertests-{phpflavor}-{image}' -node: ci-{image}-wikimedia -concurrent: true -triggers: - - zuul -builders: - - castor-load - - assert-phpflavor: - phpflavor: '{phpflavor}' - - hhvm-clear-hhbc - - zuul-cloner: - projects: > - mediawiki/core - mediawiki/vendor - - mw-install-mysql - - mw-apply-settings - - mw-fetch-composer-dev - - shell: "PHPUNIT_TESTSUITE=parsertests /srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" -publishers: - - phpunit-junit-2 - - archive-log-dir - - castor-save - -# Runs subset of MediaWiki tests -# -# Excludes '@group ParserTests' tests which are run in parallel via -# mediawiki-phpunit-parsertests-{phpflavor} +# Runs all MediaWiki PHPUnit tests on a CI slave - job-template: name: 'mediawiki-phpunit-{phpflavor}' node: 'contintLabsSlave && phpflavor-{phpflavor}' @@ -180,37 +150,7 @@ - mw-install-mysql - mw-apply-settings - mw-fetch-composer-dev - # ParserTests tests are run via 'mediawiki-phpunit-parsertests-phpflavor' - - shell: "PHPUNIT_EXCLUDE_GROUP=ParserTests /srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" -publishers: - - phpunit-junit-2 - - mw-teardown-mysql - - archive-log-dir - -# mediawiki-phpunit-parsertests-{phpflavor} -# -# Only runs the 'parsertests' MediaWiki testsuite. -# Complements 'mediawiki-phpunit-{phpflavor}'. -- job-template: -name: 'mediawiki-phpunit-parsertests-{phpflavor}' -node: 'contintLabsSlave && phpflavor-{phpflavor}' -concurrent: true -properties: - - throttle-one-per-node -triggers: - - zuul -builders: - - assert-phpflavor: - phpflavor: '{phpflavor}' - - hhvm-clear-hhbc - - zuul-cloner: - projects: > - mediawiki/core - mediawiki/vendor - - mw-install-mysql - - mw-apply-settings - - mw-fetch-composer-dev - - shell: "PHPUNIT_TESTSUITE=parsertests /srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" + - shell: "/srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" publishers: - phpunit-junit-2 - mw-teardown-mysql @@ -361,9 +301,6 @@ - 'mediawiki-phpunit-{phpflavor}': phpflavor: - php53 - - 'mediawiki-phpunit-parsertests-{phpflavor}': - phpflavor: - - php53 - 'mediawiki-phpunit-{phpflavor}-{image}': _images phpflavor: - php55: @@ -373,7 +310,6 @@ image: trusty - hhvm: image: jessie - - 'mediawiki-parsertests-{phpflavor}-{image}': *phpflavor_images - 'mediawiki-phpunit-{phpflavor}-composer' - 'mediawiki-extensions-{phpflavor}': diff --git a/zuul/layout.yaml b/zuul/layout.yaml index e522fca..40da7e5 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -1339,15 +1339,12 @@ - mediawiki-core-php53lint - mediawiki-core-php55lint - mediawiki-phpunit-hhvm-trusty - - mediawiki-parsertests-hhvm-trusty -
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Change $wiki => $domain in LoadBalancer
jenkins-bot has submitted this change and it was merged. Change subject: Change $wiki => $domain in LoadBalancer .. Change $wiki => $domain in LoadBalancer Change-Id: I97f96383c501e9b3262c11d143795b82ae36aca5 --- M includes/db/loadbalancer/LoadBalancer.php 1 file changed, 74 insertions(+), 74 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/db/loadbalancer/LoadBalancer.php index 841231b..f2cf232 100644 --- a/includes/db/loadbalancer/LoadBalancer.php +++ b/includes/db/loadbalancer/LoadBalancer.php @@ -82,7 +82,7 @@ private $trxRoundId = false; /** @var array[] Map of (name => callable) */ private $trxRecurringCallbacks = []; - /** @var string Local Wiki ID and default for selectDB() calls */ + /** @var string Local Domain ID and default for selectDB() calls */ private $localDomain; /** @var string Current server name */ private $host; @@ -202,12 +202,12 @@ /** * @param array $loads -* @param bool|string $wiki Wiki to get non-lagged for +* @param bool|string $domain Domain to get non-lagged for * @param int $maxLag Restrict the maximum allowed lag to this many seconds * @return bool|int|string */ - private function getRandomNonLagged( array $loads, $wiki = false, $maxLag = INF ) { - $lags = $this->getLagTimes( $wiki ); + private function getRandomNonLagged( array $loads, $domain = false, $maxLag = INF ) { + $lags = $this->getLagTimes( $domain ); # Unset excessively lagged servers foreach ( $lags as $i => $lag ) { @@ -251,7 +251,7 @@ return ArrayUtils::pickRandom( $loads ); } - public function getReaderIndex( $group = false, $wiki = false ) { + public function getReaderIndex( $group = false, $domain = false ) { if ( count( $this->mServers ) == 1 ) { # Skip the load balancing if there's only one server return $this->getWriterIndex(); @@ -279,7 +279,7 @@ } # Scale the configured load ratios according to the dynamic load if supported - $this->getLoadMonitor()->scaleLoads( $nonErrorLoads, $group, $wiki ); + $this->getLoadMonitor()->scaleLoads( $nonErrorLoads, $group, $domain ); $laggedReplicaMode = false; @@ -299,11 +299,11 @@ # avoid lagged servers so as to avoid just blocking in that method. $ago = microtime( true ) - $this->mWaitForPos->asOfTime(); # Aim for <= 1 second of waiting (being too picky can backfire) - $i = $this->getRandomNonLagged( $currentLoads, $wiki, $ago + 1 ); + $i = $this->getRandomNonLagged( $currentLoads, $domain, $ago + 1 ); } if ( $i === false ) { # Any server with less lag than it's 'max lag' param is preferable - $i = $this->getRandomNonLagged( $currentLoads, $wiki ); + $i = $this->getRandomNonLagged( $currentLoads, $domain ); } if ( $i === false && count( $currentLoads ) != 0 ) { # All replica DBs lagged. Switch to read-only mode @@ -325,9 +325,9 @@ $serverName = $this->getServerName( $i ); $this->connLogger->debug( __METHOD__ . ": Using reader #$i: $serverName..." ); - $conn = $this->openConnection( $i, $wiki ); + $conn = $this->openConnection( $i, $domain ); if ( !$conn ) { - $this->connLogger->warning( __METHOD__ . ": Failed connecting to $i/$wiki" ); + $this->connLogger->warning( __METHOD__ . ": Failed connecting to $i/$domain" ); unset( $nonErrorLoads[$i] ); unset( $currentLoads[$i] ); $i = false; @@ -336,7 +336,7 @@ // Decrement reference counter, we are finished with this connection. // It will be incremented for the caller later. - if ( $wiki !== false ) { + if ( $domain !== false ) { $this->reuseConnection( $conn ); } @@ -500,14 +500,14 @@ return $ok; } - public function getConnection(
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Exception cleanups for LoadBalancer
jenkins-bot has submitted this change and it was merged. Change subject: Exception cleanups for LoadBalancer .. Exception cleanups for LoadBalancer * Make the error message itself be dumb/raw. * Make the exception exposer show the same GUI message. * Remove overzelous wgLang check in MWExceptionRenderer. Change-Id: If3b3cc785ea3080e4975efe33b3c2cf304d6 --- M autoload.php M includes/db/loadbalancer/LoadBalancer.php M includes/exception/MWExceptionRenderer.php M includes/libs/rdbms/exception/DBError.php 4 files changed, 41 insertions(+), 11 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 66736b3..b9fd6bd 100644 --- a/autoload.php +++ b/autoload.php @@ -311,6 +311,7 @@ 'DBReplicationWaitError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBSiteStore' => __DIR__ . '/includes/site/DBSiteStore.php', 'DBTransactionError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', + 'DBTransactionSizeError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBUnexpectedError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DataUpdate' => __DIR__ . '/includes/deferred/DataUpdate.php', 'Database' => __DIR__ . '/includes/db/Database.php', diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/db/loadbalancer/LoadBalancer.php index 841231b..b5c6f98 100644 --- a/includes/db/loadbalancer/LoadBalancer.php +++ b/includes/db/loadbalancer/LoadBalancer.php @@ -784,7 +784,8 @@ } if ( !is_array( $server ) ) { - throw new InvalidArgumentException( 'You must update your load-balancing configuration. ' . + throw new InvalidArgumentException( + 'You must update your load-balancing configuration. ' . 'See DefaultSettings.php entry for $wgDBservers.' ); } @@ -1034,10 +1035,10 @@ // If this fails, then all DB transactions will be rollback back together. $time = $conn->pendingWriteQueryDuration( $conn::ESTIMATE_DB_APPLY ); if ( $limit > 0 && $time > $limit ) { - throw new DBTransactionError( + throw new DBTransactionSizeError( $conn, "Transaction spent $time second(s) in writes, exceeding the $limit limit.", - wfMessage( 'transaction-duration-limit-exceeded', $time, $limit )->text() + [ $time, $limit ] ); } // If a connection sits idle while slow queries execute on another, that connection diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index f455191..58b4ac7 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -134,15 +134,13 @@ */ private static function useOutputPage( Exception $e ) { // Can the extension use the Message class/wfMessage to get i18n-ed messages? - $useMessageCache = ( $GLOBALS['wgLang'] instanceof Language ); foreach ( $e->getTrace() as $frame ) { if ( isset( $frame['class'] ) && $frame['class'] === 'LocalisationCache' ) { - $useMessageCache = false; + return false; } } return ( - $useMessageCache && !empty( $GLOBALS['wgFullyInitialised'] ) && !empty( $GLOBALS['wgOut'] ) && !defined( 'MEDIAWIKI_INSTALL' ) @@ -172,6 +170,10 @@ if ( $hookResult ) { $wgOut->addHTML( $hookResult ); } else { + // Show any custom GUI message before the details + if ( $e instanceof MessageSpecifier ) { + $wgOut->addHtml( Message::newFromSpecifier( $e )->escaped() ); + } $wgOut->addHTML( self::getHTML( $e ) ); } @@ -209,14 +211,14 @@ */ private static function getHTML( Exception $e ) { if ( self::showBackTrace( $e ) ) { - return '' . + $html = "" . nl2br( htmlspecialchars( MWExceptionHandler::getLogMessage( $e ) ) ) . 'Backtrace:' .
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Change $wiki => $domain in LoadBalancer
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310723 Change subject: Change $wiki => $domain in LoadBalancer .. Change $wiki => $domain in LoadBalancer Change-Id: I97f96383c501e9b3262c11d143795b82ae36aca5 --- M includes/db/loadbalancer/LoadBalancer.php 1 file changed, 74 insertions(+), 74 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/23/310723/1 diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/db/loadbalancer/LoadBalancer.php index 841231b..f2cf232 100644 --- a/includes/db/loadbalancer/LoadBalancer.php +++ b/includes/db/loadbalancer/LoadBalancer.php @@ -82,7 +82,7 @@ private $trxRoundId = false; /** @var array[] Map of (name => callable) */ private $trxRecurringCallbacks = []; - /** @var string Local Wiki ID and default for selectDB() calls */ + /** @var string Local Domain ID and default for selectDB() calls */ private $localDomain; /** @var string Current server name */ private $host; @@ -202,12 +202,12 @@ /** * @param array $loads -* @param bool|string $wiki Wiki to get non-lagged for +* @param bool|string $domain Domain to get non-lagged for * @param int $maxLag Restrict the maximum allowed lag to this many seconds * @return bool|int|string */ - private function getRandomNonLagged( array $loads, $wiki = false, $maxLag = INF ) { - $lags = $this->getLagTimes( $wiki ); + private function getRandomNonLagged( array $loads, $domain = false, $maxLag = INF ) { + $lags = $this->getLagTimes( $domain ); # Unset excessively lagged servers foreach ( $lags as $i => $lag ) { @@ -251,7 +251,7 @@ return ArrayUtils::pickRandom( $loads ); } - public function getReaderIndex( $group = false, $wiki = false ) { + public function getReaderIndex( $group = false, $domain = false ) { if ( count( $this->mServers ) == 1 ) { # Skip the load balancing if there's only one server return $this->getWriterIndex(); @@ -279,7 +279,7 @@ } # Scale the configured load ratios according to the dynamic load if supported - $this->getLoadMonitor()->scaleLoads( $nonErrorLoads, $group, $wiki ); + $this->getLoadMonitor()->scaleLoads( $nonErrorLoads, $group, $domain ); $laggedReplicaMode = false; @@ -299,11 +299,11 @@ # avoid lagged servers so as to avoid just blocking in that method. $ago = microtime( true ) - $this->mWaitForPos->asOfTime(); # Aim for <= 1 second of waiting (being too picky can backfire) - $i = $this->getRandomNonLagged( $currentLoads, $wiki, $ago + 1 ); + $i = $this->getRandomNonLagged( $currentLoads, $domain, $ago + 1 ); } if ( $i === false ) { # Any server with less lag than it's 'max lag' param is preferable - $i = $this->getRandomNonLagged( $currentLoads, $wiki ); + $i = $this->getRandomNonLagged( $currentLoads, $domain ); } if ( $i === false && count( $currentLoads ) != 0 ) { # All replica DBs lagged. Switch to read-only mode @@ -325,9 +325,9 @@ $serverName = $this->getServerName( $i ); $this->connLogger->debug( __METHOD__ . ": Using reader #$i: $serverName..." ); - $conn = $this->openConnection( $i, $wiki ); + $conn = $this->openConnection( $i, $domain ); if ( !$conn ) { - $this->connLogger->warning( __METHOD__ . ": Failed connecting to $i/$wiki" ); + $this->connLogger->warning( __METHOD__ . ": Failed connecting to $i/$domain" ); unset( $nonErrorLoads[$i] ); unset( $currentLoads[$i] ); $i = false; @@ -336,7 +336,7 @@ // Decrement reference counter, we are finished with this connection. // It will be incremented for the caller later. - if ( $wiki !== false ) { + if ( $domain !== false ) { $this->reuseConnection( $conn ); } @@ -500,14 +500,14 @@ return $ok;
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: phpunit: Simplify mock object syntax in includes/db/ tests
jenkins-bot has submitted this change and it was merged. Change subject: phpunit: Simplify mock object syntax in includes/db/ tests .. phpunit: Simplify mock object syntax in includes/db/ tests * Omit redundant `expects( $this->any() )`. * Use willReturn() instead of `will( $this->returnValue() )`. Change-Id: If90ac651748af8a78a720992240e40ba53cec79c --- M tests/phpunit/includes/db/DatabaseMysqlBaseTest.php M tests/phpunit/includes/db/LBFactoryTest.php 2 files changed, 18 insertions(+), 34 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php index 607f25c..f13ead4 100644 --- a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php +++ b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php @@ -169,15 +169,11 @@ ->setMethods( [ 'fetchRow', 'query' ] ) ->getMock(); - $db->expects( $this->any() ) - ->method( 'query' ) + $db->method( 'query' ) ->with( $this->anything() ) - ->will( - $this->returnValue( null ) - ); + ->willReturn( null ); - $db->expects( $this->any() ) - ->method( 'fetchRow' ) + $db->method( 'fetchRow' ) ->with( $this->anything() ) ->will( $this->onConsecutiveCalls( [ 'Tables_in_' => 'view1' ], @@ -361,13 +357,11 @@ 'getLagDetectionMethod', 'getHeartbeatData', 'getMasterServerInfo' ] ) ->getMock(); - $db->expects( $this->any() ) - ->method( 'getLagDetectionMethod' ) - ->will( $this->returnValue( 'pt-heartbeat' ) ); + $db->method( 'getLagDetectionMethod' ) + ->willReturn( 'pt-heartbeat' ); - $db->expects( $this->any() ) - ->method( 'getMasterServerInfo' ) - ->will( $this->returnValue( [ 'serverId' => 172, 'asOf' => time() ] ) ); + $db->method( 'getMasterServerInfo' ) + ->willReturn( [ 'serverId' => 172, 'asOf' => time() ] ); // Fake the current time. list( $nowSecFrac, $nowSec ) = explode( ' ', microtime() ); @@ -381,10 +375,9 @@ $ptTimeISO = $ptDateTime->format( 'Y-m-d\TH:i:s' ); $ptTimeISO .= ltrim( number_format( $ptSecFrac, 6 ), '0' ); - $db->expects( $this->any() ) - ->method( 'getHeartbeatData' ) + $db->method( 'getHeartbeatData' ) ->with( [ 'server_id' => 172 ] ) - ->will( $this->returnValue( [ $ptTimeISO, $now ] ) ); + ->willReturn( [ $ptTimeISO, $now ] ); $db->setLBInfo( 'clusterMasterHost', 'db1052' ); $lagEst = $db->getLag(); diff --git a/tests/phpunit/includes/db/LBFactoryTest.php b/tests/phpunit/includes/db/LBFactoryTest.php index bf78d13..862ec42 100644 --- a/tests/phpunit/includes/db/LBFactoryTest.php +++ b/tests/phpunit/includes/db/LBFactoryTest.php @@ -159,26 +159,18 @@ $mockDB = $this->getMockBuilder( 'DatabaseMysql' ) ->disableOriginalConstructor() ->getMock(); - $mockDB->expects( $this->any() ) - ->method( 'writesOrCallbacksPending' )->will( $this->returnValue( true ) ); - $mockDB->expects( $this->any() ) - ->method( 'lastDoneWrites' )->will( $this->returnValue( $now ) ); - $mockDB->expects( $this->any() ) - ->method( 'getMasterPos' )->will( $this->returnValue( $mPos ) ); + $mockDB->method( 'writesOrCallbacksPending' )->willReturn( true ); + $mockDB->method( 'lastDoneWrites' )->willReturn( $now ); + $mockDB->method( 'getMasterPos' )->willReturn( $mPos ); $lb = $this->getMockBuilder( 'LoadBalancer' ) ->disableOriginalConstructor() ->getMock(); - $lb->expects( $this->any() ) - ->method( 'getConnection' )->will( $this->returnValue( $mockDB ) ); - $lb->expects( $this->any() ) - ->method( 'getServerCount' )->will( $this->returnValue( 2 ) ); - $lb->expects( $this->any() ) - ->method( 'parentInfo' )->will( $this->returnValue( [ 'id' => "main-DEFAULT" ] ) ); - $lb->expects( $this->any() ) - ->method( 'getAnyOpenConnection'
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Change DatabaseBase => IDatabase in /db where possible
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310722 Change subject: Change DatabaseBase => IDatabase in /db where possible .. Change DatabaseBase => IDatabase in /db where possible Change-Id: Ia0a049cd4294c5a39aa9ed228d4eb5b15736ea1f --- M includes/db/CloneDatabase.php M includes/db/Database.php M includes/db/DatabaseMssql.php M includes/db/DatabaseMysqlBase.php M includes/db/DatabaseOracle.php M includes/db/DatabasePostgres.php M includes/db/DatabaseSqlite.php M includes/db/DatabaseUtility.php M includes/db/loadbalancer/LBFactorySingle.php M includes/db/loadbalancer/LoadBalancer.php M includes/libs/rdbms/database/IDatabase.php M includes/libs/rdbms/database/RBConnRef.php 12 files changed, 65 insertions(+), 68 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/22/310722/1 diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 97d59d8..caca7e2 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -43,13 +43,13 @@ /** * Constructor * -* @param DatabaseBase $db A database subclass +* @param IDatabase $db A database subclass * @param array $tablesToClone An array of tables to clone, unprefixed * @param string $newTablePrefix Prefix to assign to the tables * @param string $oldTablePrefix Prefix on current tables, if not $wgDBprefix * @param bool $dropCurrentTables */ - public function __construct( DatabaseBase $db, array $tablesToClone, + public function __construct( IDatabase $db, array $tablesToClone, $newTablePrefix, $oldTablePrefix = '', $dropCurrentTables = true ) { $this->db = $db; @@ -131,7 +131,7 @@ global $wgDBprefix; wfGetLBFactory()->forEachLB( function( LoadBalancer $lb ) use ( $prefix ) { $lb->setDomainPrefix( $prefix ); - $lb->forEachOpenConnection( function ( DatabaseBase $db ) use ( $prefix ) { + $lb->forEachOpenConnection( function ( IDatabase $db ) use ( $prefix ) { $db->tablePrefix( $prefix ); } ); } ); diff --git a/includes/db/Database.php b/includes/db/Database.php index 109dbfe..e68a8f2 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -231,7 +231,7 @@ * connection object, by specifying no parameters to __construct(). This * feature is deprecated and should be removed. * -* DatabaseBase subclasses should not be constructed directly in external +* IDatabase classes should not be constructed directly in external * code. DatabaseBase::factory() should be used instead. * * @param array $params Parameters passed from DatabaseBase::factory() @@ -301,7 +301,7 @@ /** * Given a DB type, construct the name of the appropriate child class of -* DatabaseBase. This is designed to replace all of the manual stuff like: +* IDatabase. This is designed to replace all of the manual stuff like: *$class = 'Database' . ucfirst( strtolower( $dbType ) ); * as well as validate against the canonical list of DB types we have * @@ -318,8 +318,8 @@ * @param string $dbType A possible DB type * @param array $p An array of options to pass to the constructor. *Valid options are: host, user, password, dbname, flags, tablePrefix, schema, driver -* @throws MWException If the database driver or extension cannot be found -* @return DatabaseBase|null DatabaseBase subclass or null +* @return IDatabase|null If the database driver or extension cannot be found +* @throws MWException */ final public static function factory( $dbType, $p = [] ) { global $wgCommandLineMode; @@ -368,7 +368,7 @@ ]; $class = 'Database' . ucfirst( $driver ); - if ( class_exists( $class ) && is_subclass_of( $class, 'DatabaseBase' ) ) { + if ( class_exists( $class ) && is_subclass_of( $class, 'IDatabase' ) ) { // Resolve some defaults for b/c $p['host'] = isset( $p['host'] ) ? $p['host'] : false; $p['user'] = isset( $p['user'] ) ? $p['user'] : false; @@ -398,7 +398,7 @@ } public function setLogger( LoggerInterface $logger ) { - $this->quertLogger = $logger; + $this->queryLogger = $logger; } public function getServerInfo() { @@ -494,12 +494,6 @@ } } - /** -* Set a lazy-connecting DB handle to the master DB (for replication status purposes) -* -*
[MediaWiki-commits] [Gerrit] operations/puppet[production]: toollabs: Remove unneeded puppet-lint ignore rules
Dzahn has submitted this change and it was merged. Change subject: toollabs: Remove unneeded puppet-lint ignore rules .. toollabs: Remove unneeded puppet-lint ignore rules They are not needed since puppet lint does not fail even if you take those lines out. Change-Id: I64fe8799505dac0a3f55af30e734fe89daa78cb7 --- M modules/toollabs/manifests/bastion.pp 1 file changed, 0 insertions(+), 5 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/toollabs/manifests/bastion.pp b/modules/toollabs/manifests/bastion.pp index 4536691..e587786 100644 --- a/modules/toollabs/manifests/bastion.pp +++ b/modules/toollabs/manifests/bastion.pp @@ -17,7 +17,6 @@ if os_version('ubuntu trusty') { -# lint:ignore:arrow_alignment cgred::group {'shell': order => '01', config => { @@ -38,7 +37,6 @@ # misc group for on-the-fly classification # of expensive processes as opposed to kill -# lint:ignore:arrow_alignment cgred::group {'throttle': config => { cpu=> { @@ -50,7 +48,6 @@ }, } -# lint:ignore:arrow_alignment cgred::group {'user-daemons': config => { cpu=> { @@ -67,7 +64,6 @@ ], } -# lint:ignore:arrow_alignment cgred::group {'scripts': config => { cpu=> { @@ -103,7 +99,6 @@ ], } -# lint:ignore:arrow_alignment cgred::group {'utilities': config => { cpu=> { -- To view, visit https://gerrit.wikimedia.org/r/310715 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64fe8799505dac0a3f55af30e734fe89daa78cb7 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: PaladoxGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: Chasemp Gerrit-Reviewer: Coren Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Hashar Gerrit-Reviewer: Merlijn van Deen 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] operations/puppet[production]: icinga/phab: adjust checkcommand for phabricator http check
Dzahn has submitted this change and it was merged. Change subject: icinga/phab: adjust checkcommand for phabricator http check .. icinga/phab: adjust checkcommand for phabricator http check For unknown reasons this existing check stopped working suddenly today. There was no change that can explain it. This is to show how changing the string to something else that is still on the front page mysteriously fixes it. Change-Id: I4d4477cabff724fa757cfbc29433cec37053080b --- M modules/nagios_common/files/checkcommands.cfg 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Dzahn: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/nagios_common/files/checkcommands.cfg b/modules/nagios_common/files/checkcommands.cfg index 8bc75ac..a60989c 100644 --- a/modules/nagios_common/files/checkcommands.cfg +++ b/modules/nagios_common/files/checkcommands.cfg @@ -487,7 +487,7 @@ # so it should trigger if 200 but shows something else define command { command_namecheck_https_phabricator -command_line$USER1$/check_http -S -H 'phabricator.wikimedia.org' -I misc-web-lb.wikimedia.org -u 'https://phabricator.wikimedia.org/' -s 'Wikimedia and MediaWiki' +command_line$USER1$/check_http -S -H 'phabricator.wikimedia.org' -I misc-web-lb.wikimedia.org -u 'https://phabricator.wikimedia.org/' -s 'focus on bug' } # check the Apple dictionary bridge on search.wm.org -- To view, visit https://gerrit.wikimedia.org/r/310721 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4d4477cabff724fa757cfbc29433cec37053080b Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: DzahnGerrit-Reviewer: 20after4 Gerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: icinga/phab: adjust checkcommand for phabricator http check
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/310721 Change subject: icinga/phab: adjust checkcommand for phabricator http check .. icinga/phab: adjust checkcommand for phabricator http check For unknown reasons this existing check stopped working suddenly today. There was no change that can explain it. This is to show how changing the string to something else that is still on the front page mysteriously fixes it. Change-Id: I4d4477cabff724fa757cfbc29433cec37053080b --- M modules/nagios_common/files/checkcommands.cfg 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/21/310721/1 diff --git a/modules/nagios_common/files/checkcommands.cfg b/modules/nagios_common/files/checkcommands.cfg index 8bc75ac..a60989c 100644 --- a/modules/nagios_common/files/checkcommands.cfg +++ b/modules/nagios_common/files/checkcommands.cfg @@ -487,7 +487,7 @@ # so it should trigger if 200 but shows something else define command { command_namecheck_https_phabricator -command_line$USER1$/check_http -S -H 'phabricator.wikimedia.org' -I misc-web-lb.wikimedia.org -u 'https://phabricator.wikimedia.org/' -s 'Wikimedia and MediaWiki' +command_line$USER1$/check_http -S -H 'phabricator.wikimedia.org' -I misc-web-lb.wikimedia.org -u 'https://phabricator.wikimedia.org/' -s 'focus on bug' } # check the Apple dictionary bridge on search.wm.org -- To view, visit https://gerrit.wikimedia.org/r/310721 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d4477cabff724fa757cfbc29433cec37053080b Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid MWException and wf* log methods in DatabaseBase
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310720 Change subject: Avoid MWException and wf* log methods in DatabaseBase .. Avoid MWException and wf* log methods in DatabaseBase Change-Id: Idc418ae1088f87d6416e2552976d94f7d1e8f5db --- M includes/db/Database.php M includes/db/DatabaseMssql.php M includes/db/DatabaseSqlite.php M includes/db/loadbalancer/LBFactoryMulti.php M includes/db/loadbalancer/LBFactorySimple.php M includes/db/loadbalancer/LoadBalancer.php 6 files changed, 36 insertions(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/20/310720/1 diff --git a/includes/db/Database.php b/includes/db/Database.php index 109dbfe..17761ff 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -69,6 +69,8 @@ protected $connLogger; /** @var LoggerInterface */ protected $queryLogger; + /** @var callback Error logging callback */ + protected $errorLogger; /** @var resource Database connection */ protected $mConn = null; @@ -318,7 +320,7 @@ * @param string $dbType A possible DB type * @param array $p An array of options to pass to the constructor. *Valid options are: host, user, password, dbname, flags, tablePrefix, schema, driver -* @throws MWException If the database driver or extension cannot be found +* @throws InvalidArgumentException If the database driver or extension cannot be found * @return DatabaseBase|null DatabaseBase subclass or null */ final public static function factory( $dbType, $p = [] ) { @@ -355,7 +357,7 @@ $driver = $dbType; } if ( $driver === false ) { - throw new MWException( __METHOD__ . + throw new InvalidArgumentException( __METHOD__ . " no viable database extension found for type '$dbType'" ); } @@ -390,6 +392,11 @@ if ( isset( $p['queryLogger'] ) ) { $conn->queryLogger = $p['queryLogger']; } + if ( isset( $p['errorLogger'] ) ) { + $conn->errorLogger = $p['errorLogger']; + } else { + $conn->errorLogger = [ MWExceptionHandler::class, 'logException' ]; + } } else { $conn = null; } @@ -398,7 +405,7 @@ } public function setLogger( LoggerInterface $logger ) { - $this->quertLogger = $logger; + $this->queryLogger = $logger; } public function getServerInfo() { @@ -747,7 +754,7 @@ protected function installErrorHandler() { $this->mPHPError = false; $this->htmlErrors = ini_set( 'html_errors', '0' ); - set_error_handler( [ $this, 'connectionErrorHandler' ] ); + set_error_handler( [ $this, 'connectionerrorLogger' ] ); } /** @@ -772,12 +779,12 @@ * @param int $errno * @param string $errstr */ - public function connectionErrorHandler( $errno, $errstr ) { + public function connectionerrorLogger( $errno, $errstr ) { $this->mPHPError = $errstr; } /** -* Create a log context to pass to wfLogDBError or other logging functions. +* Create a log context to pass to PSR logging functions. * * @param array $extras Additional data to add to context * @return array @@ -796,11 +803,6 @@ public function close() { if ( $this->mConn ) { if ( $this->trxLevel() ) { - if ( !$this->mTrxAutomatic ) { - wfWarn( "Transaction still in progress (from {$this->mTrxFname}), " . - " performing implicit commit before closing connection!" ); - } - $this->commit( __METHOD__, self::FLUSHING_INTERNAL ); } @@ -954,7 +956,8 @@ if ( $this->reconnect() ) { $msg = __METHOD__ . ": lost connection to {$this->getServer()}; reconnected"; $this->connLogger->warning( $msg ); - $this->queryLogger->warning( "$msg:\n" . wfBacktrace( true ) ); + $this->queryLogger->warning( + "$msg:\n" . ( new RuntimeException() )->getTraceAsString() ); if ( !$recoverable ) { # Callers may
[MediaWiki-commits] [Gerrit] operations/puppet[production]: [WIP] Beta: Clean puppetmaster cherry-picks
Thcipriani has uploaded a new change for review. https://gerrit.wikimedia.org/r/310719 Change subject: [WIP] Beta: Clean puppetmaster cherry-picks .. [WIP] Beta: Clean puppetmaster cherry-picks This is an attempt to reduce the number of bit-rotted cherry-picks on the beta puppetmaster. The git-clean-puppetmaster script takes a two-pronged approach: 1. Remove any commits that have been merged or abandoned in gerrit. 2. Post to the phabricator task for which the cherry pick was made if it seems like the patch may have been forgotten. This hopefully strikes a balance of keeping beta-cherrypicks easy and keeping the management of cherry-picks sane. Bug: T135427 Change-Id: I25089e194739e799e8f8c63fc74a70e25863524e --- A modules/beta/files/puppetmaster/git-clean-puppetmaster.logrotate A modules/beta/files/puppetmaster/git-clean-puppetmaster.py A modules/beta/manifests/puppetmaster/gitclean.pp M modules/role/manifests/beta/puppetmaster.pp 4 files changed, 267 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/19/310719/1 diff --git a/modules/beta/files/puppetmaster/git-clean-puppetmaster.logrotate b/modules/beta/files/puppetmaster/git-clean-puppetmaster.logrotate new file mode 100644 index 000..16cb184 --- /dev/null +++ b/modules/beta/files/puppetmaster/git-clean-puppetmaster.logrotate @@ -0,0 +1,11 @@ +## +### THIS FILE IS MANAGED BY PUPPET +## + +/var/log/git-clean-puppetmaster.log { +daily +copytruncate +missingok +notifempty +rotate 7 +} diff --git a/modules/beta/files/puppetmaster/git-clean-puppetmaster.py b/modules/beta/files/puppetmaster/git-clean-puppetmaster.py new file mode 100644 index 000..7279004 --- /dev/null +++ b/modules/beta/files/puppetmaster/git-clean-puppetmaster.py @@ -0,0 +1,221 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +""" +git-clean-puppetmaster +-- + +This script will veinly attempt to enforce some order onto the patches picked +onto a puppetmaster. It ensures that all patches are not in a MERGED or +ABANDONED state in gerrit. This script will also be annoying and (possibly +repeatedly) poke any tasks associated with any cherry-picked patches. +""" +from __future__ import print_function + +import json +import os +import subprocess +import sys +import time + +import requests + +# One month in seconds +ACTIVE = 30 * 24 * 60 * 60 + +PUPPET_DIR = '/var/lib/git/operations/puppet' +GIT = '/usr/bin/git' +GIT_CMD = (GIT, '-C', PUPPET_DIR) + + +GERRIT_URL = 'https://gerrit.wikimedia.org/r' + +GERRIT_API = os.path.join( +GERRIT_URL, +'changes', +'operations%2Fpuppet~production~{}' +) + + +class GerritAPIError(Exception): +"""Exception class for gerrit api.""" + +pass + + +class PhabTask(object): +"""Encapsulate phab task api.""" + +URL = 'https://phabricator.wikimedia.org' +API = os.path.join(URL, 'api') +API_QUERY = 'maniphest.query' +API_UPDATE = 'maniphest.update' +API_DETAIL = 'maniphest.gettasktransactions' + +COMMENT = ''' +This task has a patch that is cherry-picked on deployment-puppetmaster: + +> {commit} +''' + +"""Class to encapsulate arcanist info.""" +def __init__(self, task, sha): +"""Build phab task.""" +self.task = task +self.sha = sha +self._token = None +self._is_active = None +self._closed = None + +def _api(self, endpoint=None): +"""Return json data from api query.""" +if not endpoint: +endpoint = self.API_QUERY +data = {} +headers = {'accept': 'application/json'} +data['api.token'] = self.token +r = requests.post( +os.path.join(self.API, endpoint), +headers=headers, +data=data) + +r.raise_for_status() + +return r.json() + +@property +def token(self): +"""Get Conduit API token.""" +if self._token: +return self._token + +with open('/root/beta-puppetmaster.arcrc') as arcrc: +config_json = json.loads(arcrc.read()) + +self._token = config_json['hosts'][self.API + '/']['token'] + +@property +def is_closed(self): +"""Determine if task is closed from task-id.""" +if self._closed is not None: +return self._closed + +data = {'ids[0]': self.task} +query_data = self._api(data) +self._closed = query_data['result'][str(self.task)]['isClosed'] + +return self._closed + +@property +def is_active(self): +""" +Determine if a task is active or not. + +Currently, "active" is defined as "has seen activity in the past month" +""" +if self._is_active is not None: +return self._is_active + +data = {'ids[0]':
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: Actually populate the prefix panel with prefi...
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/310718 Change subject: Puppet Panel: Actually populate the prefix panel with prefixes. .. Puppet Panel: Actually populate the prefix panel with prefixes. Bug: T91990 Change-Id: I1a22aa6cad93da0bfe3c4f41748fd0a7566a1f61 --- M modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py M modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py M modules/openstack/files/liberty/horizon/puppettab/puppet_config.py M modules/openstack/files/liberty/horizon/puppettab/tab.py M modules/openstack/files/liberty/horizon/puppettab/templates/puppet/plus_tab.html 5 files changed, 54 insertions(+), 36 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/18/310718/1 diff --git a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py index f4fdc4f..c9f5640 100644 --- a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py +++ b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py @@ -14,11 +14,15 @@ #under the License. import logging +import re from django import template from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ +from wikimediapuppettab.puppet_config import puppet_config + +from horizon import exceptions from horizon import tabs logging.basicConfig() @@ -39,12 +43,20 @@ super(PlusTab, self).__init__(*args, **kwargs) def render(self): -LOG.warning("rendering, and logging is working") context = template.RequestContext(self.request) context['prefix_name'] = self.prefix_name return render_to_string(self.get_template_name(self.request), self.data, context_instance=context) def post(self, request, *args, **kwargs): -LOG.warning("We've got POST!") + +pattern = re.compile("^[A-Za-z][A-Za-z0-9_-]*$") +if not pattern.match(request.POST["prefix_name"]): +raise exceptions.BadRequest('Prefix must begin with a ' +'letter and contain only letters, ' +'numbers, _ or -.') + self.prefix_name = request.POST["prefix_name"] + +config = puppet_config(self.prefix_name, self.tenant_id) +config.set_hiera("") diff --git a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py index 4bb05b4..5b60eec 100644 --- a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py +++ b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py @@ -24,6 +24,7 @@ from wikimediapuppettab.tab import PuppetTab from wikimediapuppettab.prefixpanel.plustab import PlusTab +from wikimediapuppettab.puppet_config import puppet_config logging.basicConfig() LOG = logging.getLogger(__name__) @@ -32,9 +33,6 @@ class PrefixPuppetPanel(horizon.Panel): name = _("Prefix Puppet") slug = "prefixpuppet" - -def handle(self, request, data): -LOG.warning('PrefixPuppetPanel is handling') class PrefixTabs(tabs.TabGroup): @@ -50,21 +48,19 @@ tab_instances = [] tenant_id = self.request.user.tenant_id +prefixlist = puppet_config.get_prefixes(tenant_id) +LOG.warning("prefixlist: %s" % prefixlist) -# demo #1 -prefix = 'prefixone' -tab_instances.append(("puppet-%s" % prefix, - PuppetTab(self, -request, -prefix=prefix, -tenant_id=tenant_id))) -# demo #2 -prefix = 'prefixtwo' -tab_instances.append(("puppet-%s" % prefix, - PuppetTab(self, -request, -prefix=prefix, -tenant_id=tenant_id))) +# One tab per prefix +for prefix in prefixlist: +# exclude anything with a '.' as those are instance names +if '.' not in prefix: +tab_instances.append(("puppet-%s" % prefix, + PuppetTab(self, +request, +prefix=prefix, +tenant_id=tenant_id))) + # + tab tab_instances.append(('puppetprefixplus', PlusTab(self, request, tenant_id=tenant_id))) @@ -75,14 +71,8 @@ if not self._set_active_tab():
[MediaWiki-commits] [Gerrit] operations/puppet[production]: apache: fix 42 x 'class not documented', add doc links
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/310717 Change subject: apache: fix 42 x 'class not documented', add doc links .. apache: fix 42 x 'class not documented', add doc links Fixes 42 lint warnings about classes not being documented, by linking to the relevant docs page for each Apache module. Bug: T127797 Change-Id: Ib552f24bd3e4ee80b92cb0a32b089452fd2a4b1c --- M modules/apache/manifests/mod.pp 1 file changed, 91 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/17/310717/1 diff --git a/modules/apache/manifests/mod.pp b/modules/apache/manifests/mod.pp index ff85c1b..633938a 100644 --- a/modules/apache/manifests/mod.pp +++ b/modules/apache/manifests/mod.pp @@ -9,57 +9,148 @@ # Modules that are bundled with the apache2 package # lint:ignore:autoloader_layout # ^ FIXABLE ? + +# https://httpd.apache.org/docs/current/mod/mod_actions.html class apache::mod::actions { apache::mod_conf { 'actions':} } + +# https://httpd.apache.org/docs/current/mod/mod_alias.html class apache::mod::alias { apache::mod_conf { 'alias': } } + +# https://httpd.apache.org/docs/current/mod/mod_auth_basic.html class apache::mod::auth_basic { apache::mod_conf { 'auth_basic': } } + +# https://httpd.apache.org/docs/current/mod/mod_authn_file.html class apache::mod::authn_file { apache::mod_conf { 'authn_file': } } + +# https://httpd.apache.org/docs/current/mod/mod_authz_groupfile.html class apache::mod::authz_groupfile { apache::mod_conf { 'authz_groupfile': } } + +# https://httpd.apache.org/docs/current/mod/mod_authz_host.html class apache::mod::authz_host { apache::mod_conf { 'authz_host': } } + +# https://httpd.apache.org/docs/current/mod/mod_authnz_ldap.html class apache::mod::authnz_ldap { apache::mod_conf { 'authnz_ldap':} } + +# https://httpd.apache.org/docs/current/mod/mod_authz_user.html class apache::mod::authz_user { apache::mod_conf { 'authz_user': } } + +# https://httpd.apache.org/docs/current/mod/mod_autoindex.html class apache::mod::autoindex { apache::mod_conf { 'autoindex': } } + +# https://httpd.apache.org/docs/current/mod/mod_cgi.html class apache::mod::cgi { apache::mod_conf { 'cgi':} } + +# https://httpd.apache.org/docs/current/mod/mod_dav.html class apache::mod::dav { apache::mod_conf { 'dav':} } + +# https://httpd.apache.org/docs/current/mod/mod_dav_fs.html class apache::mod::dav_fs { apache::mod_conf { 'dav_fs': } } + +# https://httpd.apache.org/docs/current/mod/mod_dir.html class apache::mod::dir { apache::mod_conf { 'dir':} } + +# https://httpd.apache.org/docs/current/mod/mod_env.html class apache::mod::env { apache::mod_conf { 'env':} } + +# https://httpd.apache.org/docs/current/mod/mod_expires.html class apache::mod::expires { apache::mod_conf { 'expires':} } + +# https://httpd.apache.org/docs/current/mod/mod_filter.html class apache::mod::filter { apache::mod_conf { 'filter': } } + +# https://httpd.apache.org/docs/current/mod/mod_headers.html class apache::mod::headers { apache::mod_conf { 'headers':} } + +# https://httpd.apache.org/docs/current/mod/mod_mime.html class apache::mod::mime{ apache::mod_conf { 'mime': } } + +# https://httpd.apache.org/docs/current/mod/mod_negotiation.html class apache::mod::negotiation { apache::mod_conf { 'negotiation':} } + +# https://httpd.apache.org/docs/current/mod/mod_proxy.html class apache::mod::proxy { apache::mod_conf { 'proxy': } } + +# https://httpd.apache.org/docs/current/mod/mod_proxy_balancer.html class apache::mod::proxy_balancer { apache::mod_conf { 'proxy_balancer': } } + +# https://httpd.apache.org/docs/current/mod/mod_proxy_http.html class apache::mod::proxy_http { apache::mod_conf { 'proxy_http': } } + +# https://httpd.apache.org/docs/current/mod/mod_authz_user.html class apache::mod::rewrite { apache::mod_conf { 'rewrite':} } + +# https://httpd.apache.org/docs/current/mod/mod_setenvif.html class apache::mod::setenvif{ apache::mod_conf { 'setenvif': } } + +# https://httpd.apache.org/docs/current/mod/mod_ssl.html class apache::mod::ssl { apache::mod_conf { 'ssl':} } + +# https://httpd.apache.org/docs/current/mod/mod_substitute.html class apache::mod::substitute { apache::mod_conf { 'substitute': } } + +# https://httpd.apache.org/docs/current/mod/mod_userdir.html class apache::mod::userdir { apache::mod_conf { 'userdir':} } + # lint:endignore # Modules that depend on additional packages # lint:ignore:right_to_left_relationship lint:ignore:autoloader_layout # FIXABLE ^ ? + +#
[MediaWiki-commits] [Gerrit] oojs/ui[master]: ComboBoxInputWidget: Hide dropdown indicator when there is n...
VolkerE has uploaded a new change for review. https://gerrit.wikimedia.org/r/310716 Change subject: ComboBoxInputWidget: Hide dropdown indicator when there is no dropdown .. ComboBoxInputWidget: Hide dropdown indicator when there is no dropdown Hiding dropdown indicator when class `.oo-ui-comboBoxInputWidget-empty` is set. Bug: T145176 Change-Id: I0b087bc56e19e1d0be63d145b00426b8aee2efc5 --- M src/styles/widgets/ComboBoxInputWidget.less 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/16/310716/1 diff --git a/src/styles/widgets/ComboBoxInputWidget.less b/src/styles/widgets/ComboBoxInputWidget.less index 4a6babe..1d1789b 100644 --- a/src/styles/widgets/ComboBoxInputWidget.less +++ b/src/styles/widgets/ComboBoxInputWidget.less @@ -3,6 +3,12 @@ .oo-ui-comboBoxInputWidget { display: inline-block; + &.oo-ui-comboBoxInputWidget-empty { + > .oo-ui-indicatorElement-indicator { + display: none; + } + } + &.oo-ui-widget-enabled { > .oo-ui-indicatorElement-indicator { cursor: pointer; -- To view, visit https://gerrit.wikimedia.org/r/310716 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b087bc56e19e1d0be63d145b00426b8aee2efc5 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/core[master]: Move DBConnRef and ChronologyProtector to /libs/rdbms
jenkins-bot has submitted this change and it was merged. Change subject: Move DBConnRef and ChronologyProtector to /libs/rdbms .. Move DBConnRef and ChronologyProtector to /libs/rdbms Change-Id: If2c4b314a5c39311328843f534d91bf90823e179 --- M autoload.php R includes/libs/rdbms/chronologyprotector/ChronologyProtector.php R includes/libs/rdbms/database/RBConnRef.php 3 files changed, 9 insertions(+), 9 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index 66736b3..557df83 100644 --- a/autoload.php +++ b/autoload.php @@ -241,7 +241,7 @@ 'CheckStorage' => __DIR__ . '/maintenance/storage/checkStorage.php', 'CheckSyntax' => __DIR__ . '/maintenance/checkSyntax.php', 'CheckUsernames' => __DIR__ . '/maintenance/checkUsernames.php', - 'ChronologyProtector' => __DIR__ . '/includes/db/ChronologyProtector.php', + 'ChronologyProtector' => __DIR__ . '/includes/libs/rdbms/chronologyprotector/ChronologyProtector.php', 'ClassCollector' => __DIR__ . '/includes/utils/AutoloadGenerator.php', 'CleanupAncientTables' => __DIR__ . '/maintenance/cleanupAncientTables.php', 'CleanupBlocks' => __DIR__ . '/maintenance/cleanupBlocks.php', @@ -299,7 +299,7 @@ 'DBAccessBase' => __DIR__ . '/includes/dao/DBAccessBase.php', 'DBAccessError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBAccessObjectUtils' => __DIR__ . '/includes/dao/DBAccessObjectUtils.php', - 'DBConnRef' => __DIR__ . '/includes/db/DBConnRef.php', + 'DBConnRef' => __DIR__ . '/includes/libs/rdbms/database/RBConnRef.php', 'DBConnectionError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', 'DBExpectedError' => __DIR__ . '/includes/libs/rdbms/exception/DBError.php', diff --git a/includes/db/ChronologyProtector.php b/includes/libs/rdbms/chronologyprotector/ChronologyProtector.php similarity index 100% rename from includes/db/ChronologyProtector.php rename to includes/libs/rdbms/chronologyprotector/ChronologyProtector.php diff --git a/includes/db/DBConnRef.php b/includes/libs/rdbms/database/RBConnRef.php similarity index 97% rename from includes/db/DBConnRef.php rename to includes/libs/rdbms/database/RBConnRef.php index 8604295..e606340 100644 --- a/includes/db/DBConnRef.php +++ b/includes/libs/rdbms/database/RBConnRef.php @@ -8,10 +8,10 @@ * @since 1.22 */ class DBConnRef implements IDatabase { - /** @var LoadBalancer */ + /** @var ILoadBalancer */ private $lb; - /** @var DatabaseBase|null */ + /** @var IDatabase|null Live connection handle */ private $conn; /** @var array|null */ @@ -22,13 +22,13 @@ const FLD_WIKI = 2; /** -* @param LoadBalancer $lb -* @param DatabaseBase|array $conn Connection or (server index, group, wiki ID) +* @param ILoadBalancer $lb +* @param IDatabase|array $conn Connection or (server index, group, wiki ID) */ - public function __construct( LoadBalancer $lb, $conn ) { + public function __construct( ILoadBalancer $lb, $conn ) { $this->lb = $lb; - if ( $conn instanceof DatabaseBase ) { - $this->conn = $conn; + if ( $conn instanceof IDatabase ) { + $this->conn = $conn; // live handle } elseif ( count( $conn ) >= 3 && $conn[self::FLD_WIKI] !== false ) { $this->params = $conn; } else { -- To view, visit https://gerrit.wikimedia.org/r/310510 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If2c4b314a5c39311328843f534d91bf90823e179 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-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]: toollabs: Remove unneeded puppet-lint ignore rules
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/310715 Change subject: toollabs: Remove unneeded puppet-lint ignore rules .. toollabs: Remove unneeded puppet-lint ignore rules They are not needed since puppet lint does not fail even if you take those lines out. Change-Id: I64fe8799505dac0a3f55af30e734fe89daa78cb7 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/15/310715/1 -- To view, visit https://gerrit.wikimedia.org/r/310715 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64fe8799505dac0a3f55af30e734fe89daa78cb7 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Paladox___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move TransactionProfiler to /libs/rdbms
jenkins-bot has submitted this change and it was merged. Change subject: Move TransactionProfiler to /libs/rdbms .. Move TransactionProfiler to /libs/rdbms Change-Id: I13173facc9f101bca69e3bf3e85f292f8468e855 --- M autoload.php R includes/libs/rdbms/TransactionProfiler.php 2 files changed, 5 insertions(+), 4 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index a71d943..4b5d9e8 100644 --- a/autoload.php +++ b/autoload.php @@ -1419,7 +1419,7 @@ 'TitleValue' => __DIR__ . '/includes/title/TitleValue.php', 'TrackBlobs' => __DIR__ . '/maintenance/storage/trackBlobs.php', 'TraditionalImageGallery' => __DIR__ . '/includes/gallery/TraditionalImageGallery.php', - 'TransactionProfiler' => __DIR__ . '/includes/profiler/TransactionProfiler.php', + 'TransactionProfiler' => __DIR__ . '/includes/libs/rdbms/TransactionProfiler.php', 'TransformParameterError' => __DIR__ . '/includes/media/MediaTransformOutput.php', 'TransformTooBigImageAreaError' => __DIR__ . '/includes/media/MediaTransformOutput.php', 'TransformationalImageHandler' => __DIR__ . '/includes/media/TransformationalImageHandler.php', diff --git a/includes/profiler/TransactionProfiler.php b/includes/libs/rdbms/TransactionProfiler.php similarity index 97% rename from includes/profiler/TransactionProfiler.php rename to includes/libs/rdbms/TransactionProfiler.php index bf26573..5c9976d 100644 --- a/includes/profiler/TransactionProfiler.php +++ b/includes/libs/rdbms/TransactionProfiler.php @@ -198,8 +198,9 @@ $elapsed = ( $eTime - $sTime ); if ( $isWrite && $n > $this->expect['maxAffected'] ) { - $this->logger->info( "Query affected $n row(s):\n" . $query . "\n" . - wfBacktrace( true ) ); + $this->logger->info( + "Query affected $n row(s):\n" . $query . "\n" . + ( new RuntimeException() )->getTraceAsString() ); } // Report when too many writes/queries happen... @@ -322,7 +323,7 @@ $this->logger->info( "Expectation ($expect <= $n) by $by not met$actual:\n$query\n" . - wfBacktrace( true ) + ( new RuntimeException() )->getTraceAsString() ); } } -- To view, visit https://gerrit.wikimedia.org/r/310534 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I13173facc9f101bca69e3bf3e85f292f8468e855 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-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] wikimedia...SmashPig[master]: Clean up antifraud queue usage
Ejegg has submitted this change and it was merged. Change subject: Clean up antifraud queue usage .. Clean up antifraud queue usage No more KeyedOpaqueStorableObject or mirroring to ActiveMQ, just push an array straight to Redis Bug: T131273 Change-Id: Ib06f946899c2217f52b6277233b679dca95f69c6 --- D CrmLink/Messages/DonationInterfaceAntifraud.php A CrmLink/Messages/DonationInterfaceAntifraudFactory.php M PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php M PaymentProviders/Adyen/Tests/config_test.yaml M PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php M SmashPig.yaml M Tests/MessageTest.php 7 files changed, 75 insertions(+), 87 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/CrmLink/Messages/DonationInterfaceAntifraud.php b/CrmLink/Messages/DonationInterfaceAntifraud.php deleted file mode 100644 index f462300..000 --- a/CrmLink/Messages/DonationInterfaceAntifraud.php +++ /dev/null @@ -1,44 +0,0 @@ -risk_score = $riskScore; - $obj->score_breakdown = $scoreBreakdown; - $obj->validation_action = $validationAction; - - $obj->contribution_tracking_id = $message['contribution_tracking_id']; - $obj->date = $message['date']; - $obj->gateway = $message['gateway']; - $obj->gateway_txn_id = $message['gateway_txn_id']; - $obj->order_id = $message['order_id']; - $obj->payment_method = $message['payment_method']; - // no 'server' available - $obj->user_ip = $message['user_ip']; - - return $obj; - } -} diff --git a/CrmLink/Messages/DonationInterfaceAntifraudFactory.php b/CrmLink/Messages/DonationInterfaceAntifraudFactory.php new file mode 100644 index 000..dc8c7f5 --- /dev/null +++ b/CrmLink/Messages/DonationInterfaceAntifraudFactory.php @@ -0,0 +1,38 @@ + $riskScore, + 'score_breakdown' => $scoreBreakdown, + 'validation_action' => $validationAction, + ); + + $keysToCopy = array( + 'contribution_tracking_id', + 'date', + 'gateway', + 'gateway_txn_id', + 'order_id', + 'payment_method', + 'user_ip' + // no 'server' available + ); + + foreach( $keysToCopy as $key ) { + $antifraud[$key] = $donationMessage[$key]; + } + + return $antifraud; + } +} diff --git a/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php b/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php index 8a06d51..fb39f08 100644 --- a/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php +++ b/PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php @@ -5,7 +5,7 @@ use SmashPig\Core\Jobs\RunnableJob; use SmashPig\Core\Logging\Logger; use SmashPig\Core\Logging\TaggedLogger; -use SmashPig\CrmLink\Messages\DonationInterfaceAntifraud; +use SmashPig\CrmLink\Messages\DonationInterfaceAntifraudFactory; use SmashPig\PaymentProviders\Adyen\AdyenPaymentsInterface; use SmashPig\PaymentProviders\Adyen\ExpatriatedMessages\Authorisation; @@ -189,11 +189,13 @@ } protected function sendAntifraudMessage( $dbMessage, $riskScore, $scoreBreakdown, $action ) { - $antifraudMessage = DonationInterfaceAntifraud::factory( + $antifraudMessage = DonationInterfaceAntifraudFactory::create( $dbMessage, $riskScore, $scoreBreakdown, $action ); $this->logger->debug( "Sending antifraud message with risk score $riskScore and action $action." ); - Configuration::getDefaultConfig()->object( 'data-store/antifraud' )->push( $antifraudMessage ); + Configuration::getDefaultConfig() + ->object( 'data-store/payments-antifraud' ) + ->push( $antifraudMessage ); } /** diff --git a/PaymentProviders/Adyen/Tests/config_test.yaml b/PaymentProviders/Adyen/Tests/config_test.yaml index 40185fa..2be830d 100644 --- a/PaymentProviders/Adyen/Tests/config_test.yaml +++ b/PaymentProviders/Adyen/Tests/config_test.yaml @@ -1,8 +1,11 @@ adyen: data-store: -antifraud-stomp: -class: SmashPig\Tests\MockDataStore +payments-antifraud: +class: PHPQueue\Backend\PDO +constructor-parameters: +- +connection_string: 'sqlite::memory:' verified: class: PHPQueue\Backend\PDO diff --git a/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php b/PaymentProviders/Adyen/Tests/phpunit/CaptureJobTest.php index 8c1e270..efcabbc 100644 ---
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make WikiPage::getRevision() make use of Revision::newKnownC...
jenkins-bot has submitted this change and it was merged. Change subject: Make WikiPage::getRevision() make use of Revision::newKnownCurrent() .. Make WikiPage::getRevision() make use of Revision::newKnownCurrent() Change-Id: Id06319b31bc523a5d514930c3d609af4d991453b --- M includes/page/WikiPage.php 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index c09d0eb..6c0c4a8 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -621,15 +621,18 @@ // happened after the first S1 SELECT. // http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html#isolevel_repeatable-read $flags = Revision::READ_LOCKING; + $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); } elseif ( $this->mDataLoadedFrom == self::READ_LATEST ) { // Bug T93976: if page_latest was loaded from the master, fetch the // revision from there as well, as it may not exist yet on a replica DB. // Also, this keeps the queries in the same REPEATABLE-READ snapshot. $flags = Revision::READ_LATEST; + $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); } else { - $flags = 0; + $dbr = wfGetDB( DB_REPLICA ); + $revision = Revision::newKnownCurrent( $dbr, $this->getId(), $latest ); } - $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); + if ( $revision ) { // sanity $this->setLastEdit( $revision ); } -- To view, visit https://gerrit.wikimedia.org/r/310705 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id06319b31bc523a5d514930c3d609af4d991453b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Fix missing dependency of ext.visualEditor.mwwikitext upon e...
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/310714 Change subject: Fix missing dependency of ext.visualEditor.mwwikitext upon ext.visualEditor.desktopArticleTarget .. Fix missing dependency of ext.visualEditor.mwwikitext upon ext.visualEditor.desktopArticleTarget Change-Id: I029ef5faa6490bfab2c71b1df81c51a5b7494b84 --- M extension.json 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/14/310714/1 diff --git a/extension.json b/extension.json index 68be6d8..fc33d07 100644 --- a/extension.json +++ b/extension.json @@ -1762,7 +1762,8 @@ ], "dependencies": [ "ext.visualEditor.mwlink", - "ext.visualEditor.mwcore" + "ext.visualEditor.mwcore", + "ext.visualEditor.desktopArticleTarget" ], "messages": [ "visualeditor-generating-wikitext-progress" -- To view, visit https://gerrit.wikimedia.org/r/310714 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I029ef5faa6490bfab2c71b1df81c51a5b7494b84 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Alex Monk___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ProofreadPage[master]: Fix missing dependency of ext.proofreadpage.ve.pageTarget up...
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/310713 Change subject: Fix missing dependency of ext.proofreadpage.ve.pageTarget upon ext.visualEditor.desktopArticleTarget .. Fix missing dependency of ext.proofreadpage.ve.pageTarget upon ext.visualEditor.desktopArticleTarget Change-Id: I4ccd9efa38139366f574bc65cb41b27513abf268 --- M extension.json 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage refs/changes/13/310713/1 diff --git a/extension.json b/extension.json index 8624f26..5b8207b 100644 --- a/extension.json +++ b/extension.json @@ -220,6 +220,7 @@ ], "dependencies": [ "ext.visualEditor.mwcore", + "ext.visualEditor.desktopArticleTarget", "jquery.prpZoom" ], "messages": [ -- To view, visit https://gerrit.wikimedia.org/r/310713 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ccd9efa38139366f574bc65cb41b27513abf268 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ProofreadPage Gerrit-Branch: master Gerrit-Owner: Alex Monk___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: mysql_wmf: Use require_package instead of package latest
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/310712 Change subject: mysql_wmf: Use require_package instead of package latest .. mysql_wmf: Use require_package instead of package latest Bug: T115348 Change-Id: Ibec252d32eb7ce9b80a909a77fc457aaea64bb34 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/12/310712/1 -- To view, visit https://gerrit.wikimedia.org/r/310712 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibec252d32eb7ce9b80a909a77fc457aaea64bb34 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] operations/puppet[production]: requesttracker: Use require_package instead of package latest
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/310711 Change subject: requesttracker: Use require_package instead of package latest .. requesttracker: Use require_package instead of package latest Bug: T115348 Change-Id: Ia52fd3ada6a6752548af8edd08d6af634f12d354 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/11/310711/1 -- To view, visit https://gerrit.wikimedia.org/r/310711 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia52fd3ada6a6752548af8edd08d6af634f12d354 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] wikimedia...SmashPig[master]: Add 'IF NOT EXISTS' to table creation
jenkins-bot has submitted this change and it was merged. Change subject: Add 'IF NOT EXISTS' to table creation .. Add 'IF NOT EXISTS' to table creation Because too lazy for proper schema migration Change-Id: Ic25887e9f591c6997dc19172c442de71f59cf25b --- M Schema/mysql/001_CreatePendingTable.sql M Schema/mysql/002_CreateDamagedTable.sql M Schema/mysql/003_CreatePaymentsInitialTable.sql M Schema/sqlite/001_CreatePendingTable.sql M Schema/sqlite/002_CreateDamagedTable.sql M Schema/sqlite/003_CreatePaymentsInitialTable.sql 6 files changed, 6 insertions(+), 6 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/Schema/mysql/001_CreatePendingTable.sql b/Schema/mysql/001_CreatePendingTable.sql index f39d495..76dd361 100644 --- a/Schema/mysql/001_CreatePendingTable.sql +++ b/Schema/mysql/001_CreatePendingTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE pending ( +CREATE TABLE IF NOT EXISTS pending ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL, `gateway` varchar(255) NOT NULL, diff --git a/Schema/mysql/002_CreateDamagedTable.sql b/Schema/mysql/002_CreateDamagedTable.sql index 138966b..677a8e6 100644 --- a/Schema/mysql/002_CreateDamagedTable.sql +++ b/Schema/mysql/002_CreateDamagedTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE damaged ( +CREATE TABLE IF NOT EXISTS damaged ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `original_date` datetime NOT NULL, `damaged_date` datetime NOT NULL, diff --git a/Schema/mysql/003_CreatePaymentsInitialTable.sql b/Schema/mysql/003_CreatePaymentsInitialTable.sql index cac4ebc..26bc744 100644 --- a/Schema/mysql/003_CreatePaymentsInitialTable.sql +++ b/Schema/mysql/003_CreatePaymentsInitialTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE payments_initial ( +CREATE TABLE IF NOT EXISTS payments_initial ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `contribution_tracking_id` int(11) DEFAULT NULL, `gateway` varchar(255) DEFAULT NULL, diff --git a/Schema/sqlite/001_CreatePendingTable.sql b/Schema/sqlite/001_CreatePendingTable.sql index c6e7b41..0edcd69 100644 --- a/Schema/sqlite/001_CreatePendingTable.sql +++ b/Schema/sqlite/001_CreatePendingTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE pending ( +CREATE TABLE IF NOT EXISTS pending ( `id` integer primary key, `date` datetime NOT NULL, `gateway` varchar(255) NOT NULL, diff --git a/Schema/sqlite/002_CreateDamagedTable.sql b/Schema/sqlite/002_CreateDamagedTable.sql index 64eb97f..e13a8bb 100644 --- a/Schema/sqlite/002_CreateDamagedTable.sql +++ b/Schema/sqlite/002_CreateDamagedTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE damaged ( +CREATE TABLE IF NOT EXISTS damaged ( `id` integer primary key, `original_date` datetime NOT NULL, `damaged_date` datetime NOT NULL, diff --git a/Schema/sqlite/003_CreatePaymentsInitialTable.sql b/Schema/sqlite/003_CreatePaymentsInitialTable.sql index c3ecd22..b06d6e6 100644 --- a/Schema/sqlite/003_CreatePaymentsInitialTable.sql +++ b/Schema/sqlite/003_CreatePaymentsInitialTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE payments_initial ( +CREATE TABLE IF NOT EXISTS payments_initial ( `id` integer primary key, `contribution_tracking_id` integer NULL, `gateway` varchar(255) NULL, -- To view, visit https://gerrit.wikimedia.org/r/310707 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic25887e9f591c6997dc19172c442de71f59cf25b Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Springle 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...SmashPig[master]: Remove all traces of stomp pending queue
jenkins-bot has submitted this change and it was merged. Change subject: Remove all traces of stomp pending queue .. Remove all traces of stomp pending queue DEPLOYMENT NOTE: Redis queue is now just called 'pending' Bug: T131274 Change-Id: If20b52465bc8f27e4458361a2ce93e63ae8efd9e --- M Core/DataStores/PendingDatabase.php M Core/Jobs/DeletePendingJob.php M Core/Listeners/ListenerBase.php M Maintenance/ConsumePendingQueue.php M Maintenance/CreateIpnMessagesFromPendingDb.php M PaymentProviders/Adyen/AdyenListener.php M PaymentProviders/Adyen/Jobs/ProcessCaptureRequestJob.php M PaymentProviders/Adyen/Jobs/RecordCaptureJob.php M PaymentProviders/Adyen/Tests/config_test.yaml M PaymentProviders/Amazon/ExpatriatedMessages/PaymentCapture.php M PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php M SmashPig.yaml M Tests/PendingQueueConsumerTest.php 13 files changed, 26 insertions(+), 110 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/Core/DataStores/PendingDatabase.php b/Core/DataStores/PendingDatabase.php index 1c30f55..c006595 100644 --- a/Core/DataStores/PendingDatabase.php +++ b/Core/DataStores/PendingDatabase.php @@ -85,11 +85,7 @@ where gateway = :gateway and order_id = :order_id limit 1' ); - if ( !$prepared ) { - // TODO: remove after transition to new pending queue - // database exists but table is not yet set up - return null; - } + $prepared->bindValue( ':gateway', $gatewayName, PDO::PARAM_STR ); $prepared->bindValue( ':order_id', $orderId, PDO::PARAM_STR ); $prepared->execute(); @@ -175,57 +171,6 @@ $message = json_decode( $row['message'], true ); $message['pending_id'] = $row['id']; return $message; - } - - /** -* Ensure a smooth transition of pending message from ActiveMQ to database. -* Log notices if entries differ between queue and db. -* TODO: remove when ActiveMQ is gone -* -* @param DonationInterfaceMessage|null $queueMessage Message from ActiveMQ -* @param array|null $dbMessage Normalized message from pending DB -*/ - public static function comparePending( $queueMessage, $dbMessage ) { - if ( $dbMessage ) { - $id = $dbMessage['gateway'] . '-' . $dbMessage['order_id']; - } else if ( $queueMessage ) { - $id = $queueMessage->gateway . '-' . $queueMessage->order_id; - } else { - // neither exists, nothing to log - return; - } - $logger = Logger::getTaggedLogger( 'PendingComparison' ); - - if ( $queueMessage && $dbMessage ) { - $queueData = json_decode( $queueMessage->toJson(), true ); - unset( $queueData['correlationId'] ); - unset( $queueData['propertiesExportedAsKeys'] ); - unset( $queueData['propertiesExcludedFromExport'] ); - foreach ( array_keys( $queueData ) as $key ) { - if ( $queueData[$key] === '' && !isset( $dbMessage[$key] ) ) { - unset ( $queueData[$key] ); - } - } - $differences = array_diff_assoc( $queueData, $dbMessage ); - if ( $differences ) { - $logger->notice( - "Pending message for $id " . - 'differs between ActiveMQ and pending database: ' . - json_encode( $differences, true ) - ); - } - } else if ( $queueMessage && !$dbMessage ) { - $logger->notice( - "Found pending message for $id " . - 'in ActiveMQ but not in pending database.' - ); - } else if ( $dbMessage && !$queueMessage ) { - $logger->notice( - "Found pending message for $id " . - 'in pending database but not in ActiveMQ: ' . - json_encode( $dbMessage ) - ); - } } /** diff --git a/Core/Jobs/DeletePendingJob.php b/Core/Jobs/DeletePendingJob.php index 6a10e67..6210fa8 100644 --- a/Core/Jobs/DeletePendingJob.php +++ b/Core/Jobs/DeletePendingJob.php @@ -4,7 +4,7 @@ use SmashPig\Core\Logging\Logger; /** - * Job
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Fix 'new ve.dm.Transaction.newFromInsertion' typos in tests
jenkins-bot has submitted this change and it was merged. Change subject: Fix 'new ve.dm.Transaction.newFromInsertion' typos in tests .. Fix 'new ve.dm.Transaction.newFromInsertion' typos in tests They were harmless because the function returned an object which supplants the spurious one 'new' creates. Change-Id: I46a6b8cf072f342c81eeb01e6659f2f0500445d6 --- M tests/dm/ve.dm.Surface.test.js 1 file changed, 11 insertions(+), 11 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/dm/ve.dm.Surface.test.js b/tests/dm/ve.dm.Surface.test.js index c82285e..48cd63f 100644 --- a/tests/dm/ve.dm.Surface.test.js +++ b/tests/dm/ve.dm.Surface.test.js @@ -60,7 +60,7 @@ fragment = surface.getFragment(), doc = surface.getDocument(), selection = new ve.dm.LinearSelection( doc, range ), - tx = new ve.dm.Transaction.newFromInsertion( doc, 1, [ 'x' ] ); + tx = ve.dm.Transaction.newFromInsertion( doc, 1, [ 'x' ] ); assert.strictEqual( surface.breakpoint(), false, 'Returns false if no transactions applied' ); @@ -106,14 +106,14 @@ assert.strictEqual( surface.doesStagingAllowUndo(), undefined, 'doesStagingAllowUndo undefined when not staging' ); assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface range matches fragment range' ); - surface.change( new ve.dm.Transaction.newFromInsertion( doc, 1, [ 'a' ] ) ); + surface.change( ve.dm.Transaction.newFromInsertion( doc, 1, [ 'a' ] ) ); surface.pushStaging(); assert.strictEqual( surface.isStaging(), true, 'isStaging true after pushStaging' ); assert.deepEqual( surface.getStagingTransactions(), [], 'getStagingTransactions empty array after pushStaging' ); assert.strictEqual( surface.doesStagingAllowUndo(), false, 'doesStagingAllowUndo false when staging without undo' ); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); surface.change( tx1 ); assert.strictEqual( fragment.getText(), 'abhi', 'document contents match after first transaction' ); @@ -126,7 +126,7 @@ assert.strictEqual( surface.doesStagingAllowUndo(), true, 'doesStagingAllowUndo true when staging with undo' ); assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); surface.change( tx2 ); assert.strictEqual( fragment.getText(), 'abchi', 'document contents match after second transaction' ); @@ -143,11 +143,11 @@ assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); surface.pushStaging(); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); surface.change( tx1 ); surface.pushStaging(); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); surface.change( tx2 ); assert.deepEqual( surface.popAllStaging(), [ tx1, tx2 ], 'popAllStaging returns full transaction list' ); @@ -155,11 +155,11 @@ assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); surface.pushStaging(); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); surface.change( tx1 ); surface.pushStaging(); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); surface.change( tx2 ); surface.applyStaging(); @@ -171,11 +171,11 @@ assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); surface.pushStaging(); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 4, [ 'd' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 4, [ 'd' ] ); surface.change( tx1 ); surface.pushStaging(); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 5, [ 'e' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 5, [ 'e' ] ); surface.change( tx2 ); surface.applyAllStaging(); @@ -190,7 +190,7 @@ surface.pushStaging(); surface.pushStaging(); // Apply transaction at second level, first level is empty and has no selctionBefore - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 4, [ 'd' ] ); + tx1 =
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Use correct switch type when opening welcome dialog on NWE
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/310709 Change subject: Use correct switch type when opening welcome dialog on NWE .. Use correct switch type when opening welcome dialog on NWE Bug: T145225 Change-Id: I032652733576d1a9797cc3dbb3dd24ca69cb30e5 --- M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js M modules/ve-mw/init/ve.init.MWWelcomeDialog.js M modules/ve-mw/init/ve.init.mw.ArticleTarget.js 3 files changed, 9 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/09/310709/1 diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js index 5aa6038..6bf9527 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js @@ -962,7 +962,7 @@ welcomeDialog, { switchable: init.isAvailable, - editor: 'wte' + editor: 'source' } ) .then( function ( opened ) { return opened; } ) diff --git a/modules/ve-mw/init/ve.init.MWWelcomeDialog.js b/modules/ve-mw/init/ve.init.MWWelcomeDialog.js index 702f631..4599e36 100644 --- a/modules/ve-mw/init/ve.init.MWWelcomeDialog.js +++ b/modules/ve-mw/init/ve.init.MWWelcomeDialog.js @@ -40,18 +40,18 @@ { action: 'switch-wte', label: OO.ui.deferMsg( 'visualeditor-welcomedialog-switch' ), - modes: [ 've' ] + modes: [ 'visual' ] }, { action: 'switch-ve', label: OO.ui.deferMsg( 'visualeditor-welcomedialog-switch-ve' ), - modes: [ 'wte' ] + modes: [ 'source' ] }, { action: 'accept', label: OO.ui.deferMsg( 'visualeditor-welcomedialog-action' ), flags: [ 'progressive', 'primary' ], - modes: [ 've', 'wte', 'noswitch' ] + modes: [ 'visual', 'source', 'noswitch' ] } ]; diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js index e1c50d5..c3abf1c 100644 --- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js @@ -1812,7 +1812,7 @@ this.welcomeDialog, { switchable: this.constructor.static.trackingName !== 'mobile', - editor: 've' + editor: this.mode } ) .then( function ( opened ) { @@ -1824,11 +1824,15 @@ .then( function ( data ) { target.welcomeDialogPromise.resolve(); target.welcomeDialog = null; + // switchToWikitextEditor and switchToVisualEditor are actually + // only defined in subclasses :/ if ( data && data.action === 'switch-wte' ) { // TODO: Make this work on mobile - right now we can only // get away with it because the button which triggers this // action is hidden on mobile target.switchToWikitextEditor( true, true ); + } else if ( data && data.action == 'switch-ve' ) { + target.switchToVisualEditor(); } } ); } else { -- To view, visit https://gerrit.wikimedia.org/r/310709 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I032652733576d1a9797cc3dbb3dd24ca69cb30e5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Alex Monk___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: gridengine: use present instead of latest in package
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/310710 Change subject: gridengine: use present instead of latest in package .. gridengine: use present instead of latest in package Bug: T115348 Change-Id: I865da442e048fbb88980ee4f2b822e1c90b94c00 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/10/310710/1 -- To view, visit https://gerrit.wikimedia.org/r/310710 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I865da442e048fbb88980ee4f2b822e1c90b94c00 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Paladox___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: More DB related class cleanups to prepare files for /libs
jenkins-bot has submitted this change and it was merged. Change subject: More DB related class cleanups to prepare files for /libs .. More DB related class cleanups to prepare files for /libs * Cleaned up some related logging bits. * Avoid some wf* methods in LoadBalancer. Change-Id: I5da97174441c086e61ffc120889c068e241ebfd2 --- M includes/db/ChronologyProtector.php M includes/db/loadbalancer/LBFactory.php M includes/db/loadbalancer/LoadBalancer.php M includes/libs/rdbms/loadbalancer/ILoadBalancer.php M includes/libs/rdbms/loadmonitor/LoadMonitor.php M includes/libs/rdbms/loadmonitor/LoadMonitorMySQL.php M includes/libs/rdbms/loadmonitor/LoadMonitorNull.php 7 files changed, 55 insertions(+), 40 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/ChronologyProtector.php b/includes/db/ChronologyProtector.php index 4d03bc6..09b820b 100644 --- a/includes/db/ChronologyProtector.php +++ b/includes/db/ChronologyProtector.php @@ -72,7 +72,7 @@ $this->clientId = md5( $client['ip'] . "\n" . $client['agent'] ); $this->key = $store->makeGlobalKey( __CLASS__, $this->clientId ); $this->waitForPosTime = $posTime; - $this->logger = LoggerFactory::getInstance( 'DBReplication' ); + $this->logger = new \Psr\Log\NullLogger(); } public function setLogger( LoggerInterface $logger ) { @@ -265,10 +265,11 @@ if ( $result == $loop::CONDITION_REACHED ) { $msg = "expected and found pos time {$this->waitForPosTime} ({$waitedMs}ms)"; + $this->logger->debug( $msg ); } else { $msg = "expected but missed pos time {$this->waitForPosTime} ({$waitedMs}ms)"; + $this->logger->info( $msg ); } - wfDebugLog( 'replication', $msg ); } else { $data = $this->store->get( $this->key ); } diff --git a/includes/db/loadbalancer/LBFactory.php b/includes/db/loadbalancer/LBFactory.php index 5115fbe..9eda742 100644 --- a/includes/db/loadbalancer/LBFactory.php +++ b/includes/db/loadbalancer/LBFactory.php @@ -68,8 +68,6 @@ if ( isset( $conf['readOnlyReason'] ) && is_string( $conf['readOnlyReason'] ) ) { $this->readOnlyReason = $conf['readOnlyReason']; } - $this->chronProt = $this->newChronologyProtector(); - $this->trxProfiler = Profiler::instance()->getTransactionProfiler(); // Use APC/memcached style caching, but avoids loops with CACHE_DB (T141804) $sCache = ObjectCache::getLocalServerInstance(); if ( $sCache->getQoS( $sCache::ATTR_EMULATION ) > $sCache::QOS_EMULATION_SQL ) { @@ -89,8 +87,10 @@ } else { $this->wanCache = WANObjectCache::newEmpty(); } + $this->trxProfiler = Profiler::instance()->getTransactionProfiler(); $this->trxLogger = LoggerFactory::getInstance( 'DBTransaction' ); $this->replLogger = LoggerFactory::getInstance( 'DBReplication' ); + $this->chronProt = $this->newChronologyProtector(); $this->ticket = mt_rand(); } @@ -610,6 +610,7 @@ ], $request->getFloat( 'cpPosTime', $request->getCookie( 'cpPosTime', '' ) ) ); + $chronProt->setLogger( $this->replLogger ); if ( PHP_SAPI === 'cli' ) { $chronProt->setEnabled( false ); } elseif ( $request->getHeader( 'ChronologyProtection' ) === 'false' ) { @@ -669,7 +670,8 @@ 'queryLogger' => LoggerFactory::getInstance( 'DBQuery' ), 'connLogger' => LoggerFactory::getInstance( 'DBConnection' ), 'replLogger' => LoggerFactory::getInstance( 'DBReplication' ), - 'errorLogger' => [ MWExceptionHandler::class, 'logException' ] + 'errorLogger' => [ MWExceptionHandler::class, 'logException' ], + 'hostname' => wfHostname() ]; } diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/db/loadbalancer/LoadBalancer.php index 8069cf6f..841231b 100644 --- a/includes/db/loadbalancer/LoadBalancer.php +++ b/includes/db/loadbalancer/LoadBalancer.php @@ -84,6 +84,9 @@ private $trxRecurringCallbacks = []; /** @var string Local Wiki ID and default for selectDB() calls */ private $localDomain; + /** @var string Current server
[MediaWiki-commits] [Gerrit] operations/puppet[production]: contint: Use require_package instead of package latest
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/310708 Change subject: contint: Use require_package instead of package latest .. contint: Use require_package instead of package latest Bug: T115348 Change-Id: I4601b9d332d2faa4c4ebd540b82849bf1870d95a --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/08/310708/1 -- To view, visit https://gerrit.wikimedia.org/r/310708 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4601b9d332d2faa4c4ebd540b82849bf1870d95a 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] wikimedia...SmashPig[master]: Add 'IF NOT EXISTS' to table creation
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/310707 Change subject: Add 'IF NOT EXISTS' to table creation .. Add 'IF NOT EXISTS' to table creation Because too lazy for proper schema migration Change-Id: Ic25887e9f591c6997dc19172c442de71f59cf25b --- M Schema/mysql/001_CreatePendingTable.sql M Schema/mysql/002_CreateDamagedTable.sql M Schema/mysql/003_CreatePaymentsInitialTable.sql M Schema/sqlite/001_CreatePendingTable.sql M Schema/sqlite/002_CreateDamagedTable.sql M Schema/sqlite/003_CreatePaymentsInitialTable.sql 6 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/07/310707/1 diff --git a/Schema/mysql/001_CreatePendingTable.sql b/Schema/mysql/001_CreatePendingTable.sql index f39d495..76dd361 100644 --- a/Schema/mysql/001_CreatePendingTable.sql +++ b/Schema/mysql/001_CreatePendingTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE pending ( +CREATE TABLE IF NOT EXISTS pending ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL, `gateway` varchar(255) NOT NULL, diff --git a/Schema/mysql/002_CreateDamagedTable.sql b/Schema/mysql/002_CreateDamagedTable.sql index 138966b..677a8e6 100644 --- a/Schema/mysql/002_CreateDamagedTable.sql +++ b/Schema/mysql/002_CreateDamagedTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE damaged ( +CREATE TABLE IF NOT EXISTS damaged ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `original_date` datetime NOT NULL, `damaged_date` datetime NOT NULL, diff --git a/Schema/mysql/003_CreatePaymentsInitialTable.sql b/Schema/mysql/003_CreatePaymentsInitialTable.sql index cac4ebc..26bc744 100644 --- a/Schema/mysql/003_CreatePaymentsInitialTable.sql +++ b/Schema/mysql/003_CreatePaymentsInitialTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE payments_initial ( +CREATE TABLE IF NOT EXISTS payments_initial ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `contribution_tracking_id` int(11) DEFAULT NULL, `gateway` varchar(255) DEFAULT NULL, diff --git a/Schema/sqlite/001_CreatePendingTable.sql b/Schema/sqlite/001_CreatePendingTable.sql index c6e7b41..0edcd69 100644 --- a/Schema/sqlite/001_CreatePendingTable.sql +++ b/Schema/sqlite/001_CreatePendingTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE pending ( +CREATE TABLE IF NOT EXISTS pending ( `id` integer primary key, `date` datetime NOT NULL, `gateway` varchar(255) NOT NULL, diff --git a/Schema/sqlite/002_CreateDamagedTable.sql b/Schema/sqlite/002_CreateDamagedTable.sql index 64eb97f..e13a8bb 100644 --- a/Schema/sqlite/002_CreateDamagedTable.sql +++ b/Schema/sqlite/002_CreateDamagedTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE damaged ( +CREATE TABLE IF NOT EXISTS damaged ( `id` integer primary key, `original_date` datetime NOT NULL, `damaged_date` datetime NOT NULL, diff --git a/Schema/sqlite/003_CreatePaymentsInitialTable.sql b/Schema/sqlite/003_CreatePaymentsInitialTable.sql index c3ecd22..b06d6e6 100644 --- a/Schema/sqlite/003_CreatePaymentsInitialTable.sql +++ b/Schema/sqlite/003_CreatePaymentsInitialTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE payments_initial ( +CREATE TABLE IF NOT EXISTS payments_initial ( `id` integer primary key, `contribution_tracking_id` integer NULL, `gateway` varchar(255) NULL, -- To view, visit https://gerrit.wikimedia.org/r/310707 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic25887e9f591c6997dc19172c442de71f59cf25b Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig 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]: Re-add parser tests to the ParserTests group
jenkins-bot has submitted this change and it was merged. Change subject: Re-add parser tests to the ParserTests group .. Re-add parser tests to the ParserTests group It was omitted due to the new way in which parser test TestCase objects are constructed. Should fix Jenkins double-execution of parser tests. Change-Id: I8131c3b13f2e08f784bce46fee16051c14761304 --- M tests/phpunit/includes/parser/ParserIntegrationTest.php M tests/phpunit/suites/ParserTestFileSuite.php 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/includes/parser/ParserIntegrationTest.php b/tests/phpunit/includes/parser/ParserIntegrationTest.php index 698bd0b..b38c98d 100644 --- a/tests/phpunit/includes/parser/ParserIntegrationTest.php +++ b/tests/phpunit/includes/parser/ParserIntegrationTest.php @@ -9,6 +9,7 @@ * * @group Database * @group Parser + * @group ParserTests * * @todo covers tags */ diff --git a/tests/phpunit/suites/ParserTestFileSuite.php b/tests/phpunit/suites/ParserTestFileSuite.php index d3129b1..dbee894 100644 --- a/tests/phpunit/suites/ParserTestFileSuite.php +++ b/tests/phpunit/suites/ParserTestFileSuite.php @@ -18,7 +18,7 @@ foreach ( $this->ptFileInfo['tests'] as $test ) { $this->addTest( new ParserIntegrationTest( $runner, $fileName, $test ), - [ 'Database', 'Parser' ] ); + [ 'Database', 'Parser', 'ParserTests' ] ); } } -- To view, visit https://gerrit.wikimedia.org/r/310699 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8131c3b13f2e08f784bce46fee16051c14761304 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Tim StarlingGerrit-Reviewer: C. Scott Ananian Gerrit-Reviewer: Jackmcbarn Gerrit-Reviewer: MaxSem Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix broken select() call in rebuildFileCache.php
jenkins-bot has submitted this change and it was merged. Change subject: Fix broken select() call in rebuildFileCache.php .. Fix broken select() call in rebuildFileCache.php A few other small cleanups Change-Id: Ie62cf93feb5a57f629a893c7ea298ed902b52789 --- M maintenance/rebuildFileCache.php 1 file changed, 6 insertions(+), 4 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index 649557e..b278e98 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -74,10 +74,10 @@ $overwrite = $this->getOption( 'overwrite', false ); $start = ( $start > 0 ) ? $start - : $dbr->selectField( 'page', 'MIN(page_id)', false, __FUNCTION__ ); + : $dbr->selectField( 'page', 'MIN(page_id)', false, __METHOD__ ); $end = ( $end > 0 ) ? $end - : $dbr->selectField( 'page', 'MAX(page_id)', false, __FUNCTION__ ); + : $dbr->selectField( 'page', 'MAX(page_id)', false, __METHOD__ ); if ( !$start ) { $this->error( "Nothing to do.", true ); } @@ -93,9 +93,11 @@ // Go through each page and save the output while ( $blockEnd <= $end ) { // Get the pages - $res = $dbr->select( 'page', [ 'page_namespace', 'page_title', 'page_id' ], + $res = $dbr->select( 'page', + [ 'page_namespace', 'page_title', 'page_id' ], [ 'page_namespace' => MWNamespace::getContentNamespaces(), "page_id BETWEEN $blockStart AND $blockEnd" ], + __METHOD__, [ 'ORDER BY' => 'page_id ASC', 'USE INDEX' => 'PRIMARY' ] ); @@ -119,7 +121,7 @@ // If the article is cacheable, then load it if ( $article->isFileCacheable() ) { - $cache = HTMLFileCache::newFromTitle( $title, 'view' ); + $cache = new HTMLFileCache( $title, 'view' ); if ( $cache->isCacheGood() ) { if ( $overwrite ) { $rebuilt = true; -- To view, visit https://gerrit.wikimedia.org/r/310695 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie62cf93feb5a57f629a893c7ea298ed902b52789 Gerrit-PatchSet: 1 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] operations/puppet[production]: ldap: Use require_package instead of package latest
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/310706 Change subject: ldap: Use require_package instead of package latest .. ldap: Use require_package instead of package latest Bug: T115348 Change-Id: Ic263fd61a6023486c02735e0a9163dc29b131243 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/06/310706/1 -- To view, visit https://gerrit.wikimedia.org/r/310706 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic263fd61a6023486c02735e0a9163dc29b131243 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Paladox___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make WikiPage::getRevision() make use of Revision::newKnownC...
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310705 Change subject: Make WikiPage::getRevision() make use of Revision::newKnownCurrent() .. Make WikiPage::getRevision() make use of Revision::newKnownCurrent() Change-Id: Id06319b31bc523a5d514930c3d609af4d991453b --- M includes/page/WikiPage.php 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/05/310705/1 diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index c09d0eb..6c0c4a8 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -621,15 +621,18 @@ // happened after the first S1 SELECT. // http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html#isolevel_repeatable-read $flags = Revision::READ_LOCKING; + $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); } elseif ( $this->mDataLoadedFrom == self::READ_LATEST ) { // Bug T93976: if page_latest was loaded from the master, fetch the // revision from there as well, as it may not exist yet on a replica DB. // Also, this keeps the queries in the same REPEATABLE-READ snapshot. $flags = Revision::READ_LATEST; + $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); } else { - $flags = 0; + $dbr = wfGetDB( DB_REPLICA ); + $revision = Revision::newKnownCurrent( $dbr, $this->getId(), $latest ); } - $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); + if ( $revision ) { // sanity $this->setLastEdit( $revision ); } -- To view, visit https://gerrit.wikimedia.org/r/310705 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id06319b31bc523a5d514930c3d609af4d991453b 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] operations/puppet[production]: contint: don't use ensure 'latest' with php packages
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/310704 Change subject: contint: don't use ensure 'latest' with php packages .. contint: don't use ensure 'latest' with php packages As part of the "audit uses of ensure => latest", do not use latest but just "present" with PHP packages used by the contint module. Bug: T115348 Change-Id: I150696956a7ba2b9877ca7ecbefa47f0f6759be7 --- M modules/contint/manifests/packages/php.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/04/310704/1 diff --git a/modules/contint/manifests/packages/php.pp b/modules/contint/manifests/packages/php.pp index 305050a..0f69b64 100644 --- a/modules/contint/manifests/packages/php.pp +++ b/modules/contint/manifests/packages/php.pp @@ -44,7 +44,7 @@ 'php7.0-mbstring', 'php7.0-xml', ]: -ensure => latest, +ensure => present, require => Apt::Repository['sury-php'], } } -- To view, visit https://gerrit.wikimedia.org/r/310704 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I150696956a7ba2b9877ca7ecbefa47f0f6759be7 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move IDatabase/ILoadBalancer to /libs/rdbms
jenkins-bot has submitted this change and it was merged. Change subject: Move IDatabase/ILoadBalancer to /libs/rdbms .. Move IDatabase/ILoadBalancer to /libs/rdbms Change-Id: I71f980b1024dc2fbca9cafbad2c9daebb6f28c9b --- M autoload.php R includes/libs/rdbms/database/IDatabase.php R includes/libs/rdbms/loadbalancer/ILoadBalancer.php 3 files changed, 10 insertions(+), 10 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/autoload.php b/autoload.php index d6908c1..66736b3 100644 --- a/autoload.php +++ b/autoload.php @@ -575,12 +575,12 @@ 'ICacheHelper' => __DIR__ . '/includes/cache/CacheHelper.php', 'IContextSource' => __DIR__ . '/includes/context/IContextSource.php', 'IDBAccessObject' => __DIR__ . '/includes/dao/IDBAccessObject.php', - 'IDatabase' => __DIR__ . '/includes/db/IDatabase.php', + 'IDatabase' => __DIR__ . '/includes/libs/rdbms/database/IDatabase.php', 'IEContentAnalyzer' => __DIR__ . '/includes/libs/IEContentAnalyzer.php', 'IEUrlExtension' => __DIR__ . '/includes/libs/IEUrlExtension.php', 'IExpiringStore' => __DIR__ . '/includes/libs/objectcache/IExpiringStore.php', 'IJobSpecification' => __DIR__ . '/includes/jobqueue/JobSpecification.php', - 'ILoadBalancer' => __DIR__ . '/includes/db/loadbalancer/ILoadBalancer.php', + 'ILoadBalancer' => __DIR__ . '/includes/libs/rdbms/loadbalancer/ILoadBalancer.php', 'IP' => __DIR__ . '/includes/utils/IP.php', 'IPSet' => __DIR__ . '/includes/compat/IPSetCompat.php', 'IPTC' => __DIR__ . '/includes/media/IPTC.php', diff --git a/includes/db/IDatabase.php b/includes/libs/rdbms/database/IDatabase.php similarity index 99% rename from includes/db/IDatabase.php rename to includes/libs/rdbms/database/IDatabase.php index e2d7436..f1242e4 100644 --- a/includes/db/IDatabase.php +++ b/includes/libs/rdbms/database/IDatabase.php @@ -445,7 +445,7 @@ * Closes a database connection. * if it is open : commits any open transactions * -* @throws MWException +* @throws DBError * @return bool Operation success. true if already closed. */ public function close(); @@ -474,7 +474,7 @@ * comment (you can use __METHOD__ or add some extra info) * @param bool $tempIgnore Whether to avoid throwing an exception on errors... * maybe best to catch the exception instead? -* @throws MWException +* @throws DBError * @return bool|ResultWrapper True for a successful write query, ResultWrapper object * for a successful read query, or false on failure if $tempIgnore set */ @@ -890,7 +890,7 @@ *- LIST_OR:ORed WHERE clause (without the WHERE) *- LIST_SET: Comma separated with field names, like a SET clause *- LIST_NAMES: Comma separated field names -* @throws MWException|DBUnexpectedError +* @throws DBError * @return string */ public function makeList( $a, $mode = LIST_COMMA ); @@ -1486,7 +1486,7 @@ * * @param string $prefix Only show tables with this prefix, e.g. mw_ * @param string $fname Calling function name -* @throws MWException +* @throws DBError * @return array */ public function listTables( $prefix = null, $fname = __METHOD__ ); diff --git a/includes/db/loadbalancer/ILoadBalancer.php b/includes/libs/rdbms/loadbalancer/ILoadBalancer.php similarity index 98% rename from includes/db/loadbalancer/ILoadBalancer.php rename to includes/libs/rdbms/loadbalancer/ILoadBalancer.php index 94e0f2b..69c6272 100644 --- a/includes/db/loadbalancer/ILoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/ILoadBalancer.php @@ -37,7 +37,7 @@ * - waitTimeout : Maximum time to wait for replicas for consistency [optional] * - srvCache : BagOStuff object [optional] * - wanCache : WANObjectCache object [optional] -* @throws MWException +* @throws InvalidArgumentException */ public function __construct( array $params ); @@ -49,7 +49,7 @@ * Side effect: opens connections to databases * @param string|bool $group Query group, or false for the generic reader * @param string|bool $wiki Wiki ID, or false for the current wiki -* @throws MWException +* @throws DBError * @return bool|int|string */ public function getReaderIndex( $group = false, $wiki = false ); @@ -98,7 +98,7 @@ * @param array|string|bool $groups Query group(s), or false for the generic reader * @param string|bool $wiki Wiki ID, or false for the current wiki * -* @throws MWException +* @throws DBError * @return IDatabase */
[MediaWiki-commits] [Gerrit] wikimedia...SmashPig[master]: Defaults for more queues
jenkins-bot has submitted this change and it was merged. Change subject: Defaults for more queues .. Defaults for more queues Add Redis versions of donations, refunds, and recurring Change-Id: I73bb2cb8d9aecab50501deb502ac3fb2c2129fb8 --- M SmashPig.yaml 1 file changed, 40 insertions(+), 0 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/SmashPig.yaml b/SmashPig.yaml index ce72eed..d62501a 100644 --- a/SmashPig.yaml +++ b/SmashPig.yaml @@ -29,6 +29,13 @@ constructor-parameters: - antifraud +payments-antifraud: +class: PHPQueue\Backend\Predis +constructor-parameters: +- +<<: *REDIS +queue: payments-antifraud + pending: class: SmashPig\Core\DataStores\StompDataStore constructor-parameters: @@ -41,6 +48,7 @@ <<: *REDIS queue: pending +# FIXME: Consolidate these two backends pending-db: class: PDO constructor-parameters: @@ -56,6 +64,24 @@ constructor-parameters: - 'mysql:host=127.0.0.1;dbname=fredge' +recurring: +class: SmashPig\Core\DataStores\MultiQueueWriter +constructor-parameters: +- +- recurring-stomp + +recurring-stomp: +class: SmashPig\Core\DataStores\StompDataStore +constructor-parameters: +- recurring + +recurring-new: +class: PHPQueue\Backend\Predis +constructor-parameters: +- +<<: *REDIS +queue: recurring + refund: class: SmashPig\Core\DataStores\MultiQueueWriter constructor-parameters: @@ -66,6 +92,13 @@ class: SmashPig\Core\DataStores\StompDataStore constructor-parameters: - refund + +refund-new: +class: PHPQueue\Backend\Predis +constructor-parameters: +- +<<: *REDIS +queue: refund limbo: class: SmashPig\Core\DataStores\StompDataStore @@ -93,6 +126,12 @@ constructor-parameters: - verified +donations: +class: PHPQueue\Backend\Predis +constructor-parameters: +- +<<: *REDIS + # Library definitions stomp: uri: tcp://localhost:61613 @@ -107,6 +146,7 @@ failed: /queue/failed pending: /queue/pending pending-damaged: /queue/pending-damaged +recurring: /queue/donations_recurring refund: /queue/refund jobs: /queue/job-requests jobs-damaged: /queue/jobs-requests-damaged -- To view, visit https://gerrit.wikimedia.org/r/309181 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73bb2cb8d9aecab50501deb502ac3fb2c2129fb8 Gerrit-PatchSet: 8 Gerrit-Project: wikimedia/fundraising/SmashPig 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/puppet[production]: mediawiki_singlenode: Use require_package instead of package...
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/310703 Change subject: mediawiki_singlenode: Use require_package instead of package latest .. mediawiki_singlenode: Use require_package instead of package latest Bug: T115348 Change-Id: Ia6b14aa2ea4d38e813d1257e455a318ac0859cf3 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/03/310703/1 -- To view, visit https://gerrit.wikimedia.org/r/310703 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia6b14aa2ea4d38e813d1257e455a318ac0859cf3 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] operations/puppet[production]: mariadb: Use require_package instead of package latest
Paladox has uploaded a new change for review. https://gerrit.wikimedia.org/r/310702 Change subject: mariadb: Use require_package instead of package latest .. mariadb: Use require_package instead of package latest Bug: T115348 Change-Id: I4f80868d50970e656a26ae8404523f1618d64264 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/02/310702/1 -- To view, visit https://gerrit.wikimedia.org/r/310702 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f80868d50970e656a26ae8404523f1618d64264 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] integration/config[master]: mediawiki: Merge parsertests job back into main phpunit job
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/310701 Change subject: mediawiki: Merge parsertests job back into main phpunit job .. mediawiki: Merge parsertests job back into main phpunit job This was originally separated because the parser tests were too slow. Since recent refactoring they are much much faster. By accident, the refactor also broke --exclude-group=ParserTests (fixed in ). This meant that for the past week we've already been running parser tests in the main phpunit jobs as well. And still, it wasn't the slowest job. Change-Id: Ic2934746be68c06c1fc747e93f4fa73200eba652 --- M jjb/mediawiki.yaml M zuul/layout.yaml 2 files changed, 4 insertions(+), 81 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/01/310701/1 diff --git a/jjb/mediawiki.yaml b/jjb/mediawiki.yaml index 1342e29..033b930 100644 --- a/jjb/mediawiki.yaml +++ b/jjb/mediawiki.yaml @@ -105,7 +105,7 @@ publishers: - mw-teardown -# Runs all MediaWiki tests under hhvm on Nodepool instances +# Runs all MediaWiki PHPUnit tests on Nodepool - job-template: name: 'mediawiki-phpunit-{phpflavor}-{image}' node: ci-{image}-wikimedia @@ -124,43 +124,13 @@ - mw-install-mysql - mw-apply-settings - mw-fetch-composer-dev - # ParserTests tests are run via 'mediawiki-phpunit-parsertests-phpflavor' - - shell: "PHPUNIT_EXCLUDE_GROUP=ParserTests /srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" + - shell: "/srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" publishers: - phpunit-junit-2 - archive-log-dir - castor-save -# Only runs the 'parsertests' MediaWiki test suite on Nodepool instances -# Complements 'mediawiki-phpunit-{phpflavor}-{image}' -- job-template: -name: 'mediawiki-parsertests-{phpflavor}-{image}' -node: ci-{image}-wikimedia -concurrent: true -triggers: - - zuul -builders: - - castor-load - - assert-phpflavor: - phpflavor: '{phpflavor}' - - hhvm-clear-hhbc - - zuul-cloner: - projects: > - mediawiki/core - mediawiki/vendor - - mw-install-mysql - - mw-apply-settings - - mw-fetch-composer-dev - - shell: "PHPUNIT_TESTSUITE=parsertests /srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" -publishers: - - phpunit-junit-2 - - archive-log-dir - - castor-save - -# Runs subset of MediaWiki tests -# -# Excludes '@group ParserTests' tests which are run in parallel via -# mediawiki-phpunit-parsertests-{phpflavor} +# Runs all MediaWiki PHPUnit tests on a CI slave - job-template: name: 'mediawiki-phpunit-{phpflavor}' node: 'contintLabsSlave && phpflavor-{phpflavor}' @@ -180,37 +150,7 @@ - mw-install-mysql - mw-apply-settings - mw-fetch-composer-dev - # ParserTests tests are run via 'mediawiki-phpunit-parsertests-phpflavor' - - shell: "PHPUNIT_EXCLUDE_GROUP=ParserTests /srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" -publishers: - - phpunit-junit-2 - - mw-teardown-mysql - - archive-log-dir - -# mediawiki-phpunit-parsertests-{phpflavor} -# -# Only runs the 'parsertests' MediaWiki testsuite. -# Complements 'mediawiki-phpunit-{phpflavor}'. -- job-template: -name: 'mediawiki-phpunit-parsertests-{phpflavor}' -node: 'contintLabsSlave && phpflavor-{phpflavor}' -concurrent: true -properties: - - throttle-one-per-node -triggers: - - zuul -builders: - - assert-phpflavor: - phpflavor: '{phpflavor}' - - hhvm-clear-hhbc - - zuul-cloner: - projects: > - mediawiki/core - mediawiki/vendor - - mw-install-mysql - - mw-apply-settings - - mw-fetch-composer-dev - - shell: "PHPUNIT_TESTSUITE=parsertests /srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" + - shell: "/srv/deployment/integration/slave-scripts/bin/mw-phpunit.sh" publishers: - phpunit-junit-2 - mw-teardown-mysql @@ -361,9 +301,6 @@ - 'mediawiki-phpunit-{phpflavor}': phpflavor: - php53 - - 'mediawiki-phpunit-parsertests-{phpflavor}': - phpflavor: - - php53 - 'mediawiki-phpunit-{phpflavor}-{image}': _images phpflavor: - php55: @@ -373,7 +310,6 @@ image: trusty - hhvm: image: jessie - - 'mediawiki-parsertests-{phpflavor}-{image}': *phpflavor_images - 'mediawiki-phpunit-{phpflavor}-composer' - 'mediawiki-extensions-{phpflavor}': diff --git a/zuul/layout.yaml b/zuul/layout.yaml index e522fca..40da7e5 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -1339,15 +1339,12 @@ - mediawiki-core-php53lint - mediawiki-core-php55lint - mediawiki-phpunit-hhvm-trusty - -
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: How many times it explodes?
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/310700 Change subject: How many times it explodes? .. How many times it explodes? Change-Id: I2e10d06d022b810563d46254ebae969336e462ce --- M tests/parser/parserTests.txt 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/00/310700/1 diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 2c8b163..566f913 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -284,7 +284,7 @@ !! test Simple paragraph !! wikitext -This is a simple paragraph. +This is a simple paragraph. BOOM! !! html This is a simple paragraph. -- To view, visit https://gerrit.wikimedia.org/r/310700 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e10d06d022b810563d46254ebae969336e462ce Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core 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]: mediawiki.Upload.BookletLayout: Fix typo in comment
jenkins-bot has submitted this change and it was merged. Change subject: mediawiki.Upload.BookletLayout: Fix typo in comment .. mediawiki.Upload.BookletLayout: Fix typo in comment Follows-up 33041b752d. Change-Id: I50747f140d6c0a42385aa94c8827f8ff7354628d --- M resources/src/mediawiki/mediawiki.Upload.BookletLayout.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js index 920835f..7c4855f 100644 --- a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js +++ b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js @@ -346,7 +346,7 @@ return this.upload.getApi() .then( function ( api ) { // 'amenableparser' will expand templates and parser functions server-side. - // We still do the rest of wikitext parsing here (throught jqueryMsg). + // We still do the rest of wikitext parsing here (through jqueryMsg). return api.loadMessagesIfMissing( [ error.message.key ], { amenableparser: true } ) .then( function () { if ( !mw.message( error.message.key ).exists() ) { -- To view, visit https://gerrit.wikimedia.org/r/310688 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I50747f140d6c0a42385aa94c8827f8ff7354628d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: KrinkleGerrit-Reviewer: Addshore Gerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Jack Phoenix Gerrit-Reviewer: MarkTraceur 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]: Re-add parser tests to the ParserTests group
Tim Starling has uploaded a new change for review. https://gerrit.wikimedia.org/r/310699 Change subject: Re-add parser tests to the ParserTests group .. Re-add parser tests to the ParserTests group It was omitted due to the new way in which parser test TestCase objects are constructed. Should fix Jenkins double-execution of parser tests. Change-Id: I8131c3b13f2e08f784bce46fee16051c14761304 --- M tests/phpunit/includes/parser/ParserIntegrationTest.php M tests/phpunit/suites/ParserTestFileSuite.php 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/99/310699/1 diff --git a/tests/phpunit/includes/parser/ParserIntegrationTest.php b/tests/phpunit/includes/parser/ParserIntegrationTest.php index 698bd0b..b38c98d 100644 --- a/tests/phpunit/includes/parser/ParserIntegrationTest.php +++ b/tests/phpunit/includes/parser/ParserIntegrationTest.php @@ -9,6 +9,7 @@ * * @group Database * @group Parser + * @group ParserTests * * @todo covers tags */ diff --git a/tests/phpunit/suites/ParserTestFileSuite.php b/tests/phpunit/suites/ParserTestFileSuite.php index d3129b1..dbee894 100644 --- a/tests/phpunit/suites/ParserTestFileSuite.php +++ b/tests/phpunit/suites/ParserTestFileSuite.php @@ -18,7 +18,7 @@ foreach ( $this->ptFileInfo['tests'] as $test ) { $this->addTest( new ParserIntegrationTest( $runner, $fileName, $test ), - [ 'Database', 'Parser' ] ); + [ 'Database', 'Parser', 'ParserTests' ] ); } } -- To view, visit https://gerrit.wikimedia.org/r/310699 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8131c3b13f2e08f784bce46fee16051c14761304 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Tim Starling___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Reject isRequeue messages after expiry
jenkins-bot has submitted this change and it was merged. Change subject: Reject isRequeue messages after expiry .. Reject isRequeue messages after expiry FIXME: configurable variables are kinda lying. Should replace max retries with max age. Bug: T142028 Change-Id: I77293f7832f8624a386b815a35307a206033f316 --- M sites/all/modules/wmf_common/WmfQueueConsumer.php 1 file changed, 10 insertions(+), 3 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/sites/all/modules/wmf_common/WmfQueueConsumer.php b/sites/all/modules/wmf_common/WmfQueueConsumer.php index 9a1fc49..081db09 100644 --- a/sites/all/modules/wmf_common/WmfQueueConsumer.php +++ b/sites/all/modules/wmf_common/WmfQueueConsumer.php @@ -42,11 +42,18 @@ $message, WmfException $ex, $correlationId ) { $mailableDetails = ''; + $reject = false; if ( $ex->isRequeue() ) { $delay = intval( variable_get( 'wmf_common_requeue_delay', 20 * 60 ) ); - $retryDate = time() + $delay; - $this->sendToDamagedStore( $message, $ex, $retryDate ); + $maxTries = intval( variable_get( 'wmf_common_requeue_max', 10 ) ); + $ageLimit = $delay * $maxTries; + if ( $message['date'] + $ageLimit < time() ) { + $reject = true; + } else { + $retryDate = time() + $delay; + $this->sendToDamagedStore( $message, $ex, $retryDate ); + } } if ( $ex->isDropMessage() ) { @@ -56,7 +63,7 @@ NULL, WATCHDOG_ERROR ); - } elseif ( $ex->isRejectMessage() ) { + } elseif ( $ex->isRejectMessage() || $reject ) { $messageString = json_encode( $message ); watchdog( 'wmf_common', -- To view, visit https://gerrit.wikimedia.org/r/306450 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I77293f7832f8624a386b815a35307a206033f316 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...Echo[master]: Update the badges' seen state when Special:Notifications is ...
Mooeypoo has uploaded a new change for review. https://gerrit.wikimedia.org/r/310698 Change subject: Update the badges' seen state when Special:Notifications is visited .. Update the badges' seen state when Special:Notifications is visited The special page and badges are completely different 'modules' so their data models are disconnected. We do, however, want to make sure that the badges' colors are updated when the special page is loaded. We could tell the back end to never render the color of the badge when we visit the special page, but that isn't consistent with our update of seenTime, because there could be cases where the user loaded the special page and moved away (or had a fluke API issue) which means that the seenTime (and seen state in general) was *not* updated. We should represent this state when it is actually updated. Bug: T134855 Change-Id: I053ce07ca26a858fd42c9d070b7dce73cc161e4b --- M modules/ext.echo.init.js M modules/ui/mw.echo.ui.NotificationsInboxWidget.js 2 files changed, 28 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/98/310698/1 diff --git a/modules/ext.echo.init.js b/modules/ext.echo.init.js index f563f5d..70e1781 100644 --- a/modules/ext.echo.init.js +++ b/modules/ext.echo.init.js @@ -22,8 +22,6 @@ numMessages = $existingMessageLink.attr( 'data-counter-num' ), badgeLabelAlerts = $existingAlertLink.attr( 'data-counter-text' ), badgeLabelMessages = $existingMessageLink.attr( 'data-counter-text' ), - hasUnseenAlerts = $existingAlertLink.hasClass( 'mw-echo-unseen-notifications' ), - hasUnseenMessages = $existingMessageLink.hasClass( 'mw-echo-unseen-notifications' ), // Store links links = { notifications: $( '#pt-notifications-alert a' ).attr( 'href' ), @@ -33,7 +31,9 @@ // Respond to click on the notification button and load the UI on demand $( '.mw-echo-notification-badge-nojs' ).click( function ( e ) { var time = mw.now(), - myType = $( this ).parent().prop( 'id' ) === 'pt-notifications-alert' ? 'alert' : 'message'; + myType = $( this ).parent().prop( 'id' ) === 'pt-notifications-alert' ? 'alert' : 'message', + hasUnseenAlerts = $existingAlertLink.hasClass( 'mw-echo-unseen-notifications' ), + hasUnseenMessages = $existingMessageLink.hasClass( 'mw-echo-unseen-notifications' ); if ( e.which !== 1 ) { return; diff --git a/modules/ui/mw.echo.ui.NotificationsInboxWidget.js b/modules/ui/mw.echo.ui.NotificationsInboxWidget.js index d46f72d..dfdf633 100644 --- a/modules/ui/mw.echo.ui.NotificationsInboxWidget.js +++ b/modules/ui/mw.echo.ui.NotificationsInboxWidget.js @@ -262,10 +262,35 @@ widget.displayMessage( true ); } ) + .then( this.makePopupBadgesSeen.bind( this ) ) .always( this.popPending.bind( this ) ); }; /** +* Look for the echo popup badges and update their seen states +* If they are already loaded, trigger an update to their data-model's seentime, +* if they are not yet loaded, remove the 'unseen' classes that specify their +* unseen state. +*/ + mw.echo.ui.NotificationsInboxWidget.prototype.makePopupBadgesSeen = function () { + if ( mw.echo.ui.messageWidget ) { + // This means the badge JS is already loaded + mw.echo.ui.messageWidget.controller.updateSeenTime(); + } else { + // Hijack the DOM and change the state + $( '#pt-notifications-notice a' ).removeClass( 'mw-echo-unseen-notifications' ); + } + + if ( mw.echo.ui.alertWidget ) { + // This means the badge JS is already loaded + mw.echo.ui.alertWidget.controller.updateSeenTime(); + } else { + // Hijack the DOM and change the state + $( '#pt-notifications-alert a' ).removeClass( 'mw-echo-unseen-notifications' ); + } + }; + + /** * Extend the pushPending method to disable UI elements */ mw.echo.ui.NotificationsInboxWidget.prototype.pushPending = function () { -- To view, visit https://gerrit.wikimedia.org/r/310698 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id:
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make SiteStatsUpdate implement MergeableUpdate
Krinkle has submitted this change and it was merged. Change subject: Make SiteStatsUpdate implement MergeableUpdate .. Make SiteStatsUpdate implement MergeableUpdate Change-Id: I53c9bf133f0707f2fa203ddd1a7fcb65be8b1329 --- M includes/deferred/SiteStatsUpdate.php 1 file changed, 14 insertions(+), 7 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/deferred/SiteStatsUpdate.php b/includes/deferred/SiteStatsUpdate.php index d8bc35b..ab4a609 100644 --- a/includes/deferred/SiteStatsUpdate.php +++ b/includes/deferred/SiteStatsUpdate.php @@ -17,25 +17,24 @@ * * @file */ +use Wikimedia\Assert\Assert; /** * Class for handling updates to the site_stats table */ -class SiteStatsUpdate implements DeferrableUpdate { +class SiteStatsUpdate implements DeferrableUpdate, MergeableUpdate { /** @var int */ protected $edits = 0; - /** @var int */ protected $pages = 0; - /** @var int */ protected $articles = 0; - /** @var int */ protected $users = 0; - /** @var int */ protected $images = 0; + + private static $counters = [ 'edits', 'pages', 'articles', 'users', 'images' ]; // @todo deprecate this constructor function __construct( $views, $edits, $good, $pages = 0, $users = 0 ) { @@ -45,6 +44,15 @@ $this->users = $users; } + public function merge( MergeableUpdate $update ) { + /** @var SiteStatsUpdate $update */ + Assert::parameterType( __CLASS__, $update, '$update' ); + + foreach ( self::$counters as $field ) { + $this->$field += $update->$field; + } + } + /** * @param array $deltas * @return SiteStatsUpdate @@ -52,8 +60,7 @@ public static function factory( array $deltas ) { $update = new self( 0, 0, 0 ); - $fields = [ 'views', 'edits', 'pages', 'articles', 'users', 'images' ]; - foreach ( $fields as $field ) { + foreach ( self::$counters as $field ) { if ( isset( $deltas[$field] ) && $deltas[$field] ) { $update->$field = $deltas[$field]; } -- To view, visit https://gerrit.wikimedia.org/r/310578 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53c9bf133f0707f2fa203ddd1a7fcb65be8b1329 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-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]: role: move mediawiki::install to autoloader layout
Dzahn has submitted this change and it was merged. Change subject: role: move mediawiki::install to autoloader layout .. role: move mediawiki::install to autoloader layout Bug: T93645 Change-Id: Id2c0f5212add1b6e80cc83ecedbef9c17db165c3 --- R modules/role/manifests/deprecated/mediawiki/install.pp 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Paladox: Looks good to me, but someone else must approve Dzahn: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/role/manifests/deprecated/mediawiki.pp b/modules/role/manifests/deprecated/mediawiki/install.pp similarity index 100% rename from modules/role/manifests/deprecated/mediawiki.pp rename to modules/role/manifests/deprecated/mediawiki/install.pp -- To view, visit https://gerrit.wikimedia.org/r/308322 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2c0f5212add1b6e80cc83ecedbef9c17db165c3 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: HasharGerrit-Reviewer: Dzahn Gerrit-Reviewer: Giuseppe Lavagetto Gerrit-Reviewer: Hashar Gerrit-Reviewer: Paladox 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/core[master]: Fix $wgFileCache DB outage fallback
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310696 Change subject: Fix $wgFileCache DB outage fallback .. Fix $wgFileCache DB outage fallback Change-Id: I5c41b4669ca29d119de5c08a2c61dbadae7cf55c --- M includes/MediaWiki.php M includes/cache/HTMLFileCache.php M includes/exception/MWExceptionRenderer.php 3 files changed, 51 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/96/310696/1 diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index 9bbbd35..af096cc 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -527,6 +527,25 @@ $e->report(); // display the GUI error } } catch ( Exception $e ) { + $context = $this->context; + if ( + $e instanceof DBConnectionError && + $context->hasTitle() && + $context->getTitle()->canExist() && + $context->getRequest()->getVal( 'action', 'view' ) === 'view' && + HTMLFileCache::useFileCache( $this->context, HTMLFileCache::MODE_OUTAGE ) + ) { + // Try to use any (even stale) file during outages... + $cache = new HTMLFileCache( $context->getTitle(), 'view' ); + if ( $cache->isCached() ) { + $cache->loadFromFileCache( $context ); + $msgHtml = MWExceptionRenderer::getHTML( $e ); + print "\n$msgHtml\n\n"; + exit; + } + + } + MWExceptionHandler::handleException( $e ); } @@ -809,24 +828,22 @@ } } - if ( $this->config->get( 'UseFileCache' ) && $title->getNamespace() >= 0 ) { - if ( HTMLFileCache::useFileCache( $this->context ) ) { - // Try low-level file cache hit - $cache = new HTMLFileCache( $title, $action ); - if ( $cache->isCacheGood( /* Assume up to date */ ) ) { - // Check incoming headers to see if client has this cached - $timestamp = $cache->cacheTimestamp(); - if ( !$output->checkLastModified( $timestamp ) ) { - $cache->loadFromFileCache( $this->context ); - } - // Do any stats increment/watchlist stuff - // Assume we're viewing the latest revision (this should always be the case with file cache) - $this->context->getWikiPage()->doViewUpdates( $this->context->getUser() ); - // Tell OutputPage that output is taken care of - $output->disable(); - - return; + if ( $title->canExist() && HTMLFileCache::useFileCache( $this->context ) ) { + // Try low-level file cache hit + $cache = new HTMLFileCache( $title, $action ); + if ( $cache->isCacheGood( /* Assume up to date */ ) ) { + // Check incoming headers to see if client has this cached + $timestamp = $cache->cacheTimestamp(); + if ( !$output->checkLastModified( $timestamp ) ) { + $cache->loadFromFileCache( $this->context ); } + // Do any stats increment/watchlist stuff, assuming user is viewing the + // latest revision (which should always be the case for file cache) + $this->context->getWikiPage()->doViewUpdates( $this->context->getUser() ); + // Tell OutputPage that output is taken care of + $output->disable(); + + return; } } diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php index 1bab0f5..285e152 100644 --- a/includes/cache/HTMLFileCache.php +++ b/includes/cache/HTMLFileCache.php @@ -29,6 +29,9 @@ * @ingroup Cache */ class HTMLFileCache extends FileCacheBase { + const MODE_NORMAL = 0; // normal cache mode + const
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make rebuildFileCache cover ?action=history
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310697 Change subject: Make rebuildFileCache cover ?action=history .. Make rebuildFileCache cover ?action=history Also simplified the logic slightly Change-Id: I6145d52b6b701735fa4bd8e41e07fb2bf6fdcee3 --- M includes/MediaWiki.php M includes/actions/HistoryAction.php M includes/cache/HTMLFileCache.php M includes/page/Article.php M maintenance/rebuildFileCache.php 5 files changed, 64 insertions(+), 42 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/97/310697/1 diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index af096cc..ce1888c 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -528,11 +528,12 @@ } } catch ( Exception $e ) { $context = $this->context; + $action = $context->getRequest()->getVal( 'action', 'view' ); if ( $e instanceof DBConnectionError && $context->hasTitle() && $context->getTitle()->canExist() && - $context->getRequest()->getVal( 'action', 'view' ) === 'view' && + in_array( $action, [ 'view', 'history' ] , true ) && HTMLFileCache::useFileCache( $this->context, HTMLFileCache::MODE_OUTAGE ) ) { // Try to use any (even stale) file during outages... diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 41378fb..f3ef3b3 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -105,8 +105,7 @@ $config = $this->context->getConfig(); # Fill in the file cache if not set already - $useFileCache = $config->get( 'UseFileCache' ); - if ( $useFileCache && HTMLFileCache::useFileCache( $this->getContext() ) ) { + if ( HTMLFileCache::useFileCache( $this->getContext() ) ) { $cache = new HTMLFileCache( $this->getTitle(), 'history' ); if ( !$cache->isCacheGood( /* Assume up to date */ ) ) { ob_start( [ &$cache, 'saveToFileCache' ] ); diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php index 285e152..787e2d8 100644 --- a/includes/cache/HTMLFileCache.php +++ b/includes/cache/HTMLFileCache.php @@ -21,6 +21,8 @@ * @ingroup Cache */ +use MediaWiki\MediaWikiServices; + /** * Page view caching in the file system. * The only cacheable actions are "view" and "history". Also special pages @@ -31,6 +33,7 @@ class HTMLFileCache extends FileCacheBase { const MODE_NORMAL = 0; // normal cache mode const MODE_OUTAGE = 1; // fallback cache for DB outages + const MODE_SCRIPT = 2; // background cache rebuild mode /** * Construct an HTMLFileCache object from a Title and an action @@ -52,6 +55,7 @@ */ public function __construct( $title, $action ) { parent::__construct(); + $allowedTypes = self::cacheablePageActions(); if ( !in_array( $action, $allowedTypes ) ) { throw new MWException( 'Invalid file cache type given.' ); @@ -96,16 +100,15 @@ /** * Check if pages can be cached for this request/user * @param IContextSource $context -* @param integer $mode One of the HTMLFileCache::MODE_* constants +* @param integer $mode One of the HTMLFileCache::MODE_* constants (since 1.28) * @return bool */ public static function useFileCache( IContextSource $context, $mode = self::MODE_NORMAL ) { - global $wgUseFileCache, $wgDebugToolbar, $wgContLang; + $config = MediaWikiServices::getInstance()->getMainConfig(); - if ( !$wgUseFileCache ) { + if ( !$config->get( 'UseFileCache' ) && $mode !== self::MODE_SCRIPT ) { return false; - } - if ( $wgDebugToolbar ) { + } elseif ( $config->get( 'DebugToolbar' ) ) { wfDebug( "HTML file cache skipped. \$wgDebugToolbar on\n" ); return false; @@ -133,7 +136,7 @@ $ulang = $context->getLanguage(); // Check that there are no other sources of variation - if ( $user->getId() || !$ulang->equals( $wgContLang ) ) { + if ( $user->getId() || $ulang->getCode() !== $config->get( 'LanguageCode' ) ) { return false; } @@ -153,15 +156,15 @@ * @return void */ public function
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix broken select() call in rebuildFileCache.php
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310695 Change subject: Fix broken select() call in rebuildFileCache.php .. Fix broken select() call in rebuildFileCache.php A few other small cleanups Change-Id: Ie62cf93feb5a57f629a893c7ea298ed902b52789 --- M maintenance/rebuildFileCache.php 1 file changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/95/310695/1 diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index 649557e..b278e98 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -74,10 +74,10 @@ $overwrite = $this->getOption( 'overwrite', false ); $start = ( $start > 0 ) ? $start - : $dbr->selectField( 'page', 'MIN(page_id)', false, __FUNCTION__ ); + : $dbr->selectField( 'page', 'MIN(page_id)', false, __METHOD__ ); $end = ( $end > 0 ) ? $end - : $dbr->selectField( 'page', 'MAX(page_id)', false, __FUNCTION__ ); + : $dbr->selectField( 'page', 'MAX(page_id)', false, __METHOD__ ); if ( !$start ) { $this->error( "Nothing to do.", true ); } @@ -93,9 +93,11 @@ // Go through each page and save the output while ( $blockEnd <= $end ) { // Get the pages - $res = $dbr->select( 'page', [ 'page_namespace', 'page_title', 'page_id' ], + $res = $dbr->select( 'page', + [ 'page_namespace', 'page_title', 'page_id' ], [ 'page_namespace' => MWNamespace::getContentNamespaces(), "page_id BETWEEN $blockStart AND $blockEnd" ], + __METHOD__, [ 'ORDER BY' => 'page_id ASC', 'USE INDEX' => 'PRIMARY' ] ); @@ -119,7 +121,7 @@ // If the article is cacheable, then load it if ( $article->isFileCacheable() ) { - $cache = HTMLFileCache::newFromTitle( $title, 'view' ); + $cache = new HTMLFileCache( $title, 'view' ); if ( $cache->isCacheGood() ) { if ( $overwrite ) { $rebuilt = true; -- To view, visit https://gerrit.wikimedia.org/r/310695 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie62cf93feb5a57f629a893c7ea298ed902b52789 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] operations/puppet[production]: Puppet Panel: rename panel files
Andrew Bogott has submitted this change and it was merged. Change subject: Puppet Panel: rename panel files .. Puppet Panel: rename panel files Change-Id: Id72fe7c300a5641bfbb4ef8b6184a41b23dc202d --- M modules/openstack/manifests/horizon/puppetpanel.pp 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/openstack/manifests/horizon/puppetpanel.pp b/modules/openstack/manifests/horizon/puppetpanel.pp index b23c18a..d0523c3 100644 --- a/modules/openstack/manifests/horizon/puppetpanel.pp +++ b/modules/openstack/manifests/horizon/puppetpanel.pp @@ -20,7 +20,7 @@ notify => Exec['djangorefresh'], require => Package['openstack-dashboard'], } -file { '/usr/share/openstack-dashboard/openstack_dashboard/local/enabled/_1924_puppet_role_panel.py': +file { '/usr/share/openstack-dashboard/openstack_dashboard/local/enabled/_1924_puppet_project_panel.py': source => "puppet:///modules/openstack/${openstack_version}/horizon/puppet_tab_enable.py", owner => 'root', group => 'root', @@ -28,7 +28,7 @@ notify => Exec['djangorefresh'], require => Package['openstack-dashboard'], } -file { '/usr/share/openstack-dashboard/openstack_dashboard/local/enabled/_1925_puppet_role_panel.py': +file { '/usr/share/openstack-dashboard/openstack_dashboard/local/enabled/_1925_puppet_prefix_panel.py': source => "puppet:///modules/openstack/${openstack_version}/horizon/puppet_prefix_tab_enable.py", owner => 'root', group => 'root', -- To view, visit https://gerrit.wikimedia.org/r/310693 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id72fe7c300a5641bfbb4ef8b6184a41b23dc202d Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew BogottGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Hair-raising hack to pass dummy gateway response code to Don...
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/310694 Change subject: Hair-raising hack to pass dummy gateway response code to DonationInterface .. Hair-raising hack to pass dummy gateway response code to DonationInterface Change-Id: Ia7acb8bd61505bc6f43335460cc8404d74922ab5 --- M sites/all/modules/recurring_globalcollect/tests/RecurringGlobalCollectTest.php A sites/all/modules/recurring_globalcollect/tests/TestingRecurringStubAdapter.php 2 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/94/310694/1 diff --git a/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalCollectTest.php b/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalCollectTest.php index 68f0278..7bfada8 100644 --- a/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalCollectTest.php +++ b/sites/all/modules/recurring_globalcollect/tests/RecurringGlobalCollectTest.php @@ -65,6 +65,15 @@ function testChargeRecorded() { + // Get some extra access to the testing adapter :( + global $wgDonationInterfaceGatewayAdapters; + $wgDonationInterfaceGatewayAdapters['globalcollect'] = 'TestingRecurringStubAdapter'; + + // Include using require_once rather than autoload because the file + // depends on a DonationInterface testing class we loaded above. + require_once __DIR__ . '/TestingRecurringStubAdapter.php'; + TestingRecurringStubAdapter::$singletonDummyGatewayResponseCode = 'recurring-OK'; + recurring_globalcollect_charge( $this->contributionRecurId ); $result = civicrm_api3( 'Contribution', 'get', array( diff --git a/sites/all/modules/recurring_globalcollect/tests/TestingRecurringStubAdapter.php b/sites/all/modules/recurring_globalcollect/tests/TestingRecurringStubAdapter.php new file mode 100644 index 000..62c5b8c --- /dev/null +++ b/sites/all/modules/recurring_globalcollect/tests/TestingRecurringStubAdapter.php @@ -0,0 +1,18 @@ +setDummyGatewayResponseCode( self::$singletonDummyGatewayResponseCode ); + } + } +} -- To view, visit https://gerrit.wikimedia.org/r/310694 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia7acb8bd61505bc6f43335460cc8404d74922ab5 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet Panel: rename panel files
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/310693 Change subject: Puppet Panel: rename panel files .. Puppet Panel: rename panel files Change-Id: Id72fe7c300a5641bfbb4ef8b6184a41b23dc202d --- M modules/openstack/manifests/horizon/puppetpanel.pp 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/93/310693/1 diff --git a/modules/openstack/manifests/horizon/puppetpanel.pp b/modules/openstack/manifests/horizon/puppetpanel.pp index b23c18a..d0523c3 100644 --- a/modules/openstack/manifests/horizon/puppetpanel.pp +++ b/modules/openstack/manifests/horizon/puppetpanel.pp @@ -20,7 +20,7 @@ notify => Exec['djangorefresh'], require => Package['openstack-dashboard'], } -file { '/usr/share/openstack-dashboard/openstack_dashboard/local/enabled/_1924_puppet_role_panel.py': +file { '/usr/share/openstack-dashboard/openstack_dashboard/local/enabled/_1924_puppet_project_panel.py': source => "puppet:///modules/openstack/${openstack_version}/horizon/puppet_tab_enable.py", owner => 'root', group => 'root', @@ -28,7 +28,7 @@ notify => Exec['djangorefresh'], require => Package['openstack-dashboard'], } -file { '/usr/share/openstack-dashboard/openstack_dashboard/local/enabled/_1925_puppet_role_panel.py': +file { '/usr/share/openstack-dashboard/openstack_dashboard/local/enabled/_1925_puppet_prefix_panel.py': source => "puppet:///modules/openstack/${openstack_version}/horizon/puppet_prefix_tab_enable.py", owner => 'root', group => 'root', -- To view, visit https://gerrit.wikimedia.org/r/310693 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id72fe7c300a5641bfbb4ef8b6184a41b23dc202d 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] pywikibot...FLOSSbot[master]: repository: fix error verbosity
jenkins-bot has submitted this change and it was merged. Change subject: repository: fix error verbosity .. repository: fix error verbosity Change-Id: I95656a1b550d21537b3a178eeb55eb54fc14f50e Signed-off-by: Loic Dachary--- M FLOSSbot/repository.py 1 file changed, 5 insertions(+), 4 deletions(-) Approvals: Dachary: Looks good to me, approved jenkins-bot: Verified diff --git a/FLOSSbot/repository.py b/FLOSSbot/repository.py index f89b65c..e43b614 100644 --- a/FLOSSbot/repository.py +++ b/FLOSSbot/repository.py @@ -199,12 +199,14 @@ } ORDER BY ?item """ query = query + " # " + str(time.time()) +log.debug(query) site = pywikibot.Site(self.args.language_code, "wikidata") self.setup_cache(site) for item in pg.WikidataSPARQLPageGenerator(query, site=site, result_type=list): -log.info("WORKING ON https://www.wikidata.org/wiki/; + item.id) +log.info("WORKING ON https://www.wikidata.org/wiki/; + + item.getID()) self.fixup_protocol(site, item) self.fixup_rank(site, item) @@ -274,7 +276,7 @@ continue target_protocol = Repository.guess_protocol(claim) if not target_protocol: -log.error("ERROR " + claim.getTarget()) +log.error(claim.getTarget()) continue protocol = pywikibot.Claim(site, P_protocol, 0) protocol.setTarget(target_protocol) @@ -416,8 +418,7 @@ protocol = Repository.guess_protocol_from_url(url) if protocol: if not Repository.verify_protocol(url, protocol, credentials): -log.error("ERROR " + url + - " does not obey the expected protocol " + +log.error(url + " does not obey the expected protocol " + str(protocol)) return None else: -- To view, visit https://gerrit.wikimedia.org/r/310690 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95656a1b550d21537b3a178eeb55eb54fc14f50e Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/bots/FLOSSbot Gerrit-Branch: master Gerrit-Owner: Dachary Gerrit-Reviewer: Dachary 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]: delete ircyall module and role
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/310692 Change subject: delete ircyall module and role .. delete ircyall module and role This module and role is apparently not used on any labs instance anymore, and the labs project has been deleted(?). Bug:T1357 Change-Id: I96e8b5fe46e81b9d1546dd63bc14eabdde58dc2d --- D modules/ircyall/files/ircyall-upstart.conf D modules/ircyall/manifests/init.pp D modules/ircyall/templates/ircyall-web.nginx.erb D modules/role/manifests/ircyall/init.pp 4 files changed, 0 insertions(+), 90 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/92/310692/1 diff --git a/modules/ircyall/files/ircyall-upstart.conf b/modules/ircyall/files/ircyall-upstart.conf deleted file mode 100644 index ffa80c8..000 --- a/modules/ircyall/files/ircyall-upstart.conf +++ /dev/null @@ -1,14 +0,0 @@ -description "Relay for ircyall, notifies to IRC from the web" - -start on runlevel [2345] -stop on runlevel [!2345] - -setuid www-data -setgid www-data - -respawn -respawn limit 10 5 - -script -/usr/bin/ircyall -end script diff --git a/modules/ircyall/manifests/init.pp b/modules/ircyall/manifests/init.pp deleted file mode 100644 index 2df5aeb..000 --- a/modules/ircyall/manifests/init.pp +++ /dev/null @@ -1,58 +0,0 @@ -# = Class: ircyall -# -# Sets up an ircyall instance that can take authenticated -# requests via HTTP and relay them to different IRC channels. -# -# = Parameters -# [*web_port*] -# Port number to use for ircyall web listener -class ircyall( -$web_port = 80, -) { - -redis::instance { 6379: -settings => { -appendonly => true, -appendfilename => "${::hostname}-6379.aof", -}, -} - -package { [ -'python3-flask', -'python3-redis', -'python3-irc3', -'python3-asyncio-redis', -'python3-ircyall', -]: -ensure => present -} - -uwsgi::app { 'ircyall-web': -settings => { -uwsgi => { -'plugins' => 'python3', -'master'=> true, -'processes' => 8, -'module'=> 'ircyall.web2redis', -'callable' => 'app', -'socket'=> '/run/uwsgi/ircyall-web.sock', -} -}, -require => Package['python3-ircyall'], -} - -nginx::site { 'ircyall-web-nginx': -require => Uwsgi::App['ircyall-web'], -content => template('ircyall/ircyall-web.nginx.erb'), -} - -file { '/etc/init/ircyall.conf': -ensure => present, -source => 'puppet:///modules/ircyall/ircyall-upstart.conf', -} - -service { 'ircyall': -ensure => running, -require => [Package['python3-ircyall'], File['/etc/init/ircyall.conf']] -} -} diff --git a/modules/ircyall/templates/ircyall-web.nginx.erb b/modules/ircyall/templates/ircyall-web.nginx.erb deleted file mode 100644 index d1e5868..000 --- a/modules/ircyall/templates/ircyall-web.nginx.erb +++ /dev/null @@ -1,12 +0,0 @@ -upstream quarry { -server unix:/run/uwsgi/ircyall-web.sock; -} - -server { -listen <%= @web_port %>; - -location / { -include uwsgi_params; -uwsgi_pass quarry; -} -} diff --git a/modules/role/manifests/ircyall/init.pp b/modules/role/manifests/ircyall/init.pp deleted file mode 100644 index ea3fd6a..000 --- a/modules/role/manifests/ircyall/init.pp +++ /dev/null @@ -1,6 +0,0 @@ -# = Class: role::ircyall -# -# Sets up an ircyall instance -class role::ircyall { -include ::ircyall -} -- To view, visit https://gerrit.wikimedia.org/r/310692 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I96e8b5fe46e81b9d1546dd63bc14eabdde58dc2d Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikimedia...golden[master]: Expand "other" countries data
Bearloga has submitted this change and it was merged. Change subject: Expand "other" countries data .. Expand "other" countries data - Traffic, clickthrough rate, number of visits, ctr_visit (proportion of visits that have at least one clickthrough), number of sessions, ctr_session (proportion of sessions that have at least one clickthrough), by all countries and US regions - Last action by all countries and US regions - Most common section clicked per visit by all countries and US regions - First visit clickthrough by all countries and US regions Also fixed two bugs in: - Most common section clicked - Generate click breakdown (last action): 1) add sort by timestamp 2) delete lines which modify raw data Bug: T138107 Change-Id: I51c8ca4222175d0ba5c1c48d187c9b0bbe8f7a3d --- M portal/portal.R 1 file changed, 85 insertions(+), 9 deletions(-) Approvals: Bearloga: Verified; Looks good to me, approved diff --git a/portal/portal.R b/portal/portal.R index bf8d3b6..5b77aed 100644 --- a/portal/portal.R +++ b/portal/portal.R @@ -46,7 +46,6 @@ dplyr::arrange(session, ts) %>% dplyr::group_by(session) %>% dplyr::mutate(visit = cumsum(type == "landing")) %>% -dplyr::filter(visit == 1) %>% dplyr::filter(type == "clickthrough") %>% dplyr::group_by(date, session, visit, section_used) %>% dplyr::tally() %>% @@ -75,19 +74,25 @@ dplyr::mutate(date = data$date[1]) %>% dplyr::select(c(date, `no action`, `primary links`, `search`, `secondary links`, `other languages`, `other projects`)) - # Generate click breakdown - data <- data[order(data$type, decreasing = FALSE), ] - data <- data[!duplicated(data$session), ] - breakdown_data <- data[, j = list(events = .N), by = c("date", "section_used")] + # Generate click breakdown (last action) + breakdown_data <- data %>% +dplyr::arrange(ts) %>% +dplyr::filter(!duplicated(session, fromLast = TRUE)) %>% +dplyr::group_by(date, section_used) %>% +dplyr::summarize(events = n()) %>% +data.table::as.data.table() # Generate by-country breakdown with regional data for US - regions <- data.frame(abb = paste0("US:", c(as.character(state.abb), "DC")), + data("ISO_3166_1", package = "ISOcodes") + us_other_abb <- c("AS", "GU", "MP", "PR", "VI") + us_other_mask <- match(us_other_abb, ISO_3166_1$Alpha_2) + regions <- data.frame(abb = c(paste0("US:", c(as.character(state.abb), "DC")), us_other_abb), # ^ need to verify that District of Columbia shows up as DC and not another abbreviation -region = paste0("U.S. (", c(as.character(state.region), "South"), ")"), -state = c(state.name, "District of Columbia"), +region = paste0("U.S. (", c(as.character(state.region), "South", rep("Other",5)), ")"), +state = c(state.name, "District of Columbia", ISO_3166_1$Name[us_other_mask]), stringsAsFactors = FALSE) regions$region[regions$region == "U.S. (North Central)"] <- "U.S. (Midwest)" - regions$region[state.division == "Pacific"] <- "U.S. (Pacific)" # see https://phabricator.wikimedia.org/T136257#2399411 + regions$region[c(state.division == "Pacific", rep(FALSE, 5))] <- "U.S. (Pacific)" # see https://phabricator.wikimedia.org/T136257#2399411 countries <- data.frame(abb = c(regions$abb, "GB", "CA", "DE", "IN", "AU", "CN", "RU", "PH", "FR"), @@ -110,6 +115,71 @@ dplyr::select(c(date, country, events)) %>% dplyr::arrange(desc(country)) + # Experimental: Generate all countries breakdown + all_countries <- data.frame(abb = c(regions$abb, ISO_3166_1$Alpha_2[-us_other_mask]), + name = c(regions$region, ISO_3166_1$Name[-us_other_mask]), + stringsAsFactors = FALSE) + data_w_countryname <- as.data.frame(data) %>% +dplyr::mutate(country = ifelse(country %in% all_countries$abb, country, "Other")) %>% +dplyr::left_join(all_countries, by = c("country" = "abb")) %>% +dplyr::mutate(name = ifelse(is.na(name), "Other", name)) %>% +dplyr::select(-country) %>% dplyr::rename(country = name) + + ctr_visit <- data_w_countryname %>% +dplyr::arrange(session, ts) %>% +dplyr::group_by(session) %>% +dplyr::mutate(visit = cumsum(type == "landing")) %>% +dplyr::group_by(date, country, session, visit) %>% +dplyr::summarize(dummy_clt = sum(type=="clickthrough")>1) %>% +dplyr::group_by(country) %>% +dplyr::summarize(n_visit = n(), ctr_visit = sum(dummy_clt)/n()) + ctr_session <- data_w_countryname %>% +dplyr::group_by(date, country, session) %>% +dplyr::summarize(dummy_clt = sum(type=="clickthrough")>1) %>% +dplyr::group_by(country) %>% +dplyr::summarize(n_session = n(), ctr_session = sum(dummy_clt)/n()) + all_country_data
[MediaWiki-commits] [Gerrit] analytics/discovery-stats[production]: Ensure all metrics are logged with the same time
MaxSem has submitted this change and it was merged. Change subject: Ensure all metrics are logged with the same time .. Ensure all metrics are logged with the same time Bug: T144652 Change-Id: Ic860e95a88ce198be1f3c2868e6296ecef2dd5e4 (cherry picked from commit e74ff2ca4231bce1784ca718d1d2a239fd8cf6ef) --- M tracking-category-count.php 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: MaxSem: Verified; Looks good to me, approved diff --git a/tracking-category-count.php b/tracking-category-count.php index d5fbdfb..a9030e0 100644 --- a/tracking-category-count.php +++ b/tracking-category-count.php @@ -16,13 +16,14 @@ function recordToGraphite( $wiki, $metric, $count ) { global $config, $debug; +static $timestamp = time(); if ( !$config->graphiteHost || !$config->graphitePort ) { return; } $key = str_replace( '%WIKI%', $wiki, $config->categories[$metric] ); -$packet = "$key $count `date +%s`"; +$packet = "$key $count $timestamp"; $nc = "nc -q0 {$config->graphiteHost} {$config->graphitePort}"; $command = "echo \"$packet\" | $nc"; -- To view, visit https://gerrit.wikimedia.org/r/310691 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic860e95a88ce198be1f3c2868e6296ecef2dd5e4 Gerrit-PatchSet: 1 Gerrit-Project: analytics/discovery-stats Gerrit-Branch: production Gerrit-Owner: MaxSemGerrit-Reviewer: MaxSem ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] analytics/discovery-stats[production]: Ensure all metrics are logged with the same time
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/310691 Change subject: Ensure all metrics are logged with the same time .. Ensure all metrics are logged with the same time Bug: T144652 Change-Id: Ic860e95a88ce198be1f3c2868e6296ecef2dd5e4 (cherry picked from commit e74ff2ca4231bce1784ca718d1d2a239fd8cf6ef) --- M tracking-category-count.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/discovery-stats refs/changes/91/310691/1 diff --git a/tracking-category-count.php b/tracking-category-count.php index d5fbdfb..a9030e0 100644 --- a/tracking-category-count.php +++ b/tracking-category-count.php @@ -16,13 +16,14 @@ function recordToGraphite( $wiki, $metric, $count ) { global $config, $debug; +static $timestamp = time(); if ( !$config->graphiteHost || !$config->graphitePort ) { return; } $key = str_replace( '%WIKI%', $wiki, $config->categories[$metric] ); -$packet = "$key $count `date +%s`"; +$packet = "$key $count $timestamp"; $nc = "nc -q0 {$config->graphiteHost} {$config->graphitePort}"; $command = "echo \"$packet\" | $nc"; -- To view, visit https://gerrit.wikimedia.org/r/310691 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic860e95a88ce198be1f3c2868e6296ecef2dd5e4 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] pywikibot...FLOSSbot[master]: repository: fix error verbosity
Dachary has uploaded a new change for review. https://gerrit.wikimedia.org/r/310690 Change subject: repository: fix error verbosity .. repository: fix error verbosity Change-Id: I95656a1b550d21537b3a178eeb55eb54fc14f50e Signed-off-by: Loic Dachary--- M FLOSSbot/repository.py 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/bots/FLOSSbot refs/changes/90/310690/1 diff --git a/FLOSSbot/repository.py b/FLOSSbot/repository.py index f89b65c..4ef8b5f 100644 --- a/FLOSSbot/repository.py +++ b/FLOSSbot/repository.py @@ -199,12 +199,13 @@ } ORDER BY ?item """ query = query + " # " + str(time.time()) +log.debug(query) site = pywikibot.Site(self.args.language_code, "wikidata") self.setup_cache(site) for item in pg.WikidataSPARQLPageGenerator(query, site=site, result_type=list): -log.info("WORKING ON https://www.wikidata.org/wiki/; + item.id) +log.info("WORKING ON https://www.wikidata.org/wiki/; + item.getID()) self.fixup_protocol(site, item) self.fixup_rank(site, item) @@ -274,7 +275,7 @@ continue target_protocol = Repository.guess_protocol(claim) if not target_protocol: -log.error("ERROR " + claim.getTarget()) +log.error(claim.getTarget()) continue protocol = pywikibot.Claim(site, P_protocol, 0) protocol.setTarget(target_protocol) @@ -416,8 +417,7 @@ protocol = Repository.guess_protocol_from_url(url) if protocol: if not Repository.verify_protocol(url, protocol, credentials): -log.error("ERROR " + url + - " does not obey the expected protocol " + +log.error(url + " does not obey the expected protocol " + str(protocol)) return None else: -- To view, visit https://gerrit.wikimedia.org/r/310690 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95656a1b550d21537b3a178eeb55eb54fc14f50e Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/bots/FLOSSbot Gerrit-Branch: master Gerrit-Owner: Dachary ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[wmf/1.28.0-wmf.19]: Always serve all the data on preview
jenkins-bot has submitted this change and it was merged. Change subject: Always serve all the data on preview .. Always serve all the data on preview Bug: T145615 Change-Id: I1a58a9e613a59a4259081fbb8dfb9a39aa813964 (cherry picked from commit a41714fb29e51dc777aba504ef6f423cb987f08e) --- M includes/Tag/TagHandler.php M tests/phpunit/KartographerTest.php 2 files changed, 45 insertions(+), 15 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Tag/TagHandler.php b/includes/Tag/TagHandler.php index 00264b6..7412e71 100644 --- a/includes/Tag/TagHandler.php +++ b/includes/Tag/TagHandler.php @@ -299,19 +299,25 @@ $output->addTrackingCategory( 'kartographer-tracking-category', $parser->getTitle() ); } - $interact = $state->getInteractiveGroups(); - $requested = $state->getRequestedGroups(); - if ( $interact || $requested ) { - $interact = array_flip( $interact ); - $liveData = array_intersect_key( (array)$data, $interact ); - $requested = array_unique( $requested ); - // Prevent pointless API requests for missing groups - foreach ( $requested as $group ) { - if ( !isset( $data->$group ) ) { - $liveData[$group] = []; + // https://phabricator.wikimedia.org/T145615 - include all data in previews + $options = $parser->getOptions(); + if ( $data && ( $options->getIsPreview() || $options->getIsSectionPreview() ) ) { + $output->addJsConfigVars( 'wgKartographerLiveData', $data ); + } else { + $interact = $state->getInteractiveGroups(); + $requested = $state->getRequestedGroups(); + if ( $interact || $requested ) { + $interact = array_flip( $interact ); + $liveData = array_intersect_key( (array)$data, $interact ); + $requested = array_unique( $requested ); + // Prevent pointless API requests for missing groups + foreach ( $requested as $group ) { + if ( !isset( $data->$group ) ) { + $liveData[$group] = []; + } } + $output->addJsConfigVars( 'wgKartographerLiveData', $liveData ); } - $output->addJsConfigVars( 'wgKartographerLiveData', $liveData ); } } diff --git a/tests/phpunit/KartographerTest.php b/tests/phpunit/KartographerTest.php index 7fe468f..d241c9b 100644 --- a/tests/phpunit/KartographerTest.php +++ b/tests/phpunit/KartographerTest.php @@ -171,7 +171,13 @@ ]; } - public function testLiveData() { + /** +* @dataProvider provideLiveData +* @param string[] $expected +* @param bool $preview +* @param bool $sectionPreview +*/ + public function testLiveData( array $expected, $preview, $sectionPreview ) { $text = << @@ -193,20 +199,38 @@ } WIKITEXT; - $output = $this->parse( $text ); + $output = $this->parse( $text, + function( ParserOptions $options ) use ( $preview, $sectionPreview ) { + $options->setIsPreview( $preview ); + $options->setIsSectionPreview( $sectionPreview ); + } + ); $vars = $output->getJsConfigVars(); $this->assertArrayHasKey( 'wgKartographerLiveData', $vars ); - $this->assertArrayEquals( [ '_5e4843908b3c3d3b11ac4321edadedde28882cc2' ], array_keys( $vars['wgKartographerLiveData'] ) ); + $this->assertArrayEquals( $expected, array_keys( (array)$vars['wgKartographerLiveData'] ) ); + } + + public function provideLiveData() { + return [ + [ [ '_5e4843908b3c3d3b11ac4321edadedde28882cc2' ], false, false ], + [ [ '_5e4843908b3c3d3b11ac4321edadedde28882cc2', '_2251fa240a210d2861cc9f44c48d7e3ba116ff2f' ], true, false ], + [ [ '_5e4843908b3c3d3b11ac4321edadedde28882cc2', '_2251fa240a210d2861cc9f44c48d7e3ba116ff2f' ], false, true ], + [ [ '_5e4843908b3c3d3b11ac4321edadedde28882cc2', '_2251fa240a210d2861cc9f44c48d7e3ba116ff2f' ], true, true ], + ]; } /** * Parses wikitext * @param string $text +
[MediaWiki-commits] [Gerrit] mediawiki...FlaggedRevs[master]: Reorder functions to reduce forward declarations
jenkins-bot has submitted this change and it was merged. Change subject: Reorder functions to reduce forward declarations .. Reorder functions to reduce forward declarations Change-Id: I13cdf676cf7cb468966dd1a6ceca248c3e46d6ad --- M frontend/modules/ext.flaggedRevs.advanced.js M frontend/modules/ext.flaggedRevs.review.js 2 files changed, 216 insertions(+), 216 deletions(-) Approvals: Thiemo Mättig (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/frontend/modules/ext.flaggedRevs.advanced.js b/frontend/modules/ext.flaggedRevs.advanced.js index d941800..98796f5 100644 --- a/frontend/modules/ext.flaggedRevs.advanced.js +++ b/frontend/modules/ext.flaggedRevs.advanced.js @@ -10,43 +10,6 @@ /* Dropdown collapse timer */ boxCollapseTimer: null, - /* Startup function */ - init: function () { - // Enables rating detail box - var toggle = $( '#mw-fr-revisiontoggle' ); - - if ( toggle.length ) { - toggle.css( 'display', 'inline' ); // show toggle control - fr.hideBoxDetails(); // hide the initially displayed ratings - } - - // Bar UI: Toggle the box when the toggle is clicked - $( '.fr-toggle-symbol#mw-fr-revisiontoggle' ).click( fr.toggleBoxDetails ); - - // Simple UI: Show the box on mouseOver - $( '.fr-toggle-arrow#mw-fr-revisiontoggle' ).mouseover( fr.onBoxMouseOver ); - $( '.flaggedrevs_short#mw-fr-revisiontag' ).mouseout( fr.onBoxMouseOut ); - - // Enables diff detail box and toggle - toggle = $( '#mw-fr-difftoggle' ); - if ( toggle.length ) { - toggle.css( 'display', 'inline' ); // show toggle control - $( '#mw-fr-stablediff' ).hide(); - } - toggle.children( 'a' ).click( fr.toggleDiff ); - - // Enables log detail box and toggle - toggle = $( '#mw-fr-logtoggle' ); - if ( toggle.length ) { - toggle.css( 'display', 'inline' ); // show toggle control - $( '#mw-fr-logexcerpt' ).hide(); - } - toggle.children( 'a' ).click( fr.toggleLog ); - - // Enables changing of save button when "review this" checkbox changes - $( '#wpReviewEdit' ).click( fr.updateSaveButton ); - }, - /* Expands flag info box details */ showBoxDetails: function () { $( '#mw-fr-revisiondetails' ).css( 'display', 'block' ); @@ -80,6 +43,29 @@ }, /** +* Checks if mouseOut event is for a child of parentId +* @param e {jQuery.Event} +* @param parentId {String} +* @return {Boolean} True if given event object originated from a (direct or indirect) +* child element of an element with an id of parentId. +*/ + isMouseOutBubble: function ( e, parentId ) { + var toNode = e.relatedTarget; + + if ( toNode ) { + var nextParent = toNode.parentNode; + while ( nextParent ) { + if ( nextParent.id === parentId ) { + return true; + } + // next up + nextParent = nextParent.parentNode; + } + } + return false; + }, + + /** * Expands flag info box details on mouseOver * @context {jQuery} * @param e {jQuery.Event} @@ -101,29 +87,6 @@ /*global window*/ fr.boxCollapseTimer = window.setTimeout( fr.hideBoxDetails, 150 ); } - }, - - /** -* Checks if mouseOut event is for a child of parentId -* @param e {jQuery.Event} -* @param parentId {String} -* @return {Boolean} True if given event object originated from a (direct or indirect) -* child element of an element with an id of parentId. -*/ - isMouseOutBubble: function ( e, parentId ) { - var toNode = e.relatedTarget; - - if ( toNode ) { - var nextParent = toNode.parentNode; - while ( nextParent ) { - if ( nextParent.id === parentId ) { - return true; - } - // next up - nextParent = nextParent.parentNode; - } - } - return false; }, /** @@ -203,6 +166,43 @@ }
[MediaWiki-commits] [Gerrit] operations/puppet[production]: ircyall: move role to module/role
Dzahn has submitted this change and it was merged. Change subject: ircyall: move role to module/role .. ircyall: move role to module/role Change-Id: I59eeb42bf6a486990aa2b4e939a6541f7cddd3af --- R modules/role/manifests/ircyall/init.pp 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Paladox: Looks good to me, but someone else must approve Dzahn: Looks good to me, approved jenkins-bot: Verified diff --git a/manifests/role/ircyall.pp b/modules/role/manifests/ircyall/init.pp similarity index 100% rename from manifests/role/ircyall.pp rename to modules/role/manifests/ircyall/init.pp -- To view, visit https://gerrit.wikimedia.org/r/308311 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59eeb42bf6a486990aa2b4e939a6541f7cddd3af Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: HasharGerrit-Reviewer: Dzahn Gerrit-Reviewer: Hashar Gerrit-Reviewer: Paladox 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] operations/mediawiki-config[master]: Add logging channel for NewUserMessage
jenkins-bot has submitted this change and it was merged. Change subject: Add logging channel for NewUserMessage .. Add logging channel for NewUserMessage I'll be adding logging for failures to leave a message, e.g. due to an exception. Bug: T131957 Change-Id: I8263d8bf3a69027bf8934dc665adeb0acec1a957 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: BryanDavis: Looks good to me, but someone else must approve Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index b5b781a..fd0cf5f 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -4548,6 +4548,7 @@ 'Math' => 'info', // mobrovac for T121445 'memcached' => 'error', // -aaron 2012/10/24 'mobile' => 'debug', + 'NewUserMessage' => 'debug', 'oai' => 'debug', 'OAuth' => 'debug', 'OutputBuffer' => 'debug', -- To view, visit https://gerrit.wikimedia.org/r/309346 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8263d8bf3a69027bf8934dc665adeb0acec1a957 Gerrit-PatchSet: 3 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MattflaschenGerrit-Reviewer: BryanDavis Gerrit-Reviewer: Catrope Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs: Use YAML.load instead of .parse for loading YAML
Yuvipanda has submitted this change and it was merged. Change subject: labs: Use YAML.load instead of .parse for loading YAML .. labs: Use YAML.load instead of .parse for loading YAML Change-Id: Iff3601a0fb5d416acc4a7770adff60b6edf29463 --- M modules/wmflib/lib/hiera/httpcache.rb 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Yuvipanda: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/wmflib/lib/hiera/httpcache.rb b/modules/wmflib/lib/hiera/httpcache.rb index ca5e8f6..1c6abb5 100644 --- a/modules/wmflib/lib/hiera/httpcache.rb +++ b/modules/wmflib/lib/hiera/httpcache.rb @@ -68,7 +68,8 @@ end # We shamelessly throw exceptions here, and catch them upper in the chain # specifically in Hiera::Mwcache.stale? and Hiera::Mwcache.read - body = YAML.parse(res.body) + # FIXME: use safe_load here somehow? + body = YAML.load(res.body) body['hiera'] end -- To view, visit https://gerrit.wikimedia.org/r/310689 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff3601a0fb5d416acc4a7770adff60b6edf29463 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: YuvipandaGerrit-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] operations/puppet[production]: snapshot: Fix variable contains an uppercase letter
Dzahn has submitted this change and it was merged. Change subject: snapshot: Fix variable contains an uppercase letter .. snapshot: Fix variable contains an uppercase letter Bug: T93645 Change-Id: Ie32e3820da9d7f20d93a8aec67f91968902af431 --- M modules/snapshot/manifests/cron/cirrussearch.pp M modules/snapshot/manifests/cron/contentxlation.pp M modules/snapshot/manifests/cron/wikidatadumps/json.pp M modules/snapshot/manifests/cron/wikidatadumps/ttl.pp 4 files changed, 15 insertions(+), 15 deletions(-) Approvals: ArielGlenn: Looks good to me, but someone else must approve Dzahn: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/snapshot/manifests/cron/cirrussearch.pp b/modules/snapshot/manifests/cron/cirrussearch.pp index 5994ba8..6fa3476 100644 --- a/modules/snapshot/manifests/cron/cirrussearch.pp +++ b/modules/snapshot/manifests/cron/cirrussearch.pp @@ -16,8 +16,8 @@ source => 'puppet:///modules/snapshot/cron/logrotate.cirrusdump', } -$scriptPath = '/usr/local/bin/dumpcirrussearch.sh' -file { $scriptPath: +$scriptpath = '/usr/local/bin/dumpcirrussearch.sh' +file { $scriptpath: mode=> '0755', owner => 'root', group => 'root', @@ -26,13 +26,13 @@ cron { 'cirrussearch-dump': ensure => 'present', -command => "${scriptPath} --config ${confsdir}/wikidump.conf", +command => "${scriptpath} --config ${confsdir}/wikidump.conf", environment => 'MAILTO=ops-du...@wikimedia.org', user=> $user, minute => '15', hour=> '16', weekday => '1', -require => File[$scriptPath], +require => File[$scriptpath], } } diff --git a/modules/snapshot/manifests/cron/contentxlation.pp b/modules/snapshot/manifests/cron/contentxlation.pp index 00f53a5..a821146 100644 --- a/modules/snapshot/manifests/cron/contentxlation.pp +++ b/modules/snapshot/manifests/cron/contentxlation.pp @@ -8,8 +8,8 @@ $confsdir = $snapshot::dumps::dirs::confsdir $xlationdir = "${otherdir}/contenttranslation" -$scriptPath = '/usr/local/bin/dumpcontentxlation.sh' -file { $scriptPath: +$scriptpath = '/usr/local/bin/dumpcontentxlation.sh' +file { $scriptpath: mode=> '0755', owner => 'root', group => 'root', @@ -33,6 +33,6 @@ minute => '10', hour=> '9', weekday => '5', -require => File[$scriptPath], +require => File[$scriptpath], } } diff --git a/modules/snapshot/manifests/cron/wikidatadumps/json.pp b/modules/snapshot/manifests/cron/wikidatadumps/json.pp index 4618213..60f7b30 100644 --- a/modules/snapshot/manifests/cron/wikidatadumps/json.pp +++ b/modules/snapshot/manifests/cron/wikidatadumps/json.pp @@ -3,8 +3,8 @@ ) { include snapshot::cron::wikidatadumps::common -$scriptPath = '/usr/local/bin/dumpwikidatajson.sh' -file { $scriptPath: +$scriptpath = '/usr/local/bin/dumpwikidatajson.sh' +file { $scriptpath: mode=> '0755', owner => 'root', group => 'root', @@ -14,12 +14,12 @@ cron { 'wikidatajson-dump': ensure => 'present', -command => $scriptPath, +command => $scriptpath, user=> $user, minute => '15', hour=> '3', weekday => '1', -require => File[$scriptPath], +require => File[$scriptpath], } } diff --git a/modules/snapshot/manifests/cron/wikidatadumps/ttl.pp b/modules/snapshot/manifests/cron/wikidatadumps/ttl.pp index ce71051..e90c835 100644 --- a/modules/snapshot/manifests/cron/wikidatadumps/ttl.pp +++ b/modules/snapshot/manifests/cron/wikidatadumps/ttl.pp @@ -3,8 +3,8 @@ ) { include snapshot::cron::wikidatadumps::common -$scriptPath = '/usr/local/bin/dumpwikidatattl.sh' -file { $scriptPath: +$scriptpath = '/usr/local/bin/dumpwikidatattl.sh' +file { $scriptpath: mode=> '0755', owner => 'root', group => 'root', @@ -14,12 +14,12 @@ cron { 'wikidatattl-dump': ensure => 'present', -command => $scriptPath, +command => $scriptpath, user=> $user, minute => '0', hour=> '23', weekday => '1', -require => File[$scriptPath], +require => File[$scriptpath], } } -- To view, visit https://gerrit.wikimedia.org/r/308355 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie32e3820da9d7f20d93a8aec67f91968902af431 Gerrit-PatchSet: 5 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: PaladoxGerrit-Reviewer: ArielGlenn Gerrit-Reviewer: Dzahn Gerrit-Reviewer: EBernhardson
[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs: Use YAML.load instead of .parse for loading YAML
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/310689 Change subject: labs: Use YAML.load instead of .parse for loading YAML .. labs: Use YAML.load instead of .parse for loading YAML Change-Id: Iff3601a0fb5d416acc4a7770adff60b6edf29463 --- M modules/wmflib/lib/hiera/httpcache.rb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/89/310689/1 diff --git a/modules/wmflib/lib/hiera/httpcache.rb b/modules/wmflib/lib/hiera/httpcache.rb index ca5e8f6..f513435 100644 --- a/modules/wmflib/lib/hiera/httpcache.rb +++ b/modules/wmflib/lib/hiera/httpcache.rb @@ -68,7 +68,7 @@ end # We shamelessly throw exceptions here, and catch them upper in the chain # specifically in Hiera::Mwcache.stale? and Hiera::Mwcache.read - body = YAML.parse(res.body) + body = YAML.load(res.body) body['hiera'] end -- To view, visit https://gerrit.wikimedia.org/r/310689 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff3601a0fb5d416acc4a7770adff60b6edf29463 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: cache_upload: do not set do_stream=true on Varnish 4
Ema has uploaded a new change for review. https://gerrit.wikimedia.org/r/310551 Change subject: cache_upload: do not set do_stream=true on Varnish 4 .. cache_upload: do not set do_stream=true on Varnish 4 Varnish 4 already defaults to streaming mode. There is no need to set do_stream to true. Bug: T131502 Change-Id: I6b1acadf3381c76f1a9a05e1ceae37595cb6ff2c --- M templates/varnish/upload-backend.inc.vcl.erb 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/51/310551/1 diff --git a/templates/varnish/upload-backend.inc.vcl.erb b/templates/varnish/upload-backend.inc.vcl.erb index 73482f3..312eec5 100644 --- a/templates/varnish/upload-backend.inc.vcl.erb +++ b/templates/varnish/upload-backend.inc.vcl.erb @@ -62,10 +62,12 @@ <% end -%> sub cluster_be_backend_response { + <%- if not @varnish_version4 -%> // Stream large objects, >= 1 MB if (std.integer(beresp.http.Content-Length, 0) >= 1048576 || beresp.http.Content-Length ~ "^[0-9]{9}") { set beresp.do_stream = true; } + <%- end -%> // Select a random big object storage backend for objects >= 100 MB if (beresp.http.Content-Length ~ "^[0-9]{9}") { -- To view, visit https://gerrit.wikimedia.org/r/310551 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6b1acadf3381c76f1a9a05e1ceae37595cb6ff2c Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ema___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: puppetmaster: Fix whitespace error
Dzahn has submitted this change and it was merged. Change subject: puppetmaster: Fix whitespace error .. puppetmaster: Fix whitespace error Fixes ERROR: trailing whitespace found on line 11 Change-Id: Ic6d59597d7556098faa7695bf51295f3659528fc --- M modules/puppetmaster/manifests/config.pp M modules/role/manifests/puppetmaster/backend.pp 2 files changed, 1 insertion(+), 2 deletions(-) Approvals: Dzahn: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/puppetmaster/manifests/config.pp b/modules/puppetmaster/manifests/config.pp index 70d56e2..2d70129 100644 --- a/modules/puppetmaster/manifests/config.pp +++ b/modules/puppetmaster/manifests/config.pp @@ -8,7 +8,7 @@ ) { $is_37_plus = versioncmp($::puppetversion, '3.7') - + base::puppet::config { 'master': prio=> 20, content => template('puppetmaster/master.conf.erb'), diff --git a/modules/role/manifests/puppetmaster/backend.pp b/modules/role/manifests/puppetmaster/backend.pp index 0af47b5..6846db0 100644 --- a/modules/role/manifests/puppetmaster/backend.pp +++ b/modules/role/manifests/puppetmaster/backend.pp @@ -16,7 +16,6 @@ } } - class { '::puppetmaster': server_type => 'backend', config => $::role::puppetmaster::common::config -- To view, visit https://gerrit.wikimedia.org/r/310672 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic6d59597d7556098faa7695bf51295f3659528fc Gerrit-PatchSet: 4 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: PaladoxGerrit-Reviewer: Alexandros Kosiaris Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Hashar 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]: mediawiki.Upload.BookletLayout: Fix typo in comment
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/310688 Change subject: mediawiki.Upload.BookletLayout: Fix typo in comment .. mediawiki.Upload.BookletLayout: Fix typo in comment Follows-up 33041b752d. Change-Id: I50747f140d6c0a42385aa94c8827f8ff7354628d --- M resources/src/mediawiki/mediawiki.Upload.BookletLayout.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/88/310688/1 diff --git a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js index 920835f..7c4855f 100644 --- a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js +++ b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js @@ -346,7 +346,7 @@ return this.upload.getApi() .then( function ( api ) { // 'amenableparser' will expand templates and parser functions server-side. - // We still do the rest of wikitext parsing here (throught jqueryMsg). + // We still do the rest of wikitext parsing here (through jqueryMsg). return api.loadMessagesIfMissing( [ error.message.key ], { amenableparser: true } ) .then( function () { if ( !mw.message( error.message.key ).exists() ) { -- To view, visit https://gerrit.wikimedia.org/r/310688 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I50747f140d6c0a42385aa94c8827f8ff7354628d 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/core[master]: API: Force straight join for prop=linkshere|transcludedin|fi...
Anomie has uploaded a new change for review. https://gerrit.wikimedia.org/r/310552 Change subject: API: Force straight join for prop=linkshere|transcludedin|fileusage .. API: Force straight join for prop=linkshere|transcludedin|fileusage MySQL (or at least 5.5.5-10.0.23-MariaDB) chooses a really bad query plan if it thinks there will be more matching rows in the linktable than are in page. Use STRAIGHT_JOIN here to force it to use the intended, fast plan. See T145079 for details. Bug: T145079 Change-Id: I1a363450b818a049938145d0feb207c9894d2a49 --- M includes/api/ApiQueryBacklinksprop.php 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/52/310552/1 diff --git a/includes/api/ApiQueryBacklinksprop.php b/includes/api/ApiQueryBacklinksprop.php index 236fb9e..8e89c32 100644 --- a/includes/api/ApiQueryBacklinksprop.php +++ b/includes/api/ApiQueryBacklinksprop.php @@ -264,6 +264,12 @@ } } + // MySQL (or at least 5.5.5-10.0.23-MariaDB) chooses a really bad query + // plan if it thinks there will be more matching rows in the linktable + // than are in page. Use STRAIGHT_JOIN here to force it to use the + // intended, fast plan. See T145079 for details. + $this->addOption( 'STRAIGHT_JOIN' ); + $this->addOption( 'LIMIT', $params['limit'] + 1 ); $res = $this->select( __METHOD__ ); -- To view, visit https://gerrit.wikimedia.org/r/310552 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a363450b818a049938145d0feb207c9894d2a49 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Anomie___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: tendril: fix 'optional before required parameter'
Dzahn has submitted this change and it was merged. Change subject: tendril: fix 'optional before required parameter' .. tendril: fix 'optional before required parameter' Change-Id: I09cf80df0f1421fad13f491a3d87e2f18aea3fdb --- M modules/tendril/manifests/maintenance.pp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/tendril/manifests/maintenance.pp b/modules/tendril/manifests/maintenance.pp index fd41d19..0b6fb72 100644 --- a/modules/tendril/manifests/maintenance.pp +++ b/modules/tendril/manifests/maintenance.pp @@ -4,7 +4,6 @@ # or the database, but it requires having mysql access class tendril::maintenance ( -$ensure = present, $tendril_host, $tendril_user, $tendril_password, @@ -12,6 +11,7 @@ $tendril_port = 3306, $wd_user = undef, $wd_password = undef, +$ensure = present, ){ # We want to control if cron is running, not if the scripts are installed. -- To view, visit https://gerrit.wikimedia.org/r/310685 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I09cf80df0f1421fad13f491a3d87e2f18aea3fdb Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: DzahnGerrit-Reviewer: Dzahn Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs: More fixups to httpyaml hiera backend
Yuvipanda has submitted this change and it was merged. Change subject: labs: More fixups to httpyaml hiera backend .. labs: More fixups to httpyaml hiera backend Change-Id: If7155d50b15bcb4af2ea367c894abbdae44837b5 --- M modules/wmflib/lib/hiera/httpcache.rb 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Yuvipanda: Verified; Looks good to me, approved diff --git a/modules/wmflib/lib/hiera/httpcache.rb b/modules/wmflib/lib/hiera/httpcache.rb index 8a8867d..ca5e8f6 100644 --- a/modules/wmflib/lib/hiera/httpcache.rb +++ b/modules/wmflib/lib/hiera/httpcache.rb @@ -18,7 +18,7 @@ end end -def read(path, _, _) +def read(path, _=nil, _=nil) read_file(path) rescue => detail # When failing to read data, we raise an exception, see https://phabricator.wikimedia.org/T78408 -- To view, visit https://gerrit.wikimedia.org/r/310687 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7155d50b15bcb4af2ea367c894abbdae44837b5 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: YuvipandaGerrit-Reviewer: Yuvipanda ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: labs: More fixups to httpyaml hiera backend
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/310687 Change subject: labs: More fixups to httpyaml hiera backend .. labs: More fixups to httpyaml hiera backend Change-Id: If7155d50b15bcb4af2ea367c894abbdae44837b5 --- M modules/wmflib/lib/hiera/httpcache.rb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/87/310687/1 diff --git a/modules/wmflib/lib/hiera/httpcache.rb b/modules/wmflib/lib/hiera/httpcache.rb index 8a8867d..ca5e8f6 100644 --- a/modules/wmflib/lib/hiera/httpcache.rb +++ b/modules/wmflib/lib/hiera/httpcache.rb @@ -18,7 +18,7 @@ end end -def read(path, _, _) +def read(path, _=nil, _=nil) read_file(path) rescue => detail # When failing to read data, we raise an exception, see https://phabricator.wikimedia.org/T78408 -- To view, visit https://gerrit.wikimedia.org/r/310687 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7155d50b15bcb4af2ea367c894abbdae44837b5 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: phpunit: Simplify mock object syntax in includes/db/ tests
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/310686 Change subject: phpunit: Simplify mock object syntax in includes/db/ tests .. phpunit: Simplify mock object syntax in includes/db/ tests * Omit redundant `expects( $this->any() )`. * Use willReturn() instead of `will( $this->returnValue() )`. Change-Id: If90ac651748af8a78a720992240e40ba53cec79c --- M tests/phpunit/includes/db/DatabaseMysqlBaseTest.php M tests/phpunit/includes/db/LBFactoryTest.php 2 files changed, 18 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/86/310686/1 diff --git a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php index 607f25c..f13ead4 100644 --- a/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php +++ b/tests/phpunit/includes/db/DatabaseMysqlBaseTest.php @@ -169,15 +169,11 @@ ->setMethods( [ 'fetchRow', 'query' ] ) ->getMock(); - $db->expects( $this->any() ) - ->method( 'query' ) + $db->method( 'query' ) ->with( $this->anything() ) - ->will( - $this->returnValue( null ) - ); + ->willReturn( null ); - $db->expects( $this->any() ) - ->method( 'fetchRow' ) + $db->method( 'fetchRow' ) ->with( $this->anything() ) ->will( $this->onConsecutiveCalls( [ 'Tables_in_' => 'view1' ], @@ -361,13 +357,11 @@ 'getLagDetectionMethod', 'getHeartbeatData', 'getMasterServerInfo' ] ) ->getMock(); - $db->expects( $this->any() ) - ->method( 'getLagDetectionMethod' ) - ->will( $this->returnValue( 'pt-heartbeat' ) ); + $db->method( 'getLagDetectionMethod' ) + ->willReturn( 'pt-heartbeat' ); - $db->expects( $this->any() ) - ->method( 'getMasterServerInfo' ) - ->will( $this->returnValue( [ 'serverId' => 172, 'asOf' => time() ] ) ); + $db->method( 'getMasterServerInfo' ) + ->willReturn( [ 'serverId' => 172, 'asOf' => time() ] ); // Fake the current time. list( $nowSecFrac, $nowSec ) = explode( ' ', microtime() ); @@ -381,10 +375,9 @@ $ptTimeISO = $ptDateTime->format( 'Y-m-d\TH:i:s' ); $ptTimeISO .= ltrim( number_format( $ptSecFrac, 6 ), '0' ); - $db->expects( $this->any() ) - ->method( 'getHeartbeatData' ) + $db->method( 'getHeartbeatData' ) ->with( [ 'server_id' => 172 ] ) - ->will( $this->returnValue( [ $ptTimeISO, $now ] ) ); + ->willReturn( [ $ptTimeISO, $now ] ); $db->setLBInfo( 'clusterMasterHost', 'db1052' ); $lagEst = $db->getLag(); diff --git a/tests/phpunit/includes/db/LBFactoryTest.php b/tests/phpunit/includes/db/LBFactoryTest.php index bf78d13..862ec42 100644 --- a/tests/phpunit/includes/db/LBFactoryTest.php +++ b/tests/phpunit/includes/db/LBFactoryTest.php @@ -159,26 +159,18 @@ $mockDB = $this->getMockBuilder( 'DatabaseMysql' ) ->disableOriginalConstructor() ->getMock(); - $mockDB->expects( $this->any() ) - ->method( 'writesOrCallbacksPending' )->will( $this->returnValue( true ) ); - $mockDB->expects( $this->any() ) - ->method( 'lastDoneWrites' )->will( $this->returnValue( $now ) ); - $mockDB->expects( $this->any() ) - ->method( 'getMasterPos' )->will( $this->returnValue( $mPos ) ); + $mockDB->method( 'writesOrCallbacksPending' )->willReturn( true ); + $mockDB->method( 'lastDoneWrites' )->willReturn( $now ); + $mockDB->method( 'getMasterPos' )->willReturn( $mPos ); $lb = $this->getMockBuilder( 'LoadBalancer' ) ->disableOriginalConstructor() ->getMock(); - $lb->expects( $this->any() ) - ->method( 'getConnection' )->will( $this->returnValue( $mockDB ) ); - $lb->expects( $this->any() ) - ->method( 'getServerCount' )->will( $this->returnValue( 2 ) ); - $lb->expects( $this->any() ) - ->method( 'parentInfo' )->will( $this->returnValue( [ 'id' => "main-DEFAULT" ] ) ); - $lb->expects( $this->any() ) -
[MediaWiki-commits] [Gerrit] operations/puppet[production]: tendril: fix 'optional before required parameter'
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/310685 Change subject: tendril: fix 'optional before required parameter' .. tendril: fix 'optional before required parameter' Change-Id: I09cf80df0f1421fad13f491a3d87e2f18aea3fdb --- M modules/tendril/manifests/maintenance.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/85/310685/1 diff --git a/modules/tendril/manifests/maintenance.pp b/modules/tendril/manifests/maintenance.pp index fd41d19..0b6fb72 100644 --- a/modules/tendril/manifests/maintenance.pp +++ b/modules/tendril/manifests/maintenance.pp @@ -4,7 +4,6 @@ # or the database, but it requires having mysql access class tendril::maintenance ( -$ensure = present, $tendril_host, $tendril_user, $tendril_password, @@ -12,6 +11,7 @@ $tendril_port = 3306, $wd_user = undef, $wd_password = undef, +$ensure = present, ){ # We want to control if cron is running, not if the scripts are installed. -- To view, visit https://gerrit.wikimedia.org/r/310685 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09cf80df0f1421fad13f491a3d87e2f18aea3fdb Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet panel: Add per-prefix config tabs
Andrew Bogott has submitted this change and it was merged. Change subject: Puppet panel: Add per-prefix config tabs .. Puppet panel: Add per-prefix config tabs This is a roughed-in design with a few placeholder tabs. Bug: T91990 Change-Id: If6bde5b11b2a3e10fd0760f4cb3fb87532cbace6 --- A modules/openstack/files/liberty/horizon/puppet_prefix_tab_enable.py A modules/openstack/files/liberty/horizon/puppettab/prefixpanel/__init__.py A modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py A modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py A modules/openstack/files/liberty/horizon/puppettab/prefixpanel/urls.py M modules/openstack/files/liberty/horizon/puppettab/tab.py A modules/openstack/files/liberty/horizon/puppettab/templates/puppet/plus_tab.html A modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html M modules/openstack/manifests/horizon/puppetpanel.pp 9 files changed, 243 insertions(+), 4 deletions(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/openstack/files/liberty/horizon/puppet_prefix_tab_enable.py b/modules/openstack/files/liberty/horizon/puppet_prefix_tab_enable.py new file mode 100644 index 000..4764131 --- /dev/null +++ b/modules/openstack/files/liberty/horizon/puppet_prefix_tab_enable.py @@ -0,0 +1,5 @@ +PANEL = 'prefixpuppetpanel' +PANEL_GROUP = 'puppet' +PANEL_DASHBOARD = 'project' +ADD_PANEL = ('wikimediapuppettab.prefixpanel.prefixpanel.PrefixPuppetPanel') +AUTO_DISCOVER_STATIC_FILES = True diff --git a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/__init__.py b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/__init__.py new file mode 100644 index 000..e69de29 --- /dev/null +++ b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/__init__.py diff --git a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py new file mode 100644 index 000..f4fdc4f --- /dev/null +++ b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py @@ -0,0 +1,50 @@ +# Copyright (c) 2016 Andrew Bogott for Wikimedia Foundation +# All Rights Reserved. +# +#Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +#Unless required by applicable law or agreed to in writing, software +#distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +#WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +#License for the specific language governing permissions and limitations +#under the License. + +import logging + +from django import template +from django.template.loader import render_to_string +from django.utils.translation import ugettext_lazy as _ + +from horizon import tabs + +logging.basicConfig() +LOG = logging.getLogger(__name__) + + +class PlusTab(tabs.Tab): +name = _("+") +slug = "puppetprefixplus" +template_name = "project/puppet/plus_tab.html" +prefix_name = False + +def __init__(self, *args, **kwargs): +if 'tenant_id' in kwargs: +self.tenant_id = kwargs['tenant_id'] +del kwargs['tenant_id'] + +super(PlusTab, self).__init__(*args, **kwargs) + +def render(self): +LOG.warning("rendering, and logging is working") +context = template.RequestContext(self.request) +context['prefix_name'] = self.prefix_name +return render_to_string(self.get_template_name(self.request), +self.data, context_instance=context) + +def post(self, request, *args, **kwargs): +LOG.warning("We've got POST!") +self.prefix_name = request.POST["prefix_name"] diff --git a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py new file mode 100644 index 000..4bb05b4 --- /dev/null +++ b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py @@ -0,0 +1,88 @@ +# Copyright (c) 2016 Andrew Bogott for Wikimedia Foundation +# All Rights Reserved. +# +#Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +#Unless required by applicable law or agreed to in writing, software +#distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +#WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +#License for the specific language governing
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet panel: remove an extra /div
Andrew Bogott has submitted this change and it was merged. Change subject: Puppet panel: remove an extra /div .. Puppet panel: remove an extra /div Change-Id: I3ed6d5014995192e217fadb70de71e108a622575 --- M modules/openstack/files/liberty/horizon/puppettab/templates/puppet/_hiera.html 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/_hiera.html b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/_hiera.html index 46c6915..7a89c64 100644 --- a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/_hiera.html +++ b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/_hiera.html @@ -6,6 +6,5 @@ {{ config.hiera }} {% trans "Edit" %} - -- To view, visit https://gerrit.wikimedia.org/r/310682 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ed6d5014995192e217fadb70de71e108a622575 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew BogottGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceFoundation[master]: TaskApi permissions: Fixed fatal
Pwirth has submitted this change and it was merged. Change subject: TaskApi permissions: Fixed fatal .. TaskApi permissions: Fixed fatal A fatal error occured when a user has no 'read' permission. Change-Id: Ifda3a970f1bd6efe33c8437800088ec2d84f30c3 --- M includes/CoreHooks.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pwirth: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/CoreHooks.php b/includes/CoreHooks.php index 4ededc7..bf0fb30 100755 --- a/includes/CoreHooks.php +++ b/includes/CoreHooks.php @@ -147,7 +147,7 @@ $oRequest = $out->getRequest(); $oUser = $out->getUser(); - if( $oUser->getId() == 0) { + if( $oUser->getId() == 0 || !$oUser->isAllowed( 'read' ) ) { return null; //do nothing for not logged in user, prevent error with read permission for anon } -- To view, visit https://gerrit.wikimedia.org/r/310546 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifda3a970f1bd6efe33c8437800088ec2d84f30c3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Robert VogelGerrit-Reviewer: Dvogel hallowelt Gerrit-Reviewer: Ljonka Gerrit-Reviewer: Mglaser Gerrit-Reviewer: Pwirth Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Make sure tests fail on missing response file
Ejegg has uploaded a new change for review. https://gerrit.wikimedia.org/r/310684 Change subject: Make sure tests fail on missing response file .. Make sure tests fail on missing response file We were relying on something that made PHPUnit fail tests on 'echo' output. Throw an exception instead. Change-Id: I44ff361ae2c4b6012f5cb931fdec39cf5765d0db --- M tests/phpunit/includes/test_gateway/TestingAdyenAdapter.php M tests/phpunit/includes/test_gateway/TestingAstroPayAdapter.php M tests/phpunit/includes/test_gateway/TestingGlobalCollectAdapter.php M tests/phpunit/includes/test_gateway/TestingGlobalCollectOrphanAdapter.php M tests/phpunit/includes/test_gateway/TestingPaypalLegacyAdapter.php 5 files changed, 5 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/84/310684/1 diff --git a/tests/phpunit/includes/test_gateway/TestingAdyenAdapter.php b/tests/phpunit/includes/test_gateway/TestingAdyenAdapter.php index e8daca4..bc79ae7 100644 --- a/tests/phpunit/includes/test_gateway/TestingAdyenAdapter.php +++ b/tests/phpunit/includes/test_gateway/TestingAdyenAdapter.php @@ -48,10 +48,8 @@ //these are all going to be short, so... if ( file_exists( $file_path ) ) { return file_get_contents( $file_path ); - } else { - echo "File $file_path does not exist.\n"; //<-That will deliberately break the test. - return false; } + throw new RuntimeException( "File $file_path does not exist." ); } /** diff --git a/tests/phpunit/includes/test_gateway/TestingAstroPayAdapter.php b/tests/phpunit/includes/test_gateway/TestingAstroPayAdapter.php index 05935e2..fcc224c 100644 --- a/tests/phpunit/includes/test_gateway/TestingAstroPayAdapter.php +++ b/tests/phpunit/includes/test_gateway/TestingAstroPayAdapter.php @@ -55,9 +55,8 @@ //these are all going to be short, so... if ( file_exists( $file_path ) ) { return file_get_contents( $file_path ); - } else { - throw new RuntimeException( "File $file_path does not exist.\n" ); } + throw new RuntimeException( "File $file_path does not exist." ); } /** diff --git a/tests/phpunit/includes/test_gateway/TestingGlobalCollectAdapter.php b/tests/phpunit/includes/test_gateway/TestingGlobalCollectAdapter.php index e940ae9..df9622c 100644 --- a/tests/phpunit/includes/test_gateway/TestingGlobalCollectAdapter.php +++ b/tests/phpunit/includes/test_gateway/TestingGlobalCollectAdapter.php @@ -109,10 +109,8 @@ //these are all going to be short, so... if ( file_exists( $file_path ) ) { return file_get_contents( $file_path ); - } else { - echo "File $file_path does not exist.\n"; //<-That will deliberately break the test. - return false; } + throw new RuntimeException( "File $file_path does not exist." ); } /** diff --git a/tests/phpunit/includes/test_gateway/TestingGlobalCollectOrphanAdapter.php b/tests/phpunit/includes/test_gateway/TestingGlobalCollectOrphanAdapter.php index af19f37..2b155f2 100644 --- a/tests/phpunit/includes/test_gateway/TestingGlobalCollectOrphanAdapter.php +++ b/tests/phpunit/includes/test_gateway/TestingGlobalCollectOrphanAdapter.php @@ -80,10 +80,8 @@ //these are all going to be short, so... if ( file_exists( $file_path ) ) { return file_get_contents( $file_path ); - } else { - echo "File $file_path does not exist.\n"; //<-That will deliberately break the test. - return false; } + throw new RuntimeException( "File $file_path does not exist." ); } /** diff --git a/tests/phpunit/includes/test_gateway/TestingPaypalLegacyAdapter.php b/tests/phpunit/includes/test_gateway/TestingPaypalLegacyAdapter.php index bbb9951..2f654c2 100644 --- a/tests/phpunit/includes/test_gateway/TestingPaypalLegacyAdapter.php +++ b/tests/phpunit/includes/test_gateway/TestingPaypalLegacyAdapter.php @@ -38,10 +38,8 @@ //these are all going to be short, so... if ( file_exists( $file_path ) ) { return file_get_contents( $file_path ); - } else { - echo "File $file_path does not exist.\n"; //<-That will deliberately break the test. - return false; } + throw new RuntimeException( "File $file_path does not exist." ); } /** -- To view, visit https://gerrit.wikimedia.org/r/310684 To
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet panel: Add a missing /div
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/310682 Change subject: Puppet panel: Add a missing /div .. Puppet panel: Add a missing /div Change-Id: I3ed6d5014995192e217fadb70de71e108a622575 --- M modules/openstack/files/liberty/horizon/puppettab/templates/puppet/_hiera.html 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/82/310682/1 diff --git a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/_hiera.html b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/_hiera.html index 46c6915..7a89c64 100644 --- a/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/_hiera.html +++ b/modules/openstack/files/liberty/horizon/puppettab/templates/puppet/_hiera.html @@ -6,6 +6,5 @@ {{ config.hiera }} {% trans "Edit" %} - -- To view, visit https://gerrit.wikimedia.org/r/310682 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ed6d5014995192e217fadb70de71e108a622575 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Puppet panel: Add per-prefix config tabs
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/310683 Change subject: Puppet panel: Add per-prefix config tabs .. Puppet panel: Add per-prefix config tabs This is a roughed-in design with a few placeholder tabs. Bug: T91990 Change-Id: If6bde5b11b2a3e10fd0760f4cb3fb87532cbace6 --- A modules/openstack/files/liberty/horizon/puppet_prefix_tab_enable.py A modules/openstack/files/liberty/horizon/puppettab/prefixpanel/__init__.py A modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py A modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py A modules/openstack/files/liberty/horizon/puppettab/prefixpanel/urls.py M modules/openstack/files/liberty/horizon/puppettab/tab.py A modules/openstack/files/liberty/horizon/puppettab/templates/puppet/plus_tab.html A modules/openstack/files/liberty/horizon/puppettab/templates/puppet/prefix_panel.html M modules/openstack/manifests/horizon/puppetpanel.pp 9 files changed, 244 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/83/310683/1 diff --git a/modules/openstack/files/liberty/horizon/puppet_prefix_tab_enable.py b/modules/openstack/files/liberty/horizon/puppet_prefix_tab_enable.py new file mode 100644 index 000..e90fae1 --- /dev/null +++ b/modules/openstack/files/liberty/horizon/puppet_prefix_tab_enable.py @@ -0,0 +1,6 @@ +PANEL = 'prefixpuppetpanel' +PANEL_GROUP = 'puppet' +PANEL_DASHBOARD = 'project' +ADD_PANEL = ('wikimediapuppettab.prefixpanel.prefixpanel.PrefixPuppetPanel') +AUTO_DISCOVER_STATIC_FILES = True + diff --git a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/__init__.py b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/__init__.py new file mode 100644 index 000..e69de29 --- /dev/null +++ b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/__init__.py diff --git a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py new file mode 100644 index 000..f4fdc4f --- /dev/null +++ b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/plustab.py @@ -0,0 +1,50 @@ +# Copyright (c) 2016 Andrew Bogott for Wikimedia Foundation +# All Rights Reserved. +# +#Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +#Unless required by applicable law or agreed to in writing, software +#distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +#WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +#License for the specific language governing permissions and limitations +#under the License. + +import logging + +from django import template +from django.template.loader import render_to_string +from django.utils.translation import ugettext_lazy as _ + +from horizon import tabs + +logging.basicConfig() +LOG = logging.getLogger(__name__) + + +class PlusTab(tabs.Tab): +name = _("+") +slug = "puppetprefixplus" +template_name = "project/puppet/plus_tab.html" +prefix_name = False + +def __init__(self, *args, **kwargs): +if 'tenant_id' in kwargs: +self.tenant_id = kwargs['tenant_id'] +del kwargs['tenant_id'] + +super(PlusTab, self).__init__(*args, **kwargs) + +def render(self): +LOG.warning("rendering, and logging is working") +context = template.RequestContext(self.request) +context['prefix_name'] = self.prefix_name +return render_to_string(self.get_template_name(self.request), +self.data, context_instance=context) + +def post(self, request, *args, **kwargs): +LOG.warning("We've got POST!") +self.prefix_name = request.POST["prefix_name"] diff --git a/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py new file mode 100644 index 000..4bb05b4 --- /dev/null +++ b/modules/openstack/files/liberty/horizon/puppettab/prefixpanel/prefixpanel.py @@ -0,0 +1,88 @@ +# Copyright (c) 2016 Andrew Bogott for Wikimedia Foundation +# All Rights Reserved. +# +#Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 +# +#Unless required by applicable law or agreed to in writing, software +#distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +#WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +#License