[MediaWiki-commits] [Gerrit] mediawiki...ArticlePlaceholder[master]: Use eslint to lint JavaScript instead of jscs and jshint
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354986 ) Change subject: Use eslint to lint JavaScript instead of jscs and jshint .. Use eslint to lint JavaScript instead of jscs and jshint Bug: T165843 Change-Id: I7550bb2553e5dabc793a7a113539dde60fba28f8 --- A .eslintignore A .eslintrc.json D .jscsrc D .jshintignore D .jshintrc M Gruntfile.js M modules/ext.articleplaceholder.createArticle/ext.articleplaceholder.createArticle.js M package.json A tests/qunit/.eslintrc.json M tests/qunit/modules/ext.articleplaceholder.createArticle/ext.articleplaceholder.createArticleTranslation.test.js 10 files changed, 38 insertions(+), 54 deletions(-) Approvals: Fomafix: Looks good to me, approved jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, but someone else must approve diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000..82eaa05 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +node_modules/** +vendor/** diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000..e8bfd6d --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + }, + "globals": { + "mediaWiki": false, + "module": false, + "OO": false + }, + "rules": { + "dot-notation": "off", + "no-proto": "off", + "valid-jsdoc": "off", + "wrap-iife": "off" + } +} diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 8bb503d..000 --- a/.jscsrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "preset": "wikimedia", - "jsDoc": { - "checkAnnotations": { - "preset": "jsduck5", - "extra": { - "license": true, - "licence": true - } - } - } -} diff --git a/.jshintignore b/.jshintignore deleted file mode 100644 index 3c3629e..000 --- a/.jshintignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 18db22d..000 --- a/.jshintrc +++ /dev/null @@ -1,23 +0,0 @@ -{ - // Enforcing - "bitwise": true, - "eqeqeq": true, - "latedef": true, - "noarg": true, - "nonew": true, - "undef": true, - "unused": true, - "strict": false, - - // Environment - "browser": true, - - "globals": { - "jQuery": false, - "mediaWiki": false, - "module": true, - "OO": false, - "QUnit": false, - "sinon": false - } -} diff --git a/Gruntfile.js b/Gruntfile.js index e1af6af..eb5e877 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,20 +1,11 @@ -/*jshint node:true */ +/* eslint-env node */ + module.exports = function ( grunt ) { require( 'load-grunt-tasks' )( grunt ); grunt.initConfig( { - jshint: { - options: { - jshintrc: true - }, - all: [ - '*.js', - 'modules/**/*.js', - 'tests/**/*.js' - ] - }, - jscs: { - src: '<%= jshint.all %>' + eslint: { + all: '.' }, banana: { all: 'i18n/' @@ -40,6 +31,6 @@ } } ); - grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana', 'qunit', 'stylelint' ] ); + grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'qunit', 'stylelint' ] ); grunt.registerTask( 'default', 'test' ); }; diff --git a/modules/ext.articleplaceholder.createArticle/ext.articleplaceholder.createArticle.js b/modules/ext.articleplaceholder.createArticle/ext.articleplaceholder.createArticle.js index c651583..5b694c7 100644 --- a/modules/ext.articleplaceholder.createArticle/ext.articleplaceholder.createArticle.js +++ b/modules/ext.articleplaceholder.createArticle/ext.articleplaceholder.createArticle.js @@ -56,7 +56,7 @@ * @override */ CreateArticleDialog.prototype.initialize = function () { - CreateArticleDialog.parent.prototype.initialize.call( this ); // jshint:ignore + CreateArticleDialog.parent.prototype.initialize.call( this ); this.createContentElements(); this.$body.append( this.dialogContent ); }; diff --git a/package.json b/package.json index 35a7ffc..d7d1c16 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ "test":
[MediaWiki-commits] [Gerrit] integration/config[master]: Set up CI for Whoops extension
Gergő Tisza has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355063 ) Change subject: Set up CI for Whoops extension .. Set up CI for Whoops extension Change-Id: Iac1de79bba667b0a79b8617b3ad6867a4befa367 --- M zuul/layout.yaml 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/63/355063/1 diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 55f60a2..bef4b90 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -7088,6 +7088,12 @@ - name: extension-unittests-generic - name: npm + -name: mediawiki/extensions/Whoops + template: + - name: npm + - name: composer + - name: extension-unittests-generic + - name: mediawiki/extensions/Widgets template: - name: jshint -- To view, visit https://gerrit.wikimedia.org/r/355063 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac1de79bba667b0a79b8617b3ad6867a4befa367 Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Whoops[master]: Create extension files
Gergő Tisza has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355062 ) Change subject: Create extension files .. Create extension files Needs T153256 to be fixed to work properly. Bug: T111731 Change-Id: Id29e0ced1ddaf604c7b573f3673d090c3e5ac3c1 Depends-On: Ifb01b454ec2fbe5f9ecb375a12b0e7e8a884ee22 --- A .eslintrc.json A .gitignore M .gitreview A .stylelintrc A Gruntfile.js A README.md A composer.json A extension.json A i18n/en.json A i18n/qqq.json A package.json A phpcs.xml A src/Hooks.php A src/WhoopsRenderer.php 14 files changed, 167 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Whoops refs/changes/62/355062/1 diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000..4843240 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,10 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + }, + "globals": { + "mediaWiki": false + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..59a2a36 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.*.swp +*~ +/.project +/composer.lock +/vendor +/node_modules diff --git a/.gitreview b/.gitreview index 49667b8..a76fdd7 100644 --- a/.gitreview +++ b/.gitreview @@ -2,5 +2,5 @@ host=gerrit.wikimedia.org port=29418 project=mediawiki/extensions/Whoops.git -defaultbranch=master +track=1 defaultrebase=0 diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 000..2c90730 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,3 @@ +{ + "extends": "stylelint-config-wikimedia" +} diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 000..24faaef --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,40 @@ +/* eslint-env node */ +module.exports = function ( grunt ) { + var conf = grunt.file.readJSON( 'extension.json' ); + + grunt.loadNpmTasks( 'grunt-banana-checker' ); + grunt.loadNpmTasks( 'grunt-eslint' ); + grunt.loadNpmTasks( 'grunt-jsonlint' ); + grunt.loadNpmTasks( 'grunt-stylelint' ); + + grunt.initConfig( { + eslint: { + all: [ + '**/*.js', + '!node_modules/**', + '!vendor/**' + ] + }, + stylelint: { + options: { + syntax: 'less' + }, + all: [ + '**/*.{css,less}', + '!node_modules/**', + '!vendor/**' + ] + }, + banana: conf.MessagesDirs, + jsonlint: { + all: [ + '**/*.json', + '!node_modules/**', + '!vendor/**' + ] + } + } ); + + grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] ); + grunt.registerTask( 'default', 'test' ); +}; diff --git a/README.md b/README.md new file mode 100644 index 000..d8cab2d --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +This extensions installs [Whoops](https://github.com/filp/whoops) as the error +renderer for MediaWiki. \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 000..a6f48a6 --- /dev/null +++ b/composer.json @@ -0,0 +1,16 @@ +{ + "require": { + "filp/whoops": "~2.1" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "0.9.2", + "mediawiki/mediawiki-codesniffer": "0.7.2" + }, + "scripts": { + "fix": "phpcbf", + "test": [ + "parallel-lint . --exclude vendor", + "phpcs -p -s" + ] + } +} diff --git a/extension.json b/extension.json new file mode 100644 index 000..495dbdf --- /dev/null +++ b/extension.json @@ -0,0 +1,27 @@ +{ + "name": "Whoops", + "version": "0.1.0", + "author": [ + "Gergő Tisza" + ], + "url": "https://www.mediawiki.org/wiki/Extension:Whoops;, + "descriptionmsg": "whoops-desc", + "license-name": "MIT", + "type": "other", + "AutoloadClasses": { + "MediaWiki\\Extensions\\Whoops\\Hooks": "src/Hooks.php", + "MediaWiki\\Extensions\\Whoops\\WhoopsRenderer": "src/WhoopsRenderer.php" + }, + "Hooks": { + "MediaWikiServices": [ + "MediaWiki\\Extensions\\Whoops\\Hooks::onMediaWikiServices" + ] + }, + "MessagesDirs": { + "Whoops": [ + "i18n" + ] +
[MediaWiki-commits] [Gerrit] labs/striker[master]: Make django's makemigrations happy
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/353908 ) Change subject: Make django's makemigrations happy .. Make django's makemigrations happy The ldapdb models are not actually managed by Django's migrations system, but makemigrations apparently doesn't know that. Rather than adding a new migration file that does nothing, I'm manually backporting the changes it wants to make to the initial migration for the project. This is a complete no-op for both development and production. Change-Id: I46335e5464d72da175c7ef2402ee968062cbf949 --- M striker/tools/migrations/0001_squashed.py M striker/tools/models.py 2 files changed, 6 insertions(+), 7 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/striker/tools/migrations/0001_squashed.py b/striker/tools/migrations/0001_squashed.py index 06ed066..bcaba25 100644 --- a/striker/tools/migrations/0001_squashed.py +++ b/striker/tools/migrations/0001_squashed.py @@ -34,8 +34,8 @@ migrations.CreateModel( name='Maintainer', fields=[ -('dn', models.CharField(max_length=200)), -('username', ldapdb.models.fields.CharField(max_length=200, serialize=False, primary_key=True, db_column='uid')), +('dn', models.CharField(primary_key=True, serialize=False, max_length=200)), +('username', ldapdb.models.fields.CharField(max_length=200, unique=True, db_column='uid')), ('full_name', ldapdb.models.fields.CharField(max_length=200, db_column='cn')), ], options={ @@ -45,8 +45,8 @@ migrations.CreateModel( name='Tool', fields=[ -('dn', models.CharField(max_length=200)), -('cn', ldapdb.models.fields.CharField(max_length=200, serialize=False, primary_key=True, db_column='cn')), +('dn', models.CharField(primary_key=True, serialize=False, max_length=200)), +('cn', ldapdb.models.fields.CharField(max_length=200, unique=True, db_column='cn')), ('gid_number', ldapdb.models.fields.IntegerField(unique=True, db_column='gidNumber')), ('members', ldapdb.models.fields.ListField(db_column='member')), ], diff --git a/striker/tools/models.py b/striker/tools/models.py index 85fb5b1..bd9aa92 100644 --- a/striker/tools/models.py +++ b/striker/tools/models.py @@ -33,7 +33,7 @@ base_dn = settings.TOOLS_MAINTAINER_BASE_DN object_classes = ['posixAccount'] -username = fields.CharField(db_column='uid', primary_key=True) +username = fields.CharField(db_column='uid', unique=True) full_name = fields.CharField(db_column='cn') def __str__(self): @@ -53,8 +53,7 @@ objects = ToolManager() -cn = fields.CharField( -db_column='cn', max_length=200, primary_key=True) +cn = fields.CharField(db_column='cn', max_length=200, unique=True) gid_number = fields.IntegerField(db_column='gidNumber', unique=True) members = fields.ListField(db_column='member') -- To view, visit https://gerrit.wikimedia.org/r/353908 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I46335e5464d72da175c7ef2402ee968062cbf949 Gerrit-PatchSet: 2 Gerrit-Project: labs/striker Gerrit-Branch: master Gerrit-Owner: BryanDavisGerrit-Reviewer: BryanDavis 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]: Turn MWExceptionRenderer into a service
Gergő Tisza has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355061 ) Change subject: Turn MWExceptionRenderer into a service .. Turn MWExceptionRenderer into a service Splits MWExceptionRenderer into two classes, one taking care of relatively straightforward edge cases (command-line error etc) and hold shared functionality, and another one with the code that's more likely to be replaced for custom error display. Bug: T111731 Change-Id: Ifb01b454ec2fbe5f9ecb375a12b0e7e8a884ee22 --- M autoload.php M includes/MediaWiki.php M includes/MediaWikiServices.php M includes/ServiceWiring.php M includes/exception/MWExceptionHandler.php M includes/exception/MWExceptionRenderer.php A includes/exception/Renderer.php A includes/exception/StandardRenderer.php M tests/phpunit/includes/MediaWikiServicesTest.php 9 files changed, 531 insertions(+), 318 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/61/355061/1 diff --git a/autoload.php b/autoload.php index fbdee83..8aa1533 100644 --- a/autoload.php +++ b/autoload.php @@ -870,6 +870,8 @@ 'MediaWiki\\Auth\\UsernameAuthenticationRequest' => __DIR__ . '/includes/auth/UsernameAuthenticationRequest.php', 'MediaWiki\\Diff\\ComplexityException' => __DIR__ . '/includes/diff/ComplexityException.php', 'MediaWiki\\Diff\\WordAccumulator' => __DIR__ . '/includes/diff/WordAccumulator.php', + 'MediaWiki\\Exception\\Renderer' => __DIR__ . '/includes/exception/Renderer.php', + 'MediaWiki\\Exception\\StandardRenderer' => __DIR__ . '/includes/exception/StandardRenderer.php', 'MediaWiki\\HeaderCallback' => __DIR__ . '/includes/HeaderCallback.php', 'MediaWiki\\Interwiki\\ClassicInterwikiLookup' => __DIR__ . '/includes/interwiki/ClassicInterwikiLookup.php', 'MediaWiki\\Interwiki\\InterwikiLookup' => __DIR__ . '/includes/interwiki/InterwikiLookup.php', diff --git a/includes/MediaWiki.php b/includes/MediaWiki.php index b18414d..1a83e12 100644 --- a/includes/MediaWiki.php +++ b/includes/MediaWiki.php @@ -542,7 +542,7 @@ $cache = new HTMLFileCache( $context->getTitle(), 'view' ); if ( $cache->isCached() ) { $cache->loadFromFileCache( $context, HTMLFileCache::MODE_OUTAGE ); - print MWExceptionRenderer::getHTML( $e ); + print MediaWikiServices::getInstance()->getExceptionRenderer()->getHTML( $e ); exit; } diff --git a/includes/MediaWikiServices.php b/includes/MediaWikiServices.php index 3bf6d78..564417a 100644 --- a/includes/MediaWikiServices.php +++ b/includes/MediaWikiServices.php @@ -1,4 +1,5 @@ getService( 'ReadOnlyMode' ); } + /** +* @since 1.30 +* @return Renderer +*/ + public function getExceptionRenderer() { + return $this->getService( 'ExceptionRenderer' ); + } + /// // NOTE: When adding a service getter here, don't forget to add a test // case for it in MediaWikiServicesTest::provideGetters() and in diff --git a/includes/ServiceWiring.php b/includes/ServiceWiring.php index 6afabed..5a7335a 100644 --- a/includes/ServiceWiring.php +++ b/includes/ServiceWiring.php @@ -37,6 +37,7 @@ * MediaWiki code base. */ +use MediaWiki\Exception\StandardRenderer; use MediaWiki\Interwiki\ClassicInterwikiLookup; use MediaWiki\Linker\LinkRendererFactory; use MediaWiki\Logger\LoggerFactory; @@ -417,6 +418,10 @@ ); }, + 'ExceptionRenderer' => function( MediaWikiServices $services ) { + return new StandardRenderer(); + }, + /// // NOTE: When adding a service here, don't forget to add a getter function // in the MediaWikiServices class. The convenience getter should just call diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 433274e..aad0ffc 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -18,6 +18,7 @@ * @file */ +use MediaWiki\Exception\Renderer; use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; use Psr\Log\LogLevel; @@ -64,6 +65,7 @@ * @param Exception|Throwable $e */ protected static function report( $e ) { + $renderer = MediaWikiServices::getInstance()->getExceptionRenderer(); try { // Try and show the exception prettily, with the normal skin infrastructure if ( $e instanceof MWException ) {
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove $wgExceptionHooks
Gergő Tisza has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355060 ) Change subject: Remove $wgExceptionHooks .. Remove $wgExceptionHooks Skip deprecation period because it is very unlikely that anyone used this: it does not appear anywhere on gerrit/git, no nontrivial google hits, the documentation has been flat out wrong for 9 years and no one noticed it, and the whole feature is fairly useless as you need to declare it separately for every single exception class you expect. Change-Id: I85844a238d3135d05eeba10331149624b04bafe2 --- M RELEASE-NOTES-1.30 M includes/DefaultSettings.php M includes/exception/MWException.php M includes/exception/MWExceptionRenderer.php M tests/phpunit/includes/exception/MWExceptionTest.php 5 files changed, 8 insertions(+), 139 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/60/355060/1 diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30 index fbe23ab..3d2b3a7 100644 --- a/RELEASE-NOTES-1.30 +++ b/RELEASE-NOTES-1.30 @@ -17,6 +17,7 @@ This is intended for extensions that want control over the instantiation of their jobs, to allow for proper dependency injection. +* $wgExceptionHooks has been removed. === New features in 1.30 === * (T37247) Output from Parser::parse() will now be wrapped in a div with diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 0d82d35..19c585d 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -7432,15 +7432,6 @@ ]; /** - * Hooks that are used for outputting exceptions. Format is: - * $wgExceptionHooks[] = $funcname - * or: - * $wgExceptionHooks[] = [ $class, $funcname ] - * Hooks should return strings or false - */ -$wgExceptionHooks = []; - -/** * Page property link table invalidation lists. When a page property * changes, this may require other link tables to be updated (eg * adding __HIDDENCAT__ means the hiddencat tracking category will diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 4ff8636..8c1f8dc 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -64,17 +64,6 @@ } /** -* Run hook to allow extensions to modify the text of the exception -* -* @param string $name Class name of the exception -* @param array $args Arguments to pass to the callback functions -* @return string|null String to output or null if any hook has been called -*/ - public function runHooks( $name, $args = [] ) { - return MWExceptionRenderer::runHooks( $this, $name, $args ); - } - - /** * Get a message from i18n * * @param string $key Message name @@ -164,12 +153,7 @@ if ( $this->useOutputPage() ) { $wgOut->prepareErrorPage( $this->getPageTitle() ); - $hookResult = $this->runHooks( static::class ); - if ( $hookResult ) { - $wgOut->addHTML( $hookResult ); - } else { - $wgOut->addHTML( $this->getHTML() ); - } + $wgOut->addHTML( $this->getHTML() ); $wgOut->output(); } else { @@ -183,12 +167,7 @@ 'body { font-family: sans-serif; margin: 0; padding: 0.5em 2em; }' . "\n"; - $hookResult = $this->runHooks( static::class . 'Raw' ); - if ( $hookResult ) { - echo $hookResult; - } else { - echo $this->getHTML(); - } + echo $this->getHTML(); echo "\n"; } diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index 435fde3..bd43934 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -85,51 +85,6 @@ } /** -* Run hook to allow extensions to modify the text of the exception -* -* Called by MWException for b/c -* -* @param Exception|Throwable $e -* @param string $name Class name of the exception -* @param array $args Arguments to pass to the callback functions -* @return string|null String to output or null if any hook has been called -*/ - public static function runHooks( $e, $name, $args = [] ) { - global $wgExceptionHooks; - - if ( !isset( $wgExceptionHooks ) || !is_array( $wgExceptionHooks ) ) { - return null; // Just silently ignore - } - - if ( !array_key_exists( $name,
[MediaWiki-commits] [Gerrit] mediawiki...WikiEditor[master]: Add parameter useskin to action=parse for live preview
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355008 ) Change subject: Add parameter useskin to action=parse for live preview .. Add parameter useskin to action=parse for live preview This change duplicates the Change-Id: Ie3615866 in core and is needed to load the module 'mediawiki.toc' since Change-Id: Iaad84d24. Change-Id: Ie667e97737acb66a8efcb299bc081b9577ae24d6 --- M modules/jquery.wikiEditor.preview.js 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/jquery.wikiEditor.preview.js b/modules/jquery.wikiEditor.preview.js index 57c0293..faac2b8 100644 --- a/modules/jquery.wikiEditor.preview.js +++ b/modules/jquery.wikiEditor.preview.js @@ -66,6 +66,7 @@ prop: 'text|modules|jsconfigvars', preview: true, disableeditsection: true, + useskin: mw.config.get( 'skin' ), uselang: mw.config.get( 'wgUserLanguage' ) } ).done( function ( data ) { var loadmodules, $content; -- To view, visit https://gerrit.wikimedia.org/r/355008 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie667e97737acb66a8efcb299bc081b9577ae24d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: FomafixGerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Remove check for MediaWikiTestCase::getTestSysop method
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/352561 ) Change subject: Remove check for MediaWikiTestCase::getTestSysop method .. Remove check for MediaWikiTestCase::getTestSysop method This should now always exist... Change-Id: I17fb5d44798f71aea45c72fc384ca11444d61dc3 --- M repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php 1 file changed, 1 insertion(+), 5 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php b/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php index 1bd278d..d273119 100644 --- a/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php +++ b/repo/tests/phpunit/includes/Interactors/ItemMergeInteractorTest.php @@ -340,11 +340,7 @@ 'Q2' => $toData, ) ); - if ( method_exists( $this, 'getTestSysop' ) ) { - $user = $this->getTestSysop()->getUser(); - } else { - $user = User::newFromName( 'UTSysop' ); - } + $user = $this->getTestSysop()->getUser(); $user->addWatch( $entityTitleLookup->getTitleForId( $fromId ) ); $interactor->mergeItems( $fromId, $toId, $ignoreConflicts, 'CustomSummary' ); -- To view, visit https://gerrit.wikimedia.org/r/352561 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I17fb5d44798f71aea45c72fc384ca11444d61dc3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: AddshoreGerrit-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] oojs/ui[master]: themes: Field*Layout help position perfectly aligned
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/350307 ) Change subject: themes: Field*Layout help position perfectly aligned .. themes: Field*Layout help position perfectly aligned Foremost MediaWiki theme, making FieldLayout's and FieldSetLayout's help PopupButtonWidget position perfectly aligned with label baseline and vertically with widgets. Also resetting Frameless ButtonWidget's sizes specifically for help PopupButtonWidget. Bug: T163094 Change-Id: I9da8b446d7d5dcaa3bd849b58e03247fe77ee889 --- M src/styles/layouts/FieldLayout.less M src/themes/apex/layouts.less M src/themes/wikimediaui/common.less M src/themes/wikimediaui/layouts.less 4 files changed, 62 insertions(+), 20 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/src/styles/layouts/FieldLayout.less b/src/styles/layouts/FieldLayout.less index 5498835..0c30e5b 100644 --- a/src/styles/layouts/FieldLayout.less +++ b/src/styles/layouts/FieldLayout.less @@ -60,14 +60,5 @@ } } - &.oo-ui-fieldLayout-align-top, - &.oo-ui-fieldLayout-align-inline { - .oo-ui-fieldLayout-help { - // HACK: The height of this ButtonWidget extends below the header line (with align: top), - // causing the field widget to be narrower than it should be. 0.3em chosen experimentally. - margin-top: -0.3em; - } - } - .theme-oo-ui-fieldLayout(); } diff --git a/src/themes/apex/layouts.less b/src/themes/apex/layouts.less index 80d6963..d8033de 100644 --- a/src/themes/apex/layouts.less +++ b/src/themes/apex/layouts.less @@ -78,6 +78,15 @@ } } + &.oo-ui-fieldLayout-align-top, + &.oo-ui-fieldLayout-align-inline { + .oo-ui-fieldLayout-help { + // HACK: This PopupButtonWidget's `height` extends below the header's baseline (with align: top), + // causing the field widget to be narrower than it should be. 0.3em chosen experimentally. + margin-top: -0.3em; + } + } + > .oo-ui-popupButtonWidget { .oo-ui-inline-spacing( 0 ); margin-top: 0.25em; diff --git a/src/themes/wikimediaui/common.less b/src/themes/wikimediaui/common.less index fd01d55..6e700e7 100644 --- a/src/themes/wikimediaui/common.less +++ b/src/themes/wikimediaui/common.less @@ -82,6 +82,7 @@ @size-indicator: 12 / @oo-ui-font-size-browser / @oo-ui-font-size-default; // equals `0.9375em`≈`12px` @size-toggleswitch-grip-min: 16px; @size-dialog-bar-top: 44 / @oo-ui-font-size-browser / @oo-ui-font-size-default; // equals `3.4375em`≈`44px` +@size-fieldlayout-help-icon: 22 / @oo-ui-font-size-browser / @oo-ui-font-size-default; @start-framed-icon-only: 7 / @oo-ui-font-size-browser / @oo-ui-font-size-default; // equals `0.547em`≈`7px`; HACK: We have to break with `@padding-start-input-text-icon` to perfectly center in `@min-width-button-default` @start-framed-icon-only-numberinput: 6 / @oo-ui-font-size-browser / @oo-ui-font-size-default; // equals `0.46875em`≈`6px` @@ -102,6 +103,8 @@ @margin-button-close: 4 / @oo-ui-font-size-browser / @oo-ui-font-size-default; @margin-top-tagitem: 4 / @oo-ui-font-size-browser / @oo-ui-font-size-default; @margin-top-tagmultiselect-input: 6 / @oo-ui-font-size-browser / @oo-ui-font-size-default; +@margin-top-fieldlayout-help: -( 6 / @oo-ui-font-size-browser / @oo-ui-font-size-default ); +@margin-top-fieldsetlayout-help: -( 6 / @oo-ui-font-size-browser / @oo-ui-font-size-default ) / 2; @margin-bottom-fieldset-header: 8 / @oo-ui-font-size-browser / ( @oo-ui-font-size-default * @font-size-fieldset-header ); @border-default: @border-width-default solid @border-color-default; @@ -145,6 +148,7 @@ @padding-taboption: @padding-top-default @padding-horizontal-taboption @padding-bottom-default; @padding-horizontal-default: 12 / @oo-ui-font-size-browser / @oo-ui-font-size-default; // equals `0.9375em`≈`12px` @padding-horizontal-input-text: 8 / @oo-ui-font-size-browser / @oo-ui-font-size-default; +@padding-horizontal-frameless: 4 / @oo-ui-font-size-browser / @oo-ui-font-size-default; @padding-horizontal-taboption: 13 / @oo-ui-font-size-browser / @oo-ui-font-size-default; // equals `0.9375em`≈`13px`; @padding-horizontal-default = @border-width-default @padding-horizontal-tagitem: 4 / @oo-ui-font-size-browser / @oo-ui-font-size-default; @padding-vertical-label: 4 / @oo-ui-font-size-browser / @oo-ui-font-size-default; diff --git a/src/themes/wikimediaui/layouts.less b/src/themes/wikimediaui/layouts.less index 86eb027..83b4f2f 100644 --- a/src/themes/wikimediaui/layouts.less +++ b/src/themes/wikimediaui/layouts.less @@ -53,7 +53,7 @@ &.oo-ui-labelElement {
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Test TermSqlIndex::deleteTermsOfEntity in the read full ID mode
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354093 ) Change subject: Test TermSqlIndex::deleteTermsOfEntity in the read full ID mode .. Test TermSqlIndex::deleteTermsOfEntity in the read full ID mode This was missing I958152bc099fd6a68f2fc6ea006417c548d83dd4, adding for completion. Bug: T162673 Change-Id: Idc483c230be643b947119873c132c0f42360425a --- M lib/tests/phpunit/Store/Sql/TermSqlIndexTest.php 1 file changed, 23 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/lib/tests/phpunit/Store/Sql/TermSqlIndexTest.php b/lib/tests/phpunit/Store/Sql/TermSqlIndexTest.php index f21d6d8..e905f90 100644 --- a/lib/tests/phpunit/Store/Sql/TermSqlIndexTest.php +++ b/lib/tests/phpunit/Store/Sql/TermSqlIndexTest.php @@ -633,4 +633,27 @@ $this->assertSame( 'Q1112362', $row->term_full_entity_id ); } + public function testDeleteTermsForEntity_withReadFullEntityId() { + $index = $this->getTermIndex(); + $index->clear(); + $index->setReadFullEntityIdColumn( true ); + + $item = new Item( new ItemId( 'Q10' ) ); + $item->setLabel( 'en', 'abc' ); + + $index->saveTermsOfEntity( $item ); + + $searchCriteria = [ new TermIndexSearchCriteria( [ 'termText' => 'abc' ] ) ]; + + $matches = $index->getMatchingTerms( $searchCriteria ); + + $this->assertNotEmpty( $matches ); + + $index->deleteTermsOfEntity( $item->getId() ); + + $matches = $index->getMatchingTerms( $searchCriteria ); + + $this->assertEmpty( $matches ); + } + } -- To view, visit https://gerrit.wikimedia.org/r/354093 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idc483c230be643b947119873c132c0f42360425a Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: WMDE-leszekGerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Thiemo Mättig (WMDE) Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Update docs/usagetracking.wiki: Statement usages, minor things
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354216 ) Change subject: Update docs/usagetracking.wiki: Statement usages, minor things .. Update docs/usagetracking.wiki: Statement usages, minor things For the update aspects, please see AffectedPagesFinder::getChangedAspects. Change-Id: I51f8f319c0e673dbb95d7b725b35b2ff69f7e609 Note: Statement usages aren't currently used for any page updates. --- M docs/usagetracking.wiki 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/docs/usagetracking.wiki b/docs/usagetracking.wiki index d32b0d6..3272732 100644 --- a/docs/usagetracking.wiki +++ b/docs/usagetracking.wiki @@ -11,24 +11,25 @@ == Client side usage tracking == -Each client wiki tracks which pages use (which aspect of) which entity (from which repo). The "aspect" is used to decide which kind of change is relevant for the given kind of usage, and what kind of update is needed for the page in question. The following aspects are defined: +Each client wiki tracks which pages use (which aspect of) which entity (from which repo). The "aspect" is used to decide which kind of change is relevant for the given kind of usage, and what kind of update is needed for the page in question. Among others the following aspects are defined: * sitelinks: only an item's sitelinks are used. This would be the case for a client page that is connected to an item on the repo via an incoming sitelink, but does not access any data of the item directly. A change to the sitelinks may be applied without re-parsing the page, by overwriting the sitelinks in the cached ParserOutput opbject. * label: only the entity's label is used. This would be the case when a localized reference to the entity is shown on a page. It's also used in cases when a property is referenced by label. A page that uses a label should be updated when that label chances, but this kind of update my be considered low priority. The language in which the label is used is tracked along as a "modification" of the label aspect. In case language fallback is applied, all relevant languages are considered to be used on the page. * all: any and all aspects of the entity may be used on the given page. This includes statements, claims, and labels. This kind of usage triggers a full re-parse on any change to the entity. This aspect of use is recorded when entity data is accessed via Lua or the #property parser function. -Entity usage on client pages is tracked using the following codes: +Entity usage on client pages is tracked using the following codes (each representing one aspect): * sitelinks (S): the entity's sitelinks are used. * label (L.xx): the entity's label in in language xx changed. * title (T): the title of the local page corresponding to the entity is used. -* all (X): other aspects (such as statement data), or all aspects, are or may be used. +* statements (C): certain statements (identified by their property id) from the entity are used. +* other (O): something else about the entity (such as statement data) is used. +* all (X): all aspects of an entity are or may be used. Changes result in updates to pages that use the respective entity based on the aspect that is used. Changes are classified accordingly: * sitelinks (S): any change to the entity's sitelinks. Pages that use the S or X aspect are updated. * label (L.xx): the label in the language "xx" changed. Pages that use the L.xx or X aspect are updated. * title (T): the sitelink corresponding to the local wiki was changed. Pages that use the S, T, or X aspect are updated. -* all (X): Everything about the entity changed, all pages using the entity are updated. -* other (O): something else about the entity (such as statement data) changed. Only pages that use the X aspect are updated. +* other (O): something else about the entity (such as statement data) changed. Only pages that use the O or X aspects are updated. This way, editing e.g. statements will not cause pages that just show the entities label to be purged. -- To view, visit https://gerrit.wikimedia.org/r/354216 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I51f8f319c0e673dbb95d7b725b35b2ff69f7e609 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Hoo manGerrit-Reviewer: Daniel Kinzler Gerrit-Reviewer: Hoo man 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...Wikibase[master]: Add the "disabledUsageAspects" client setting
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354244 ) Change subject: Add the "disabledUsageAspects" client setting .. Add the "disabledUsageAspects" client setting We need this to add new usage aspects which we don't immediately want on all wikis. Change-Id: I5817b1c2b85e8d4004dd32fe324a5f2ef777d1fb --- M client/config/WikibaseClient.default.php M client/includes/Store/Sql/DirectSqlStore.php M client/includes/Usage/Sql/SqlUsageTracker.php M client/tests/phpunit/includes/Usage/Sql/SqlUsageTrackerTest.php M docs/options.wiki 5 files changed, 109 insertions(+), 4 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/client/config/WikibaseClient.default.php b/client/config/WikibaseClient.default.php index 52a9ce2..db050e8 100644 --- a/client/config/WikibaseClient.default.php +++ b/client/config/WikibaseClient.default.php @@ -82,6 +82,8 @@ */ 'disabledDataTypes' => [], + 'disabledUsageAspects' => [], + // The type of object cache to use. Use CACHE_XXX constants. // This is both a repo and client setting, and should be set to the same value in // repo and clients for multiwiki setups. diff --git a/client/includes/Store/Sql/DirectSqlStore.php b/client/includes/Store/Sql/DirectSqlStore.php index 4dcb73d..431b7f1 100644 --- a/client/includes/Store/Sql/DirectSqlStore.php +++ b/client/includes/Store/Sql/DirectSqlStore.php @@ -166,6 +166,11 @@ private $writeFullEntityIdColumn; /** +* @var string[] +*/ + private $disabledUsageAspects; + + /** * @param EntityChangeFactory $entityChangeFactory * @param EntityContentDataCodec $contentCodec * @param EntityIdParser $entityIdParser @@ -202,6 +207,7 @@ $this->cacheDuration = $settings->getSetting( 'sharedCacheDuration' ); $this->siteId = $settings->getSetting( 'siteGlobalID' ); $this->writeFullEntityIdColumn = $settings->getSetting( 'writeFullEntityIdColumn' ); + $this->disabledUsageAspects = $settings->getSetting( 'disabledUsageAspects' ); } /** @@ -279,7 +285,7 @@ public function getUsageTracker() { if ( $this->usageTracker === null ) { $connectionManager = $this->getLocalConnectionManager(); - $this->usageTracker = new SqlUsageTracker( $this->entityIdParser, $connectionManager ); + $this->usageTracker = new SqlUsageTracker( $this->entityIdParser, $connectionManager, $this->disabledUsageAspects ); } return $this->usageTracker; diff --git a/client/includes/Usage/Sql/SqlUsageTracker.php b/client/includes/Usage/Sql/SqlUsageTracker.php index b2170fe..ec5662f 100644 --- a/client/includes/Usage/Sql/SqlUsageTracker.php +++ b/client/includes/Usage/Sql/SqlUsageTracker.php @@ -35,6 +35,11 @@ private $connectionManager; /** +* @var string[] +*/ + private $disabledUsageAspects; + + /** * @var int */ private $batchSize = 100; @@ -42,10 +47,16 @@ /** * @param EntityIdParser $idParser * @param SessionConsistentConnectionManager $connectionManager +* @param string[] $disabledUsageAspects */ - public function __construct( EntityIdParser $idParser, SessionConsistentConnectionManager $connectionManager ) { + public function __construct( + EntityIdParser $idParser, + SessionConsistentConnectionManager $connectionManager, + array $disabledUsageAspects + ) { $this->idParser = $idParser; $this->connectionManager = $connectionManager; + $this->disabledUsageAspects = $disabledUsageAspects; } /** @@ -106,6 +117,29 @@ } /** +* @param EntityUsage[] $usages +* +* @throws InvalidArgumentException +* @return EntityUsage[] +*/ + private function removeBlacklistedUsages( array $usages ) { + $newUsages = array(); + + foreach ( $usages as $usage ) { + if ( !( $usage instanceof EntityUsage ) ) { + throw new InvalidArgumentException( '$usages must contain EntityUsage objects.' ); + } + if ( in_array( $usage->getAspect(), $this->disabledUsageAspects ) ) { + continue; + } + + $newUsages[] = $usage; + } + + return $newUsages; + } + + /** * @see UsageTracker::addUsedEntities * * @param int $pageId
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add EntityUsage::STATEMENT_USAGE and adopt UsageAccumulator
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/353154 ) Change subject: Add EntityUsage::STATEMENT_USAGE and adopt UsageAccumulator .. Add EntityUsage::STATEMENT_USAGE and adopt UsageAccumulator This allows adding entity usages for specific (groups of) Statements identified by their property id. I chose "C" as aspect key for the old "Claim" (:/), because "S" is already used for Sitelinks. Bug: T151717 Change-Id: Ia4c53a021917d16ad719c29b8b8f86e7216eb3fd --- M client/i18n/en.json M client/i18n/qqq.json M client/includes/Api/ApiListEntityUsage.php M client/includes/Api/ApiPropsEntityUsage.php M client/includes/Usage/EntityUsage.php M client/includes/Usage/UsageAccumulator.php M client/tests/phpunit/includes/Usage/UsageAccumulatorContractTester.php 7 files changed, 42 insertions(+), 0 deletions(-) Approvals: WMDE-leszek: Looks good to me, but someone else must approve jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/client/i18n/en.json b/client/i18n/en.json index a98e542..3d06608 100644 --- a/client/i18n/en.json +++ b/client/i18n/en.json @@ -112,6 +112,7 @@ "wikibase-pageinfo-entity-usage-S": "Sitelink", "wikibase-pageinfo-entity-usage-L": "Label: $1", "wikibase-pageinfo-entity-usage-T": "Title", + "wikibase-pageinfo-entity-usage-C": "Statement: $1", "wikibase-pageinfo-entity-usage-X": "All entity data", "wikibase-pageinfo-entity-usage-O": "Other (Statements)", "wikibase-property-render-error": "Failed to render property $1: $2", diff --git a/client/i18n/qqq.json b/client/i18n/qqq.json index ad291ef..8afc175 100644 --- a/client/i18n/qqq.json +++ b/client/i18n/qqq.json @@ -123,6 +123,7 @@ "wikibase-pageinfo-entity-usage-S": "Name for ''sitelink'' entity usage\n{{Identical|Sitelink}}", "wikibase-pageinfo-entity-usage-L": "Name for ''label'' entity usage\n{{Identical|Label}}", "wikibase-pageinfo-entity-usage-T": "Name for ''title'' entity usage\n{{Identical|Title}}", + "wikibase-pageinfo-entity-usage-C": "Name for ''statement'' entity usage\n", "wikibase-pageinfo-entity-usage-X": "Name for ''all'' entity usage", "wikibase-pageinfo-entity-usage-O": "Name for ''other'' entity usage", "wikibase-property-render-error": "Error message shown when the #property parser function fails to render a property value.\n\nParameters:\n* $1 - the property ID or name\n* $2 - the original error message (this is typically in English and may be rather technical)", diff --git a/client/includes/Api/ApiListEntityUsage.php b/client/includes/Api/ApiListEntityUsage.php index 0bd57b7..6296626 100644 --- a/client/includes/Api/ApiListEntityUsage.php +++ b/client/includes/Api/ApiListEntityUsage.php @@ -254,6 +254,7 @@ EntityUsage::SITELINK_USAGE, EntityUsage::LABEL_USAGE, EntityUsage::TITLE_USAGE, + EntityUsage::STATEMENT_USAGE, EntityUsage::ALL_USAGE, EntityUsage::OTHER_USAGE, ] diff --git a/client/includes/Api/ApiPropsEntityUsage.php b/client/includes/Api/ApiPropsEntityUsage.php index 7053e2b..a67a820 100644 --- a/client/includes/Api/ApiPropsEntityUsage.php +++ b/client/includes/Api/ApiPropsEntityUsage.php @@ -178,6 +178,7 @@ EntityUsage::SITELINK_USAGE, EntityUsage::LABEL_USAGE, EntityUsage::TITLE_USAGE, + EntityUsage::STATEMENT_USAGE, EntityUsage::ALL_USAGE, EntityUsage::OTHER_USAGE, ] diff --git a/client/includes/Usage/EntityUsage.php b/client/includes/Usage/EntityUsage.php index e4784b4..597878b 100644 --- a/client/includes/Usage/EntityUsage.php +++ b/client/includes/Usage/EntityUsage.php @@ -41,6 +41,14 @@ const TITLE_USAGE = 'T'; /** +* Usage flag indicating that certain statements (identified by their property id) +* from the entity were used. +* This currently implies that we also have an OTHER_USAGE or an ALL_USAGE +* for the same entity (STATEMENT_USAGE is never used alone). +*/ + const STATEMENT_USAGE = 'C'; + + /** * Usage flag indicating that any and all aspects of the entity * were (or may have been) used. */ @@ -63,6 +71,7 @@ self::SITELINK_USAGE => null, self::LABEL_USAGE => null, self::TITLE_USAGE => null, + self::STATEMENT_USAGE => null,
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Show wtachlist feed instead of a-z if the user is an editor
Ladsgroup has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355045 ) Change subject: Show wtachlist feed instead of a-z if the user is an editor .. Show wtachlist feed instead of a-z if the user is an editor Per our discussion with Jon in the hackathon today Bug: T88270 Change-Id: I5319ed7ff76b7d466ee63f16e1859d53cd8e7406 --- M extension.json M includes/specials/SpecialMobileWatchlist.php 2 files changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/45/355045/1 diff --git a/extension.json b/extension.json index b254664..1441b5b 100644 --- a/extension.json +++ b/extension.json @@ -1874,7 +1874,8 @@ "MFEnableManifest": true, "MFManifestThemeColor": "#252525", "MFManifestBackgroundColor": "#FF", - "MFLogWrappedInfoboxes": true + "MFLogWrappedInfoboxes": true, + "MFWatchlistEditCountThreshold": 10 }, "manifest_version": 1 } diff --git a/includes/specials/SpecialMobileWatchlist.php b/includes/specials/SpecialMobileWatchlist.php index 060f397..2e2b37a 100644 --- a/includes/specials/SpecialMobileWatchlist.php +++ b/includes/specials/SpecialMobileWatchlist.php @@ -54,6 +54,7 @@ * @param string $par parameter submitted as subpage */ function executeWhenAvailable( $par ) { + global $wgMFWatchlistEditCountThreshold; // Anons don't get a watchlist $this->requireLogin( 'mobile-frontend-watchlist-purpose' ); @@ -70,7 +71,14 @@ 'mobile.pagesummary.styles', ] ); $req = $this->getRequest(); - $this->view = $req->getVal( 'watchlistview', 'a-z' ); + + # Show watchlist feed if that person is an editor + if ( $this->getUser()->getEditCount() > $wgMFWatchlistEditCountThreshold ) { + $this->view = $req->getVal( 'watchlistview', 'feed' ); + } else { + $this->view = $req->getVal( 'watchlistview', 'a-z' ); + } + $this->filter = $req->getVal( 'filter', 'all' ); $this->fromPageTitle = Title::newFromText( $req->getVal( 'from', false ) ); -- To view, visit https://gerrit.wikimedia.org/r/355045 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5319ed7ff76b7d466ee63f16e1859d53cd8e7406 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Ladsgroup___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Whoops[master]: Switch .gitreview from defaultbranch to track
QChris has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355041 ) Change subject: Switch .gitreview from defaultbranch to track .. Switch .gitreview from defaultbranch to track Bug: T146293 Change-Id: I55d33510dc027fd266c85236d8144dde8a6c2f5a --- M .gitreview 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Whoops refs/changes/41/355041/1 diff --git a/.gitreview b/.gitreview index 49667b8..a76fdd7 100644 --- a/.gitreview +++ b/.gitreview @@ -2,5 +2,5 @@ host=gerrit.wikimedia.org port=29418 project=mediawiki/extensions/Whoops.git -defaultbranch=master +track=1 defaultrebase=0 -- To view, visit https://gerrit.wikimedia.org/r/355041 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I55d33510dc027fd266c85236d8144dde8a6c2f5a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Whoops Gerrit-Branch: master Gerrit-Owner: QChris___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Silence mediawiki::user exec-spam
Gergő Tisza has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355036 ) Change subject: Silence mediawiki::user exec-spam .. Silence mediawiki::user exec-spam The SQL-based 'unless' rule for setting user groups did not work for wikis where one of the groups (such as 'steward') did not exist. Change-Id: Ic22468404e21dab1cff0d26a79c0b9b58aecbee2 --- M puppet/modules/mediawiki/manifests/user.pp 1 file changed, 13 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/36/355036/1 diff --git a/puppet/modules/mediawiki/manifests/user.pp b/puppet/modules/mediawiki/manifests/user.pp index 6e270db..432a518 100644 --- a/puppet/modules/mediawiki/manifests/user.pp +++ b/puppet/modules/mediawiki/manifests/user.pp @@ -70,15 +70,17 @@ if ! empty($groups) { $comma_groups = join($groups, ',') -$comma_groups_sql = join($groups, "', '") +$comma_groups_php = join($groups, "', '") -$group_count = size($groups) -$sql_unless = " -SELECT COUNT(*) -FROM user_groups -JOIN user ON ug_user = user_id -WHERE user_name = '${canonical_username}' -AND ug_group IN ('${$comma_groups_sql}');" +# eval.php requires each command to be a single line +# double-escape $ against puppet + shell +$eval_unless = " +\\\$u = User::newFromName( '${username}' ); +\\\$u->load( User::READ_LATEST ); +\\\$expected_groups = array_intersect( [ '${comma_groups_php}' ], User::GetAllGroups() ); +\\\$actual_groups = \\\$u->getGroups(); +echo array_diff( \\\$expected_groups, \\\$actual_groups ) ? 'Bad' : 'Good'; +" mediawiki::maintenance { "mediawiki_user_${canonical_username}_${wiki}_${comma_groups}": command => "/usr/local/bin/mwscript createAndPromote.php --wiki='${wiki}' \ @@ -87,9 +89,9 @@ # Check that they're already in all the requested groups, # using counts. -unless => "/bin/echo \"${sql_unless}\" | \ -/usr/local/bin/mwscript sql.php --wikidb='${wiki}' | \ -/bin/grep -q '=> ${group_count}'", +unless => "/bin/echo \"${eval_unless}\" | \ +/usr/local/bin/mwscript eval.php --wiki='${wiki}' | \ +/bin/grep -q '^Good$'", require => [ Mediawiki::Maintenance["mediawiki_user_${canonical_username}_${wiki}"], ] -- To view, visit https://gerrit.wikimedia.org/r/355036 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic22468404e21dab1cff0d26a79c0b9b58aecbee2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/vagrant[master]: Add whoops role
Gergő Tisza has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355033 ) Change subject: Add whoops role .. Add whoops role Bug: T111731 Change-Id: I3353fe599b551c8ad381db5161650b631efa2229 --- A puppet/modules/role/manifests/whoops.pp 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/33/355033/1 diff --git a/puppet/modules/role/manifests/whoops.pp b/puppet/modules/role/manifests/whoops.pp new file mode 100644 index 000..3cb09d5 --- /dev/null +++ b/puppet/modules/role/manifests/whoops.pp @@ -0,0 +1,14 @@ +# == Class: role::whoops +# Installs the Whoops[https://www.mediawiki.org/wiki/Extension:Whoops] +# extension for nice exception display. +# +class role::whoops () { +mediawiki::extension { 'Whoops': +settings => { +wgShowExceptionDetails => true, +wgShowDBErrorBacktrace => true, +}, +composer => true, +} +} + -- To view, visit https://gerrit.wikimedia.org/r/355033 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3353fe599b551c8ad381db5161650b631efa2229 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Send queries via POST, not GET
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354878 ) Change subject: Send queries via POST, not GET .. Send queries via POST, not GET There is a limit on the length of GET request, both client-side and server-side. Sending all queries via GET requests means that long queries cannot be run from the query service UI. The server-side limit, imposed by an nginx server on query.wikidata.org, appears to be at 16334 bytes of query: a query of 16333 space characters (sent via curl, without URL-encoding the space characters) results in a parse error from BlazeGraph, a query of 16334 space characters results in a 414 Request-URI Too Large error from nginx. (I suspect that the real limit is 2^14 = 16384 bytes, also counting `GET /bigdata/namespace/wdq/sparql?query=` and `HTTP/1.1\r\n`, which seems to add up to 16384 bytes plus or minus some off-by-one errors.) The client-side limit is less clear, but according to some experiments appears to be 6167 bytes on both Firefox and Chromium, which corresponds to 2035 spaces in the query as sent by the query service UI (which encodes each space as %20, three bytes). Since the client-side limit can vary across browsers and there is no clear disadvantage to POST, we always send the query via POST. The “SPARQL endpoint” link offered next to “Display” and “Download” still contains the GET version, since a POST request cannot be expressed in a single, copyable URL. To test this behavior, it is useful to know that `printf %*s 10` prints 10 space characters to standard output. This can be used to quickly generate strings of a certain length. Change-Id: Ic770e25bb4bd2edf0008aeaf23447d412407c0f5 --- M wikibase/queryService/api/Sparql.js 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/wikibase/queryService/api/Sparql.js b/wikibase/queryService/api/Sparql.js index 7710bc0..33cb8e0 100644 --- a/wikibase/queryService/api/Sparql.js +++ b/wikibase/queryService/api/Sparql.js @@ -127,12 +127,16 @@ SELF.prototype.query = function( query ) { var self = this, deferred = $.Deferred(), - settings = { headers: { Accept: 'application/sparql-results+json' } }; + settings = { + headers: { Accept: 'application/sparql-results+json' }, + data: 'query=' + encodeURIComponent( query ), + method: 'POST' + }; - this._queryUri = this._serviceUri + '?query=' + encodeURIComponent( query ); + this._queryUri = this._serviceUri + '?' + settings.data; this._executionTime = Date.now(); - $.ajax( this._queryUri, settings ).done( function( data, textStatus, request ) { + $.ajax( this._serviceUri, settings ).done( function( data, textStatus, request ) { self._executionTime = Date.now() - self._executionTime; if ( typeof data.boolean === 'boolean' ) { -- To view, visit https://gerrit.wikimedia.org/r/354878 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic770e25bb4bd2edf0008aeaf23447d412407c0f5 Gerrit-PatchSet: 3 Gerrit-Project: wikidata/query/gui Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE)Gerrit-Reviewer: Jonas Kress (WMDE) Gerrit-Reviewer: Lucas Werkmeister (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...WikiEditor[master]: Add parameter useskin to action=parse for live preview
Fomafix has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355008 ) Change subject: Add parameter useskin to action=parse for live preview .. Add parameter useskin to action=parse for live preview This change duplicates the Change-Id: Ie3615866 in core and is needed to load the module 'mediawiki.toc' since Change-Id: Iaad84d24. Change-Id: Ie667e97737acb66a8efcb299bc081b9577ae24d6 --- M modules/jquery.wikiEditor.preview.js 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor refs/changes/08/355008/1 diff --git a/modules/jquery.wikiEditor.preview.js b/modules/jquery.wikiEditor.preview.js index 57c0293..faac2b8 100644 --- a/modules/jquery.wikiEditor.preview.js +++ b/modules/jquery.wikiEditor.preview.js @@ -66,6 +66,7 @@ prop: 'text|modules|jsconfigvars', preview: true, disableeditsection: true, + useskin: mw.config.get( 'skin' ), uselang: mw.config.get( 'wgUserLanguage' ) } ).done( function ( data ) { var loadmodules, $content; -- To view, visit https://gerrit.wikimedia.org/r/355008 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie667e97737acb66a8efcb299bc081b9577ae24d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: Fomafix___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Sort by the 'most popular' newsletters
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354905 ) Change subject: Sort by the 'most popular' newsletters .. Sort by the 'most popular' newsletters Co-Authored-By: Brian WolffBug: T131607 Change-Id: I51d63df8efb4e036606f648f2e6ddf18d37fd565 --- M Newsletter.hooks.php M includes/specials/pagers/NewsletterTablePager.php A sql/nl_newsletter-add-nl_active_subscriber_name.sql A sql/nl_newsletter-drop-nl-active_name.sql 4 files changed, 158 insertions(+), 26 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/Newsletter.hooks.php b/Newsletter.hooks.php index 32dd5e5..95795f8 100755 --- a/Newsletter.hooks.php +++ b/Newsletter.hooks.php @@ -117,6 +117,10 @@ __DIR__ . '/sql/nl_newsletters-add-unique.sql' ); $updater->addExtensionField( 'nl_newsletters', 'nl_subscriber_count', __DIR__ . '/sql/nl_newsletters-add-subscriber_count.sql' ); + $updater->dropExtensionIndex( 'nl_newsletters', 'nl_active_name', + __DIR__ . '/sql/nl_newsletter-drop-nl-active_name.sql' ); + $updater->addExtensionIndex( 'nl_newsletters', 'nl_active_subscriber_name', + __DIR__ . '/sql/nl_newsletter-add-nl_active_subscriber_name.sql' ); return true; } diff --git a/includes/specials/pagers/NewsletterTablePager.php b/includes/specials/pagers/NewsletterTablePager.php index 7623d1d..90f5172 100644 --- a/includes/specials/pagers/NewsletterTablePager.php +++ b/includes/specials/pagers/NewsletterTablePager.php @@ -3,12 +3,16 @@ /** * @license GNU GPL v2+ * @author Tina Johnson - * @todo Optimize queries here + * @author Brian Wolff + * @author Tony Thomas <01tonytho...@gmail.com> */ use MediaWiki\MediaWikiServices; class NewsletterTablePager extends TablePager { + + /** Added to offset for sorting reasons */ + const EXTRAINT = 15000; /** * @var string[] @@ -28,6 +32,9 @@ if ( $readDb !== null ) { $this->mDb = $readDb; } + // Because we mIndexField is not unique + // we need the last one. + $this->setIncludeOffset( true ); parent::__construct( $context ); } @@ -48,13 +55,33 @@ return $this->fieldNames; } - private function getSubscribedQuery( $offset, $limit, $descending ) { + /** +* Get the query for newsletters for which the user is subscribed to. +* +* This is either run directly or as part as a union. its +* done as part of a union to avoid expensive filesort. +* +* @param string $offset The indexpager offset (Number of subscribers) +* @param int $limit The limit +* @param boolean $descending Ascending or descending? +* @param string $secondaryOffset For tiebreaking the order (nl_name) +*/ + private function getSubscribedQuery( $offset, $limit, $descending, $secondaryOffset ) { // XXX Hacky $oldIndex = $this->mIndexField; - $this->mIndexField = 'nl_name'; + $this->mIndexField = 'nl_subscriber_count'; $this->mode = 'subscribed'; list( $tables, $fields, $conds, $fname, $options, $join_conds ) = $this->buildQueryInfo( $offset, $limit, $descending ); + + if ( $secondaryOffset !== false ) { + $conds[] = $this->getSecondaryOrderBy( $descending, $offset, $secondaryOffset ); + } + if ( !$this->mDb->unionSupportsOrderAndLimit() ) { + // Sqlite is going to be inefficient + unset( $options['ORDER BY'] ); + unset( $options['LIMIT'] ); + } $subscribedPart = $this->mDb->selectSQLText( $tables, $fields, $conds, $fname, $options, $join_conds ); @@ -62,13 +89,51 @@ return $subscribedPart; } - private function getUnsubscribedQuery( $offset, $limit, $descending ) { + /** +* Add paging conditions for tie-breaking +* +* @param $desc +* @param $offset +* @param $secondaryOffset +* @return mixed +*/ + private function getSecondaryOrderBy( $desc, $offset, $secondaryOffset ) { + $operator = $this->getOp( $desc ); + return $this->mDb->makeList( [ + 'nl_subscriber_count ' . $operator . $this->mDb->addQuotes( $offset ), + $this->mDb->makeList( [ + 'nl_subscriber_count' => $offset, +
[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Use in the 'nl_subscriber_count' to compute subscriber count
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355006 ) Change subject: Use in the 'nl_subscriber_count' to compute subscriber count .. Use in the 'nl_subscriber_count' to compute subscriber count * Also removed unused NewsletterDb::getNewslettersFromResult() Bug: T159083 Change-Id: I58f226b58681a797b7351ea704959682cd9f80a6 --- M includes/Newsletter.php M includes/NewsletterDb.php M includes/NewsletterStore.php M includes/content/NewsletterContent.php 4 files changed, 34 insertions(+), 18 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Newsletter.php b/includes/Newsletter.php index c86301f..820f1ad 100644 --- a/includes/Newsletter.php +++ b/includes/Newsletter.php @@ -117,9 +117,8 @@ /** * @return int */ - public function getSubscriberCount() { - $this->loadSubscribers(); - return count( $this->subscribers ); + public function getSubscribersCount() { + return NewsletterStore::getDefaultInstance()->getNewsletterSubscribersCount( $this->id ); } /** diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php index eea58d0..91baed2 100644 --- a/includes/NewsletterDb.php +++ b/includes/NewsletterDb.php @@ -360,6 +360,29 @@ } /** +* @param $id +* @return array +*/ + public function getNewsletterSubscribersCount( $id ) { + Assert::parameterType( 'integer', $id, '$id' ); + + $dbr = $this->lb->getConnection( DB_SLAVE ); + + $result = $dbr->selectField( + 'nl_newsletters', + 'nl_subscriber_count', + [ 'nl_id' => $id ], + __METHOD__ + ); + + $this->lb->reuseConnection( $dbr ); + + // We store nl_subscriber_count as negative numbers so that sorting should work on one + // direction + return -(int)$result; + } + + /** * @param int $id * * @return int[] @@ -400,20 +423,6 @@ $this->lb->reuseConnection( $dbr ); return $res; - } - - /** -* @param ResultWrapper $result -* -* @return Newsletter[] -*/ - private function getNewslettersFromResult( ResultWrapper $result ) { - $newsletters = []; - foreach ( $result as $row ) { - $newsletters[] = $this->getNewsletterFromRow( $row ); - } - - return $newsletters; } /** diff --git a/includes/NewsletterStore.php b/includes/NewsletterStore.php index 30dbfd9..c2121d4 100644 --- a/includes/NewsletterStore.php +++ b/includes/NewsletterStore.php @@ -190,6 +190,14 @@ } /** +* @param $id +* @return array +*/ + public function getNewsletterSubscribersCount( $id ) { + return $this->db->getNewsletterSubscribersCount( $id ); + } + + /** * @param int $id * * @return int[] diff --git a/includes/content/NewsletterContent.php b/includes/content/NewsletterContent.php index 4da1bff..67d2aac 100644 --- a/includes/content/NewsletterContent.php +++ b/includes/content/NewsletterContent.php @@ -150,7 +150,7 @@ 'type' => 'info', 'label-message' => 'newsletter-view-subscriber-count', 'default' => !$this->newsletter ? 0 : $options->getUserLangObj()->formatNum( - $this->newsletter->getSubscriberCount() ), + $this->newsletter->getSubscribersCount() ), ], ]; $publishersArray = $this->getPublishersFromJSONData( $this->publishers ); -- To view, visit https://gerrit.wikimedia.org/r/355006 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I58f226b58681a797b7351ea704959682cd9f80a6 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: 01tonythomas <01tonytho...@gmail.com> Gerrit-Reviewer: Brian WolffGerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Allow modules to be registered via a factory...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/351878 ) Change subject: resourceloader: Allow modules to be registered via a factory callback .. resourceloader: Allow modules to be registered via a factory callback This should work the same way as registering API modules via a factory callback. Point in case: Ifb8611473a971 could avoid global state using this mechanism. Change-Id: Ifbf29006141ce2a2dff42efa352f406502a06bc6 --- M RELEASE-NOTES-1.30 M docs/extension.schema.v2.json M includes/resourceloader/ResourceLoader.php M tests/phpunit/includes/resourceloader/ResourceLoaderTest.php 4 files changed, 35 insertions(+), 1 deletion(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/RELEASE-NOTES-1.30 b/RELEASE-NOTES-1.30 index fbe23ab..03ae7c2 100644 --- a/RELEASE-NOTES-1.30 +++ b/RELEASE-NOTES-1.30 @@ -17,6 +17,9 @@ This is intended for extensions that want control over the instantiation of their jobs, to allow for proper dependency injection. +* $wgResourceModules may now specify callback functions as an alternative + to plain class names, using the 'factory' key in the module description + array. This allows dependency injection to be used for ResourceLoader modules. === New features in 1.30 === * (T37247) Output from Parser::parse() will now be wrapped in a div with diff --git a/docs/extension.schema.v2.json b/docs/extension.schema.v2.json index d5a9b65..6345632 100644 --- a/docs/extension.schema.v2.json +++ b/docs/extension.schema.v2.json @@ -318,7 +318,7 @@ } }, { - "description": "An arbitrary ResourceLoaderModule definition", + "description": "An arbitrary ResourceLoaderModule definition by class", "properties": { "class": { "type": "string", @@ -326,6 +326,16 @@ } }, "required": ["class"] + }, + { + "description": "An arbitrary ResourceLoaderModule definition with instantiator", + "properties": { + "factory": { + "type": "string", + "description": "A static instantiator function for creating the ResourceLoaderModule object." + } + }, + "required": ["factory"] } ] } diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 3cd7821..0d12840 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -541,6 +541,10 @@ if ( isset( $info['object'] ) ) { // Object given in info array $object = $info['object']; + } elseif ( isset( $info['factory'] ) ) { + $object = call_user_func( $info['factory'], $info ); + $object->setConfig( $this->getConfig() ); + $object->setLogger( $this->logger ); } else { if ( !isset( $info['class'] ) ) { $class = 'ResourceLoaderFileModule'; diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php index af3212a..0833047 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php @@ -146,6 +146,23 @@ /** * @covers ResourceLoader::getModule */ + public function testGetModuleFactory() { + $factory = function( array $info ) { + $this->assertArrayHasKey( 'kitten', $info ); +
[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Make nl_subscriber_count negative.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354945 ) Change subject: Make nl_subscriber_count negative. .. Make nl_subscriber_count negative. We want to do queries ordered by nl_subscriber_count asc, nl_name desc but that causes a filesort (Can't open index in both directions). So instead we are making nl_subscriber_count be defined negative. Change-Id: I51d63ee8ef04e036606f648f2e6ddf18d37fd565 --- M includes/NewsletterDb.php M maintenance/updateSubscribersCount.php M sql/nl_newsletters-add-subscriber_count.sql 3 files changed, 8 insertions(+), 4 deletions(-) Approvals: 01tonythomas: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php index eea58d0..63f02f5 100644 --- a/includes/NewsletterDb.php +++ b/includes/NewsletterDb.php @@ -39,7 +39,8 @@ if ( $success ) { $dbw->update( 'nl_newsletters', - [ 'nl_subscriber_count=nl_subscriber_count+1' ], + // For index reasons, count is negative + [ 'nl_subscriber_count=nl_subscriber_count-1' ], [ 'nl_id' => $newsletter->getId() ], __METHOD__ ); @@ -70,7 +71,8 @@ if ( $success ) { $dbw->update( 'nl_newsletters', - [ 'nl_subscriber_count=nl_subscriber_count-1' ], + // For index reasons, count is negative + [ 'nl_subscriber_count=nl_subscriber_count+1' ], [ 'nl_id' => $newsletter->getId() ], __METHOD__ ); diff --git a/maintenance/updateSubscribersCount.php b/maintenance/updateSubscribersCount.php index 17bc93a..25c6611 100644 --- a/maintenance/updateSubscribersCount.php +++ b/maintenance/updateSubscribersCount.php @@ -31,7 +31,8 @@ foreach ( $res as $row ) { $dbw->update( 'nl_newsletters', - [ 'nl_subscriber_count' => $row->subscriber_count ], + // This column is negative for index reasons. + [ 'nl_subscriber_count' => -$row->subscriber_count ], [ 'nl_id' => $row->nl_id ], __METHOD__ ); diff --git a/sql/nl_newsletters-add-subscriber_count.sql b/sql/nl_newsletters-add-subscriber_count.sql index 7e60a7f..a3d6a40 100644 --- a/sql/nl_newsletters-add-subscriber_count.sql +++ b/sql/nl_newsletters-add-subscriber_count.sql @@ -1,3 +1,4 @@ -- Add a column nl_subscriber_count to enable better sorting +-- This is always a negative integer, for indexing reasons. ALTER TABLE /*_*/nl_newsletters - ADD COLUMN nl_subscriber_count INTEGER NOT NULL DEFAULT 0; \ No newline at end of file + ADD COLUMN nl_subscriber_count INTEGER NOT NULL DEFAULT 0; -- To view, visit https://gerrit.wikimedia.org/r/354945 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I51d63ee8ef04e036606f648f2e6ddf18d37fd565 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Brian WolffGerrit-Reviewer: 01tonythomas <01tonytho...@gmail.com> 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.1]: Fix the web updater
Paladox has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355007 ) Change subject: Fix the web updater .. Fix the web updater It kept failing with Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ESCAPE '`'' at line 1 (localhost) Change-Id: I2671415fc34b1e6226104c88ca21fafc860bb7fb (cherry picked from commit 5d56bcb925af653fed427e90a1cfb982de386720) --- M includes/installer/MysqlInstaller.php 1 file changed, 12 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/07/355007/1 diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 09051f4..4f0b66c 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -179,8 +179,8 @@ # Determine existing default character set if ( $conn->tableExists( "revision", __METHOD__ ) ) { - $revision = $conn->buildLike( $this->getVar( 'wgDBprefix' ) . 'revision' ); - $res = $conn->query( "SHOW TABLE STATUS $revision", __METHOD__ ); + $revision = $this->escapeLikeInternal( $this->getVar( 'wgDBprefix' ) . 'revision', '\\' ); + $res = $conn->query( "SHOW TABLE STATUS LIKE '$revision'", __METHOD__ ); $row = $conn->fetchObject( $res ); if ( !$row ) { $this->parent->showMessage( 'config-show-table-status' ); @@ -222,6 +222,16 @@ } /** +* @param string $s +* @return string +*/ + protected function escapeLikeInternal( $s, $escapeChar = '`' ) { + return str_replace( [ $escapeChar, '%', '_' ], + [ "{$escapeChar}{$escapeChar}", "{$escapeChar}%", "{$escapeChar}_" ], + $s ); + } + + /** * Get a list of storage engines that are available and supported * * @return array -- To view, visit https://gerrit.wikimedia.org/r/355007 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2671415fc34b1e6226104c88ca21fafc860bb7fb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.1 Gerrit-Owner: Paladox___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Add newsletter queries should go into a single transaction
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354930 ) Change subject: Add newsletter queries should go into a single transaction .. Add newsletter queries should go into a single transaction * Announce issue page should check if title exists Bug: T159081 Change-Id: I1b46a4450c6d3dfcdbbc5536694b21e6f28be568 --- M includes/NewsletterDb.php M includes/specials/SpecialNewsletter.php 2 files changed, 4 insertions(+), 0 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php index eea58d0..bbe5aef 100644 --- a/includes/NewsletterDb.php +++ b/includes/NewsletterDb.php @@ -443,6 +443,7 @@ // Note: the writeDb is used as this is used in the next insert $dbw = $this->lb->getConnection( DB_MASTER ); + $dbw->begin( __METHOD__ ); $lastIssueId = (int)$dbw->selectField( 'nl_issues', 'MAX(nli_issue_id)', @@ -463,7 +464,9 @@ ], __METHOD__ ); + $dbw->commit( __METHOD__ ); } catch ( DBQueryError $ex ) { + $dbw->rollback( __METHOD__ ); $success = false; } diff --git a/includes/specials/SpecialNewsletter.php b/includes/specials/SpecialNewsletter.php index a2e0dc2..9bfcf00 100644 --- a/includes/specials/SpecialNewsletter.php +++ b/includes/specials/SpecialNewsletter.php @@ -300,6 +300,7 @@ $fields = [ 'issuepage' => [ 'type' => 'title', + 'exists' => true, 'name' => 'issuepage', 'creatable' => true, 'required' => true, -- To view, visit https://gerrit.wikimedia.org/r/354930 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1b46a4450c6d3dfcdbbc5536694b21e6f28be568 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: 01tonythomas <01tonytho...@gmail.com> Gerrit-Reviewer: Brian WolffGerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Refreshed[master]: v3.2.0 - Fix #site-notice interaction with #header-wrapper
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354882 ) Change subject: v3.2.0 - Fix #site-notice interaction with #header-wrapper .. v3.2.0 - Fix #site-notice interaction with #header-wrapper Bug: T152939 Change-Id: I7d5640acc7a04f34222b92369000198895811303 --- M refreshed/mediawiki/skinning.interface.css M skin.json 2 files changed, 5 insertions(+), 1 deletion(-) Approvals: SamanthaNguyen: Looks good to me, approved jenkins-bot: Verified diff --git a/refreshed/mediawiki/skinning.interface.css b/refreshed/mediawiki/skinning.interface.css index c66e944..44179e3 100644 --- a/refreshed/mediawiki/skinning.interface.css +++ b/refreshed/mediawiki/skinning.interface.css @@ -5,6 +5,10 @@ font-size: 0.8em; } +#site-notice { + display: inline-block; +} + #localNotice { margin-bottom: 0em !important; } diff --git a/skin.json b/skin.json index 561cda1..87312f3 100644 --- a/skin.json +++ b/skin.json @@ -1,6 +1,6 @@ { "name": "Refreshed", - "version": "3.1.9", + "version": "3.2.0", "author": [ "Adam Carter", "Drew1200", -- To view, visit https://gerrit.wikimedia.org/r/354882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7d5640acc7a04f34222b92369000198895811303 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Refreshed Gerrit-Branch: master Gerrit-Owner: SamanthaNguyenGerrit-Reviewer: Jack Phoenix Gerrit-Reviewer: SamanthaNguyen 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...Newsletter[master]: Use in the 'nl_subscriber_count' to compute subscriber count
01tonythomas has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355006 ) Change subject: Use in the 'nl_subscriber_count' to compute subscriber count .. Use in the 'nl_subscriber_count' to compute subscriber count * Also removed unused NewsletterDb::getNewslettersFromResult() Bug: T159083 Change-Id: I58f226b58681a797b7351ea704959682cd9f80a6 --- M includes/Newsletter.php M includes/NewsletterDb.php M includes/NewsletterStore.php M includes/content/NewsletterContent.php 4 files changed, 33 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/06/355006/1 diff --git a/includes/Newsletter.php b/includes/Newsletter.php index c86301f..820f1ad 100644 --- a/includes/Newsletter.php +++ b/includes/Newsletter.php @@ -117,9 +117,8 @@ /** * @return int */ - public function getSubscriberCount() { - $this->loadSubscribers(); - return count( $this->subscribers ); + public function getSubscribersCount() { + return NewsletterStore::getDefaultInstance()->getNewsletterSubscribersCount( $this->id ); } /** diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php index eea58d0..74d55c2 100644 --- a/includes/NewsletterDb.php +++ b/includes/NewsletterDb.php @@ -359,6 +359,28 @@ return array_map( 'intval', $result ); } + + /** +* @param $id +* @return array +*/ + public function getNewsletterSubscribersCount( $id ) { + Assert::parameterType( 'integer', $id, '$id' ); + + $dbr = $this->lb->getConnection( DB_SLAVE ); + + $result = $dbr->selectField( + 'nl_newsletters', + 'nl_subscriber_count', + [ 'nl_id' => $id ], + __METHOD__ + ); + + $this->lb->reuseConnection( $dbr ); + + return -(int)$result; + } + /** * @param int $id * @@ -400,20 +422,6 @@ $this->lb->reuseConnection( $dbr ); return $res; - } - - /** -* @param ResultWrapper $result -* -* @return Newsletter[] -*/ - private function getNewslettersFromResult( ResultWrapper $result ) { - $newsletters = []; - foreach ( $result as $row ) { - $newsletters[] = $this->getNewsletterFromRow( $row ); - } - - return $newsletters; } /** diff --git a/includes/NewsletterStore.php b/includes/NewsletterStore.php index 30dbfd9..c2121d4 100644 --- a/includes/NewsletterStore.php +++ b/includes/NewsletterStore.php @@ -190,6 +190,14 @@ } /** +* @param $id +* @return array +*/ + public function getNewsletterSubscribersCount( $id ) { + return $this->db->getNewsletterSubscribersCount( $id ); + } + + /** * @param int $id * * @return int[] diff --git a/includes/content/NewsletterContent.php b/includes/content/NewsletterContent.php index 4da1bff..67d2aac 100644 --- a/includes/content/NewsletterContent.php +++ b/includes/content/NewsletterContent.php @@ -150,7 +150,7 @@ 'type' => 'info', 'label-message' => 'newsletter-view-subscriber-count', 'default' => !$this->newsletter ? 0 : $options->getUserLangObj()->formatNum( - $this->newsletter->getSubscriberCount() ), + $this->newsletter->getSubscribersCount() ), ], ]; $publishersArray = $this->getPublishersFromJSONData( $this->publishers ); -- To view, visit https://gerrit.wikimedia.org/r/355006 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58f226b58681a797b7351ea704959682cd9f80a6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: 01tonythomas <01tonytho...@gmail.com> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Don't treat users who used to be blocked as blocked
MusikAnimal has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355004 ) Change subject: Don't treat users who used to be blocked as blocked .. Don't treat users who used to be blocked as blocked Bug: T165891 Change-Id: I13112e49b325bfc64e2aed5332f61863499feb62 --- M includes/ArticleMetadata.php 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage refs/changes/04/355004/1 diff --git a/includes/ArticleMetadata.php b/includes/ArticleMetadata.php index e5b0245..68a92f5 100755 --- a/includes/ArticleMetadata.php +++ b/includes/ArticleMetadata.php @@ -892,6 +892,8 @@ return true; } + $now = wfTimestampNow(); + $res = $this->db->select( [ 'revision', 'user', 'ipblocks' ], [ @@ -904,7 +906,10 @@ [], [ 'user' => [ 'LEFT JOIN', 'rev_user = user_id' ], - 'ipblocks' => [ 'LEFT JOIN', 'rev_user = ipb_user AND rev_user_text = ipb_address' ] + 'ipblocks' => [ + 'LEFT JOIN', + "rev_user = ipb_user AND rev_user_text = ipb_address AND ipb_expiry > $now" + ] ] ); -- To view, visit https://gerrit.wikimedia.org/r/355004 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13112e49b325bfc64e2aed5332f61863499feb62 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageTriage Gerrit-Branch: master Gerrit-Owner: MusikAnimal___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Remove hacks for unsupported IE versions
Esanders has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355005 ) Change subject: Remove hacks for unsupported IE versions .. Remove hacks for unsupported IE versions Change-Id: I2f63652cfa25128047db5d2e9d18aa6b5489804d --- M extension.json M lqt.js 2 files changed, 4 insertions(+), 22 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads refs/changes/05/355005/1 diff --git a/extension.json b/extension.json index 93632cd..367814d 100644 --- a/extension.json +++ b/extension.json @@ -151,7 +151,6 @@ "mediawiki.action.edit.preview", "mediawiki.api.watch", "user.tokens", - "jquery.client", "user.options", "mediawiki.api", "mediawiki.util" diff --git a/lqt.js b/lqt.js index 2323982..6234362 100644 --- a/lqt.js +++ b/lqt.js @@ -138,7 +138,7 @@ }, injectEditForm: function ( params, $container, preload ) { - var isIE7, $loadSpinner, $container, + var $loadSpinner, $container, page = $container.closest( '.lqt-thread-topmost' ) .find( '.lqt-thread-talkpage-metadata' ).val(); if ( !page ) { @@ -146,9 +146,6 @@ } liquidThreads.cancelEdit( $container ); - - isIE7 = $.client.test( { msie: [ [ '>=', 7 ], [ '<', 8 ] ] }, - $.client.profile(), true ); $loadSpinner = $( '' ).addClass( 'mw-ajax-loader lqt-loader' ); $container.before( $loadSpinner ); @@ -194,11 +191,7 @@ $container.find( 'textarea' )[ 0 ].value = preload; } - if ( isIE7 ) { - setTimeout( finishShow, 500 ); - } else { - $container.slideDown( 'slow', finishShow ); - } + $container.slideDown( 'slow', finishShow ); $cancelButton = $container.find( '#mw-editform-cancel' ); $cancelButton.click( liquidThreads.cancelEdit ); @@ -231,9 +224,6 @@ mw.loader.using( [ 'mediawiki.action.edit' ], function () { - if ( isIE7 ) { - $container.empty().show(); - } liquidThreads.loadInlineEditForm( params, $container, function () { var dependencies = [ 'ext.wikiEditor', 'user.options', 'jquery.wikiEditor.toolbar', 'jquery.wikiEditor.toolbar.config', @@ -259,16 +249,9 @@ } ); }, - // From http://clipmarks.com/clipmark/CEFC94CB-94D6-4495-A7AA-791B7355E284/ insertAtCursor: function ( myField, myValue ) { - var sel, startPos, endPos; - if ( document.selection ) { - // IE support - myField.focus(); - sel = document.selection.createRange(); - sel.text = myValue; - } else if ( myField.selectionStart || myField.selectionStart === '0' ) { - // MOZILLA/NETSCAPE support + var startPos, endPos; + if ( myField.selectionStart || myField.selectionStart === '0' ) { startPos = myField.selectionStart; endPos = myField.selectionEnd; myField.value = myField.value.substring( 0, startPos ) + myValue + myField.value.substring( endPos, myField.value.length ); -- To view, visit https://gerrit.wikimedia.org/r/355005 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f63652cfa25128047db5d2e9d18aa6b5489804d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LiquidThreads 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...Metrolook[master]: Use https links
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355003 ) Change subject: Use https links .. Use https links Change-Id: Iac97d6cbd73513940ed76bc5db8d543c1ab2a4b5 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Paladox: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index ba4945c..3b36eb0 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -10,6 +10,6 @@ "metrolook.js": "/* Any JavaScript here will be loaded for users using the Metrolook skin */", "skinmetrolook-collapsiblenav-preference": "Enable collapsing of items in the sidebar in Metrolook skin", "metrolook-guest": "Guest", - "metrolook-tiles": "* https://www.pidgi.net/wiki/|PidgiWiki|https://images.pidgi.net/pidgiwikitiletop.png\n* httpd://www.pidgi.net/press/|PidgiWiki Press|https://images.pidgi.net/pidgipresstiletop.png\n* https://www.petalburgwoods.com/|Petalburg Woods|https://images.pidgi.net/pwntiletop.png\n* https://burstcade.pidgi.net/|Burstcade|https://images.pidgi.net/burstcadetiletop.png;, + "metrolook-tiles": "* https://www.pidgi.net/wiki/|PidgiWiki|https://images.pidgi.net/pidgiwikitiletop.png\n* https://www.pidgi.net/press/|PidgiWiki Press|https://images.pidgi.net/pidgipresstiletop.png\n* https://www.petalburgwoods.com/|Petalburg Woods|https://images.pidgi.net/pwntiletop.png\n* https://burstcade.pidgi.net/|Burstcade|https://images.pidgi.net/burstcadetiletop.png;, "metrolook-tiles-second": "" } -- To view, visit https://gerrit.wikimedia.org/r/355003 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac97d6cbd73513940ed76bc5db8d543c1ab2a4b5 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/skins/Metrolook Gerrit-Branch: master Gerrit-Owner: PaladoxGerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Metrolook[master]: Use https links
Paladox has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355003 ) Change subject: Use https links .. Use https links Change-Id: Iac97d6cbd73513940ed76bc5db8d543c1ab2a4b5 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Metrolook refs/changes/03/355003/1 -- To view, visit https://gerrit.wikimedia.org/r/355003 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac97d6cbd73513940ed76bc5db8d543c1ab2a4b5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Metrolook Gerrit-Branch: master Gerrit-Owner: Paladox___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Re-initialize WikiEditor when not present
Esanders has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355002 ) Change subject: Re-initialize WikiEditor when not present .. Re-initialize WikiEditor when not present Bug: T165976 Change-Id: I628f2447a699c25bf09a5a769c7e1382c01441b6 --- M lqt.js 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads refs/changes/02/355002/1 diff --git a/lqt.js b/lqt.js index 1306373..2323982 100644 --- a/lqt.js +++ b/lqt.js @@ -206,7 +206,13 @@ $container.find( '#wpTextbox1' ).attr( 'rows', 12 ); $container.find( '#wpDiff' ).hide(); - if ( $.fn.wikiEditor ) { + if ( $.fn.wikiEditor && $.wikiEditor.isSupported( $.wikiEditor.modules.toolbar ) ) { + if ( !$( '#wpTextbox1' ).data( 'wikiEditor-context' ) ) { + // Add wikiEditor toolbar + $( '#wpTextbox1' ).wikiEditor( 'addModule', $.wikiEditor.modules.toolbar.config.getDefaultConfig() ); + $( '#wpTextbox1' ).wikiEditor( 'addModule', $.wikiEditor.modules.dialogs.config.getDefaultConfig() ); + } + // cleanup unnecessary things from the old toolbar $( '#editpage-specialchars' ).remove(); $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { -- To view, visit https://gerrit.wikimedia.org/r/355002 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I628f2447a699c25bf09a5a769c7e1382c01441b6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LiquidThreads 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] operations...pybal[master]: Create new BGP message classes for incremental construction
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354684 ) Change subject: Create new BGP message classes for incremental construction .. Create new BGP message classes for incremental construction The existing construct* methods in the BGP class are simple and work well, but are not really flexible or optimal for large messages such as UPDATEs. Introduce a new ancestor class BGPMessage and derived BGPUpdateMessage for efficient and incremental package construction. Also move BGP.constructHeader to BGPMessage.prependHeader as a static method. Change-Id: I542ca34c09de45005b083c3f5f7797653f664989 --- M pybal/bgp.py 1 file changed, 101 insertions(+), 13 deletions(-) Approvals: Ema: Looks good to me, but someone else must approve Mark Bergsma: Looks good to me, approved jenkins-bot: Verified diff --git a/pybal/bgp.py b/pybal/bgp.py index f38f0ce..48132f4 100644 --- a/pybal/bgp.py +++ b/pybal/bgp.py @@ -1349,7 +1349,103 @@ self.protocol.closeConnection() # Remove from connections list if self.bgpPeering: self.bgpPeering.connectionClosed(self.protocol) - + +class BGPMessage(object): +msgtype = None +msgLenOffset = 16 + +def __init__(self): +self.msg = (bytearray(HDR_LEN), ) +self.constructHeader() + +def __repr__(self): +msgType = { +MSG_OPEN: "OPEN", +MSG_UPDATE: "UPDATE", +MSG_NOTIFICATION: "NOTIFICATION", +MSG_KEEPALIVE: "KEEPALIVE", + +}.get(self.msgtype, "Invalid") +return "" % (msgType, len(self)) + +def __str__(self): +return "".join([str(part) for part in self.msg]) + +def __len__(self): +return sum([len(part) for part in self.msg]) + +def __getitem__(self, i): +return buffer(self.msg[i]) + +@staticmethod +def prependHeader(message, type): +"""Prepends the mandatory header to a constructed BGP message""" + +return struct.pack('!16sHB', + chr(255)*16, + len(message)+HDR_LEN, + type) + message + +def constructHeader(self, buffer=None): +struct.pack_into('!16sHB', (buffer or self.msg[0]), 0, +chr(255)*16, +len(self), +self.msgtype) + +def _append(self, buf, data, lenOffset=None): +""" +Appends variable records (e.g. NLRI, attributes) and updates +the variable length and total message size. +""" + +newSize = len(self) + len(data) +if newSize <= MAX_LEN: +buf.extend(data) +if lenOffset: +struct.pack_into('!H', buf, lenOffset, len(buf) - lenOffset - 2) +struct.pack_into('!H', self.msg[0], self.msgLenOffset, newSize) +else: +raise ValueError("New message size %s would exceed MAX_LEN %d" % +(newSize, MAX_LEN)) + +class BGPUpdateMessage(BGPMessage): +msgtype = MSG_UPDATE + +def __init__(self): +super(BGPUpdateMessage, self).__init__() +self.msg = (self.msg[0], bytearray(2), bytearray(2), bytearray()) +self.withdrCount, self.attrCount, self.nlriCount = 0, 0, 0 + +def __repr__(self): +return (super(BGPUpdateMessage, self).__repr__()[:-1] ++ ", [%d:%d] withdrawals" % (self.withdrCount, len(self.msg[1])) ++ ", [%d:%d] attributes" % (self.attrCount, len(self.msg[2])) ++ ", [%d:%d] NLRI>" % (self.nlriCount, len(self.msg[3]))) + + +def addWithdrawals(self, withdrawals): +""" +Incrementally adds withdrawals to the UPDATE message. +Does not attempt to remove duplicates. +""" +self._append(self.msg[1], BGP.encodePrefixes(withdrawals)) +self.withdrCount += len(withdrawals) + +def addAttributes(self, attributes): +""" +Incrementally adds NLRI attributes to the UPDATE message. +""" + +self._append(self.msg[2], BGP.encodeAttributes(attributes)) +self.attrCount += len(attributes) + +def addNLRI(self, nlri): +""" +Incrementally adds NLRI to the UPDATE message. +""" + +self._append(self.msg[3], BGP.encodePrefixes(nlri)) +self.nlriCount += len(nlri) class BGP(protocol.Protocol): """Protocol class for BGP 4""" @@ -1451,14 +1547,6 @@ self.transport.write(self.constructNotification(error, suberror, data)) -def constructHeader(self, message, type): -"""Prepends the mandatory header to a constructed BGP message""" - -return struct.pack('!16sHB', - chr(255)*16, - len(message)+19, - type) + message - def constructOpen(self): """Constructs a BGP Open message""" @@ -1473,7 +1561,7 @@
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Put print click handler on link, not on list item
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354998 ) Change subject: Put print click handler on link, not on list item .. Put print click handler on link, not on list item Was responding to clicks outside the link, which was confusing. Bug: T24256 Change-Id: I22f7cf20a08bb4204b0442defeb7cfb83899b969 --- M resources/src/mediawiki/page/ready.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki/page/ready.js b/resources/src/mediawiki/page/ready.js index 758e20a..1f6c8a6 100644 --- a/resources/src/mediawiki/page/ready.js +++ b/resources/src/mediawiki/page/ready.js @@ -59,7 +59,7 @@ mw.hook( 'wikipage.categories' ).fire( $nodes ); } - $( '#t-print' ).click( function ( e ) { + $( '#t-print a' ).click( function ( e ) { window.print(); e.preventDefault(); } ); -- To view, visit https://gerrit.wikimedia.org/r/354998 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22f7cf20a08bb4204b0442defeb7cfb83899b969 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Brion VIBBERGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Krinkle Gerrit-Reviewer: TheDJ Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...LiquidThreads[master]: Remove unused jQuery.autogrow
Esanders has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355001 ) Change subject: Remove unused jQuery.autogrow .. Remove unused jQuery.autogrow Change-Id: Ib8b2fd4d1306eec40adefaaca2219fd6a2fe4f34 --- M Gruntfile.js M extension.json D jquery/jquery.autogrow.js M lqt.js 4 files changed, 2 insertions(+), 155 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads refs/changes/01/355001/1 diff --git a/Gruntfile.js b/Gruntfile.js index 4ff394e..bc5ff98 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -10,7 +10,6 @@ eslint: { all: [ '**/*.js', - '!jquery/jquery.autogrow.js', '!node_modules/**' ] }, diff --git a/extension.json b/extension.json index 981a857..93632cd 100644 --- a/extension.json +++ b/extension.json @@ -143,8 +143,7 @@ ], "scripts": [ "lqt.js", - "jquery/jquery.thread_collapse.js", - "jquery/jquery.autogrow.js" + "jquery/jquery.thread_collapse.js" ], "dependencies": [ "jquery.ui.dialog", diff --git a/jquery/jquery.autogrow.js b/jquery/jquery.autogrow.js deleted file mode 100644 index f4325fd..000 --- a/jquery/jquery.autogrow.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Auto Expanding Text Area (1.2.2) - * by Chrys Bader (www.chrysbader.com) - * chr...@gmail.com - * - * Special thanks to: - * Jake Chapa - j...@hybridstudio.com - * John Resig - jere...@gmail.com - * - * Copyright (c) 2008 Chrys Bader (www.chrysbader.com) - * Licensed under the GPL (GPL-LICENSE.txt) license. - * - * - * NOTE: This script requires jQuery to work. Download jQuery at www.jquery.com - * - */ - -(function(jQuery) { - - var self = null; - - jQuery.fn.autogrow = function(o) - { - return this.each(function() { - new jQuery.autogrow(this, o); - }); - }; - - - /** -* The autogrow object. -* -* @constructor -* @name jQuery.autogrow -* @param Object e The textarea to create the autogrow for. -* @param Hash o A set of key/value pairs to set as configuration properties. -* @cat Plugins/autogrow -*/ - - jQuery.autogrow = function (e, o) - { - this.options= o || {}; - this.dummy = null; - this.interval = null; - this.line_height= this.options.lineHeight || parseInt(jQuery(e).css('line-height')); - this.min_height = this.options.minHeight || parseInt(jQuery(e).css('min-height')); - this.max_height = this.options.maxHeight || parseInt(jQuery(e).css('max-height'));; - this.expand_callback= this.options.expandCallback; - this.textarea = jQuery(e); - - if(this.line_height == NaN) - this.line_height = 0; - - // Only one textarea activated at a time, the one being used - this.init(); - }; - - jQuery.autogrow.fn = jQuery.autogrow.prototype = { - autogrow: '1.2.2' - }; - - jQuery.autogrow.fn.extend = jQuery.autogrow.extend = jQuery.extend; - - jQuery.autogrow.fn.extend({ - - init: function() { - var self = this; - this.textarea.css({overflow: 'hidden', display: 'block'}); - this.textarea.bind('focus', function() { self.startExpand() } ).bind('blur', function() { self.stopExpand() }); - this.checkExpand(); - }, - - startExpand: function() { - var self = this; - this.interval = window.setInterval(function() {self.checkExpand()}, 400); - }, - - stopExpand: function() { - clearInterval(this.interval); - }, - - checkExpand: function() { - - if (this.dummy == null) - { - this.dummy = jQuery(''); - this.dummy.css({ - 'font-size' : this.textarea.css('font-size'), - 'font-family': this.textarea.css('font-family'), - 'width' : this.textarea.css('width'), - 'padding-top' :
[MediaWiki-commits] [Gerrit] operations...pybal[master]: bgp: add a few unit tests
Ema has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355000 ) Change subject: bgp: add a few unit tests .. bgp: add a few unit tests Add unit test for BGPUpdateMessage and the Origin and BaseASPath BGP attributes. Change-Id: I539e515623df800fd1985693dbf2a574b2eb3be7 --- A pybal/bgp/test_bgp.py 1 file changed, 47 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal refs/changes/00/355000/1 diff --git a/pybal/bgp/test_bgp.py b/pybal/bgp/test_bgp.py new file mode 100644 index 000..9db5ff6 --- /dev/null +++ b/pybal/bgp/test_bgp.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +""" + bgp.bgp unit tests + ~~ + + This module contains tests for `bgp.bgp`. + +""" + +import ip +import bgp + +import unittest + + +class AttributeTestCase(unittest.TestCase): + +def testOriginAttribute(self): +attr = bgp.OriginAttribute() +self.assertFalse(attr.optional) +self.assertTrue(attr.transitive) +self.assertEquals(attr.value, attr.ORIGIN_IGP) + +def testBaseASPathAttribute(self): +attr = bgp.BaseASPathAttribute() +self.assertEquals(attr.value, [(2, [])]) + +class BGPUpdateMessageTestCase(unittest.TestCase): + +def setUp(self): +self.msg = bgp.BGPUpdateMessage() +self.assertEquals(self.msg.msgLenOffset, 16) +self.assertEquals(len(self.msg.msg), 4) + +def testAddSomeWithdrawals(self): +self.assertEquals(self.msg.addSomeWithdrawals(set()), 0) + +prefixset = set([ip.IPv4IP('127.0.0.1'),]) +self.assertEquals(self.msg.addSomeWithdrawals(prefixset), 1) + +# The prefix should have been removed from the set +self.assertEquals(len(prefixset), 0) + +prefixset = set([ ip.IPv4IP(idx) for idx in range(1024) ]) +# Not all prefixes will fit within maxLen +self.assertEquals(self.msg.addSomeWithdrawals(prefixset), 813) +self.assertEquals(len(prefixset), 211) -- To view, visit https://gerrit.wikimedia.org/r/355000 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I539e515623df800fd1985693dbf2a574b2eb3be7 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/pybal Gerrit-Branch: master Gerrit-Owner: Ema___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...SecureSessions[master]: Better escaping
Seb35 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354999 ) Change subject: Better escaping .. Better escaping In French, the special page Session displays " Adresse IP: " because of a parser rule + HTML-escaping. This patch request a text version of three messages instead of a wikitext version. Change-Id: I852c1814d9ef84daf83c5f30dcf5fbea5ec74b06 --- M SpecialSessions.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecureSessions refs/changes/99/354999/1 diff --git a/SpecialSessions.php b/SpecialSessions.php index f797e62..7b85365 100644 --- a/SpecialSessions.php +++ b/SpecialSessions.php @@ -83,11 +83,11 @@ // Make a table describing the session. $description = Html::rawElement( 'table', array(), Html::rawElement( 'tr', array(), - Html::element( 'td', array( 'class' => 'mw-label' ), $this->msg( 'securesessions-sessions-ip' ) ) . + Html::element( 'td', array( 'class' => 'mw-label' ), $this->msg( 'securesessions-sessions-ip' )->escaped() ) . Html::element( 'td', array( 'class' => 'mw-input' ), $session['ip'] ) ) . Html::rawElement( 'tr', array(), - Html::element( 'td', array( 'class' => 'mw-label' ), $this->msg( 'securesessions-sessions-activity' ) ) . + Html::element( 'td', array( 'class' => 'mw-label' ), $this->msg( 'securesessions-sessions-activity' )->escaped() ) . Html::element( 'td', array( 'class' => 'mw-input' ), $timestamp->getHumanTimestamp() ) ) ); @@ -119,7 +119,7 @@ $form = new HTMLForm( $this->fields, $this->getContext() ); $form->setSubmitCallback( array( $this, 'onSubmit' ) ); - $form->setWrapperLegend( $this->msg( 'securesessions-sessions-legend' ) ); + $form->setWrapperLegend( $this->msg( 'securesessions-sessions-legend' )->text() ); $form->addHeaderText( $this->msg( 'securesessions-sessions-text' )->parseAsBlock() ); -- To view, visit https://gerrit.wikimedia.org/r/354999 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I852c1814d9ef84daf83c5f30dcf5fbea5ec74b06 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecureSessions Gerrit-Branch: master Gerrit-Owner: Seb35___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: In Autopromote skip edit count lookup if requirement is 0 or...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/337807 ) Change subject: In Autopromote skip edit count lookup if requirement is 0 or invalid .. In Autopromote skip edit count lookup if requirement is 0 or invalid Autopromote makes a DB call to fetch user edit count when checking edit count requirements. We can skip this call if requirement is set to 0 or invalid (less than 0). Bug: T157718 Change-Id: I7bcfa6e7e4991fe7b48bef84ad24621564261abc --- M includes/Autopromote.php A tests/phpunit/includes/AutopromoteTest.php 2 files changed, 60 insertions(+), 1 deletion(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Autopromote.php b/includes/Autopromote.php index 56fbb07..a01465e 100644 --- a/includes/Autopromote.php +++ b/includes/Autopromote.php @@ -177,7 +177,13 @@ } return false; case APCOND_EDITCOUNT: - return $user->getEditCount() >= $cond[1]; + $reqEditCount = $cond[1]; + + // T157718: Avoid edit count lookup if specified edit count is 0 or invalid + if ( $reqEditCount <= 0 ) { + return true; + } + return $user->getEditCount() >= $reqEditCount; case APCOND_AGE: $age = time() - wfTimestampOrNull( TS_UNIX, $user->getRegistration() ); return $age >= $cond[1]; diff --git a/tests/phpunit/includes/AutopromoteTest.php b/tests/phpunit/includes/AutopromoteTest.php new file mode 100644 index 000..785aa4e --- /dev/null +++ b/tests/phpunit/includes/AutopromoteTest.php @@ -0,0 +1,53 @@ +setMwGlobals( [ + 'wgAutopromote' => [ + 'autoconfirmed' => [ APCOND_EDITCOUNT, $requirement ] + ] + ] ); + + /** @var PHPUnit_Framework_MockObject_MockObject|User $userMock */ + $userMock = $this->getMock( 'User', [ 'getEditCount' ] ); + if ( $requirement > 0 ) { + $userMock->expects( $this->once() ) + ->method( 'getEditCount' ) + ->willReturn( $editCount ); + } else { + $userMock->expects( $this->never() ) + ->method( 'getEditCount' ); + } + + $result = Autopromote::getAutopromoteGroups( $userMock ); + if ( $editCount >= $requirement ) { + $this->assertContains( + 'autoconfirmed', + $result, + 'User must be promoted if they meet edit count requirement' + ); + } else { + $this->assertNotContains( + 'autoconfirmed', + $result, + 'User must not be promoted if they fail edit count requirement' + ); + } + } + + public static function provideEditCountsAndRequirements() { + return [ + 'user with sufficient editcount' => [ 100, 10 ], + 'user with insufficient editcount' => [ 4, 10 ], + 'edit count requirement set to 0' => [ 1, 0 ], + ]; + } +} -- To view, visit https://gerrit.wikimedia.org/r/337807 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7bcfa6e7e4991fe7b48bef84ad24621564261abc Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TK-999Gerrit-Reviewer: CSteipp Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Parent5446 Gerrit-Reviewer: Reedy Gerrit-Reviewer: TK-999 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]: Update CREDITS
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354992 ) Change subject: Update CREDITS .. Update CREDITS Also update mailmap to avoid duplicates. Change-Id: Ic305027c47a96d6d7ea8892823c4ceb687f17e13 --- M .mailmap M CREDITS 2 files changed, 6 insertions(+), 1 deletion(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/.mailmap b/.mailmap index ae18878..e649fb1 100644 --- a/.mailmap +++ b/.mailmap @@ -412,6 +412,7 @@ Sumit AsthanaTerraCodes Thalia Chan +Thalia Chan Thiemo Mättig Thiemo Mättig This, that and the other diff --git a/CREDITS b/CREDITS index 1530425..14c454e 100644 --- a/CREDITS +++ b/CREDITS @@ -16,6 +16,7 @@ * Aashaka Shah * abhinand * Abhishek Das +* Ad Huikeshoven * Adam Miller * Adam Roses Wight * addshore @@ -358,6 +359,7 @@ * Ltrlg * Luc Van Oostenryck * Lucas Garczewski +* Lucas Werkmeister * Luigi Corsaro * Luis Felipe Schenone * Luke Faraone @@ -434,6 +436,7 @@ * Mohamed Magdy * Molly White * Moriel Schottlender +* Moritz Oberhauser * Mormegil * Mr. E23 * MrBlueSky @@ -618,10 +621,11 @@ * T.D. Corell * Tarquin * TerraCodes +* Thalia Chan * The Discoverer * The Evil IP address * theopolisme -* Thiemo Mättig (WMDE) +* Thiemo Mättig * This, that and the other * tholam * Thomas Arrow -- To view, visit https://gerrit.wikimedia.org/r/354992 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic305027c47a96d6d7ea8892823c4ceb687f17e13 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle Gerrit-Reviewer: BryanDavis Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Put print click handler on link, not on list item
Brion VIBBER has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354998 ) Change subject: Put print click handler on link, not on list item .. Put print click handler on link, not on list item Was responding to clicks outside the link, which was confusing. Bug: T24256 Change-Id: I22f7cf20a08bb4204b0442defeb7cfb83899b969 --- M resources/src/mediawiki/page/ready.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/98/354998/1 diff --git a/resources/src/mediawiki/page/ready.js b/resources/src/mediawiki/page/ready.js index 758e20a..1f6c8a6 100644 --- a/resources/src/mediawiki/page/ready.js +++ b/resources/src/mediawiki/page/ready.js @@ -59,7 +59,7 @@ mw.hook( 'wikipage.categories' ).fire( $nodes ); } - $( '#t-print' ).click( function ( e ) { + $( '#t-print a' ).click( function ( e ) { window.print(); e.preventDefault(); } ); -- To view, visit https://gerrit.wikimedia.org/r/354998 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22f7cf20a08bb4204b0442defeb7cfb83899b969 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Brion VIBBER___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/quibble[master]: HUGE WIP
Hashar has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354997 ) Change subject: HUGE WIP .. HUGE WIP Change-Id: I6a5757abde25da0d9af172b773090f72c65db26e --- A .dockerignore M .gitignore M Dockerfile M README.md M quibble/cmd.py 5 files changed, 66 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/quibble refs/changes/97/354997/1 diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000..9cae93a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +/cache/* +/.tox/* diff --git a/.gitignore b/.gitignore index bfbeb7a..16241c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /.coverage /quibble.egg-info/ +/cache/ /cover/ /.tox *.pyc diff --git a/Dockerfile b/Dockerfile index 85ee5bc..2f2c645 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,11 +12,12 @@ git clone --bare "https://gerrit.wikimedia.org/r/p/mediawiki/vendor; "/srv/git/mediawiki/vendor.git" && \ git clone "https://gerrit.wikimedia.org/r/p/integration/jenkins; "/srv/deployment/integration/slave-scripts" -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server php5 php5-mysql php5-gd php5-curl djvulibre-bin nodejs-legacy && \ -/usr/sbin/service mysql start +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server php5 php5-mysql php5-gd php5-curl djvulibre-bin nodejs-legacy RUN git clone "https://gerrit.wikimedia.org/r/p/integration/composer; "/srv/deployment/integration/composer" && \ - ln -s "/srv/deployment/integration/composer/vendor/bin/composer" "/usr/local/bin/composer" + ln -s "/srv/deployment/integration/composer/vendor/bin/composer" "/usr/local/bin/composer" && \ +composer global config cache-dir /cache/composer +ENV COMPOSER_CACHE_DIR /cache/composer # Some of Zuul dependencies. Would be better done by install the zuul.deb package from apt.wikimedia.org RUN apt-get install -y \ @@ -33,6 +34,10 @@ python3-docutils \ python3-babel +RUN apt-get install -y npm && npm install -g npm@2.15.2 && npm config set cache /cache/npm + +RUN apt-get install -y chromium chromedriver xvfb + COPY . /opt/quibble RUN cd /opt/quibble && \ diff --git a/README.md b/README.md index ba7b9e2..9a11301 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,12 @@ Then run the quibble command: - service mysql start ZUUL_URL=https://gerrit.wikimedia.org/r/p ZUUL_BRANCH=master ZUUL_REF=master quibble --packages-source vendor --workspace /workspace +composer and npm cache configuration point at /cache. At your option, you can run docker and bindmount a cache directory that will be reused between runs: + + docker -v `pwd`/cache:/cache ... + TESTING --- diff --git a/quibble/cmd.py b/quibble/cmd.py index 02c5478..f335f2c 100644 --- a/quibble/cmd.py +++ b/quibble/cmd.py @@ -80,6 +80,24 @@ projects_to_clone = self.get_repos_to_clone(clone_vendor) self.clonerepos(projects_to_clone) +def prepare_webhost(self): +# MW_SERVER=http://localhost +# SCRIPT_PATH=/mw +subprocess.check_call( +['ln', '-s', '/workspace/src', '/var/www/html/mw']) +conf = "\n".join([ +"http://localhost';", +"$wgScriptPath = '/mw';", +"$wgScript = $wgStylePath = $wgLogo = false;", +"$wgResourceBasePath = null;", +"$wgEnableJavaScriptTest = true;", +"?>" +]) +localSettings = os.path.join(self.mw_install_path, 'LocalSettings.php') +with open(localSettings, 'a') as f: +f.write(conf) + def clonerepos(self, repos): cloner = zuul.lib.cloner.Cloner( git_base_url='https://gerrit.wikimedia.org/r/p', @@ -124,11 +142,36 @@ raise Exception('Script %s failed with exit code: %s' % ( script, proc.returncode)) +def service_start(self, service_name): +self.log.debug('Starting service: %s' % service_name) +subprocess.check_call(['service', service_name, 'start']) + +def service_xvfb(self): +self.log.debug('Starting xvfb') +xvfb_proc = subprocess.Popen( +['/usr/bin/Xvfb', ':94', '-screen', '0', '800x600x16', '-ac', '-noreset']) +self.log.info('Started xvfb with PID %s' % xvfb_proc.pid) + def mw_install(self): self.run_script('global-setup.sh') self.run_script('mw-install-mysql.sh') self.run_script('mw-apply-settings.sh') self.run_script('mw-run-update-script.sh') + +def qunit_karma(self): +self.log.debug('grunt karma:main') +subprocess.check_call( +['npm', 'install'], cwd=self.mw_install_path) +subprocess.check_call( +['./node_modules/.bin/grunt', 'karma:main'], +cwd=self.mw_install_path, +env={ +'CHROME_BIN': '/usr/bin/chromium',
[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[master]: Remove RejectParserCacheValue hook for old GeSHi parser cache
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/353598 ) Change subject: Remove RejectParserCacheValue hook for old GeSHi parser cache .. Remove RejectParserCacheValue hook for old GeSHi parser cache SyntaxHighlight migrated to Pygments nearly 2 years ago, and was included in the 1.26 release. By now everyone should have cleared their parser caches, so this hook isn't useful. Change-Id: Ia267a648ce9188232dd55c6ed3bb2c2fa65223a9 --- M SyntaxHighlight.class.php M extension.json 2 files changed, 0 insertions(+), 24 deletions(-) Approvals: jenkins-bot: Verified TheDJ: Looks good to me, approved diff --git a/SyntaxHighlight.class.php b/SyntaxHighlight.class.php index bacfd54..c7d9200 100644 --- a/SyntaxHighlight.class.php +++ b/SyntaxHighlight.class.php @@ -483,27 +483,6 @@ } /** -* Reject parser cache values that are for GeSHi since those -* ResourceLoader modules no longer exist -* -* @param ParserOutput $parserOutput -* @param WikiPage|Article $page -* @param ParserOptions $popts -* @return bool -*/ - public static function onRejectParserCacheValue( - ParserOutput $parserOutput, $page, ParserOptions $popts - ) { - foreach ( $parserOutput->getModuleStyles() as $module ) { - if ( strpos( $module, 'ext.geshi.' ) === 0 ) { - $page->getTitle()->purgeSquid(); - return false; - } - } - return true; - } - - /** * Conditionally register resource loader modules that depends on the * VisualEditor MediaWiki extension. * diff --git a/extension.json b/extension.json index b10a92f..c32c6cc 100644 --- a/extension.json +++ b/extension.json @@ -60,9 +60,6 @@ "ApiFormatHighlight": [ "SyntaxHighlight::onApiFormatHighlight" ], - "RejectParserCacheValue": [ - "SyntaxHighlight::onRejectParserCacheValue" - ], "ResourceLoaderRegisterModules": [ "SyntaxHighlight::onResourceLoaderRegisterModules" ] -- To view, visit https://gerrit.wikimedia.org/r/353598 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia267a648ce9188232dd55c6ed3bb2c2fa65223a9 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: TheDJ Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Follow-up 7e72163ea: Fix CBN alien unit test I missed and fo...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354994 ) Change subject: Follow-up 7e72163ea: Fix CBN alien unit test I missed and force-merged .. Follow-up 7e72163ea: Fix CBN alien unit test I missed and force-merged Whoops. Change-Id: I21e30efd930458f6c1509e2f3d947f94d5ec5ad2 --- M modules/ve-mw/tests/ce/ve.ce.ContentBranchNode.test.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Bartosz Dziewoński: Looks good to me, approved DLynch: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/tests/ce/ve.ce.ContentBranchNode.test.js b/modules/ve-mw/tests/ce/ve.ce.ContentBranchNode.test.js index 4148256..c02dcbc 100644 --- a/modules/ve-mw/tests/ce/ve.ce.ContentBranchNode.test.js +++ b/modules/ve-mw/tests/ce/ve.ce.ContentBranchNode.test.js @@ -36,7 +36,7 @@ html: 'ab' + 'c' + - 'de' + + 'de' + '' } ]; -- To view, visit https://gerrit.wikimedia.org/r/354994 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I21e30efd930458f6c1509e2f3d947f94d5ec5ad2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: JforresterGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: DLynch Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: Only strip on one side and fix whitespace in the demo config
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354987 ) Change subject: Only strip on one side and fix whitespace in the demo config .. Only strip on one side and fix whitespace in the demo config Change-Id: I9575af3bae30356e2527f041e4ced4126656c9b0 --- M erfgoedbot/fill_table_monuments_all.py M erfgoedbot/monuments_config/nl-wd_nl.json 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Jean-Frédéric: Looks good to me, approved jenkins-bot: Verified diff --git a/erfgoedbot/fill_table_monuments_all.py b/erfgoedbot/fill_table_monuments_all.py index 2b6c84e..a4ac15a 100644 --- a/erfgoedbot/fill_table_monuments_all.py +++ b/erfgoedbot/fill_table_monuments_all.py @@ -267,7 +267,7 @@ MonumentWikidataDatasetSql.get_template_dir(), filename) with open(filepath, 'r') as f: sql = f.read() -return sql.strip() +return sql.rstrip() class VariableType(object): diff --git a/erfgoedbot/monuments_config/nl-wd_nl.json b/erfgoedbot/monuments_config/nl-wd_nl.json index aefdc6b..8678b14 100644 --- a/erfgoedbot/monuments_config/nl-wd_nl.json +++ b/erfgoedbot/monuments_config/nl-wd_nl.json @@ -11,8 +11,8 @@ "unusedImagesPage": "Wikipedia:Wikiproject/Erfgoed/Nederlandse Erfgoed Inventarisatie/Ongebruikte foto's", "imagesWithoutIdPage": "Wikipedia:Wikiproject/Erfgoed/Nederlandse Erfgoed Inventarisatie/Foto's zonder id", "missingCommonscatPage": "Wikipedia:Wikiproject/Erfgoed/Nederlandse Erfgoed Inventarisatie/Missende commonscat links", -"sparql" : "{ ?item wdt:P359 [] } UNION { ?item wdt:P1435 wd:Q916333 } UNION { ?item wdt:P1435 wd:Q13423591 } UNION { ?item wdt:P1435 wd:Q17698911 }", -"sql_lang": "Dutch", +"sparql": "{ ?item wdt:P359 [] } UNION { ?item wdt:P1435 wd:Q916333 } UNION { ?item wdt:P1435 wd:Q13423591 } UNION { ?item wdt:P1435 wd:Q17698911 }", +"sql_lang": "Dutch # Wikidata", "sql_country": "Netherlands", "sql_data": { "dataset": { -- To view, visit https://gerrit.wikimedia.org/r/354987 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9575af3bae30356e2527f041e4ced4126656c9b0 Gerrit-PatchSet: 2 Gerrit-Project: labs/tools/heritage Gerrit-Branch: wikidata Gerrit-Owner: Lokal ProfilGerrit-Reviewer: Jean-Frédéric 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...Cite[master]: Revert "Update ve.ui.MWWikitextStringTransferHandler.test re...
Jforrester has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354990 ) Change subject: Revert "Update ve.ui.MWWikitextStringTransferHandler.test results for wrapping" .. Revert "Update ve.ui.MWWikitextStringTransferHandler.test results for wrapping" This reverts commit ca45349b840fc81d3652de397066aef333413f76. Change-Id: If4ca5fdb57fbddd0eb89aa8adf4c47a0c005e023 --- M modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Jforrester: Verified; Looks good to me, approved diff --git a/modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js b/modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js index 4479eae..9072a8e 100644 --- a/modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js +++ b/modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js @@ -31,7 +31,6 @@ '', annotations: [], expectedData: [ - { type: 'paragraph' }, { type: 'mwReference', attributes: { @@ -52,7 +51,6 @@ } }, { type: '/mwReference' }, - { type: '/paragraph' }, { type: 'internalList' }, { type: 'internalItem' }, { type: 'paragraph', internal: { generated: 'wrapper' } }, -- To view, visit https://gerrit.wikimedia.org/r/354990 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If4ca5fdb57fbddd0eb89aa8adf4c47a0c005e023 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Cite Gerrit-Branch: master Gerrit-Owner: JforresterGerrit-Reviewer: Esanders Gerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Follow-up 7e72163ea: Fix CBN alien unit test I missed and fo...
Jforrester has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354994 ) Change subject: Follow-up 7e72163ea: Fix CBN alien unit test I missed and force-merged .. Follow-up 7e72163ea: Fix CBN alien unit test I missed and force-merged Whoops. Change-Id: I21e30efd930458f6c1509e2f3d947f94d5ec5ad2 --- M modules/ve-mw/tests/ce/ve.ce.ContentBranchNode.test.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/94/354994/1 diff --git a/modules/ve-mw/tests/ce/ve.ce.ContentBranchNode.test.js b/modules/ve-mw/tests/ce/ve.ce.ContentBranchNode.test.js index 4148256..c02dcbc 100644 --- a/modules/ve-mw/tests/ce/ve.ce.ContentBranchNode.test.js +++ b/modules/ve-mw/tests/ce/ve.ce.ContentBranchNode.test.js @@ -36,7 +36,7 @@ html: 'ab' + 'c' + - 'de' + + 'de' + '' } ]; -- To view, visit https://gerrit.wikimedia.org/r/354994 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I21e30efd930458f6c1509e2f3d947f94d5ec5ad2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Jforrester___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Avoid PHP notices about unset indexes in ApiPageTriageList
Kaldari has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354993 ) Change subject: Avoid PHP notices about unset indexes in ApiPageTriageList .. Avoid PHP notices about unset indexes in ApiPageTriageList This fixes problems introduced in Icfd6aea. Also improve comments about excluding redirects and deleted pages so it is less confusing. Change-Id: I40772e546c637f6855bfe53933c16811cff8ad85 --- M api/ApiPageTriageList.php 1 file changed, 12 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage refs/changes/93/354993/1 diff --git a/api/ApiPageTriageList.php b/api/ApiPageTriageList.php index 160b35d..37da518 100644 --- a/api/ApiPageTriageList.php +++ b/api/ApiPageTriageList.php @@ -131,25 +131,29 @@ // 2 = patrolled // 3 = autopatrolled $reviewOpr = ''; - if ( $opts['showreviewed'] ) { + if ( isset( $opts['showreviewed'] ) && $opts['showreviewed'] ) { $reviewOpr .= '>'; } - if ( $opts['showunreviewed'] ) { + if ( isset( $opts['showunreviewed'] ) && $opts['showunreviewed'] ) { $reviewOpr .= '='; } if ( !$reviewOpr ) { - return $pages; + if ( $count ) { + return 0; + } else { + return $pages; + } } if ( $reviewOpr !== '>=' ) { $conds[] = 'ptrp_reviewed ' . $reviewOpr . ' 0'; } - // Include redirect - if ( !$opts['showredirs'] ) { + // Exclude redirects unless they are explicitly requested + if ( !isset( $opts['showredirs'] ) || !$opts['showredirs'] ) { $conds['page_is_redirect'] = 0; } - // Include marked for deletion - if ( !$opts['showdeleted'] ) { + // Exclude pages marked for deletion unless they are explicitly requested + if ( !isset( $opts['showdeleted'] ) || !$opts['showdeleted'] ) { $conds['ptrp_deleted'] = 0; } @@ -247,7 +251,7 @@ // only single tag search is allowed foreach ( $searchableTags as $key => $val ) { - if ( $opts[$key] ) { + if ( isset( $opts[$key] ) && $opts[$key] ) { if ( $val['val'] === false ) { // if val is false, use the value that was supplied via the api call $tagConds = " ptrpt_page_id = ptrp_page_id AND ptrpt_tag_id = '" -- To view, visit https://gerrit.wikimedia.org/r/354993 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I40772e546c637f6855bfe53933c16811cff8ad85 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageTriage Gerrit-Branch: master Gerrit-Owner: Kaldari___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Update CREDITS
Krinkle has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354992 ) Change subject: Update CREDITS .. Update CREDITS Also update mailmap to avoid duplicates. Change-Id: Ic305027c47a96d6d7ea8892823c4ceb687f17e13 --- M .mailmap M CREDITS 2 files changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/92/354992/1 diff --git a/.mailmap b/.mailmap index ae18878..e649fb1 100644 --- a/.mailmap +++ b/.mailmap @@ -412,6 +412,7 @@ Sumit AsthanaTerraCodes Thalia Chan +Thalia Chan Thiemo Mättig Thiemo Mättig This, that and the other diff --git a/CREDITS b/CREDITS index 1530425..14c454e 100644 --- a/CREDITS +++ b/CREDITS @@ -16,6 +16,7 @@ * Aashaka Shah * abhinand * Abhishek Das +* Ad Huikeshoven * Adam Miller * Adam Roses Wight * addshore @@ -358,6 +359,7 @@ * Ltrlg * Luc Van Oostenryck * Lucas Garczewski +* Lucas Werkmeister * Luigi Corsaro * Luis Felipe Schenone * Luke Faraone @@ -434,6 +436,7 @@ * Mohamed Magdy * Molly White * Moriel Schottlender +* Moritz Oberhauser * Mormegil * Mr. E23 * MrBlueSky @@ -618,10 +621,11 @@ * T.D. Corell * Tarquin * TerraCodes +* Thalia Chan * The Discoverer * The Evil IP address * theopolisme -* Thiemo Mättig (WMDE) +* Thiemo Mättig * This, that and the other * tholam * Thomas Arrow -- To view, visit https://gerrit.wikimedia.org/r/354992 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic305027c47a96d6d7ea8892823c4ceb687f17e13 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikimediaBadges[master]: Use eslint to lint JavaScript instead of jshint
WMDE-leszek has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354991 ) Change subject: Use eslint to lint JavaScript instead of jshint .. Use eslint to lint JavaScript instead of jshint Bug: T165843 Change-Id: Ief9fdbfb38379c79c3b01dc960040c15d3d16588 --- A .eslintignore A .eslintrc.json M Gruntfile.js M package.json 4 files changed, 20 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaBadges refs/changes/91/354991/1 diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000..82eaa05 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +node_modules/** +vendor/** diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000..9fad52a --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,7 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + } +} diff --git a/Gruntfile.js b/Gruntfile.js index 2a477c4..15d38dc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,20 +1,18 @@ +/* eslint-env node */ + module.exports = function ( grunt ) { grunt.loadNpmTasks( 'grunt-jsonlint' ); - grunt.loadNpmTasks( 'grunt-contrib-jshint' ); + grunt.loadNpmTasks( 'grunt-eslint' ); grunt.loadNpmTasks( 'grunt-banana-checker' ); grunt.loadNpmTasks( 'grunt-stylelint' ); grunt.initConfig( { banana: { all: [ - 'i18n/', + 'i18n/' ] }, - jshint: { - all: [ - '**/*.js', - '!node_modules/**', - '!vendor/**' - ] + eslint: { + all: '.' }, jsonlint: { all: [ @@ -32,7 +30,7 @@ ] } } ); - grunt.registerTask( 'lint', ['jsonlint', 'banana', 'jshint', 'stylelint'] ); - grunt.registerTask( 'test', ['lint'] ); - grunt.registerTask( 'default', ['test'] ); + grunt.registerTask( 'lint', [ 'jsonlint', 'banana', 'eslint', 'stylelint' ] ); + grunt.registerTask( 'test', [ 'lint' ] ); + grunt.registerTask( 'default', [ 'test' ] ); }; diff --git a/package.json b/package.json index f806475..8feb7c8 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "devDependencies": { + "eslint-config-wikimedia": "0.4.0", "grunt": "1.0.1", "grunt-banana-checker": "0.5.0", - "grunt-contrib-jshint": "1.1.0", + "grunt-eslint": "19.0.0", "grunt-jsonlint": "1.1.0", "grunt-stylelint": "0.6.0", "stylelint-config-wikimedia": "0.4.1" -- To view, visit https://gerrit.wikimedia.org/r/354991 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief9fdbfb38379c79c3b01dc960040c15d3d16588 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaBadges 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...VisualEditor[master]: Update VE core submodule to master (c00d2fa38)
Jforrester has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354984 ) Change subject: Update VE core submodule to master (c00d2fa38) .. Update VE core submodule to master (c00d2fa38) New changes: 95ba60c60 RebaseServer: When rejecting, publish the top of the history instead of the top of the rejected change bb71b76d8 ce.BranchNode: Handle splices next to text nodes d1300c6e6 ve.Node#attach: set document before root, rather than after df6113771 summarizeTransaction: hide null author b6f45436d rebaser: Prevent submissions before initialization ac71b0ea6 Add ve.ce.View#initialize to eliminate constructor/onSetup duplication 45cd82bd7 Render HTML attributes in ce.View#initialize rather than in the constructor Change-Id: I4d61f40247fdab60bdc2e1b23f30ffee4c8ab8dc --- M lib/ve 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: DLynch: Looks good to me, approved Jforrester: Verified diff --git a/lib/ve b/lib/ve index 69d8607..c00d2fa 16 --- a/lib/ve +++ b/lib/ve @@ -1 +1 @@ -Subproject commit 69d8607cf0b893bb3fc9cb76c4784f21b6932d80 +Subproject commit c00d2fa38581eaa7b2c9c20bb763214b1d921348 -- To view, visit https://gerrit.wikimedia.org/r/354984 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4d61f40247fdab60bdc2e1b23f30ffee4c8ab8dc Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: JforresterGerrit-Reviewer: DLynch Gerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Cite[master]: Revert "Update ve.ui.MWWikitextStringTransferHandler.test re...
Hello Esanders, jenkins-bot, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/354990 to review the following change. Change subject: Revert "Update ve.ui.MWWikitextStringTransferHandler.test results for wrapping" .. Revert "Update ve.ui.MWWikitextStringTransferHandler.test results for wrapping" This reverts commit ca45349b840fc81d3652de397066aef333413f76. Change-Id: If4ca5fdb57fbddd0eb89aa8adf4c47a0c005e023 --- M modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cite refs/changes/90/354990/1 diff --git a/modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js b/modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js index 4479eae..9072a8e 100644 --- a/modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js +++ b/modules/ve-cite/tests/ve.ui.MWWikitextStringTransferHandler.test.js @@ -31,7 +31,6 @@ '', annotations: [], expectedData: [ - { type: 'paragraph' }, { type: 'mwReference', attributes: { @@ -52,7 +51,6 @@ } }, { type: '/mwReference' }, - { type: '/paragraph' }, { type: 'internalList' }, { type: 'internalItem' }, { type: 'paragraph', internal: { generated: 'wrapper' } }, -- To view, visit https://gerrit.wikimedia.org/r/354990 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If4ca5fdb57fbddd0eb89aa8adf4c47a0c005e023 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Cite Gerrit-Branch: master Gerrit-Owner: JforresterGerrit-Reviewer: Esanders Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikidata.org[master]: Use eslint to lint JavaScript instead of jscs and jshint
WMDE-leszek has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354989 ) Change subject: Use eslint to lint JavaScript instead of jscs and jshint .. Use eslint to lint JavaScript instead of jscs and jshint Bug: T165843 Change-Id: I970144fd4af2524485d1e686ce45c22d23860ff8 --- R .eslintignore A .eslintrc.json D .jscsrc D .jshintrc M Gruntfile.js M package.json 6 files changed, 15 insertions(+), 40 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata.org refs/changes/89/354989/1 diff --git a/.jshintignore b/.eslintignore similarity index 100% rename from .jshintignore rename to .eslintignore diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000..9fad52a --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,7 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + } +} diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 04baa68..000 --- a/.jscsrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "preset": "wikimedia", - "excludeFiles": [ "node_modules/**", "vendor/**" ] -} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index d43c482..000 --- a/.jshintrc +++ /dev/null @@ -1,20 +0,0 @@ -{ - // Enforcing - "bitwise": true, - "eqeqeq": true, - "es3": true, - "latedef": true, - "noarg": true, - "nonew": true, - "undef": true, - "unused": true, - "strict": false, - - // Environment - "browser": true, - - "globals": { - "mw": false, - "$": false - } -} diff --git a/Gruntfile.js b/Gruntfile.js index a104080..8894c36 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,23 +1,15 @@ -/*jshint node:true */ +/* eslint-env node */ + 'use strict'; module.exports = function ( grunt ) { - grunt.loadNpmTasks( 'grunt-contrib-jshint' ); + grunt.loadNpmTasks( 'grunt-eslint' ); grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.loadNpmTasks( 'grunt-banana-checker' ); - grunt.loadNpmTasks( 'grunt-jscs' ); grunt.loadNpmTasks( 'grunt-stylelint' ); grunt.initConfig( { - jshint: { - options: { - jshintrc: true - }, - all: [ - '**/*.js' - ] - }, - jscs: { - src: '<%= jshint.all %>' + eslint: { + all: '.' }, banana: { all: 'i18n/' @@ -39,6 +31,6 @@ } } ); - grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana', 'stylelint' ] ); + grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'stylelint' ] ); grunt.registerTask( 'default', 'test' ); }; diff --git a/package.json b/package.json index 07a0ec4..02ca4e3 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "test": "grunt test" }, "devDependencies": { +"eslint-config-wikimedia": "0.4.0", "grunt": "1.0.1", -"grunt-contrib-jshint": "0.11.3", "grunt-banana-checker": "0.4.0", -"grunt-jscs": "2.5.0", +"grunt-eslint": "19.0.0", "grunt-jsonlint": "1.0.7", "grunt-stylelint": "0.6.0", "stylelint-config-wikimedia": "0.4.1" -- To view, visit https://gerrit.wikimedia.org/r/354989 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I970144fd4af2524485d1e686ce45c22d23860ff8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikidata.org 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/vagrant[master]: [WIP] Horizon role
BryanDavis has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354988 ) Change subject: [WIP] Horizon role .. [WIP] Horizon role Bare bones role to provision Horizon (OpenStack Dashboard). Bug: T166006 Change-Id: Id353154c70cca5825f24636940668423267a1753 --- M puppet/hieradata/common.yaml A puppet/modules/role/manifests/horizon.pp A puppet/modules/role/templates/horizon/apache.conf.erb 3 files changed, 140 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/88/354988/1 diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml index 4adc168..7ee2d26 100644 --- a/puppet/hieradata/common.yaml +++ b/puppet/hieradata/common.yaml @@ -343,6 +343,9 @@ role::globalblocking::db_pass: "%{hiera('mediawiki::multiwiki::db_pass')}" role::globalblocking::db_name: globalblocking +role::horizon::vhost_name: "horizon%{hiera('mwv::tld')}" +role::horizon::log_dir: /vagrant/logs + role::keystone::admin_password: vagrant role::keystone::db_password: vagrant diff --git a/puppet/modules/role/manifests/horizon.pp b/puppet/modules/role/manifests/horizon.pp new file mode 100644 index 000..1603bbc --- /dev/null +++ b/puppet/modules/role/manifests/horizon.pp @@ -0,0 +1,115 @@ +# == Class: role::horizon +# +# Provision an OpenStack horizon service. +# +# [*log_dir*] +# Directory to write log files to. Directory must already exist. +# A 'horizon' subdirectory will be created. +# +# [*vhost_name*] +# Apache vhost name. (example: 'striker.local.wmftest.net') +class role::horizon ( +$log_dir, +$vhost_name, +) { +include ::role::keystone +include ::apache +include ::apache::mod::wsgi_py3 + +$deploy_dir = '/usr/share/openstack-dashboard/openstack_dashboard' + +$packages = [ + 'fonts-font-awesome', + 'fonts-materialdesignicons-webfont', + 'fonts-roboto-fontface', + 'libjs-angular-gettext', + 'libjs-angularjs', + 'libjs-angularjs-smart-table', + 'libjs-bootswatch', + 'libjs-d3', + 'libjs-jquery-cookie', + 'libjs-jquery-metadata', + 'libjs-jquery-tablesorter', + 'libjs-jquery-ui', + 'libjs-jquery.quicksearch', + 'libjs-jsencrypt', + 'libjs-lrdragndrop', + 'libjs-magic-search', + 'libjs-rickshaw', + 'libjs-spin.js', + 'libjs-term.js', + 'libjs-twitter-bootstrap', + 'libjs-twitter-bootstrap-datepicker', + 'openstack-dashboard', + 'python-ceilometerclient', + 'python-compressor', + 'python-csscompressor', + 'python-designate-dashboard', + 'python-django', + 'python-django-appconf', + 'python-django-babel', + 'python-django-common', + 'python-django-compressor', + 'python-django-horizon', + 'python-django-openstack-auth', + 'python-django-overextends', + 'python-django-pyscss', + 'python-heatclient', + 'python-keystoneclient', + 'python-openstack-auth', + 'python-pint', + 'python-pyscss', + 'python-rcssmin', + 'python-rjsmin', + 'python-xstatic', + 'python-xstatic-angular', + 'python-xstatic-angular-bootstrap', + 'python-xstatic-angular-gettext', + 'python-xstatic-angular-lrdragndrop', + 'python-xstatic-bootstrap-datepicker', + 'python-xstatic-bootstrap-scss', + 'python-xstatic-bootswatch', + 'python-xstatic-d3', + 'python-xstatic-font-awesome', + 'python-xstatic-hogan', + 'python-xstatic-jasmine', + 'python-xstatic-jquery', + 'python-xstatic-jquery-migrate', + 'python-xstatic-jquery-ui', + 'python-xstatic-jquery.quicksearch', + 'python-xstatic-jquery.tablesorter', + 'python-xstatic-jsencrypt', + 'python-xstatic-magic-search', + 'python-xstatic-mdi', + 'python-xstatic-rickshaw', + 'python-xstatic-roboto-fontface', + 'python-xstatic-smart-table', + 'python-xstatic-spin', + 'python-xstatic-term.js', +] + +apt::pin { 'horizon': +package => join(sort($packages), ' '), +pin => 'release a=jessie-backports', +priority => '1001', +} + +package { $packages: +ensure => 'present', +require => Apt::Pin['horizon'], +} + +file { "${log_dir}/horizon": +ensure => 'directory', +mode => '0777', +} + +apache::site { $vhost_name: +ensure => present, +# Load before MediaWiki wildcard vhost for Labs. +priority => 40, +content => template('role/horizon/apache.conf.erb'), +require => Class['apache::mod::wsgi_py3'], +notify => Service['apache2'], +} +} diff --git a/puppet/modules/role/templates/horizon/apache.conf.erb b/puppet/modules/role/templates/horizon/apache.conf.erb new file mode 100644 index 000..7ee1013 --- /dev/null +++
[MediaWiki-commits] [Gerrit] mediawiki...PageTriage[master]: Bringing back the top reviewers stats
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354740 ) Change subject: Bringing back the top reviewers stats .. Bringing back the top reviewers stats To use, pass topreviewers=timerange to the action=pagetriagestats API Possible values: last-day, last-week or last-month This data is not exposed in the Page Curation interface Bug: T165910 Change-Id: I58dc596c22c12d0ebd48fe619549bb8b9bfc0a0d --- M api/ApiPageTriageStats.php M i18n/en.json M i18n/qqq.json M includes/PageTriageUtil.php 4 files changed, 19 insertions(+), 3 deletions(-) Approvals: jenkins-bot: Verified Kaldari: Looks good to me, approved diff --git a/api/ApiPageTriageStats.php b/api/ApiPageTriageStats.php index 19d54c1..759e7e8 100644 --- a/api/ApiPageTriageStats.php +++ b/api/ApiPageTriageStats.php @@ -16,6 +16,10 @@ 'filteredarticle' => PageTriageUtil::getArticleFilterStat( $params ), ]; + if ( isset( $params['topreviewers'] ) ) { + $data['topreviewers'] = PageTriageUtil::getTopTriagers( $params['topreviewers'] ); + } + $result = [ 'result' => 'success', 'stats' => $data ]; $this->getResult()->addValue( null, $this->getModuleName(), $result ); } @@ -58,6 +62,9 @@ 'username' => [ ApiBase::PARAM_TYPE => 'user', ], + 'topreviewers' => [ + ApiBase::PARAM_TYPE => 'string', + ], ]; } } diff --git a/i18n/en.json b/i18n/en.json index ac3b5d5..29f6b0e 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -405,6 +405,7 @@ "apihelp-pagetriagestats-param-non_autoconfirmed_users": "Whether to include only pages created by non-autoconfirmed users.", "apihelp-pagetriagestats-param-blocked_users": "Whether to include only pages created by blocked users.", "apihelp-pagetriagestats-param-username": "Include only pages created by username.", + "apihelp-pagetriagestats-param-topreviewers": "Include the top 10 reviewers over the given timeframe. Valid values include last-day, last-week (default), or last-month.", "apihelp-pagetriagetagging-description": "Add tags to an article.", "apihelp-pagetriagetagging-param-pageid": "The article for which to be tagged.", "apihelp-pagetriagetagging-param-top": "The tagging text to be added to the top of an article.", diff --git a/i18n/qqq.json b/i18n/qqq.json index 8f8f2fd..ec9f7b0 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -418,6 +418,7 @@ "apihelp-pagetriagestats-param-non_autoconfirmed_users": "{{doc-apihelp-param|pagetriagestats|non_autoconfirmed_users}}", "apihelp-pagetriagestats-param-blocked_users": "{{doc-apihelp-param|pagetriagestats|blocked_users}}", "apihelp-pagetriagestats-param-username": "{{doc-apihelp-param|pagetriagestats|username}}", + "apihelp-pagetriagestats-param-topreviewers": "{{doc-apihelp-param|pagetriagestats|topreviewers}}", "apihelp-pagetriagetagging-description": "{{doc-apihelp-description|pagetriagetagging}}", "apihelp-pagetriagetagging-param-pageid": "{{doc-apihelp-param|pagetriagetagging|pageid}}", "apihelp-pagetriagetagging-param-top": "{{doc-apihelp-param|pagetriagetagging|top}}", diff --git a/includes/PageTriageUtil.php b/includes/PageTriageUtil.php index 6799efd..1fa076a 100755 --- a/includes/PageTriageUtil.php +++ b/includes/PageTriageUtil.php @@ -119,6 +119,11 @@ return ApiPageTriageList::getPageIds( $filters, true ); } + /** +* Get number of reviewed articles in the past week +* @param string|int $namespace Namespace number +* @return array Stats to be returned +*/ public static function getReviewedArticleStat( $namespace = '' ) { global $wgMemc; @@ -162,16 +167,17 @@ // make it expire in 10 minutes $wgMemc->set( $key, $data, 600 ); + return $data; } /** * Get top page triagers in various time frame * @param $time string - time to look back for top triagers, possible values include -* last-day, last-week +* last-day, last-week, last-month * @return array */ - public static function getTopTriager( $time = 'last-week' ) { + public static function getTopTriagers( $time = 'last-week' ) { global $wgMemc; $now = wfTimestamp( TS_UNIX ); @@ -179,7 +185,8 @@ // times to look back for top trigers and expiration time in cache $timeFrame = [ 'last-day' => [ 'ts' => $now -
[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: Only strip on one side
Lokal Profil has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354987 ) Change subject: Only strip on one side .. Only strip on one side Change-Id: I9575af3bae30356e2527f041e4ced4126656c9b0 --- M erfgoedbot/fill_table_monuments_all.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage refs/changes/87/354987/1 diff --git a/erfgoedbot/fill_table_monuments_all.py b/erfgoedbot/fill_table_monuments_all.py index 2b6c84e..a4ac15a 100644 --- a/erfgoedbot/fill_table_monuments_all.py +++ b/erfgoedbot/fill_table_monuments_all.py @@ -267,7 +267,7 @@ MonumentWikidataDatasetSql.get_template_dir(), filename) with open(filepath, 'r') as f: sql = f.read() -return sql.strip() +return sql.rstrip() class VariableType(object): -- To view, visit https://gerrit.wikimedia.org/r/354987 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9575af3bae30356e2527f041e4ced4126656c9b0 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/heritage Gerrit-Branch: wikidata Gerrit-Owner: Lokal Profil___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: rebaser: Prevent submissions before initialization
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354949 ) Change subject: rebaser: Prevent submissions before initialization .. rebaser: Prevent submissions before initialization When b3ad56e0e focused the surface right at the start, that caused the server to crash because the resulting selection change was submitted before the client had finished initializing. Change-Id: I1f1b58293a54978648dab14d5bfaeac53593ecf3 --- M src/dm/ve.dm.SurfaceSynchronizer.js 1 file changed, 15 insertions(+), 0 deletions(-) Approvals: Divec: Looks good to me, approved jenkins-bot: Verified diff --git a/src/dm/ve.dm.SurfaceSynchronizer.js b/src/dm/ve.dm.SurfaceSynchronizer.js index f313fe5..02d1973 100644 --- a/src/dm/ve.dm.SurfaceSynchronizer.js +++ b/src/dm/ve.dm.SurfaceSynchronizer.js @@ -105,6 +105,18 @@ /** * @inheritdoc */ +ve.dm.SurfaceSynchronizer.prototype.submitChange = function () { + // Prevent submission before initialization is complete + if ( !this.initialized ) { + return; + } + // Parent method + ve.dm.RebaseClient.prototype.submitChange.apply( this, arguments ); +}; + +/** + * @inheritdoc + */ ve.dm.SurfaceSynchronizer.prototype.sendChange = function ( backtrack, change ) { this.socket.emit( 'submitChange', { backtrack: this.backtrack, @@ -285,7 +297,10 @@ } history = ve.dm.Change.static.deserialize( data.history, this.doc ); this.acceptChange( history ); + + // Mark ourselves as initialized and retry any prevented submissions this.initialized = true; + this.submitChangeThrottled(); }; /** -- To view, visit https://gerrit.wikimedia.org/r/354949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f1b58293a54978648dab14d5bfaeac53593ecf3 Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: Divec Gerrit-Reviewer: Esanders Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ArticlePlaceholder[master]: Use eslint to lint JavaScript instead of jscs and jshint
WMDE-leszek has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354986 ) Change subject: Use eslint to lint JavaScript instead of jscs and jshint .. Use eslint to lint JavaScript instead of jscs and jshint Bug: T165843 Change-Id: I7550bb2553e5dabc793a7a113539dde60fba28f8 --- A .eslintignore A .eslintrc.json M Gruntfile.js M package.json A tests/qunit/.eslintrc.json 5 files changed, 31 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder refs/changes/86/354986/1 diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000..82eaa05 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +node_modules/** +vendor/** diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000..c410740 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,13 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + }, + "rules": { + "dot-notation": "off", + "no-proto": "off", + "valid-jsdoc": "off", + "wrap-iife": "off" + } +} diff --git a/Gruntfile.js b/Gruntfile.js index e1af6af..eb5e877 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,20 +1,11 @@ -/*jshint node:true */ +/* eslint-env node */ + module.exports = function ( grunt ) { require( 'load-grunt-tasks' )( grunt ); grunt.initConfig( { - jshint: { - options: { - jshintrc: true - }, - all: [ - '*.js', - 'modules/**/*.js', - 'tests/**/*.js' - ] - }, - jscs: { - src: '<%= jshint.all %>' + eslint: { + all: '.' }, banana: { all: 'i18n/' @@ -40,6 +31,6 @@ } } ); - grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana', 'qunit', 'stylelint' ] ); + grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'qunit', 'stylelint' ] ); grunt.registerTask( 'default', 'test' ); }; diff --git a/package.json b/package.json index 35a7ffc..d7d1c16 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ "test": "grunt test" }, "devDependencies": { + "eslint-config-wikimedia": "0.4.0", "grunt": "1.0.1", "grunt-banana-checker": "0.4.0", - "grunt-contrib-jshint": "0.11.2", "grunt-contrib-qunit": "^1.2.0", - "grunt-jscs": "2.1.0", + "grunt-eslint": "19.0.0", "grunt-jsonlint": "1.0.7", "grunt-stylelint": "0.6.0", "jquery": "^3.1.1", diff --git a/tests/qunit/.eslintrc.json b/tests/qunit/.eslintrc.json new file mode 100644 index 000..a974377 --- /dev/null +++ b/tests/qunit/.eslintrc.json @@ -0,0 +1,9 @@ +{ + "extends": "../../.eslintrc.json", + "env": { + "qunit": true + }, + "globals": { + "sinon": false + } +} -- To view, visit https://gerrit.wikimedia.org/r/354986 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7550bb2553e5dabc793a7a113539dde60fba28f8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ArticlePlaceholder 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] VisualEditor/VisualEditor[master]: RebaseServer: When rejecting, publish the top of the history...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354702 ) Change subject: RebaseServer: When rejecting, publish the top of the history instead of the top of the rejected change .. RebaseServer: When rejecting, publish the top of the history instead of the top of the rejected change The top of the rejected change has an incorrect/unexpected start, and this causes exceptions in clients. We should clean up the selection handling in dm.Change in general. Bonus: always remove selections in ve.dm.Change#truncate for sanity. Change-Id: I443181201d2ecdf582822a98e4b994a38948546f --- M src/dm/ve.dm.Change.js M src/dm/ve.dm.RebaseServer.js 2 files changed, 5 insertions(+), 2 deletions(-) Approvals: Divec: Looks good to me, approved jenkins-bot: Verified diff --git a/src/dm/ve.dm.Change.js b/src/dm/ve.dm.Change.js index c867305..0558580 100644 --- a/src/dm/ve.dm.Change.js +++ b/src/dm/ve.dm.Change.js @@ -611,6 +611,8 @@ /** * Build a change from the first (least recent) transactions of this change. * + * Always removes selections. + * * @param {number} length Number of transactions * @return {ve.dm.Change} Subset of this change with only the least recent transactions */ @@ -622,7 +624,7 @@ this.start, this.transactions.slice( 0, length ), this.stores.slice( 0, length ), - length < this.stores.length ? {} : OO.cloneObject( this.selections ) + {} ); }; diff --git a/src/dm/ve.dm.RebaseServer.js b/src/dm/ve.dm.RebaseServer.js index 62b319a..a0ad936 100644 --- a/src/dm/ve.dm.RebaseServer.js +++ b/src/dm/ve.dm.RebaseServer.js @@ -113,7 +113,8 @@ // Follow-on does not fully acknowledge outstanding conflicts: reject entirely rejections = rejections - backtrack + change.transactions.length; this.updateDocState( doc, author, null, rejections, null ); - appliedChange = change.truncate( 0 ); + // FIXME argh this publishes an empty change, which is not what we want + appliedChange = state.history.truncate( 0 ); } else if ( rejections < backtrack ) { throw new Error( 'Backtrack=' + backtrack + ' > ' + rejections + '=rejections' ); } else { -- To view, visit https://gerrit.wikimedia.org/r/354702 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I443181201d2ecdf582822a98e4b994a38948546f Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: Divec Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikidata...rdf[master]: fix comment
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354922 ) Change subject: fix comment .. fix comment Change-Id: I3848b0c9d5024c67a65b844dd0ebe008accb86c1 --- M blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/inline/literal/WikibaseDateExtension.java 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Smalyshev: Looks good to me, approved jenkins-bot: Verified diff --git a/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/inline/literal/WikibaseDateExtension.java b/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/inline/literal/WikibaseDateExtension.java index 3750e39..c8adf74 100644 --- a/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/inline/literal/WikibaseDateExtension.java +++ b/blazegraph/src/main/java/org/wikidata/query/rdf/blazegraph/inline/literal/WikibaseDateExtension.java @@ -136,7 +136,7 @@ } if (d2 && dt1.equals(XMLSchema.DURATION)) { -// date and duration, is OK +// duration and date, is OK return true; } -- To view, visit https://gerrit.wikimedia.org/r/354922 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3848b0c9d5024c67a65b844dd0ebe008accb86c1 Gerrit-PatchSet: 1 Gerrit-Project: wikidata/query/rdf Gerrit-Branch: master Gerrit-Owner: SmalyshevGerrit-Reviewer: Smalyshev Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Set initial configuration for techconduct.wikimedia.org
Dereckson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354985 ) Change subject: Set initial configuration for techconduct.wikimedia.org .. Set initial configuration for techconduct.wikimedia.org Private wiki, with Flow Bug: T165977 Change-Id: I9083b5b06f8def3700c9a39f519a11b70fe23c55 --- M dblists/all.dblist M dblists/flowprivate.dblist M dblists/nowikidatadescriptiontaglines.dblist M dblists/private.dblist M dblists/s3.dblist M dblists/securepollglobal.dblist M dblists/small.dblist M dblists/special.dblist M wmf-config/InitialiseSettings.php 9 files changed, 26 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/85/354985/1 diff --git a/dblists/all.dblist b/dblists/all.dblist index dd37493..543d871 100644 --- a/dblists/all.dblist +++ b/dblists/all.dblist @@ -753,6 +753,7 @@ tawiktionary tcywiki tenwiki +techconductwiki test2wiki testwiki testwikidatawiki diff --git a/dblists/flowprivate.dblist b/dblists/flowprivate.dblist index b5458ba..7fa421e 100644 --- a/dblists/flowprivate.dblist +++ b/dblists/flowprivate.dblist @@ -1 +1,2 @@ officewiki +techconductwiki diff --git a/dblists/nowikidatadescriptiontaglines.dblist b/dblists/nowikidatadescriptiontaglines.dblist index 5460751..e5bcff3 100644 --- a/dblists/nowikidatadescriptiontaglines.dblist +++ b/dblists/nowikidatadescriptiontaglines.dblist @@ -385,6 +385,7 @@ tawikinews tawikisource tawiktionary +techconductwiki tenwiki test2wiki testwiki diff --git a/dblists/private.dblist b/dblists/private.dblist index 299f5d3..261fbd8 100644 --- a/dblists/private.dblist +++ b/dblists/private.dblist @@ -27,6 +27,7 @@ searchcomwiki spcomwiki stewardwiki +techconductwiki transitionteamwiki wg_enwiki wikimaniateamwiki diff --git a/dblists/s3.dblist b/dblists/s3.dblist index 0da0603..1759710 100644 --- a/dblists/s3.dblist +++ b/dblists/s3.dblist @@ -720,6 +720,7 @@ tawikisource tawiktionary tcywiki +techconductwiki tenwiki test2wiki testwiki diff --git a/dblists/securepollglobal.dblist b/dblists/securepollglobal.dblist index d32709c..89a45d9 100644 --- a/dblists/securepollglobal.dblist +++ b/dblists/securepollglobal.dblist @@ -748,6 +748,7 @@ tawikisource tawiktionary tcywiki +techconductwiki tenwiki test2wiki testwiki diff --git a/dblists/small.dblist b/dblists/small.dblist index febba09..7eb255e 100644 --- a/dblists/small.dblist +++ b/dblists/small.dblist @@ -401,6 +401,7 @@ tawikibooks tawikiquote tcywiki +techconductwiki tenwiki tetwiki tewikibooks diff --git a/dblists/special.dblist b/dblists/special.dblist index 29f7f36..c0b70a4 100644 --- a/dblists/special.dblist +++ b/dblists/special.dblist @@ -40,6 +40,7 @@ specieswiki stewardwiki strategywiki +techconductwiki tenwiki test2wiki testwiki diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 24979a9..4ac7c3b 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -1161,6 +1161,7 @@ 'specieswiki' => '/static/images/project-logos/specieswiki.png', 'stewardwiki' => '/static/images/project-logos/stewardwiki.png', // T39700 'strategywiki' => '/static/images/project-logos/strategywiki.png', + 'techcomwiki' => '/static/images/project-logos/techcomwiki.png', 'tenwiki' => '/static/images/project-logos/tenwiki.png', 'testwiki' => '/static/images/project-logos/testwiki.png', 'test2wiki' => '/static/images/project-logos/test2wiki.png', @@ -1431,6 +1432,7 @@ 'arbcom_cswiki' => ['1.5x' => '/static/images/project-logos/arbcom_cswiki-1.5x.png', '2x' => '/static/images/project-logos/arbcom_cswiki-2x.png'], // T151731 'foundationwiki' => [ '1.5x' => '/static/images/project-logos/foundationwiki-1.5x.png', '2x' => '/static/images/project-logos/foundationwiki-2x.png' ], 'metawiki' => [ '1.5x' => '/static/images/project-logos/metawiki-1.5x.png', '2x' => '/static/images/project-logos/metawiki-2x.png' ], + 'techconductwiki' => [ '1.5x' => '/static/images/project-logos/techconductwiki-1.5x.png', '2x' => '/static/images/project-logos/techconductwiki-2x.png' ], 'test2wiki' => [ '1.5x' => '/static/images/project-logos/test2wiki-1.5x.png', '2x' => '/static/images/project-logos/test2wiki-2x.png' ], ], # @} end of wgLogoHD @@ -1673,6 +1675,7 @@ 'specieswiki' => '//species.wikimedia.org', 'stewardwiki' => '//steward.wikimedia.org', 'strategywiki' => '//strategy.wikimedia.org', + 'techconductwiki' => '//techconduct.wikimedia.org', // T165977 'testwikidatawiki' => '//test.wikidata.org', 'transitionteamwiki' => '//transitionteam.wikimedia.org', 'usabilitywiki' => '//usability.wikimedia.org', @@ -2183,6 +2186,7 @@ 'tawikiquote' => 'விக்கிமேற்கோள்', 'tawikisource' => 'விக்கிமூலம்', 'tcywiki' =>
[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Update VE core submodule to master (7aab1c6ba)
Jforrester has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354984 ) Change subject: Update VE core submodule to master (7aab1c6ba) .. Update VE core submodule to master (7aab1c6ba) New changes: bb71b76d8 ce.BranchNode: Handle splices next to text nodes d1300c6e6 ve.Node#attach: set document before root, rather than after df6113771 summarizeTransaction: hide null author ac71b0ea6 Add ve.ce.View#initialize to eliminate constructor/onSetup duplication 45cd82bd7 Render HTML attributes in ce.View#initialize rather than in the constructor Change-Id: I4d61f40247fdab60bdc2e1b23f30ffee4c8ab8dc --- M lib/ve 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/84/354984/1 diff --git a/lib/ve b/lib/ve index 69d8607..7aab1c6 16 --- a/lib/ve +++ b/lib/ve @@ -1 +1 @@ -Subproject commit 69d8607cf0b893bb3fc9cb76c4784f21b6932d80 +Subproject commit 7aab1c6ba53ed92130638da8be35dba7c65754bd -- To view, visit https://gerrit.wikimedia.org/r/354984 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d61f40247fdab60bdc2e1b23f30ffee4c8ab8dc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Jforrester___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: fix
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354983 ) Change subject: fix .. fix Change-Id: I75503d8516489ae4a5be56202d3a797b234b6d0d --- M erfgoedbot/template/classic_table.sql.template 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jean-Frédéric: Looks good to me, approved jenkins-bot: Verified diff --git a/erfgoedbot/template/classic_table.sql.template b/erfgoedbot/template/classic_table.sql.template index bd74801..954df7e 100644 --- a/erfgoedbot/template/classic_table.sql.template +++ b/erfgoedbot/template/classic_table.sql.template @@ -1,6 +1,8 @@ DROP TABLE IF EXISTS `{table}`; CREATE TABLE IF NOT EXISTS `{table}` ( {rows} + `source` varchar(510) NOT NULL DEFAULT '', + `changed` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`{primkey}`), KEY `latitude` (`lat`), KEY `longitude` (`lon`) -- To view, visit https://gerrit.wikimedia.org/r/354983 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I75503d8516489ae4a5be56202d3a797b234b6d0d Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/heritage Gerrit-Branch: wikidata Gerrit-Owner: Lokal ProfilGerrit-Reviewer: Jean-Frédéric 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...SyntaxHighlight_GeSHi[master]: Remove 'GeSHi' name from composer and npm manifests
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354726 ) Change subject: Remove 'GeSHi' name from composer and npm manifests .. Remove 'GeSHi' name from composer and npm manifests Both of these seem to be private, and are therefore easily renamed. Bug: T164939 Change-Id: I09be0ef0131d31182ed8bb6be221c76dba2c1a53 --- M composer.json M package.json 2 files changed, 1 insertion(+), 4 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.json b/composer.json index 30ac741..bc3fc91 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "mediawiki/syntax-highlight_geshi", + "name": "mediawiki/syntax-highlight", "description": "Syntax highlighting extension for MediaWiki", "require": { "symfony/process": "~3.2" diff --git a/package.json b/package.json index 443f5a2..720fdec 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,5 @@ { - "name": "SyntaxHighlight_GeSHi", - "version": "0.0.0", "private": true, - "description": "Build tools for the SyntaxHighlight_GeSHi MediaWiki extension.", "scripts": { "test": "grunt test" }, -- To view, visit https://gerrit.wikimedia.org/r/354726 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I09be0ef0131d31182ed8bb6be221c76dba2c1a53 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi Gerrit-Branch: master Gerrit-Owner: TheDJGerrit-Reviewer: Jforrester Gerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Print: prefer JS print over printable version.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/350197 ) Change subject: Print: prefer JS print over printable version. .. Print: prefer JS print over printable version. Bug: T24256 Change-Id: Ic3dc15e578ce4a94959285c9ae579e9088423544 --- M resources/src/mediawiki/page/ready.js 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki/page/ready.js b/resources/src/mediawiki/page/ready.js index d5a667e..758e20a 100644 --- a/resources/src/mediawiki/page/ready.js +++ b/resources/src/mediawiki/page/ready.js @@ -58,6 +58,11 @@ */ mw.hook( 'wikipage.categories' ).fire( $nodes ); } + + $( '#t-print' ).click( function ( e ) { + window.print(); + e.preventDefault(); + } ); } ); }( mediaWiki, jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/350197 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3dc15e578ce4a94959285c9ae579e9088423544 Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: TheDJGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Fomafix Gerrit-Reviewer: Jdlrobson Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Mattflaschen Gerrit-Reviewer: TheDJ 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] labs...heritage[wikidata]: fix
Lokal Profil has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354983 ) Change subject: fix .. fix Change-Id: I75503d8516489ae4a5be56202d3a797b234b6d0d --- M erfgoedbot/template/classic_table.sql.template 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage refs/changes/83/354983/1 diff --git a/erfgoedbot/template/classic_table.sql.template b/erfgoedbot/template/classic_table.sql.template index bd74801..954df7e 100644 --- a/erfgoedbot/template/classic_table.sql.template +++ b/erfgoedbot/template/classic_table.sql.template @@ -1,6 +1,8 @@ DROP TABLE IF EXISTS `{table}`; CREATE TABLE IF NOT EXISTS `{table}` ( {rows} + `source` varchar(510) NOT NULL DEFAULT '', + `changed` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`{primkey}`), KEY `latitude` (`lat`), KEY `longitude` (`lon`) -- To view, visit https://gerrit.wikimedia.org/r/354983 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75503d8516489ae4a5be56202d3a797b234b6d0d Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/heritage Gerrit-Branch: wikidata Gerrit-Owner: Lokal Profil___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Update \n handling for HTMLUsersMultiselectField
Mattflaschen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354982 ) Change subject: Update \n handling for HTMLUsersMultiselectField .. Update \n handling for HTMLUsersMultiselectField Change-Id: I51b772946f1e50a21fb86cab969defb4647b820b --- M includes/htmlform/fields/HTMLMultiSelectField.php M includes/htmlform/fields/HTMLUsersMultiselectField.php 2 files changed, 21 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/82/354982/1 diff --git a/includes/htmlform/fields/HTMLMultiSelectField.php b/includes/htmlform/fields/HTMLMultiSelectField.php index 2b6e066..6c51a6c 100644 --- a/includes/htmlform/fields/HTMLMultiSelectField.php +++ b/includes/htmlform/fields/HTMLMultiSelectField.php @@ -3,7 +3,7 @@ /** * Multi-select field */ -class HTMLMultiSelectField extends HTMLFormField implements HTMLNestedFilterable { +class HTMLMultiSelectField extends HTMLFormField { /** * @param array $params * In adition to the usual HTMLFormField parameters, this can take the following fields: diff --git a/includes/htmlform/fields/HTMLUsersMultiselectField.php b/includes/htmlform/fields/HTMLUsersMultiselectField.php index 8829f66..7c6902b 100644 --- a/includes/htmlform/fields/HTMLUsersMultiselectField.php +++ b/includes/htmlform/fields/HTMLUsersMultiselectField.php @@ -14,14 +14,16 @@ * * @note This widget is not likely to remain functional in non-OOUI forms. */ -class HTMLUsersMultiselectField extends HTMLUserTextField { +class HTMLUsersMultiselectField extends HTMLUserTextField implements HTMLNestedFilterable { public function loadDataFromRequest( $request ) { - if ( !$request->getCheck( $this->mName ) ) { - return $this->getDefault(); + if ( $request->getCheck( $this->mName ) ) { + $value = $request->getText( $this->mName ); + } else { + $value = $this->getDefault(); } - $usersArray = explode( "\n", $request->getText( $this->mName ) ); + $usersArray = explode( "\n", $value ); // Remove empty lines $usersArray = array_values( array_filter( $usersArray, function( $username ) { return trim( $username ) !== ''; @@ -29,6 +31,20 @@ return $usersArray; } + /** +* Support for seperating multi-option preferences into multiple preferences +* Due to lack of array support. +* +* @param array $data +*/ + public function filterDataForSubmit( $data ) { + return [ + '' => implode( "\n", $data ), + ]; + } + + + public function validate( $value, $alldata ) { if ( !$this->mParams['exists'] ) { return true; -- To view, visit https://gerrit.wikimedia.org/r/354982 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I51b772946f1e50a21fb86cab969defb4647b820b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Mattflaschen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityExternalValidation[master]: Use eslint to lint JavaScript instead of jscs and jshint
WMDE-leszek has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354981 ) Change subject: Use eslint to lint JavaScript instead of jscs and jshint .. Use eslint to lint JavaScript instead of jscs and jshint Bug: T165843 Change-Id: I35aef83c3ad46725682b7b18d1c81ee5f364b410 --- A .eslintignore A .eslintrc.json D .jscsrc D .jshintignore D .jshintrc M Gruntfile.js M package.json 7 files changed, 19 insertions(+), 72 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation refs/changes/81/354981/1 diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000..82eaa05 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +node_modules/** +vendor/** diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000..25deb55 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,9 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + }, + "rules": { + } +} diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index dc3da02..000 --- a/.jscsrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - // https://github.com/wikimedia/jscs-preset-wikimedia/blob/master/presets/wikimedia.json - "preset": "wikimedia" -} diff --git a/.jshintignore b/.jshintignore deleted file mode 100644 index 394522f..000 --- a/.jshintignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/** \ No newline at end of file diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index a984a17..000 --- a/.jshintrc +++ /dev/null @@ -1,49 +0,0 @@ -{ - "camelcase": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "supernew": true, - "shadow": false, - "noarg": true, - "noempty": true, - "nonew": true, - "quotmark": false, // sometimes double quotes make sense, e.g. "foo's" is better readable than 'foo\'s' - "trailing": true, - "undef": true, - "unused": "vars", // we want to allow unused function parameters - "laxbreak": true, - "laxcomma": false, - "onevar": false, - "bitwise": true, - "forin": false, - "regexp": true, - "strict": true, - "scripturl": true, - - // Environment - "browser": true, - - // Globals - "globals": { - "jQuery": false, - "mediaWiki": false, - "wikibase": true, - "dataValues": false, - "dataTypes": false, - "util": false, - "valueFormatters": false, - "valueParsers": false - }, - - "overrides": { - "*/tests/qunit/**/*.tests.js": { - "globals": { - "sinon": false, - "QUnit": false - } - } - } -} \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index d20944f..6ad3e87 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,24 +1,14 @@ -/* jshint node: true, strict: false */ +/* eslint-env node */ + module.exports = function ( grunt ) { - grunt.loadNpmTasks( 'grunt-contrib-jshint' ); - grunt.loadNpmTasks( 'grunt-jscs' ); + grunt.loadNpmTasks( 'grunt-eslint' ); grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.loadNpmTasks( 'grunt-banana-checker' ); grunt.loadNpmTasks( 'grunt-stylelint' ); grunt.initConfig( { - jshint: { - options: { - jshintrc: true - }, - all: [ - '**/*.js', - '!node_modules/**', - '!vendor/**' - ] - }, - jscs: { - src: '<%= jshint.all %>' + eslint: { + all: '.' }, banana: { options: { @@ -45,5 +35,5 @@ } } ); - grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana', 'stylelint' ] ); + grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'stylelint' ] ); }; diff --git a/package.json b/package.json index 69d95e9..9030571 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,11 @@ "author": "BP2014N1", "license": "GPL-2.0+", "devDependencies": { + "eslint-config-wikimedia": "0.4.0", "grunt": "1.0.1", "grunt-banana-checker": "0.3.0", + "grunt-eslint": "19.0.0", "grunt-jsonlint": "1.1.0", - "grunt-contrib-jshint": "0.11.3", - "grunt-jscs": "2.1.0", "grunt-stylelint":
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: ve.Node#attach: set document before root, rather than after
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354908 ) Change subject: ve.Node#attach: set document before root, rather than after .. ve.Node#attach: set document before root, rather than after onRoot event handlers expect a document to be set. Swapping this is safe because setDocument() doesn't fire events. Change-Id: I9169f097f61aee0be12b62d887e4e3ef9c82a7a9 --- M src/ve.Node.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: DLynch: Looks good to me, approved jenkins-bot: Verified diff --git a/src/ve.Node.js b/src/ve.Node.js index d5b8b72..55a4031 100644 --- a/src/ve.Node.js +++ b/src/ve.Node.js @@ -366,8 +366,8 @@ */ ve.Node.prototype.attach = function ( parent ) { this.parent = parent; - this.setRoot( parent.getRoot() ); this.setDocument( parent.getDocument() ); + this.setRoot( parent.getRoot() ); this.emit( 'attach', parent ); }; -- To view, visit https://gerrit.wikimedia.org/r/354908 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9169f097f61aee0be12b62d887e4e3ef9c82a7a9 Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: DLynch Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikidata[master]: Use PropertySuggester in gerrit instead of github
Ladsgroup has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354980 ) Change subject: Use PropertySuggester in gerrit instead of github .. Use PropertySuggester in gerrit instead of github Bug: T104309 Change-Id: If169cc678858bce99735fb3346e2e9d8c364581a --- M composer.json 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikidata refs/changes/80/354980/1 diff --git a/composer.json b/composer.json index e465826..20dc3de 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,10 @@ "repositories": [ { "type": "git", +"url": "https://gerrit.wikimedia.org/r/mediawiki/extensions/PropertySuggester; +}, +{ +"type": "git", "url": "https://gerrit.wikimedia.org/r/mediawiki/extensions/Wikidata.org; }, { @@ -31,7 +35,7 @@ "require": { "php": ">=5.5.0", "mediawiki/article-placeholder": "dev-master", -"propertysuggester/property-suggester": "~3.1.2", +"propertysuggester/property-suggester": "dev-master", "wikibase/wikibase": "dev-master", "wikibase/wikimedia-badges": "dev-master", "wikibase/Wikidata.org": "dev-master", -- To view, visit https://gerrit.wikimedia.org/r/354980 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If169cc678858bce99735fb3346e2e9d8c364581a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikidata Gerrit-Branch: master Gerrit-Owner: Ladsgroup___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: ce.BranchNode: Handle splices next to text nodes
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354906 ) Change subject: ce.BranchNode: Handle splices next to text nodes .. ce.BranchNode: Handle splices next to text nodes Because ce.TextNodes have an empty .$element, the onSplice logic fails to find the insertion point in the DOM. We assume that there will never be two adjacent text nodes, so when the insertion point is after a text node, we go back one node, get its .$element, then move forward one node in the DOM. Change-Id: I22ae8fad8c24b7e8e60abab78142b6f59b736549 --- M src/ce/ve.ce.BranchNode.js 1 file changed, 22 insertions(+), 8 deletions(-) Approvals: DLynch: Looks good to me, approved jenkins-bot: Verified diff --git a/src/ce/ve.ce.BranchNode.js b/src/ce/ve.ce.BranchNode.js index 6e680e8..1ba33be 100644 --- a/src/ce/ve.ce.BranchNode.js +++ b/src/ce/ve.ce.BranchNode.js @@ -179,7 +179,9 @@ var i, j, length, args = [], - $anchor, + anchorCeNode, + prevCeNode, + anchorDomNode, afterAnchor, node, parentNode, @@ -203,16 +205,28 @@ removals[ i ].$element.detach(); } if ( args.length >= 3 ) { - if ( index ) { - // Get the element before the insertion point - $anchor = this.children[ index - 1 ].$element.last(); + if ( index > 0 ) { + // Get the element before the insertion + anchorCeNode = this.children[ index - 1 ]; + // If the CE node is a text node, its $element will be empty + // Look at its previous sibling, which cannot be a text node + if ( anchorCeNode.getType() === 'text' ) { + prevCeNode = this.children[ index - 2 ]; + if ( prevCeNode ) { + anchorDomNode = prevCeNode.$element.last()[ 0 ].nextSibling; + } else { + anchorDomNode = this.$element[ 0 ].firstChild; + } + } else { + anchorDomNode = anchorCeNode.$element.last()[ 0 ]; + } } for ( i = args.length - 1; i >= 2; i-- ) { args[ i ].attach( this ); - if ( index ) { - // DOM equivalent of $anchor.after( args[i].$element ); - afterAnchor = $anchor[ 0 ].nextSibling; - parentNode = $anchor[ 0 ].parentNode; + if ( anchorDomNode ) { + // DOM equivalent of $( anchorDomNode ).after( args[i].$element ); + afterAnchor = anchorDomNode.nextSibling; + parentNode = anchorDomNode.parentNode; for ( j = 0, length = args[ i ].$element.length; j < length; j++ ) { parentNode.insertBefore( args[ i ].$element[ j ], afterAnchor ); } -- To view, visit https://gerrit.wikimedia.org/r/354906 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22ae8fad8c24b7e8e60abab78142b6f59b736549 Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: DLynch Gerrit-Reviewer: Divec Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQuality[master]: Use eslint to lint JavaScript instead of jscs and jshint
WMDE-leszek has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354979 ) Change subject: Use eslint to lint JavaScript instead of jscs and jshint .. Use eslint to lint JavaScript instead of jscs and jshint Bug: T165843 Change-Id: I1a227af7278f14630de93154f0afc7ffcc9fc47f --- R .eslintignore A .eslintrc.json D .jscsrc D .jshintrc M Gruntfile.js M package.json 6 files changed, 16 insertions(+), 71 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQuality refs/changes/79/354979/1 diff --git a/.jshintignore b/.eslintignore similarity index 61% rename from .jshintignore rename to .eslintignore index a860310..82eaa05 100644 --- a/.jshintignore +++ b/.eslintignore @@ -1 +1,2 @@ node_modules/** +vendor/** diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000..9fad52a --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,7 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + } +} diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 74c47b6..000 --- a/.jscsrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - // https://github.com/wikimedia/jscs-preset-wikimedia/blob/master/presets/wikimedia.json - "preset": "wikimedia" -} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 73ad575..000 --- a/.jshintrc +++ /dev/null @@ -1,49 +0,0 @@ -{ - "camelcase": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "supernew": true, - "shadow": false, - "noarg": true, - "noempty": true, - "nonew": true, - "quotmark": false, // sometimes double quotes make sense, e.g. "foo's" is better readable than 'foo\'s' - "trailing": true, - "undef": true, - "unused": "vars", // we want to allow unused function parameters - "laxbreak": true, - "laxcomma": false, - "onevar": false, - "bitwise": true, - "forin": false, - "regexp": true, - "strict": true, - "scripturl": true, - - // Environment - "browser": true, - - // Globals - "globals": { -"jQuery": false, -"mediaWiki": false, -"wikibase": true, -"dataValues": false, -"dataTypes": false, -"util": false, -"valueFormatters": false, -"valueParsers": false - }, - - "overrides": { -"*/tests/qunit/**/*.tests.js": { - "globals": { -"sinon": false, -"QUnit": false - } -} - } -} diff --git a/Gruntfile.js b/Gruntfile.js index b0b67b3..573c373 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,24 +1,14 @@ -/* jshint node: true, strict: false */ +/* eslint-env node */ + module.exports = function ( grunt ) { - grunt.loadNpmTasks( 'grunt-contrib-jshint' ); + grunt.loadNpmTasks( 'grunt-eslint' ); grunt.loadNpmTasks( 'grunt-jsonlint' ); - grunt.loadNpmTasks( 'grunt-jscs' ); grunt.loadNpmTasks( 'grunt-banana-checker' ); grunt.loadNpmTasks( 'grunt-stylelint' ); grunt.initConfig( { - jshint: { - options: { - jshintrc: true - }, - all: [ - '**/*.js', - '!node_modules/**', - '!vendor/**' - ] - }, - jscs: { - src: '<%= jshint.all %>' + eslint: { + all: '.' }, banana: { options: { @@ -43,6 +33,6 @@ } } ); - grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana', 'stylelint' ] ); + grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'stylelint' ] ); grunt.registerTask( 'default', 'test' ); }; diff --git a/package.json b/package.json index 9c4b585..c8ba0d5 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "author": "BP2014N1", "license": "GPL-2.0+", "devDependencies": { + "eslint-config-wikimedia": "0.4.0", "grunt": "1.0.1", "grunt-banana-checker": "0.4.0", -"grunt-contrib-jshint": "0.11.3", -"grunt-jscs": "2.6.0", +"grunt-eslint": "19.0.0", "grunt-jsonlint": "1.0.7", "grunt-stylelint": "0.6.0", "stylelint-config-wikimedia": "0.4.1" -- To view, visit https://gerrit.wikimedia.org/r/354979 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a227af7278f14630de93154f0afc7ffcc9fc47f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQuality 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...RevisionSlider[master]: Fix RevisionSlider issues with REL 1.27
Andrew-WMDE has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354978 ) Change subject: Fix RevisionSlider issues with REL 1.27 .. Fix RevisionSlider issues with REL 1.27 Bug: T161143 Change-Id: Ie294d6a582a4ae661c5e071c9148a8365e356f09 --- M i18n/en.json M i18n/qqq.json M modules/ext.RevisionSlider.Revision.js M modules/ext.RevisionSlider.RevisionListView.js M src/RevisionSliderHooks.php 5 files changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RevisionSlider refs/changes/78/354978/1 diff --git a/i18n/en.json b/i18n/en.json index cac2430..5f4962f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -10,6 +10,7 @@ "revisionslider-beta-feature-message": "Revision slider", "revisionslider-beta-feature-description": "Show a revision slider when comparing two revisions of a page.", "revisionslider-toggle-label": "Browse history", + "revisionslider-loading-placeholder": "The revision slider is loading...", "revisionslider-page-size": "$1 {{PLURAL:$2|byte|bytes}}", "revisionslider-change-size": "$1 {{PLURAL:$3|byte|bytes}}", "revisionslider-label-date": "Date", diff --git a/i18n/qqq.json b/i18n/qqq.json index 612c6ff..6b6d73f 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -12,6 +12,7 @@ "revisionslider-beta-feature-message": "Label for the RevisionSlider Beta Feature.", "revisionslider-beta-feature-description": "Description for the RevisionSlider Beta Feature, describing the feature that will be enabled.", "revisionslider-toggle-label": "Label of the button toggling the visibility of RevisionSlider", + "revisionslider-loading-placeholder": "Message shown while the RevisionSlider is still loading on a diff page. Once loaded the message is removed.", "revisionslider-page-size": "Page size after the revision.\n\nParameters:\n$1 - number of bytes formatted for output (with mw.language.converNumber)\n$2 - number of bytes, could be used with PLURAL\n{{Identical|Byte}}", "revisionslider-change-size": "Change size, ie. number of bytes added or removed in the revision.\n\nParameters:\n$1 - change size formatted for output (colour-coded HTML element, including plus or minus sign)\n$2 - change size (in bytes), can be negative\n$3 - change size (in bytes) without a sign\n{{Identical|Byte}}", "revisionslider-label-date": "Label for the creation date of the revision.\n{{Identical|Date}}", diff --git a/modules/ext.RevisionSlider.Revision.js b/modules/ext.RevisionSlider.Revision.js index 181b2fd..ad258a5 100644 --- a/modules/ext.RevisionSlider.Revision.js +++ b/modules/ext.RevisionSlider.Revision.js @@ -121,7 +121,7 @@ */ formatDate: function ( rawDate ) { var offset = parseInt( mw.libs.revisionSlider.userOffset ); - return moment( rawDate ).utcOffset( offset ).format( 'LLL' ); + return moment( rawDate ).zone( offset ).format( 'LLL' ); }, /** diff --git a/modules/ext.RevisionSlider.RevisionListView.js b/modules/ext.RevisionSlider.RevisionListView.js index d674d72..e7f0221 100644 --- a/modules/ext.RevisionSlider.RevisionListView.js +++ b/modules/ext.RevisionSlider.RevisionListView.js @@ -178,6 +178,15 @@ this.hideCurrentTooltip(); tooltip = this.makeTooltip( revision, $revisionContainer ); + + tooltip.$element.css( 'top', $revisionContainer.offset().top + $revisionContainer.outerHeight() + 'px' ); + + if ( this.dir === 'ltr' ) { + tooltip.$element.css( 'margin-left', $revisionContainer.offset().left + this.revisionWidth / 2 + 'px' ); + } else { + tooltip.$element.css( 'margin-right', $revisionContainer.offset().left + this.revisionWidth / 2 + 'px' ); + } + tooltip.$element.addClass( 'mw-revslider-revision-tooltip-' + pos ); $( 'body' ).append( tooltip.$element ); diff --git a/src/RevisionSliderHooks.php b/src/RevisionSliderHooks.php index 2cabf66..3bb1340 100644 --- a/src/RevisionSliderHooks.php +++ b/src/RevisionSliderHooks.php @@ -89,7 +89,7 @@ ] ); $toggleButton->setAttributes( [ 'style' => 'width: 100%; text-align: center;' ] ); - $progressBar = new OOUI\ProgressBarWidget( [ 'progress' => false ] ); + $progressBar = ( new Message( 'revisionslider-loading-placeholder' ) )->text(); $out->prependHTML( Html::rawElement( -- To view, visit https://gerrit.wikimedia.org/r/354978 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Revert "Upgrade to jQuery v3" until OOjs UI is fully compatible
Jforrester has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354977 ) Change subject: Revert "Upgrade to jQuery v3" until OOjs UI is fully compatible .. Revert "Upgrade to jQuery v3" until OOjs UI is fully compatible This reverts commit 42f5568203dd24b9af9f2d0fba3708c12931c20c. Change-Id: I361cbb973935f080997d0b8569706dd20cf371a0 --- M lib/jquery/jquery.js 1 file changed, 4,701 insertions(+), 4,603 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor refs/changes/77/354977/1 -- To view, visit https://gerrit.wikimedia.org/r/354977 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I361cbb973935f080997d0b8569706dd20cf371a0 Gerrit-PatchSet: 1 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: Jforrester___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: Repair broken skip
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354974 ) Change subject: Repair broken skip .. Repair broken skip Change-Id: Iddfb6628d0c25f55af44844e6ceb56f1ddea7b14 --- M README.md M erfgoedbot/fill_table_monuments_all.py M erfgoedbot/monument_tables.py A erfgoedbot/template/fill_monument_all_wikidata.sql.template R erfgoedbot/template/wikidata_table.sql.template M tests/test_fill_table.py 6 files changed, 22 insertions(+), 7 deletions(-) Approvals: Jean-Frédéric: Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index 461c0de..a4a70e5 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ ``` # Create database tables python erfgoedbot/monument_tables.py -python fill_table_monuments_all.py +python erfgoedbot/fill_table_monuments_all.py # Build and start the Docker containers docker-compose -f docker-compose-bot.yml up --build -d diff --git a/erfgoedbot/fill_table_monuments_all.py b/erfgoedbot/fill_table_monuments_all.py index 68bd3de..2b6c84e 100644 --- a/erfgoedbot/fill_table_monuments_all.py +++ b/erfgoedbot/fill_table_monuments_all.py @@ -262,7 +262,7 @@ @staticmethod def load_wikidata_template_sql(): """Fetch the SQL template for a wikidata config.""" -filename = 'fill_monument_all_wikidata.sql' +filename = 'fill_monument_all_wikidata.sql.template' filepath = os.path.join( MonumentWikidataDatasetSql.get_template_dir(), filename) with open(filepath, 'r') as f: @@ -356,8 +356,6 @@ config_file = os.path.join(config_dir, filename) data = _read_config_from_file(config_file) if not data.get('table').startswith(domain): # skip e.g. wlpa ones -continue -if data.get('type') == 'sparql': # Skip Sparql-based config for now continue datasets.append(monuments_dataset_sql_from_json(data)) return datasets diff --git a/erfgoedbot/monument_tables.py b/erfgoedbot/monument_tables.py index 67ed3c1..15bee1e 100755 --- a/erfgoedbot/monument_tables.py +++ b/erfgoedbot/monument_tables.py @@ -128,7 +128,7 @@ def load_wikidata_template_sql(): """Fetch the SQL template for a wikidata config.""" -filename = 'wikidata_table_template.sql' +filename = 'wikidata_table.sql.template' with open(os.path.join(get_template_dir(), filename), 'r') as f: sql = f.read() return sql diff --git a/erfgoedbot/template/fill_monument_all_wikidata.sql.template b/erfgoedbot/template/fill_monument_all_wikidata.sql.template new file mode 100644 index 000..6b69fb3 --- /dev/null +++ b/erfgoedbot/template/fill_monument_all_wikidata.sql.template @@ -0,0 +1,17 @@ +{dataset} AS `country`, +{lang} AS `lang`, +`id` AS `id`, +{adm0} AS `adm0`, +`name` AS `name`, +`admin` AS `municipality`, +`lat` AS `lat`, +`lon` AS `lon`, +ROUND(`lat` * @granularity) AS `lat_int`, +ROUND(`lon` * @granularity) AS `lon_int`, +`image` AS `image`, +`wd_item` AS `wd_item`, +`commonscat` AS `commonscat`, +`source` AS `source`, +`changed` AS `changed`, +`monument_article` AS `monument_article`, +`registrant_url` AS `registrant_url` diff --git a/erfgoedbot/template/wikidata_table_template.sql b/erfgoedbot/template/wikidata_table.sql.template similarity index 100% rename from erfgoedbot/template/wikidata_table_template.sql rename to erfgoedbot/template/wikidata_table.sql.template diff --git a/tests/test_fill_table.py b/tests/test_fill_table.py index e819d5b..2cc83cf 100644 --- a/tests/test_fill_table.py +++ b/tests/test_fill_table.py @@ -125,7 +125,7 @@ """Return field destinations for a given table in monuments_config.""" key = self.config_lookup[table] dest = [] -for field in config.countries[key]['fields']: +for field in config.countries[key].get('fields', []): dest.append(field['dest']) return dest @@ -134,12 +134,12 @@ msg = '%s in fill_table_monuments_all not present in monuments_config' self.assert_all_in(self.data.keys(), self.config_tables, msg=msg) -@unittest.expectedFailure # remove ASAP def test_fill_table_monuments_all_config_tables_used(self): """Ensure that all monuments_config tables are used.""" msg = '%s in monuments_config not used in fill_table_monuments_all' self.assert_all_in(self.config_tables, self.data.keys(), msg=msg) +@unittest.expectedFailure # @todo fix def test_fill_table_monuments_all_source_in_config(self): """Ensure all sources are present in the corresponding config entry.""" for table, dataset in self.data.iteritems(): -- To view, visit https://gerrit.wikimedia.org/r/354974 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id:
[MediaWiki-commits] [Gerrit] operations/puppet[production]: WIP prometheus::alertmanager
Filippo Giunchedi has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354976 ) Change subject: WIP prometheus::alertmanager .. WIP prometheus::alertmanager Change-Id: I66f5b377ddf8771bb2635d83667ffb9682ad294f --- A modules/prometheus/manifests/alertmanager.pp A modules/prometheus/templates/initscripts/prometheus-alertmanager.systemd.erb 2 files changed, 64 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/76/354976/1 diff --git a/modules/prometheus/manifests/alertmanager.pp b/modules/prometheus/manifests/alertmanager.pp new file mode 100644 index 000..c077167 --- /dev/null +++ b/modules/prometheus/manifests/alertmanager.pp @@ -0,0 +1,53 @@ +# == Define: prometheus::alertmanager +# +# XXX +# +# = Parameters +# +# [*listen_address*] +# Address to listen on, in the form [address]:port. +# +# [*storage_path*] +# Base path for data storage. +# +# [*external_url*] +# The URL under which Alertmanager is externally reachable + +# XXX config file +class prometheus::alertmanager ( +$listen_address = ':9093', +$storage_path = '/var/lib/prometheus/alertmanager/', +$config_file = '/etc/prometheus/alertmanager.yml', +$external_url = undef, +) { +requires_os('debian >= jessie') + +require_package('prometheus-alertmanager') + +$service_name = 'prometheus-alertmanager' + +file { $config_file: +ensure => present, +mode=> '0444', +owner => 'root', +group => 'root', +notify => Exec["${service_name}-reload"], +# XXX +#content => ordered_yaml($prometheus_config), +} + +exec { "{service_name}-reload": +command => "/bin/systemctl reload ${service_name}", +refreshonly => true, +} + +base::service_unit { $service_name: +ensure => present, +systemd=> true, +template_name => 'prometheus-alertmanager', +service_params => { +enable => true, +hasrestart => true, +}, +} +} diff --git a/modules/prometheus/templates/initscripts/prometheus-alertmanager.systemd.erb b/modules/prometheus/templates/initscripts/prometheus-alertmanager.systemd.erb new file mode 100644 index 000..f3789b0 --- /dev/null +++ b/modules/prometheus/templates/initscripts/prometheus-alertmanager.systemd.erb @@ -0,0 +1,11 @@ +[Unit] +Description=Prometheus alertmanager + +[Service] +User=prometheus +ExecStart=/usr/bin/prometheus <% if @external_url != nil %>-web.external-url <%= @external_url %> -storage.path <%= @storage_path %> -config.file <%= @config_file %> +Restart=on-failure +RestartSec=2s +TimeoutStopSec=20s +ExecReload=/bin/kill -HUP $MAINPID +SendSIGKILL=no -- To view, visit https://gerrit.wikimedia.org/r/354976 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I66f5b377ddf8771bb2635d83667ffb9682ad294f Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Filippo Giunchedi___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/puppet[production]: role: set external url for prometheus beta
Filippo Giunchedi has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354975 ) Change subject: role: set external url for prometheus beta .. role: set external url for prometheus beta Change-Id: Ica23dfc02372b0428a645eef69d2f27e19262244 --- M modules/role/manifests/prometheus/beta.pp M modules/role/manifests/prometheus/tools.pp 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/75/354975/1 diff --git a/modules/role/manifests/prometheus/beta.pp b/modules/role/manifests/prometheus/beta.pp index 8da8c25..3d72923 100644 --- a/modules/role/manifests/prometheus/beta.pp +++ b/modules/role/manifests/prometheus/beta.pp @@ -66,6 +66,7 @@ prometheus::server { 'beta': listen_address => '127.0.0.1:9903', +external_url => 'https://beta-prometheus.wmflabs.org/beta', scrape_configs_extra => array_concat($varnish_jobs, $mysql_jobs, $web_jobs, $cassandra_jobs), alertmanager_url => 'http://localhost:9093/am', diff --git a/modules/role/manifests/prometheus/tools.pp b/modules/role/manifests/prometheus/tools.pp index a66e50b..e4ff985 100644 --- a/modules/role/manifests/prometheus/tools.pp +++ b/modules/role/manifests/prometheus/tools.pp @@ -14,6 +14,7 @@ prometheus::server { 'tools': listen_address => '127.0.0.1:9902', +external_url => 'https://tools-prometheus.wmflabs.org/tools', scrape_configs_extra => [ { 'job_name' => 'k8s-api', -- To view, visit https://gerrit.wikimedia.org/r/354975 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ica23dfc02372b0428a645eef69d2f27e19262244 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Filippo Giunchedi___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Add ve.ce.View#initialize to eliminate constructor/onSetup d...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/195236 ) Change subject: Add ve.ce.View#initialize to eliminate constructor/onSetup duplication .. Add ve.ce.View#initialize to eliminate constructor/onSetup duplication initialize() is called on construction and whenever this.$element changes. Change-Id: I45edc12995b75366d3f79657d4f826ddbd36cc4e --- M src/ce/nodes/ve.ce.AlienNode.js M src/ce/nodes/ve.ce.GeneratedContentNode.js M src/ce/nodes/ve.ce.TableCellNode.js M src/ce/ve.ce.BranchNode.js M src/ce/ve.ce.LeafNode.js M src/ce/ve.ce.View.js 6 files changed, 54 insertions(+), 63 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/src/ce/nodes/ve.ce.AlienNode.js b/src/ce/nodes/ve.ce.AlienNode.js index 07fa909..76ec656 100644 --- a/src/ce/nodes/ve.ce.AlienNode.js +++ b/src/ce/nodes/ve.ce.AlienNode.js @@ -28,6 +28,9 @@ ve.ce.FocusableNode.call( this, this.$element, { classes: [ 've-ce-alienNode-highlights' ] } ); + + // Re-initialize after $element changes + this.initialize(); }; /* Inheritance */ diff --git a/src/ce/nodes/ve.ce.GeneratedContentNode.js b/src/ce/nodes/ve.ce.GeneratedContentNode.js index 0ca660e..afbec9d 100644 --- a/src/ce/nodes/ve.ce.GeneratedContentNode.js +++ b/src/ce/nodes/ve.ce.GeneratedContentNode.js @@ -171,6 +171,7 @@ this.$resizable = this.getResizableElement(); } + this.initialize(); if ( this.live ) { this.emit( 'setup' ); } diff --git a/src/ce/nodes/ve.ce.TableCellNode.js b/src/ce/nodes/ve.ce.TableCellNode.js index 7ba38a7..46fbc5e 100644 --- a/src/ce/nodes/ve.ce.TableCellNode.js +++ b/src/ce/nodes/ve.ce.TableCellNode.js @@ -15,35 +15,12 @@ * @param {Object} [config] Configuration options */ ve.ce.TableCellNode = function VeCeTableCellNode() { - var rowspan, colspan; - // Parent constructor ve.ce.TableCellNode.super.apply( this, arguments ); // Mixin constructors ve.ce.TableCellableNode.call( this ); ve.ce.ContentEditableNode.call( this ); - - rowspan = this.model.getRowspan(); - colspan = this.model.getColspan(); - - // DOM changes - this.$element - // The following classes can be used here: - // ve-ce-tableCellNode-data - // ve-ce-tableCellNode-header - .addClass( 've-ce-tableCellNode ve-ce-tableCellNode-' + this.model.getAttribute( 'style' ) ); - - // Set attributes (keep in sync with #onSetup) - if ( rowspan > 1 ) { - this.$element.attr( 'rowspan', rowspan ); - } - if ( colspan > 1 ) { - this.$element.attr( 'colspan', colspan ); - } - - // Add tooltip - this.$element.attr( 'title', ve.msg( 'visualeditor-tablecell-tooltip' ) ); // Events this.model.connect( this, { @@ -66,6 +43,37 @@ /* Methods */ /** + * @inheritdoc + */ +ve.ce.TableCellNode.prototype.initialize = function () { + var rowspan, colspan; + + // Parent method + ve.ce.TableCellNode.super.prototype.initialize.call( this ); + + rowspan = this.model.getRowspan(); + colspan = this.model.getColspan(); + + // DOM changes + this.$element + // The following classes can be used here: + // ve-ce-tableCellNode-data + // ve-ce-tableCellNode-header + .addClass( 've-ce-tableCellNode ve-ce-tableCellNode-' + this.model.getAttribute( 'style' ) ); + + // Set attributes (keep in sync with #onSetup) + if ( rowspan > 1 ) { + this.$element.attr( 'rowspan', rowspan ); + } + if ( colspan > 1 ) { + this.$element.attr( 'colspan', colspan ); + } + + // Add tooltip + this.$element.attr( 'title', ve.msg( 'visualeditor-tablecell-tooltip' ) ); +}; + +/** * Set the editing mode of a table cell node * * @param {boolean} enable Enable editing @@ -85,29 +93,6 @@ */ ve.ce.TableCellNode.prototype.onUpdate = function () { this.updateTagName(); -}; - -/** - * @inheritdoc - */ -ve.ce.TableCellNode.prototype.onSetup = function () { - var rowspan, colspan; - // Parent method - ve.ce.TableCellNode.super.prototype.onSetup.call( this ); - - rowspan = this.model.getRowspan(); - colspan = this.model.getColspan(); - // Set attributes (duplicated from constructor in case this.$element is replaced) - if ( rowspan > 1 ) { - this.$element.attr( 'rowspan', rowspan ); - } else { - this.$element.removeAttr( 'rowspan' ); - } - if ( colspan > 1 ) { - this.$element.attr( 'colspan', colspan ); - } else { - this.$element.removeAttr( 'colspan' ); - } }; /**
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Render HTML attributes in ce.View#initialize rather than in ...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/195238 ) Change subject: Render HTML attributes in ce.View#initialize rather than in the constructor .. Render HTML attributes in ce.View#initialize rather than in the constructor This means that when this.$element is changed, miscellaneous attributes aren't removed any more. For instance, if a table cell has style="background: red;" and the user changes it to a heading cell, the red background will no longer disappear. (It already didn't disappear in the final version that ends up being saved, but until now the rendering lied and didn't show the red background.) Change-Id: Ib552bd1e124f1bc932454fda07056d4979925b9e --- M src/ce/ve.ce.View.js 1 file changed, 14 insertions(+), 15 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/src/ce/ve.ce.View.js b/src/ce/ve.ce.View.js index ec14cf2..71e32b5 100644 --- a/src/ce/ve.ce.View.js +++ b/src/ce/ve.ce.View.js @@ -36,21 +36,6 @@ teardown: 'onTeardown' } ); - if ( this.model.element && this.model.element.originalDomElementsIndex !== undefined ) { - // Render attributes from original DOM elements - ve.dm.Converter.static.renderHtmlAttributeList( - this.model.getOriginalDomElements( this.model.getStore() ), - this.$element, - this.constructor.static.renderHtmlAttributes, - // computed attributes - true, - // deep - !( this.model instanceof ve.dm.Node ) || - !this.model.canHaveChildren() || - this.model.handlesOwnChildren() - ); - } - // Initialize this.initialize(); }; @@ -121,6 +106,20 @@ * this.$element is replaced. */ ve.ce.View.prototype.initialize = function () { + if ( this.model.element && this.model.element.originalDomElementsIndex !== undefined ) { + // Render attributes from original DOM elements + ve.dm.Converter.static.renderHtmlAttributeList( + this.model.getOriginalDomElements( this.model.getStore() ), + this.$element, + this.constructor.static.renderHtmlAttributes, + // computed attributes + true, + // deep + !( this.model instanceof ve.dm.Node ) || + !this.model.canHaveChildren() || + this.model.handlesOwnChildren() + ); + } }; /** -- To view, visit https://gerrit.wikimedia.org/r/195238 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib552bd1e124f1bc932454fda07056d4979925b9e Gerrit-PatchSet: 5 Gerrit-Project: VisualEditor/VisualEditor Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: DLynch Gerrit-Reviewer: Esanders Gerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Use random label when testing grammatical features.
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354947 ) Change subject: Use random label when testing grammatical features. .. Use random label when testing grammatical features. This changes the browser test from adding a grammatical feature with a fixed label to using random labels. Aside from being more generic this also prevents the test from failing locally when re-running it due to the duplicate item check. Change-Id: I95a44ca405a8c910fa5766e86542f8320e64e406 --- M tests/browser/features/forms.feature M tests/browser/features/step_definitions/forms_steps.rb M tests/browser/features/support/env.rb 3 files changed, 8 insertions(+), 8 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/tests/browser/features/forms.feature b/tests/browser/features/forms.feature index 4b9501e..5a216c8 100644 --- a/tests/browser/features/forms.feature +++ b/tests/browser/features/forms.feature @@ -21,11 +21,11 @@ Scenario: Add grammatical feature Given I have a Lexeme with a Form And I am on the page of the Lexeme to test - And I have an item with label "Plural" and description "Plural" + And I have an item to test When I click on first Form's edit button - And I select "Plural" as the grammatical feature + And I select the test item as the grammatical feature And I save the first Form -Then I should see "Plural" in the list of grammatical features +Then I should see the item's label in the list of grammatical features @integration Scenario: Add Form diff --git a/tests/browser/features/step_definitions/forms_steps.rb b/tests/browser/features/step_definitions/forms_steps.rb index bf9dda3..4804829 100644 --- a/tests/browser/features/step_definitions/forms_steps.rb +++ b/tests/browser/features/step_definitions/forms_steps.rb @@ -64,9 +64,9 @@ on(LexemePage).lexeme_first_form_edit_element.when_visible.click end -When(/^I select "(.*?)" as the grammatical feature$/) do |feature| +When(/^I select the test item as the grammatical feature$/) do on(LexemePage) do |page| -page.grammatical_feature_input_element.send_keys(feature) +page.grammatical_feature_input_element.send_keys(@item_under_test['label']) page.grammatical_feature_selection_first_option_element.when_visible.click end end @@ -75,9 +75,8 @@ on(LexemePage).lexeme_first_form_save_element.when_visible.click end -Then(/^I should see "(.*?)" in the list of grammatical features$/) do |feature| +Then(/^I should see the item's label in the list of grammatical features$/) do Watir::Wait.until(timeout = 5) do -on(LexemePage).first_form_grammatical_features_element.text.include? feature +on(LexemePage).first_form_grammatical_features_element.text.include? @item_under_test['label'] end - end diff --git a/tests/browser/features/support/env.rb b/tests/browser/features/support/env.rb index f66d030..b6907e7 100644 --- a/tests/browser/features/support/env.rb +++ b/tests/browser/features/support/env.rb @@ -17,4 +17,5 @@ require_all File.dirname(__FILE__) + '/../../../../../Wikibase/tests/browser/features/support/modules' require_all File.dirname(__FILE__) + '/../../../../../Wikibase/tests/browser/features/step_definitions' require_all File.dirname(__FILE__) + '/pages' +require_all File.dirname(__FILE__) + '/../../../../../Wikibase/tests/browser/features/support/utils' require File.dirname(__FILE__) + '/../../../../../Wikibase/tests/browser/features/support/pages/item_page' -- To view, visit https://gerrit.wikimedia.org/r/354947 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95a44ca405a8c910fa5766e86542f8320e64e406 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseLexeme Gerrit-Branch: master Gerrit-Owner: JakobGerrit-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] translatewiki[master]: Maintenance for email aliases
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354969 ) Change subject: Maintenance for email aliases .. Maintenance for email aliases Change-Id: I584e00999357ae041a036ed0ffbb589ebba771be --- M puppet/modules/users/files/aliases 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: jenkins-bot: Verified Nikerabbit: Looks good to me, approved diff --git a/puppet/modules/users/files/aliases b/puppet/modules/users/files/aliases index 088bd27..f430433 100644 --- a/puppet/modules/users/files/aliases +++ b/puppet/modules/users/files/aliases @@ -18,12 +18,10 @@ root: siebr...@kitano.nl, niklas.laxst...@gmail.com amir: amir.ahar...@mail.huji.ac.il -lcawte: le...@lewiscawte.info -mah: m...@everybody.org nike: niklas.laxst...@gmail.com raymond: raimond.spekk...@gmail.com siebrand: siebr...@kitano.nl -translatewiki: siebr...@kitano.nl +translatewiki: siebr...@kitano.nl, niklas.laxst...@gmail.com federico: federicol...@tiscali.it blockly: siebr...@kitano.nl -- To view, visit https://gerrit.wikimedia.org/r/354969 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I584e00999357ae041a036ed0ffbb589ebba771be Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: SiebrandGerrit-Reviewer: Nikerabbit Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: Repair broken skip
Lokal Profil has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354974 ) Change subject: Repair broken skip .. Repair broken skip Change-Id: Iddfb6628d0c25f55af44844e6ceb56f1ddea7b14 --- M README.md M erfgoedbot/fill_table_monuments_all.py M tests/test_fill_table.py 3 files changed, 3 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage refs/changes/74/354974/1 diff --git a/README.md b/README.md index 461c0de..a4a70e5 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ ``` # Create database tables python erfgoedbot/monument_tables.py -python fill_table_monuments_all.py +python erfgoedbot/fill_table_monuments_all.py # Build and start the Docker containers docker-compose -f docker-compose-bot.yml up --build -d diff --git a/erfgoedbot/fill_table_monuments_all.py b/erfgoedbot/fill_table_monuments_all.py index 68bd3de..c97e4de 100644 --- a/erfgoedbot/fill_table_monuments_all.py +++ b/erfgoedbot/fill_table_monuments_all.py @@ -357,8 +357,6 @@ data = _read_config_from_file(config_file) if not data.get('table').startswith(domain): # skip e.g. wlpa ones continue -if data.get('type') == 'sparql': # Skip Sparql-based config for now -continue datasets.append(monuments_dataset_sql_from_json(data)) return datasets diff --git a/tests/test_fill_table.py b/tests/test_fill_table.py index e819d5b..2cc83cf 100644 --- a/tests/test_fill_table.py +++ b/tests/test_fill_table.py @@ -125,7 +125,7 @@ """Return field destinations for a given table in monuments_config.""" key = self.config_lookup[table] dest = [] -for field in config.countries[key]['fields']: +for field in config.countries[key].get('fields', []): dest.append(field['dest']) return dest @@ -134,12 +134,12 @@ msg = '%s in fill_table_monuments_all not present in monuments_config' self.assert_all_in(self.data.keys(), self.config_tables, msg=msg) -@unittest.expectedFailure # remove ASAP def test_fill_table_monuments_all_config_tables_used(self): """Ensure that all monuments_config tables are used.""" msg = '%s in monuments_config not used in fill_table_monuments_all' self.assert_all_in(self.config_tables, self.data.keys(), msg=msg) +@unittest.expectedFailure # @todo fix def test_fill_table_monuments_all_source_in_config(self): """Ensure all sources are present in the corresponding config entry.""" for table, dataset in self.data.iteritems(): -- To view, visit https://gerrit.wikimedia.org/r/354974 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iddfb6628d0c25f55af44844e6ceb56f1ddea7b14 Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/heritage Gerrit-Branch: wikidata Gerrit-Owner: Lokal Profil___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseQualityConstraints[master]: Use eslint to lint JavaScript instead of jscs and jshint
WMDE-leszek has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354973 ) Change subject: Use eslint to lint JavaScript instead of jscs and jshint .. Use eslint to lint JavaScript instead of jscs and jshint Bug: T165843 Change-Id: Icd63270c78558582d2dd23d3449f6cee2b359a53 --- R .eslintignore A .eslintrc.json M Gruntfile.js M package.json 4 files changed, 20 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints refs/changes/73/354973/1 diff --git a/.jshintignore b/.eslintignore similarity index 100% rename from .jshintignore rename to .eslintignore diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000..15268a4 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,12 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + }, + "rules": { + "keyword-spacing": "off", + "space-before-function-paren": "off", + "wrap-iife": "off" + } +} diff --git a/Gruntfile.js b/Gruntfile.js index c160c4d..10f645a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,24 +1,14 @@ -/* jshint node: true, strict: false */ +/* eslint-env node */ + module.exports = function ( grunt ) { - grunt.loadNpmTasks( 'grunt-contrib-jshint' ); - grunt.loadNpmTasks( 'grunt-jscs' ); + grunt.loadNpmTasks( 'grunt-eslint' ); grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.loadNpmTasks( 'grunt-banana-checker' ); grunt.loadNpmTasks( 'grunt-stylelint' ); grunt.initConfig( { - jshint: { - options: { - jshintrc: true - }, - all: [ - '**/*.js', - '!node_modules/**', - '!vendor/**' - ] - }, - jscs: { - src: '<%= jshint.all %>' + eslint: { + all: '.' }, banana: { options: { @@ -44,5 +34,5 @@ } } ); - grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana', 'stylelint' ] ); + grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'stylelint' ] ); }; diff --git a/package.json b/package.json index 1a603b4..fe2116f 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,11 @@ "author": "BP2014N1", "license": "GPL-2.0+", "devDependencies": { + "eslint-config-wikimedia": "0.4.0", "grunt": "1.0.1", "grunt-banana-checker": "0.3.0", "grunt-jsonlint": "1.1.0", - "grunt-contrib-jshint": "0.11.3", - "grunt-jscs": "2.1.0", + "grunt-eslint": "19.0.0", "grunt-stylelint": "0.6.0", "stylelint-config-wikimedia": "0.4.1" } -- To view, visit https://gerrit.wikimedia.org/r/354973 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icd63270c78558582d2dd23d3449f6cee2b359a53 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints 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...pybal[master]: Add unit tests for the Origin and BaseASPath BGP attributes
Ema has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354972 ) Change subject: Add unit tests for the Origin and BaseASPath BGP attributes .. Add unit tests for the Origin and BaseASPath BGP attributes Change-Id: I5e0c0b6213251bc71fa59195c140dda6ead802c6 --- A pybal/test/test_bgp.py 1 file changed, 28 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal refs/changes/72/354972/1 diff --git a/pybal/test/test_bgp.py b/pybal/test/test_bgp.py new file mode 100644 index 000..fc442e7 --- /dev/null +++ b/pybal/test/test_bgp.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +""" + PyBal unit tests + + + This module contains tests for `pybal.bgp`. + +""" + +import pybal +import pybal.config +import pybal.bgp + +from .fixtures import PyBalTestCase + + +class AttributeTestCase(PyBalTestCase): + +def testOriginAttribute(self): +attr = pybal.bgp.OriginAttribute() +self.assertFalse(attr.optional) +self.assertTrue(attr.transitive) +self.assertEquals(attr.value, attr.ORIGIN_IGP) + +def testBaseASPathAttribute(self): +attr = pybal.bgp.BaseASPathAttribute() +self.assertEquals(attr.value, [(2, [])]) + -- To view, visit https://gerrit.wikimedia.org/r/354972 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5e0c0b6213251bc71fa59195c140dda6ead802c6 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/pybal Gerrit-Branch: master 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]: Make controller responsible for switching lexemeformview to ...
Aleksey Bekh-Ivanov (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354971 ) Change subject: Make controller responsible for switching lexemeformview to edit mode .. Make controller responsible for switching lexemeformview to edit mode Bug: T165481 Change-Id: I6da917929ac7703a09f5e7f4798658712af0a19d --- M resources/jquery.wikibase.grammaticalfeatureview.js M resources/jquery.wikibase.lexemeformlistview.js M resources/jquery.wikibase.lexemeformview.js M resources/view/ControllerViewFactory.js 4 files changed, 16 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme refs/changes/71/354971/1 diff --git a/resources/jquery.wikibase.grammaticalfeatureview.js b/resources/jquery.wikibase.grammaticalfeatureview.js index efeb6ff..178dfaa 100644 --- a/resources/jquery.wikibase.grammaticalfeatureview.js +++ b/resources/jquery.wikibase.grammaticalfeatureview.js @@ -46,9 +46,6 @@ _create: function () { PARENT.prototype._create.call( this ); this._labelFormattingService = this.options.labelFormattingService; - if ( !this.value() ) { - this.startEditing(); - } }, _startEditing: function () { this._inEditMode = true; diff --git a/resources/jquery.wikibase.lexemeformlistview.js b/resources/jquery.wikibase.lexemeformlistview.js index f06d4ed..5685dc4 100644 --- a/resources/jquery.wikibase.lexemeformlistview.js +++ b/resources/jquery.wikibase.lexemeformlistview.js @@ -59,9 +59,9 @@ _createListView: function () { this._listview = new $.wikibase.listview( { listItemAdapter: this.options.getListItemAdapter( this._removeItem.bind( this ) ), - listItemNodeName: 'div' + listItemNodeName: 'div', + value: this.options.value }, this.element.find( '.wikibase-lexeme-forms' ) ); - }, /** diff --git a/resources/jquery.wikibase.lexemeformview.js b/resources/jquery.wikibase.lexemeformview.js index 1b10d68..d6ea5ef 100644 --- a/resources/jquery.wikibase.lexemeformview.js +++ b/resources/jquery.wikibase.lexemeformview.js @@ -70,10 +70,6 @@ _create: function () { PARENT.prototype._create.call( this ); this._grammaticalFeatureView = this._buildGrammaticalFeatureView(); - - if ( !this.value() ) { - this.startEditing(); - } }, _buildGrammaticalFeatureView: function buildGrammaticalFeatureView() { var self = this; diff --git a/resources/view/ControllerViewFactory.js b/resources/view/ControllerViewFactory.js index 2c8f108..d07567d 100644 --- a/resources/view/ControllerViewFactory.js +++ b/resources/view/ControllerViewFactory.js @@ -56,43 +56,48 @@ buildEntityTermsView: this.getEntityTermsView.bind( this, startEditingCallback ), buildSitelinkGroupListView: this.getSitelinkGroupListView.bind( this, startEditingCallback ), buildStatementGroupListView: this.getStatementGroupListView.bind( this, startEditingCallback ), - buildLexemeFormListView: this.getLexemeFormListView.bind( this, startEditingCallback ), + buildLexemeFormListView: this.getLexemeFormListView.bind( this, entity, startEditingCallback ), value: entity } ); }; - SELF.prototype.getLexemeFormListView = function ( startEditingCallback ) { + SELF.prototype.getLexemeFormListView = function ( lexeme, startEditingCallback ) { return this._getView( 'lexemeformlistview', $( '.wikibase-lexeme-forms-section' ), { getListItemAdapter: this.getListItemAdapterForLexemeFormListView.bind( this, startEditingCallback ), - getAdder: this._getAdderWithStartEditing( startEditingCallback ) + getAdder: this._getAdderWithStartEditing( startEditingCallback ), + value: lexeme.forms } ); }; - SELF.prototype.getLexemeFormView = function ( value, labelFormattingService, $dom, startEditingCallback, removeCallback ) { + SELF.prototype.getLexemeFormView = function ( form, labelFormattingService, $dom, startEditingCallback,
[MediaWiki-commits] [Gerrit] mediawiki...TwoColConflict[master]: Remove min-width around filter options
WMDE-Fisch has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354970 ) Change subject: Remove min-width around filter options .. Remove min-width around filter options Change-Id: Ibf71547317ae764264b21f7fc6b8dfc65e374fc5 --- M modules/ext.TwoColConflict.less 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwoColConflict refs/changes/70/354970/1 diff --git a/modules/ext.TwoColConflict.less b/modules/ext.TwoColConflict.less index e47de99..0d7f7bd 100644 --- a/modules/ext.TwoColConflict.less +++ b/modules/ext.TwoColConflict.less @@ -261,7 +261,6 @@ .mw-twocolconflict-filter-titles { font-weight: bold; - min-width: 150px; } .mw-twocolconflict-filter-options-btn .oo-ui-fieldLayout { @@ -270,6 +269,5 @@ } .mw-twocolconflict-filter-options-btn.oo-ui-radioSelectInputWidget .oo-ui-fieldLayout .oo-ui-fieldLayout-body { - min-width: 120px; padding: 0 0.25em; } -- To view, visit https://gerrit.wikimedia.org/r/354970 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf71547317ae764264b21f7fc6b8dfc65e374fc5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TwoColConflict Gerrit-Branch: master Gerrit-Owner: WMDE-Fisch___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: PHP7: Use intval to baseconvert instead of string casting
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354964 ) Change subject: PHP7: Use intval to baseconvert instead of string casting .. PHP7: Use intval to baseconvert instead of string casting PHP7 and later no longer automatically casts strings containing hexadecimal numbers to actual numbers when trying to do math on them. Use intval with base 16 instead. Bug: T160536 Change-Id: Idc8e030847d80275df22877df09234b4e248cded --- M handlers/OggHandler/File_Ogg/File/Ogg/Flac.php M handlers/OggHandler/File_Ogg/File/Ogg/Opus.php M handlers/OggHandler/File_Ogg/File/Ogg/Speex.php M handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php 4 files changed, 10 insertions(+), 10 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php b/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php index bf98d60..d19fd01 100644 --- a/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php +++ b/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php @@ -65,8 +65,8 @@ } function getSecondsFromGranulePos( $granulePos ){ -return (( '0x' . substr( $granulePos, 0, 8 ) ) * pow(2, 32) - + ( '0x' . substr( $granulePos, 8, 8 ) )) +return (intval(substr( $granulePos, 0, 8 ), 16 ) * pow(2, 32) + + intval(substr( $granulePos, 8, 8 ), 16 )) / $this->_streamInfo['sample_rate']; } diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php b/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php index 2c23d92..9066f0b 100644 --- a/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php +++ b/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php @@ -57,8 +57,8 @@ } function getSecondsFromGranulePos( $granulePos ){ -return (( '0x' . substr( $granulePos, 0, 8 ) ) * pow(2, 32) -+ ( '0x' . substr( $granulePos, 8, 8 ) ) +return (intval(substr( $granulePos, 0, 8 ), 16 ) * pow(2, 32) ++ intval(substr( $granulePos, 8, 8 ), 16 ) - $this->_header['pre_skip']) / 48000; } diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php b/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php index 42f9b0e..6398ed9 100644 --- a/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php +++ b/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php @@ -43,13 +43,13 @@ $this->_decodeHeader(); $this->_decodeCommentsHeader(); $endSec = -(( '0x' . substr( $this->_lastGranulePos, 0, 8 ) ) * pow(2, 32) -+ ( '0x' . substr( $this->_lastGranulePos, 8, 8 ) )) +(intval(substr( $this->_lastGranulePos, 0, 8 ), 16 ) * pow(2, 32) ++ intval(substr( $this->_lastGranulePos, 8, 8 ), 16 )) / $this->_header['rate']; $startSec = -(( '0x' . substr( $this->_firstGranulePos, 0, 8 ) ) * pow(2, 32) -+ ( '0x' . substr( $this->_firstGranulePos, 8, 8 ) )) +(intval(substr( $this->_firstGranulePos, 0, 8 ), 16 ) * pow(2, 32) ++ intval(substr( $this->_firstGranulePos, 8, 8 ), 16 )) / $this->_header['rate']; //make sure the offset is worth taking into account oggz_chop related hack diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php b/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php index 06c2c18..8d4510c 100644 --- a/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php +++ b/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php @@ -185,8 +185,8 @@ $this->_avgBitrate = $this->_streamLength ? ($this->_streamSize * 8) / $this->_streamLength : 0; } function getSecondsFromGranulePos( $granulePos ){ - return (( '0x' . substr( $granulePos, 0, 8 ) ) * pow(2, 32) -+ ( '0x' . substr( $granulePos, 8, 8 ) )) + return (intval(substr( $granulePos, 0, 8 ), 16) * pow(2, 32) ++ intval( substr( $granulePos, 8, 8 ), 16 )) / $this->_idHeader['audio_sample_rate']; } /** -- To view, visit https://gerrit.wikimedia.org/r/354964 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idc8e030847d80275df22877df09234b4e248cded Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Brion VIBBER 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]: Maintenance for email aliases
Siebrand has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354969 ) Change subject: Maintenance for email aliases .. Maintenance for email aliases Change-Id: I584e00999357ae041a036ed0ffbb589ebba771be --- M puppet/modules/users/files/aliases 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/69/354969/1 diff --git a/puppet/modules/users/files/aliases b/puppet/modules/users/files/aliases index 088bd27..f430433 100644 --- a/puppet/modules/users/files/aliases +++ b/puppet/modules/users/files/aliases @@ -18,12 +18,10 @@ root: siebr...@kitano.nl, niklas.laxst...@gmail.com amir: amir.ahar...@mail.huji.ac.il -lcawte: le...@lewiscawte.info -mah: m...@everybody.org nike: niklas.laxst...@gmail.com raymond: raimond.spekk...@gmail.com siebrand: siebr...@kitano.nl -translatewiki: siebr...@kitano.nl +translatewiki: siebr...@kitano.nl, niklas.laxst...@gmail.com federico: federicol...@tiscali.it blockly: siebr...@kitano.nl -- To view, visit https://gerrit.wikimedia.org/r/354969 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I584e00999357ae041a036ed0ffbb589ebba771be Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Only add the resolution switcher to video files
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354736 ) Change subject: Only add the resolution switcher to video files .. Only add the resolution switcher to video files Adding this button is problematic, since we don't really need it in audio players, and the module also wasn't compatible with audio only files. Change-Id: Ie90a16187d7c7fc5181a9b5a2963c3939f97668b --- M resources/ext.tmh.player.js 1 file changed, 23 insertions(+), 19 deletions(-) Approvals: jenkins-bot: Verified TheDJ: Looks good to me, approved diff --git a/resources/ext.tmh.player.js b/resources/ext.tmh.player.js index 8e6f054..77ab011 100755 --- a/resources/ext.tmh.player.js +++ b/resources/ext.tmh.player.js @@ -1,6 +1,6 @@ /* global videojs */ ( function ( $, mw, videojs ) { - var globalConfig, audioConfig, playerConfig; + var globalConfig, videoConfig, audioConfig, playerConfig; globalConfig = { language: mw.config.get( 'wgUserLanguage' ), @@ -13,17 +13,6 @@ }, techOrder: [ 'html5' ], plugins: { - videoJsResolutionSwitcher: { - sourceOrder: true, - customSourcePicker: function ( player, sources/* , label */ ) { - // Resolution switcher gets confused by preload=none on ogv.js - if ( player.preload() === 'none' ) { - player.preload( 'metadata' ); - } - player.src( sources ); - return player; - } - }, responsiveLayout: { layoutMap: [ { layoutClassName: 'vjs-layout-tiny', width: 3 }, @@ -34,6 +23,22 @@ }, replayButton: {}, infoButton: {} + } + }; + + videoConfig = { + plugins: { + videoJsResolutionSwitcher: { + sourceOrder: true, + customSourcePicker: function ( player, sources/* , label */ ) { + // Resolution switcher gets confused by preload=none on ogv.js + if ( player.preload() === 'none' ) { + player.preload( 'metadata' ); + } + player.src( sources ); + return player; + } + } } }; @@ -52,18 +57,17 @@ function loadSinglePlayer( index ) { var i, l, preload, resolutions, playerHeight, defaultRes, videoplayer = this, - $videoplayer = $( this ); + $videoplayer = $( this ), + isAudio = videoplayer.tagName.toLowerCase() === 'audio'; if ( $videoplayer.closest( '.video-js' ).length ) { // This player has already been transformed. return; } + playerConfig = $.extend( {}, globalConfig ); - if ( videoplayer.tagName.toLowerCase() === 'audio' ) { - // We hide the big play button, show the controlbar with CSS - // We remove the fullscreen button - playerConfig = $.extend( true, {}, playerConfig, audioConfig ); - } + playerConfig = $.extend( true, {}, playerConfig, isAudio ? audioConfig : videoConfig ); + // Future interactions go faster if we've preloaded a little preload = 'metadata'; if ( !mw.OgvJsSupport.canPlayNatively() ) { @@ -117,7 +121,7 @@ break; } } - if ( defaultRes ) { + if ( !isAudio && defaultRes ) { playerConfig.plugins.videoJsResolutionSwitcher[ 'default' ] = defaultRes; } -- To view, visit https://gerrit.wikimedia.org/r/354736 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie90a16187d7c7fc5181a9b5a2963c3939f97668b Gerrit-PatchSet: 1 Gerrit-Project:
[MediaWiki-commits] [Gerrit] pywikibot/core[master]: Introduce the new WbUnknown data type for Wikibase This can ...
Multichill has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354968 ) Change subject: Introduce the new WbUnknown data type for Wikibase This can be used later to store claims with an unknown data type. .. Introduce the new WbUnknown data type for Wikibase This can be used later to store claims with an unknown data type. Bug: T165961 Change-Id: Ib65eb0f34cffa3c058c4e01ff79c145002310b2a --- M pywikibot/__init__.py M tests/wikibase_tests.py 2 files changed, 67 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/68/354968/1 diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index 8a1ea57..f5637b0 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -1024,6 +1024,47 @@ return cls(page, site) +class WbUnknown(_WbRepresentation): +""" +A Wikibase representation for unknown data type. +This will prevent the bot from breaking completely when a new type +is introduced. + +This data type is just a json container +""" + +_items = ('json') + +def __init__(self, json): +""" +Create a new WbUnknown object. + +@param json: Wikibase JSON +@type: dict +""" +self.json = json + +def toWikibase(self): +""" +Return the JSON object for the Wikibase API. + +@return: Wikibase JSON +@rtype: dict +""" +return self.json + +@classmethod +def fromWikibase(cls, json): +""" +Create a WbUnknown from the JSON data given by the Wikibase API. + +@param json: Wikibase JSON +@type json: dict +@rtype: pywikibot.WbUnknown +""" +return cls(json) + + _sites = {} _url_cache = {} # The code/fam pair for each URL diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py index d66a9d9..32138bb 100644 --- a/tests/wikibase_tests.py +++ b/tests/wikibase_tests.py @@ -746,6 +746,32 @@ non_map_page, self.get_repo()) +class TestWbUnknown(WikidataTestCase): + +"""Test Wikibase WbUnknown data type.""" + +dry = True + +def test_WbUnknown_string(self): +"""Test WbUnknown string.""" +q_dict = {'text': 'Test that basics work', 'language': 'en'} +q = pywikibot.WbUnknown(q_dict) +self.assertEqual(q.toWikibase(), q_dict) + +def test_WbUnknown_equality(self): +"""Test WbUnknown equality.""" +q_dict = {'text': 'Thou shall test this!', 'language': 'unknown'} +q = pywikibot.WbUnknown(q_dict) +self.assertEqual(q, q) + +def test_WbUnknown_fromWikibase(self): +"""Test WbUnknown.fromWikibase() instantiating.""" +q = pywikibot.WbUnknown.fromWikibase({'text': 'Test this!', + 'language': u'en'}) +self.assertEqual(q.toWikibase(), + {'text': 'Test this!', 'language': 'en'}) + + class TestItemPageExtensibility(TestCase): """Test ItemPage extensibility.""" -- To view, visit https://gerrit.wikimedia.org/r/354968 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib65eb0f34cffa3c058c4e01ff79c145002310b2a Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Multichill___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Simple tree query visualization
Jonas Kress (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354967 ) Change subject: Simple tree query visualization .. Simple tree query visualization Bug: T152676 Change-Id: I35ec03fe15d61a462f7aa47b3aa5f0f89428d80f --- M index.html M package.json M wikibase/queryService/ui/App.js M wikibase/queryService/ui/editor/hint/Sparql.js A wikibase/queryService/ui/resultBrowser/TreeResultBrowser.js M wikibase/tests/index.html M wikibase/tests/queryService/ui/resultBrowser/ResultBrowser.test.js 7 files changed, 146 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui refs/changes/67/354967/1 diff --git a/index.html b/index.html index ea28bea..72be0f6 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ - + @@ -258,6 +258,7 @@ + @@ -283,6 +284,7 @@ + diff --git a/package.json b/package.json index 8a9c4e6..4cc827f 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "jquery.i18n": "git+https://github.com/wikimedia/jquery.i18n.git;, "jquery.uls": "git+https://github.com/wikimedia/jquery.uls.git;, "js-cookie": "^2.1.2", +"jstree": "^3.3.4", "leaflet": "~1.0.0", "leaflet-fullscreen": "^1.0.1", "leaflet-zoombox": "^0.2.0", diff --git a/wikibase/queryService/ui/App.js b/wikibase/queryService/ui/App.js index 8df42df..df100e3 100644 --- a/wikibase/queryService/ui/App.js +++ b/wikibase/queryService/ui/App.js @@ -168,6 +168,13 @@ object: null, $element: null }, + Tree: { + icon: 'fa-tree', + label: 'Tree', + class: 'TreeResultBrowser', + object: null, + $element: null + }, Timeline: { icon: 'glyphicon-calendar', label: 'Timeline', diff --git a/wikibase/queryService/ui/editor/hint/Sparql.js b/wikibase/queryService/ui/editor/hint/Sparql.js index 122f2b0..7ead0ce 100755 --- a/wikibase/queryService/ui/editor/hint/Sparql.js +++ b/wikibase/queryService/ui/editor/hint/Sparql.js @@ -18,7 +18,7 @@ 'FILTER ()', 'FILTER NOT EXISTS', 'FILTER NOT EXISTS {\n\n}', 'UNION', 'UNION {\n\n}', 'BIND', 'BIND ()', 'GROUP_CONCAT', '(GROUP_CONCAT() as )', 'ORDER BY', '#defaultView:Map', '#defaultView:ImageGrid', '#defaultView:Map', '#defaultView:BubbleChart', - '#defaultView:TreeMap', '#defaultView:Timeline', '#defaultView:Dimensions', '#defaultView:Graph', '#defaultView:LineChart', '#defaultView:BarChart', '#defaultView:ScatterChart', '#defaultView:AreaChart', + '#defaultView:TreeMap', '#defaultView:Tree', '#defaultView:Timeline', '#defaultView:Dimensions', '#defaultView:Graph', '#defaultView:LineChart', '#defaultView:BarChart', '#defaultView:ScatterChart', '#defaultView:AreaChart', 'SERVICE wikibase:around {\n\t?place wdt:P625 ?location.\n\tbd:serviceParam wikibase:center ? .\n\tbd:serviceParam wikibase:radius ? .\n\tbd:serviceParam wikibase:distance ?dist.\n}', 'SERVICE wikibase:box {\n\t?place wdt:P625 ?location.\n\tbd:serviceParam wikibase:cornerWest ? .\n\tbd:serviceParam wikibase:cornerEast ? .\n}', 'hint:Query hint:optimizer "None".', diff --git a/wikibase/queryService/ui/resultBrowser/TreeResultBrowser.js b/wikibase/queryService/ui/resultBrowser/TreeResultBrowser.js new file mode 100644 index 000..0e25125 --- /dev/null +++ b/wikibase/queryService/ui/resultBrowser/TreeResultBrowser.js @@ -0,0 +1,127 @@ +var wikibase = wikibase || {}; +wikibase.queryService = wikibase.queryService || {}; +wikibase.queryService.ui = wikibase.queryService.ui || {}; +wikibase.queryService.ui.resultBrowser = wikibase.queryService.ui.resultBrowser || {}; + +wikibase.queryService.ui.resultBrowser.TreeResultBrowser = ( function( $, d3, window ) { + 'use strict'; + + /** +* A tree result browser +* +* @class wikibase.queryService.ui.resultBrowser.TreeResultBrowser +* @license GNU GPL v2+ +* +* @author Jonas Kress +* +* @constructor +*/ + function SELF() { + this._labelColumns = {}; + } + + SELF.prototype = new wikibase.queryService.ui.resultBrowser.AbstractChartResultBrowser(); + + /** +* @property {Object} +* @private +**/ + SELF.prototype._labelColumns = null; + + /** +* Draw browser to the given element +* @param {jQuery} $element to draw at +**/
[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: Create fill monuments_all sql for wikidata configs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354938 ) Change subject: Create fill monuments_all sql for wikidata configs .. Create fill monuments_all sql for wikidata configs Bug: T165932 Change-Id: Ib0baa9d0837bddf7c12577c531cbddd54424a63a --- M erfgoedbot/fill_table_monuments_all.py 1 file changed, 83 insertions(+), 6 deletions(-) Approvals: Jean-Frédéric: Looks good to me, approved jenkins-bot: Verified diff --git a/erfgoedbot/fill_table_monuments_all.py b/erfgoedbot/fill_table_monuments_all.py index 6bd295d..68bd3de 100644 --- a/erfgoedbot/fill_table_monuments_all.py +++ b/erfgoedbot/fill_table_monuments_all.py @@ -170,10 +170,11 @@ @param replacements: Dictionary with target variable as key and replacement SQL a value. e.g. {"adm0": "'ad'", "lat": "`lat`"} """ -if 'country' not in replacements or 'lang' not in replacements: -raise ValueError("Both 'country' and 'lang' must be replaced") -self.dataset = replacements['country'].text -self.lang = replacements['lang'].text +required_fields = ('country', 'lang') +if not all(required in replacements for required in required_fields): +raise ValueError( +"All of the required fields '{}' must be replaced".format( +"','".join(required_fields))) if 'lat' not in replacements: self.variables['lat_int'] = None @@ -194,6 +195,79 @@ pywikibot.warning( "Unrecognized variable in {table}: {variable}".format( table=self.table, variable=target)) + + +class MonumentWikidataDatasetSql(MonumentDatasetSql): + +"""A single dataset (country) in the fill_monuments_all generation.""" + +def __init__(self, country, language, table, replacements, where=None): +""" +Initialize the dataset SQL object. + +@param country: Full text name of country or dataset. E.g. 'Andorra' +or 'Sweden (Listed historical ships)'. +@param language: Full text name of the language. E.g. 'Swedish'. +@param table: Table name (need not be "{domain}_{country}_({lang})") +@param replacements: Dictionary with target variable as key and +replacement SQL a value. e.g. {"adm0": "'ad'", "lat": "`lat`"} +@param where: A WHERE SQL clause, without the "WHERE" (optional). +""" +super(MonumentWikidataDatasetSql, self).__init__( +country, language, table, replacements, where) + +def get_replaced(self): +"""Return the list of replaced variables.""" +# the following list is determined by the sql template +return ['country', 'lang', 'id', 'adm0', 'name', 'municipality', +'lat', 'lon', 'lat_int', 'lon_int', 'image', 'wd_item', +'commonscat', 'source', 'changed', 'monument_article', +'registrant_url'] + +def load_values(self, replacements): +""" +Load the dataset specific replacements. + +Does not accept variables other than those in self.variables. +Automatically handles lat_int and lon_int. + +@param replacements: Dictionary with target variable as key and +replacement SQL a value. e.g. {"adm0": "'ad'", "lat": "`lat`"} +""" +required_fields = ('dataset', 'lang', 'adm0') +if not all(required in replacements for required in required_fields): +raise ValueError( +"All of the required fields '{}' must be replaced".format( +"','".join(required_fields))) + +self.dataset = replacements['dataset'].format() +self.lang = replacements['lang'].format() +self.adm0 = replacements['adm0'].format() + +def make_varible_sql(self): +"""Make the main body of the sql file, i.e. the mapping.""" +sql = MonumentWikidataDatasetSql.load_wikidata_template_sql() +return sql.format( +dataset=self.dataset, +lang=self.lang, +adm0=self.adm0 +) + +@staticmethod +def get_template_dir(): +"""Fetch the SQL template for a wikidata config.""" +return os.path.join( +os.path.dirname(os.path.abspath(__file__)), 'template') + +@staticmethod +def load_wikidata_template_sql(): +"""Fetch the SQL template for a wikidata config.""" +filename = 'fill_monument_all_wikidata.sql' +filepath = os.path.join( +MonumentWikidataDatasetSql.get_template_dir(), filename) +with open(filepath, 'r') as f: +sql = f.read() +return sql.strip() class VariableType(object): @@ -247,8 +321,11 @@ def monuments_dataset_sql_from_json(data): """Construct MonumentDatasetSql from json data.""" sql_data =
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Revert "TransactionProcessor: modify DM tree branches instea...
Hello Catrope, Divec, jenkins-bot, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/354966 to review the following change. Change subject: Revert "TransactionProcessor: modify DM tree branches instead of rebuilding them" .. Revert "TransactionProcessor: modify DM tree branches instead of rebuilding them" This reverts commit 6c915f3055433fb62e0d413c115ea6036523b530. Bug: T165965 Change-Id: I27a473db1d115498594f032f2c88166f0bb13998 --- M .jsduck/categories.json M build/modules.json M demos/ve/desktop.html M demos/ve/mobile.html M src/dm/ve.dm.TransactionProcessor.js D src/dm/ve.dm.TreeCursor.js D src/dm/ve.dm.TreeModifier.js M tests/dm/ve.dm.RebaseServer.test.js M tests/dm/ve.dm.TransactionProcessor.test.js D tests/dm/ve.dm.TreeModifier.test.js M tests/index.html 11 files changed, 129 insertions(+), 884 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor refs/changes/66/354966/1 diff --git a/.jsduck/categories.json b/.jsduck/categories.json index 3b4ff78..360e1c7 100644 --- a/.jsduck/categories.json +++ b/.jsduck/categories.json @@ -63,8 +63,6 @@ "ve.dm.*Selection", "ve.dm.Transaction", "ve.dm.TransactionBuilder", - "ve.dm.TreeCursor", - "ve.dm.TreeModifier", "ve.dm.TransactionProcessor", "ve.dm.TransactionProcessor.*" ] diff --git a/build/modules.json b/build/modules.json index 26b8ad3..de51b8e 100644 --- a/build/modules.json +++ b/build/modules.json @@ -275,8 +275,6 @@ "src/dm/ve.dm.TransactionProcessor.js", "src/dm/ve.dm.Transaction.js", "src/dm/ve.dm.TransactionBuilder.js", - "src/dm/ve.dm.TreeCursor.js", - "src/dm/ve.dm.TreeModifier.js", "src/dm/ve.dm.Selection.js", "src/dm/ve.dm.Surface.js", "src/dm/ve.dm.SurfaceFragment.js", @@ -677,7 +675,6 @@ "tests/dm/ve.dm.TestRebaseClient.js", "tests/dm/ve.dm.TestRebaseServer.js", "tests/dm/ve.dm.RebaseServer.test.js", - "tests/dm/ve.dm.TreeModifier.test.js", "tests/dm/ve.dm.TransactionProcessor.test.js", "tests/dm/ve.dm.APIResultsQueue.test.js", "tests/dm/ve.dm.Surface.test.js", diff --git a/demos/ve/desktop.html b/demos/ve/desktop.html index 0e6a4fc..da8e2d8 100644 --- a/demos/ve/desktop.html +++ b/demos/ve/desktop.html @@ -216,8 +216,6 @@ - - diff --git a/demos/ve/mobile.html b/demos/ve/mobile.html index 8d17f6e..cad6de6 100644 --- a/demos/ve/mobile.html +++ b/demos/ve/mobile.html @@ -216,8 +216,6 @@ - - diff --git a/src/dm/ve.dm.TransactionProcessor.js b/src/dm/ve.dm.TransactionProcessor.js index 6e6209e..4cdfb0f 100644 --- a/src/dm/ve.dm.TransactionProcessor.js +++ b/src/dm/ve.dm.TransactionProcessor.js @@ -47,7 +47,6 @@ this.replaceMinInsertLevel = 0; this.retainDepth = 0; this.replaceSpliceQueue = []; - this.treeModifier = null; }; /* Static members */ @@ -85,9 +84,6 @@ ve.dm.TransactionProcessor.prototype.process = function () { var i, completed; - // Ensure the pre-modification document tree has been generated - this.document.getDocumentNode(); - // First process each operation to gather modifications in the modification queue. // If an exception occurs during this stage, we don't need to do anything to recover, // because no modifications were made yet. @@ -102,8 +98,6 @@ try { completed = false; this.applyModifications(); - this.treeModifier = new ve.dm.TreeModifier( this.document, this.transaction ); - this.treeModifier.process(); this.queueAnnotateEvents(); completed = true; } finally { @@ -351,14 +345,19 @@ * {number} splices[].offset Offset to remove/insert at (unadjusted) * {number} splices[].removeLength Number of elements to remove * {Array} splices[].insert Data to insert; for efficiency, objects are inserted without cloning + * @param {number} splitAncestorLevel How many levels of ancestors were split (closed by inserted data) + * For example, if inserting `` splitAncestorLevel=1, and if
[MediaWiki-commits] [Gerrit] mediawiki...PropertySuggester[master]: Add .gitreview
Ladsgroup has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354965 ) Change subject: Add .gitreview .. Add .gitreview Bug: T104309 Change-Id: Id7662deae59e4ff20ebb5e469e688614631440c7 --- A .gitreview 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PropertySuggester refs/changes/65/354965/1 diff --git a/.gitreview b/.gitreview new file mode 100644 index 000..58067eb --- /dev/null +++ b/.gitreview @@ -0,0 +1,6 @@ +[gerrit] +host=gerrit.wikimedia.org +port=29418 +project=mediawiki/extensions/PropertySuggester.git +track=1 +defaultrebase=0 -- To view, visit https://gerrit.wikimedia.org/r/354965 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id7662deae59e4ff20ebb5e469e688614631440c7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PropertySuggester Gerrit-Branch: master Gerrit-Owner: Ladsgroup___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: PHP7: Use intval to baseconvert instead of string casting
TheDJ has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354964 ) Change subject: PHP7: Use intval to baseconvert instead of string casting .. PHP7: Use intval to baseconvert instead of string casting PHP7 and later no longer automatically casts strings containing hexadecimal numbers to actual numbers when trying to do math on them. Use intval with base 16 instead. Bug: T160536 Change-Id: Idc8e030847d80275df22877df09234b4e248cded --- M handlers/OggHandler/File_Ogg/File/Ogg/Flac.php M handlers/OggHandler/File_Ogg/File/Ogg/Opus.php M handlers/OggHandler/File_Ogg/File/Ogg/Speex.php M handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php 4 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/64/354964/1 diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php b/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php index bf98d60..d19fd01 100644 --- a/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php +++ b/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php @@ -65,8 +65,8 @@ } function getSecondsFromGranulePos( $granulePos ){ -return (( '0x' . substr( $granulePos, 0, 8 ) ) * pow(2, 32) - + ( '0x' . substr( $granulePos, 8, 8 ) )) +return (intval(substr( $granulePos, 0, 8 ), 16 ) * pow(2, 32) + + intval(substr( $granulePos, 8, 8 ), 16 )) / $this->_streamInfo['sample_rate']; } diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php b/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php index 2c23d92..9066f0b 100644 --- a/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php +++ b/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php @@ -57,8 +57,8 @@ } function getSecondsFromGranulePos( $granulePos ){ -return (( '0x' . substr( $granulePos, 0, 8 ) ) * pow(2, 32) -+ ( '0x' . substr( $granulePos, 8, 8 ) ) +return (intval(substr( $granulePos, 0, 8 ), 16 ) * pow(2, 32) ++ intval(substr( $granulePos, 8, 8 ), 16 ) - $this->_header['pre_skip']) / 48000; } diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php b/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php index 42f9b0e..6398ed9 100644 --- a/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php +++ b/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php @@ -43,13 +43,13 @@ $this->_decodeHeader(); $this->_decodeCommentsHeader(); $endSec = -(( '0x' . substr( $this->_lastGranulePos, 0, 8 ) ) * pow(2, 32) -+ ( '0x' . substr( $this->_lastGranulePos, 8, 8 ) )) +(intval(substr( $this->_lastGranulePos, 0, 8 ), 16 ) * pow(2, 32) ++ intval(substr( $this->_lastGranulePos, 8, 8 ), 16 )) / $this->_header['rate']; $startSec = -(( '0x' . substr( $this->_firstGranulePos, 0, 8 ) ) * pow(2, 32) -+ ( '0x' . substr( $this->_firstGranulePos, 8, 8 ) )) +(intval(substr( $this->_firstGranulePos, 0, 8 ), 16 ) * pow(2, 32) ++ intval(substr( $this->_firstGranulePos, 8, 8 ), 16 )) / $this->_header['rate']; //make sure the offset is worth taking into account oggz_chop related hack diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php b/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php index 06c2c18..8d4510c 100644 --- a/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php +++ b/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php @@ -185,8 +185,8 @@ $this->_avgBitrate = $this->_streamLength ? ($this->_streamSize * 8) / $this->_streamLength : 0; } function getSecondsFromGranulePos( $granulePos ){ - return (( '0x' . substr( $granulePos, 0, 8 ) ) * pow(2, 32) -+ ( '0x' . substr( $granulePos, 8, 8 ) )) + return (intval(substr( $granulePos, 0, 8 ), 16) * pow(2, 32) ++ intval( substr( $granulePos, 8, 8 ), 16 )) / $this->_idHeader['audio_sample_rate']; } /** -- To view, visit https://gerrit.wikimedia.org/r/354964 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idc8e030847d80275df22877df09234b4e248cded Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: TheDJ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: JS Lexeme deserializer can deserialize grammatical features
Aleksey Bekh-Ivanov (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354963 ) Change subject: JS Lexeme deserializer can deserialize grammatical features .. JS Lexeme deserializer can deserialize grammatical features Bug: T165481 Change-Id: I8a1eaf1a38be31f74a9748430a2c4e101ff66105 --- M resources/serialization/LexemeDeserializer.js M tests/qunit/serialization/LexemeDeserializer.tests.js 2 files changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme refs/changes/63/354963/1 diff --git a/resources/serialization/LexemeDeserializer.js b/resources/serialization/LexemeDeserializer.js index 53ff3d9..db4af64 100644 --- a/resources/serialization/LexemeDeserializer.js +++ b/resources/serialization/LexemeDeserializer.js @@ -36,7 +36,6 @@ var lexeme = new wikibase.datamodel.Lexeme( serialization.id, - termMapDeserializer.deserialize( serialization.labels ), statementGroupSetDeserializer.deserialize( serialization.claims ) ); @@ -50,7 +49,7 @@ return new wb.lexeme.datamodel.LexemeForm( formSerialization.id, formSerialization.representation, - formSerialization.gramaaticalFeatures, + formSerialization.grammaticalFeatures, statementGroupSetDeserializer.deserialize( formSerialization.claims ) ); } diff --git a/tests/qunit/serialization/LexemeDeserializer.tests.js b/tests/qunit/serialization/LexemeDeserializer.tests.js index dbda4fc..885fbf1 100644 --- a/tests/qunit/serialization/LexemeDeserializer.tests.js +++ b/tests/qunit/serialization/LexemeDeserializer.tests.js @@ -66,7 +66,7 @@ forms: [ { id: 'F1', representation: 'some representation', - gramaaticalFeatures: [ 'Q1' ], + grammaticalFeatures: [ 'Q1' ], claims: claimsSerialization } ] } ); -- To view, visit https://gerrit.wikimedia.org/r/354963 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a1eaf1a38be31f74a9748430a2c4e101ff66105 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseLexeme Gerrit-Branch: master Gerrit-Owner: Aleksey Bekh-Ivanov (WMDE)___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix EnhancedChangesList::getDiffHistLinks null exception
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354602 ) Change subject: Fix EnhancedChangesList::getDiffHistLinks null exception .. Fix EnhancedChangesList::getDiffHistLinks null exception If a page is deleted, rc_cur_id is missing, but it takes a while before job queue deletes RC entries. If we encounter something like that, just skip it since its bound for deletion anyways. Bug: T164059 Change-Id: I286109a9707e54939c0da31656ef54fd29acf481 --- M includes/changes/EnhancedChangesList.php 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index b8a2ac8..7e59882 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -712,6 +712,11 @@ if ( $rc->getAttribute( 'rc_type' ) == RC_CATEGORIZE ) { // For categorizations we must swap the category title with the page title! $pageTitle = Title::newFromID( $rc->getAttribute( 'rc_cur_id' ) ); + if ( !$pageTitle ) { + // The page has been deleted, but the RC entry + // deletion job has not run yet. Just skip. + return ''; + } } $retVal = ' ' . $this->msg( 'parentheses' ) -- To view, visit https://gerrit.wikimedia.org/r/354602 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I286109a9707e54939c0da31656ef54fd29acf481 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Brian WolffGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Catrope Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Reedy Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move some more classes to comply with class per file
Reedy has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354962 ) Change subject: Move some more classes to comply with class per file .. Move some more classes to comply with class per file Change-Id: Ibecea848fcca24709847931f5e02a7c981c4d277 --- M autoload.php M includes/WikiMap.php A includes/WikiReference.php M includes/Xml.php A includes/XmlJsCode.php M includes/utils/ZipDirectoryReader.php A includes/utils/ZipDirectoryReaderError.php 7 files changed, 209 insertions(+), 148 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/62/354962/1 diff --git a/autoload.php b/autoload.php index fbdee83..5576e84 100644 --- a/autoload.php +++ b/autoload.php @@ -1598,7 +1598,7 @@ 'WikiImporter' => __DIR__ . '/includes/import/WikiImporter.php', 'WikiMap' => __DIR__ . '/includes/WikiMap.php', 'WikiPage' => __DIR__ . '/includes/page/WikiPage.php', - 'WikiReference' => __DIR__ . '/includes/WikiMap.php', + 'WikiReference' => __DIR__ . '/includes/WikiReference.php', 'WikiRevision' => __DIR__ . '/includes/import/WikiRevision.php', 'WikiStatsOutput' => __DIR__ . '/maintenance/language/StatOutputs.php', 'WikiTextStructure' => __DIR__ . '/includes/content/WikiTextStructure.php', @@ -1673,11 +1673,11 @@ 'XhprofData' => __DIR__ . '/includes/libs/XhprofData.php', 'Xml' => __DIR__ . '/includes/Xml.php', 'XmlDumpWriter' => __DIR__ . '/includes/export/XmlDumpWriter.php', - 'XmlJsCode' => __DIR__ . '/includes/Xml.php', + 'XmlJsCode' => __DIR__ . '/includes/XmlJsCode.php', 'XmlSelect' => __DIR__ . '/includes/XmlSelect.php', 'XmlTypeCheck' => __DIR__ . '/includes/libs/mime/XmlTypeCheck.php', 'ZhConverter' => __DIR__ . '/languages/classes/LanguageZh.php', 'ZipDirectoryReader' => __DIR__ . '/includes/utils/ZipDirectoryReader.php', - 'ZipDirectoryReaderError' => __DIR__ . '/includes/utils/ZipDirectoryReader.php', + 'ZipDirectoryReaderError' => __DIR__ . '/includes/utils/ZipDirectoryReaderError.php', 'profile_point' => __DIR__ . '/profileinfo.php', ]; diff --git a/includes/WikiMap.php b/includes/WikiMap.php index 0f479ac..a03bc19 100644 --- a/includes/WikiMap.php +++ b/includes/WikiMap.php @@ -175,106 +175,3 @@ return false; } } - -/** - * Reference to a locally-hosted wiki - */ -class WikiReference { - private $mCanonicalServer; ///< canonical server URL, e.g. 'https://www.mediawiki.org' - private $mServer; ///< server URL, may be protocol-relative, e.g. '//www.mediawiki.org' - private $mPath; ///< path, '/wiki/$1' - - /** -* @param string $canonicalServer -* @param string $path -* @param null|string $server -*/ - public function __construct( $canonicalServer, $path, $server = null ) { - $this->mCanonicalServer = $canonicalServer; - $this->mPath = $path; - $this->mServer = $server === null ? $canonicalServer : $server; - } - - /** -* Get the URL in a way to be displayed to the user -* More or less Wikimedia specific -* -* @return string -*/ - public function getDisplayName() { - $parsed = wfParseUrl( $this->mCanonicalServer ); - if ( $parsed ) { - return $parsed['host']; - } else { - // Invalid server spec. - // There's no sane thing to do here, so just return the canonical server name in full. - return $this->mCanonicalServer; - } - } - - /** -* Helper function for getUrl() -* -* @todo FIXME: This may be generalized... -* -* @param string $page Page name (must be normalised before calling this function! -* May contain a section part.) -* @param string|null $fragmentId -* -* @return string relative URL, without the server part. -*/ - private function getLocalUrl( $page, $fragmentId = null ) { - $page = wfUrlencode( str_replace( ' ', '_', $page ) ); - - if ( is_string( $fragmentId ) && $fragmentId !== '' ) { - $page .= '#' . wfUrlencode( $fragmentId ); - } - - return str_replace( '$1', $page, $this->mPath ); - } - - /** -* Get a canonical (i.e. based on $wgCanonicalServer) URL to a page on this foreign wiki -* -* @param string $page Page name (must be normalised before calling this function!) -* @param string|null $fragmentId -* -* @return string Url -*/ - public function getCanonicalUrl( $page, $fragmentId = null ) { - return $this->mCanonicalServer .
[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: [WIP] harvest Wikidata into monuments database
Jean-Frédéric has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354961 ) Change subject: [WIP] harvest Wikidata into monuments database .. [WIP] harvest Wikidata into monuments database Change-Id: I3b4d656a3f71f436507b27eabcf38623e2bd23ec --- M erfgoedbot/update_database.py 1 file changed, 81 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/heritage refs/changes/61/354961/1 diff --git a/erfgoedbot/update_database.py b/erfgoedbot/update_database.py index 75381c3..50233c5 100755 --- a/erfgoedbot/update_database.py +++ b/erfgoedbot/update_database.py @@ -11,10 +11,12 @@ python update_database.py -countrycode:XX -lang:YY ''' +import os import warnings import datetime import pywikibot +import pywikibot.data.sparql from pywikibot import pagegenerators import monuments_config as mconfig @@ -240,6 +242,43 @@ return contents +def process_monument_wikidata(params, countryconfig, conn, cursor): +"""Process a single instance of a monument row template.""" +params['name'] = params['itemLabel'].value +params['image'] = params['itemLabel'].value.split('/')[-1] +params['source'] = params['item'].value +params['admin'] = params['adminLabel'].value +params['wd_item'] = params['item'].getID() +del params['adminLabel'] +del params['itemLabel'] +del params['item'] + +print "UPDATE" + +query = u"""REPLACE INTO `%s`(""" % (countryconfig.get('table'),) + +delimiter = u'' +for key in params.keys(): +query += delimiter + u"""`%s`""" % (key,) +delimiter = u', ' + +query += u""") VALUES (""" + +print query + +delimiter = u'' +for value in params.values(): +query += delimiter + u"""%s""" +delimiter = u', ' + +query += u""")""" +with warnings.catch_warnings(record=True) as w: +warnings.simplefilter("always") +print query +print params.values() +cursor.execute(query, params.values()) + + def processMonument(params, source, countryconfig, conn, cursor, sourcePage, headerDefaults, unknownFields): """Process a single instance of a monument row template.""" @@ -385,6 +424,36 @@ unknownFieldsStatistics(countryconfig, unknownFields) +def load_wikidata_template_sparql(): +"""Fetch the SQL template for a wikidata config.""" +filename = 'wikidata_query.sparql' +with open(os.path.join(get_template_dir(), filename), 'r') as f: +sparql = f.read() +return sparql + + +def get_template_dir(): +"""Fetch the SQL template for a wikidata config.""" +return os.path.join( +os.path.dirname(os.path.abspath(__file__)), 'template') + + +def process_country_wikidata(countryconfig, conn, cursor): +pywikibot.Site().data_repository() +sparql_select = countryconfig.get('sparql') +sparql_template = load_wikidata_template_sparql() + +sparql_query = sparql_template % dict( +select_statement=sparql_select, +lang=countryconfig.get('lang') +) +print sparql_query +sq = pywikibot.data.sparql.SparqlQuery() +query_result = sq.select(sparql_query, full_data=True) +for resultitem in query_result: +process_monument_wikidata(resultitem, countryconfig, conn, cursor) + + def main(): """The main loop.""" # First find out what to work on @@ -411,6 +480,7 @@ if countrycode: lang = pywikibot.Site().language() +lang = 'nl' if not mconfig.countries.get((countrycode, lang)): pywikibot.warning( u'I have no config for countrycode "%s" in language "%s"' % ( @@ -421,9 +491,12 @@ countrycode, lang)) try: -processCountry( -mconfig.countries.get((countrycode, lang)), conn, cursor, -fullUpdate, daysBack) +countryconfig = mconfig.countries.get((countrycode, lang)) +if countryconfig.get('type') == 'sparql': +process_country_wikidata(countryconfig, conn, cursor) +else: +processCountry(countryconfig, conn, cursor, + fullUpdate, daysBack) except Exception, e: pywikibot.error( u"Unknown error occurred when processing country " @@ -435,8 +508,11 @@ u'Working on countrycode "%s" in language "%s"' % ( countrycode, lang)) try: -processCountry(countryconfig, conn, cursor, - fullUpdate, daysBack) +if countryconfig.get('type') == 'sparql': +process_country_wikidata(countryconfig, conn, cursor) +else: +processCountry(countryconfig, conn, cursor, + fullUpdate, daysBack) except Exception, e:
[MediaWiki-commits] [Gerrit] labs...heritage[wikidata]: Construct country sqls for wikidata configs
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354742 ) Change subject: Construct country sqls for wikidata configs .. Construct country sqls for wikidata configs The trigger to change to wikidata behaviour would be `"type": "sparql"` in the configs. Also re-factor sql construction for classic configs. Bug: T165919 Change-Id: Ia7a26127508a9456b257059b5435a52666b22aec --- M erfgoedbot/monument_tables.py A erfgoedbot/template/classic_table.sql.template A erfgoedbot/template/wikidata_table_template.sql M tests/test_monument_tables.py 4 files changed, 205 insertions(+), 166 deletions(-) Approvals: Jean-Frédéric: Looks good to me, approved jenkins-bot: Verified diff --git a/erfgoedbot/monument_tables.py b/erfgoedbot/monument_tables.py index 03f6092..67ed3c1 100755 --- a/erfgoedbot/monument_tables.py +++ b/erfgoedbot/monument_tables.py @@ -5,12 +5,11 @@ Author: Platonides """ - import os import monuments_config as mconfig -def processCountry(countrycode, lang, countryconfig): +def processCountry(country_code, lang, country_config): """ Process the country configs to create sql files. @@ -18,46 +17,36 @@ @param lang: language @param countryconfig: country configuration """ -# These are not listed in the monument config -extra_cols = " `source` varchar(510) NOT NULL DEFAULT '',\n" \ - " `changed` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n" # noqa E501 +# @todo: standardise these as 'monuments_{country}_({lang})' +table = country_config.get('table') -table = countryconfig.get('table') -sql_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "sql") -f = open(os.path.join(sql_dir, "create_table_%s.sql" % table), "w") -f.write("DROP TABLE IF EXISTS `%s`;\n" % table) -f.write("CREATE TABLE IF NOT EXISTS `%s` (\n" % table) - -source_primkey = countryconfig.get('primkey') -primkey = process_classic_config(f, countryconfig, source_primkey, - extra_cols) - -if not primkey: -if not isinstance(source_primkey, (str, unicode)): -primkey = u"`,`".join(source_primkey) +try: +if country_config.get('type') == 'sparql': +sql = process_wikidata_config(country_config) else: -raise Exception( -"Primary key not found for countrycode: %s, lang: %s" -% (countrycode, lang)) +sql = process_classic_config(country_config) +except Exception as e: +raise Exception( +'{exception} for countrycode: {country}, lang: {lang}'.format( +exception=e, country=country_code, lang=lang)) -f.write(' PRIMARY KEY (`%s`),\n' % primkey.encode('utf8')) -f.write(' KEY `latitude` (`lat`),\n KEY `longitude` (`lon`)\n') -f.write(') ENGINE=InnoDB DEFAULT CHARSET=utf8;\n') +f = open(os.path.join( +get_sql_dir(), 'create_table_{}.sql'.format(table)), 'w') +f.write(sql) f.close() -def process_classic_config(f, country_config, source_primkey, extra_cols): +def process_classic_config(country_config): """ Process a country configuration for wikitext lists. -@param f: file-like object to write output to @param country_config: country configuration -@param source_primkey: the key to the value used as a primary key -@param extra_cols: sql for source and changed columns -@return primkey +@return sql """ primkey = False -default_type = "varchar(255)" +default_type = 'varchar(255)' +source_primkey = country_config.get('primkey') +fields_sql = [] for field in country_config.get('fields'): column = field.get('dest') @@ -69,30 +58,94 @@ primkey = column if column in ['lon', 'lat']: -f.write(b" `%s` double DEFAULT NULL,\n" % column.encode('utf8')) +fields_sql.append( +b'`{}` double DEFAULT NULL,'.format(column.encode('utf8'))) else: -# why are we forcing extra_cols to be inserted early? -if column == 'monument_article': -f.write(extra_cols) -extra_cols = '' typ = field.get('type') or default_type -if typ.startswith("int("): +if typ.startswith('int('): if field.get('auto_increment'): -typ += " NOT NULL AUTO_INCREMENT" +typ += ' NOT NULL AUTO_INCREMENT' else: -typ += " NOT NULL DEFAULT 0" +typ += ' NOT NULL DEFAULT 0' elif typ.startswith("varchar("): if field.get('default'): -typ += " NOT NULL DEFAULT '%s'" % field.get('default') +typ += " NOT NULL DEFAULT
[MediaWiki-commits] [Gerrit] operations/puppet[production]: Don't replicate techconductwiki to labs
Dereckson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/354960 ) Change subject: Don't replicate techconductwiki to labs .. Don't replicate techconductwiki to labs Bug: T165977 Change-Id: I009b946e9f0537008f398ac1c07ad1c42101c7e5 --- M manifests/realm.pp 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/60/354960/1 diff --git a/manifests/realm.pp b/manifests/realm.pp index b81b9be..fcb235d 100644 --- a/manifests/realm.pp +++ b/manifests/realm.pp @@ -123,6 +123,7 @@ 'searchcomwiki', 'spcomwiki', 'stewardwiki', + 'techconductwiki', 'transitionteamwiki', 'wg_enwiki', 'wikimaniateamwiki', -- To view, visit https://gerrit.wikimedia.org/r/354960 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I009b946e9f0537008f398ac1c07ad1c42101c7e5 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits