[MediaWiki-commits] [Gerrit] operations/puppet[production]: cache::text: enable nginx-lua-prometheus
Ema has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378671 ) Change subject: cache::text: enable nginx-lua-prometheus .. cache::text: enable nginx-lua-prometheus Expose nginx metrics for prometheus. cp4018 (text ulsfo) has been running with such a config for weeks without issues. Change-Id: I8fe26638c5004efb2d165b7df5e36529c2a80509 --- M manifests/site.pp M modules/role/manifests/cache/text.pp 2 files changed, 2 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/71/378671/1 diff --git a/manifests/site.pp b/manifests/site.pp index 72e06d3..c7662d9 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -295,16 +295,9 @@ role(cache::upload, ipsec) } -node /^cp40(0[89]|1[067])\.ulsfo\.wmnet$/ { +node /^cp40(0[89]|1[0678])\.ulsfo\.wmnet$/ { interface::add_ip6_mapped { 'main': } role(cache::text, ipsec) -} - -# nginx-lua-prometheus testing on a text node -node 'cp4018.ulsfo.wmnet' { -interface::add_ip6_mapped { 'main': } -role(cache::text, ipsec) -class { 'tlsproxy::prometheus': } } node /^cp402[1-6]\.ulsfo\.wmnet$/ { diff --git a/modules/role/manifests/cache/text.pp b/modules/role/manifests/cache/text.pp index dd69ad1..7362cd1 100644 --- a/modules/role/manifests/cache/text.pp +++ b/modules/role/manifests/cache/text.pp @@ -11,6 +11,7 @@ include role::cache::ssl::unified include ::standard +class { 'tlsproxy::prometheus': } class { 'prometheus::node_vhtcpd': } class { 'varnish::htcppurger': -- To view, visit https://gerrit.wikimedia.org/r/378671 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8fe26638c5004efb2d165b7df5e36529c2a80509 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] mediawiki...WikibaseLexeme[master]: Add request object of AddForm API action and created it from...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/377742 ) Change subject: Add request object of AddForm API action and created it from API params .. Add request object of AddForm API action and created it from API params Change-Id: Ic593fcd9922f732036d7c5bdda407aa64928 --- A src/Api/AddFormRequest.php A src/Api/AddFormRequestParser.php A src/Api/AddFormRequestParserResult.php A tests/phpunit/mediawiki/Api/AddFormRequestParserTest.php A tests/phpunit/mediawiki/Api/AddFormRequestTest.php 5 files changed, 493 insertions(+), 0 deletions(-) Approvals: Aleksey Bekh-Ivanov (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/src/Api/AddFormRequest.php b/src/Api/AddFormRequest.php new file mode 100644 index 000..5a04c11 --- /dev/null +++ b/src/Api/AddFormRequest.php @@ -0,0 +1,65 @@ +isEmpty(), '$representations', 'should not be empty' ); + + $this->lexemeId = $lexemeId; + $this->representations = $representations; + $this->grammaticalFeatures = $grammaticalFeatures; + } + + /** +* @return ChangeOpAddForm +*/ + public function getChangeOp() { + return new ChangeOpAddForm( $this->representations, $this->grammaticalFeatures ); + } + + /** +* @return LexemeId +*/ + public function getLexemeId() { + return $this->lexemeId; + } + +} diff --git a/src/Api/AddFormRequestParser.php b/src/Api/AddFormRequestParser.php new file mode 100644 index 000..bb2a7aa --- /dev/null +++ b/src/Api/AddFormRequestParser.php @@ -0,0 +1,168 @@ +entityIdParser = $entityIdParser; + } + + /** +* @param array $params +* @return AddFormRequestParserResult +*/ + public function parse( array $params ) { + $errors = $this->validateRequiredFieldsPresent( $params ); + if ( $errors ) { + return AddFormRequestParserResult::newWithErrors( $errors ); + } + + $data = json_decode( $params['data'], true ); + if ( $data === null ) { + return AddFormRequestParserResult::newWithErrors( [ 'data-invalid-json' ] ); + } + + $errors = $this->validateDataStructure( $data ); + if ( $errors ) { + return AddFormRequestParserResult::newWithErrors( $errors ); + } + + $lexemeId = $this->parseLexemeId( $params['lexemeId'], $errors ); + $representations = $this->parseRepresentations( $data['representations'], $errors ); + $grammaticalFeatures = $this->parseGrammaticalFeatures( $data['grammaticalFeatures'], $errors ); + + if ( $errors ) { + return AddFormRequestParserResult::newWithErrors( $errors ); + } + + return AddFormRequestParserResult::newWithRequest( + new AddFormRequest( $lexemeId, $representations, $grammaticalFeatures ) + ); + } + + private function validateDataStructure( $data ) { + $errors = []; + + if ( !is_array( $data ) ) { + return [ 'data-not-array' ]; + } + + if ( !array_key_exists( 'representations', $data ) ) { + $errors[] = 'data-representations-key-missing'; + } elseif ( !is_array( $data['representations'] ) ) { + $errors[] = 'data-representations-not-array'; + } + + if ( !array_key_exists( 'grammaticalFeatures', $data ) ) { + $errors[] = 'data-grammatical-features-key-missing'; + } elseif ( !is_array( $data['grammaticalFeatures'] ) ) { + $errors[] = 'data-grammatical-features-not-array'; + } + + return $errors; + } + + /** +* @param string $id +* @return LexemeId|null +*/ + private function parseLexemeId( $id, array &$errors ) { + try { + $lexemeId = $this->entityIdParser->parse( $id ); + } catch ( EntityIdParsingException $e ) { + $errors[] = [ 'lexemeid-invalid', $id ]; + return null; + } + + if ( $lexemeId->getEntityType() !== 'lexeme' ) { + $errors[] = [ 'lexemeid-not-lexeme-id', $id ]; + return null; + } + + return $lexemeId; + } + + private function parseRepresentations( array $data, array &$errors ) { + $representations = []; + + foreach ( $data as $index => $representationData ) { + $incomplete = false; + +
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Fix no suggestions error on CX dashboard
Petar.petkovic has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378670 ) Change subject: Fix no suggestions error on CX dashboard .. Fix no suggestions error on CX dashboard - Fix error which is occuring when suggestions are disabled on CX dashboard. - Set 'In progress' as default list in case suggestions are disabled on CX dashboard. Change-Id: I1a2cc0628585492894dc30ec2b28ad754b010ea6 --- M modules/dashboard/ext.cx.dashboard.js 1 file changed, 32 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/70/378670/1 diff --git a/modules/dashboard/ext.cx.dashboard.js b/modules/dashboard/ext.cx.dashboard.js index 06a9c69..a68bd97 100644 --- a/modules/dashboard/ext.cx.dashboard.js +++ b/modules/dashboard/ext.cx.dashboard.js @@ -153,6 +153,7 @@ if ( mw.config.get( 'wgContentTranslationEnableSuggestions' ) ) { this.renderTranslationSuggestions(); } else { + this.setActiveList( 'draft' ); return; } @@ -399,11 +400,7 @@ }; CXDashboard.prototype.listen = function () { - var ulsOptions, - // Here only 'Suggestions' list language filter gets created, translation lists - // ('In progress' and 'Published') create their language filters in fillLanguageFilters method - list = this.lists[ 'suggestions' ], - self = this; + var self = this; this.filter.on( 'select', function ( item ) { self.setActiveList( item.getData() ); @@ -411,23 +408,11 @@ mw.hook( 'mw.cx.translationlist.items.changed' ).add( this.fillLanguageFilters.bind( this ) ); - ulsOptions = { - menuWidth: 'medium', - quickList: function () { - return mw.uls.getFrequentLanguageList(); - }, - compact: true - }; - createUls( - list.languageFilter.$sourceLanguageFilter, - this.setFilter.bind( this, 'sourceLanguage' ), - ulsOptions - ); - createUls( - list.languageFilter.$targetLanguageFilter, - this.setFilter.bind( this, 'targetLanguage' ), - ulsOptions - ); + if ( mw.config.get( 'wgContentTranslationEnableSuggestions' ) ) { + // Here only 'Suggestions' list language filter gets created, translation lists + // ('In progress' and 'Published') create their language filters in fillLanguageFilters method + this.createUlsForSuggestionsList(); + } this.$publishedArticlesButton.on( 'click', function () { self.filter.selectItemByData( 'published' ); @@ -455,6 +440,31 @@ }; /** +* Creates source and target language ULS for suggestions list +*/ + CXDashboard.prototype.createUlsForSuggestionsList = function () { + var list = this.lists[ 'suggestions' ], + ulsOptions = { + menuWidth: 'medium', + quickList: function () { + return mw.uls.getFrequentLanguageList(); + }, + compact: true + }; + + createUls( + list.languageFilter.$sourceLanguageFilter, + this.setFilter.bind( this, 'sourceLanguage' ), + ulsOptions + ); + createUls( + list.languageFilter.$targetLanguageFilter, + this.setFilter.bind( this, 'targetLanguage' ), + ulsOptions + ); + }; + + /** * Fill source and target language filter with respective data fetched from the server */ CXDashboard.prototype.fillLanguageFilters = function () { -- To view, visit https://gerrit.wikimedia.org/r/378670 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a2cc0628585492894dc30ec2b28ad754b010ea6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Petar.petkovic___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Detect query timeouts and throw a specific exception
Mattflaschen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378683 ) Change subject: Detect query timeouts and throw a specific exception .. Detect query timeouts and throw a specific exception Throw DBQueryTimeoutError if a database query error is detected to be a timeout. Only DatabaseMysqlBase has been updated here. This is a subclass of DBQueryError, so existing catch'es will work. Bug: T175775 Change-Id: I4749dc33ad530d9b22504f02106b1ca49e8eb167 --- M autoload.php M includes/libs/rdbms/database/Database.php M includes/libs/rdbms/database/DatabaseMysqlBase.php M includes/libs/rdbms/exception/DBQueryError.php A includes/libs/rdbms/exception/DBQueryTimeoutError.php 5 files changed, 77 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/83/378683/1 diff --git a/autoload.php b/autoload.php index 61fd192..4dd5f12 100644 --- a/autoload.php +++ b/autoload.php @@ -1636,6 +1636,7 @@ 'Wikimedia\\Rdbms\\DBExpectedError' => __DIR__ . '/includes/libs/rdbms/exception/DBExpectedError.php', 'Wikimedia\\Rdbms\\DBMasterPos' => __DIR__ . '/includes/libs/rdbms/database/position/DBMasterPos.php', 'Wikimedia\\Rdbms\\DBQueryError' => __DIR__ . '/includes/libs/rdbms/exception/DBQueryError.php', + 'Wikimedia\\Rdbms\\DBQueryTimeoutError' => __DIR__ . '/includes/libs/rdbms/exception/DBQueryTimeoutError.php', 'Wikimedia\\Rdbms\\DBReadOnlyError' => __DIR__ . '/includes/libs/rdbms/exception/DBReadOnlyError.php', 'Wikimedia\\Rdbms\\DBReplicationWaitError' => __DIR__ . '/includes/libs/rdbms/exception/DBReplicationWaitError.php', 'Wikimedia\\Rdbms\\DBTransactionError' => __DIR__ . '/includes/libs/rdbms/exception/DBTransactionError.php', diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index c904092..acbdf00 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -1130,6 +1130,19 @@ } } + /** +* Checks whether the cause of the error is detected to be a timeout. +* +* It returns false by default, and not all engines support detecting this yet. +* If this returns false, it will be treated as a generic query error. +* +* @param string error Error text +* @param int errno Error number +*/ + protected function wasQueryTimeout( $error, $errno ) { + return false; + } + public function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) { if ( $this->ignoreErrors() || $tempIgnore ) { $this->queryLogger->debug( "SQL ERROR (ignored): $error\n" ); @@ -1146,7 +1159,12 @@ ] ) ); $this->queryLogger->debug( "SQL ERROR: " . $error . "\n" ); - throw new DBQueryError( $this, $error, $errno, $sql, $fname ); + $wasQueryTimeout = $this->wasQueryTimeout( $error, $errno ); + if ( $wasQueryTimeout ) { + throw new DBQueryTimeoutError( $this, $error, $errno, $sql, $fname ); + } else { + throw new DBQueryError( $this, $error, $errno, $sql, $fname ); + } } } diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php b/includes/libs/rdbms/database/DatabaseMysqlBase.php index 3c4cda5..5312a3d 100644 --- a/includes/libs/rdbms/database/DatabaseMysqlBase.php +++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php @@ -486,6 +486,10 @@ */ abstract protected function mysqlError( $conn = null ); + protected function wasQueryTimeout( $error, $errno ) { + return $errno == 2062; + } + /** * @param string $table * @param array $uniqueIndexes diff --git a/includes/libs/rdbms/exception/DBQueryError.php b/includes/libs/rdbms/exception/DBQueryError.php index a8ea3ad..e6870a7 100644 --- a/includes/libs/rdbms/exception/DBQueryError.php +++ b/includes/libs/rdbms/exception/DBQueryError.php @@ -40,19 +40,22 @@ * @param int|string $errno * @param string $sql * @param string $fname +* @param string $message Optional message, intended for subclases (optional) */ - public function __construct( IDatabase $db, $error, $errno, $sql, $fname ) { - if ( $db instanceof Database && $db->wasConnectionError( $errno ) ) { - $message = "A connection error occured. \n" . - "Query: $sql\n" . - "Function: $fname\n" . - "Error: $errno $error\n"; - } else { -
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Allow contint-admins to interact with zuul service
Hashar has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378664 ) Change subject: Allow contint-admins to interact with zuul service .. Allow contint-admins to interact with zuul service We were able to reload/restart the zuul service as the zuul user via the sudo rule: ALL = (zuul) NOPASSWD: ALL Since 4f0df3e8b, zuul is behind systemd which requires root access as I understand it. Bug: T167845 Change-Id: I09579510031d4924e974d09e4e1fc7cfde0e833c --- M modules/admin/data/data.yaml 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/64/378664/1 diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml index f83416a..2f34e16 100644 --- a/modules/admin/data/data.yaml +++ b/modules/admin/data/data.yaml @@ -151,6 +151,11 @@ 'ALL = NOPASSWD: /usr/sbin/service nodepool stop', 'ALL = NOPASSWD: /usr/sbin/service nodepool restart', 'ALL = NOPASSWD: /usr/sbin/service nodepool status', + 'ALL = NOPASSWD: /usr/sbin/service zuul reload', + 'ALL = NOPASSWD: /usr/sbin/service zuul restart', + 'ALL = NOPASSWD: /usr/sbin/service zuul start', + 'ALL = NOPASSWD: /usr/sbin/service zuul stop', + 'ALL = NOPASSWD: /usr/sbin/service zuul status', 'ALL = NOPASSWD: /usr/sbin/service zuul-merger reload', 'ALL = NOPASSWD: /usr/sbin/service zuul-merger restart', 'ALL = NOPASSWD: /usr/sbin/service zuul-merger start', -- To view, visit https://gerrit.wikimedia.org/r/378664 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09579510031d4924e974d09e4e1fc7cfde0e833c Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Hashar___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Save and publish: Avoid references to ApiVisualEditorEdit
Santhosh has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378668 ) Change subject: Save and publish: Avoid references to ApiVisualEditorEdit .. Save and publish: Avoid references to ApiVisualEditorEdit In 21486e0c tryDeflate method from ApiVisualEditorEdit. But CX1 does not declare a depedency to VE extension eventhough the same publish/save code is used by CX2. Referring ApiVisualEditorEdit may cause issues to our test or any other installation without VE extension. I created a copy of tryDeflate method in ApiContentTranslationPublish and used it for save and publish for now. Change-Id: Ie21b8710530b1c71026141aaca76f5086cfc3b67 --- M api/ApiContentTranslationPublish.php M api/ApiContentTranslationSave.php 2 files changed, 21 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/68/378668/1 diff --git a/api/ApiContentTranslationPublish.php b/api/ApiContentTranslationPublish.php index 9c6d0d4..8ff23a3 100644 --- a/api/ApiContentTranslationPublish.php +++ b/api/ApiContentTranslationPublish.php @@ -173,7 +173,7 @@ try { $wikitext = $this->restbaseClient->convertHtmlToWikitext( $targetTitle, - ApiVisualEditorEdit::tryDeflate( $params['html'] ) + self::tryDeflate( $params['html'] ) ); } catch ( MWException $e ) { if ( is_callable( [ $this, 'dieWithError' ] ) ) { @@ -264,6 +264,25 @@ } } + public static function tryDeflate( $content ) { + if ( substr( $content, 0, 11 ) === 'rawdeflate,' ) { + $deflated = base64_decode( substr( $content, 11 ) ); + MediaWiki\suppressWarnings(); + $inflated = gzinflate( $deflated ); + MediaWiki\restoreWarnings(); + if ( $deflated === $inflated || $inflated === false ) { + // Static equivalent of $this->dieWithError + throw ApiUsageException::newWithMessage( + null, + 'apierror-cx-invalidsectioncontent', + 'invalidcontent' + ); + } + return $inflated; + } + return $content; + } + public function getAllowedParams() { return [ 'title' => [ diff --git a/api/ApiContentTranslationSave.php b/api/ApiContentTranslationSave.php index 9924ff2..b02947e 100644 --- a/api/ApiContentTranslationSave.php +++ b/api/ApiContentTranslationSave.php @@ -46,7 +46,7 @@ $translationId = $translation->getTranslationId(); $translationUnits = $this->getTranslationUnits( - ApiVisualEditorEdit::tryDeflate( $params['content'] ), + ApiContentTranslationPublish::tryDeflate( $params['content'] ), $translationId ); $this->saveTranslationUnits( $translationUnits, $translation ); -- To view, visit https://gerrit.wikimedia.org/r/378668 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie21b8710530b1c71026141aaca76f5086cfc3b67 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Santhosh___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/config[master]: fab: reload zuul via systemd
Hashar has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378665 ) Change subject: fab: reload zuul via systemd .. fab: reload zuul via systemd Zuul is now behind systemd, hence it is no more possible to reload it as the zuul user and the init script. Switch to use the user credentials and the service command. The sudo rule is added in puppet via: https://gerrit.wikimedia.org/r/#/c/378664/ Bug: T167845 Change-Id: I09579510031d4924e974d09e4e1fc7cfde0e833c --- M fabfile.py 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/65/378665/1 diff --git a/fabfile.py b/fabfile.py index 7747120..e139787 100644 --- a/fabfile.py +++ b/fabfile.py @@ -23,6 +23,7 @@ env.sudo_user = 'zuul' env.host_string = 'contint1001.wikimedia.org' +do_reload = False with cd('/etc/zuul/wikimedia'): sudo('git remote update') sudo('git --no-pager log -p HEAD..origin/master zuul') @@ -30,7 +31,11 @@ 'Did you log your reload in #wikimedia-releng (e.g. ' + '"!log Reloading Zuul to deploy [hash]")'): sudo('git rebase') -sudo('/etc/init.d/zuul reload') +do_reload = True + +if do_reload: +env.sudo_user = None +sudo('/usr/sbin/service zuul reload', shell=False) @task -- To view, visit https://gerrit.wikimedia.org/r/378665 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09579510031d4924e974d09e4e1fc7cfde0e833c Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Hashar___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Add FormSet shrinking
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378413 ) Change subject: Add FormSet shrinking .. Add FormSet shrinking Change-Id: I4b3500f7587cf68435a758e10cb5ddf4c9163bd2 --- M tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferPatcherTest.php M tests/phpunit/composer/ErisGenerators/FormSetGenerator.php M tests/phpunit/composer/ErisGenerators/LexemeGenerator.php 3 files changed, 68 insertions(+), 2 deletions(-) Approvals: WMDE-leszek: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferPatcherTest.php b/tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferPatcherTest.php index 42572ba..0b7e26e 100644 --- a/tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferPatcherTest.php +++ b/tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferPatcherTest.php @@ -43,6 +43,10 @@ WikibaseLexemeGenerators::lexeme( new LexemeId( 'L1' ) ) ) ->then( function ( Lexeme $lexeme1, Lexeme $lexeme2 ) use ( $differ, $patcher ) { + // Deep cloning is needed because $lexeme1 gets mutated in this test. + // Because of mutation shrinking will work incorrectly + $lexeme1 = unserialize( serialize( $lexeme1 ) ); + $patch = $differ->diffEntities( $lexeme1, $lexeme2 ); $patcher->patchEntity( $lexeme1, $patch ); diff --git a/tests/phpunit/composer/ErisGenerators/FormSetGenerator.php b/tests/phpunit/composer/ErisGenerators/FormSetGenerator.php index ff4fd9e..3be31ba 100644 --- a/tests/phpunit/composer/ErisGenerators/FormSetGenerator.php +++ b/tests/phpunit/composer/ErisGenerators/FormSetGenerator.php @@ -43,7 +43,46 @@ } public function shrink( GeneratedValueSingle $element ) { - return $element; + /** @var FormSet $formSet */ + $formSet = $element->unbox(); + + if ( $formSet->count() === 0 ) { + return $element; + } elseif ( $formSet->count() === 1 ) { + return GeneratedValueSingle::fromValueAndInput( + new FormSet( [] ), + $element, + 'FormSet' + ); + } elseif ( $formSet->count() === 2 ) { + $shrunk1 = new FormSet( [ $formSet->toArray()[0] ] ); + $shrunk2 = new FormSet( [ $formSet->toArray()[1] ] ); + return new GeneratedValueOptions( [ + GeneratedValueSingle::fromValueAndInput( $shrunk1, $element, 'FormSet' ), + GeneratedValueSingle::fromValueAndInput( $shrunk2, $element, 'FormSet' ), + ] ); + } else { + $forms = $formSet->toArray(); + $chunkSize = round( count( $forms ) / 3 ); + + $chunk1 = array_slice( $forms, 0, $chunkSize ); + $chunk2 = array_slice( $forms, $chunkSize, $chunkSize ); + $chunk3 = array_slice( $forms, $chunkSize * 2 ); + + $shrunk1 = new FormSet( array_merge( $chunk1, $chunk2 ) ); + $shrunk2 = new FormSet( array_merge( $chunk1, $chunk3 ) ); + $shrunk3 = new FormSet( array_merge( $chunk2, $chunk3 ) ); + + array_pop( $forms ); + $shrunkOneLess = new FormSet( $forms ); + + return new GeneratedValueOptions( [ +GeneratedValueSingle::fromValueAndInput( $shrunk1, $element, 'FormSet' ), +GeneratedValueSingle::fromValueAndInput( $shrunk2, $element, 'FormSet' ), +GeneratedValueSingle::fromValueAndInput( $shrunk3, $element, 'FormSet' ), +GeneratedValueSingle::fromValueAndInput( $shrunkOneLess, $element, 'FormSet' ), + ] ); + } } } diff --git a/tests/phpunit/composer/ErisGenerators/LexemeGenerator.php b/tests/phpunit/composer/ErisGenerators/LexemeGenerator.php index bc20f2e..b58b2fa 100644 --- a/tests/phpunit/composer/ErisGenerators/LexemeGenerator.php +++ b/tests/phpunit/composer/ErisGenerators/LexemeGenerator.php @@ -95,7 +95,30 @@ * @return GeneratedValueSingle|GeneratedValueOptions */ public function shrink( GeneratedValueSingle $element ) { - return $element; + /** @var Lexeme $lexeme */ + $lexeme = $element->unbox(); + + $shrunkFormSet =
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Use the title description and image in CX link inspector
Santhosh has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378666 ) Change subject: Use the title description and image in CX link inspector .. Use the title description and image in CX link inspector Show the title image and desciption in the custom CX Link inspector. No attention to styling is given for now. Change-Id: I0e95ee2e36e053cd5295329421113670d09d0d80 --- M modules/ve-cx/ui/ve.ui.CXLinkContextItem.js M modules/ve-cx/ui/ve.ui.CXTranslationUnitContextItem.js 2 files changed, 57 insertions(+), 30 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/66/378666/1 diff --git a/modules/ve-cx/ui/ve.ui.CXLinkContextItem.js b/modules/ve-cx/ui/ve.ui.CXLinkContextItem.js index d88152f..6e23ce3 100644 --- a/modules/ve-cx/ui/ve.ui.CXLinkContextItem.js +++ b/modules/ve-cx/ui/ve.ui.CXLinkContextItem.js @@ -9,12 +9,14 @@ // Parent constructor ve.ui.CXLinkContextItem.super.apply( this, arguments ); // Mixin constructor - ve.ui.CXTranslationUnitContextItem.apply( this ); + ve.ui.CXTranslationUnitContextItem.apply( this, arguments ); + this.$sourceBody = $( '' ) .addClass( 've-ui-linearContextItem-body' ) .addClass( 've-ui-cxLinkContextItem-sourceBody' ) .insertBefore( this.$body ); this.$element.addClass( 've-ui-cxLinkContextItem' ); + }; /* Inheritance */ @@ -37,38 +39,60 @@ */ ve.ui.CXLinkContextItem.prototype.renderBody = function () { var $sourceLink, $targetLink, - targetSurface = this.context.getSurface(), - translation = ve.init.target.getTranslation(), - unit = translation.getTranslationUnit( this.model.getTranslationUnitId() ), - sourceModel = unit.sourceModel; + adaptationInfo = this.model.element.attributes.cx; // Source link - $sourceLink = this.constructor.static.generateBody( - // TODO: this ought to be a linkCache pointing at the source wiki - ve.init.platform.linkCache, - sourceModel, - translation.sourceDoc.getHtmlDocument() - ); - // Target link - $targetLink = this.constructor.static.generateBody( - ve.init.platform.linkCache, - this.model, - targetSurface.getModel().getDocument().getHtmlDocument() - ); + $sourceLink = this.generateBody( adaptationInfo.sourceTitle ); + this.$sourceBody.empty().append( $sourceLink ); - function addLanguageDescription( $link, lang ) { - $link.find( '.ve-ui-mwInternalLinkContextItem-link' ).after( - $( '' ) - .addClass( 've-ui-mwInternalLinkContextItem-description' ) - .text( ve.init.platform.getLanguageAutonym( lang ) ) - ); + // Target link + if ( adaptationInfo.adapted ) { + $targetLink = this.generateBody( adaptationInfo.targetTitle ); + this.$body.empty().append( $targetLink ); + } +}; + +/** + * Generate the body of the link context item + * + * @param {Object} linkInfo The object with title meta data + * @return {jQuery} The jQuery object of the link context item + */ +ve.ui.CXLinkContextItem.prototype.generateBody = function ( linkInfo ) { + var panel, $linkTitle, $linkDesc, linkInfoPanel, + icon; + + $linkTitle = $( '' ) + .addClass( 'cx-tools-link-text' ) + .text( linkInfo.title ) + .prop( { + target: '_blank', + title: linkInfo.title, + href: this.translation.config.siteMapper.getPageUrl( linkInfo.pagelanguage, linkInfo.title ) + } ); + $linkDesc = $( '' ) + .addClass( 'cx-tools-link-desc' ) + .text( linkInfo.terms && linkInfo.terms.description || '' ); + linkInfoPanel = new OO.ui.PanelLayout( { + expanded: false, + framed: false, + padded: false, + classes: [ 'cx-tools-link-info' ], + content: [ $linkTitle, $linkDesc ] + } ); + icon = new OO.ui.IconWidget( { icon: 'page-existing' } ); + if ( linkInfo.thumbnail && linkInfo.thumbnail.source ) { + icon.$element.css( 'background-image', 'url(' + linkInfo.thumbnail.source + ')' ); } - addLanguageDescription( $sourceLink, translation.sourceDoc.getLang() ); - addLanguageDescription( $targetLink, translation.targetDoc.getLang() ); + panel = new OO.ui.HorizontalLayout( { + expanded: false, + framed: false, + padded: false, + items: [ icon, linkInfoPanel ] + } ); -
[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[master]: [WIP] Ruby to Node conversion of integration tests.
Jdrewniak has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378688 ) Change subject: [WIP] Ruby to Node conversion of integration tests. .. [WIP] Ruby to Node conversion of integration tests. Begininng the conversion of integration tests from Ruby to Node. Maintaining Cucumber (here Cucumber.js) as the testing framework. https://github.com/cucumber/cucumber-js Using MWBot as the API helper https://github.com/Fannon/mwbot Requires chromedriver to be installed: https://sites.google.com/a/chromium.org/chromedriver/ Currently set to run in Chrome (not yet headless). Change-Id: I873f1deed555e78cab20201c938ca0a353ef0576 --- M Gruntfile.js M package.json A tests/browser/features/node_example.feature A tests/integration/config/wdio.conf.jenkins.js A tests/integration/config/wdio.conf.js A tests/integration/features/elasticsearch_on_special_version.feature A tests/integration/features/step_definitions/page_step_helpers.js A tests/integration/features/step_definitions/page_steps.js A tests/integration/features/suggest_api.feature A tests/integration/features/support/hooks.js A tests/integration/features/support/pages/article_page.js A tests/integration/features/support/pages/page.js A tests/integration/features/support/pages/special_version.js A tests/integration/features/support/world.js 14 files changed, 811 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch refs/changes/88/378688/1 diff --git a/Gruntfile.js b/Gruntfile.js index 024f234..b3f7d8f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -10,6 +10,15 @@ grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.loadNpmTasks( 'grunt-banana-checker' ); grunt.loadNpmTasks( 'grunt-stylelint' ); + grunt.loadNpmTasks( 'grunt-webdriver' ); + + var WebdriverIOconfigFile; + + if ( process.env.JENKINS_HOME ) { + WebdriverIOconfigFile = './tests/integration/config/wdio.conf.jenkins.js'; + } else { + WebdriverIOconfigFile = './tests/integration/config/wdio.conf.js'; + } grunt.initConfig( { jshint: { @@ -42,6 +51,12 @@ '!tests/browser/articles/**', '!vendor/**' ] + }, + // Configure WebdriverIO Node task + webdriver: { + test: { + configFile: WebdriverIOconfigFile + } } } ); diff --git a/package.json b/package.json index 2c7a0e1..e7f2409 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,21 @@ "private": true, "description": "Build tools for the CirrusSearch extension.", "scripts": { -"test": "grunt test" +"test": "grunt test", +"selenium": "killall -0 chromedriver 2>/dev/null || chromedriver --url-base=/wd/hub --port= & grunt webdriver:test; killall chromedriver" }, "devDependencies": { +"cucumber": "^3.0.1", "grunt": "1.0.1", "grunt-banana-checker": "0.5.0", "grunt-contrib-jshint": "1.0.0", "grunt-jsonlint": "1.0.7", "grunt-stylelint": "0.6.0", +"grunt-webdriver": "^2.0.3", +"mwbot": "^1.0.9", "stylelint": "7.8.0", -"stylelint-config-wikimedia": "0.4.1" +"stylelint-config-wikimedia": "0.4.1", +"wdio-cucumber-framework": "^1.0.1", +"webdriverio": "^4.8.0" } } diff --git a/tests/browser/features/node_example.feature b/tests/browser/features/node_example.feature new file mode 100644 index 000..4120478 --- /dev/null +++ b/tests/browser/features/node_example.feature @@ -0,0 +1,10 @@ +Feature: Example feature + Scenario: 1 + 0 + Given I start with 1 + When I add 0 + Then I end up with 1 + + Scenario: 1 + 1 + Given I start with 1 + When I add 1 + Then I end up with 2 \ No newline at end of file diff --git a/tests/integration/config/wdio.conf.jenkins.js b/tests/integration/config/wdio.conf.jenkins.js new file mode 100644 index 000..451b1c0 --- /dev/null +++ b/tests/integration/config/wdio.conf.jenkins.js @@ -0,0 +1,22 @@ +/*jshint esversion: 6, node:true */ + +/* eslint no-undef: "error" */ +/* eslint-env node */ +'use strict'; +var merge = require( 'deepmerge' ), + wdioConf = require( './wdio.conf.js' ); + +// Overwrite default settings +exports.config = merge( wdioConf.config, { + username: 'WikiAdmin', + password: 'testpass', + screenshotPath: '../log/', + baseUrl: process.env.MW_SERVER + process.env.MW_SCRIPT_PATH, + + reporters: [ 'spec', 'junit' ], + reporterOptions: { + junit: { + outputDir: '../log/' + } + } +} ); diff --git a/tests/integration/config/wdio.conf.js b/tests/integration/config/wdio.conf.js new file mode 100644 index 000..890a026 --- /dev/null +++
[MediaWiki-commits] [Gerrit] mediawiki/core[REL1_29]: Avoid scoped lock errors in Category::refreshCounts() due to...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/376745 ) Change subject: Avoid scoped lock errors in Category::refreshCounts() due to nesting .. Avoid scoped lock errors in Category::refreshCounts() due to nesting Bug: T166757 Change-Id: Ie59523a8b3315f063c914cd25d7b53c11e03fbcd (cherry picked from commit dbaec78dbba7de0cf063d01fcb4bcb53ba1e4e4e) --- M includes/deferred/LinksDeletionUpdate.php M includes/page/WikiPage.php 2 files changed, 9 insertions(+), 2 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/deferred/LinksDeletionUpdate.php b/includes/deferred/LinksDeletionUpdate.php index ca29078..3dd9de6 100644 --- a/includes/deferred/LinksDeletionUpdate.php +++ b/includes/deferred/LinksDeletionUpdate.php @@ -106,7 +106,11 @@ __METHOD__ ); if ( $row ) { - Category::newFromRow( $row, $title )->refreshCounts(); + $cat = Category::newFromRow( $row, $title ); + // T166757: do the update after the main job DB commit + DeferredUpdates::addCallableUpdate( function () use ( $cat ) { + $cat->refreshCounts(); + } ); } } diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index a687900..da9b93d 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -3496,7 +3496,10 @@ ); foreach ( $rows as $row ) { $cat = Category::newFromRow( $row ); - $cat->refreshCounts(); + // T166757: do the update after this DB commit + DeferredUpdates::addCallableUpdate( function () use ( $cat ) { + $cat->refreshCounts(); + } ); } } } -- To view, visit https://gerrit.wikimedia.org/r/376745 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie59523a8b3315f063c914cd25d7b53c11e03fbcd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: REL1_29 Gerrit-Owner: MartineznovoGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Martineznovo Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/config[master]: Add missing unit test, npm jobs and make tests voting
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/376761 ) Change subject: Add missing unit test, npm jobs and make tests voting .. Add missing unit test, npm jobs and make tests voting ArticleCreationWorkflow: npm already exists EditcountAdditions: I067a94504bf61a5f337c5e8c8cb71d221ddbdee5 MultiLanguageManager: Id53ee46bd864f435c6cea0e3dec08ed08c7cf889 BrickipediaExtra: Ib59a3c5c5619a1748268de667d6af1eff14b1093 ArticleToCategory2: New extension, unit test only ExtJSBase: New extension Wikisource: New extension, empty Lingo: Passed Ie09783c2ee7d8f23a82f19f2dd32dfc268fbe8f2 BlueSpiceMultiUpload: Passed I3ad1aa5c5cac99d9d23f15a544abd4347d6c9303 BlueSpiceSubPageTree: Passed I3ad1aa5c5cac99d9d23f15a544abd4347d6c9303 CloseWikis: Passed I3c0806be5480b10008f139734c10e724ba9c1b9d ImageRating: Passed Ib56dfc90434dd0e1761cda67364b2ccfb4c84af2 ListSignup: Passed I53dde21424bb0ce35b0ca7b7508a62cfbc72910e MultiUpload: Id6bef2818fc12a153cd2dd42a0ae83f9e5bc5077 Sarcasm: Passed Ia9622af63602d2e011e6facde12771a35f33995d SphinxSearch: Passed Id3a8234e41c39b7ab6309b2102277e92f00195d8 SSLClientAuthentication: Passed I72696529ac9ed8e12b4169962f3c2317d4b4bda7 UpdateMediaWiki: Passed I3029a275085d1ec0dc6807011ec6efc3b67510ad VisualChat: Passed Id8cfd9b8c53b4233d2d01e09af9e5074caf6e7cb Link_Attributes: Passed Iad0e6942d167ddf53d3d7df0133d96cfe114967b ParserFun: Passed Id9c6418c0bff7c593cb679b956aeb6971da72ce7 VIKI, VikiSemanticTitle, VikiTitleIcon: Failing SMW unit tests Change-Id: Ia3bd4f511feee3d49d822239ab0d1c64247c9c0f --- M zuul/layout.yaml 1 file changed, 46 insertions(+), 23 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/zuul/layout.yaml b/zuul/layout.yaml index b612876..5a204c3 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -3113,6 +3113,11 @@ - name: extension-unittests-generic - name: mwgate-npm + - name: mediawiki/extensions/EditcountAdditions +template: + - name: extension-unittests-non-voting + - name: mwgate-npm + - name: mediawiki/extensions/EditNotify template: - name: extension-unittests-generic @@ -3189,6 +3194,11 @@ - name: tox-jessie - name: mediawiki/extensions/EventBus +template: + - name: extension-unittests-generic + - name: mwgate-npm + + - name: mediawiki/extensions/ExtJSBase template: - name: extension-unittests-generic - name: mwgate-npm @@ -3524,8 +3534,7 @@ - name: mediawiki/extensions/Lingo template: - - name: mwgate-composer - - name: extension-unittests-non-voting + - name: extension-unittests-generic - name: mwgate-npm - name: mediawiki/extensions/LinkedWiki @@ -3677,6 +3686,11 @@ - name: mediawiki/extensions/MessageCommons template: - name: extension-unittests-generic + - name: mwgate-npm + + - name: mediawiki/extensions/MultiLanguageManager +template: + - name: extension-unittests-non-voting - name: mwgate-npm - name: mediawiki/extensions/MultiMaps @@ -3982,11 +3996,16 @@ template: - name: extension-unittests-generic - name: extension-phan-generic + - name: mwgate-npm - name: mediawiki/extensions/ArticleIndex template: - name: extension-unittests-generic - name: mwgate-npm + + - name: mediawiki/extensions/ArticleToCategory2 +template: + - name: extension-unittests-non-voting - name: mediawiki/extensions/AssertEdit template: @@ -4100,7 +4119,7 @@ - name: mediawiki/extensions/BlueSpiceMultiUpload template: - - name: extension-unittests-composer-non-voting + - name: extension-unittests-composer - name: mwgate-npm - name: mediawiki/extensions/BlueSpicePageAssignments @@ -4129,7 +4148,7 @@ - name: mediawiki/extensions/BlueSpiceSubPageTree template: - - name: extension-unittests-composer-non-voting + - name: extension-unittests-composer - name: mediawiki/extensions/Bootstrap template: @@ -4143,6 +4162,11 @@ - name: mediawiki/extensions/BreadCrumbs2 template: - name: extension-unittests-generic + - name: mwgate-npm + + - name: mediawiki/extensions/BrickipediaExtra +template: + - name: extension-unittests-non-voting - name: mwgate-npm - name: mediawiki/extensions/Carp @@ -4185,10 +4209,9 @@ - name: extension-unittests-generic - name: mwgate-npm - # Non-voting due to T157815 - name: mediawiki/extensions/CloseWikis template: - - name: extension-unittests-non-voting + - name: extension-unittests-generic - name: mwgate-npm - name: mediawiki/extensions/Commentbox @@ -4311,7 +4334,7 @@ - name: mediawiki/extensions/DjangoAnalytics template: - - name: extension-unittests-non-voting + - name: extension-unittests-generic - name:
[MediaWiki-commits] [Gerrit] operations/puppet[production]: restructure dumps webserver, zim manifests to module/role/pr...
ArielGlenn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/376750 ) Change subject: restructure dumps webserver, zim manifests to module/role/profile .. restructure dumps webserver, zim manifests to module/role/profile We don't serve zim dumps via a special setup any more, so rename that stuff to reflect what it does, i.e. serve html dumps. Other dumps-related manifests will get moved into the dumps module and profile directories later. Bug: T175592 Change-Id: I87da750a869061774156bde2997fce0f1908baf6 --- D hieradata/role/common/dumps/server.yaml R hieradata/role/common/dumps/web/htmldumps.yaml A hieradata/role/common/dumps/web/xmldumps.yaml M manifests/site.pp A modules/dumps/files/web/htmldumps/logrotate.conf R modules/dumps/files/web/htmldumps/nginx.conf R modules/dumps/files/web/xmldumps/favicon.ico R modules/dumps/files/web/xmldumps/logrotate.conf D modules/dumps/manifests/init.pp A modules/dumps/manifests/web/htmldumps.pp A modules/dumps/manifests/web/xmldumps.pp D modules/dumps/manifests/zim.pp R modules/dumps/templates/web/xmldumps/nginx.conf.erb A modules/profile/manifests/dumps/nfs_server.pp A modules/profile/manifests/dumps/web/htmldumps.pp A modules/profile/manifests/dumps/web/rsync_server.pp A modules/profile/manifests/dumps/web/xmldumps.pp D modules/role/manifests/dumps/server.pp A modules/role/manifests/dumps/web/htmldumps.pp A modules/role/manifests/dumps/web/xmldumps.pp D modules/role/manifests/dumps/zim.pp 21 files changed, 217 insertions(+), 190 deletions(-) Approvals: ArielGlenn: Looks good to me, approved jenkins-bot: Verified diff --git a/hieradata/role/common/dumps/server.yaml b/hieradata/role/common/dumps/server.yaml deleted file mode 100644 index 1dfaa66..000 --- a/hieradata/role/common/dumps/server.yaml +++ /dev/null @@ -1,25 +0,0 @@ -dumps::rsync_clients: - - dataset1001.wikimedia.org - - mwlog1001.eqiad.wmnet - - mwlog2001.codfw.wmnet - - phab1001.eqiad.wmnet - - ms1001.wikimedia.org - - stat1005.eqiad.wmnet - - stat1006.eqiad.wmnet - - sagres.c3sl.ufpr.br - - odysseus.fi.muni.cz - - odysseus.linux.cz - - mirror.fr.wickedway.nl -# disable Feb 10 2017, looking into dns issues -# - wikimedia.wansec.com - - ftpmirror.your.org - - ec2-174-129-186-231.compute-1.amazonaws.com - - ftpmirror-ae0-4.us.your.org - - crcdtn01.crc.nd.edu - - wmrsync.crc.nd.edu - - wikimedia.iconic.vi - - poincare.acc.umu.se - - wikimedia.bytemark.co.uk -dumps::rsync_clients_ipv6: - - odysseus.ip6.fi.muni.cz - - poincare.acc.umu.se diff --git a/hieradata/role/common/dumps/zim.yaml b/hieradata/role/common/dumps/web/htmldumps.yaml similarity index 100% rename from hieradata/role/common/dumps/zim.yaml rename to hieradata/role/common/dumps/web/htmldumps.yaml diff --git a/hieradata/role/common/dumps/web/xmldumps.yaml b/hieradata/role/common/dumps/web/xmldumps.yaml new file mode 100644 index 000..80cdcb5 --- /dev/null +++ b/hieradata/role/common/dumps/web/xmldumps.yaml @@ -0,0 +1,26 @@ +profile::dumps::web::rsync_server::clients: + ipv4: +- dataset1001.wikimedia.org +- mwlog1001.eqiad.wmnet +- mwlog2001.codfw.wmnet +- phab1001.eqiad.wmnet +- ms1001.wikimedia.org +- stat1005.eqiad.wmnet +- stat1006.eqiad.wmnet +- sagres.c3sl.ufpr.br +- odysseus.fi.muni.cz +- odysseus.linux.cz +- mirror.fr.wickedway.nl +# disable Feb 10 2017, looking into dns issues +# - wikimedia.wansec.com +- ftpmirror.your.org +- ec2-174-129-186-231.compute-1.amazonaws.com +- ftpmirror-ae0-4.us.your.org +- crcdtn01.crc.nd.edu +- wmrsync.crc.nd.edu +- wikimedia.iconic.vi +- poincare.acc.umu.se +- wikimedia.bytemark.co.uk + ipv6: +- odysseus.ip6.fi.muni.cz +- poincare.acc.umu.se diff --git a/manifests/site.pp b/manifests/site.pp index 7b0d4c1..72e06d3 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -328,7 +328,7 @@ node 'dataset1001.wikimedia.org' { -role(dataset::primary, dumps::server) +role(dataset::primary, dumps::web::xmldumps) interface::add_ip6_mapped { 'main': } } @@ -948,9 +948,9 @@ interface::add_ip6_mapped { 'main': } } -# ZIM dumps (https://en.wikipedia.org/wiki/ZIM_%28file_format%29) +# HTML dumps from Restbase node 'francium.eqiad.wmnet' { -role(dumps::zim) +role(dumps::web::htmldumps) } # Virtualization hosts @@ -1544,7 +1544,7 @@ # also see dataset1001 node 'ms1001.wikimedia.org' { -role(dataset::secondary, dumps::server) +role(dataset::secondary, dumps::web::xmldumps) interface::add_ip6_mapped { 'main': } } diff --git a/modules/dumps/files/web/htmldumps/logrotate.conf b/modules/dumps/files/web/htmldumps/logrotate.conf new file mode 100644 index 000..1404bd5 --- /dev/null +++ b/modules/dumps/files/web/htmldumps/logrotate.conf @@ -0,0 +1,18 @@ +# logrotate config for web logs for html dumps server +# This file is managed by
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: WIP: RCFilters: Display specific error if query times out.
Mattflaschen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378687 ) Change subject: WIP: RCFilters: Display specific error if query times out. .. WIP: RCFilters: Display specific error if query times out. The backend works but the frontend needs to be updated. Bug: T175776 Change-Id: If4d880e9e6a56989895956798fc6918a43841065 --- M includes/specialpage/ChangesListSpecialPage.php M languages/i18n/en.json M languages/i18n/qqq.json M resources/src/mediawiki.rcfilters/mw.rcfilters.init.js 4 files changed, 75 insertions(+), 38 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/87/378687/1 diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index 0762bf7..587d356 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -21,6 +21,7 @@ * @ingroup SpecialPage */ use MediaWiki\Logger\LoggerFactory; +use Wikimedia\Rdbms\DBQueryTimeoutError; use Wikimedia\Rdbms\ResultWrapper; use Wikimedia\Rdbms\FakeResultWrapper; use Wikimedia\Rdbms\IDatabase; @@ -519,45 +520,56 @@ public function execute( $subpage ) { $this->rcSubpage = $subpage; - $rows = $this->getRows(); $opts = $this->getOptions(); - if ( $rows === false ) { - $rows = new FakeResultWrapper( [] ); - } + try { + $rows = $this->getRows(); + if ( $rows === false ) { + $rows = new FakeResultWrapper( [] ); + } - // Used by Structured UI app to get results without MW chrome - if ( $this->getRequest()->getVal( 'action' ) === 'render' ) { - $this->getOutput()->setArticleBodyOnly( true ); - } + // Used by Structured UI app to get results without MW chrome + if ( $this->getRequest()->getVal( 'action' ) === 'render' ) { + $this->getOutput()->setArticleBodyOnly( true ); + } - // Used by "live update" and "view newest" to check - // if there's new changes with minimal data transfer - if ( $this->getRequest()->getBool( 'peek' ) ) { - $code = $rows->numRows() > 0 ? 200 : 304; - $this->getOutput()->setStatusCode( $code ); - return; - } + // Used by "live update" and "view newest" to check + // if there's new changes with minimal data transfer + if ( $this->getRequest()->getBool( 'peek' ) ) { + $code = $rows->numRows() > 0 ? 200 : 304; + $this->getOutput()->setStatusCode( $code ); + return; + } - $batch = new LinkBatch; - foreach ( $rows as $row ) { - $batch->add( NS_USER, $row->rc_user_text ); - $batch->add( NS_USER_TALK, $row->rc_user_text ); - $batch->add( $row->rc_namespace, $row->rc_title ); - if ( $row->rc_source === RecentChange::SRC_LOG ) { - $formatter = LogFormatter::newFromRow( $row ); - foreach ( $formatter->getPreloadTitles() as $title ) { - $batch->addObj( $title ); + $batch = new LinkBatch; + foreach ( $rows as $row ) { + $batch->add( NS_USER, $row->rc_user_text ); + $batch->add( NS_USER_TALK, $row->rc_user_text ); + $batch->add( $row->rc_namespace, $row->rc_title ); + if ( $row->rc_source === RecentChange::SRC_LOG ) { + $formatter = LogFormatter::newFromRow( $row ); + foreach ( $formatter->getPreloadTitles() as $title ) { + $batch->addObj( $title ); + } } } + $batch->execute(); + + $this->setHeaders(); + $this->outputHeader(); + $this->addModules(); + $this->webOutput( $rows, $opts ); + + $rows->free(); + } catch ( DBQueryTimeoutError $timeoutException ) { + MWExceptionHandler::logException( $timeoutException ); + + $this->setHeaders(); +
[MediaWiki-commits] [Gerrit] mediawiki...Cite[master]: Debounce reference list updates
Esanders has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378690 ) Change subject: Debounce reference list updates .. Debounce reference list updates Ideally update wouldn't be called multiple times for simple transactions, but this should prevent unneccesary updates if that does happen. Bug: T176066 Change-Id: I1e7a21c19cee7d50ca160749f243c57f2fb08bab --- M modules/ve-cite/ve.ce.MWReferencesListNode.js 1 file changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite refs/changes/90/378690/1 diff --git a/modules/ve-cite/ve.ce.MWReferencesListNode.js b/modules/ve-cite/ve.ce.MWReferencesListNode.js index f19e6e4..5aadfb8 100644 --- a/modules/ve-cite/ve.ce.MWReferencesListNode.js +++ b/modules/ve-cite/ve.ce.MWReferencesListNode.js @@ -36,8 +36,10 @@ // Events this.model.connect( this, { attributeChange: 'onAttributeChange' } ); + this.updateDebounced = ve.debounce( this.update.bind( this ) ); + // Initialization - this.update(); + this.updateDebounced(); }; /* Inheritance */ @@ -108,7 +110,7 @@ ve.ce.MWReferencesListNode.prototype.onInternalListUpdate = function ( groupsChanged ) { // Only update if this group has been changed if ( groupsChanged.indexOf( this.model.getAttribute( 'listGroup' ) ) !== -1 ) { - this.update(); + this.updateDebounced(); } }; @@ -121,7 +123,7 @@ */ ve.ce.MWReferencesListNode.prototype.onAttributeChange = function ( key ) { if ( key === 'listGroup' ) { - this.update(); + this.updateDebounced(); } }; @@ -136,7 +138,7 @@ // When the list node updates we're not sure which list group the item // belonged to so we always update // TODO: Only re-render the reference which has been edited - this.update(); + this.updateDebounced(); }; /** -- To view, visit https://gerrit.wikimedia.org/r/378690 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e7a21c19cee7d50ca160749f243c57f2fb08bab Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Cite Gerrit-Branch: master Gerrit-Owner: Esanders___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix findHooks.php
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378491 ) Change subject: Fix findHooks.php .. Fix findHooks.php Add the test entry point, because it contains documented hooks. Filter out empty args, coming from trailing commas Removed empty lines from hooks.txt, because a hook must be one block without newlines between. Change-Id: I71e0625da96cad03f5e38a000fa61d1d2bdac8ef --- M docs/hooks.txt M maintenance/findHooks.php 2 files changed, 9 insertions(+), 7 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/docs/hooks.txt b/docs/hooks.txt index b7fe8c1..a19e9fc 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -996,13 +996,10 @@ 'ChangesListSpecialPageQuery': Called when building SQL query on pages inheriting from ChangesListSpecialPage (in core: RecentChanges, RecentChangesLinked and Watchlist). - Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure. - Instead, use sub-classes of those classes, in conjunction with the ChangesListSpecialPageStructuredFilters hook. - This hook can be used to implement filters that do not implement that structure, or custom behavior that is not an individual filter. $name: name of the special page, e.g. 'Watchlist' @@ -1017,20 +1014,16 @@ filters for pages inheriting from ChangesListSpecialPage (in core: RecentChanges, RecentChangesLinked, and Watchlist). Generally, you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects. - When constructing them, you specify which group they belong to. You can reuse existing groups (accessed through $special->getFilterGroup), or create your own (ChangesListBooleanFilterGroup or ChangesListStringOptionsFilterGroup). If you create new groups, you must register them with $special->registerFilterGroup. - Note that this is called regardless of whether the user is currently using the new (structured) or old (unstructured) filter UI. If you want your boolean filter to show on both the new and old UI, specify all the supported fields. These include showHide, label, and description. - See the constructor of each ChangesList* class for documentation of supported fields. - $special: ChangesListSpecialPage instance 'ChangeTagAfterDelete': Called after a change tag has been deleted (that is, diff --git a/maintenance/findHooks.php b/maintenance/findHooks.php index 81e18c9..fd36db1 100644 --- a/maintenance/findHooks.php +++ b/maintenance/findHooks.php @@ -79,6 +79,9 @@ $nonRecurseDirs = [ "$IP/", ]; + $extraFiles = [ + "$IP/tests/phpunit/MediaWikiTestCase.php", + ]; foreach ( $recurseDirs as $dir ) { $ret = $this->getHooksFromDir( $dir, self::FIND_RECURSIVE ); @@ -89,6 +92,10 @@ $ret = $this->getHooksFromDir( $dir ); $potentialHooks = array_merge( $potentialHooks, $ret['good'] ); $badHooks = array_merge( $badHooks, $ret['bad'] ); + } + foreach ( $extraFiles as $file ) { + $potentialHooks = array_merge( $potentialHooks, $this->getHooksFromFile( $file ) ); + $badHooks = array_merge( $badHooks, $this->getBadHooksFromFile( $file ) ); } $documented = array_keys( $documentedHooks ); @@ -262,6 +269,8 @@ $n = []; if ( preg_match_all( '/((?:[^,\(\)]|\([^\(\)]*\))+)/', $match[4], $n ) ) { $args = array_map( 'trim', $n[1] ); + // remove empty entries from trailing spaces + $args = array_filter( $args ); } } elseif ( isset( $match[3] ) ) { // Found a parameter for Hooks::run, -- To view, visit https://gerrit.wikimedia.org/r/378491 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I71e0625da96cad03f5e38a000fa61d1d2bdac8ef Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Hashar 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]: Remove Puppet code which is obsolete with Salt grain removal
Ema has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/377292 ) Change subject: Remove Puppet code which is obsolete with Salt grain removal .. Remove Puppet code which is obsolete with Salt grain removal Salt is being removed from our infrastructure and replaced by Cumin. Change-Id: I8bcfec2b499b0f1597f71f215bf6e20db98e1250 --- M modules/lvs/manifests/configuration.pp M modules/profile/templates/lvs/service_ips.erb 2 files changed, 2 insertions(+), 11 deletions(-) Approvals: Ema: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/lvs/manifests/configuration.pp b/modules/lvs/manifests/configuration.pp index 38450f9..418235e 100644 --- a/modules/lvs/manifests/configuration.pp +++ b/modules/lvs/manifests/configuration.pp @@ -44,18 +44,9 @@ }, } -# NOTE: This is for informational purposes only. The actual configuration -# that decides primary/secondary is done at the BGP level on the routers. -$lvs_grain = $::hostname ? { -/^lvs100[123789]$/ => 'primary', -/^lvs200[123]$/ => 'primary', -/^lvs[34]00[1256]$/ => 'primary', -default => 'secondary' -} - # This is technically redundant information from $lvs_class_hosts, but # transforming one into the other in puppet is a huge PITA. -$lvs_grain_class = $::hostname ? { +$lvs_class = $::hostname ? { 'lvs1007' => 'high-traffic1', 'lvs1008' => 'high-traffic2', 'lvs1009' => 'low-traffic', diff --git a/modules/profile/templates/lvs/service_ips.erb b/modules/profile/templates/lvs/service_ips.erb index ed8b2d2..41f4e88 100644 --- a/modules/profile/templates/lvs/service_ips.erb +++ b/modules/profile/templates/lvs/service_ips.erb @@ -19,7 +19,7 @@ end # TODO: maybe split primary/secondary and classes? -lvs_class = scope.lookupvar("::lvs::configuration::lvs_grain_class") +lvs_class = scope.lookupvar("::lvs::configuration::lvs_class") lvs_services = scope.lookupvar("::lvs::configuration::lvs_services") services = lvs_services.values.select do |srv| # We select objects in all classes if class is "secondary" -- To view, visit https://gerrit.wikimedia.org/r/377292 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8bcfec2b499b0f1597f71f215bf6e20db98e1250 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: MuehlenhoffGerrit-Reviewer: BBlack Gerrit-Reviewer: Ema Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Increase margin-left on gadget help link
Lucas Werkmeister (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378678 ) Change subject: Increase margin-left on gadget help link .. Increase margin-left on gadget help link This puts a bit more space between the constraint type name (if it’s very long) and the help link, so it doesn’t look like an ordinary inter-word space. Requested by Thiemo in a comment on I9b38af8c2f. Change-Id: If4af8571512cc39a4783a7e393ddb4355e5f9770 --- M modules/ui/ConstraintReportPanel.css 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints refs/changes/78/378678/1 diff --git a/modules/ui/ConstraintReportPanel.css b/modules/ui/ConstraintReportPanel.css index e83f978..19e61a7 100644 --- a/modules/ui/ConstraintReportPanel.css +++ b/modules/ui/ConstraintReportPanel.css @@ -5,6 +5,6 @@ .wbqc-report .wbqc-constraint-type-help { font-weight: normal; float: right; - margin-left: 0.5em; + margin-left: 1.5em; margin-right: 0.5em; } -- To view, visit https://gerrit.wikimedia.org/r/378678 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If4af8571512cc39a4783a7e393ddb4355e5f9770 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE)___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: pagePreviews: Stop A/B test on enwiki and dewiki
Phuedx has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378686 ) Change subject: pagePreviews: Stop A/B test on enwiki and dewiki .. pagePreviews: Stop A/B test on enwiki and dewiki Changes: * Remove A/B test configuration for all wikis. * Disable EventLogging instrumentation on all wikis. * Revert the Page Previews feature to a beta feature on enwiki and dewiki. This also has the effect of disabling the feature for logged out users. Bug: T176068 Change-Id: Ia69d651dc7d0f3971252b30b9d3c9fff9809e372 --- M wmf-config/InitialiseSettings.php 1 file changed, 3 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/86/378686/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index f96d715..49e3a8f 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -13585,9 +13585,6 @@ // stage 0 and stage 1 wikis. 'pp_stage0' => true, 'pp_stage1' => true, - // T172291 - 'enwiki' => true, - 'dewiki' => true, ], 'wgPopupsPageBlacklist' => [ @@ -13615,6 +13612,8 @@ 'wmgPopupsBetaFeature' => [ 'default' => false, + 'enwiki' => true, + 'dewiki' => true, ], 'wgPopupsStatsvSamplingRate' => [ @@ -13624,16 +13623,12 @@ ], 'wgPopupsAnonsExperimentalGroupSize' => [ - // Read: Enable previews for all anonymous users by default, which is the current behaviour on all wikis except enwiki and dewiki per T162672. + // Read: Enable previews for all anonymous users by default. 'default' => 0, - 'enwiki' => 0.06, - 'dewiki' => 0.16, ], 'wgPopupsEventLogging' => [ 'default' => false, - 'enwiki' => true, - 'dewiki' => true, ], 'wgPopupsGateway' => [ -- To view, visit https://gerrit.wikimedia.org/r/378686 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia69d651dc7d0f3971252b30b9d3c9fff9809e372 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Phuedx___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/config[master]: fab: git gc zuul repo on the servers
Hashar has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378667 ) Change subject: fab: git gc zuul repo on the servers .. fab: git gc zuul repo on the servers Objects accumulated in /etc/zuul/wikimedia : $ git count-objects -vH count: 3981 size: 33.17 MiB in-pack: 18850 packs: 1 size-pack: 3.33 MiB prune-packable: 0 garbage: 0 size-garbage: 0 bytes $ Trigger git gc whenever there is more than 128 objects. Change-Id: I3af6fe0f1c06c94065be10961d548703ad0c87ce --- M fabfile.py 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/67/378667/1 diff --git a/fabfile.py b/fabfile.py index e139787..dc6b62a 100644 --- a/fabfile.py +++ b/fabfile.py @@ -31,6 +31,7 @@ 'Did you log your reload in #wikimedia-releng (e.g. ' + '"!log Reloading Zuul to deploy [hash]")'): sudo('git rebase') +sudo('git -c gc.auto=128 gc --auto --quiet') do_reload = True if do_reload: -- To view, visit https://gerrit.wikimedia.org/r/378667 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3af6fe0f1c06c94065be10961d548703ad0c87ce Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Hashar___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Fix no suggestions error on CX dashboard
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378670 ) Change subject: Fix no suggestions error on CX dashboard .. Fix no suggestions error on CX dashboard - Fix error which is occuring when suggestions are disabled on CX dashboard. - Set 'In progress' as default list in case suggestions are disabled on CX dashboard. Change-Id: I1a2cc0628585492894dc30ec2b28ad754b010ea6 --- M modules/dashboard/ext.cx.dashboard.js 1 file changed, 32 insertions(+), 22 deletions(-) Approvals: jenkins-bot: Verified Santhosh: Looks good to me, approved diff --git a/modules/dashboard/ext.cx.dashboard.js b/modules/dashboard/ext.cx.dashboard.js index 06a9c69..a68bd97 100644 --- a/modules/dashboard/ext.cx.dashboard.js +++ b/modules/dashboard/ext.cx.dashboard.js @@ -153,6 +153,7 @@ if ( mw.config.get( 'wgContentTranslationEnableSuggestions' ) ) { this.renderTranslationSuggestions(); } else { + this.setActiveList( 'draft' ); return; } @@ -399,11 +400,7 @@ }; CXDashboard.prototype.listen = function () { - var ulsOptions, - // Here only 'Suggestions' list language filter gets created, translation lists - // ('In progress' and 'Published') create their language filters in fillLanguageFilters method - list = this.lists[ 'suggestions' ], - self = this; + var self = this; this.filter.on( 'select', function ( item ) { self.setActiveList( item.getData() ); @@ -411,23 +408,11 @@ mw.hook( 'mw.cx.translationlist.items.changed' ).add( this.fillLanguageFilters.bind( this ) ); - ulsOptions = { - menuWidth: 'medium', - quickList: function () { - return mw.uls.getFrequentLanguageList(); - }, - compact: true - }; - createUls( - list.languageFilter.$sourceLanguageFilter, - this.setFilter.bind( this, 'sourceLanguage' ), - ulsOptions - ); - createUls( - list.languageFilter.$targetLanguageFilter, - this.setFilter.bind( this, 'targetLanguage' ), - ulsOptions - ); + if ( mw.config.get( 'wgContentTranslationEnableSuggestions' ) ) { + // Here only 'Suggestions' list language filter gets created, translation lists + // ('In progress' and 'Published') create their language filters in fillLanguageFilters method + this.createUlsForSuggestionsList(); + } this.$publishedArticlesButton.on( 'click', function () { self.filter.selectItemByData( 'published' ); @@ -455,6 +440,31 @@ }; /** +* Creates source and target language ULS for suggestions list +*/ + CXDashboard.prototype.createUlsForSuggestionsList = function () { + var list = this.lists[ 'suggestions' ], + ulsOptions = { + menuWidth: 'medium', + quickList: function () { + return mw.uls.getFrequentLanguageList(); + }, + compact: true + }; + + createUls( + list.languageFilter.$sourceLanguageFilter, + this.setFilter.bind( this, 'sourceLanguage' ), + ulsOptions + ); + createUls( + list.languageFilter.$targetLanguageFilter, + this.setFilter.bind( this, 'targetLanguage' ), + ulsOptions + ); + }; + + /** * Fill source and target language filter with respective data fetched from the server */ CXDashboard.prototype.fillLanguageFilters = function () { -- To view, visit https://gerrit.wikimedia.org/r/378670 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a2cc0628585492894dc30ec2b28ad754b010ea6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Petar.petkovicGerrit-Reviewer: Santhosh Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: New Wikidata Build - 2017-09-18T10:00:01+0000
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378669 ) Change subject: New Wikidata Build - 2017-09-18T10:00:01+ .. New Wikidata Build - 2017-09-18T10:00:01+ Change-Id: I1bf7b77236bba72eee8105160f443fb93f84a6e2 --- M composer.lock M extensions/Wikibase/client/i18n/ais.json M extensions/Wikibase/client/i18n/fa.json M extensions/Wikibase/client/i18n/sd.json M extensions/Wikibase/client/i18n/uk.json M extensions/Wikibase/lib/i18n/ais.json M extensions/Wikibase/repo/i18n/ais.json M vendor/composer/installed.json M vendor/wikibase/data-model-serialization/RELEASE-NOTES.md M vendor/wikibase/data-model-serialization/src/Deserializers/SnakDeserializer.php M vendor/wikibase/internal-serialization/README.md M vendor/wikibase/internal-serialization/src/Deserializers/LegacyEntityIdDeserializer.php M vendor/wikibase/internal-serialization/src/Deserializers/LegacyFingerprintDeserializer.php M vendor/wikibase/internal-serialization/src/Deserializers/LegacySiteLinkListDeserializer.php M vendor/wikibase/internal-serialization/src/Deserializers/LegacySnakDeserializer.php 15 files changed, 99 insertions(+), 70 deletions(-) Approvals: WMDE-leszek: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.lock b/composer.lock index 8f47210..3063396 100644 --- a/composer.lock +++ b/composer.lock @@ -1143,16 +1143,16 @@ }, { "name": "wikibase/data-model-serialization", -"version": "2.5.0", +"version": "2.6.0", "source": { "type": "git", "url": "https://github.com/wmde/WikibaseDataModelSerialization.git;, -"reference": "11ff3ca434d6cc63e7ce501229cf416736b45689" +"reference": "022c336875d979de630d11da9fc3628c664cb6ba" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/wmde/WikibaseDataModelSerialization/zipball/11ff3ca434d6cc63e7ce501229cf416736b45689;, -"reference": "11ff3ca434d6cc63e7ce501229cf416736b45689", +"url": "https://api.github.com/repos/wmde/WikibaseDataModelSerialization/zipball/022c336875d979de630d11da9fc3628c664cb6ba;, +"reference": "022c336875d979de630d11da9fc3628c664cb6ba", "shasum": "" }, "require": { @@ -1163,7 +1163,7 @@ }, "require-dev": { "data-values/geo": "~2.0|~1.0|~0.1", -"data-values/number": ">=0.1 <0.9", +"data-values/number": ">=0.1 <0.10", "data-values/time": "~0.2", "phpunit/phpunit": "~4.8", "wikibase/wikibase-codesniffer": "^0.1.0" @@ -1176,7 +1176,7 @@ "type": "library", "extra": { "branch-alias": { -"dev-master": "2.4.x-dev" +"dev-master": "2.6.x-dev" } }, "autoload": { @@ -1209,7 +1209,7 @@ "wikibase", "wikidata" ], -"time": "2017-08-30 14:07:46" +"time": "2017-09-18 08:39:03" }, { "name": "wikibase/data-model-services", @@ -1270,16 +1270,16 @@ }, { "name": "wikibase/internal-serialization", -"version": "2.5.0", +"version": "2.6.0", "source": { "type": "git", "url": "https://github.com/wmde/WikibaseInternalSerialization.git;, -"reference": "5e7f717ffcf6f9267ab50d9cf2b0afae4b5b86e0" +"reference": "b1ac697ede618d70108d5d6e0e623e9fcbb90976" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/wmde/WikibaseInternalSerialization/zipball/5e7f717ffcf6f9267ab50d9cf2b0afae4b5b86e0;, -"reference": "5e7f717ffcf6f9267ab50d9cf2b0afae4b5b86e0", +"url": "https://api.github.com/repos/wmde/WikibaseInternalSerialization/zipball/b1ac697ede618d70108d5d6e0e623e9fcbb90976;, +"reference": "b1ac697ede618d70108d5d6e0e623e9fcbb90976", "shasum": "" }, "require": { @@ -1289,18 +1289,18 @@ "wikibase/data-model-serialization": "~2.0" }, "require-dev": { -"data-values/common": "~0.3.0|~0.2.0", -"data-values/geo": "~1.1|~2.0", -"data-values/number": ">=0.1 <0.9", -"data-values/time": "~0.7.0", +"data-values/common": ">=0.1 <0.5", +"data-values/geo": ">=1.0 <3.0", +"data-values/number": ">=0.1 <0.10", +"data-values/time": ">=0.1 <0.9", "phpmd/phpmd":
[MediaWiki-commits] [Gerrit] integration/config[master]: Add extensions/DataTypes
AnotherLadsgroup has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378672 ) Change subject: Add extensions/DataTypes .. Add extensions/DataTypes Bug: T127292 Change-Id: I2e04a8e308e402a0b7e8a8273fb0d45cc135d31f --- M zuul/layout.yaml 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/72/378672/1 diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 5a204c3..9c98df8 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -4293,6 +4293,12 @@ - name: extension-unittests-generic - name: mwgate-npm + - name: mediawiki/extensions/DataTypes +template: + - name: extension-unittests-composer + - name: mwgate-npm + - name: extension-qunit-composer + - name: mediawiki/extensions/DeleteOwn template: - name: extension-unittests-generic -- To view, visit https://gerrit.wikimedia.org/r/378672 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e04a8e308e402a0b7e8a8273fb0d45cc135d31f Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: AnotherLadsgroup___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceExtendedStatistics[refs/meta/config]: Modify access rules
Robert Vogel has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378684 ) Change subject: Modify access rules .. Modify access rules Change-Id: I9bb56163d7620cb1f20d9586bef6426bbe63c0b9 --- M groups M project.config 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtendedStatistics refs/changes/84/378684/1 diff --git a/groups b/groups index 4e1516c..a3c18a8 100644 --- a/groups +++ b/groups @@ -1,3 +1,4 @@ # UUID Group Name # db4fa62c57d55db4a327f66e6d2cc39ffa2701ec extension-BlueSpiceExtendedStatistics +f7087318186de2eac3b21b63abd2a145035455a3 bluespice diff --git a/project.config b/project.config index b8e900f..bb8e7c8 100644 --- a/project.config +++ b/project.config @@ -7,4 +7,5 @@ [submit] mergeContent = true [access "refs/*"] + owner = group bluespice owner = group extension-BlueSpiceExtendedStatistics -- To view, visit https://gerrit.wikimedia.org/r/378684 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bb56163d7620cb1f20d9586bef6426bbe63c0b9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceExtendedStatistics Gerrit-Branch: refs/meta/config Gerrit-Owner: Robert Vogel___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceUserManager[refs/meta/config]: Modify access rules
Robert Vogel has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378685 ) Change subject: Modify access rules .. Modify access rules Change-Id: Iae2ed4e1081906beefdee547934cc2bd8f34e0a8 --- M groups M project.config 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceUserManager refs/changes/85/378685/1 diff --git a/groups b/groups index 7b0d93f..d041196 100644 --- a/groups +++ b/groups @@ -1,3 +1,4 @@ # UUID Group Name # 04d741239bb34f8209c38fb0fcaa24aa0b9430d6 extension-BlueSpiceUserManager +f7087318186de2eac3b21b63abd2a145035455a3 bluespice diff --git a/project.config b/project.config index 5743785..fbb9372 100644 --- a/project.config +++ b/project.config @@ -7,4 +7,5 @@ [submit] mergeContent = true [access "refs/*"] + owner = group bluespice owner = group extension-BlueSpiceUserManager -- To view, visit https://gerrit.wikimedia.org/r/378685 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iae2ed4e1081906beefdee547934cc2bd8f34e0a8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceUserManager Gerrit-Branch: refs/meta/config Gerrit-Owner: Robert Vogel___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] marvin[master]: Chore: Lint module order by type, instead of alphabetically
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378242 ) Change subject: Chore: Lint module order by type, instead of alphabetically .. Chore: Lint module order by type, instead of alphabetically Instead of sorting modules alphabetically, add linting so that modules are sorted by type: ["builtin", "external", "parent", "sibling", "index"] Change-Id: Ibe4bc7b03b8d132a1c7a885ec43a4287605c9118 --- M .eslintrc.json M package-lock.json M package.json M src/client/index.tsx M src/common/components/app/app.test.ts M src/common/pages/about.tsx M src/common/pages/index.tsx M src/common/pages/not-found.tsx M src/common/pages/style-guide.tsx M src/common/routers/api.ts M src/common/routers/router.ts M src/server/components/page.tsx M src/server/index.tsx M test/server/components/page.test.ts M webpack.config.ts 15 files changed, 130 insertions(+), 18 deletions(-) Approvals: Niedzielski: Looks good to me, approved jenkins-bot: Verified diff --git a/.eslintrc.json b/.eslintrc.json index 6d6b60b..3cf0d28 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,7 +4,8 @@ "prettier" ], "plugins": [ -"prettier" +"prettier", +"import" ], "rules": { "prettier/prettier": ["warn", { "parser": "typescript" }], @@ -15,7 +16,9 @@ "ignoreUrls": true, "ignorePattern": "^/// .+|// eslint-.+" } -] +], +"sort-imports": "off", +"import/order": ["warn"] }, "parser": "typescript-eslint-parser", "parserOptions": { diff --git a/package-lock.json b/package-lock.json index 319c07a..9ed6e22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -970,6 +970,12 @@ "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", "dev": true }, +"contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz;, + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true +}, "content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz;, @@ -1695,6 +1701,56 @@ "resolved": "https://registry.npmjs.org/eslint-config-wikimedia/-/eslint-config-wikimedia-0.4.0.tgz;, "integrity": "sha1-Qs8e4NR7HyQ8un5vFEVWy8bS4MM=", "dev": true +}, +"eslint-import-resolver-node": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz;, + "integrity": "sha512-yUtXS15gIcij68NmXmP9Ni77AQuCN0itXbCc/jWd8C6/yKZaSNXicpC8cgvjnxVdmfsosIXrjpzFq7GcDryb6A==", + "dev": true, + "requires": { +"debug": "2.6.8", +"resolve": "1.4.0" + } +}, +"eslint-module-utils": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz;, + "integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==", + "dev": true, + "requires": { +"debug": "2.6.8", +"pkg-dir": "1.0.0" + } +}, +"eslint-plugin-import": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.7.0.tgz;, + "integrity": "sha512-HGYmpU9f/zJaQiKNQOVfHUh2oLWW3STBrCgH0sHTX1xtsxYlH1zjLh8FlQGEIdZSdTbUMaV36WaZ6ImXkenGxQ==", + "dev": true, + "requires": { +"builtin-modules": "1.1.1", +"contains-path": "0.1.0", +"debug": "2.6.8", +"doctrine": "1.5.0", +"eslint-import-resolver-node": "0.3.1", +"eslint-module-utils": "2.1.1", +"has": "1.0.1", +"lodash.cond": "4.5.2", +"minimatch": "3.0.4", +"read-pkg-up": "2.0.0" + }, + "dependencies": { +"doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz;, + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { +"esutils": "2.0.2", +"isarray": "1.0.0" + } +} + } }, "eslint-plugin-jsdoc": { "version": "3.1.2", @@ -4165,6 +4221,12 @@ "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", "dev": true }, +"lodash.cond": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz;, + "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", + "dev": true +}, "lodash.create": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz;, @@ -5199,6 +5261,12 @@ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, +"path-parse": { + "version": "1.0.5", +
[MediaWiki-commits] [Gerrit] operations/puppet[production]: dumps: Align box-shadow with WikimediaUI standard
ArielGlenn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378408 ) Change subject: dumps: Align box-shadow with WikimediaUI standard .. dumps: Align box-shadow with WikimediaUI standard See Ib32072e8770ccc120f732498ef8e18b6ce2bf8ff Change-Id: I54fa084321486ca4de1ea039d85d43378a4424dd --- M modules/snapshot/files/dumps/templates/report.html 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: ArielGlenn: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/snapshot/files/dumps/templates/report.html b/modules/snapshot/files/dumps/templates/report.html index 6f884ec..245e316 100644 --- a/modules/snapshot/files/dumps/templates/report.html +++ b/modules/snapshot/files/dumps/templates/report.html @@ -47,18 +47,18 @@ } li.in-progress { border-top: 3px solid #3366cc; -box-shadow: 0 8px 12px -8px #375baf; font-weight: bold; +box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.15 ); } .done { border-top: 3px solid #00af89; -box-shadow: 0 8px 12px -8px #0a4337; +box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.15 ); } .failed { color: #b32424; font-weight: bold; border-top: 3px solid #b32424; -box-shadow: 0 8px 12px -8px #5a1212; +box-shadow: 0 1px 1px rgba( 0, 0, 0, 0.15 ); } .waiting { color: #c8ccd1; -- To view, visit https://gerrit.wikimedia.org/r/378408 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I54fa084321486ca4de1ea039d85d43378a4424dd Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: LadsgroupGerrit-Reviewer: ArielGlenn 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]: New Wikidata Build - 2017-09-18T10:00:01+0000
WikidataBuilder has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378669 ) Change subject: New Wikidata Build - 2017-09-18T10:00:01+ .. New Wikidata Build - 2017-09-18T10:00:01+ Change-Id: I1bf7b77236bba72eee8105160f443fb93f84a6e2 --- M composer.lock M extensions/Wikibase/client/i18n/ais.json M extensions/Wikibase/client/i18n/fa.json M extensions/Wikibase/client/i18n/sd.json M extensions/Wikibase/client/i18n/uk.json M extensions/Wikibase/lib/i18n/ais.json M extensions/Wikibase/repo/i18n/ais.json M vendor/composer/installed.json M vendor/wikibase/data-model-serialization/RELEASE-NOTES.md M vendor/wikibase/data-model-serialization/src/Deserializers/SnakDeserializer.php M vendor/wikibase/internal-serialization/README.md M vendor/wikibase/internal-serialization/src/Deserializers/LegacyEntityIdDeserializer.php M vendor/wikibase/internal-serialization/src/Deserializers/LegacyFingerprintDeserializer.php M vendor/wikibase/internal-serialization/src/Deserializers/LegacySiteLinkListDeserializer.php M vendor/wikibase/internal-serialization/src/Deserializers/LegacySnakDeserializer.php 15 files changed, 99 insertions(+), 70 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/69/378669/1 diff --git a/composer.lock b/composer.lock index 8f47210..3063396 100644 --- a/composer.lock +++ b/composer.lock @@ -1143,16 +1143,16 @@ }, { "name": "wikibase/data-model-serialization", -"version": "2.5.0", +"version": "2.6.0", "source": { "type": "git", "url": "https://github.com/wmde/WikibaseDataModelSerialization.git;, -"reference": "11ff3ca434d6cc63e7ce501229cf416736b45689" +"reference": "022c336875d979de630d11da9fc3628c664cb6ba" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/wmde/WikibaseDataModelSerialization/zipball/11ff3ca434d6cc63e7ce501229cf416736b45689;, -"reference": "11ff3ca434d6cc63e7ce501229cf416736b45689", +"url": "https://api.github.com/repos/wmde/WikibaseDataModelSerialization/zipball/022c336875d979de630d11da9fc3628c664cb6ba;, +"reference": "022c336875d979de630d11da9fc3628c664cb6ba", "shasum": "" }, "require": { @@ -1163,7 +1163,7 @@ }, "require-dev": { "data-values/geo": "~2.0|~1.0|~0.1", -"data-values/number": ">=0.1 <0.9", +"data-values/number": ">=0.1 <0.10", "data-values/time": "~0.2", "phpunit/phpunit": "~4.8", "wikibase/wikibase-codesniffer": "^0.1.0" @@ -1176,7 +1176,7 @@ "type": "library", "extra": { "branch-alias": { -"dev-master": "2.4.x-dev" +"dev-master": "2.6.x-dev" } }, "autoload": { @@ -1209,7 +1209,7 @@ "wikibase", "wikidata" ], -"time": "2017-08-30 14:07:46" +"time": "2017-09-18 08:39:03" }, { "name": "wikibase/data-model-services", @@ -1270,16 +1270,16 @@ }, { "name": "wikibase/internal-serialization", -"version": "2.5.0", +"version": "2.6.0", "source": { "type": "git", "url": "https://github.com/wmde/WikibaseInternalSerialization.git;, -"reference": "5e7f717ffcf6f9267ab50d9cf2b0afae4b5b86e0" +"reference": "b1ac697ede618d70108d5d6e0e623e9fcbb90976" }, "dist": { "type": "zip", -"url": "https://api.github.com/repos/wmde/WikibaseInternalSerialization/zipball/5e7f717ffcf6f9267ab50d9cf2b0afae4b5b86e0;, -"reference": "5e7f717ffcf6f9267ab50d9cf2b0afae4b5b86e0", +"url": "https://api.github.com/repos/wmde/WikibaseInternalSerialization/zipball/b1ac697ede618d70108d5d6e0e623e9fcbb90976;, +"reference": "b1ac697ede618d70108d5d6e0e623e9fcbb90976", "shasum": "" }, "require": { @@ -1289,18 +1289,18 @@ "wikibase/data-model-serialization": "~2.0" }, "require-dev": { -"data-values/common": "~0.3.0|~0.2.0", -"data-values/geo": "~1.1|~2.0", -"data-values/number": ">=0.1 <0.9", -"data-values/time": "~0.7.0", +"data-values/common": ">=0.1 <0.5", +"data-values/geo": ">=1.0 <3.0", +"data-values/number": ">=0.1 <0.10", +"data-values/time": ">=0.1 <0.9",
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Enable config ContentTranslationEnableSuggestions by default
Santhosh has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378673 ) Change subject: Enable config ContentTranslationEnableSuggestions by default .. Enable config ContentTranslationEnableSuggestions by default Change-Id: I8d710ec11baf7bfcbcfd8bdb50453ae554a96fd3 --- M extension.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/73/378673/1 diff --git a/extension.json b/extension.json index f459880..6c270d8 100644 --- a/extension.json +++ b/extension.json @@ -162,7 +162,7 @@ "key": "", "age": "3600" }, - "ContentTranslationEnableSuggestions": false, + "ContentTranslationEnableSuggestions": true, "@RecommendToolAPIURL": "Web API URL for translation recommendation tool", "RecommendToolAPIURL": "https://recommend.wmflabs.org/types/translation/v1/articles;, "ContentTranslationVersion": "1" -- To view, visit https://gerrit.wikimedia.org/r/378673 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8d710ec11baf7bfcbcfd8bdb50453ae554a96fd3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Santhosh___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: VCL: remove wikiScrape rate limiting
Ema has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378732 ) Change subject: VCL: remove wikiScrape rate limiting .. VCL: remove wikiScrape rate limiting Remove the ad-hoc rate limiting for the wikiScrape User-Agent as we have now tackled the problem in a more generic way. Introduce UA-specific rate limiting (varnishTest) in the test version of our VCL for VTC testing. Change-Id: I19cd735f1dc277e6a9ec540f1dfb6428017101a3 --- M modules/varnish/files/tests/text/12-rate-limiting.vtc M modules/varnish/templates/text-frontend.inc.vcl.erb 2 files changed, 11 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/32/378732/1 diff --git a/modules/varnish/files/tests/text/12-rate-limiting.vtc b/modules/varnish/files/tests/text/12-rate-limiting.vtc index 541cc00..8de8aa1 100644 --- a/modules/varnish/files/tests/text/12-rate-limiting.vtc +++ b/modules/varnish/files/tests/text/12-rate-limiting.vtc @@ -19,14 +19,14 @@ client c1 { # First 25 requests are fine loop 25 { -txreq -hdr "User-Agent: wikiScrape/0.0.0" -hdr "X-Forwarded-Proto: https" +txreq -hdr "User-Agent: varnishTest" -hdr "X-Forwarded-Proto: https" rxresp expect resp.status == 200 expect resp.http.X-Cache ~ "pass" } # The 26th request gets rate limited -txreq -hdr "User-Agent: wikiScrape/0.0.0" -hdr "X-Forwarded-Proto: https" +txreq -hdr "User-Agent: varnishTest" -hdr "X-Forwarded-Proto: https" rxresp expect resp.status == 429 expect resp.msg == "Too Many Requests" @@ -36,7 +36,7 @@ delay 5 -txreq -hdr "User-Agent: wikiScrape/0.0.0" -hdr "X-Forwarded-Proto: https" +txreq -hdr "User-Agent: varnishTest" -hdr "X-Forwarded-Proto: https" rxresp expect resp.status == 200 } -run diff --git a/modules/varnish/templates/text-frontend.inc.vcl.erb b/modules/varnish/templates/text-frontend.inc.vcl.erb index 096c386..6bb6216 100644 --- a/modules/varnish/templates/text-frontend.inc.vcl.erb +++ b/modules/varnish/templates/text-frontend.inc.vcl.erb @@ -180,12 +180,6 @@ sub cluster_fe_hit { } sub cluster_fe_ratelimit { - if (req.http.User-Agent ~ "^wikiScrape") { - if (vsthrottle.is_denied("wikiScrape:" + req.http.X-Client-IP, 25, 5s)) { - return (synth(429, "Too Many Requests")); - } - } - // Ratelimit miss/pass requests per IP: // * Excluded for now: // * all WMF IPs (including labs) @@ -207,6 +201,14 @@ } } } + + <%- if @varnish_testing -%> + if (req.http.User-Agent ~ "^varnishTest") { + if (vsthrottle.is_denied("varnishTest:" + req.http.X-Client-IP, 25, 5s)) { + return (synth(429, "Too Many Requests")); + } + } + <%- end -%> } sub cluster_fe_miss { -- To view, visit https://gerrit.wikimedia.org/r/378732 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I19cd735f1dc277e6a9ec540f1dfb6428017101a3 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] mediawiki/core[wmf/1.30.0-wmf.18]: Use db query builder not raw sql
Reedy has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378735 ) Change subject: Use db query builder not raw sql .. Use db query builder not raw sql Change-Id: I8e26932e28fdda9a52e0486c5d2eb269eb9ecae5 Follows-up: Ice1bdae3d16cf365da14c6df0e8d91d2b914e064 (cherry picked from commit 90534ed5daa7f68d6d7bf349afd55f2c8295f067) --- M maintenance/populateIpChanges.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/35/378735/1 diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index 004b6bc..ffb8c43 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -67,12 +67,12 @@ $this->output( "Copying IP revisions to ip_changes, from rev_id $start to rev_id $end\n" ); while ( $blockStart <= $end ) { - $cond = "rev_id >= $blockStart AND rev_user = 0 ORDER BY rev_id ASC LIMIT " . $this->mBatchSize; $rows = $dbw->select( 'revision', [ 'rev_id', 'rev_timestamp', 'rev_user_text' ], - $cond, - __METHOD__ + [ "rev_id >= $blockStart", 'rev_user' => 0 ], + __METHOD__, + [ 'ORDER BY' => 'rev_id ASC', 'LIMIT' => $this->mBatchSize ] ); if ( !$rows || $rows->numRows() === 0 ) { -- To view, visit https://gerrit.wikimedia.org/r/378735 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e26932e28fdda9a52e0486c5d2eb269eb9ecae5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.18 Gerrit-Owner: Reedy___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [IMPR] Provide generator settings inside (user-)fixes.py
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/314857 ) Change subject: [IMPR] Provide generator settings inside (user-)fixes.py .. [IMPR] Provide generator settings inside (user-)fixes.py - Generator has the keyword 'generator' and may be a str or a iterable of str which enables multiple pagegenerators arguments - The fixes generator is invoked only if no generator is given by command line. This enables to override the default generator given by the fixes set. Bug: T147418 Change-Id: Id099b50b766fb87678807a2a209c5bd2dd824245 --- M scripts/replace.py 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: Huji: Looks good to me, approved jenkins-bot: Verified Zoranzoki21: Looks good to me, but someone else must approve diff --git a/scripts/replace.py b/scripts/replace.py index 1abd206..cd39f4c 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -128,7 +128,7 @@ """ # # (C) Daniel Herding, 2004-2012 -# (C) Pywikibot team, 2004-2016 +# (C) Pywikibot team, 2004-2017 # # Distributed under the terms of the MIT license. # @@ -1023,6 +1023,7 @@ # Perform one of the predefined actions. missing_fixes_summaries = [] # which a fixes/replacements miss a summary +generators_given = bool(genFactory.gens) for fix_name in fixes_set: try: fix = fixes.fixes[fix_name] @@ -1044,6 +1045,12 @@ set_summary = i18n.translate(site, fix['msg'], fallback=True) else: set_summary = None +if not generators_given and 'generator' in fix: +gen_args = fix['generator'] +if isinstance(gen_args, basestring): +gen_args = [gen_args] +for gen_arg in gen_args: +genFactory.handleArg(gen_arg) replacement_set = ReplacementList(fix.get('regex'), fix.get('exceptions'), fix.get('nocase'), -- To view, visit https://gerrit.wikimedia.org/r/314857 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id099b50b766fb87678807a2a209c5bd2dd824245 Gerrit-PatchSet: 5 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Huji Gerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Magul Gerrit-Reviewer: Matěj Suchánek Gerrit-Reviewer: Merlijn van Deen Gerrit-Reviewer: Mpaa Gerrit-Reviewer: Zoranzoki21 Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...NavigationTiming[wmf/1.30.0-wmf.18]: Unbreak navTiming reporting
Krinkle has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378740 ) Change subject: Unbreak navTiming reporting .. Unbreak navTiming reporting Follows-up 3d5946f. The check for '> 0' of the computed relative value being removed in itself was fine, but the problem was that this check was also indirectly used to ensure the original value exists at all and is in fact not also 0. We could add a check for the original value (before subtraction) is above 0 For example: The raw 'secureConnectionStart' value (expected to be a timestamp) may be 0 itself, in which case subtracting navStart produces a negative value. Also, if the key is absent, it would produce NaN which (in JSON) becomes null, which is invalid per the schema declaring it as int, thus the entire beacon packet was being discarded. Bug: T176105 Change-Id: I187505b75ad8f94763d20546eb408139622c617a --- M modules/ext.navigationTiming.js M tests/ext.navigationTiming.test.js 2 files changed, 120 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NavigationTiming refs/changes/40/378740/1 diff --git a/modules/ext.navigationTiming.js b/modules/ext.navigationTiming.js index f5d18cf..cd129f3 100644 --- a/modules/ext.navigationTiming.js +++ b/modules/ext.navigationTiming.js @@ -120,7 +120,15 @@ 'responseStart', 'secureConnectionStart' ], function ( i, marker ) { - timingData[ marker ] = timing[ marker ] - navStart; + // Verify the key exists and that it is above zero to avoid submit + // of invalid or negative values after subtracting navStart. + // While these keys are meant to be timestamps, they may be absent + // or 0 where the measured operation did not ocurr. + // E.g. secureConnectionStart is 0 when the connection is reused (T176105) + var value = timing[ marker ]; + if ( typeof value === 'number' && value > 0 ) { + timingData[ marker ] = value - navStart; + } } ); if ( timing.domainLookupStart ) { @@ -293,6 +301,7 @@ // mocked from the top down via window.performance. The test // needs to force this module to re-resolve this cached // reference. See ext.navigationTiming.test.js + timing = performance.timing; navigation = performance.navigation; } }; diff --git a/tests/ext.navigationTiming.test.js b/tests/ext.navigationTiming.test.js index 1891b6d..48837d6 100644 --- a/tests/ext.navigationTiming.test.js +++ b/tests/ext.navigationTiming.test.js @@ -57,3 +57,113 @@ } } } ); + +// Case with example values typical for a first view +// where DNS, TCP, SSL etc. all need to happen. +QUnit.test( 'First view', function ( assert ) { + var event, stub, expected, key, type, val; + + this.sandbox.stub( window, 'performance', { + timing: { + navigationStart: 100, + fetchStart: 200, + domainLookupStart: 210, + domainLookupEnd: 225, + connectStart: 226, + secureConnectionStart: 235, + connectEnd: 250, + requestStart: 250, + responseStart: 300, + responseEnd: 400, + domComplete: 450, + loadEventStart: 570, + loadEventEnd: 575 + }, + navigation: { + // type: TYPE_NAVIGATE + type: 0, + redirectCount: 0 + } + } ); + require( 'ext.navigationTiming' ).reinit(); + stub = this.sandbox.stub( mw.eventLog, 'logEvent' ); + require( 'ext.navigationTiming' ).emitNavTiming(); + assert.ok( stub.calledOnce, 'mw.eventLog.logEvent was called' ); + assert.equal( stub.getCall( 0 ).args[ 0 ], 'NavigationTiming', 'Schema name' ); + event = stub.getCall( 0 ).args[ 1 ]; + + expected = { + dnsLookup: [ 'number', 15 ], + connectStart: [ 'number', 126 ], + secureConnectionStart: [ 'number', 135 ], + connectEnd: [ 'number', 150 ], + requestStart: [ 'number', 150 ], + responseStart: [ 'number', 200 ], + responseEnd: [ 'number', 300 ], + domComplete: [ 'number', 350 ], + loadEventStart: [ 'number', 470 ], +
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Design tweak: update reference dialog colors
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/377783 ) Change subject: Design tweak: update reference dialog colors .. Design tweak: update reference dialog colors Bug: T171469 Change-Id: I6d74eb1aa2d321d7f859cadf4f9931aec18f49bc --- M app/src/main/res/layout/dialog_reference.xml M app/src/main/res/values/attrs.xml M app/src/main/res/values/styles_dark.xml M app/src/main/res/values/styles_light.xml 4 files changed, 18 insertions(+), 10 deletions(-) Approvals: Dbrant: Looks good to me, approved jenkins-bot: Verified diff --git a/app/src/main/res/layout/dialog_reference.xml b/app/src/main/res/layout/dialog_reference.xml index edbbb48..085a0e0 100644 --- a/app/src/main/res/layout/dialog_reference.xml +++ b/app/src/main/res/layout/dialog_reference.xml @@ -1,6 +1,7 @@ -http://schemas.android.com/apk/res/android; +http://schemas.android.com/apk/res/android; xmlns:tools="http://schemas.android.com/tools; android:layout_width="match_parent" android:layout_height="wrap_content" @@ -15,7 +16,7 @@ style="@style/RtlAwareTextView" android:textSize="16sp" android:fontFamily="sans-serif-medium" -android:textColor="?attr/feed_text_primary_color" +android:textColor="?android:textColorPrimary" tools:text="Reference [1]"/> +android:theme="?attr/horizontal_divider" /> - + diff --git a/app/src/main/res/values/styles_dark.xml b/app/src/main/res/values/styles_dark.xml index d7f9f56..e1f7d02 100644 --- a/app/src/main/res/values/styles_dark.xml +++ b/app/src/main/res/values/styles_dark.xml @@ -52,7 +52,6 @@ @color/list_item_text_primary_dark @color/list_item_text_secondary_dark 1.0 - @color/base10 @color/base18 @color/color_state_nav_tab_dark @@ -64,9 +63,8 @@ @color/feed_text_tertiary_dark @color/base12 @color/base14 - @color/accent75 - +@style/HorizontalDividerDark @@ -89,4 +87,9 @@- @color/base30
+ +- @color/base100
+- 0.20
+ + diff --git a/app/src/main/res/values/styles_light.xml b/app/src/main/res/values/styles_light.xml index 97ee642..d85002f 100644 --- a/app/src/main/res/values/styles_light.xml +++ b/app/src/main/res/values/styles_light.xml @@ -64,9 +64,8 @@ @color/feed_text_tertiary_light @color/base100 @color/base100 - @color/accent50 - +@style/HorizontalDividerLight @@ -91,4 +90,9 @@- src_in
+ +- @color/base0
+- 0.12
+ + -- To view, visit https://gerrit.wikimedia.org/r/377783 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6d74eb1aa2d321d7f859cadf4f9931aec18f49bc Gerrit-PatchSet: 6 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: MhollowayGerrit-Reviewer: Brion VIBBER Gerrit-Reviewer: Cooltey Gerrit-Reviewer: Dbrant Gerrit-Reviewer: Mholloway Gerrit-Reviewer: Sharvaniharan Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [DNM] Remove redundant fields from old DB tables.
Daniel Kinzler has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378729 ) Change subject: [DNM] Remove redundant fields from old DB tables. .. [DNM] Remove redundant fields from old DB tables. This patch is intended as a showcase only! Bug: T174028 Change-Id: I5e37c929713efad34218e616829235f417f1861c --- M maintenance/tables.sql 1 file changed, 0 insertions(+), 42 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/29/378729/1 diff --git a/maintenance/tables.sql b/maintenance/tables.sql index 37c4dc5..c7a24e1 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -303,9 +303,6 @@ -- Uncompressed length in bytes of the page's current source text. page_len int unsigned NOT NULL, - -- content model, see CONTENT_MODEL_XXX constants - page_content_model varbinary(32) DEFAULT NULL, - -- Page content language page_lang varbinary(35) DEFAULT NULL ) /*$wgDBTableOptions*/; @@ -339,12 +336,6 @@ -- Key to page_id. This should _never_ be invalid. rev_page int unsigned NOT NULL, - -- Key to text.old_id, where the actual bulk text is stored. - -- It's possible for multiple revisions to use the same text, - -- for instance revisions where only metadata is altered - -- or a rollback to a previous version. - rev_text_id int unsigned NOT NULL, - -- Text comment summarizing the change. Deprecated in favor of -- revision_comment_temp.revcomment_comment_id. rev_comment varbinary(767) NOT NULL default '', @@ -375,12 +366,6 @@ -- SHA-1 text content hash in base-36 rev_sha1 varbinary(32) NOT NULL default '', - - -- content model, see CONTENT_MODEL_XXX constants - rev_content_model varbinary(32) DEFAULT NULL, - - -- content format, see CONTENT_FORMAT_XXX constants - rev_content_format varbinary(64) DEFAULT NULL ) /*$wgDBTableOptions*/ MAX_ROWS=1000 AVG_ROW_LENGTH=1024; -- In case tables are created as MyISAM, use row hints for MySQL <5.0 to avoid 4GB limit @@ -536,14 +521,6 @@ ar_namespace int NOT NULL default 0, ar_title varchar(255) binary NOT NULL default '', - -- Newly deleted pages will not store text in this table, - -- but will reference the separately existing text rows. - -- This field is retained for backwards compatibility, - -- so old archived pages will remain accessible after - -- upgrading from 1.4 to 1.5. - -- Text may be gzipped or otherwise funky. - ar_text mediumblob NOT NULL, - -- Basic revision stuff... ar_comment varbinary(767) NOT NULL default '', -- Deprecated in favor of ar_comment_id ar_comment_id bigint unsigned NOT NULL DEFAULT 0, -- ("DEFAULT 0" is temporary, signaling that ar_comment should be used) @@ -551,9 +528,6 @@ ar_user_text varchar(255) binary NOT NULL, ar_timestamp binary(14) NOT NULL default '', ar_minor_edit tinyint NOT NULL default 0, - - -- See ar_text note. - ar_flags tinyblob NOT NULL, -- When revisions are deleted, their unique rev_id is stored -- here so it can be retained after undeletion. This is necessary @@ -563,17 +537,6 @@ -- Old entries from 1.4 will be NULL here, and a new rev_id will -- be created on undeletion for those revisions. ar_rev_id int unsigned, - - -- For newly deleted revisions, this is the text.old_id key to the - -- actual stored text. To avoid breaking the block-compression scheme - -- and otherwise making storage changes harder, the actual text is - -- *not* deleted from the text table, merely hidden by removal of the - -- page and revision entries. - -- - -- Old entries deleted under 1.2-1.4 will have NULL here, and their - -- ar_text and ar_flags fields will be used to create a new text - -- row upon undeletion. - ar_text_id int unsigned, -- rev_deleted for archives ar_deleted tinyint unsigned NOT NULL default 0, @@ -594,11 +557,6 @@ -- SHA-1 text content hash in base-36 ar_sha1 varbinary(32) NOT NULL default '', - -- content model, see CONTENT_MODEL_XXX constants - ar_content_model varbinary(32) DEFAULT NULL, - - -- content format, see CONTENT_FORMAT_XXX constants - ar_content_format varbinary(64) DEFAULT NULL ) /*$wgDBTableOptions*/; -- Index for Special:Undelete to page through deleted revisions -- To view, visit https://gerrit.wikimedia.org/r/378729 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5e37c929713efad34218e616829235f417f1861c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Daniel Kinzler___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: DesktopArticleTarget: Support preloadtitle in source mode
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378726 ) Change subject: DesktopArticleTarget: Support preloadtitle in source mode .. DesktopArticleTarget: Support preloadtitle in source mode Can't support it in visual mode, since there's no new-section handling at all. Bug: T51622 Change-Id: I763d5fff156e9ef3893bd882fab1dc2d47121728 --- M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js M modules/ve-mw/init/ve.init.mw.ArticleTarget.js 2 files changed, 9 insertions(+), 0 deletions(-) Approvals: Esanders: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index bab1f98..249b8f9 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -506,6 +506,10 @@ } surface.setPlaceholder( ve.msg( 'visualeditor-section-body-placeholder' ) ); this.$editableContent.before( this.sectionTitle.$element ); + + if ( this.currentUri.query.preloadtitle ) { + this.sectionTitle.setValue( this.currentUri.query.preloadtitle ); + } } }; diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js index 3207592..005e623 100644 --- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js +++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js @@ -1860,6 +1860,11 @@ ve.init.mw.ArticleTarget.prototype.updateToolbarSaveButtonState = function () { var isDisabled; + if ( !this.getSurface() ) { + // Called before we're attached, so meaningless; abandon for now + return; + } + this.edited = this.getSurface().getModel().hasBeenModified() || this.fromEditedState; if ( this.sectionTitle ) { this.edited = this.edited || this.sectionTitle.getValue() !== ''; -- To view, visit https://gerrit.wikimedia.org/r/378726 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I763d5fff156e9ef3893bd882fab1dc2d47121728 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: DLynchGerrit-Reviewer: Esanders Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] analytics/refinery[master]: Add oozie util workflow to launch spark jobs
Ottomata has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/201009 ) Change subject: Add oozie util workflow to launch spark jobs .. Add oozie util workflow to launch spark jobs This uses spark-submit to launch the job, rather than the builtin Spark oozie action. The Spark oozie action does not work with HiveContext. I got this to work with my CamusJsonRefine job refining eventbus data like: sudo -u hdfs oozie job \ -Doozie_directory=/user/otto/oozie \ -Dhive_site_xml="hdfs://analytics-hadoop/wmf/refinery/current/oozie/util/hive/hive-site.xml" \ -Dspark_app_jar=hdfs://analytics-hadoop/user/otto/refinery-job-0.0.49-SNAPSHOT.jar \ -Dspark_app_class=org.wikimedia.analytics.refinery.job.CamusJsonRefine \ -Dspark_app_options="-i /wmf/data/raw/event -d otto -l /user/otto/external/eventbus1 -p year=2017,month=07,day=18,hour=00 --limit 4 --done-flag _REFINED --table-regex .*/(?:codfw|eqiad)_(.+)/hourly/.*" \ -oozie $OOZIE_URL -run -config ~/refinery/oozie/util/spark/submit/workflow.properties Bug: T94596, T162610 Change-Id: If4077f33bfec87b3a09c0670c71025fc92fb082d --- A oozie/util/spark/submit/README.md A oozie/util/spark/submit/workflow.properties A oozie/util/spark/submit/workflow.xml 3 files changed, 197 insertions(+), 0 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/oozie/util/spark/submit/README.md b/oozie/util/spark/submit/README.md new file mode 100644 index 000..c3fc35e --- /dev/null +++ b/oozie/util/spark/submit/README.md @@ -0,0 +1,14 @@ +This is a workflow intended to be used to submit Spark jobs via an Oozie shell action. +Oozie has a built in Spark action, but it does not work with HiveContext due to classpath issues. +This workflow can be used to submit Spark jobs that use HiveContext by bypassing whatever +Oozie classpath issues cause the problem, and submitting a Spark job directly with spark-submit. + +This workflow expects Spark/YARN to support dynamic allocation, and will use it by default. +You can configure the maximum number of allocated executors by setting the spark_max_executors +property. spark_max_executors defaults to 64. + +This workflow expects that your Spark job is configured to intake its CLI options as a single +string passed to the --options flag. This allows us to use a single workflow with variable +Spark app CLI options. Oozie requires that individual CLI options are each specified in their +own tag, which is inflexble on its own if we want to work with any +generic Spark job. diff --git a/oozie/util/spark/submit/workflow.properties b/oozie/util/spark/submit/workflow.properties new file mode 100644 index 000..ea6fcc8 --- /dev/null +++ b/oozie/util/spark/submit/workflow.properties @@ -0,0 +1,60 @@ +# Configures an oozie shell action to submit a Spark job via spark-submit. +# Even though OOZIE-1983 added support for a Spark action, we ran into a CLASSPATH +# problem when trying use Oozie with a Spark job that uses HiveContext. +# This spark-submit shell based workflow can be used to launch +# Spark jobs that require use of HiveContext. If your Spark job doesn't use +# HiveContext, you should just use the built in Oozie Spark action. +# +# This workflow is meant to work with Spark applications that are able to take their +# CLI opts via a single flag that takes all options as a single string and then parses them. +# E.g. --options "-S true --input /path/to/input --output /path/to/output" +# +# You will probably be using this workflow.xml as a sub workflow. However, if you would +# like to just submit a Spark job as a single workflow, you may use this +# workflow.properties file like: +# +# oozie job -run -config oozie/util/spark/submit/workflow.properties \ +# -Dspark_app_name="My Awesome Spark App" \ +# -Dspark_app_jar=hdfs://analytics-hadoop/user/$USER/oozie/my_spark_app.jar \ +# -Dspark_app_class=org.wikimedia.analytics.refinery.job.MySparkJob \ +# -Dspark_app_options="..." +# + +name_node = hdfs://analytics-hadoop +job_tracker = resourcemanager.analytics.eqiad.wmnet:8032 +queue_name= default + +# Base path in HDFS to refinery. +# When submitting this job for production, you should +# override this to point directly at a deployed +# directory name, and not the 'symbolic' 'current' directory. +# E.g. /wmf/refinery/2015-01-05T17.59.18Z--7bb7f07 +refinery_directory= ${name_node}/wmf/refinery/current + +# HDFS path to artifacts that will be used by this job. +# E.g. refinery-job.jar should exist here. +artifacts_directory = ${refinery_directory}/artifacts + +# Base path in HDFS to oozie files. +# Other files will be used relative to this path. +oozie_directory = ${refinery_directory}/oozie + +# These are required properties. +spark_app_jar=
[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Introduce a userscripts directory
Huji has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378734 ) Change subject: Introduce a userscripts directory .. Introduce a userscripts directory Bug: T176147 Change-Id: Ia9fc57243f5b66b20b00911f373c916d79945ceb --- A userscripts/__init__.py 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/34/378734/1 diff --git a/userscripts/__init__.py b/userscripts/__init__.py new file mode 100644 index 000..02a8c63 --- /dev/null +++ b/userscripts/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +"""THIS DIRECTORY IS TO HOLD USER-DEFINED BOT SCRIPTS.""" -- To view, visit https://gerrit.wikimedia.org/r/378734 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9fc57243f5b66b20b00911f373c916d79945ceb Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Huji___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Pass root job params through WikiPageUpdater
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/375819 ) Change subject: Pass root job params through WikiPageUpdater .. Pass root job params through WikiPageUpdater Root job timestamps help with deduplication. Bug: T173710 Change-Id: I566d2253080a0e8fb74526f33763d23f7ecdadcf --- M client/includes/ChangeNotificationJob.php M client/includes/Changes/ChangeHandler.php M client/includes/Changes/InjectRCRecordsJob.php M client/includes/Changes/PageUpdater.php M client/includes/Changes/WikiPageUpdater.php M client/tests/phpunit/includes/Changes/ChangeHandlerTest.php M client/tests/phpunit/includes/Changes/InjectRCRecordsJobTest.php M client/tests/phpunit/includes/Changes/MockPageUpdater.php M client/tests/phpunit/includes/Changes/WikiPageUpdaterTest.php M docs/hooks.txt M repo/includes/Notifications/JobQueueChangeNotificationSender.php M repo/tests/phpunit/includes/Notifications/JobQueueChangeNotificationSenderTest.php 12 files changed, 360 insertions(+), 68 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/client/includes/ChangeNotificationJob.php b/client/includes/ChangeNotificationJob.php index 3822471..2a4fe72 100644 --- a/client/includes/ChangeNotificationJob.php +++ b/client/includes/ChangeNotificationJob.php @@ -96,7 +96,7 @@ $changes = $this->getChanges(); $changeHandler = $this->getChangeHandler(); - $changeHandler->handleChanges( $changes ); + $changeHandler->handleChanges( $changes, $this->getRootJobParams() ); if ( $changes ) { /* @var EntityChange $last */ diff --git a/client/includes/Changes/ChangeHandler.php b/client/includes/Changes/ChangeHandler.php index 8d8046d..4ce3e10 100644 --- a/client/includes/Changes/ChangeHandler.php +++ b/client/includes/Changes/ChangeHandler.php @@ -75,20 +75,21 @@ /** * @param EntityChange[] $changes +* @param array $rootJobParams any relevant root job parameters to be inherited by new jobs. */ - public function handleChanges( array $changes ) { + public function handleChanges( array $changes, array $rootJobParams = [] ) { $changes = $this->changeRunCoalescer->transformChangeList( $changes ); - if ( !Hooks::run( 'WikibaseHandleChanges', [ $changes ] ) ) { + if ( !Hooks::run( 'WikibaseHandleChanges', [ $changes, $rootJobParams ] ) ) { return; } foreach ( $changes as $change ) { - if ( !Hooks::run( 'WikibaseHandleChange', [ $change ] ) ) { + if ( !Hooks::run( 'WikibaseHandleChange', [ $change, $rootJobParams ] ) ) { continue; } - $this->handleChange( $change ); + $this->handleChange( $change, $rootJobParams ); } } @@ -98,10 +99,9 @@ * @todo: process multiple changes at once! * * @param EntityChange $change -* -* @throws MWException +* @param array $rootJobParams any relevant root job parameters to be inherited by new jobs. */ - public function handleChange( EntityChange $change ) { + public function handleChange( EntityChange $change, array $rootJobParams = [] ) { $changeId = $this->getChangeIdForLog( $change ); wfDebugLog( __CLASS__, __FUNCTION__ . ": handling change #$changeId" . ' (' . $change->getType() . ')' ); @@ -116,10 +116,67 @@ ( new LinkBatch( $titlesToUpdate ) )->execute(); - $this->updater->purgeWebCache( $titlesToUpdate ); - $this->updater->scheduleRefreshLinks( $titlesToUpdate ); - $this->updater->injectRCRecords( $titlesToUpdate, $change ); - // TODO: inject dummy revisions + // NOTE: deduplicate + $titleBatchSignature = $this->getTitleBatchSignature( $titlesToUpdate ); + $rootJobParams['rootJobSignature'] = $titleBatchSignature; + + if ( !isset( $rootJobParams['rootJobTimestamp'] ) ) { + $rootJobParams['rootJobTimestamp'] = wfTimestampNow(); + } + + $this->updater->purgeWebCache( $titlesToUpdate, $rootJobParams ); + $this->updater->scheduleRefreshLinks( $titlesToUpdate, $rootJobParams ); + + // NOTE: signature depends on change ID, effectively disabling deduplication + $changeSignature = $this->getChangeSignature( $change ); + $rootJobParams['rootJobSignature'] = $titleBatchSignature . '&' . $changeSignature; + $this->updater->injectRCRecords( $titlesToUpdate,
[MediaWiki-commits] [Gerrit] labs...heritage[master]: Use isort to sort imports
Jean-Frédéric has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378741 ) Change subject: Use isort to sort imports .. Use isort to sort imports isort is a Python utility to sort imports alphabetically, and automatically separated into sections. This adds to `setup.cfg` an isort config closely mimicking our current conventions (cf `multi_line_output`), and updates the entire codebase. Change-Id: Id37f2e645db0c93951916410f0fbd34fee0b62be --- M bin/deploy_message_from_git_log.py M erfgoedbot/add_coord_to_articles.py M erfgoedbot/add_object_location_monuments.py M erfgoedbot/categorize_images.py M erfgoedbot/converters.py M erfgoedbot/database_connection.py M erfgoedbot/fill_table_monuments_all.py M erfgoedbot/images_of_monuments_without_id.py M erfgoedbot/missing_commonscat_links.py M erfgoedbot/monument_tables.py M erfgoedbot/monuments_config.py M erfgoedbot/populate_image_table.py M erfgoedbot/unused_monument_images.py M erfgoedbot/update_database.py M erfgoedbot/update_id_dump.py M setup.cfg M tests/test_categorization.py M tests/test_checkers.py M tests/test_common.py M tests/test_converters.py M tests/test_database_connection.py M tests/test_database_statistics.py M tests/test_fill_table.py M tests/test_monument_tables.py M tests/test_monuments_config.py M tests/test_populate_image_table.py M tests/test_update_database.py 27 files changed, 72 insertions(+), 48 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage refs/changes/41/378741/1 diff --git a/bin/deploy_message_from_git_log.py b/bin/deploy_message_from_git_log.py index fa609d4..8e6c8de 100644 --- a/bin/deploy_message_from_git_log.py +++ b/bin/deploy_message_from_git_log.py @@ -4,7 +4,6 @@ import re import subprocess - GIT_COMMIT_FIELDS = ['id', 'message'] GIT_LOG_FORMAT_FIELDS = ['%h', '%b'] GIT_LOG_FORMAT = '%x1f'.join(GIT_LOG_FORMAT_FIELDS) + '%x1e' diff --git a/erfgoedbot/add_coord_to_articles.py b/erfgoedbot/add_coord_to_articles.py index 5a9950e..b6356f0 100644 --- a/erfgoedbot/add_coord_to_articles.py +++ b/erfgoedbot/add_coord_to_articles.py @@ -19,12 +19,12 @@ import pywikibot -import monuments_config as mconfig import common as common +import monuments_config as mconfig from database_connection import ( close_database_connection, -connect_to_monuments_database, -connect_to_commons_database +connect_to_commons_database, +connect_to_monuments_database ) # coordinate templates for different language wikipedias diff --git a/erfgoedbot/add_object_location_monuments.py b/erfgoedbot/add_object_location_monuments.py index 1ffc23f..c8a18d8 100644 --- a/erfgoedbot/add_object_location_monuments.py +++ b/erfgoedbot/add_object_location_monuments.py @@ -11,8 +11,8 @@ import monuments_config as mconfig from database_connection import ( close_database_connection, -connect_to_monuments_database, -connect_to_commons_database +connect_to_commons_database, +connect_to_monuments_database ) diff --git a/erfgoedbot/categorize_images.py b/erfgoedbot/categorize_images.py index 1705d56..23c05d7 100644 --- a/erfgoedbot/categorize_images.py +++ b/erfgoedbot/categorize_images.py @@ -20,11 +20,10 @@ import os import pywikibot -from pywikibot import pagegenerators -from pywikibot import textlib +from pywikibot import pagegenerators, textlib -import monuments_config as mconfig import common as common +import monuments_config as mconfig from database_connection import ( close_database_connection, connect_to_monuments_database diff --git a/erfgoedbot/converters.py b/erfgoedbot/converters.py index 92abc44..6747319 100644 --- a/erfgoedbot/converters.py +++ b/erfgoedbot/converters.py @@ -4,6 +4,7 @@ """Conversion methods""" import re + from checkers import is_int diff --git a/erfgoedbot/database_connection.py b/erfgoedbot/database_connection.py index 741b061..1438e8a 100644 --- a/erfgoedbot/database_connection.py +++ b/erfgoedbot/database_connection.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import os + import MySQLdb import yaml diff --git a/erfgoedbot/fill_table_monuments_all.py b/erfgoedbot/fill_table_monuments_all.py index 4193478..41d577a 100644 --- a/erfgoedbot/fill_table_monuments_all.py +++ b/erfgoedbot/fill_table_monuments_all.py @@ -2,9 +2,11 @@ # -*- coding: utf-8 -*- """Create the fill_table_monuments_all SQL.""" from __future__ import unicode_literals -import os + import json +import os from collections import OrderedDict + import pywikibot diff --git a/erfgoedbot/images_of_monuments_without_id.py b/erfgoedbot/images_of_monuments_without_id.py index 5413ea1..62189bf 100644 --- a/erfgoedbot/images_of_monuments_without_id.py +++ b/erfgoedbot/images_of_monuments_without_id.py @@ -18,8 +18,8 @@ import monuments_config as mconfig from database_connection import ( close_database_connection, -
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Create a 'patroller' user group at Meta-Wiki
MarcoAurelio has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378695 ) Change subject: Create a 'patroller' user group at Meta-Wiki .. Create a 'patroller' user group at Meta-Wiki - Added rights: autopatrol, patrol, patrolmarks and rollback. - Granted and removed by administrators Bug: T176079 Change-Id: Iac8ec9e0f535b95d4be3f14b2e871dc48b3a425a --- M wmf-config/InitialiseSettings.php 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/95/378695/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index f96d715..ef80d63 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -8907,6 +8907,12 @@ 'oauthadmin' => [ // T142123 'autopatrol' => true, ], + 'patroller' => [ //T176079 + 'autopatrol' => true, + 'patrol' => true, + 'patrolmarks' => true, + 'rollback' => true, + ], 'steward' => [ 'centralauth-rename' => true, 'userrights-interwiki' => true, @@ -10116,7 +10122,7 @@ ], '+metawiki' => [ 'bureaucrat' => [ 'centralnoticeadmin', 'flood', 'uploader', 'translationadmin' ], // T48639, T110674 - 'sysop' => [ 'autopatrolled', 'massmessage-sender' ], // T59611 + 'sysop' => [ 'autopatrolled', 'massmessage-sender', 'patroller' ], // T59611, T176079 ], '+mkwiki' => [ 'bureaucrat' => [ 'patroller', 'autopatrolled', 'autoreviewed' ], @@ -10871,7 +10877,7 @@ ], '+metawiki' => [ 'bureaucrat' => [ 'flood', 'translationadmin', 'centralnoticeadmin', 'uploader' ], // T39198, T52287, T110674 - 'sysop' => [ 'autopatrolled', 'massmessage-sender' ], // T59611 + 'sysop' => [ 'autopatrolled', 'massmessage-sender', 'patroller' ], // T59611, T176079 ], '+mkwiki' => [ 'bureaucrat' => [ 'patroller', 'autopatrolled', 'autoreviewed' ], -- To view, visit https://gerrit.wikimedia.org/r/378695 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac8ec9e0f535b95d4be3f14b2e871dc48b3a425a Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MarcoAurelio___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: prometheus: add nginx_cache_text cluster definition
Ema has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378705 ) Change subject: prometheus: add nginx_cache_text cluster definition .. prometheus: add nginx_cache_text cluster definition Change-Id: Id30c3294a17b5b56383768ee3f58dc42c8d947e0 --- M modules/role/manifests/prometheus/ops.pp 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/05/378705/1 diff --git a/modules/role/manifests/prometheus/ops.pp b/modules/role/manifests/prometheus/ops.pp index 756341a..a1b8b8d 100644 --- a/modules/role/manifests/prometheus/ops.pp +++ b/modules/role/manifests/prometheus/ops.pp @@ -448,6 +448,16 @@ }, } +prometheus::cluster_config{ "nginx_cache_text_${::site}": +dest=> "${targets_path}/nginx_cache_text_${::site}.yaml", +site=> $::site, +cluster => 'cache_text', +port=> 9145, +labels => { +'cluster' => 'cache_text' +}, +} + prometheus::cluster_config{ "nginx_thumbor_${::site}": dest=> "${targets_path}/nginx_thumbor_${::site}.yaml", site=> $::site, -- To view, visit https://gerrit.wikimedia.org/r/378705 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id30c3294a17b5b56383768ee3f58dc42c8d947e0 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] mediawiki...WikibaseLexeme[master]: Move API-class-related unit tests not depending on MediaWiki...
WMDE-leszek has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378722 ) Change subject: Move API-class-related unit tests not depending on MediaWiki to appropriate subdir .. Move API-class-related unit tests not depending on MediaWiki to appropriate subdir Change-Id: I93d66f522b8fced202d9c6ab6552f70fde3ea1e1 --- R tests/phpunit/composer/Api/AddFormRequestParserTest.php R tests/phpunit/composer/Api/AddFormRequestTest.php 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme refs/changes/22/378722/1 diff --git a/tests/phpunit/mediawiki/Api/AddFormRequestParserTest.php b/tests/phpunit/composer/Api/AddFormRequestParserTest.php similarity index 98% rename from tests/phpunit/mediawiki/Api/AddFormRequestParserTest.php rename to tests/phpunit/composer/Api/AddFormRequestParserTest.php index 9f44cb7..7b579aa 100644 --- a/tests/phpunit/mediawiki/Api/AddFormRequestParserTest.php +++ b/tests/phpunit/composer/Api/AddFormRequestParserTest.php @@ -1,6 +1,6 @@ https://gerrit.wikimedia.org/r/378722 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93d66f522b8fced202d9c6ab6552f70fde3ea1e1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseLexeme Gerrit-Branch: master Gerrit-Owner: WMDE-leszek___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Add TermList (lemmaList) shrinking
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378414 ) Change subject: Add TermList (lemmaList) shrinking .. Add TermList (lemmaList) shrinking Change-Id: I5a3e09b2393fb2e4f4239efee90be3de6c79cfbb --- A tests/phpunit/composer/ErisGenerators/CartesianProduct.php A tests/phpunit/composer/ErisGenerators/CartesianProductTest.php M tests/phpunit/composer/ErisGenerators/LexemeGenerator.php M tests/phpunit/composer/ErisGenerators/TermListGenerator.php 4 files changed, 317 insertions(+), 5 deletions(-) Approvals: WMDE-leszek: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/composer/ErisGenerators/CartesianProduct.php b/tests/phpunit/composer/ErisGenerators/CartesianProduct.php new file mode 100644 index 000..aa6930d --- /dev/null +++ b/tests/phpunit/composer/ErisGenerators/CartesianProduct.php @@ -0,0 +1,116 @@ +generatedValues = $generatedValues; + } + + public function map( callable $fn, $generatorName = 'CartesianProduct' ) { + $result = $this->combine( $generatorName ); + + return $result->map( + function ( array $args ) use ( $fn ) { + return call_user_func_array( $fn, $args ); + }, + $generatorName + ); + } + + /** +* @param $generatorName +* +* @return GeneratedValueOptions +*/ + private function combine( $generatorName ) { + if ( count( $this->generatedValues ) === 1 ) { + return $this->generatedValues[0]->map( + function ( $v ) { + return [ $v ]; + }, + $generatorName + ); + } + + $result = $this->cartesianProduct( + $this->generatedValues[0], + $this->generatedValues[1], + $generatorName, + function ( $v1, $v2 ) { + return [ $v1, $v2 ]; + } + ); + + $valuesCount = count( $this->generatedValues ); + for ( $i = 2; $i < $valuesCount; $i++ ) { + $result = $this->cartesianProduct( + $result, + $this->generatedValues[$i], + $generatorName, + function ( array $args, $value ) { + $args[] = $value; + return $args; + } + ); + } + + return $result; + } + + private function cartesianProduct( + GeneratedValueOptions $v1, + GeneratedValueOptions $v2, + $generatorName, + callable $merge + ) { + $options = []; + foreach ( $v1 as $firstPart ) { + foreach ( $v2 as $secondPart ) { + $options[] = GeneratedValueSingle::fromValueAndInput( + $merge( $firstPart->unbox(), $secondPart->unbox() ), + $merge( $firstPart->input(), $secondPart->input() ), + $generatorName + ); + } + } + return new GeneratedValueOptions( $options ); + } + +} diff --git a/tests/phpunit/composer/ErisGenerators/CartesianProductTest.php b/tests/phpunit/composer/ErisGenerators/CartesianProductTest.php new file mode 100644 index 000..3bde892 --- /dev/null +++ b/tests/phpunit/composer/ErisGenerators/CartesianProductTest.php @@ -0,0 +1,161 @@ +skipTestIfErisIsNotInstalled(); + + $opt1 = $this->createOptionsWithSingleValue( 1 ); + + /** @var GeneratedValueOptions $result */ + $result = CartesianProduct::create( $opt1 ) + ->map( + function ( $n1 ) { + return $n1; + } + ); + + $this->assertEquals( 1, $result->count() ); + $this->assertEquals( 1, $result->first()->unbox() ); + } + + public function testCanHandleTwoGeneratedValueOptions() { + $this->skipTestIfErisIsNotInstalled(); + + $opt1 = $this->createOptionsWithSingleValue( 1 ); + $opt2 = $this->createOptionsWithSingleValue( 2 ); + + /** @var GeneratedValueOptions $result */ + $result = CartesianProduct::create( $opt1, $opt2 ) +
[MediaWiki-commits] [Gerrit] mediawiki...ContentTranslation[master]: Wrap translated sections in cxSection nodes
Esanders has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378728 ) Change subject: Wrap translated sections in cxSection nodes .. Wrap translated sections in cxSection nodes Without these it's impossible to keep sections aligned. Change-Id: I9497b9e3cd4d87ef549cf863d738073e7f8f2da5 --- M extension.json M modules/dm/mw.cx.dm.Translation.js M modules/ui/mw.cx.ui.TranslationView.js A modules/ve-cx/ce/styles/ve.ce.CXSectionNode.css M modules/ve-cx/ce/ve.ce.CXPlaceholderNode.js M modules/ve-cx/ce/ve.ce.CXSectionNode.js M modules/ve-cx/dm/ve.dm.CXPlaceholderNode.js M modules/ve-cx/dm/ve.dm.CXSectionNode.js 8 files changed, 58 insertions(+), 28 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/28/378728/1 diff --git a/extension.json b/extension.json index f459880..4ae2c1b 100644 --- a/extension.json +++ b/extension.json @@ -1269,6 +1269,7 @@ ], "styles": [ "ve-cx/ce/styles/ve.ce.CXPlaceholderNode.less", + "ve-cx/ce/styles/ve.ce.CXSectionNode.css", "ve-cx/ui/styles/ve.ui.CXSurface.css" ], "messages": [ diff --git a/modules/dm/mw.cx.dm.Translation.js b/modules/dm/mw.cx.dm.Translation.js index 4f1e176..288fd29 100644 --- a/modules/dm/mw.cx.dm.Translation.js +++ b/modules/dm/mw.cx.dm.Translation.js @@ -83,7 +83,8 @@ return; } sectionNode = domDoc.createElement( 'section' ); - sectionNode.id = sectionIdPrefix + nextSectionId++; + sectionNode.setAttribute( 'id', sectionIdPrefix + nextSectionId ); + nextSectionId++; domDoc.body.replaceChild( sectionNode, node ); if ( forTarget ) { sectionNode.setAttribute( 'rel', 'cx:Placeholder' ); diff --git a/modules/ui/mw.cx.ui.TranslationView.js b/modules/ui/mw.cx.ui.TranslationView.js index b346089..1a1bdc5 100644 --- a/modules/ui/mw.cx.ui.TranslationView.js +++ b/modules/ui/mw.cx.ui.TranslationView.js @@ -76,7 +76,7 @@ * @param {number} sectionNumber The number in the source/target section id attribute */ mw.cx.ui.TranslationView.static.alignSectionPair = function ( sourceOffsetTop, targetOffsetTop, sectionNumber ) { - var offsetTop, + var offsetTop, viewNode, sourceNode = document.getElementById( 'cxSourceSection' + sectionNumber ), targetNode = document.getElementById( 'cxTargetSection' + sectionNumber ); @@ -86,6 +86,7 @@ if ( !sourceNode || !targetNode ) { return; } + viewNode = $.data( targetNode, 'view' ); sourceNode.style.marginTop = ''; targetNode.style.marginTop = ''; targetNode.style.height = ''; @@ -95,7 +96,7 @@ ); sourceNode.style.marginTop = ( offsetTop - sourceOffsetTop - sourceNode.offsetTop ) + 'px'; targetNode.style.marginTop = ( offsetTop - targetOffsetTop - targetNode.offsetTop ) + 'px'; - if ( isSubclass( $.data( targetNode, 'view' ), ve.ce.CXPlaceholderNode ) ) { + if ( isSubclass( viewNode, ve.ce.CXPlaceholderNode ) || isSubclass( viewNode, ve.ce.CXSectionNode ) ) { if ( sourceNode.offsetHeight > targetNode.offsetHeight ) { targetNode.style.height = sourceNode.offsetHeight + 'px'; } @@ -284,7 +285,7 @@ mw.cx.ui.TranslationView.prototype.onDocumentActivatePlaceholder = function ( placeholder ) { var sourceModel, sourceNode, - cxid = placeholder.model.getAttribute( 'cxid' ), + cxid = placeholder.getModel().getAttribute( 'cxid' ), sectionNumber = parseInt( cxid.match( /^cxTargetSection([0-9]+)$/ )[ 1 ], 10 ), sourceId = 'cxSourceSection' + sectionNumber, targetId = 'cxTargetSection' + sectionNumber; @@ -351,31 +352,28 @@ }; mw.cx.ui.TranslationView.prototype.gotPlaceholderTranslation = function ( placeholder, data ) { - var pasteDoc, tx1, tx2, firstOffset, docLen, + var pasteDoc, newCursorRange, docLen, fragmentRange, modelSurface = this.getSurface().getModel(), - doc = modelSurface.documentModel, - pRange = placeholder.getModel().getOuterRange(); + cxid = placeholder.getModel().getAttribute( 'cxid' ), + fragment = modelSurface.getLinearFragment( placeholder.getModel().getOuterRange() ); pasteDoc = ve.dm.converter.getModelFromDom( ve.createDocumentFromHtml( data ) ); docLen = pasteDoc.getInternalList().getListNode().getOuterRange().start; - tx1 = ve.dm.TransactionBuilder.static.newFromRemoval( doc, pRange ); - tx2 =
[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Consistently use the message when updating count
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/375482 ) Change subject: Consistently use the message when updating count .. Consistently use the message when updating count The current initial message in the button label is "Alerts (x)" or "Notices (x)" but when the badge loaded, we changed that to only show the rendered number. This is inconsistent; the badge should always update the label properly, even if it's not visible in most cases. Bug: T173970 Change-Id: I6a5e13fc36ddb1bf467c712fcf49af3b18e582d0 --- M modules/ext.echo.init.js M modules/ui/mw.echo.ui.BadgeLinkWidget.js M modules/ui/mw.echo.ui.NotificationBadgeWidget.js 3 files changed, 19 insertions(+), 11 deletions(-) Approvals: Sbisson: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ext.echo.init.js b/modules/ext.echo.init.js index b4b82f9..b5e0962 100644 --- a/modules/ext.echo.init.js +++ b/modules/ext.echo.init.js @@ -76,7 +76,7 @@ numItems: Number( numMessages ), hasUnseen: hasUnseenMessages, badgeIcon: 'tray', - badgeLabel: badgeLabelMessages, + convertedNumber: badgeLabelMessages, links: links, href: $existingMessageLink.attr( 'href' ) } @@ -93,7 +93,7 @@ alertModelManager, { numItems: Number( numAlerts ), - badgeLabel: badgeLabelAlerts, + convertedNumber: badgeLabelAlerts, hasUnseen: hasUnseenAlerts, badgeIcon: 'bell', links: links, diff --git a/modules/ui/mw.echo.ui.BadgeLinkWidget.js b/modules/ui/mw.echo.ui.BadgeLinkWidget.js index dc59e09..8339e6b 100644 --- a/modules/ui/mw.echo.ui.BadgeLinkWidget.js +++ b/modules/ui/mw.echo.ui.BadgeLinkWidget.js @@ -10,6 +10,7 @@ * @cfg {string} [type] The notification types this button represents; * 'message', 'alert' or 'all' * @cfg {string} [href] URL the badge links to +* @cfg {string} [convertedNumber] A converted version of the initial count */ mw.echo.ui.BadgeLinkWidget = function MwEchoUiBadgeLinkWidget( config ) { config = config || {}; @@ -28,7 +29,7 @@ this.count = 0; this.type = config.type || 'alert'; - this.setCount( config.numItems, config.label ); + this.setCount( config.numItems, config.convertedNumber ); if ( config.href !== undefined && OO.ui.isSafeUrl( config.href ) ) { this.$element.attr( 'href', config.href ); @@ -47,22 +48,30 @@ * Set the count labels for this button. * * @param {number} numItems Number of items -* @param {string} [label] Label of the button. Defaults to the item number. +* @param {string} [convertedNumber] Label of the button. Defaults to the default message +* showing the item number. */ - mw.echo.ui.BadgeLinkWidget.prototype.setCount = function ( numItems, label ) { - label = label || numItems; + mw.echo.ui.BadgeLinkWidget.prototype.setCount = function ( numItems, convertedNumber ) { + convertedNumber = convertedNumber !== undefined ? convertedNumber : numItems; this.$element .toggleClass( 'mw-echo-notifications-badge-all-read', !numItems ) - .toggleClass( 'mw-echo-notifications-badge-long-label', label.length > 2 ) + .toggleClass( 'mw-echo-notifications-badge-long-label', convertedNumber.length > 2 ) .attr( 'data-counter-num', numItems ) - .attr( 'data-counter-text', label ); + .attr( 'data-counter-text', convertedNumber ); + + this.setLabel( mw.msg( + this.type === 'alert' ? + 'echo-notification-alert' : + 'echo-notification-notice', + convertedNumber + ) ); if ( this.count !== numItems ) { this.count = numItems; // Fire badge count change hook - mw.hook(
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: DesktopArticleTarget: Support preloadtitle in source mode
DLynch has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378726 ) Change subject: DesktopArticleTarget: Support preloadtitle in source mode .. DesktopArticleTarget: Support preloadtitle in source mode Can't support it in visual mode, since there's no new-section handling at all. Bug: T51622 Change-Id: I763d5fff156e9ef3893bd882fab1dc2d47121728 --- M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/26/378726/1 diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index bab1f98..8817de7 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -494,6 +494,7 @@ * @param {ve.ui.Surface} surface Surface */ ve.init.mw.DesktopArticleTarget.prototype.setupNewSection = function ( surface ) { + var uri; if ( surface.getMode() === 'source' && this.section === 'new' ) { if ( !this.sectionTitle ) { this.sectionTitle = new OO.ui.TextInputWidget( { @@ -506,6 +507,11 @@ } surface.setPlaceholder( ve.msg( 'visualeditor-section-body-placeholder' ) ); this.$editableContent.before( this.sectionTitle.$element ); + + uri = new mw.Uri(); + if ( uri.query.preloadtitle ) { + this.sectionTitle.setValue( uri.query.preloadtitle ); + } } }; -- To view, visit https://gerrit.wikimedia.org/r/378726 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I763d5fff156e9ef3893bd882fab1dc2d47121728 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: DLynch___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Simplify Eris usage in tests
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378421 ) Change subject: Simplify Eris usage in tests .. Simplify Eris usage in tests Added ErisTest trait that controls correct setUp and tearDown Change-Id: Ib43a6812e3efb02b1cfff0d7144f0bc94b0704ae --- M tests/phpunit/composer/DataModel/Services/Diff/FormDifferPatcherTest.php M tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferPatcherTest.php M tests/phpunit/composer/ErisGenerators/CartesianProductTest.php A tests/phpunit/composer/ErisGenerators/ErisTest.php A tests/phpunit/composer/ErisGenerators/PHPUnitTestCaseWrapper.php 5 files changed, 129 insertions(+), 37 deletions(-) Approvals: WMDE-leszek: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/composer/DataModel/Services/Diff/FormDifferPatcherTest.php b/tests/phpunit/composer/DataModel/Services/Diff/FormDifferPatcherTest.php index 4443d8c..45205cc 100644 --- a/tests/phpunit/composer/DataModel/Services/Diff/FormDifferPatcherTest.php +++ b/tests/phpunit/composer/DataModel/Services/Diff/FormDifferPatcherTest.php @@ -2,7 +2,6 @@ namespace Wikibase\Lexeme\Tests\DataModel\Services\Diff; -use Eris\Facade; use Wikibase\DataModel\Entity\ItemId; use Wikibase\DataModel\Entity\PropertyId; use Wikibase\DataModel\Snak\PropertySomeValueSnak; @@ -12,25 +11,22 @@ use Wikibase\Lexeme\DataModel\Services\Diff\FormDiffer; use Wikibase\Lexeme\DataModel\Services\Diff\FormPatcher; use Wikibase\Lexeme\Tests\DataModel\NewForm; +use Wikibase\Lexeme\Tests\ErisGenerators\ErisTest; use Wikibase\Lexeme\Tests\ErisGenerators\WikibaseLexemeGenerators; class FormDifferPatcherTest extends \PHPUnit_Framework_TestCase { - public function testProperty_PatchingLexemeWithGeneratedDiffAlwaysRestoresItToTheTargetState() { - if ( !class_exists( Facade::class ) ) { - $this->markTestSkipped( 'Package `giorgiosironi/eris` is not installed. Skipping' ); - } + use ErisTest; + public function testProperty_PatchingLexemeWithGeneratedDiffAlwaysRestoresItToTheTargetState() { $differ = new FormDiffer(); $patcher = new FormPatcher(); - //Lines below is needed to reproduce failures. In case of failure seed will be in the output - //$seed = 1504876177284329; - //putenv("ERIS_SEED=$seed"); + //Line below is needed to reproduce failures. In case of failure seed will be in the output + //$this->eris()->seed(1504876177284329)->forAll( ... - $eris = new Facade(); - - $eris->forAll( + $this->eris() + ->forAll( WikibaseLexemeGenerators::form( new FormId( 'F1' ) ), WikibaseLexemeGenerators::form( new FormId( 'F1' ) ) ) diff --git a/tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferPatcherTest.php b/tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferPatcherTest.php index 0b7e26e..d500d3b 100644 --- a/tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferPatcherTest.php +++ b/tests/phpunit/composer/DataModel/Services/Diff/LexemeDifferPatcherTest.php @@ -2,14 +2,12 @@ namespace Wikibase\Lexeme\Tests\DataModel\Services\Diff; -use Wikibase\DataModel\Entity\ItemId; -use Wikibase\Lexeme\DataModel\Form; use Wikibase\Lexeme\DataModel\FormId; -use Eris\Facade; use Wikibase\Lexeme\DataModel\Lexeme; use Wikibase\Lexeme\DataModel\LexemeId; use Wikibase\Lexeme\DataModel\Services\Diff\LexemeDiffer; use Wikibase\Lexeme\DataModel\Services\Diff\LexemePatcher; +use Wikibase\Lexeme\Tests\ErisGenerators\ErisTest; use Wikibase\Lexeme\Tests\ErisGenerators\WikibaseLexemeGenerators; use Wikibase\Lexeme\Tests\DataModel\NewForm; use Wikibase\Lexeme\Tests\DataModel\NewLexeme; @@ -24,21 +22,17 @@ */ class LexemeDifferPatcherTest extends \PHPUnit_Framework_TestCase { - public function testProperty_PatchingLexemeWithGeneratedDiffAlwaysRestoresItToTheTargetState() { - if ( !class_exists( Facade::class ) ) { - $this->markTestSkipped( 'Package `giorgiosironi/eris` is not installed. Skipping' ); - } + use ErisTest; + public function testProperty_PatchingLexemeWithGeneratedDiffAlwaysRestoresItToTheTargetState() { $differ = new LexemeDiffer(); $patcher = new LexemePatcher(); - //Lines below is needed to reproduce failures. In case of failure seed will be in the output - //$seed = 1504876177284329; - //putenv("ERIS_SEED=$seed"); + //Line below is needed to reproduce failures. In case of failure seed will be in the output + //$this->eris()->seed(1504876177284329)->forAll( ... - $eris = new
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Revert "VCL: fixed keep values: 7d def, 1d for text"
Hello Ema, jenkins-bot, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/378731 to review the following change. Change subject: Revert "VCL: fixed keep values: 7d def, 1d for text" .. Revert "VCL: fixed keep values: 7d def, 1d for text" This reverts commit ce14f15509071057c9d8826ae00df2b899275bda. Change-Id: I1e890c99032c102b53fe5e487c3d60a5f3b2c757 --- M modules/role/manifests/cache/text.pp M modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb 2 files changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/31/378731/1 diff --git a/modules/role/manifests/cache/text.pp b/modules/role/manifests/cache/text.pp index 584203b..a29b732 100644 --- a/modules/role/manifests/cache/text.pp +++ b/modules/role/manifests/cache/text.pp @@ -44,7 +44,6 @@ 'shortener_domain' => $shortener_domain, 'pass_random' => true, 'req_handling' => hiera('cache::req_handling'), -'keep' => '1d', } $be_vcl_config = $common_vcl_config diff --git a/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb b/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb index 6400886..eb5c727 100644 --- a/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb +++ b/modules/varnish/templates/vcl/wikimedia-common.inc.vcl.erb @@ -383,10 +383,15 @@ set beresp.ttl = 10m; } - // For valid positive-TTL objects: + // Set keep, which influences the amount of time objects are kept available + // in cache for IMS requests (TTL+grace+keep). Scale keep to the app-provided + // TTL. if (beresp.ttl > 0s) { - // Set fixed keep values (def 7d) regardless of TTLs - set beresp.keep = <%= @vcl_config.fetch("keep", "7d") %>; + if (beresp.ttl < <%= @vcl_config.fetch("keep", "7d") %>) { + set beresp.keep = beresp.ttl; + } else { + set beresp.keep = <%= @vcl_config.fetch("keep", "7d") %>; + } // Hard TTL cap on all fetched objects (default 1d) if (beresp.ttl > <%= @vcl_config.fetch("ttl_cap", "1d") %>) { -- To view, visit https://gerrit.wikimedia.org/r/378731 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e890c99032c102b53fe5e487c3d60a5f3b2c757 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlackGerrit-Reviewer: Ema Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix: make sure page contents are deleted from disk when dele...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378715 ) Change subject: Fix: make sure page contents are deleted from disk when deleting from list. .. Fix: make sure page contents are deleted from disk when deleting from list. Bug: T164585 Change-Id: Iba700494e2870d07aafb74a503aaeaffb0363a6f --- M app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java M app/src/main/java/org/wikipedia/savedpages/SavedPageSyncService.java 2 files changed, 8 insertions(+), 2 deletions(-) Approvals: jenkins-bot: Verified Mholloway: Looks good to me, approved diff --git a/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java b/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java index bdb67da..630bdde 100644 --- a/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java +++ b/app/src/main/java/org/wikipedia/readinglist/page/database/ReadingListPageDao.java @@ -95,11 +95,16 @@ }); } +public synchronized void deleteIfOrphaned(@NonNull ReadingListPageRow row) { +if (row.listKeys().isEmpty()) { +delete(row); +} +} + public synchronized void upsert(@NonNull ReadingListPage row) { if (row.listKeys().isEmpty()) { httpDao.markDeleted(new ReadingListPageHttpRow(row)); diskDao.markDeleted(new ReadingListPageDiskRow(row)); -delete(row); } else { httpDao.markUpserted(new ReadingListPageHttpRow(row)); if (row.diskStatus() == DiskStatus.OUTDATED) { @@ -107,8 +112,8 @@ } else if (row.diskStatus() == DiskStatus.ONLINE || row.diskStatus() == DiskStatus.UNSAVED) { diskDao.markOnline(new ReadingListPageDiskRow(row)); } -super.upsert(row); } +super.upsert(row); } public synchronized void markOutdated(@NonNull ReadingListPage row) { diff --git a/app/src/main/java/org/wikipedia/savedpages/SavedPageSyncService.java b/app/src/main/java/org/wikipedia/savedpages/SavedPageSyncService.java index 556273a..8d862d0 100644 --- a/app/src/main/java/org/wikipedia/savedpages/SavedPageSyncService.java +++ b/app/src/main/java/org/wikipedia/savedpages/SavedPageSyncService.java @@ -121,6 +121,7 @@ } cacheDelegate.remove(sectionsCall.request()); } +ReadingListPageDao.instance().deleteIfOrphaned(dat); } dao.completeDiskTransaction(row); } -- To view, visit https://gerrit.wikimedia.org/r/378715 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba700494e2870d07aafb74a503aaeaffb0363a6f Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: DbrantGerrit-Reviewer: Brion VIBBER Gerrit-Reviewer: Cooltey Gerrit-Reviewer: Mholloway Gerrit-Reviewer: Sharvaniharan Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Don't unconditionally run patch-editsummary-length.sql
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378638 ) Change subject: Don't unconditionally run patch-editsummary-length.sql .. Don't unconditionally run patch-editsummary-length.sql Bug: T176041 Change-Id: I165ee4fa1c0cfadf5f8f400a0ea9db220ed7dbbb --- M includes/installer/MysqlUpdater.php M maintenance/archives/patch-editsummary-length.sql 2 files changed, 24 insertions(+), 8 deletions(-) Approvals: Reedy: Looks good to me, but someone else must approve jenkins-bot: Verified Anomie: Looks good to me, approved diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 2abc6b6..e2ff960 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -267,7 +267,7 @@ // 1.25 // note this patch covers other _comment and _description fields too - [ 'modifyField', 'recentchanges', 'rc_comment', 'patch-editsummary-length.sql' ], + [ 'doExtendCommentLengths' ], // 1.26 [ 'dropTable', 'hitcounter' ], @@ -1181,6 +1181,22 @@ ); } + protected function doExtendCommentLengths() { + $table = $this->db->tableName( 'revision' ); + $res = $this->db->query( "SHOW COLUMNS FROM $table LIKE 'rev_comment'" ); + $row = $this->db->fetchObject( $res ); + + if ( $row && ( $row->Type !== "varbinary(767)" || $row->Default !== "" ) ) { + $this->applyPatch( + 'patch-editsummary-length.sql', + false, + 'Extending edit summary lengths (and setting defaults)' + ); + } else { + $this->output( '...comment fields are up to date' ); + } + } + public function getSchemaVars() { global $wgDBTableOptions; diff --git a/maintenance/archives/patch-editsummary-length.sql b/maintenance/archives/patch-editsummary-length.sql index c8ac1ad..996d562 100644 --- a/maintenance/archives/patch-editsummary-length.sql +++ b/maintenance/archives/patch-editsummary-length.sql @@ -1,11 +1,11 @@ -ALTER TABLE /*_*/revision MODIFY rev_comment varbinary(767) NOT NULL; -ALTER TABLE /*_*/archive MODIFY ar_comment varbinary(767) NOT NULL; -ALTER TABLE /*_*/image MODIFY img_description varbinary(767) NOT NULL; -ALTER TABLE /*_*/oldimage MODIFY oi_description varbinary(767) NOT NULL; -ALTER TABLE /*_*/filearchive MODIFY fa_description varbinary(767); +ALTER TABLE /*_*/revision MODIFY rev_comment varbinary(767) NOT NULL default ''; +ALTER TABLE /*_*/archive MODIFY ar_comment varbinary(767) NOT NULL default ''; +ALTER TABLE /*_*/image MODIFY img_description varbinary(767) NOT NULL default ''; +ALTER TABLE /*_*/oldimage MODIFY oi_description varbinary(767) NOT NULL default ''; +ALTER TABLE /*_*/filearchive MODIFY fa_description varbinary(767) default ''; ALTER TABLE /*_*/filearchive MODIFY fa_deleted_reason varbinary(767) default ''; ALTER TABLE /*_*/recentchanges MODIFY rc_comment varbinary(767) NOT NULL default ''; ALTER TABLE /*_*/logging MODIFY log_comment varbinary(767) NOT NULL default ''; -ALTER TABLE /*_*/ipblocks MODIFY ipb_reason varbinary(767) NOT NULL; -ALTER TABLE /*_*/protected_titles MODIFY pt_reason varbinary(767); +ALTER TABLE /*_*/ipblocks MODIFY ipb_reason varbinary(767) NOT NULL default ''; +ALTER TABLE /*_*/protected_titles MODIFY pt_reason varbinary(767) default ''; -- To view, visit https://gerrit.wikimedia.org/r/378638 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I165ee4fa1c0cfadf5f8f400a0ea9db220ed7dbbb Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: ReedyGerrit-Reviewer: Anomie Gerrit-Reviewer: Huji Gerrit-Reviewer: Jjanes Gerrit-Reviewer: Parent5446 Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Raise a new exception class when we get a page with namespac...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/367321 ) Change subject: Raise a new exception class when we get a page with namespace < 0 .. Raise a new exception class when we get a page with namespace < 0 This could be used to handle this error in scripts more properly Bug: T169213 Change-Id: Icb312829e575fa85c0c2d477f3e7cb904dd27bfb --- M pywikibot/__init__.py M pywikibot/data/api.py M pywikibot/exceptions.py 3 files changed, 19 insertions(+), 3 deletions(-) Approvals: Huji: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index e4000cc..348b596 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -53,7 +53,7 @@ SiteDefinitionError, NoSuchSite, UnknownSite, UnknownFamily, UnknownExtension, NoUsername, UserBlocked, -PageRelatedError, IsRedirectPage, IsNotRedirectPage, +PageRelatedError, UnsupportedPage, IsRedirectPage, IsNotRedirectPage, PageSaveRelatedError, PageNotSaved, OtherPageSaveError, LockedPage, CascadeLockedPage, LockedNoPage, NoCreateError, EditConflict, PageDeletedConflict, PageCreatedConflict, @@ -106,7 +106,8 @@ 'SiteDefinitionError', 'NoSuchSite', 'UnknownSite', 'UnknownFamily', 'UnknownExtension', 'NoUsername', 'UserBlocked', 'UserActionRefuse', -'PageRelatedError', 'IsRedirectPage', 'IsNotRedirectPage', +'PageRelatedError', 'UnsupportedPage', 'IsRedirectPage', +'IsNotRedirectPage', 'PageSaveRelatedError', 'PageNotSaved', 'OtherPageSaveError', 'LockedPage', 'CascadeLockedPage', 'LockedNoPage', 'NoCreateError', 'EditConflict', 'PageDeletedConflict', 'PageCreatedConflict', diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index 6dc86d6..a84db31 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -35,7 +35,7 @@ from pywikibot.comms import http from pywikibot.exceptions import ( Server504Error, Server414Error, FatalServerError, NoUsername, -Error, TimeoutError, InvalidTitle +Error, TimeoutError, InvalidTitle, UnsupportedPage ) from pywikibot.tools import ( MediaWikiVersion, deprecated, itergroup, ip, PY2, getargspec, @@ -3144,6 +3144,8 @@ property which would make the value present must be in the props parameter. @type props: iterable of string +@raises InvalidTitle: Page title is invalid +@raises UnsupportedPage: Page with namespace < 0 is not supported yet """ if "pageid" in pagedict: page._pageid = int(pagedict['pageid']) @@ -3154,6 +3156,8 @@ if page.site.sametitle(page.title(), pagedict['title']): if 'invalid' in pagedict: raise InvalidTitle('%s: %s' % (page, pagedict['invalidreason'])) +if int(pagedict['ns']) < 0: +raise UnsupportedPage(page) raise AssertionError( "Page %s has neither 'pageid' nor 'missing' attribute" % pagedict['title']) page._contentmodel = pagedict.get('contentmodel') # can be None diff --git a/pywikibot/exceptions.py b/pywikibot/exceptions.py index d9dff19..52018df 100644 --- a/pywikibot/exceptions.py +++ b/pywikibot/exceptions.py @@ -24,6 +24,7 @@ PageRelatedError: any exception which is caused by an operation on a Page. - NoPage: Page does not exist + - UnsupportedPage: Page is not supported due to a namespace restriction - IsRedirectPage: Page is a redirect page - IsNotRedirectPage: Page is not a redirect page - CircularRedirect: Page is a circular redirect @@ -227,6 +228,16 @@ pass +class UnsupportedPage(PageRelatedError): + +"""Unsupported page due to namespace restriction.""" + +# namespaces < 0 aren't supported (T169213) +message = 'Page %s is not supported due to namespace restriction.' + +pass + + class NoMoveTarget(PageRelatedError): """Expected move target page not found.""" -- To view, visit https://gerrit.wikimedia.org/r/367321 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb312829e575fa85c0c2d477f3e7cb904dd27bfb Gerrit-PatchSet: 5 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Dalba Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Huji Gerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Magul Gerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] performance/WebPageTest[master]: Collect LastInteractive = TTI
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378069 ) Change subject: Collect LastInteractive = TTI .. Collect LastInteractive = TTI Collect and send LastInteractive to Graphite. Bug: T115606 Change-Id: I250bfc5ba87d368615957a99237fd581062ca693 --- M lib/cli.js M lib/collectMetrics.js M test/collectMetricsTest.js 3 files changed, 7 insertions(+), 4 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/cli.js b/lib/cli.js index c35f2d0..56bd37c 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -22,7 +22,7 @@ // Not 100% sure it's the latest though. Test by logging the output from WebPageTest // Note: It can differ depending on what agent that runs the tests. // In the future we can add LastInteractive = TTI but it only works in Chrome -const DEFAULT_METRICS = 'SpeedIndex,render,TTFB,fullyLoaded,lastVisualChange,visualComplete95,visualComplete99'; +const DEFAULT_METRICS = 'SpeedIndex,render,TTFB,fullyLoaded,lastVisualChange,visualComplete95,visualComplete99,LastInteractive'; module.exports = { /** diff --git a/lib/collectMetrics.js b/lib/collectMetrics.js index aae2446..2a404e7 100644 --- a/lib/collectMetrics.js +++ b/lib/collectMetrics.js @@ -55,7 +55,10 @@ const keyStart = namespace + '.' + location + '.' + browser + '.' + view + '.'; metricsToCollect.forEach( function( metric ) { - metricsToSend.timings[ keyStart + metric ] = wptJson.data.median[ view ][ metric ]; + // We don't have all metrics for all browsers, for example LastInteractive + if ( wptJson.data.median[ view ][ metric ] ) { + metricsToSend.timings[ keyStart + metric ] = wptJson.data.median[ view ][ metric ]; + } } ); metricsToSend.misc[ keyStart + 'domElements' ] = diff --git a/test/collectMetricsTest.js b/test/collectMetricsTest.js index 41861aa..42f0e64 100644 --- a/test/collectMetricsTest.js +++ b/test/collectMetricsTest.js @@ -17,7 +17,7 @@ } ); // verify that we collect all the metrics that we want - [ 'SpeedIndex', 'render', 'TTFB', 'fullyLoaded', 'lastVisualChange', 'domElements', 'visualComplete95', 'visualComplete99' ].forEach( function( definedMetric ) { + [ 'SpeedIndex', 'render', 'TTFB', 'fullyLoaded', 'lastVisualChange', 'domElements', 'visualComplete95', 'visualComplete99', 'LastInteractive' ].forEach( function( definedMetric ) { let metricIncluded = false; Object.keys( metrics ).forEach( function( type ) { Object.keys( metrics[ type ] ).forEach( function( key ) { @@ -55,7 +55,7 @@ } ); // verify that we collect all the metrics that we want - [ 'SpeedIndex', 'render', 'TTFB', 'fullyLoaded', 'lastVisualChange', 'domElements', 'visualComplete95', 'visualComplete99' ].forEach( function( definedMetric ) { + [ 'SpeedIndex', 'render', 'TTFB', 'fullyLoaded', 'lastVisualChange', 'domElements', 'visualComplete95', 'visualComplete99', 'LastInteractive' ].forEach( function( definedMetric ) { let metricIncluded = false; Object.keys( metrics ).forEach( function( type ) { Object.keys( metrics[ type ] ).forEach( function( key ) { -- To view, visit https://gerrit.wikimedia.org/r/378069 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I250bfc5ba87d368615957a99237fd581062ca693 Gerrit-PatchSet: 1 Gerrit-Project: performance/WebPageTest Gerrit-Branch: master Gerrit-Owner: PhedenskogGerrit-Reviewer: Gilles Gerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: wmcs: Add wikireplica_dns management script
BryanDavis has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378739 ) Change subject: wmcs: Add wikireplica_dns management script .. wmcs: Add wikireplica_dns management script The new wikireplica_dns script can be used to create/update DNS records in the *.db.svc.eqiad.wmflabs zones managed by Designate. Typical usage would involve updating the /etc/wikireplica_dns.yaml config file to add a new shard or to point the service names to a different backend database server. Then the /usr/local/bin/wikireplica_dns script would be run to update the Designate DNS. `/usr/local/bin/wikireplica_dns --aliases` should also be used when adding a new wikidb to the replication set so that the expected .{web,analytics}.db.svc.eqiad.wmflabs CNAME records are created pointing to the 'shard' that contains the wikidb in production. Bug: T174860 Change-Id: I151c2a1c1694cccb0c6543d91d1efbee9e2ff335 --- A modules/openstack2/files/util/wikireplica_dns.py A modules/openstack2/files/util/wikireplica_dns.yaml M modules/openstack2/manifests/util/admin_scripts.pp 3 files changed, 297 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/39/378739/1 diff --git a/modules/openstack2/files/util/wikireplica_dns.py b/modules/openstack2/files/util/wikireplica_dns.py new file mode 100644 index 000..bf5bf56 --- /dev/null +++ b/modules/openstack2/files/util/wikireplica_dns.py @@ -0,0 +1,235 @@ +#!/usr/bin/python +# # Copyright (c) 2017 Wikimedia Foundation and contributors +# +# 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. +from __future__ import print_function + +import argparse +import json +import logging +import time +import yaml + +import mwopenstackclients +import requests + +from oslo_utils import uuidutils + + +logger = logging.getLogger(__name__) + + +class DnsManager(object): +"""Wrapper for communicating with Designate API.""" +def __init__(self): +clients = mwopenstackclients.clients() +services = clients.keystoneclient().services.list() +serviceid = [s.id for s in services if s.type == 'dns'][0] +endpoints = clients.keystoneclient().endpoints.list(serviceid) +self.url = [e.url for e in endpoints if e.interface == 'public'][0] +session = clients.session() +self.token = session.get_token() + +def _json_http_kwargs(self, kwargs): +kwargs['headers'] = { +'Content-type': 'application/json', +} +if kwargs.get('data', None): +kwargs['data'] = json.dumps(kwargs['data']) +return kwargs + +def _req(self, verb, *args, **kwargs): +# Work around lack of X-Auth-Sudo-Tenant-ID support in +# python-designateclient <2.2.0 with direct use of API. +map = { +'GET': requests.get, +'POST': requests.post, +'PUT': requests.put, +'PATCH': requests.patch, +'DELETE': requests.delete, +} +args = list(args) +args[0] = self.url + args[0] +headers = kwargs.get('headers', {}) +headers.update({ +'X-Auth-Token': self.token, +'X-Auth-Sudo-Tenant-ID': 'noauth-project', +'X-Designate-Edit-Managed-Records': 'true', +}) +kwargs['headers'] = headers +r = map[verb.upper()](*args, **kwargs) +if r.status_code >= 400: +logging.warning('Error response from %s:\n%s', args[0], r.text) +r.raise_for_status() +return r + +def _get(self, *args, **kwargs): +return self._req('GET', *args, **kwargs) + +def _post(self, *args, **kwargs): +kwargs = self._json_http_kwargs(kwargs) +return self._req('POST', *args, **kwargs) + +def _put(self, *args, **kwargs): +kwargs = self._json_http_kwargs(kwargs) +return self._req('PUT', *args, **kwargs) + +def zones(self, name=None, params=None): +params = params or {} +if name: +params['name'] = name +r = self._get('/v2/zones', params=params) +return r.json()['zones'] + +def create_zone( +self, name, type_="primary", email=None, description=None, +ttl=None, masters=None, attributes=None +): +data = { +"name": name, +"type": type_,
[MediaWiki-commits] [Gerrit] operations/puppet[production]: add tgr to pdfrender-admin sudo group
RobH has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378060 ) Change subject: add tgr to pdfrender-admin sudo group .. add tgr to pdfrender-admin sudo group THIS MUST BE MERGED AFTER OPS MEETING REVIEW. Please note this is a sudo granting access group, and thus must be approved in the weekly operations meeting. The next meeting is scheduled for 2017-09-15, and this will be listed for approval in that meeting. Once approval in the meeting is granted, and all other requirements are met on the access request task, this can be merged by a member of the operations team. Bug: T175882 Change-Id: I21dfd218bd3c4393cd13ee287a555fe4b55b31dc --- M modules/admin/data/data.yaml 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Muehlenhoff: Looks good to me, but someone else must approve Gergő Tisza: Looks good to me, but someone else must approve RobH: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml index f83416a..f14f625 100644 --- a/modules/admin/data/data.yaml +++ b/modules/admin/data/data.yaml @@ -587,7 +587,7 @@ pdfrender-admin: description: Group of pdfrender admins gid: 790 -members: [gwicke, ppchelko, eevans, mobrovac] +members: [gwicke, ppchelko, eevans, mobrovac, tgr] privileges: ['ALL = NOPASSWD: /usr/sbin/service pdfrender *', 'ALL = (pdfrender) NOPASSWD: ALL'] trendingedits-admin: -- To view, visit https://gerrit.wikimedia.org/r/378060 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I21dfd218bd3c4393cd13ee287a555fe4b55b31dc Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: RobHGerrit-Reviewer: Alex Monk Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: Muehlenhoff Gerrit-Reviewer: RobH Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: [WIP] Support additinal domains inn RESTBase
Ppchelko has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378727 ) Change subject: [WIP] Support additinal domains inn RESTBase .. [WIP] Support additinal domains inn RESTBase Work in progress! Bug: T175874 Change-Id: If68eeb8ddfdab93d3e2818cf7e3aae91a5b08a6b --- M puppet/hieradata/common.yaml M puppet/modules/restbase/manifests/init.pp M puppet/modules/restbase/templates/config.yaml.erb 3 files changed, 16 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/27/378727/1 diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml index 9683949..b01d299 100644 --- a/puppet/hieradata/common.yaml +++ b/puppet/hieradata/common.yaml @@ -301,7 +301,7 @@ redis::max_memory: 256M restbase::port: 7231 -restbase::domain: "%{hiera('role::mediawiki::hostname')}" +restbase::base_uri: "%{hiera('role::mediawiki::hostname')}" restbase::dbdir: /var/lib/restbase role::centralauth::db_host: "%{hiera('mysql::grant_host_name')}" @@ -368,7 +368,7 @@ language: he sitename: ויקיפדיה ru: -language: ru +language: ru` sitename: Википедия zh: language: zh @@ -382,7 +382,7 @@ role::ldapauth::writer_password: vagrant_writer role::ldapauth::admin_password: vagrant_admin -role::mediawiki::hostname: "dev%{hiera('mediawiki::multiwiki::base_domain')}" +role::mediawiki::hostname: "%{hiera('mediawiki::multiwiki::base_domain')}" role::quips::vhost_name: "quips%{hiera('mwv::tld')}%{::port_fragment}" role::quips::dir: "%{hiera('mwv::services_dir')}/quips" diff --git a/puppet/modules/restbase/manifests/init.pp b/puppet/modules/restbase/manifests/init.pp index b4d5b9c..a889a97 100644 --- a/puppet/modules/restbase/manifests/init.pp +++ b/puppet/modules/restbase/manifests/init.pp @@ -8,8 +8,8 @@ # [*port*] # the port RESTBase will be running on # -# [*domain*] -# the domain to serve +# [*base_uri*] +# The base uri for wikis. Example: ".wiki.local.wmftest.net" # # [*dbdir*] # the directory where to place the SQLite database file @@ -22,12 +22,11 @@ # class restbase ( $port, -$domain, +$base_uri, $dbdir, $log_level = undef, $eventlogging_service_port = 8085 ) { - require_package('libsqlite3-dev') $graphoid_port = defined(Class['graphoid']) ? { @@ -56,6 +55,13 @@ default => 8090, } +$domains = unique(flatten([ +'dev', +'commons', +keys(hiera('role::langwikis::langwiki_list', {})), +keys(hiera('contenttranslation::wikis', {})) +])) + $pdf_service_port = defined(Class['electron']) ? { true=> $::electron::port, default => 8098, diff --git a/puppet/modules/restbase/templates/config.yaml.erb b/puppet/modules/restbase/templates/config.yaml.erb index 348bb12..5267ac7 100644 --- a/puppet/modules/restbase/templates/config.yaml.erb +++ b/puppet/modules/restbase/templates/config.yaml.erb @@ -60,7 +60,9 @@ allow: - pattern: /^https?:\/\// paths: -/{domain:<%= @domain %>}: *default_project +<% for domain in @domains %> +/{domain:<%= domain %><%= @base_uri %>}: *default_project +<% end -%> # global domain /{domain:wikimedia.org}: *wikimedia -- To view, visit https://gerrit.wikimedia.org/r/378727 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If68eeb8ddfdab93d3e2818cf7e3aae91a5b08a6b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Ppchelko___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: [WIP] Browser tests for Form ID counter when revert/undo
Aleksey Bekh-Ivanov (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378730 ) Change subject: [WIP] Browser tests for Form ID counter when revert/undo .. [WIP] Browser tests for Form ID counter when revert/undo Change-Id: I45f1c9c4a0ff9a1b8637e90bf0b78da3f6a0a27f --- M tests/browser/features/forms.feature M tests/browser/features/step_definitions/forms_steps.rb A tests/browser/features/support/pages/entity_history_page.rb M tests/browser/features/support/pages/lexeme_page.rb A tests/browser/features/support/pages/undo_page.rb 5 files changed, 72 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme refs/changes/30/378730/1 diff --git a/tests/browser/features/forms.feature b/tests/browser/features/forms.feature index 537fe03..d151fd2 100644 --- a/tests/browser/features/forms.feature +++ b/tests/browser/features/forms.feature @@ -81,3 +81,21 @@ Scenario: I can see each Form's statements Given I have a Lexeme with a Form Then for each Form there is a statement list + + @integration + Scenario: FormId counter is not decremented when change is undone +Given I am on a Lexeme page + Then I add a Form + Then I go to the history page + And I undo the latest change + When I add a Form + Then the new Form has the ID greater than the previous one + + @integration + Scenario: FormId counter is not decremented when old revision is restored +Given I am on a Lexeme page + And I add a Form + Then I go to the history page + And I restore the previous revision + When I add a Form + Then the new Form has the ID greater than the previous one diff --git a/tests/browser/features/step_definitions/forms_steps.rb b/tests/browser/features/step_definitions/forms_steps.rb index 7bbe413..2c237c6 100644 --- a/tests/browser/features/step_definitions/forms_steps.rb +++ b/tests/browser/features/step_definitions/forms_steps.rb @@ -148,3 +148,38 @@ Then(/^the first Form should no longer have the removed grammatical feature$/) do expect(@form_I_am_currently_editing.grammatical_feature?(@grammatical_feature_to_delete)).to be false end + +Then(/^I add a Form$/) do + step 'I click the Forms list add button' + step 'I enter "some representation" as the "en" form representation' + step 'I save the Form' +end + +Then(/^I go to the history page$/) do + @last_form_id_before_undo = on(LexemePage).forms[-1].id_element.text + on(LexemePage).history_link_element.when_visible.click +end + + +Then(/^I undo the latest change$/) do + # pick latest revision and click "undo" link + on(EntityHistoryPage).revisions[0].undo_element.when_visible.click + # confirm "undo" + on(UndoPage).save_page.when_visible.click + # got back to the initial Lexeme page +end + +Then(/^I restore the previous revision$/) do + # pick latest revision and click "undo" link + on(EntityHistoryPage).revisions[1].undo_element.when_visible.click + # confirm "undo" + on(UndoPage).save_page.when_visible.click + # got back to the initial Lexeme page +end + +Then(/^the new Form has the ID greater than the previous one$/) do + last_form_id = on(LexemePage).forms[-1].id_element.text + + expect(last_form_id).to > @last_form_id_before_undo +end + diff --git a/tests/browser/features/support/pages/entity_history_page.rb b/tests/browser/features/support/pages/entity_history_page.rb new file mode 100644 index 000..6c7f6d2 --- /dev/null +++ b/tests/browser/features/support/pages/entity_history_page.rb @@ -0,0 +1,12 @@ +class EntityRevision + include PageObject + + a(:undo, css: '.mw-history-undo a') + a(:restore, text: 'restore') #This link doesn't have any css identifier +end + +class EntityHistoryPage + include PageObject + + page_sections(:revisions, EntityRevision, css: 'ul#pagehistory > li') +end \ No newline at end of file diff --git a/tests/browser/features/support/pages/lexeme_page.rb b/tests/browser/features/support/pages/lexeme_page.rb index e254a00..4da7f07 100644 --- a/tests/browser/features/support/pages/lexeme_page.rb +++ b/tests/browser/features/support/pages/lexeme_page.rb @@ -112,6 +112,8 @@ include PageObject include EntityPage + element(:history_link, css: '#ca-history a') + span(:forms_header, id: 'forms') div(:forms_container, class: 'wikibase-lexeme-forms') h3(:form_representation, class: 'wikibase-lexeme-form-representation') diff --git a/tests/browser/features/support/pages/undo_page.rb b/tests/browser/features/support/pages/undo_page.rb new file mode 100644 index 000..40a57bc --- /dev/null +++ b/tests/browser/features/support/pages/undo_page.rb @@ -0,0 +1,5 @@ +class UndoPage + include PageObject + + button(:save_page, css:'form#undo button') +end \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/378730 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Increase margin-left on gadget help link
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378678 ) Change subject: Increase margin-left on gadget help link .. Increase margin-left on gadget help link This puts a bit more space between the constraint type name (if it’s very long) and the help link, so it doesn’t look like an ordinary inter-word space. Requested by Thiemo in a comment on I9b38af8c2f. Bug: T175153 Change-Id: If4af8571512cc39a4783a7e393ddb4355e5f9770 --- M modules/ui/ConstraintReportPanel.css 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/modules/ui/ConstraintReportPanel.css b/modules/ui/ConstraintReportPanel.css index e83f978..19e61a7 100644 --- a/modules/ui/ConstraintReportPanel.css +++ b/modules/ui/ConstraintReportPanel.css @@ -5,6 +5,6 @@ .wbqc-report .wbqc-constraint-type-help { font-weight: normal; float: right; - margin-left: 0.5em; + margin-left: 1.5em; margin-right: 0.5em; } -- To view, visit https://gerrit.wikimedia.org/r/378678 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If4af8571512cc39a4783a7e393ddb4355e5f9770 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE)Gerrit-Reviewer: Jonas Kress (WMDE) Gerrit-Reviewer: Thiemo Mättig (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikimediaEvents[master]: Kartographer: Protect against undefined data.options
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378516 ) Change subject: Kartographer: Protect against undefined data.options .. Kartographer: Protect against undefined data.options Bug: T174249 Change-Id: I5b0623452a017a2f23ddeb57aaa118da7af564ea --- M modules/ext.wikimediaEvents.kartographer.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Bearloga: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ext.wikimediaEvents.kartographer.js b/modules/ext.wikimediaEvents.kartographer.js index 9996062..2971a94 100644 --- a/modules/ext.wikimediaEvents.kartographer.js +++ b/modules/ext.wikimediaEvents.kartographer.js @@ -225,7 +225,7 @@ break; } - if ( data.action.endsWith( 'layer' ) ) { + if ( data.options && data.options.extra && data.action.endsWith( 'layer' ) ) { options.extra.layer = data.options.extra.layer; } -- To view, visit https://gerrit.wikimedia.org/r/378516 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5b0623452a017a2f23ddeb57aaa118da7af564ea Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/WikimediaEvents Gerrit-Branch: master Gerrit-Owner: TheDJGerrit-Reviewer: Bearloga Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Follow-up a45d6fc3: Add 'tay' language to build to unbreak t...
Jforrester has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378733 ) Change subject: Follow-up a45d6fc3: Add 'tay' language to build to unbreak the repo .. Follow-up a45d6fc3: Add 'tay' language to build to unbreak the repo Change-Id: I9c0bf9c8cbd751c808f23e51ab3b8b93ad6f43d0 --- M .jsduck/eg-iframe.html M demos/ve/desktop-dist.html M demos/ve/desktop.html M demos/ve/mobile-dist.html M demos/ve/mobile.html 5 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor refs/changes/33/378733/1 diff --git a/.jsduck/eg-iframe.html b/.jsduck/eg-iframe.html index d6403df..1fe76d9 100644 --- a/.jsduck/eg-iframe.html +++ b/.jsduck/eg-iframe.html @@ -67,7 +67,7 @@ ve.messagePaths = ["../i18n/","../lib/oojs-ui/i18n/"]; - ve.availableLanguages = ["ace","af","ais","am","ang","ar","arc","arq","as","ast","av","az","azb","ba","bcc","bcl","be-tarask","be","bg","bho","bn","bqi","br","bs","ca","cdo","ce","cjy-hant","ckb","co","cs","cu","cy","da","de","diq","dsb","dty","egl","el","eml","en-ca","en-gb","en","eo","es","et","eu","fa","fi","fo","fr","frp","frr","fur","fy","ga","gd","gl","glk","gn","gom-latn","gor","gsw","gu","gv","he","hi","hr","hrx","hsb","hu-formal","hu","hy","ia","id","ie","ilo","inh","io","is","it","ja","jv","ka","kab","khw","kk-cyrl","km","kn","ko-kp","ko","krc","kri","krl","ksh","ku-latn","kw","ky","la","lb","lez","li","lki","lmo","lrc","lt","luz","lv","lzh","lzz","mg","min","mk","ml","mn","mr","ms","mt","nan","nap","nb","nds-nl","nds","ne","nl","nn","oc","olo","om","or","os","pa","pam","pfl","pl","pms","ps","pt-br","pt","qqq","qu","rm","ro","roa-tara","ru","rue","sa","sah","sc","scn","sco","sd","sgs","sh","shn","si","sk","skr-arab","sl","sq","sr-ec","sr-el","su","sv","sw","ta","te","tg-cyrl","th","tl","tr","tt-cyrl","tyv","tzm","ug-arab","uk","ur","uz","vec","vep","vi","vo","war","wuu","xmf","yi","yue","zh-hans","zh-hant","ace","af","ais","am","ar","arc","arq","as","ast","awa","az","azb","ba","bcc","bcl","be-tarask","be","bg","bho","bn","bqi","br","bs","ca","cdo","ce","ckb","co","crh-cyrl","crh-latn","cs","cu","cy","da","de","diq","dsb","dty","egl","el","eml","en-ca","en","eo","es","et","eu","fa","fi","fo","fr","frr","fur","fy","gd","gl","glk","gom-latn","gor","gu","he","hi","hif-latn","hr","hrx","hsb","hu-formal","hu","hy","ia","id","ie","ilo","inh","io","is","it","ja","jv","ka","kab","khw","kk-cyrl","km","kn","ko","krc","krl","ksh","ku-latn","kw","ky","la","lb","li","lki","lmo","lt","luz","lv","lzh","mg","min","mk","ml","mn","mr","ms","nan","nap","nb","nds-nl","nds","ne","nl","nn","oc","olo","om","or","pa","pfl","pl","pms","pnb","ps","pt-br","pt","qqq","qu","ro","roa-tara","ru","sa","sah","scn","sco","sd","sh","shn","si","sk","skr-arab","sl","sq","sr-ec","sr-el","su","sv","sw","ta","te","tg-cyrl","th","tl","tr","tt-cyrl","ug-arab","uk","ur","uz","vec","vep","vi","vo","war","wuu","xmf","yi","yo","yue","zh-hans","zh-hant"]; + ve.availableLanguages =
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Follow-up a45d6fc3: Add 'tay' language to build to unbreak t...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378733 ) Change subject: Follow-up a45d6fc3: Add 'tay' language to build to unbreak the repo .. Follow-up a45d6fc3: Add 'tay' language to build to unbreak the repo Change-Id: I9c0bf9c8cbd751c808f23e51ab3b8b93ad6f43d0 --- M .jsduck/eg-iframe.html M demos/ve/desktop-dist.html M demos/ve/desktop.html M demos/ve/mobile-dist.html M demos/ve/mobile.html 5 files changed, 5 insertions(+), 5 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/.jsduck/eg-iframe.html b/.jsduck/eg-iframe.html index d6403df..1fe76d9 100644 --- a/.jsduck/eg-iframe.html +++ b/.jsduck/eg-iframe.html @@ -67,7 +67,7 @@ ve.messagePaths = ["../i18n/","../lib/oojs-ui/i18n/"]; - ve.availableLanguages = ["ace","af","ais","am","ang","ar","arc","arq","as","ast","av","az","azb","ba","bcc","bcl","be-tarask","be","bg","bho","bn","bqi","br","bs","ca","cdo","ce","cjy-hant","ckb","co","cs","cu","cy","da","de","diq","dsb","dty","egl","el","eml","en-ca","en-gb","en","eo","es","et","eu","fa","fi","fo","fr","frp","frr","fur","fy","ga","gd","gl","glk","gn","gom-latn","gor","gsw","gu","gv","he","hi","hr","hrx","hsb","hu-formal","hu","hy","ia","id","ie","ilo","inh","io","is","it","ja","jv","ka","kab","khw","kk-cyrl","km","kn","ko-kp","ko","krc","kri","krl","ksh","ku-latn","kw","ky","la","lb","lez","li","lki","lmo","lrc","lt","luz","lv","lzh","lzz","mg","min","mk","ml","mn","mr","ms","mt","nan","nap","nb","nds-nl","nds","ne","nl","nn","oc","olo","om","or","os","pa","pam","pfl","pl","pms","ps","pt-br","pt","qqq","qu","rm","ro","roa-tara","ru","rue","sa","sah","sc","scn","sco","sd","sgs","sh","shn","si","sk","skr-arab","sl","sq","sr-ec","sr-el","su","sv","sw","ta","te","tg-cyrl","th","tl","tr","tt-cyrl","tyv","tzm","ug-arab","uk","ur","uz","vec","vep","vi","vo","war","wuu","xmf","yi","yue","zh-hans","zh-hant","ace","af","ais","am","ar","arc","arq","as","ast","awa","az","azb","ba","bcc","bcl","be-tarask","be","bg","bho","bn","bqi","br","bs","ca","cdo","ce","ckb","co","crh-cyrl","crh-latn","cs","cu","cy","da","de","diq","dsb","dty","egl","el","eml","en-ca","en","eo","es","et","eu","fa","fi","fo","fr","frr","fur","fy","gd","gl","glk","gom-latn","gor","gu","he","hi","hif-latn","hr","hrx","hsb","hu-formal","hu","hy","ia","id","ie","ilo","inh","io","is","it","ja","jv","ka","kab","khw","kk-cyrl","km","kn","ko","krc","krl","ksh","ku-latn","kw","ky","la","lb","li","lki","lmo","lt","luz","lv","lzh","mg","min","mk","ml","mn","mr","ms","nan","nap","nb","nds-nl","nds","ne","nl","nn","oc","olo","om","or","pa","pfl","pl","pms","pnb","ps","pt-br","pt","qqq","qu","ro","roa-tara","ru","sa","sah","scn","sco","sd","sh","shn","si","sk","skr-arab","sl","sq","sr-ec","sr-el","su","sv","sw","ta","te","tg-cyrl","th","tl","tr","tt-cyrl","ug-arab","uk","ur","uz","vec","vep","vi","vo","war","wuu","xmf","yi","yo","yue","zh-hans","zh-hant"]; + ve.availableLanguages =
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Make a difference between entity serializers used to seriali...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/377266 ) Change subject: Make a difference between entity serializers used to serialize data for storage, and to serialize it tu output to outside world .. Make a difference between entity serializers used to serialize data for storage, and to serialize it tu output to outside world This change does not matter much for current way items and properties are serialized (the same format stored in the DB and presetned e.g. in API results), although there are already places which state in comment there is not guarantees given. This might matter for extensions adding custom entity types that contain data that must be stored but should not visible to data user. And in general, consumers of data provided by Wikibase should not be make any assumption on correspondence between what user get e.g. from API and what is persisted in the internal storage. Change-Id: Ifaeb8048cf4120744b85bcf325379157da6a01a6 --- M data-access/src/GenericServices.php M data-access/src/MultipleRepositoryAwareWikibaseServices.php M data-access/src/PerRepositoryServiceWiring.php M data-access/src/WikibaseServices.php M data-access/tests/phpunit/GenericServicesTest.php M data-access/tests/phpunit/MultipleRepositoryAwareWikibaseServicesTest.php M docs/entitytypes.wiki M lib/includes/EntityTypeDefinitions.php M lib/tests/phpunit/EntityTypeDefinitionsTest.php M repo/WikibaseRepo.entitytypes.php M repo/includes/WikibaseRepo.php M repo/tests/phpunit/includes/Api/EditPageTest.php M repo/tests/phpunit/includes/Content/DeferredDecodingEntityHolderTest.php M repo/tests/phpunit/includes/Content/EntityHandlerTest.php M repo/tests/phpunit/includes/WikibaseRepoTest.php 15 files changed, 126 insertions(+), 8 deletions(-) Approvals: Aleksey Bekh-Ivanov (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/data-access/src/GenericServices.php b/data-access/src/GenericServices.php index 1cc8b82..702a60e 100644 --- a/data-access/src/GenericServices.php +++ b/data-access/src/GenericServices.php @@ -44,6 +44,11 @@ private $compactEntitySerializer; /** +* @var Serializer|null +*/ + private $storageEntitySerializer; + + /** * @var LanguageFallbackChainFactory */ private $languageFallbackChainFactory; @@ -115,6 +120,27 @@ } /** +* Returns the entity serializer that generates serialization that is used in the storage layer. +* +* @return Serializer +*/ + public function getStorageEntitySerializer() { + if ( !isset( $this->storageEntitySerializer ) ) { + $serializerFactoryCallbacks = $this->entityTypeDefinitions->getStorageSerializerFactoryCallbacks(); + $baseSerializerFactory = $this->getBaseDataModelSerializerFactory(); + $serializers = []; + + foreach ( $serializerFactoryCallbacks as $callback ) { + $serializers[] = call_user_func( $callback, $baseSerializerFactory ); + } + + $this->storageEntitySerializer = new DispatchingSerializer( $serializers ); + } + + return $this->storageEntitySerializer; + } + + /** * @return SerializerFactory Factory creating serializers that generate the full (expanded) serialization. * The factory returned has the knowledge about items, properties, and the elements they are made of, * but not about other entity types. diff --git a/data-access/src/MultipleRepositoryAwareWikibaseServices.php b/data-access/src/MultipleRepositoryAwareWikibaseServices.php index a4f2c6e..04d5c1d 100644 --- a/data-access/src/MultipleRepositoryAwareWikibaseServices.php +++ b/data-access/src/MultipleRepositoryAwareWikibaseServices.php @@ -150,6 +150,9 @@ 'CompactEntitySerializer' => function() use ( $genericServices ) { return $genericServices->getCompactEntitySerializer(); }, + 'StorageEntitySerializer' => function() use ( $genericServices ) { + return $genericServices->getStorageEntitySerializer(); + }, 'EntityStoreWatcher' => function() use ( $multiRepositoryServices ) { return $multiRepositoryServices; }, @@ -224,6 +227,15 @@ } /** +* Returns the entity serializer that generates serialization that is used in the storage layer. +* +* @return Serializer +*/ + public function getStorageEntitySerializer() { + return $this->getService( 'StorageEntitySerializer' ); + } + + /** *
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.18]: Use db query builder not raw sql
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378735 ) Change subject: Use db query builder not raw sql .. Use db query builder not raw sql Change-Id: I8e26932e28fdda9a52e0486c5d2eb269eb9ecae5 Follows-up: Ice1bdae3d16cf365da14c6df0e8d91d2b914e064 (cherry picked from commit 90534ed5daa7f68d6d7bf349afd55f2c8295f067) --- M maintenance/populateIpChanges.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index 004b6bc..ffb8c43 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -67,12 +67,12 @@ $this->output( "Copying IP revisions to ip_changes, from rev_id $start to rev_id $end\n" ); while ( $blockStart <= $end ) { - $cond = "rev_id >= $blockStart AND rev_user = 0 ORDER BY rev_id ASC LIMIT " . $this->mBatchSize; $rows = $dbw->select( 'revision', [ 'rev_id', 'rev_timestamp', 'rev_user_text' ], - $cond, - __METHOD__ + [ "rev_id >= $blockStart", 'rev_user' => 0 ], + __METHOD__, + [ 'ORDER BY' => 'rev_id ASC', 'LIMIT' => $this->mBatchSize ] ); if ( !$rows || $rows->numRows() === 0 ) { -- To view, visit https://gerrit.wikimedia.org/r/378735 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e26932e28fdda9a52e0486c5d2eb269eb9ecae5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.18 Gerrit-Owner: ReedyGerrit-Reviewer: Parent5446 Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.18]: Speed up populateIpChanges maintenance script.
Reedy has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378736 ) Change subject: Speed up populateIpChanges maintenance script. .. Speed up populateIpChanges maintenance script. Use BETWEEN in populateIpChanges maintenance script, which will make it more efficient when copying revisions with a high rev_id. Also adding a 'max-rev-id' option to prevent the script from looping through IP changes that have already been copied since the core patch was deployed. Bug: T175962 Change-Id: I1df10c9b7237ad5002f76f9d354c36ce879d9d9f (cherry picked from commit 2eac9d7ef4953fdfe5f710fb3dc98c360c80c5ae) --- M maintenance/populateIpChanges.php 1 file changed, 15 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/36/378736/1 diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index ffb8c43..c173270 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -47,6 +47,12 @@ ); $this->addOption( 'rev-id', 'The rev_id to start copying from. Default: 0', false, true ); $this->addOption( + 'max-rev-id', + 'The rev_id to stop at. Default: result of MAX(rev_id)', + false, + true + ); + $this->addOption( 'throttle', 'Wait this many milliseconds after copying each batch of revisions. Default: 0', false, @@ -57,20 +63,25 @@ public function doDBUpdates() { $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] ); $dbw = $this->getDB( DB_MASTER ); $throttle = intval( $this->getOption( 'throttle', 0 ) ); + $maxRevId = intval( $this->getOption( 'max-rev-id', 0 ) ); $start = $this->getOption( 'rev-id', 0 ); - $end = $dbw->selectField( 'revision', 'MAX(rev_id)', false, __METHOD__ ); + $end = $maxRevId > 0 + ? $maxRevId + : $dbw->selectField( 'revision', 'MAX(rev_id)', false, __METHOD__ ); $blockStart = $start; $revCount = 0; $this->output( "Copying IP revisions to ip_changes, from rev_id $start to rev_id $end\n" ); while ( $blockStart <= $end ) { - $rows = $dbw->select( + $blockEnd = min( $blockStart + 200, $end ); + $rows = $dbr->select( 'revision', [ 'rev_id', 'rev_timestamp', 'rev_user_text' ], - [ "rev_id >= $blockStart", 'rev_user' => 0 ], + [ "rev_id BETWEEN $blockStart AND $blockEnd", 'rev_user' => 0 ], __METHOD__, [ 'ORDER BY' => 'rev_id ASC', 'LIMIT' => $this->mBatchSize ] ); @@ -80,7 +91,7 @@ } $this->output( "...checking $this->mBatchSize revisions for IP edits that need copying, " . - "starting with rev_id $blockStart\n" ); + "between rev_ids $blockStart and $blockEnd\n" ); $insertRows = []; foreach ( $rows as $row ) { -- To view, visit https://gerrit.wikimedia.org/r/378736 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1df10c9b7237ad5002f76f9d354c36ce879d9d9f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.18 Gerrit-Owner: ReedyGerrit-Reviewer: MusikAnimal ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Improve encoding of embedded SVGs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/377820 ) Change subject: Improve encoding of embedded SVGs .. Improve encoding of embedded SVGs Unencode spaces, slashes, colons and equals signs. Bug: T175318 Change-Id: Idebdfca8f93d5e090deba5bf5a256d7054e2d6c8 --- M includes/libs/CSSMin.php M maintenance/benchmarks/cssmin/circle.svg M tests/phpunit/data/cssmin/circle.svg M tests/phpunit/includes/libs/CSSMinTest.php 4 files changed, 15 insertions(+), 7 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified VolkerE: Looks good to me, but someone else must approve diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index cd80066..ee88d0d 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -142,7 +142,15 @@ if ( preg_match( '/^[\r\n\t\x20-\x7e]+$/', $contents ) ) { // Do not base64-encode non-binary files (sane SVGs). // (This often produces longer URLs, but they compress better, yielding a net smaller size.) - $uri = 'data:' . $type . ',' . rawurlencode( $contents ); + $encoded = rawurlencode( $contents ); + // Unencode some things that don't need to be encoded, to make the encoding smaller + $encoded = strtr( $encoded, [ + '%20' => ' ', // Unencode spaces + '%2F' => '/', // Unencode slashes + '%3A' => ':', // Unencode colons + '%3D' => '=', // Unencode equals signs + ] ); + $uri = 'data:' . $type . ',' . $encoded; if ( !$ie8Compat || strlen( $uri ) < self::DATA_URI_SIZE_LIMIT ) { return $uri; } diff --git a/maintenance/benchmarks/cssmin/circle.svg b/maintenance/benchmarks/cssmin/circle.svg index 6b7d1af..4f7af21 100644 --- a/maintenance/benchmarks/cssmin/circle.svg +++ b/maintenance/benchmarks/cssmin/circle.svg @@ -1,4 +1,4 @@ http://www.w3.org/2000/svg; width="8" height="8"> - + diff --git a/tests/phpunit/data/cssmin/circle.svg b/tests/phpunit/data/cssmin/circle.svg index 6b7d1af..4f7af21 100644 --- a/tests/phpunit/data/cssmin/circle.svg +++ b/tests/phpunit/data/cssmin/circle.svg @@ -1,4 +1,4 @@ http://www.w3.org/2000/svg; width="8" height="8"> - + diff --git a/tests/phpunit/includes/libs/CSSMinTest.php b/tests/phpunit/includes/libs/CSSMinTest.php index 7d9a420..b06df97 100644 --- a/tests/phpunit/includes/libs/CSSMinTest.php +++ b/tests/phpunit/includes/libs/CSSMinTest.php @@ -271,9 +271,9 @@ // data: URIs for red.gif, green.gif, circle.svg $red = 'data:image/gif;base64,R0lGODlhAQABAIAAAP8AADAAACwAAQABAAACAkQBADs='; $green = 'data:image/gif;base64,R0lGODlhAQABAICAADAAACwAAQABAAACAkQBADs='; - $svg = 'data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A' - . '%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D' - . '%228%22%3E%0A%3Ccircle%20cx%3D%224%22%20cy%3D%224%22%20r%3D%222%22%2F%3E%0A%3C%2Fsvg%3E%0A'; + $svg = 'data:image/svg+xml,%3C%3Fxml version=%221.0%22 encoding=%22UTF-8%22%3F%3E%0A' + . '%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%228%22 height=' + . '%228%22%3E%0A%09%3Ccircle cx=%224%22 cy=%224%22 r=%222%22/%3E%0A%3C/svg%3E%0A'; // @codingStandardsIgnoreStart Generic.Files.LineLength return [ @@ -361,7 +361,7 @@ [ 'SVG files are embedded without base64 encoding and unnecessary IE 6 and 7 fallback', 'foo { /* @embed */ background: url(circle.svg); }', - "foo { background: url($svg); }", + "foo { background: url(\"$svg\"); }", ], [ 'Two regular files in one rule', -- To view, visit https://gerrit.wikimedia.org/r/377820 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idebdfca8f93d5e090deba5bf5a256d7054e2d6c8 Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Catrope Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: VolkerE Gerrit-Reviewer: jenkins-bot <>
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.18]: Speed up populateIpChanges maintenance script.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378736 ) Change subject: Speed up populateIpChanges maintenance script. .. Speed up populateIpChanges maintenance script. Use BETWEEN in populateIpChanges maintenance script, which will make it more efficient when copying revisions with a high rev_id. Also adding a 'max-rev-id' option to prevent the script from looping through IP changes that have already been copied since the core patch was deployed. Bug: T175962 Change-Id: I1df10c9b7237ad5002f76f9d354c36ce879d9d9f (cherry picked from commit 2eac9d7ef4953fdfe5f710fb3dc98c360c80c5ae) --- M maintenance/populateIpChanges.php 1 file changed, 15 insertions(+), 4 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index ffb8c43..c173270 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -47,6 +47,12 @@ ); $this->addOption( 'rev-id', 'The rev_id to start copying from. Default: 0', false, true ); $this->addOption( + 'max-rev-id', + 'The rev_id to stop at. Default: result of MAX(rev_id)', + false, + true + ); + $this->addOption( 'throttle', 'Wait this many milliseconds after copying each batch of revisions. Default: 0', false, @@ -57,20 +63,25 @@ public function doDBUpdates() { $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] ); $dbw = $this->getDB( DB_MASTER ); $throttle = intval( $this->getOption( 'throttle', 0 ) ); + $maxRevId = intval( $this->getOption( 'max-rev-id', 0 ) ); $start = $this->getOption( 'rev-id', 0 ); - $end = $dbw->selectField( 'revision', 'MAX(rev_id)', false, __METHOD__ ); + $end = $maxRevId > 0 + ? $maxRevId + : $dbw->selectField( 'revision', 'MAX(rev_id)', false, __METHOD__ ); $blockStart = $start; $revCount = 0; $this->output( "Copying IP revisions to ip_changes, from rev_id $start to rev_id $end\n" ); while ( $blockStart <= $end ) { - $rows = $dbw->select( + $blockEnd = min( $blockStart + 200, $end ); + $rows = $dbr->select( 'revision', [ 'rev_id', 'rev_timestamp', 'rev_user_text' ], - [ "rev_id >= $blockStart", 'rev_user' => 0 ], + [ "rev_id BETWEEN $blockStart AND $blockEnd", 'rev_user' => 0 ], __METHOD__, [ 'ORDER BY' => 'rev_id ASC', 'LIMIT' => $this->mBatchSize ] ); @@ -80,7 +91,7 @@ } $this->output( "...checking $this->mBatchSize revisions for IP edits that need copying, " . - "starting with rev_id $blockStart\n" ); + "between rev_ids $blockStart and $blockEnd\n" ); $insertRows = []; foreach ( $rows as $row ) { -- To view, visit https://gerrit.wikimedia.org/r/378736 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1df10c9b7237ad5002f76f9d354c36ce879d9d9f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.18 Gerrit-Owner: ReedyGerrit-Reviewer: MusikAnimal Gerrit-Reviewer: Parent5446 Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: ResourceLoaderImageModule: Use CSSMin::buildUrlValue() where...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/377827 ) Change subject: ResourceLoaderImageModule: Use CSSMin::buildUrlValue() where needed .. ResourceLoaderImageModule: Use CSSMin::buildUrlValue() where needed We can't just assume that the URLs that we generate are safe to use in url() without quotes. There's already a function that automatically uses quotes where necessary, so use that. Change-Id: I6663e49b82592eb45b8854fcff56ac966b39f8ce --- M includes/resourceloader/ResourceLoaderImageModule.php 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved Krinkle: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/resourceloader/ResourceLoaderImageModule.php b/includes/resourceloader/ResourceLoaderImageModule.php index cbcf5a0..8b54959 100644 --- a/includes/resourceloader/ResourceLoaderImageModule.php +++ b/includes/resourceloader/ResourceLoaderImageModule.php @@ -381,11 +381,13 @@ * @return string[] CSS declarations to use given URIs as background-image */ protected function getCssDeclarations( $primary, $fallback ) { + $primaryUrl = CSSMin::buildUrlValue( $primary ); + $fallbackUrl = CSSMin::buildUrlValue( $fallback ); return [ - "background-image: url($fallback);", - "background-image: linear-gradient(transparent, transparent), url($primary);", + "background-image: $fallbackUrl;", + "background-image: linear-gradient(transparent, transparent), $primaryUrl;", // Do not serve SVG to Opera 12, bad rendering with border-radius or background-size (T87504) - "background-image: -o-linear-gradient(transparent, transparent), url($fallback);", + "background-image: -o-linear-gradient(transparent, transparent), $fallbackUrl;", ]; } -- To view, visit https://gerrit.wikimedia.org/r/377827 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6663e49b82592eb45b8854fcff56ac966b39f8ce Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Legoktm Gerrit-Reviewer: VolkerE Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Split mediawiki.special.preferences into separate file for e...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378391 ) Change subject: Split mediawiki.special.preferences into separate file for each function .. Split mediawiki.special.preferences into separate file for each function This JavaScript code does four things: * Convert a simple form into one with tab navigation * Convert a simple message box into pretty notifications * Prevent browser window from being closed with unsaved changes to preferences * Add some enhancements to the timezone field I will be making some large changes here for T117781 and having everything mixed in one file was making that difficult. I avoided making any cleanup changes to make it easier to review this change. Change-Id: I5e31a661177002e40708614011c1f7e08ec4f44d --- M resources/Resources.php A resources/src/mediawiki.special/mediawiki.special.preferences.confirmClose.js A resources/src/mediawiki.special/mediawiki.special.preferences.convertmessagebox.js D resources/src/mediawiki.special/mediawiki.special.preferences.js A resources/src/mediawiki.special/mediawiki.special.preferences.tabs.js A resources/src/mediawiki.special/mediawiki.special.preferences.timezone.js 6 files changed, 335 insertions(+), 306 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/resources/Resources.php b/resources/Resources.php index 10786da..52dccdb 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -2092,7 +2092,12 @@ 'styles' => 'resources/src/mediawiki.special/mediawiki.special.pagesWithProp.css', ], 'mediawiki.special.preferences' => [ - 'scripts' => 'resources/src/mediawiki.special/mediawiki.special.preferences.js', + 'scripts' => [ + 'resources/src/mediawiki.special/mediawiki.special.preferences.confirmClose.js', + 'resources/src/mediawiki.special/mediawiki.special.preferences.convertmessagebox.js', + 'resources/src/mediawiki.special/mediawiki.special.preferences.tabs.js', + 'resources/src/mediawiki.special/mediawiki.special.preferences.timezone.js', + ], 'messages' => [ 'prefs-tabs-navigation-hint', 'prefswarning-warning', diff --git a/resources/src/mediawiki.special/mediawiki.special.preferences.confirmClose.js b/resources/src/mediawiki.special/mediawiki.special.preferences.confirmClose.js new file mode 100644 index 000..45df37f --- /dev/null +++ b/resources/src/mediawiki.special/mediawiki.special.preferences.confirmClose.js @@ -0,0 +1,63 @@ +/*! + * JavaScript for Special:Preferences: Enable save button and prevent the window being accidentally + * closed when any form field is changed. + */ +( function ( mw, $ ) { + $( function () { + var allowCloseWindow; + + // Check if all of the form values are unchanged + function isPrefsChanged() { + var inputs = $( '#mw-prefs-form :input[name]' ), + input, $input, inputType, + index, optIndex, + opt; + + for ( index = 0; index < inputs.length; index++ ) { + input = inputs[ index ]; + $input = $( input ); + + // Different types of inputs have different methods for accessing defaults + if ( $input.is( 'select' ) ) { + // has the property defaultSelected for each option + for ( optIndex = 0; optIndex < input.options.length; optIndex++ ) { + opt = input.options[ optIndex ]; + if ( opt.selected !== opt.defaultSelected ) { + return true; + } + } + } else if ( $input.is( 'input' ) ) { // has defaultValue or defaultChecked + inputType = input.type; + if ( inputType === 'radio' || inputType === 'checkbox' ) { + if ( input.checked !== input.defaultChecked ) { + return true; + } + } else if ( input.value !== input.defaultValue ) { + return true; + } + } + } + +
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Do no allow AddFormRequestParserResult::getRequest be called...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378720 ) Change subject: Do no allow AddFormRequestParserResult::getRequest be called if there were errors .. Do no allow AddFormRequestParserResult::getRequest be called if there were errors Change-Id: I20a44ea7b2312cdc1e46c6409d76140e908ac4e7 --- M src/Api/AddFormRequestParserResult.php A tests/phpunit/composer/Api/AddFormRequestParserResultTest.php 2 files changed, 30 insertions(+), 0 deletions(-) Approvals: Aleksey Bekh-Ivanov (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/src/Api/AddFormRequestParserResult.php b/src/Api/AddFormRequestParserResult.php index ba18383..a4d8f77 100644 --- a/src/Api/AddFormRequestParserResult.php +++ b/src/Api/AddFormRequestParserResult.php @@ -29,6 +29,12 @@ } public function getRequest() { + if ( $this->errors ) { + throw new \LogicException( + 'There have been errors when parsing the request. Call getErrors to handle them' + ); + } + return $this->request; } diff --git a/tests/phpunit/composer/Api/AddFormRequestParserResultTest.php b/tests/phpunit/composer/Api/AddFormRequestParserResultTest.php new file mode 100644 index 000..8e0e0a0 --- /dev/null +++ b/tests/phpunit/composer/Api/AddFormRequestParserResultTest.php @@ -0,0 +1,24 @@ +setExpectedException( \Exception::class ); + + $result->getRequest(); + } + +} -- To view, visit https://gerrit.wikimedia.org/r/378720 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I20a44ea7b2312cdc1e46c6409d76140e908ac4e7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseLexeme Gerrit-Branch: master Gerrit-Owner: WMDE-leszekGerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Better JSON wellformedness check AddFormRequestParser
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378721 ) Change subject: Better JSON wellformedness check AddFormRequestParser .. Better JSON wellformedness check AddFormRequestParser Change-Id: Iff4f91b7ffd27d6cb705c54d9b42386b7db75e6e --- M src/Api/AddFormRequestParser.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Aleksey Bekh-Ivanov (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/src/Api/AddFormRequestParser.php b/src/Api/AddFormRequestParser.php index bb2a7aa..f19f64a 100644 --- a/src/Api/AddFormRequestParser.php +++ b/src/Api/AddFormRequestParser.php @@ -33,7 +33,7 @@ } $data = json_decode( $params['data'], true ); - if ( $data === null ) { + if ( json_last_error() !== JSON_ERROR_NONE ) { return AddFormRequestParserResult::newWithErrors( [ 'data-invalid-json' ] ); } -- To view, visit https://gerrit.wikimedia.org/r/378721 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff4f91b7ffd27d6cb705c54d9b42386b7db75e6e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseLexeme Gerrit-Branch: master Gerrit-Owner: WMDE-leszekGerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Speed up populateIpChanges maintenance script.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378480 ) Change subject: Speed up populateIpChanges maintenance script. .. Speed up populateIpChanges maintenance script. Use BETWEEN in populateIpChanges maintenance script, which will make it more efficient when copying revisions with a high rev_id. Also adding a 'max-rev-id' option to prevent the script from looping through IP changes that have already been copied since the core patch was deployed. Bug: T175962 Change-Id: I1df10c9b7237ad5002f76f9d354c36ce879d9d9f --- M maintenance/populateIpChanges.php 1 file changed, 15 insertions(+), 4 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index ffb8c43..c173270 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -47,6 +47,12 @@ ); $this->addOption( 'rev-id', 'The rev_id to start copying from. Default: 0', false, true ); $this->addOption( + 'max-rev-id', + 'The rev_id to stop at. Default: result of MAX(rev_id)', + false, + true + ); + $this->addOption( 'throttle', 'Wait this many milliseconds after copying each batch of revisions. Default: 0', false, @@ -57,20 +63,25 @@ public function doDBUpdates() { $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + $dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] ); $dbw = $this->getDB( DB_MASTER ); $throttle = intval( $this->getOption( 'throttle', 0 ) ); + $maxRevId = intval( $this->getOption( 'max-rev-id', 0 ) ); $start = $this->getOption( 'rev-id', 0 ); - $end = $dbw->selectField( 'revision', 'MAX(rev_id)', false, __METHOD__ ); + $end = $maxRevId > 0 + ? $maxRevId + : $dbw->selectField( 'revision', 'MAX(rev_id)', false, __METHOD__ ); $blockStart = $start; $revCount = 0; $this->output( "Copying IP revisions to ip_changes, from rev_id $start to rev_id $end\n" ); while ( $blockStart <= $end ) { - $rows = $dbw->select( + $blockEnd = min( $blockStart + 200, $end ); + $rows = $dbr->select( 'revision', [ 'rev_id', 'rev_timestamp', 'rev_user_text' ], - [ "rev_id >= $blockStart", 'rev_user' => 0 ], + [ "rev_id BETWEEN $blockStart AND $blockEnd", 'rev_user' => 0 ], __METHOD__, [ 'ORDER BY' => 'rev_id ASC', 'LIMIT' => $this->mBatchSize ] ); @@ -80,7 +91,7 @@ } $this->output( "...checking $this->mBatchSize revisions for IP edits that need copying, " . - "starting with rev_id $blockStart\n" ); + "between rev_ids $blockStart and $blockEnd\n" ); $insertRows = []; foreach ( $rows as $row ) { -- To view, visit https://gerrit.wikimedia.org/r/378480 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1df10c9b7237ad5002f76f9d354c36ce879d9d9f Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: MusikAnimalGerrit-Reviewer: Jcrespo Gerrit-Reviewer: MaxSem Gerrit-Reviewer: Parent5446 Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Make Wikibase code base compatible with current DataModel ma...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378723 ) Change subject: Make Wikibase code base compatible with current DataModel master .. Make Wikibase code base compatible with current DataModel master Calling Item::setId or Property::setId with an integer is not supported any more. We are not using this new DataModel version at the moment, but I am using it's current master in my dev environment. Bug: T151577 Change-Id: I85931ad0d6d1eceef2b0e63906e05ed1d49b055f --- M lib/tests/phpunit/Changes/TestChanges.php M lib/tests/phpunit/EntityRevisionLookupTest.php M lib/tests/phpunit/MockRepositoryTest.php M repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php 4 files changed, 6 insertions(+), 12 deletions(-) Approvals: Ladsgroup: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/tests/phpunit/Changes/TestChanges.php b/lib/tests/phpunit/Changes/TestChanges.php index e876cc0..ec0024d 100644 --- a/lib/tests/phpunit/Changes/TestChanges.php +++ b/lib/tests/phpunit/Changes/TestChanges.php @@ -52,18 +52,15 @@ $changeFactory = self::getEntityChangeFactory(); if ( empty( $changes ) ) { - $empty = Property::newFromType( 'string' ); - $empty->setId( 100 ); + $empty = new Property( new PropertyId( 'P100' ), null, 'string' ); $changes['property-creation'] = $changeFactory->newFromUpdate( EntityChange::ADD, null, $empty ); $changes['property-deletion'] = $changeFactory->newFromUpdate( EntityChange::REMOVE, $empty, null ); // - - $old = Property::newFromType( 'string' ); - $old->setId( 100 ); + $old = new Property( new PropertyId( 'P100' ), null, 'string' ); - $new = Property::newFromType( 'string' ); - $new->setId( 100 ); + $new = new Property( new PropertyId( 'P100' ), null, 'string' ); $new->setLabel( "de", "dummy" ); $changes['property-set-label'] = $changeFactory->newFromUpdate( EntityChange::UPDATE, $old, $new ); diff --git a/lib/tests/phpunit/EntityRevisionLookupTest.php b/lib/tests/phpunit/EntityRevisionLookupTest.php index ecf2692..79562f1 100644 --- a/lib/tests/phpunit/EntityRevisionLookupTest.php +++ b/lib/tests/phpunit/EntityRevisionLookupTest.php @@ -38,8 +38,7 @@ $entities[12] = new EntityRevision( $item, 12, '20130101001200' ); - $prop = Property::newFromType( "string" ); - $prop->setId( 753 ); + $prop = new Property( new PropertyId( 'P753' ), null, 'string' ); $entities[13] = new EntityRevision( $prop, 13, '20130101001300' ); diff --git a/lib/tests/phpunit/MockRepositoryTest.php b/lib/tests/phpunit/MockRepositoryTest.php index 759d567..ece40cb 100644 --- a/lib/tests/phpunit/MockRepositoryTest.php +++ b/lib/tests/phpunit/MockRepositoryTest.php @@ -300,8 +300,7 @@ $three->setLabel( 'de', 'drei' ); $three->setDescription( 'en', 'the third' ); - $prop = Property::newFromType( 'string' ); - $prop->setId( 4 ); + $prop = new Property( new PropertyId( 'P4' ), null, 'string' ); $prop->setLabel( 'en', 'property!' ); $this->repo->putEntity( $one, 1001 ); diff --git a/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php b/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php index 985cba0..ed1f000 100644 --- a/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php +++ b/repo/tests/phpunit/includes/Validators/EntityExistsValidatorTest.php @@ -30,8 +30,7 @@ private function getEntityLookup() { $q8 = new Item( new ItemId( 'Q8' ) ); - $p8 = Property::newFromType( 'string' ); - $p8->setId( 8 ); + $p8 = new Property( new PropertyId( 'P8' ), null, 'string' ); $entityLookup = new MockRepository(); $entityLookup->putEntity( $q8 ); -- To view, visit https://gerrit.wikimedia.org/r/378723 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I85931ad0d6d1eceef2b0e63906e05ed1d49b055f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (WMDE)Gerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Lucas Werkmeister (WMDE) Gerrit-Reviewer: WMDE-leszek Gerrit-Reviewer: jenkins-bot
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Run strval() over the File description
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378642 ) Change subject: Run strval() over the File description .. Run strval() over the File description Bug: T176090 Change-Id: I8488666c221a1bd4e4e063291e74819a07a4a20f --- M includes/export/XmlDumpWriter.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Andrew Bogott: Looks good to me, but someone else must approve jenkins-bot: Verified Anomie: Looks good to me, approved diff --git a/includes/export/XmlDumpWriter.php b/includes/export/XmlDumpWriter.php index 990f16d..c46eb61 100644 --- a/includes/export/XmlDumpWriter.php +++ b/includes/export/XmlDumpWriter.php @@ -403,7 +403,7 @@ if ( $file->isDeleted( File::DELETED_COMMENT ) ) { $comment = Xml::element( 'comment', [ 'deleted' => 'deleted' ] ); } else { - $comment = Xml::elementClean( 'comment', null, $file->getDescription() ); + $comment = Xml::elementClean( 'comment', null, strval( $file->getDescription() ) ); } return "\n" . $this->writeTimestamp( $file->getTimestamp() ) . -- To view, visit https://gerrit.wikimedia.org/r/378642 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8488666c221a1bd4e4e063291e74819a07a4a20f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: ReedyGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: Anomie 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...NavigationTiming[master]: Unbreak navTiming reporting
Krinkle has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378737 ) Change subject: Unbreak navTiming reporting .. Unbreak navTiming reporting Follows-up 3d5946f. The check for '> 0' of the computed relative value being removed in itself was fine, but the problem was that this check was also indirectly used to ensure the original value exists at all and is in fact not also 0. We could add a check for the original value (before subtraction) is above 0 For example: The raw 'secureConnectionStart' value (expected to be a timestamp) may be 0 itself, in which case subtracting navStart produces a negative value. Also, if the key is absent, it would produce NaN which (in JSON) becomes null, which is invalid per the schema declaring it as int, thus the entire beacon packet was being discarded. Bug: T176105 Change-Id: I187505b75ad8f94763d20546eb408139622c617a --- M tests/ext.navigationTiming.test.js 1 file changed, 91 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/NavigationTiming refs/changes/37/378737/1 diff --git a/tests/ext.navigationTiming.test.js b/tests/ext.navigationTiming.test.js index 1891b6d..0abbbad 100644 --- a/tests/ext.navigationTiming.test.js +++ b/tests/ext.navigationTiming.test.js @@ -57,3 +57,94 @@ } } } ); + +// Case with example values typical for a first view +// where DNS, TCP, SSL etc. all need to happen. +QUnit.test( 'First view', function ( assert ) { + var event, expected, key, type, val; + + this.sandbox.stub( window, 'performance', { + timing: { + navigationStart: 100, + fetchStart: 200, + domainLookupStart: 210, + domainLookupEnd: 225, + connectStart: 226, + secureConnectionStart: 235, + connectEnd: 250, + responseStart: 300, + domComplete: 450, + loadEventEnd: 575 + }, + navigation: { + // type: TYPE_NAVIGATE + type: 0, + redirectCount: 0 + } + } ); + require( 'ext.navigationTiming' ).reinit(); + this.sandbox.stub( mw.eventLog, 'logEvent' ); + require( 'ext.navigationTiming' ).emitNavTiming(); + + expected = { + dnsLookup: [ 'number', 15 ], + connectStart: [ 'number', 126 ], + secureConnectionStart: [ 'number', 135 ], + connectEnd: [ 'number', 150 ], + responseStart: [ 'number', 200 ], + domComplete: [ 'number', 350 ], + loadEventEnd: [ 'number', 475 ] + }; + + for ( key in expected ) { + type = expected[ key ][ 0 ]; + val = expected[ key ][ 1 ]; + assert.strictEqual( typeof event[ key ], type, 'Type of event property: ' + key ); + assert.strictEqual( event[ key ], val, 'Value of event property: ' + key ); + } +} ); + +// Case with example values typical for a repeat view +// where DNS, TCP, SSL etc. are cached/re-used. +QUnit.test( 'Repeat view', function ( assert ) { + var event, expected, key, type, val; + + this.sandbox.stub( window, 'performance', { + timing: { + navigationStart: 100, + fetchStart: 200, + domainLookupStart: 200, + domainLookupEnd: 200, + connectStart: 200, + secureConnectionStart: 0, + connectEnd: 200, + responseStart: 300, + domComplete: 450, + loadEventEnd: 575 + }, + navigation: { + // type: TYPE_NAVIGATE + type: 0, + redirectCount: 0 + } + } ); + require( 'ext.navigationTiming' ).reinit(); + this.sandbox.stub( mw.eventLog, 'logEvent' ); + require( 'ext.navigationTiming' ).emitNavTiming(); + + expected = { + dnsLookup: [ 'number', 0 ], + connectStart: [ 'number', 0 ], + connectEnd: [ 'number', 0 ], + responseStart: [ 'number', 100 ], + domComplete: [ 'number', 250 ], + loadEventEnd: [ 'number', 475 ] + }; + + for ( key in expected ) { + type = expected[ key ][ 0 ]; + val = expected[ key ][ 1 ]; + assert.strictEqual( typeof event[ key ], type, 'Type of event property: ' + key ); + assert.strictEqual( event[ key ], val, 'Value of event property: ' + key ); + } +} ); -- To view, visit
[MediaWiki-commits] [Gerrit] operations/dns[master]: depool codfw front edge traffic
BBlack has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378738 ) Change subject: depool codfw front edge traffic .. depool codfw front edge traffic Change-Id: Ie90d29adeedc57aa0c813f86dc07462628796950 --- M admin_state 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dns refs/changes/38/378738/1 diff --git a/admin_state b/admin_state index 54ee433..e95e6b5 100644 --- a/admin_state +++ b/admin_state @@ -72,3 +72,5 @@ ### v T164610 - semi-permanent to avoid confusion until T164609 geoip/misc-addrs/ulsfo => DOWN ### ^ T164610 - semi-permanent to avoid confusion until T164609 + +geoip/generic-map/codfw => DOWN -- To view, visit https://gerrit.wikimedia.org/r/378738 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie90d29adeedc57aa0c813f86dc07462628796950 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: BBlack___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/dns[master]: depool codfw front edge traffic
BBlack has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378738 ) Change subject: depool codfw front edge traffic .. depool codfw front edge traffic Change-Id: Ie90d29adeedc57aa0c813f86dc07462628796950 --- M admin_state 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: BBlack: Looks good to me, approved jenkins-bot: Verified diff --git a/admin_state b/admin_state index 54ee433..e95e6b5 100644 --- a/admin_state +++ b/admin_state @@ -72,3 +72,5 @@ ### v T164610 - semi-permanent to avoid confusion until T164609 geoip/misc-addrs/ulsfo => DOWN ### ^ T164610 - semi-permanent to avoid confusion until T164609 + +geoip/generic-map/codfw => DOWN -- To view, visit https://gerrit.wikimedia.org/r/378738 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie90d29adeedc57aa0c813f86dc07462628796950 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: BBlackGerrit-Reviewer: BBlack Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [fixes] Remove tags arround ISBN numbers
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/313790 ) Change subject: [fixes] Remove tags arround ISBN numbers .. [fixes] Remove tags arround ISBN numbers - add a generator for the tags which could be overwriten by any generator option given to replace.py - also simplify regex groups and fix multiple spaces between ISBN and number Bug: T147180 Change-Id: Ie5942addaee800686cf87ea7c4e57ff68a37ab27 --- M pywikibot/fixes.py 1 file changed, 11 insertions(+), 6 deletions(-) Approvals: Huji: Looks good to me, approved jenkins-bot: Verified Zoranzoki21: Looks good to me, but someone else must approve diff --git a/pywikibot/fixes.py b/pywikibot/fixes.py index 6586cf4..ae5ed7d 100644 --- a/pywikibot/fixes.py +++ b/pywikibot/fixes.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """File containing all standard fixes.""" # -# (C) Pywikibot team, 2008-2010 +# (C) Pywikibot team, 2008-2017 # # Distributed under the terms of the MIT license. # @@ -380,13 +380,15 @@ }, 'isbn': { +'generator': ['-search:insource:/nowiki\>ISBN:?(?:| *)[0-9]/', + '-namespace:0'], 'regex': True, 'msg': 'isbn-formatting', # use i18n translations 'replacements': [ # Remove colon between the word ISBN and the number (r'ISBN: (\d+)', r'ISBN \1'), # superfluous word "number" -(r'ISBN( number| no\.?| No\.?|-Nummer|-Nr\.):? (\d+)', r'ISBN \2'), +(r'ISBN(?: [Nn]umber| [Nn]o\.?|-Nummer|-Nr\.):? (\d+)', r'ISBN \1'), # Space, minus, dot, hypen, en dash, em dash, etc. instead of # hyphen-minus as separator, or spaces between digits and separators. # Note that these regular expressions also match valid ISBNs, but @@ -402,8 +404,11 @@ (r'ISBN (\d+) *[\- −.‐-―] *(\d+) *[\- −.‐-―] *(\d+) *[\- −.‐-―] *(\d|X|x)(?!\d)', r'ISBN \1-\2-\3-\4'), # ISBN-10 # missing space before ISBN-10 or before ISBN-13, -# or non-breaking space. -(r'ISBN(|| )((\d(-?)){12}\d|(\d(-?)){9}[\dXx])', r'ISBN \2'), +# or multiple spaces or non-breaking space. +(r'ISBN(?: *|)((\d(-?)){12}\d|(\d(-?)){9}[\dXx])', + r'ISBN \1'), +# remove tags +(r'ISBN ([0-9\-xX]+)', r'ISBN \1'), ], 'exceptions': { 'inside-tags': [ @@ -411,8 +416,8 @@ 'hyperlink', ], 'inside': [ -r'ISBN (\d(-?)){12}\d', # matches valid ISBN-13s -r'ISBN (\d(-?)){9}[\dXx]', # matches valid ISBN-10s +r'ISBN (97[89]-?)(\d-?){9}\d', # matches valid ISBN-13s +r'ISBN (\d-?){9}[\dXx]', # matches valid ISBN-10s ], } }, -- To view, visit https://gerrit.wikimedia.org/r/313790 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie5942addaee800686cf87ea7c4e57ff68a37ab27 Gerrit-PatchSet: 9 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: XqtGerrit-Reviewer: Dalba Gerrit-Reviewer: Huji Gerrit-Reviewer: John Vandenberg Gerrit-Reviewer: Magul Gerrit-Reviewer: Matěj Suchánek Gerrit-Reviewer: Mpaa Gerrit-Reviewer: Whym Gerrit-Reviewer: Xqt Gerrit-Reviewer: Zoranzoki21 Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Fix header edit button tint (once more, with feeling)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378129 ) Change subject: Fix header edit button tint (once more, with feeling) .. Fix header edit button tint (once more, with feeling) Confirmed the fix on API levels 16 and 25. Bug: T172157 Change-Id: I2d8fa75b78a2764e543857e608a6e22734f541f1 --- M app/src/main/res/layout/view_page_header.xml M app/src/main/res/values/attrs.xml M app/src/main/res/values/styles_dark.xml M app/src/main/res/values/styles_light.xml 4 files changed, 13 insertions(+), 4 deletions(-) Approvals: Dbrant: Looks good to me, approved jenkins-bot: Verified diff --git a/app/src/main/res/layout/view_page_header.xml b/app/src/main/res/layout/view_page_header.xml index 3f12821..268b45e 100644 --- a/app/src/main/res/layout/view_page_header.xml +++ b/app/src/main/res/layout/view_page_header.xml @@ -71,9 +71,8 @@ android:layout_marginRight="@dimen/edit_pencil_horizontal_margin" android:layout_gravity="bottom|end" app:srcCompat="@drawable/ic_mode_edit_white_24dp" +style="?attr/header_edit_button" android:scaleType="fitCenter" -android:tint="?android:attr/textColorSecondary" -android:alpha="?attr/page_header_edit_pencil_alpha" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="@string/article_header_edit_hint" /> diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index f3c7e86..1cf27c9 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -47,6 +47,7 @@ + diff --git a/app/src/main/res/values/styles_dark.xml b/app/src/main/res/values/styles_dark.xml index b867993..bafbab0 100644 --- a/app/src/main/res/values/styles_dark.xml +++ b/app/src/main/res/values/styles_dark.xml @@ -64,6 +64,7 @@ @color/feed_text_tertiary_dark @color/base12 @color/base14 +@style/HeaderEditButtonDark @color/accent75 @style/HorizontalDividerDark @@ -93,4 +94,9 @@ 0.20 + +- @color/base100
+- 0.7
+ + diff --git a/app/src/main/res/values/styles_light.xml b/app/src/main/res/values/styles_light.xml index 285fb13..9779d3b 100644 --- a/app/src/main/res/values/styles_light.xml +++ b/app/src/main/res/values/styles_light.xml @@ -52,8 +52,6 @@ @color/link_preview_offline_text_light @color/list_item_text_primary_light @color/list_item_text_secondary_light -0.55 - @color/base80 @android:color/white @color/color_state_nav_tab_light @@ -65,6 +63,7 @@ @color/feed_text_tertiary_light @color/base100 @color/base100 +@style/HeaderEditButtonLight @color/accent50 @style/HorizontalDividerLight @@ -96,4 +95,8 @@ 0.12 + +- 0.55
+ + -- To view, visit https://gerrit.wikimedia.org/r/378129 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2d8fa75b78a2764e543857e608a6e22734f541f1 Gerrit-PatchSet: 3 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: MhollowayGerrit-Reviewer: Brion VIBBER Gerrit-Reviewer: Cooltey Gerrit-Reviewer: Dbrant Gerrit-Reviewer: Sharvaniharan Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: pagePreviews: Stop A/B test on enwiki and dewiki
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378686 ) Change subject: pagePreviews: Stop A/B test on enwiki and dewiki .. pagePreviews: Stop A/B test on enwiki and dewiki Changes: * Remove A/B test configuration for all wikis. * Disable EventLogging instrumentation on all wikis. * Revert the Page Previews feature to a beta feature on enwiki and dewiki. This also has the effect of disabling the feature for logged out users. Bug: T176068 Change-Id: Ia69d651dc7d0f3971252b30b9d3c9fff9809e372 --- M wmf-config/InitialiseSettings.php 1 file changed, 3 insertions(+), 8 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index d113835..fdbae50 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -13586,9 +13586,6 @@ // stage 0 and stage 1 wikis. 'pp_stage0' => true, 'pp_stage1' => true, - // T172291 - 'enwiki' => true, - 'dewiki' => true, ], 'wgPopupsPageBlacklist' => [ @@ -13616,6 +13613,8 @@ 'wmgPopupsBetaFeature' => [ 'default' => false, + 'enwiki' => true, + 'dewiki' => true, ], 'wgPopupsStatsvSamplingRate' => [ @@ -13625,16 +13624,12 @@ ], 'wgPopupsAnonsExperimentalGroupSize' => [ - // Read: Enable previews for all anonymous users by default, which is the current behaviour on all wikis except enwiki and dewiki per T162672. + // Read: Enable previews for all anonymous users by default. 'default' => 0, - 'enwiki' => 0.06, - 'dewiki' => 0.16, ], 'wgPopupsEventLogging' => [ 'default' => false, - 'enwiki' => true, - 'dewiki' => true, ], 'wgPopupsGateway' => [ -- To view, visit https://gerrit.wikimedia.org/r/378686 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia69d651dc7d0f3971252b30b9d3c9fff9809e372 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: PhuedxGerrit-Reviewer: Hashar Gerrit-Reviewer: Urbanecm 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]: Lists: Change zen.spamhaus.org DNSBL action from warn to drop
Herron has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378697 ) Change subject: Lists: Change zen.spamhaus.org DNSBL action from warn to drop .. Lists: Change zen.spamhaus.org DNSBL action from warn to drop Drop conncetions from IP addresses listed in zen.spamhaus.org DNSBL Bug: T175878 Change-Id: I92633699cde8bcf1767b6499734712e0951d88ab --- M modules/profile/templates/exim/exim4.conf.mailman.erb 1 file changed, 3 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/97/378697/1 diff --git a/modules/profile/templates/exim/exim4.conf.mailman.erb b/modules/profile/templates/exim/exim4.conf.mailman.erb index f0a8606..fc5c2c0 100644 --- a/modules/profile/templates/exim/exim4.conf.mailman.erb +++ b/modules/profile/templates/exim/exim4.conf.mailman.erb @@ -125,12 +125,10 @@ # Check whether the sender address domain exists require verify = sender - # Reject messages from IP addresses listed in DNSBL - # This is a warn for testing. After testing... - # * Change to delay & drop - # * Change log_message to message - warn log_message = $sender_host_address is listed by $dnslist_domain ($dnslist_value: $dnslist_text) + # Drop connections from IP addresses listed in DNSBL + drop message = $sender_host_address is listed by $dnslist_domain ($dnslist_value: $dnslist_text) dnslists = zen.spamhaus.org + delay 15s accept -- To view, visit https://gerrit.wikimedia.org/r/378697 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I92633699cde8bcf1767b6499734712e0951d88ab Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Herron___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...EventBus[master]: [Tests] Added several basic tests to static helpers
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378694 ) Change subject: [Tests] Added several basic tests to static helpers .. [Tests] Added several basic tests to static helpers This doesn't really provide great coverage yet, but it's better then nothing. These tests mostly verify that static helper methods work under normal conditions. Bug: T175958 Change-Id: Id304d449b5c083d965e117acdf7eb3efda9cf02e --- M tests/phpunit/EventBusTest.php 1 file changed, 115 insertions(+), 3 deletions(-) Approvals: Mobrovac: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/EventBusTest.php b/tests/phpunit/EventBusTest.php index 74ce178..d3fbbdd 100644 --- a/tests/phpunit/EventBusTest.php +++ b/tests/phpunit/EventBusTest.php @@ -1,8 +1,120 @@ assertTrue( true ); + public function testCreateEvent() { + $event = EventBus::createEvent( + 'http://test.wikipedia.org/wiki/TestPage', + 'test_topic', + [ + 'test_property_string' => 'test_value', + 'test_property_int'=> 42 + ] + ); + + $this->assertNotNull( $event ); + + // Meta property checks + $this->assertNotNull( $event['meta'] ); + $this->assertEquals( 'http://test.wikipedia.org/wiki/TestPage', $event['meta']['uri'] ); + $this->assertEquals( 'test_topic', $event['meta']['topic'] ); + $this->assertNotNull( $event['meta']['request_id'] ); + $this->assertNotNull( $event['meta']['id'] ); + $this->assertNotNull( $event['meta']['dt'] ); + $this->assertNotNull( $event['meta']['domain'] ); + + // Event properties checks + $this->assertEquals( 'test_value', $event['test_property_string'] ); + $this->assertEquals( 42, $event['test_property_int'] ); + } + + public function testGetArticleURL() { + $url = EventBus::getArticleURL( Title::newFromDBkey( 'Main_Page' ) ); + $this->assertStringEndsWith( 'Main_Page', $url ); + } + + public function testCreatePerformerAttrs() { + $user = $this->getTestUser( [ 'testers' ] )->getUser(); + $performerAttrs = EventBus::createPerformerAttrs( $user ); + + $this->assertEquals( $user->getName(), $performerAttrs['user_text'] ); + $this->assertContains( 'testers', $performerAttrs['user_groups'] ); + $this->assertFalse( $performerAttrs['user_is_bot'] ); + $this->assertEquals( 0, $performerAttrs['user_edit_count'] ); + $this->assertEquals( $user->getId(), $performerAttrs['user_id'] ); + } + + function newTestRevision( $text, $title = "Test", + $model = CONTENT_MODEL_WIKITEXT, $format = null + ) { + if ( is_string( $title ) ) { + $title = Title::newFromText( $title ); + } + + $content = ContentHandler::makeContent( $text, $title, $model, $format ); + + $rev = new Revision( + [ + 'id' => 42, + 'page' => 23, + 'title' => $title, + + 'content' => $content, + 'length' => $content->getSize(), + 'comment' => "testing", + 'minor_edit' => false, + + 'content_format' => $format, + ] + ); + + return $rev; + } + + public function testCreateRevisionAttrs() { + global $wgDBname; + + $title = Title::newFromText( 'Test' ); + $content = ContentHandler::makeContent( + 'Bla bla bla', + $title, + CONTENT_MODEL_WIKITEXT, + null ); + + $rev = new Revision( + [ + 'id' => 42, + 'page' => 23, + 'title' => $title, + 'rev_user' => $this->getTestUser( [ 'testers' ] ), + + 'content' => $content, + 'length' => $content->getSize(), + 'comment' => "testing", + 'minor_edit' => false, + + 'content_format' => null, + ] + ); + + $revisionAttrs = EventBus::createRevisionAttrs( $rev ); + +
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAuthors[master]: Initial commit
Nasty has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378711 ) Change subject: Initial commit .. Initial commit Change-Id: Ifad9bdd7361f5bf3c61eac1503891b890933d343 --- A .gitreview A Authors.class.php A composer.json A doc/Hooks.txt A extension.json A i18n/ast.json A i18n/ba.json A i18n/bcc.json A i18n/bn.json A i18n/br.json A i18n/ca.json A i18n/ce.json A i18n/de.json A i18n/diq.json A i18n/el.json A i18n/en.json A i18n/es.json A i18n/et.json A i18n/eu.json A i18n/fa.json A i18n/fr.json A i18n/gl.json A i18n/gu.json A i18n/he.json A i18n/hi.json A i18n/hu.json A i18n/ia.json A i18n/id.json A i18n/it.json A i18n/ja.json A i18n/kn.json A i18n/ko.json A i18n/ksh.json A i18n/lb.json A i18n/lt.json A i18n/lv.json A i18n/mk.json A i18n/mr.json A i18n/nb.json A i18n/nl.json A i18n/oc.json A i18n/pl.json A i18n/ps.json A i18n/pt-br.json A i18n/pt.json A i18n/qqq.json A i18n/roa-tara.json A i18n/ru.json A i18n/sl.json A i18n/sv.json A i18n/tr.json A i18n/uk.json A i18n/vi.json A i18n/zh-hans.json A i18n/zh-hant.json A languages/Authors.i18n.magic.php A resources/bluespice.authors.css A resources/images/bs-author-orig-bg.png A resources/images/more-users_v2.png A views/view.Authors.php A views/view.AuthorsUserPageProfileImageSetting.php 61 files changed, 1,445 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceAuthors refs/changes/11/378711/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 000..bee6799 --- /dev/null +++ b/.gitreview @@ -0,0 +1,6 @@ +[gerrit] +host=gerrit.wikimedia.org +port=29418 +project=mediawiki/extensions/BlueSpiceAuthors.git +track=1 +defaultrebase=0 diff --git a/Authors.class.php b/Authors.class.php new file mode 100644 index 000..22bc111 --- /dev/null +++ b/Authors.class.php @@ -0,0 +1,337 @@ +http://www.bluespice.com + * + * @author Markus Glaser+ * @author Robert Vogel + * @version2.23.1 + * @packageBlueSpice_Extensions + * @subpackage Authors + * @copyright Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved. + * @licensehttp://www.gnu.org/copyleft/gpl.html GNU Public License v2 or later + * @filesource + */ + +//Last review MRG (30.06.11 10:25) + +/** + * Base class for Authors extension + * @package BlueSpice_Extensions + * @subpackage Authors + */ +class Authors extends BsExtensionMW { + + /** +* Initialization of Authors extension +*/ + protected function initExt() { + wfProfileIn( 'BS::'.__METHOD__ ); + // Hooks + $this->setHook( 'SkinTemplateOutputPageBeforeExec' ); + $this->setHook( 'BeforePageDisplay' ); + $this->setHook( 'BSInsertMagicAjaxGetData' ); + $this->setHook( 'BS:UserPageSettings', 'onUserPageSettings' ); + $this->setHook( 'PageContentSave' ); + + BsConfig::registerVar( 'MW::Authors::Blacklist', array( 'MediaWiki default' ), BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_ARRAY_STRING ); + BsConfig::registerVar( 'MW::Authors::Limit', 10, BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_INT, 'bs-authors-pref-limit', 'int' ); + BsConfig::registerVar( 'MW::Authors::MoreImage', 'more-users_v2.png', BsConfig::LEVEL_PRIVATE|BsConfig::TYPE_STRING ); + BsConfig::registerVar( 'MW::Authors::Show',true, BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_BOOL, 'bs-authors-pref-show', 'toggle' ); + + $this->mCore->registerBehaviorSwitch( 'bs_noauthors' ); + + wfProfileOut( 'BS::'.__METHOD__ ); + } + + /** +* Inject tags into InsertMagic +* @param Object $oResponse reference +* $param String $type +* @return always true to keep hook running +*/ + public function onBSInsertMagicAjaxGetData( &$oResponse, $type ) { + if( $type != 'switches' ) return true; + + $oDescriptor = new stdClass(); + $oDescriptor->id = 'bs:authors'; + $oDescriptor->type = 'switch'; + $oDescriptor->name = 'NOAUTHORS'; + $oDescriptor->desc = wfMessage( 'bs-authors-switch-description' )->plain(); + $oDescriptor->code = '__NOAUTHORS__'; + $oDescriptor->previewable = false; + $oResponse->result[] = $oDescriptor; + + return true; + } + + /** +* Hook-Handler for MediaWiki 'BeforePageDisplay' hook. Sets context if needed. +* @param OutputPage $oOutputPage +* @param Skin $oSkin +* @return bool +*/ + public function onBeforePageDisplay( &$oOutputPage, &$oSkin ) { + if ( $this->checkContext() === false ) return true; +
[MediaWiki-commits] [Gerrit] operations/puppet[production]: eventlogging_cleaner.py: add feature to pick start_ts from file
Elukey has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378236 ) Change subject: eventlogging_cleaner.py: add feature to pick start_ts from file .. eventlogging_cleaner.py: add feature to pick start_ts from file If the script is run in a cron file it might be useful to have an option to pick the start_ts from a file, and eventually replace it with the end_ts if all the sanitization batches terminates correctly. Bug: T156933 Change-Id: I58ac856f7d6d6df4ba872923fd8531b15661f271 --- M modules/role/files/mariadb/eventlogging_cleaner.py 1 file changed, 81 insertions(+), 24 deletions(-) Approvals: Elukey: Looks good to me, approved jenkins-bot: Verified Volans: Looks good to me, but someone else must approve diff --git a/modules/role/files/mariadb/eventlogging_cleaner.py b/modules/role/files/mariadb/eventlogging_cleaner.py index 886cead..da1c5a9 100644 --- a/modules/role/files/mariadb/eventlogging_cleaner.py +++ b/modules/role/files/mariadb/eventlogging_cleaner.py @@ -187,19 +187,16 @@ class Terminator(object): -def __init__(self, database, whitelist, newer_than, older_than, +def __init__(self, database, whitelist, start_ts, end_ts, batch_size, sleep_between_batches, dry_run=False): self.reference_time = datetime.utcnow() self.database = database self.whitelist = whitelist -self.start = self.relative_ts(newer_than) -self.end = self.relative_ts(older_than) +self.start = start_ts +self.end = end_ts self.batch_size = batch_size self.sleep_between_batches = sleep_between_batches self.dry_run = dry_run - -def relative_ts(self, days): -return (self.reference_time - timedelta(days=days)).strftime(DATE_FORMAT) def purge(self, table): """ @@ -231,7 +228,7 @@ between start_ts and self.end, return the timestamp of the last one. If there are no events between start_ts and self.end, return None. """ -if start_ts > self.end: +if datetime.strptime(start_ts, DATE_FORMAT) > datetime.strptime(self.end, DATE_FORMAT): return None command = ( @@ -390,6 +387,10 @@ return whitelist_hash +def relative_ts(reference_time, days): +return (reference_time - timedelta(days=days)).strftime(DATE_FORMAT) + + if __name__ == '__main__': parser = argparse.ArgumentParser(description='EventLogging data ' 'retention script') @@ -407,9 +408,15 @@ parser.add_argument('--older-than', dest='older_than', default=90, type=int, help='Delete logs older than this number of days' ' (default: 90)') -parser.add_argument('--newer-than', dest='newer_than', default=91, type=int, -help='Delete logs newer than this number of days' -' (default: 91)') +parser.add_argument('--newer-than', dest='newer_than', type=int, default=0, +help='Delete logs newer than this number of days') +parser.add_argument('--start-ts-file', dest='start_ts_file', default=None, +help="Ignore the --newer-than option and read the start timestamp " + "from the file path indicated as argument. This option is " + "useful when the script is used in cron, since any failure " + "could lead to sanitization gaps. The file is expected to " + "have a single line containing the start timestamp in the " + "format {}.".format(DATE_FORMAT.replace('%', '%%'))) parser.add_argument('--dry-run', dest='dry_run', action='store_true', help='Only print sql commands without executing them') parser.add_argument('--batch-size', dest='batch_size', default=1000, type=int, @@ -465,6 +472,20 @@ ) sys.exit(1) +if args.newer_than > 0 and args.start_ts_file: +log.error( +"Only one between --newer-than and " +"--start-ts-file can be specified." +) +sys.exit(1) + +if not (args.newer_than > 0 or args.start_ts_file): +log.error( +"One parameter between --newer-than and " +"--start-ts-file is required." +) +sys.exit(1) + if args.older_than < 90: log.error( "Attempt to delete data older than ({}) days " @@ -473,12 +494,29 @@ ) sys.exit(1) -if args.newer_than <= args.older_than: -log.error("--newer-than must be stricly greater than --older-than") -sys.exit(1) - try: database = None + +# Establish start/end timestamps from command line args +now = datetime.utcnow() +end_ts =
[MediaWiki-commits] [Gerrit] mediawiki...BetaFeatures[wmf/1.30.0-wmf.18]: Temporary log all the executions of the update job.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378222 ) Change subject: Temporary log all the executions of the update job. .. Temporary log all the executions of the update job. As a part of migration to the EventBus based JobQueue, we've started to double-process the UpdateBetaFeatureUserCountsJob. In order to verify correctness and compare 2 queue implementations, we will temporary log all the executions of the job and then match the logs between old and new pipelines. The job is extremelly low volume, ~0.1/s, so we would not flood the logs. See also: https://gerrit.wikimedia.org/r/#/c/378078 Bug: T175637 Change-Id: I9d0345292a63e5516aae727de7c047117faa5ae0 --- M includes/UpdateBetaFeatureUserCountsJob.php 1 file changed, 14 insertions(+), 0 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/UpdateBetaFeatureUserCountsJob.php b/includes/UpdateBetaFeatureUserCountsJob.php index f354e08..916d1ca 100644 --- a/includes/UpdateBetaFeatureUserCountsJob.php +++ b/includes/UpdateBetaFeatureUserCountsJob.php @@ -23,11 +23,18 @@ * @license GNU General Public License version 2 or later */ +use MediaWiki\Logger\LoggerFactory; + class UpdateBetaFeatureUserCountsJob extends Job { + + /** @var \Psr\Log\LoggerInterface */ + private $logger; + public function __construct( $title, $params ) { parent::__construct( 'updateBetaFeaturesUserCounts', $title, $params ); $this->removeDuplicates = true; + $this->logger = LoggerFactory::getInstance( 'updateBetaFeaturesUserCounts' ); } /** @@ -36,6 +43,13 @@ * @return bool */ public function run() { + // Temporarily log all the jobs in order to compare old redis JobQueue with EventBus + // JobQueue pipeline. This event is very low-volume (~0.1 events per second), so we + // will not overload the logs. + // Jobs delivered by EventBus will have the 'pipeline' property set to EventBus + // so that the corresponding jobs can be matched together using the requestId. + $this->logger->info( 'Executing', $this->params ); + $dbw = wfGetDB( DB_MASTER ); $res = $dbw->select( -- To view, visit https://gerrit.wikimedia.org/r/378222 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9d0345292a63e5516aae727de7c047117faa5ae0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BetaFeatures Gerrit-Branch: wmf/1.30.0-wmf.18 Gerrit-Owner: MobrovacGerrit-Reviewer: Hashar Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Ppchelko Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Block same-file reuploads
Matthias Mullie has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378702 ) Change subject: Block same-file reuploads .. Block same-file reuploads When uploading a file, there are a few ways of checking for and blocking (or at least warning about) duplicate uploads already. However, it occasionally seems to happen that files get uploaded twice. The exact same file, usually - submitted at (almost) the exact same time (possibly some error in whatever submits the file upload, but still) Given 2 uploads at (almost) the exact same time, both of them are stored, even if they are the exact same files. The last upload also ends up with a `logging` entry with `log_page = 0`. I don’t believe such upload should go through: if we do find that a file is an exact duplicate of something that already exists, I don’t see any reason it should go through. Note that with this patch, it will become impossible to reupload a file with the exact same hash (which was possible before.) If we still want to allow same-file reuploads while also blocking these kind of race-condition same-uploads, we could make the check more strict (e.g. also check timestamps, or check if page already exists, or …) Bug: T158480 Change-Id: I76cbd2c64c3b893997f1f85974d6f82cbfe121e1 --- M includes/filerepo/file/LocalFile.php M maintenance/importImages.php 2 files changed, 29 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/02/378702/1 diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 96e7a7e..9697d7e 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1244,8 +1244,14 @@ // Once the second operation goes through, then the current version was // updated and we must therefore update the DB too. $oldver = $status->value; - if ( !$this->recordUpload2( $oldver, $comment, $pageText, $props, $timestamp, $user, $tags ) ) { - $status->fatal( 'filenotfound', $srcPath ); + $uploadStatus = $this->recordUpload2( $oldver, $comment, $pageText, $props, $timestamp, $user, $tags ); + if ( !$uploadStatus->isOK() ) { + if ( $uploadStatus->hasMessage( 'filenotfound' ) ) { + // update filenotfound error with more specific path + $status->fatal( 'filenotfound', $srcPath ); + } else { + $status->merge( $uploadStatus ); + } } } @@ -1275,7 +1281,7 @@ $pageText = SpecialUpload::getInitialPageText( $desc, $license, $copyStatus, $source ); - if ( !$this->recordUpload2( $oldver, $desc, $pageText, false, $timestamp, $user ) ) { + if ( !$this->recordUpload2( $oldver, $desc, $pageText, false, $timestamp, $user )->isOK() ) { return false; } @@ -1295,7 +1301,7 @@ * @param string|bool $timestamp * @param null|User $user * @param string[] $tags -* @return bool +* @return Status */ function recordUpload2( $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null, $tags = [] @@ -1329,7 +1335,7 @@ if ( !$this->fileExists ) { wfDebug( __METHOD__ . ": File " . $this->getRel() . " went missing!\n" ); - return false; + return Status::newFatal( 'filenotfound', $this->getRel() ); } $dbw->startAtomic( __METHOD__ ); @@ -1362,16 +1368,24 @@ $reupload = ( $dbw->affectedRows() == 0 ); if ( $reupload ) { + $row = $dbw->selectRow( + 'image', + [ 'img_timestamp', 'img_sha1' ], + [ 'img_name' => $this->getName() ], + __METHOD__, + [ 'LOCK IN SHARE MODE' ] + ); + + if ( $row && $row->img_sha1 === $this->sha1 ) { + $dbw->endAtomic( __METHOD__ ); + wfDebug( __METHOD__ . ": File " . $this->getRel() . " already exists!\n" ); + $title = Title::newFromText( $this->getName(), NS_FILE ); + return Status::newFatal( 'fileexists-no-change', $title->getPrefixedText() ); + } + if ( $allowTimeKludge ) { # Use LOCK IN
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: [Logging config] Enable logging for updateBetaFeaturesUserCo...
Ppchelko has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378703 ) Change subject: [Logging config] Enable logging for updateBetaFeaturesUserCounts .. [Logging config] Enable logging for updateBetaFeaturesUserCounts See also: I9d0345292a63e5516aae727de7c047117faa5ae0 Change-Id: Ieb8bbc94fca9d1f8a33af45b0e11a1d79b7ec78c --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/03/378703/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index fdbae50..fdda6c9 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -5212,6 +5212,7 @@ 'ts_badpass' => 'debug', 'UpdateRepo' => 'debug', 'updateTranstagOnNullRevisions' => 'debug', +'updateBetaFeaturesUserCounts' => 'info', // T175637 'upload' => 'debug', 'wfLogDBError' => 'debug', // Former $wgDBerrorLog 'wikibase-debug' => 'debug', -- To view, visit https://gerrit.wikimedia.org/r/378703 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb8bbc94fca9d1f8a33af45b0e11a1d79b7ec78c Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Ppchelko___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...BlueSpiceAuthors[master]: Removed unused files
Robert Vogel has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378710 ) Change subject: Removed unused files .. Removed unused files Change-Id: I2a9587e172c9e4a187c60dfee21bcf7f954f99b2 --- D groups D project.config 2 files changed, 0 insertions(+), 15 deletions(-) Approvals: Robert Vogel: Verified; Looks good to me, approved diff --git a/groups b/groups deleted file mode 100644 index 28d0fcc..000 --- a/groups +++ /dev/null @@ -1,4 +0,0 @@ -# UUID Group Name -# -96de72a7678707ad71b6ff789626aab7b2244b6f extension-BlueSpiceAuthors -f7087318186de2eac3b21b63abd2a145035455a3 bluespice diff --git a/project.config b/project.config deleted file mode 100644 index b80c871..000 --- a/project.config +++ /dev/null @@ -1,11 +0,0 @@ -[project] - description = MediaWiki extension BlueSpiceAuthors -[access] - inheritFrom = mediawiki/extensions -[receive] - requireChangeId = true -[submit] - mergeContent = true -[access "refs/*"] - owner = group bluespice - owner = group extension-BlueSpiceAuthors -- To view, visit https://gerrit.wikimedia.org/r/378710 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2a9587e172c9e4a187c60dfee21bcf7f954f99b2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceAuthors Gerrit-Branch: master Gerrit-Owner: NastyGerrit-Reviewer: Robert Vogel ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.18]: Return description fields for unprefixed image cache rows
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378712 ) Change subject: Return description fields for unprefixed image cache rows .. Return description fields for unprefixed image cache rows Bug: T175444 Change-Id: I5560187d3850253095b695dc7a3cfc954fba9318 --- M includes/filerepo/file/LocalFile.php 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Reedy: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 96e7a7e..4c0dea2 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -351,9 +351,8 @@ static $results = []; if ( $prefix == '' ) { - return $fields; + return array_merge( $fields, [ 'description' ] ); } - if ( !isset( $results[$prefix] ) ) { $prefixedFields = []; foreach ( $fields as $field ) { -- To view, visit https://gerrit.wikimedia.org/r/378712 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5560187d3850253095b695dc7a3cfc954fba9318 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.18 Gerrit-Owner: ReedyGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: MX: Add zen.spamhaus.org DNSBL check to MTA rcpt acl
Herron has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378717 ) Change subject: MX: Add zen.spamhaus.org DNSBL check to MTA rcpt acl .. MX: Add zen.spamhaus.org DNSBL check to MTA rcpt acl Today messages from hosts listed in zen.spamhaus.org are given a spam score of ~3.5. In some cases this allows messages from known spam sources to continue onward towards delivery. This change will warn (for the purposes of testing) if a blacklisted host connects directly to the wikimedia.org mx systems. Pending successful testing, a follow-up change will update the acl action from warn to delay and drop (with a useful 5xx error message). Bug: T175879 Change-Id: I0ba0441097e69784e582fb98a6d742b984ef348d --- M modules/role/templates/exim/exim4.conf.mx.erb 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Herron: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/role/templates/exim/exim4.conf.mx.erb b/modules/role/templates/exim/exim4.conf.mx.erb index 5ef35c7..7cf76d4 100644 --- a/modules/role/templates/exim/exim4.conf.mx.erb +++ b/modules/role/templates/exim/exim4.conf.mx.erb @@ -156,6 +156,13 @@ # Check whether the sender address domain exists require verify = sender + # Drop connections from IP addresses listed in DNSBL + # This is a warn for testing. After testing... + # * Change to delay & drop + # * Change log_message to message + warn log_message = $sender_host_address is listed by $dnslist_domain ($dnslist_value: $dnslist_text) + dnslists = zen.spamhaus.org + accept acl_check_connect: -- To view, visit https://gerrit.wikimedia.org/r/378717 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ba0441097e69784e582fb98a6d742b984ef348d Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: HerronGerrit-Reviewer: Giuseppe Lavagetto Gerrit-Reviewer: Herron 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...WikibaseLexeme[master]: Better JSON wellformedness check AddFormRequestParser
WMDE-leszek has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378721 ) Change subject: Better JSON wellformedness check AddFormRequestParser .. Better JSON wellformedness check AddFormRequestParser Change-Id: Iff4f91b7ffd27d6cb705c54d9b42386b7db75e6e --- M src/Api/AddFormRequestParser.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme refs/changes/21/378721/1 diff --git a/src/Api/AddFormRequestParser.php b/src/Api/AddFormRequestParser.php index bb2a7aa..f19f64a 100644 --- a/src/Api/AddFormRequestParser.php +++ b/src/Api/AddFormRequestParser.php @@ -33,7 +33,7 @@ } $data = json_decode( $params['data'], true ); - if ( $data === null ) { + if ( json_last_error() !== JSON_ERROR_NONE ) { return AddFormRequestParserResult::newWithErrors( [ 'data-invalid-json' ] ); } -- To view, visit https://gerrit.wikimedia.org/r/378721 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff4f91b7ffd27d6cb705c54d9b42386b7db75e6e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseLexeme Gerrit-Branch: master Gerrit-Owner: WMDE-leszek___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Meta(Talk)Namespace configuration for be.wiktionary
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378234 ) Change subject: Meta(Talk)Namespace configuration for be.wiktionary .. Meta(Talk)Namespace configuration for be.wiktionary Bug: T175950 Change-Id: I84d50745267ca99e79d970e5237cacf3c9196551 --- M wmf-config/InitialiseSettings.php 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified Zoranzoki21: Looks good to me, but someone else must approve diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index fdbae50..ff8aa65 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -2558,6 +2558,7 @@ 'be_x_oldwiki' => 'Вікіпэдыя', 'bewiki' => 'Вікіпедыя', 'bewikisource' => 'Вікікрыніцы', + 'bewiktionary' => 'Вікіслоўнік', // T175950 'bgwiki' => 'Уикипедия', 'bgwikibooks' => 'Уикикниги', 'bgwikinews' => 'Уикиновини', @@ -2978,6 +2979,7 @@ 'bawikibooks' => 'Викидәреслек_буйынса_фекерләшеү', // T173471 'bdwikimedia' => 'উইকিমিডিয়া_বাংলাদেশ_আলোচনা', 'bewikisource' => 'Размовы_пра_Вікікрыніцы', + 'bewiktionary' => 'Размовы_пра_Вікіслоўнік', // T175950 'bswiki' => 'Razgovor_s_Wikipedijom', // T115812 'bswiktionary' => 'Razgovor_s_Wikirječnikom', 'cuwiki' => 'Википєдїѩ_бєсѣда', // T123654 -- To view, visit https://gerrit.wikimedia.org/r/378234 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I84d50745267ca99e79d970e5237cacf3c9196551 Gerrit-PatchSet: 3 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MarcoAurelioGerrit-Reviewer: Hashar Gerrit-Reviewer: Urbanecm Gerrit-Reviewer: Zoranzoki21 Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Move nfs and directory setup for dumpsdata hosts into dumps ...
ArielGlenn has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378701 ) Change subject: Move nfs and directory setup for dumpsdata hosts into dumps module .. Move nfs and directory setup for dumpsdata hosts into dumps module Best for all dumps-related manifests to be in one module to the extent possible. Bug: T175606 Change-Id: I5d9acb5b6059bcb9fdf5d6440159123ae8c9b7d7 --- M manifests/site.pp A modules/dumps/manifests/generation/client/nfs.pp R modules/dumps/manifests/generation/server/dirs.pp R modules/dumps/manifests/generation/server/nfs.pp R modules/dumps/templates/generation/default-nfs-common.erb R modules/dumps/templates/generation/default-nfs-kernel-server.erb R modules/dumps/templates/generation/nfs_exports.erb R modules/profile/manifests/dumps/generation/server.pp M modules/profile/manifests/dumps/nfs_server.pp A modules/role/manifests/dumps/generation/server.pp D modules/role/manifests/dumpsdata.pp 11 files changed, 56 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/01/378701/1 diff --git a/manifests/site.pp b/manifests/site.pp index 72e06d3..a2c9be0 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -785,7 +785,7 @@ } node /^dumpsdata100[12].eqiad.wmnet$/ { -role(dumpsdata) +role(dumps::generation::server) } node 'eeden.wikimedia.org' { diff --git a/modules/dumps/manifests/generation/client/nfs.pp b/modules/dumps/manifests/generation/client/nfs.pp new file mode 100644 index 000..7f2ea1b --- /dev/null +++ b/modules/dumps/manifests/generation/client/nfs.pp @@ -0,0 +1,22 @@ +class dumps::generation::client::nfs { +require_package('nfs-common') + +file { [ '/mnt/dumpsdata' ]: +ensure => 'directory', +} + +$dumpsdataserver = $::site ? { +'eqiad' => 'dumpsdata1001.eqiad.wmnet', +default => 'dumpsdata1001.eqiad.wmnet', +} + +mount { '/mnt/dumpsdata': +ensure => 'mounted', +device => "${dumpsdataserver}:/data", +fstype => 'nfs', +name => '/mnt/dumpsdata', +options => 'bg,hard,tcp,rsize=8192,wsize=8192,intr,nfsvers=3', +require => File['/mnt/dumpsdata'], +remounts => false, +} +} diff --git a/modules/dumpsdirs/manifests/init.pp b/modules/dumps/manifests/generation/server/dirs.pp similarity index 100% rename from modules/dumpsdirs/manifests/init.pp rename to modules/dumps/manifests/generation/server/dirs.pp diff --git a/modules/dumpsnfs/manifests/init.pp b/modules/dumps/manifests/generation/server/nfs.pp similarity index 82% rename from modules/dumpsnfs/manifests/init.pp rename to modules/dumps/manifests/generation/server/nfs.pp index 45a2afd..32ff18f 100644 --- a/modules/dumpsnfs/manifests/init.pp +++ b/modules/dumps/manifests/generation/server/nfs.pp @@ -10,7 +10,7 @@ mode=> '0444', owner => 'root', group => 'root', -content => template('dumpsnfs/nfs_exports.erb'), +content => template('dumps/generation/nfs_exports.erb'), require => Package['nfs-kernel-server'], } @@ -29,7 +29,7 @@ mode=> '0444', owner => 'root', group => 'root', -content => template('dumpsnfs/default-nfs-common.erb'), +content => template('dumps/generation/default-nfs-common.erb'), require => Package['nfs-kernel-server'], } @@ -37,7 +37,7 @@ mode=> '0444', owner => 'root', group => 'root', -content => template('dumpsnfs/default-nfs-kernel-server.erb'), +content => template('dumps/generation/default-nfs-kernel-server.erb'), require => Package['nfs-kernel-server'], } diff --git a/modules/dumpsnfs/templates/default-nfs-common.erb b/modules/dumps/templates/generation/default-nfs-common.erb similarity index 66% rename from modules/dumpsnfs/templates/default-nfs-common.erb rename to modules/dumps/templates/generation/default-nfs-common.erb index b70a87a..b140fd2 100644 --- a/modules/dumpsnfs/templates/default-nfs-common.erb +++ b/modules/dumps/templates/generation/default-nfs-common.erb @@ -1,3 +1,9 @@ +## +# THIS FILE IS MANAGED BY PUPPET +# +# Source: dumps/templates/generation/default-nfs-common.erb +## + # If you do not set values for the NEED_ options, they will be attempted # autodetected; this should be sufficient for most people. Valid alternatives # for the NEED_ options are "yes" and "no". @@ -10,7 +16,7 @@ # when you have a port-based firewall. To use a fixed port, set this # this variable to a statd argument like: "--port 4000 --outgoing-port 4001". # For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS -STATDOPTS="--port <%= scope.lookupvar('::dumpsnfs::statd_port') -%> --outgoing-port <%=
[MediaWiki-commits] [Gerrit] operations/puppet[production]: cache::text: enable lua support
Ema has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378700 ) Change subject: cache::text: enable lua support .. cache::text: enable lua support We've enabled nginx-lua-prometheus for cache::text, which requires lua support. Enable it. Change-Id: I2ee1c089839bc00a79c77e1f0501e3dd844620b0 --- D hieradata/hosts/cp4018.yaml M hieradata/role/common/cache/text.yaml 2 files changed, 1 insertion(+), 1 deletion(-) Approvals: Ema: Looks good to me, approved jenkins-bot: Verified Filippo Giunchedi: Looks good to me, but someone else must approve diff --git a/hieradata/hosts/cp4018.yaml b/hieradata/hosts/cp4018.yaml deleted file mode 100644 index 4812620..000 --- a/hieradata/hosts/cp4018.yaml +++ /dev/null @@ -1 +0,0 @@ -cache::lua_support: true diff --git a/hieradata/role/common/cache/text.yaml b/hieradata/role/common/cache/text.yaml index 9e6417c..6187ec5 100644 --- a/hieradata/role/common/cache/text.yaml +++ b/hieradata/role/common/cache/text.yaml @@ -1,5 +1,6 @@ cluster: cache_text cache::cluster: text +cache::lua_support: true admin::groups: - perf-roots prometheus::node_exporter::collectors_extra: -- To view, visit https://gerrit.wikimedia.org/r/378700 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2ee1c089839bc00a79c77e1f0501e3dd844620b0 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: EmaGerrit-Reviewer: Ema Gerrit-Reviewer: Filippo Giunchedi Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] translatewiki[master]: Update of config file in regards to changes in BlueSpice ext...
ItSpiderman has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378704 ) Change subject: Update of config file in regards to changes in BlueSpice extensions .. Update of config file in regards to changes in BlueSpice extensions BlueSpiceExtensions/PageTemplates -> BlueSpicePageTemplates: https://gerrit.wikimedia.org/r/#/c/378660/ https://gerrit.wikimedia.org/r/#/c/378691/ BlueSpiceExtensions/SmartList -> BlueSpiceSmartList: https://gerrit.wikimedia.org/r/#/c/378662/ https://gerrit.wikimedia.org/r/#/c/378692/ This commit based on https://phabricator.wikimedia.org/T143106 Change-Id: I5a691efda205c59e80a6c13bb825ff274a9c5b81 --- M groups/MediaWiki/mediawiki-extensions.txt 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/04/378704/1 diff --git a/groups/MediaWiki/mediawiki-extensions.txt b/groups/MediaWiki/mediawiki-extensions.txt index e02fe37..10fbc4c 100644 --- a/groups/MediaWiki/mediawiki-extensions.txt +++ b/groups/MediaWiki/mediawiki-extensions.txt @@ -358,8 +358,8 @@ Blue Spice - Page Templates id = ext-bs-pagetemplates descmsg = bs-pagetemplates-desc -file = BlueSpiceExtensions/PageTemplates/i18n/%CODE%.json -aliasfile = BlueSpiceExtensions/PageTemplates/includes/specials/SpecialPageTemplatesAdmin.alias.php +file = BlueSpicePageTemplates/i18n/%CODE%.json +aliasfile = BlueSpicePageTemplates/includes/specials/SpecialPageTemplatesAdmin.alias.php Blue Spice - Pages Visited id = ext-bs-pagesvisited @@ -411,7 +411,7 @@ Blue Spice - Smart List id = ext-bs-smartlist descmsg = bs-smartlist-desc -file = BlueSpiceExtensions/SmartList/i18n/%CODE%.json +file = BlueSpiceSmartList/i18n/%CODE%.json Blue Spice - State Bar id = ext-bs-statebar -- To view, visit https://gerrit.wikimedia.org/r/378704 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a691efda205c59e80a6c13bb825ff274a9c5b81 Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: ItSpiderman___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Bump LocalFile::VERSION to invalidate file page cache
Reedy has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378706 ) Change subject: Bump LocalFile::VERSION to invalidate file page cache .. Bump LocalFile::VERSION to invalidate file page cache Bug: T175444 Change-Id: Ic0665d5554ed43c48d4fcdef087fbd33b597788c --- M includes/filerepo/file/LocalFile.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/06/378706/1 diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index ef4e019..1a403ad 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -43,7 +43,7 @@ * @ingroup FileAbstraction */ class LocalFile extends File { - const VERSION = 10; // cache version + const VERSION = 11; // cache version const CACHE_FIELD_MAX_LEN = 1000; -- To view, visit https://gerrit.wikimedia.org/r/378706 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic0665d5554ed43c48d4fcdef087fbd33b597788c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Reedy___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Add OpenGear support to Rancid
Ayounsi has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378708 ) Change subject: Add OpenGear support to Rancid .. Add OpenGear support to Rancid From instructions on https://opengear.zendesk.com/hc/en-us/articles/216369543-RANCID-Support Next step is to add the rancid user to an OpenGear console server and test it. Bug: T175876 Change-Id: Ia75b7285562575e73bc25df19d18830c2fe6bf87 --- A modules/rancid/files/bin/oglogin A modules/rancid/files/bin/ograncid A modules/rancid/files/bin/ssh-serial-console-wrapper M modules/rancid/manifests/init.pp 4 files changed, 1,055 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/08/378708/1 diff --git a/modules/rancid/files/bin/oglogin b/modules/rancid/files/bin/oglogin new file mode 100755 index 000..5144fb5 --- /dev/null +++ b/modules/rancid/files/bin/oglogin @@ -0,0 +1,665 @@ +#! /usr/bin/expect -- +## +## $Id$ +## +## rancid 2.3.8 +## Copyright (c) 1997-2011 by Terrapin Communications, Inc. +## All rights reserved. +## +## This code is derived from software contributed to and maintained by +## Terrapin Communications, Inc. by Henry Kilmer, John Heasley, Andrew Partan, +## Pete Whiting, Austin Schutz, and Andrew Fort. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +##notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +##notice, this list of conditions and the following disclaimer in the +##documentation and/or other materials provided with the distribution. +## 3. All advertising materials mentioning features or use of this software +##must display the following acknowledgement: +##This product includes software developed by Terrapin Communications, +##Inc. and its contributors for RANCID. +## 4. Neither the name of Terrapin Communications, Inc. nor the names of its +##contributors may be used to endorse or promote products derived from +##this software without specific prior written permission. +## 5. It is requested that non-binding fixes and modifications be contributed +##back to Terrapin Communications, Inc. +## +## THIS SOFTWARE IS PROVIDED BY Terrapin Communications, INC. AND CONTRIBUTORS +## ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COMPANY OR CONTRIBUTORS +## BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +## POSSIBILITY OF SUCH DAMAGE. +# +# The expect login scripts were based on Erik Sherk's gwtn, by permission. +# +# oglogin - Opengear login +# +# Modified by Toby Smithfor Opengear +# + +# Usage line +set usage "Usage: $argv0 \[-dSV\] \[-c command\] \ +\[-Evar=x\] \[-f cloginrc-file\] \[-p user-password\] \ +\[-r passphrase\] \[-s script-file\] \[-t timeout\] \[-u username\] \ +\[-v vty-password\] \[-x command-file\] \ +\[-y ssh_cypher_type\] router \[router...\]\n" + +# env(CLOGIN) may contain: +# x == do not set xterm banner or name + +# Password file +set password_file $env(HOME)/.cloginrc +# Default is to login to the router +set do_command 0 +set do_script 0 +# The default is to look in the password file to find the passwords. This +# tracks if we receive them on the command line. +set do_passwd 1 +# Save config, if prompted +set do_saveconfig 0 +# Sometimes routers take awhile to answer (the default is 10 sec) +set timeoutdflt 45 +# +set send_human {.4 .4 .7 .3 5} + +# Find the user in the ENV, or use the unix userid. +if {[info exists env(CISCO_USER)]} { +set default_user $env(CISCO_USER) +} elseif {[info exists env(USER)]} { +set default_user $env(USER) +} elseif {[info exists env(LOGNAME)]} { +set default_user $env(LOGNAME) +} else { +# This uses "id" which I think is portable. At least it has existed +# (without options) on all machines/OSes I've been on recently - +# unlike whoami or id -nu. +if [catch {exec id} reason] { + send_error "\nError: could not exec id: $reason\n" + exit 1 +} +regexp {\(([^)]*)} "$reason" junk default_user +} +if {[info exists env(CLOGINRC)]} { +set password_file $env(CLOGINRC) +} + +# Process the command line
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.18]: Return description fields for unprefixed image cache rows
Reedy has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378712 ) Change subject: Return description fields for unprefixed image cache rows .. Return description fields for unprefixed image cache rows Bug: T175444 Change-Id: I5560187d3850253095b695dc7a3cfc954fba9318 --- M includes/filerepo/file/LocalFile.php 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/12/378712/1 diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 96e7a7e..4c0dea2 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -351,9 +351,8 @@ static $results = []; if ( $prefix == '' ) { - return $fields; + return array_merge( $fields, [ 'description' ] ); } - if ( !isset( $results[$prefix] ) ) { $prefixedFields = []; foreach ( $fields as $field ) { -- To view, visit https://gerrit.wikimedia.org/r/378712 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5560187d3850253095b695dc7a3cfc954fba9318 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.18 Gerrit-Owner: Reedy___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...production-images[master]: Add fluent-bit image
Giuseppe Lavagetto has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378260 ) Change subject: Add fluent-bit image .. Add fluent-bit image Bug: T175527 Change-Id: Ie43b9ca615a335e8cc25dc17eaffa48728780006 --- A images/fluent-bit/Dockerfile.template A images/fluent-bit/changelog A images/fluent-bit/fluent-bit.conf 3 files changed, 35 insertions(+), 0 deletions(-) Approvals: Giuseppe Lavagetto: Verified; Looks good to me, approved diff --git a/images/fluent-bit/Dockerfile.template b/images/fluent-bit/Dockerfile.template new file mode 100644 index 000..236dd41 --- /dev/null +++ b/images/fluent-bit/Dockerfile.template @@ -0,0 +1,11 @@ +FROM {{ registry }}/{{ seed_image }}:latest +LABEL Description="Fluent-bit image to run as a sidecar container" \ + maintainer="j...@wikimedia.org" + +{{ "td-agent-bit" | apt_install }} + + +COPY fluent-bit.conf /etc/td-agent-bit/td-agent-bit.conf + +# Entry point +CMD ["/opt/td-agent-bit/bin/td-agent-bit", "-c", "/etc/td-agent-bit/td-agent-bit.conf"] diff --git a/images/fluent-bit/changelog b/images/fluent-bit/changelog new file mode 100644 index 000..a978ec1 --- /dev/null +++ b/images/fluent-bit/changelog @@ -0,0 +1,5 @@ +fluent-bit (0.12.2-1) wikimedia; urgency=medium + + * Initial release. + + -- Giuseppe LavagettoFri, 15 Sep 2017 18:05:41 +0200 diff --git a/images/fluent-bit/fluent-bit.conf b/images/fluent-bit/fluent-bit.conf new file mode 100644 index 000..aa963d2 --- /dev/null +++ b/images/fluent-bit/fluent-bit.conf @@ -0,0 +1,19 @@ +[SERVICE] +Flush1 +Daemon Off +Log_Levelinfo +Log_File /var/log/fluent-bit.log +Parsers_File parsers.conf + +[INPUT] +Name tcp +Listen 127.0.0.1 +Port 24224 +Chunk_Size 32 +Buffer_Size 64 + +[OUTPUT] +Name forward +Match ${FLUENTBIT_OUTPUT_MATCH} +Host ${K8S_NODE_IP} +Port 24244 -- To view, visit https://gerrit.wikimedia.org/r/378260 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie43b9ca615a335e8cc25dc17eaffa48728780006 Gerrit-PatchSet: 2 Gerrit-Project: operations/docker-images/production-images Gerrit-Branch: master Gerrit-Owner: Giuseppe Lavagetto Gerrit-Reviewer: Giuseppe Lavagetto ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations...production-images[master]: Improvements to the build script
Giuseppe Lavagetto has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/378259 ) Change subject: Improvements to the build script .. Improvements to the build script * Add --no-install-recommends to the apt command * Use stretch as a base now * Do not add a newline at the end of the apt command. Change-Id: I551f87a695285fccc105fab284d826edb5eba355 --- M build 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Giuseppe Lavagetto: Verified; Looks good to me, approved diff --git a/build b/build index c9d2af8..a7b18c4 100755 --- a/build +++ b/build @@ -26,9 +26,8 @@ return """ RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive \ -apt-get install --yes {packages} \ -&& apt-get clean && rm -rf /var/lib/apt/lists/* -""".format(packages=pkgs) +apt-get install --yes {packages} --no-install-recommends \ +&& apt-get clean && rm -rf /var/lib/apt/lists/* """.format(packages=pkgs) class DockerImage(object): @@ -64,7 +63,7 @@ self.config = { 'registry': 'docker-registry.wikimedia.org', 'username': None, 'password': None, -'seed_image': 'wikimedia-jessie' +'seed_image': 'wikimedia-stretch' } self.config.update(self._read_config(configfile)) self.client = docker.from_env(version='auto') -- To view, visit https://gerrit.wikimedia.org/r/378259 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I551f87a695285fccc105fab284d826edb5eba355 Gerrit-PatchSet: 1 Gerrit-Project: operations/docker-images/production-images Gerrit-Branch: master Gerrit-Owner: Giuseppe LavagettoGerrit-Reviewer: Giuseppe Lavagetto ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: MX: Add zen.spamhaus.org DNSBL check to MTA rcpt acl
Herron has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378717 ) Change subject: MX: Add zen.spamhaus.org DNSBL check to MTA rcpt acl .. MX: Add zen.spamhaus.org DNSBL check to MTA rcpt acl Today messages from hosts listed in zen.spamhaus.org are given a spam score of ~3.5. In some cases this allows messages from known spam sources to continue onward towards delivery. This change will warn (for the purposes of testing) if a blacklisted host connects directly to the wikimedia.org mx systems. Pending successful testing, a follow-up change will update the acl action from warn to delay and drop (with a useful 5xx error message). Bug: T175879 Change-Id: I0ba0441097e69784e582fb98a6d742b984ef348d --- M modules/role/templates/exim/exim4.conf.mx.erb 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/17/378717/1 diff --git a/modules/role/templates/exim/exim4.conf.mx.erb b/modules/role/templates/exim/exim4.conf.mx.erb index 5ef35c7..7cf76d4 100644 --- a/modules/role/templates/exim/exim4.conf.mx.erb +++ b/modules/role/templates/exim/exim4.conf.mx.erb @@ -156,6 +156,13 @@ # Check whether the sender address domain exists require verify = sender + # Drop connections from IP addresses listed in DNSBL + # This is a warn for testing. After testing... + # * Change to delay & drop + # * Change log_message to message + warn log_message = $sender_host_address is listed by $dnslist_domain ($dnslist_value: $dnslist_text) + dnslists = zen.spamhaus.org + accept acl_check_connect: -- To view, visit https://gerrit.wikimedia.org/r/378717 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ba0441097e69784e582fb98a6d742b984ef348d Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Herron___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits