[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Revert "db-eqiad.php: Depool db1036"
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362338 ) Change subject: Revert "db-eqiad.php: Depool db1036" .. Revert "db-eqiad.php: Depool db1036" This reverts commit 6c31a4753b100fae093aa3839e41562907bb14e8. Change-Id: I8aa22166f71e2ded111feeaacc0ad86690a05510 --- M wmf-config/db-eqiad.php 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Marostegui: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php index 82e0b4e..30461f1 100644 --- a/wmf-config/db-eqiad.php +++ b/wmf-config/db-eqiad.php @@ -110,9 +110,9 @@ ], 's2' => [ 'db1054' => 0, # A3 2.8TB 96GB, master - 'db1018' => 1, # B1 1.4TB 64GB, old master 2 #T168661 temporary rc service +# 'db1018' => 0, # B1 1.4TB 64GB, old master 2 'db1021' => 0, # B1 1.4TB 64GB, vslow, dump -# 'db1036' => 1, # B2 1.4TB 64GB, watchlist, recentchanges, contributions, logpager + 'db1036' => 1, # B2 1.4TB 64GB, watchlist, recentchanges, contributions, logpager 'db1060' => 1, # C2 2.8TB 96GB, api 'db1074' => 300, # A2 3.6TB 512GB, api 'db1076' => 500, # B1 3.6TB 512GB @@ -280,19 +280,19 @@ 'db1074' => 1, ], 'watchlist' => [ - 'db1018' => 1, + 'db1036' => 1, ], 'recentchanges' => [ - 'db1018' => 1, + 'db1036' => 1, ], 'recentchangeslinked' => [ - 'db1018' => 1, + 'db1036' => 1, ], 'contributions' => [ - 'db1018' => 1, + 'db1036' => 1, ], 'logpager' => [ - 'db1018' => 1, + 'db1036' => 1, ], ], /* s3 */ 'DEFAULT' => [ -- To view, visit https://gerrit.wikimedia.org/r/362338 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8aa22166f71e2ded111feeaacc0ad86690a05510 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MarosteguiGerrit-Reviewer: Jcrespo Gerrit-Reviewer: Marostegui 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]: Revert "db-eqiad.php: Depool db1036"
Hello jenkins-bot, Jcrespo, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/362338 to review the following change. Change subject: Revert "db-eqiad.php: Depool db1036" .. Revert "db-eqiad.php: Depool db1036" This reverts commit 6c31a4753b100fae093aa3839e41562907bb14e8. Change-Id: I8aa22166f71e2ded111feeaacc0ad86690a05510 --- M wmf-config/db-eqiad.php 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/38/362338/1 diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php index 82e0b4e..30461f1 100644 --- a/wmf-config/db-eqiad.php +++ b/wmf-config/db-eqiad.php @@ -110,9 +110,9 @@ ], 's2' => [ 'db1054' => 0, # A3 2.8TB 96GB, master - 'db1018' => 1, # B1 1.4TB 64GB, old master 2 #T168661 temporary rc service +# 'db1018' => 0, # B1 1.4TB 64GB, old master 2 'db1021' => 0, # B1 1.4TB 64GB, vslow, dump -# 'db1036' => 1, # B2 1.4TB 64GB, watchlist, recentchanges, contributions, logpager + 'db1036' => 1, # B2 1.4TB 64GB, watchlist, recentchanges, contributions, logpager 'db1060' => 1, # C2 2.8TB 96GB, api 'db1074' => 300, # A2 3.6TB 512GB, api 'db1076' => 500, # B1 3.6TB 512GB @@ -280,19 +280,19 @@ 'db1074' => 1, ], 'watchlist' => [ - 'db1018' => 1, + 'db1036' => 1, ], 'recentchanges' => [ - 'db1018' => 1, + 'db1036' => 1, ], 'recentchangeslinked' => [ - 'db1018' => 1, + 'db1036' => 1, ], 'contributions' => [ - 'db1018' => 1, + 'db1036' => 1, ], 'logpager' => [ - 'db1018' => 1, + 'db1036' => 1, ], ], /* s3 */ 'DEFAULT' => [ -- To view, visit https://gerrit.wikimedia.org/r/362338 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8aa22166f71e2ded111feeaacc0ad86690a05510 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MarosteguiGerrit-Reviewer: Jcrespo 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]: db-eqiad.php: Depool db1036
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362337 ) Change subject: db-eqiad.php: Depool db1036 .. db-eqiad.php: Depool db1036 db1036 needs an alter table db1018 will take over rc service during the alter Bug: T168661 Change-Id: Icebedad00743f7c4e122327d0c3fa758ba6aa896 --- M wmf-config/db-eqiad.php 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Marostegui: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php index 30461f1..82e0b4e 100644 --- a/wmf-config/db-eqiad.php +++ b/wmf-config/db-eqiad.php @@ -110,9 +110,9 @@ ], 's2' => [ 'db1054' => 0, # A3 2.8TB 96GB, master -# 'db1018' => 0, # B1 1.4TB 64GB, old master 2 + 'db1018' => 1, # B1 1.4TB 64GB, old master 2 #T168661 temporary rc service 'db1021' => 0, # B1 1.4TB 64GB, vslow, dump - 'db1036' => 1, # B2 1.4TB 64GB, watchlist, recentchanges, contributions, logpager +# 'db1036' => 1, # B2 1.4TB 64GB, watchlist, recentchanges, contributions, logpager 'db1060' => 1, # C2 2.8TB 96GB, api 'db1074' => 300, # A2 3.6TB 512GB, api 'db1076' => 500, # B1 3.6TB 512GB @@ -280,19 +280,19 @@ 'db1074' => 1, ], 'watchlist' => [ - 'db1036' => 1, + 'db1018' => 1, ], 'recentchanges' => [ - 'db1036' => 1, + 'db1018' => 1, ], 'recentchangeslinked' => [ - 'db1036' => 1, + 'db1018' => 1, ], 'contributions' => [ - 'db1036' => 1, + 'db1018' => 1, ], 'logpager' => [ - 'db1036' => 1, + 'db1018' => 1, ], ], /* s3 */ 'DEFAULT' => [ -- To view, visit https://gerrit.wikimedia.org/r/362337 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icebedad00743f7c4e122327d0c3fa758ba6aa896 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MarosteguiGerrit-Reviewer: Jcrespo Gerrit-Reviewer: Marostegui 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]: db-eqiad.php: Depool db1036
Marostegui has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362337 ) Change subject: db-eqiad.php: Depool db1036 .. db-eqiad.php: Depool db1036 db1036 needs an alter table db1018 will take over rc service during the alter Bug: T168661 Change-Id: Icebedad00743f7c4e122327d0c3fa758ba6aa896 --- M wmf-config/db-eqiad.php 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/37/362337/1 diff --git a/wmf-config/db-eqiad.php b/wmf-config/db-eqiad.php index 30461f1..82e0b4e 100644 --- a/wmf-config/db-eqiad.php +++ b/wmf-config/db-eqiad.php @@ -110,9 +110,9 @@ ], 's2' => [ 'db1054' => 0, # A3 2.8TB 96GB, master -# 'db1018' => 0, # B1 1.4TB 64GB, old master 2 + 'db1018' => 1, # B1 1.4TB 64GB, old master 2 #T168661 temporary rc service 'db1021' => 0, # B1 1.4TB 64GB, vslow, dump - 'db1036' => 1, # B2 1.4TB 64GB, watchlist, recentchanges, contributions, logpager +# 'db1036' => 1, # B2 1.4TB 64GB, watchlist, recentchanges, contributions, logpager 'db1060' => 1, # C2 2.8TB 96GB, api 'db1074' => 300, # A2 3.6TB 512GB, api 'db1076' => 500, # B1 3.6TB 512GB @@ -280,19 +280,19 @@ 'db1074' => 1, ], 'watchlist' => [ - 'db1036' => 1, + 'db1018' => 1, ], 'recentchanges' => [ - 'db1036' => 1, + 'db1018' => 1, ], 'recentchangeslinked' => [ - 'db1036' => 1, + 'db1018' => 1, ], 'contributions' => [ - 'db1036' => 1, + 'db1018' => 1, ], 'logpager' => [ - 'db1036' => 1, + 'db1018' => 1, ], ], /* s3 */ 'DEFAULT' => [ -- To view, visit https://gerrit.wikimedia.org/r/362337 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icebedad00743f7c4e122327d0c3fa758ba6aa896 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Marostegui___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Revert "Show a popup for first time Codemirror users"
Hello Niharika29, jenkins-bot, Kaldari, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/362336 to review the following change. Change subject: Revert "Show a popup for first time Codemirror users" .. Revert "Show a popup for first time Codemirror users" This reverts commit 99e31d152fa5945f7f56a9b168cb4dd337f63654. This commit breaks extension and contains security issues. Change-Id: I6bbe966673dabd047e9543cbeb47c157e2cbf814 --- M CodeMirror.hooks.php M extension.json M i18n/en.json M i18n/qqq.json M resources/ext.CodeMirror.js D resources/modules/popup.less 6 files changed, 9 insertions(+), 112 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeMirror refs/changes/36/362336/1 diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php index 9c88320..34364fa 100644 --- a/CodeMirror.hooks.php +++ b/CodeMirror.hooks.php @@ -127,7 +127,6 @@ */ public static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) { if ( self::isCodeMirrorEnabled( $out->getContext() ) ) { - $out->enableOOUI(); $out->addModules( 'ext.CodeMirror' ); } } diff --git a/extension.json b/extension.json index db9d5af..a24dd9c 100644 --- a/extension.json +++ b/extension.json @@ -28,23 +28,16 @@ "jquery.textSelection", "mediawiki.api", "mediawiki.api.options", - "user.options", - "oojs-ui" + "user.options" ], "scripts": [ "ext.CodeMirror.js" ], "styles": [ - "ext.CodeMirror.less", - "modules/popup.less" + "ext.CodeMirror.less" ], "messages": [ - "codemirror-toggle-label", - "codemirror-popup-syntax", - "codemirror-popup-highlighting", - "codemirror-popup-desc", - "codemirror-popup-btn-yes", - "codemirror-popup-btn-no" + "codemirror-toggle-label" ] }, "ext.CodeMirror.lib": { diff --git a/i18n/en.json b/i18n/en.json index ee0733b..9087119 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -7,10 +7,5 @@ "codemirror-desc": "Provides syntax highlighting in wikitext editor", "codemirror-toggle-label": "Syntax highlighting", "codemirror-beta-title": "Syntax highlighting", - "codemirror-beta-desc": "Syntax highlighting makes editing easier by using color and shade to visually separate article text from the code for links, references and templates.", - "codemirror-popup-syntax": "Syntax", - "codemirror-popup-highlighting": "Highlighting", - "codemirror-popup-desc": "Syntax highlighting will help you easily distinguish different parts of your edit by color coding them.", - "codemirror-popup-btn-yes": "Try it", - "codemirror-popup-btn-no": "No, thank you" + "codemirror-beta-desc": "Syntax highlighting makes editing easier by using color and shade to visually separate article text from the code for links, references and templates." } diff --git a/i18n/qqq.json b/i18n/qqq.json index ba7c0c1..9496c89 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -10,10 +10,5 @@ "codemirror-desc": "{{desc|name=Code Mirror|url=https://www.mediawiki.org/wiki/Extension:CodeMirror}}\n\nAdditional info: Discription of \"Syntax highlighting\" in wiki\n[[mw:Extension:SyntaxHighlight GeSHi]]", "codemirror-toggle-label": "Title tooltip for button to toggle CodeMirror in the editing toolbar.", "codemirror-beta-title": "Title for syntax highlighting beta feature", - "codemirror-beta-desc": "Description for syntax highlight beta feature", - "codemirror-popup-syntax": "This message is combined with the message {{msg-mw|codemirror-popup-highlighting}} to form the title \"Syntax Highlighting\" (with the two words having different styling).", - "codemirror-popup-highlighting": "This message is combined with the message {{msg-mw|codemirror-popup-syntax}} to form the title \"Syntax Highlighting\" (with the two words having different styling).", - "codemirror-popup-desc": "Description of the syntax highlighting feature in the popup", - "codemirror-popup-btn-yes": "Text on the button for trying out codemirror", - "codemirror-popup-btn-no": "Text on the button for dismissing popup" +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add parser tests for decoding of entities in indicator names
Fomafix has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362335 ) Change subject: Add parser tests for decoding of entities in indicator names .. Add parser tests for decoding of entities in indicator names This change adds parser tests that test the current behavior of decoding HTML entities in indicator names when generating the indicator IDs as described in T104196. With I88e8e2077e the tests get changed to the new behavior. Change-Id: Id561c4a00ece09b4db381edfe0d5f98120cacf5e --- M tests/parser/parserTests.txt 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/35/362335/1 diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 720f3f4..79dd078 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -28343,3 +28343,13 @@ #ABCamp;Damp;amp;E !! end + +!! test +Decoding of HTML entities in indicator names for IDs (T104196) +!! options +showindicators +!! wikitext +Indicator +!! html/php +Indicator +!! end -- To view, visit https://gerrit.wikimedia.org/r/362335 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id561c4a00ece09b4db381edfe0d5f98120cacf5e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core 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] operations...cg3[master]: WIP: cg3: New upstream version
KartikMistry has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362334 ) Change subject: WIP: cg3: New upstream version .. WIP: cg3: New upstream version Other changes: * Upstream library soname bump, so package name is updated. * Updated copyright and watch files. * Set locale to C.UTF-8 to avoid build issues. Bug: T168857 Change-Id: I9758ec1920afc7fae08acb7544b8108f7004ed80 --- M debian/changelog M debian/control M debian/copyright D debian/libcg3-0.symbols R debian/libcg3-1.install R debian/libcg3-1.postinst M debian/rules M debian/watch 8 files changed, 28 insertions(+), 74 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/contenttranslation/cg3 refs/changes/34/362334/1 diff --git a/debian/changelog b/debian/changelog index 582e114..0868807 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,17 @@ +cg3 (1.0.0~r12254-1+wmf1) jessie-wikimedia; urgency=low + + * New upstream release. + * debian/control: ++ Updated dependencies due to library name change. ++ Updated Homepage URL. ++ Suggests: libdigest-sha-perl + * Updated debian/copyright and debian/watch. + * debian/rules: ++ Set locale to C.UTF-8. + * Removed symbols file. + + -- Kartik MistryFri, 30 Jun 2017 08:57:13 +0530 + cg3 (0.9.9~r11624-1+wmf1) jessie; urgency=low * Rebuild for Jessie diff --git a/debian/control b/debian/control index 7cf3300..68741cc 100644 --- a/debian/control +++ b/debian/control @@ -9,19 +9,20 @@ libboost-dev (>= 1.49.0), libicu-dev (>= 4.8) Standards-Version: 3.9.8 -Homepage: http://visl.sdu.dk/cg3.html +Homepage: https://visl.sdu.dk/cg3.html Vcs-Git: https://anonscm.debian.org/cgit/debian-science/packages/cg3.git Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/cg3.git Package: cg3 Architecture: any -Depends: libcg3-0 (= ${binary:Version}), +Depends: libcg3-1 (= ${binary:Version}), ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends} Provides: vislcg3 Conflicts: vislcg3 Replaces: vislcg3 +Suggests: libdigest-sha-perl Description: Tools for using the 3rd edition of Constraint Grammar (CG-3) Constraint Grammar compiler and applicator for the 3rd edition of CG that is developed and maintained by VISL SDU and GrammarSoft ApS. @@ -31,9 +32,9 @@ much more. The core idea is that you choose what to do based on the whole available context, as opposed to n-grams. . - See http://visl.sdu.dk/cg3.html for more documentation + See https://visl.sdu.dk/cg3.html for more documentation -Package: libcg3-0 +Package: libcg3-1 Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} @@ -46,17 +47,17 @@ . It is recommended to instrument the CLI tools instead of using this API. . - See http://visl.sdu.dk/cg3.html for more documentation + See https://visl.sdu.dk/cg3.html for more documentation Package: libcg3-dev Architecture: any Multi-Arch: same Section: libdevel Pre-Depends: ${misc:Pre-Depends} -Depends: libcg3-0 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} +Depends: libcg3-1 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} Description: Headers and shared files to develop using the CG-3 library Development files to use the CG-3 API. . It is recommended to instrument the CLI tools instead of using this API. . - See http://visl.sdu.dk/cg3.html for more documentation + See https://visl.sdu.dk/cg3.html for more documentation diff --git a/debian/copyright b/debian/copyright index 33232a4..45dff8c 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,10 +1,10 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: cg3 Upstream-Contact: Tino Didriksen -Source: http://visl.sdu.dk/cg3.html +Source: https://visl.sdu.dk/cg3.html Files: * -Copyright: 2007-2016 GrammarSoft ApS +Copyright: 2007-2017 GrammarSoft ApS License: GPL-3+ License: GPL-3+ @@ -25,7 +25,7 @@ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". Files: emacs/* -Copyright: 2010-2016 Kevin Brubeck Unhammer +Copyright: 2010-2017 Kevin Brubeck Unhammer License: GPL-2+ License: GPL-2+ @@ -77,7 +77,7 @@ Files: include/uoptions.h src/icu_uoptions.cpp -Copyright: 1995-2014 International Business Machines Corporation and others +Copyright: 1995-2017 International Business Machines Corporation and others License: ICU License: ICU diff --git a/debian/libcg3-0.symbols b/debian/libcg3-0.symbols deleted file mode 100644 index f09347f..000 --- a/debian/libcg3-0.symbols +++ /dev/null @@ -1,62 +0,0 @@ -libcg3.so.0 libcg3-0 #MINVER# - (optional=templinst|c++)"std::basic_string, std::allocator >::_M_leak_hard()@Base" 0.9.8.9567 -
[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: More carefully preserve whitespace for LC round-tripping.
C. Scott Ananian has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362333 ) Change subject: More carefully preserve whitespace for LC round-tripping. .. More carefully preserve whitespace for LC round-tripping. Change-Id: I3b8ac67e40eaaf59299764c754dc1dd096d40e3a --- M lib/html2wt/LanguageVariantHandler.js M lib/wt2html/pegTokenizer.pegjs M lib/wt2html/tt/LanguageVariantHandler.js M tests/parserTests.txt 4 files changed, 193 insertions(+), 76 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/33/362333/1 diff --git a/lib/html2wt/LanguageVariantHandler.js b/lib/html2wt/LanguageVariantHandler.js index 5f78972..74a25dd 100644 --- a/lib/html2wt/LanguageVariantHandler.js +++ b/lib/html2wt/LanguageVariantHandler.js @@ -6,12 +6,30 @@ var Util = require('../utils/Util.js').Util; var LanguageVariantText = require('./ConstrainedText.js').LanguageVariantText; +var expandSpArray = function(a) { + var result = []; + if (Array.isArray(a)) { + a.forEach(function(el) { + if (typeof (el) === 'number') { + for (var i = 0; i < el; i++) { + result.push(''); + } + } else { + result.push(el); + } + }); + } + return result; +}; + // should be called with this == instance of WikitextSerializer var LanguageVariantHandler = function(node) { var state = this.state; var dataMWV = DU.getJSONAttribute(node, 'data-mw-variant', {}); var dp = DU.getDataParsoid(node); - var trailingSemi = dp.ts; + var flSp = expandSpArray(dp.flSp); + var textSp = expandSpArray(dp.tSp); + var trailingSemi = false; var textP; var flags; var originalFlags = (dp.fl || []).reduce(function(m, k, idx) { @@ -85,20 +103,34 @@ // Helper function: combine the three parts of the -{ }- string var combine = function(flagStr, bodyStr, useTrailingSemi) { if (flagStr || /\|/.test(bodyStr)) { flagStr += '|'; } - if (useTrailingSemi) { bodyStr += ';'; } + if (useTrailingSemi !== false) { bodyStr += ';' + useTrailingSemi; } return flagStr + bodyStr; }; // Canonicalize combinations of flags. - var sortedFlags = function() { - return Array.from(flags).filter(function(f) { + var sortedFlags = function(flags, noFilter, protectFunc) { + var s = Array.from(flags).filter(function(f) { // Filter out internal-use-only flags + if (noFilter) { return true; } return !/^[$]/.test(f); }).sort(function(a, b) { var ai = originalFlags.has(a) ? originalFlags.get(a) : -1; var bi = originalFlags.has(b) ? originalFlags.get(b) : -1; return ai - bi; + }).map(function(f) { + // Reinsert the original whitespace around the flag (if any) + var i = originalFlags.get(f); + var p = protectFunc ? protectFunc(f) : f; + if (i !== undefined && (2 * i + 1) < flSp.length) { + return flSp[2 * i] + p + flSp[2 * i + 1]; + } + return p; }).join(';'); + if (2 * originalFlags.size + 1 === flSp.length) { + if (flSp.length > 1 || s.length) { s += ';'; } + s += flSp[2 * originalFlags.size]; + } + return s; }; if (dataMWV.filter && dataMWV.filter.l) { @@ -107,7 +139,7 @@ resultP = textP.then(function(text) { console.assert(flags.size === 0); return combine( - dataMWV.filter.l.map(protectLang).join(';'), + sortedFlags(dataMWV.filter.l, true, protectLang), text, false /* no trailing semi */); }); @@ -118,38 +150,51 @@ if (!/[:;|]/.test(text)) { maybeDeleteFlag('R'); } - return combine(sortedFlags(), text, false); + return combine(sortedFlags(flags), text, false); }); } else if (Array.isArray(dataMWV.bidir)) { // Bidirectional rules + if (textSp.length % 3 === 1) { + trailingSemi = textSp[textSp.length - 1]; + } var b = (dataMWV.bidir[0] &&
[MediaWiki-commits] [Gerrit] operations/puppet[production]: labstore: secondary cluster set 1004 as primary
Rush has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362214 ) Change subject: labstore: secondary cluster set 1004 as primary .. labstore: secondary cluster set 1004 as primary Change-Id: I685e7dc89d2b72addd9d294e1aca15d1cf391634 --- M modules/role/manifests/labs/nfs/secondary.pp 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Madhuvishy: Looks good to me, but someone else must approve Rush: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/role/manifests/labs/nfs/secondary.pp b/modules/role/manifests/labs/nfs/secondary.pp index 5379823..e37b4ee 100644 --- a/modules/role/manifests/labs/nfs/secondary.pp +++ b/modules/role/manifests/labs/nfs/secondary.pp @@ -23,7 +23,7 @@ if $::hostname == 'labstore1005' { # Define DRBD role for this host, should come from hiera -$drbd_role = 'primary' +$drbd_role = 'secondary' interface::ip { 'drbd-replication': interface => $data_iface, @@ -35,7 +35,7 @@ if $::hostname == 'labstore1004' { # Define DRBD role for this host, should come from hiera -$drbd_role = 'secondary' +$drbd_role = 'primary' interface::ip { 'drbd-replication': interface => $data_iface, -- To view, visit https://gerrit.wikimedia.org/r/362214 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I685e7dc89d2b72addd9d294e1aca15d1cf391634 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: RushGerrit-Reviewer: Madhuvishy Gerrit-Reviewer: Rush Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: UsersMultiSelectWidget: Port from CapsuleMultiselectWidget t...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/357963 ) Change subject: UsersMultiSelectWidget: Port from CapsuleMultiselectWidget to MenuTagMultiselectWidget .. UsersMultiSelectWidget: Port from CapsuleMultiselectWidget to MenuTagMultiselectWidget Bonus: * Remove puzzling code that claimed to fix a bug that I couldn't reproduce but instead made single-character searches never display suggestions * Clear the input after choosing a menu item Change-Id: I44e72205880d152639ee823238dc5ab84d34402b --- M includes/widget/UsersMultiselectWidget.php M resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js 2 files changed, 26 insertions(+), 21 deletions(-) Approvals: jenkins-bot: Verified Mooeypoo: Looks good to me, approved diff --git a/includes/widget/UsersMultiselectWidget.php b/includes/widget/UsersMultiselectWidget.php index d24ab7b..999cb6a 100644 --- a/includes/widget/UsersMultiselectWidget.php +++ b/includes/widget/UsersMultiselectWidget.php @@ -53,7 +53,7 @@ public function getConfig( &$config ) { if ( $this->usersArray !== null ) { - $config['data'] = $this->usersArray; + $config['selected'] = $this->usersArray; } if ( $this->inputName !== null ) { $config['name'] = $this->inputName; diff --git a/resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js b/resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js index d7464b9..832cb2b 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js +++ b/resources/src/mediawiki.widgets/mw.widgets.UsersMultiselectWidget.js @@ -14,7 +14,7 @@ * newline-separated usernames. * * @class -* @extends OO.ui.CapsuleMultiselectWidget +* @extends OO.ui.MenuTagMultiselectWidget * * @constructor * @param {Object} [config] Configuration options @@ -56,17 +56,9 @@ this.menu = this.getMenu(); // Events - // Update contents of autocomplete menu as user types letters - this.$input.on( { - keyup: this.updateMenuItems.bind( this ) - } ); - // When option is selected from autocomplete menu, update the menu - this.menu.connect( this, { - select: 'updateMenuItems' - } ); // When list of selected usernames changes, update hidden input this.connect( this, { - change: 'updateHiddenInput' + change: 'onMultiselectChange' } ); // API init @@ -75,7 +67,7 @@ /* Setup */ - OO.inheritClass( mw.widgets.UsersMultiselectWidget, OO.ui.CapsuleMultiselectWidget ); + OO.inheritClass( mw.widgets.UsersMultiselectWidget, OO.ui.MenuTagMultiselectWidget ); OO.mixinClass( mw.widgets.UsersMultiselectWidget, OO.ui.mixin.PendingElement ); /* Methods */ @@ -83,10 +75,10 @@ /** * Get currently selected usernames * -* @return {Array} usernames +* @return {string[]} usernames */ mw.widgets.UsersMultiselectWidget.prototype.getSelectedUsernames = function () { - return this.getItemsData(); + return this.getValue(); }; /** @@ -95,7 +87,7 @@ * @private */ mw.widgets.UsersMultiselectWidget.prototype.updateMenuItems = function () { - var inputValue = this.$input.val(); + var inputValue = this.input.getValue(); if ( inputValue === this.inputValue ) { // Do not restart api query if nothing has changed in the input @@ -134,18 +126,21 @@ // Remove all items from menu add fill it with new this.menu.clearItems(); - - // Additional check to prevent bug of autoinserting first suggestion - // while removing user from the list - if ( inputValue.length > 1 || suggestions.length > 1 ) { - this.menu.addItems( suggestions ); - } + this.menu.addItems( suggestions ); + // Make the menu visible; it might not be if it was previously empty + this.menu.toggle( true ); this.popPending(); }.bind( this ) ).fail( this.popPending.bind( this ) ); } else { this.menu.clearItems(); } + }; + +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix \n handling for HTMLUsersMultiselectField
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354982 ) Change subject: Fix \n handling for HTMLUsersMultiselectField .. Fix \n handling for HTMLUsersMultiselectField Bug: T166836 Change-Id: I51b772946f1e50a21fb86cab969defb4647b820b --- M includes/htmlform/fields/HTMLUsersMultiselectField.php 1 file changed, 13 insertions(+), 12 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/htmlform/fields/HTMLUsersMultiselectField.php b/includes/htmlform/fields/HTMLUsersMultiselectField.php index 8829f66..eb88909 100644 --- a/includes/htmlform/fields/HTMLUsersMultiselectField.php +++ b/includes/htmlform/fields/HTMLUsersMultiselectField.php @@ -15,18 +15,16 @@ * @note This widget is not likely to remain functional in non-OOUI forms. */ class HTMLUsersMultiselectField extends HTMLUserTextField { - public function loadDataFromRequest( $request ) { - if ( !$request->getCheck( $this->mName ) ) { - return $this->getDefault(); - } + $value = $request->getText( $this->mName, $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 ) !== ''; } ) ); - return $usersArray; + // This function is expected to return a string + return implode( "\n", $usersArray ); } public function validate( $value, $alldata ) { @@ -38,7 +36,9 @@ return false; } - foreach ( $value as $username ) { + // $value is a string, because HTMLForm fields store their values as strings + $usersArray = explode( "\n", $value ); + foreach ( $usersArray as $username ) { $result = parent::validate( $username, $alldata ); if ( $result !== true ) { return $result; @@ -48,12 +48,12 @@ return true; } - public function getInputHTML( $values ) { + public function getInputHTML( $value ) { $this->mParent->getOutput()->enableOOUI(); - return $this->getInputOOUI( $values ); + return $this->getInputOOUI( $value ); } - public function getInputOOUI( $values ) { + public function getInputOOUI( $value ) { $params = [ 'name' => $this->mName ]; if ( isset( $this->mParams['default'] ) ) { @@ -68,8 +68,9 @@ ->plain(); } - if ( !is_null( $values ) ) { - $params['default'] = $values; + if ( !is_null( $value ) ) { + // $value is a string, but the widget expects an array + $params['default'] = explode( "\n", $value ); } // Make the field auto-infusable when it's used inside a legacy HTMLForm rather than OOUIHTMLForm -- To view, visit https://gerrit.wikimedia.org/r/354982 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I51b772946f1e50a21fb86cab969defb4647b820b Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: MattflaschenGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Catrope Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Krinkle Gerrit-Reviewer: MtDu 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...SocialProfile[master]: Remove duplicate prevLink, move back nextLink to it's origin...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362332 ) Change subject: Remove duplicate prevLink, move back nextLink to it's original place .. Remove duplicate prevLink, move back nextLink to it's original place Change-Id: Ibae1c102f5eade46416d7d32c861b44e645226fc --- M UserProfile/UserProfileHooks.php 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Jack Phoenix: Looks good to me, approved jenkins-bot: Verified diff --git a/UserProfile/UserProfileHooks.php b/UserProfile/UserProfileHooks.php index eed7a06..aea74e2 100644 --- a/UserProfile/UserProfileHooks.php +++ b/UserProfile/UserProfileHooks.php @@ -95,7 +95,7 @@ * (as of 2016-07-08) with some tweaks for SocialProfile. * * @author Scott Cushman@wikiHow -- original code -* @author Jack Phoenix -- modifications +* @author Jack Phoenix, Samantha Nguyen -- modifications */ public static function onDifferenceEngineOldHeader( $differenceEngine, &$oldHeader, $prevLink, $oldMinor, $diffOnly, $ldel, $unhide ) { global $wgUserProfileAvatarsInDiffs; @@ -114,7 +114,7 @@ 'class' => 'diff-avatar' ] ); - $oldHeader = '' . $prevLink . $oldRevisionHeader . '' . + $oldHeader = '' . $oldRevisionHeader . '' . '' . $avatarElement . '' . Linker::revUserTools( $differenceEngine->mOldRev, !$unhide ) . //'' . $differenceEngine->mOldRev->getTimestamp() . '' . @@ -133,7 +133,7 @@ * (as of 2016-07-08) with some tweaks for SocialProfile. * * @author Scott Cushman@wikiHow -- original code -* @author Jack Phoenix -- modifications +* @author Jack Phoenix, Samantha Nguyen -- modifications */ public static function onDifferenceEngineNewHeader( $differenceEngine, &$newHeader, $formattedRevisionTools, $nextLink, $rollback, $newMinor, $diffOnly, $rdel, $unhide ) { global $wgUserProfileAvatarsInDiffs; @@ -154,7 +154,7 @@ 'class' => 'diff-avatar' ] ); - $newHeader = '' . $newRevisionHeader . $nextLink . '' . + $newHeader = '' . $newRevisionHeader . '' . '' . $avatarElement . '' . Linker::revUserTools( $differenceEngine->mNewRev, !$unhide ) . " $rollback " . @@ -162,7 +162,7 @@ Linker::revComment( $differenceEngine->mNewRev, !$diffOnly, !$unhide ) . '' . '' . $newMinor . $rdel . '' . - '' . $differenceEngine->markPatrolledLink() . ''; + '' . $nextLink . $differenceEngine->markPatrolledLink() . ''; return true; } -- To view, visit https://gerrit.wikimedia.org/r/362332 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibae1c102f5eade46416d7d32c861b44e645226fc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SocialProfile Gerrit-Branch: master Gerrit-Owner: SamanthaNguyenGerrit-Reviewer: Jack Phoenix 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: Restrict addModuleStyles() to type=styles mo...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362121 ) Change subject: resourceloader: Restrict addModuleStyles() to type=styles modules .. resourceloader: Restrict addModuleStyles() to type=styles modules If a type=general module is enqueued, don't try to load it as a stylesheet. * Per a464d1d41d69f12fe, state tracking is already disabled for these loads (as otherwise we wrongly claim state=ready, when in fact only the styles and not the scripts were loaded). * The warning was added in a464d1d41d69f12fe. * Default install (tested in Vagrant), Wikimedia Beta cluster, and Wikimedia production have seen zero violations of this warning in the past 7 days. Raise severity to ERROR and add the 'continue' statement so that these are now not loaded at all. Bug: T92459 Change-Id: I211d56ac2df479ebf5b98667c613ecf81489539b --- M includes/resourceloader/ResourceLoaderClientHtml.php M tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php 2 files changed, 6 insertions(+), 6 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified Jforrester: Looks good to me, but someone else must approve diff --git a/includes/resourceloader/ResourceLoaderClientHtml.php b/includes/resourceloader/ResourceLoaderClientHtml.php index b8f2fa5..ace8f41 100644 --- a/includes/resourceloader/ResourceLoaderClientHtml.php +++ b/includes/resourceloader/ResourceLoaderClientHtml.php @@ -170,15 +170,16 @@ if ( $module->getType() !== ResourceLoaderModule::LOAD_STYLES ) { $logger = $rl->getLogger(); - $logger->warning( 'Unexpected general module "{module}" in styles queue.', [ + $logger->error( 'Unexpected general module "{module}" in styles queue.', [ 'module' => $name, ] ); - } else { - // Stylesheet doesn't trigger mw.loader callback. - // Set "ready" state to allow dependencies and avoid duplicate requests. (T87871) - $data['states'][$name] = 'ready'; + continue; } + // Stylesheet doesn't trigger mw.loader callback. + // Set "ready" state to allow dependencies and avoid duplicate requests. (T87871) + $data['states'][$name] = 'ready'; + $group = $module->getGroup(); $context = $this->getContext( $group, ResourceLoaderModule::TYPE_STYLES ); if ( $module->isKnownEmpty( $context ) ) { diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php index 979da44..3e0d883 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php @@ -134,7 +134,6 @@ 'test.top', ], 'styles' => [ - 'test.styles.mixed', 'test.styles.pure', ], 'scripts' => [ -- To view, visit https://gerrit.wikimedia.org/r/362121 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I211d56ac2df479ebf5b98667c613ecf81489539b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: KrinkleGerrit-Reviewer: Anomie Gerrit-Reviewer: Catrope Gerrit-Reviewer: Gergő Tisza Gerrit-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] oojs/ui[master]: FieldLayout: Add role='alert' for error messages
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362158 ) Change subject: FieldLayout: Add role='alert' for error messages .. FieldLayout: Add role='alert' for error messages Follows the ARIA pattern as described in: https://www.w3.org/TR/WCAG20-TECHS/ARIA19.html Also adding a demo where error notices are added and removed based on validation. Bug: T97957 Change-Id: Ib900e8d760a8e4d132d668eb3043ef85778dd29d --- M demos/pages/widgets.js M php/layouts/FieldLayout.php M src/layouts/FieldLayout.js 3 files changed, 27 insertions(+), 1 deletion(-) Approvals: Bartosz Dziewoński: Looks good to me, but someone else must approve jenkins-bot: Verified VolkerE: Looks good to me, approved diff --git a/demos/pages/widgets.js b/demos/pages/widgets.js index d4ccc95..e9cee0b 100644 --- a/demos/pages/widgets.js +++ b/demos/pages/widgets.js @@ -3,6 +3,7 @@ loremIpsum = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' + 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\u200E', textInputForLabel, labelForTextInput, radioSelectInputForLabel, labelForRadioSelectInput, + inputForValidation, fieldLayoutForValidation, horizontalDragItems = [], verticalDragItems = [], verticalHandledDragItems = [], @@ -56,6 +57,28 @@ labelForRadioSelectInput = new OO.ui.LabelWidget( { label: 'Label for RadioSelectInputWidget below', input: radioSelectInputForLabel + } ); + + inputForValidation = new OO.ui.TextInputWidget( { + validate: function ( value ) { + return value.length % 2 === 0; + } + } ); + + fieldLayoutForValidation = new OO.ui.FieldLayout( inputForValidation, { + align: 'top', + label: 'FieldLayout aligned top with validation errors', + help: 'Enter only even number of characters' + } ); + + inputForValidation.$input.on( 'blur', function () { + inputForValidation.getValidity().then( function () { + fieldLayoutForValidation.setErrors( [] ); + }, function () { + fieldLayoutForValidation.setErrors( [ + 'Please enter an even number of characters' + ] ); + } ); } ); fieldsets = [ @@ -2515,7 +2538,8 @@ errors: [ 'The value must be a number.' ], align: 'top' } - ) + ), + fieldLayoutForValidation ] } ), new OO.ui.FieldsetLayout( { diff --git a/php/layouts/FieldLayout.php b/php/layouts/FieldLayout.php index 78aab90..8039762 100644 --- a/php/layouts/FieldLayout.php +++ b/php/layouts/FieldLayout.php @@ -146,6 +146,7 @@ $listItem = new Tag( 'li' ); if ( $kind === 'error' ) { $icon = new IconWidget( [ 'icon' => 'alert', 'flags' => [ 'warning' ] ] ); + $listItem->setAttributes( [ 'role' => 'alert' ] ); } elseif ( $kind === 'notice' ) { $icon = new IconWidget( [ 'icon' => 'info' ] ); } else { diff --git a/src/layouts/FieldLayout.js b/src/layouts/FieldLayout.js index 2bbe48a..00a2fb9 100644 --- a/src/layouts/FieldLayout.js +++ b/src/layouts/FieldLayout.js @@ -170,6 +170,7 @@ $listItem = $( '' ); if ( kind === 'error' ) { $icon = new OO.ui.IconWidget( { icon: 'alert', flags: [ 'warning' ] } ).$element; + $listItem.attr( 'role', 'alert' ); } else if ( kind === 'notice' ) { $icon = new OO.ui.IconWidget( { icon: 'info' } ).$element; } else { -- To view, visit https://gerrit.wikimedia.org/r/362158 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib900e8d760a8e4d132d668eb3043ef85778dd29d Gerrit-PatchSet: 2 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: PrtksxnaGerrit-Reviewer: Bartosz Dziewoński Gerrit-Reviewer: Prtksxna 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] mediawiki...SocialProfile[master]: Remove duplicate prevLink, move back nextLink to it's origin...
SamanthaNguyen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362332 ) Change subject: Remove duplicate prevLink, move back nextLink to it's original place .. Remove duplicate prevLink, move back nextLink to it's original place Change-Id: Ibae1c102f5eade46416d7d32c861b44e645226fc --- M UserProfile/UserProfileHooks.php 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SocialProfile refs/changes/32/362332/1 diff --git a/UserProfile/UserProfileHooks.php b/UserProfile/UserProfileHooks.php index eed7a06..aea74e2 100644 --- a/UserProfile/UserProfileHooks.php +++ b/UserProfile/UserProfileHooks.php @@ -95,7 +95,7 @@ * (as of 2016-07-08) with some tweaks for SocialProfile. * * @author Scott Cushman@wikiHow -- original code -* @author Jack Phoenix -- modifications +* @author Jack Phoenix, Samantha Nguyen -- modifications */ public static function onDifferenceEngineOldHeader( $differenceEngine, &$oldHeader, $prevLink, $oldMinor, $diffOnly, $ldel, $unhide ) { global $wgUserProfileAvatarsInDiffs; @@ -114,7 +114,7 @@ 'class' => 'diff-avatar' ] ); - $oldHeader = '' . $prevLink . $oldRevisionHeader . '' . + $oldHeader = '' . $oldRevisionHeader . '' . '' . $avatarElement . '' . Linker::revUserTools( $differenceEngine->mOldRev, !$unhide ) . //'' . $differenceEngine->mOldRev->getTimestamp() . '' . @@ -133,7 +133,7 @@ * (as of 2016-07-08) with some tweaks for SocialProfile. * * @author Scott Cushman@wikiHow -- original code -* @author Jack Phoenix -- modifications +* @author Jack Phoenix, Samantha Nguyen -- modifications */ public static function onDifferenceEngineNewHeader( $differenceEngine, &$newHeader, $formattedRevisionTools, $nextLink, $rollback, $newMinor, $diffOnly, $rdel, $unhide ) { global $wgUserProfileAvatarsInDiffs; @@ -154,7 +154,7 @@ 'class' => 'diff-avatar' ] ); - $newHeader = '' . $newRevisionHeader . $nextLink . '' . + $newHeader = '' . $newRevisionHeader . '' . '' . $avatarElement . '' . Linker::revUserTools( $differenceEngine->mNewRev, !$unhide ) . " $rollback " . @@ -162,7 +162,7 @@ Linker::revComment( $differenceEngine->mNewRev, !$diffOnly, !$unhide ) . '' . '' . $newMinor . $rdel . '' . - '' . $differenceEngine->markPatrolledLink() . ''; + '' . $nextLink . $differenceEngine->markPatrolledLink() . ''; return true; } -- To view, visit https://gerrit.wikimedia.org/r/362332 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibae1c102f5eade46416d7d32c861b44e645226fc Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SocialProfile Gerrit-Branch: master Gerrit-Owner: SamanthaNguyen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ParserMigration[master]: Add API to ParserMigration
Tim Starling has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362331 ) Change subject: Add API to ParserMigration .. Add API to ParserMigration Bug: T162275 Change-Id: I1f2be6fcacd9ec8be8a3f2cca3c929e555aea852 --- M extension.json A includes/ApiParserMigration.php A includes/Mechanism.php M includes/MigrationEditPage.php 4 files changed, 96 insertions(+), 33 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ParserMigration refs/changes/31/362331/1 diff --git a/extension.json b/extension.json index 0f9c888..94884c3 100644 --- a/extension.json +++ b/extension.json @@ -7,13 +7,18 @@ "license-name": "CC0-1.0", "manifest_version": 1, "AutoloadClasses": { + "MediaWiki\\ParserMigration\\ApiParserMigration": "includes/ApiParserMigration.php", "MediaWiki\\ParserMigration\\EditAction": "includes/EditAction.php", "MediaWiki\\ParserMigration\\MigrationEditPage": "includes/MigrationEditPage.php", - "MediaWiki\\ParserMigration\\Hooks": "includes/Hooks.php" + "MediaWiki\\ParserMigration\\Hooks": "includes/Hooks.php", + "MediaWiki\\ParserMigration\\Mechanism": "includes/Mechanism.php" }, "Actions": { "parsermigration-edit": "MediaWiki\\ParserMigration\\EditAction" }, + "APIModules": { + "parser-migration": "MediaWiki\\ParserMigration\\ApiParserMigration" + }, "MessagesDirs": { "ParserMigration": "i18n" }, diff --git a/includes/ApiParserMigration.php b/includes/ApiParserMigration.php new file mode 100644 index 000..5e2e4e5 --- /dev/null +++ b/includes/ApiParserMigration.php @@ -0,0 +1,40 @@ +extractRequestParams(); + $page = $params['page']; + $title = \Title::newFromText( $page ); + if ( !$title ) { + $this->dieWithError( 'apierror-missingtitle' ); + } + $revision = \Revision::newFromTitle( $title ); + $content = $revision->getContent(); + if ( !$content ) { + $this->dieWithError( 'apierror-missingcontent-pageid' ); + } + $mechanism = new Mechanism( $this->getConfig()->get( 'ParserMigrationTidiers' ) ); + $user = $this->getUser(); + $options = \ParserOptions::newCanonical(); + $outputs = $mechanism->parse( $content, $title, $options, $user ); + + $result = $this->getResult(); + $result->addValue( null, 'old', $outputs[0]->getText() ); + $result->addValue( null, 'new', $outputs[1]->getText() ); + } + + public function isInternal() { + return true; + } + + public function getAllowedParams() { + return [ + 'page' => [ + \ApiBase::PARAM_TYPE => 'string', + \ApiBase::PARAM_REQUIRED => true, + ] + ]; + } +} diff --git a/includes/Mechanism.php b/includes/Mechanism.php new file mode 100644 index 000..41f46c4 --- /dev/null +++ b/includes/Mechanism.php @@ -0,0 +1,40 @@ +tidiers = $tidiers; + } + + public function parse( \Content $content, \Title $title, + \ParserOptions $baseOptions, \User $user + ) { + $options = clone $baseOptions; + $options->setTidy( false ); + $scopedCallback = $options->setupFakeRevision( $title, $content, $user ); + $parserOutput = $content->getParserOutput( $title, null, $options ); + \ScopedCallback::consume( $scopedCallback ); + + $leftOutput = $this->tidyParserOutput( $parserOutput, $this->tidiers[0] ); + $rightOutput = $this->tidyParserOutput( $parserOutput, $this->tidiers[1] ); + + return [ $leftOutput, $rightOutput ]; + } + /** +* @param \ParserOutput $parserOutput +* @param array $config +* @return \ParserOutput +*/ + protected function tidyParserOutput( $parserOutput, $config ) { + $tidier = \MWTidy::factory( $config ); + $newOutput = clone $parserOutput; + $newOutput->setText( $tidier->tidy( $newOutput->getRawText() ) ); + return $newOutput; + } +} diff --git a/includes/MigrationEditPage.php b/includes/MigrationEditPage.php index a42ad14..93189ae 100644 --- a/includes/MigrationEditPage.php +++ b/includes/MigrationEditPage.php @@ -24,53 +24,31 @@ return true; } - protected function getPreviewParserOptions() { - $parserOptions = parent::getPreviewParserOptions(); - $parserOptions->setTidy( false ); -
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: resourceloader: Improve ResourceLoaderClientHtmlTest tests
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362120 ) Change subject: resourceloader: Improve ResourceLoaderClientHtmlTest tests .. resourceloader: Improve ResourceLoaderClientHtmlTest tests The example for a mixed user module is outdated. Current user modules all separate styles and scripts. To make the effective change by the next commit easier to review, update these tests first seperately. Change-Id: I76a8a96eed8a8c39863c535362b1d0144ef2f866 --- M tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php 1 file changed, 26 insertions(+), 12 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php index cef4a29..979da44 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php @@ -46,15 +46,29 @@ 'test.styles.pure' => [ 'type' => ResourceLoaderModule::LOAD_STYLES ], 'test.styles.mixed' => [], - 'test.styles.noscript' => [ 'group' => 'noscript', 'type' => ResourceLoaderModule::LOAD_STYLES ], - 'test.styles.mixed.user' => [ 'group' => 'user' ], - 'test.styles.mixed.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ], - 'test.styles.private' => [ 'group' => 'private', 'styles' => '.private{}' ], + 'test.styles.noscript' => [ + 'type' => ResourceLoaderModule::LOAD_STYLES, + 'group' => 'noscript', + ], + 'test.styles.user' => [ + 'type' => ResourceLoaderModule::LOAD_STYLES, + 'group' => 'user', + ], + 'test.styles.user.empty' => [ + 'type' => ResourceLoaderModule::LOAD_STYLES, + 'group' => 'user', + 'isKnownEmpty' => true, + ], + 'test.styles.private' => [ + 'type' => ResourceLoaderModule::LOAD_STYLES, + 'group' => 'private', + 'styles' => '.private{}', + ], 'test.scripts' => [], 'test.scripts.top' => [ 'position' => 'top' ], - 'test.scripts.mixed.user' => [ 'group' => 'user' ], - 'test.scripts.mixed.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ], + 'test.scripts.user' => [ 'group' => 'user' ], + 'test.scripts.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ], 'test.scripts.raw' => [ 'isRaw' => true ], ]; return array_map( function ( $options ) { @@ -92,14 +106,14 @@ ] ); $client->setModuleStyles( [ 'test.styles.mixed', - 'test.styles.mixed.user.empty', + 'test.styles.user.empty', 'test.styles.private', 'test.styles.pure', 'test.unregistered.styles', ] ); $client->setModuleScripts( [ 'test.scripts', - 'test.scripts.mixed.user.empty', + 'test.scripts.user.empty', 'test.scripts.top', 'test.unregistered.scripts', ] ); @@ -109,11 +123,11 @@ 'test.private.top' => 'loading', 'test.private.bottom' => 'loading', 'test.styles.pure' => 'ready', - 'test.styles.mixed.user.empty' => 'ready', + 'test.styles.user.empty' => 'ready', 'test.styles.private' => 'ready', 'test.scripts' => 'loading', 'test.scripts.top' => 'loading', - 'test.scripts.mixed.user.empty' => 'ready', + 'test.scripts.user.empty' => 'ready', ], 'general' => [ 'test', @@ -240,9 +254,9 @@ ], [ 'context' => [], - 'modules' => [ 'test.scripts.mixed.user' ], +
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: EventLoggingManager: persistence + queueing
AMroczkowski has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362330 ) Change subject: EventLoggingManager: persistence + queueing .. EventLoggingManager: persistence + queueing Bug: T164801 Change-Id: I11d9f7068d0df98c9953a3653769dfe93b20b202 --- A app/src/main/java/org/wikipedia/analytics/EventLoggingConfig.java A app/src/main/java/org/wikipedia/analytics/EventLoggingManager.java D app/src/main/java/org/wikipedia/analytics/EventLoggingService.java M app/src/main/java/org/wikipedia/analytics/Funnel.java A app/src/main/java/org/wikipedia/analytics/SystemInformation.java A app/src/main/java/org/wikipedia/analytics/db/EventDatabaseHelper.java A app/src/main/java/org/wikipedia/analytics/db/EventRecord.java A app/src/main/java/org/wikipedia/analytics/db/EventRecordContract.java 8 files changed, 817 insertions(+), 82 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/30/362330/1 diff --git a/app/src/main/java/org/wikipedia/analytics/EventLoggingConfig.java b/app/src/main/java/org/wikipedia/analytics/EventLoggingConfig.java new file mode 100644 index 000..9b27cc8 --- /dev/null +++ b/app/src/main/java/org/wikipedia/analytics/EventLoggingConfig.java @@ -0,0 +1,33 @@ +package org.wikipedia.analytics; + +import java.util.concurrent.TimeUnit; + +class EventLoggingConfig { + +private static final int DEFAULT_BULK_UPLOAD_LIMIT = 10; +private static final long DEFAULT_FLUSH_INTERVAL = TimeUnit.MINUTES.toSeconds(1); +private static final long DEFAULT_DATA_EXPIRATION = TimeUnit.DAYS.toSeconds(5); + +private final int bulkUploadLimit; +private final long flushInterval; +private final long dataExpiration; + +EventLoggingConfig() { +bulkUploadLimit = DEFAULT_BULK_UPLOAD_LIMIT; +flushInterval = DEFAULT_FLUSH_INTERVAL; +dataExpiration = DEFAULT_DATA_EXPIRATION; +} + +public int getBulkUploadLimit() { +return bulkUploadLimit; +} + +public long getFlushInterval() { +return flushInterval; +} + +public long getDataExpiration() { +return dataExpiration; +} + +} diff --git a/app/src/main/java/org/wikipedia/analytics/EventLoggingManager.java b/app/src/main/java/org/wikipedia/analytics/EventLoggingManager.java new file mode 100644 index 000..71ebe34 --- /dev/null +++ b/app/src/main/java/org/wikipedia/analytics/EventLoggingManager.java @@ -0,0 +1,365 @@ +package org.wikipedia.analytics; + +import android.content.Context; +import android.database.sqlite.SQLiteDatabase; +import android.database.sqlite.SQLiteException; +import android.net.Uri; +import android.os.Build; +import android.os.Handler; +import android.os.HandlerThread; +import android.os.Looper; +import android.os.Message; +import android.support.annotation.VisibleForTesting; + +import org.json.JSONException; +import org.json.JSONObject; +import org.wikipedia.WikipediaApp; +import org.wikipedia.analytics.db.EventDatabaseHelper; +import org.wikipedia.analytics.db.EventRecord; +import org.wikipedia.analytics.db.EventRecordContract; +import org.wikipedia.crash.RemoteLogException; +import org.wikipedia.dataclient.okhttp.OkHttpConnectionFactory; +import org.wikipedia.util.ReleaseUtil; +import org.wikipedia.util.log.L; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + + +/*package*/ public class EventLoggingManager { +private static final RequestBody EMPTY_REQ = RequestBody.create(null, new byte[0]); +private static final String EVENTLOG_URL_PROD = "https://meta.wikimedia.org/beacon/event;; +private static final String EVENTLOG_URL_DEV = "https://deployment.wikimedia.beta.wmflabs.org/beacon/event;; +private static final String EVENTLOG_URL = ReleaseUtil.isPreBetaRelease() +? EVENTLOG_URL_DEV : EVENTLOG_URL_PROD; +// https://github.com/wikimedia/mediawiki-extensions-EventLogging/blob/8b3cb1b/modules/ext.eventLogging.core.js#L57 +private static final int MAX_URL_LEN = 2000; + +private static final int ENQUEUE_EVENTS = 1; // push given JSON message to events DB +private static final int FLUSH_QUEUE = 2; // post queued events +private static final int KILL_WORKER = 5; // Hard-kill the worker thread, discarding all events on the event queue. This is for testing, or disasters. + +private final Context context; +private final Worker worker; +private final EventLoggingConfig config; + +private static final MapINSTANCES = new HashMap<>(); + +public EventLoggingManager(final Context context, final EventLoggingConfig config) { +this.context = context; +this.config = config; +this.worker = createWorker(); +} + +
[MediaWiki-commits] [Gerrit] search/MjoLniR[master]: Setup python logging
EBernhardson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362329 ) Change subject: Setup python logging .. Setup python logging Initializes python logging in the shell scripts so we can get useful debugging information. This is particularly useful when debugging kafka to see what the library is doing. This is a bit of duplicate code, maybe some refactoring needs to be done to have a single entry point, or some sort of shared entry point code being called, but for now this probably works fine. Change-Id: I2e4200f6e12e77e4ffb230280de3eefe1f9b3f20 --- M mjolnir/cli/data_pipeline.py M mjolnir/cli/kafka_daemon.py M mjolnir/cli/training_pipeline.py 3 files changed, 45 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/search/MjoLniR refs/changes/29/362329/1 diff --git a/mjolnir/cli/data_pipeline.py b/mjolnir/cli/data_pipeline.py index 2c9c333..45a395d 100644 --- a/mjolnir/cli/data_pipeline.py +++ b/mjolnir/cli/data_pipeline.py @@ -11,6 +11,7 @@ """ import argparse +import logging import mjolnir.dbn import mjolnir.metrics import mjolnir.norm_query @@ -182,6 +183,12 @@ + ' form to bootstrap access. Query normalization will still use the ' + ' --search-cluster option') parser.add_argument( +'-v', '--verbose', dest='verbose', default=False, action='store_true', +help='Increase logging to INFO') +parser.add_argument( +'-vv', '--very-verbose', dest='very_verbose', default=False, action='store_true', +help='Increase logging to DEBUG') +parser.add_argument( 'wikis', metavar='wiki', type=str, nargs='+', help='A wiki to generate features and labels for') @@ -191,6 +198,14 @@ if __name__ == "__main__": args = parse_arguments() +if args['very_verbose']: +logging.basicConfig(level=logging.DEBUG) +elif args['verbose']: +logging.basicConfig(level=logging.INFO) +else: +logging.basicConfig() +del args['verbose'] +del args['very_verbose'] sc = SparkContext(appName="MLR: data collection pipeline") # spark info logging is incredibly spammy. Use warn to have some hope of # human decipherable output diff --git a/mjolnir/cli/kafka_daemon.py b/mjolnir/cli/kafka_daemon.py index 3e353c6..ee6626d 100644 --- a/mjolnir/cli/kafka_daemon.py +++ b/mjolnir/cli/kafka_daemon.py @@ -5,6 +5,7 @@ """ import argparse +import logging import mjolnir.kafka.daemon @@ -17,10 +18,24 @@ '-w', '--num-workers', dest='n_workers', type=int, default=5, help='Number of workers to issue elasticsearch queries in parallel. ' + 'Defaults to 5.') +parser.add_argument( +'-v', '--verbose', dest='verbose', default=False, action='store_true', +help='Increase logging to INFO') +parser.add_argument( +'-vv', '--very-verbose', dest='very_verbose', default=False, action='store_true', +help='Increase logging to DEBUG') args = parser.parse_args() return dict(vars(args)) if __name__ == '__main__': args = parse_arguments() +if args['very_verbose']: +logging.basicConfig(level=logging.DEBUG) +elif args['verbose']: +logging.basicConfig(level=logging.INFO) +else: +logging.basicConfig() +del args['verbose'] +del args['very_verbose'] mjolnir.kafka.daemon.Daemon(**args).run() diff --git a/mjolnir/cli/training_pipeline.py b/mjolnir/cli/training_pipeline.py index 3cb1af2..dab8301 100644 --- a/mjolnir/cli/training_pipeline.py +++ b/mjolnir/cli/training_pipeline.py @@ -10,6 +10,7 @@ """ import argparse +import logging import mjolnir.training.xgboost import os import pickle @@ -110,6 +111,12 @@ + 'trees used in the final result. Default uses 100 trees rather ' + 'than dynamically choosing based on max_depth. (Default: None)') parser.add_argument( +'-v', '--verbose', dest='verbose', default=False, action='store_true', +help='Increase logging to INFO') +parser.add_argument( +'-vv', '--very-verbose', dest='very_verbose', default=False, action='store_true', +help='Increase logging to DEBUG') +parser.add_argument( 'wikis', metavar='wiki', type=str, nargs='+', help='A wiki to perform model training for.') @@ -121,6 +128,14 @@ if __name__ == "__main__": args = parse_arguments() +if args['very_verbose']: +logging.basicConfig(level=logging.DEBUG) +elif args['verbose']: +logging.basicConfig(level=logging.INFO) +else: +logging.basicConfig() +del args['verbose'] +del args['very_verbose'] # TODO: Set spark configuration? Some can't actually be set here though, so best might be to set all of it # on the command line for consistency. sc = SparkContext(appName="MLR: training pipeline") -- To view,
[MediaWiki-commits] [Gerrit] search/MjoLniR[master]: Vectorize jaccard similarity
EBernhardson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362328 ) Change subject: Vectorize jaccard similarity .. Vectorize jaccard similarity The calculation of the similarity matrix dominates the time taken to group together queries, at about 200ms for 175 queries and 6.5s for 1000 queries. In the actual data our largest group is those containing only stop words at ~550 unique queries. This patch brings down the execution time on 1000 queries to around 300ms, and 175 queries down to 6ms (on my laptop). This amounts to a 20-30x speedup vs the naive version. Change-Id: I7d40ee747b089bfeb4851aab05ce34680d9392ac --- M mjolnir/norm_query.py M mjolnir/test/test_norm_query.py 2 files changed, 54 insertions(+), 35 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/search/MjoLniR refs/changes/28/362328/1 diff --git a/mjolnir/norm_query.py b/mjolnir/norm_query.py index 3608767..301ad15 100644 --- a/mjolnir/norm_query.py +++ b/mjolnir/norm_query.py @@ -21,36 +21,14 @@ import requests -def _binary_sim_jaccard(X, Y): -"""Calculate jaccard binary similarity between two vectors +def _binary_sim(matrix): +"""Compute a jaccard similarity matrix. + +Vecorization based on: https://stackoverflow.com/a/40579567 Parameters -- -X : np.array -Y : np.array - -Returns ---- -float -""" -assert len(X) == len(Y) -# both true -a = np.sum((X == 1) & (Y == 1)) -# both false -d = np.sum((X == 0) & (Y == 0)) -# number of both true over number of both not false. -return a / float(len(X) - d) - - -def _binary_sim(mat, sim=_binary_sim_jaccard): -"""Compute a similarity matrix - -Parameters --- -mat : np.array -sim : func -function taking two one dimensonal arrays of the same -size as input and returns a similarity value. +matrix : np.array Returns --- @@ -58,14 +36,27 @@ matrix of shape (n_rows, n_rows) giving the similarity between rows of the input matrix. """ -n_rows = mat.shape[0] -res = np.empty((n_rows, n_rows), dtype=np.float32) -for i in range(n_rows): -res[i][i] = 1. -for j in range(0, i): -res[i][j] = sim(mat[i], mat[j]) -res[j][i] = res[i][j] -return res +# Generate the indices of the lower triangle of our result matrix. +# The diagonal is offset by -1 because the identity in a similarity +# matrix is always 1. +r, c = np.tril_indices(matrix.shape[0], -1) +# Use those indices to build two matrices that contains all +# the rows we need to do a similarity comparison on +p1 = matrix[c] +p2 = matrix[r] +# Run the main jaccard calculation +intersection = np.logical_and(p1, p2).sum(1) +union = np.logical_or(p1, p2).sum(1).astype(np.float64) +# Build the result matrix with 1's on the diagonal +out = np.eye(matrix.shape[0]) +# Insert the result of our similarity calculation at their original indices +out[c, r] = intersection / union +# Above only populated half of the matrix, the mirrored diagonal contains +# only zeros. Fix that up by transposing. Adding the transposed matrix double +# counts the diagonal so subtract that back out. We could skip this step and +# leave half the matrix empty, but it takes a fraction of a ms to be correct +# even on mid-sized inputs (~200 queries). +return out + out.T - np.diag(np.diag(out)) def _make_query_groups(source, threshold=0.5): diff --git a/mjolnir/test/test_norm_query.py b/mjolnir/test/test_norm_query.py index 44e89dc..3f2d3b2 100644 --- a/mjolnir/test/test_norm_query.py +++ b/mjolnir/test/test_norm_query.py @@ -1,5 +1,6 @@ from collections import namedtuple import mjolnir.norm_query +import numpy as np import os import pytest @@ -50,3 +51,30 @@ source = [row(str(i), hit_page_ids) for i, hit_page_ids in enumerate(hits)] groups = mjolnir.norm_query._make_query_groups(source) assert [(str(i), g) for i, g in enumerate(expected)] == groups + + +def test_vectorized_jaccard_sim(): +# The vectorized version of jaccard similarity is 20x faster, but it is +# harder to understand. Compute it the simple way and compare to the +# vectorized version +def jaccard_sim(X, Y): +assert len(X) == len(Y) +a = np.sum((X == 1) & (Y == 1)) +d = np.sum((X == 0) & (Y == 0)) +return a / float(len(X) - d) + +def binary_sim(mat): +n_rows = mat.shape[0] +out = np.empty((n_rows, n_rows), dtype=np.float64) +for i in range(n_rows): +out[i][i] = 1. +for j in range(0, i): +out[i][j] = jaccard_sim(mat[i], mat[j]) +out[j][i] = out[i][j] +return out + +# Simulate 200 queries with 100 shared page ids +matrix = np.random.rand(200, 100)
[MediaWiki-commits] [Gerrit] mediawiki/event-schemas[master]: Revision-Create: Include rev_content_changed field.
Mobrovac has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362321 ) Change subject: Revision-Create: Include rev_content_changed field. .. Revision-Create: Include rev_content_changed field. Some actions, for example protecting the pages, create a new revision but don't actually change the page content. If a major template on a wiki gets protected, we're doing an enormous amount of work rerendering dependencies while we know the result will not change. Change-Id: Ia5492563e8e88b60eba49eccf603b1599c6c3a74 --- M jsonschema/mediawiki/revision/create/1.yaml 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Mobrovac: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/jsonschema/mediawiki/revision/create/1.yaml b/jsonschema/mediawiki/revision/create/1.yaml index 3ee33c4..81a7e9e 100644 --- a/jsonschema/mediawiki/revision/create/1.yaml +++ b/jsonschema/mediawiki/revision/create/1.yaml @@ -147,6 +147,10 @@ description: The content format of the revision. type: string + rev_content_changed: +description: Whether the revision actually changes the page content. +type: boolean + page_is_redirect: description: > True if this revision is a redirect. This -- To view, visit https://gerrit.wikimedia.org/r/362321 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia5492563e8e88b60eba49eccf603b1599c6c3a74 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/event-schemas Gerrit-Branch: master Gerrit-Owner: PpchelkoGerrit-Reviewer: GWicke Gerrit-Reviewer: Mobrovac Gerrit-Reviewer: Ottomata Gerrit-Reviewer: Ppchelko Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikimediaMessages[master]: Follow-up 6401f1ec9b69: actually add the RTL version of the ...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362312 ) Change subject: Follow-up 6401f1ec9b69: actually add the RTL version of the feedback icon .. Follow-up 6401f1ec9b69: actually add the RTL version of the feedback icon Bug: T169271 Change-Id: I7818d8140cc33246f32ae7f8e960174e7f9ee227 --- A modules/images/feedback-blue-rtl.svg 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Mooeypoo: Looks good to me, approved diff --git a/modules/images/feedback-blue-rtl.svg b/modules/images/feedback-blue-rtl.svg new file mode 100644 index 000..2e83228 --- /dev/null +++ b/modules/images/feedback-blue-rtl.svg @@ -0,0 +1,4 @@ + +http://www.w3.org/2000/svg; width="42" height="42" viewBox="0 0 42 42"> + + -- To view, visit https://gerrit.wikimedia.org/r/362312 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7818d8140cc33246f32ae7f8e960174e7f9ee227 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMessages Gerrit-Branch: master Gerrit-Owner: CatropeGerrit-Reviewer: Mooeypoo Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Hygiene: Consolidate all the usages of @contentMargin/Padding
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/357671 ) Change subject: Hygiene: Consolidate all the usages of @contentMargin/Padding .. Hygiene: Consolidate all the usages of @contentMargin/Padding * Consolidates all the @contentMargin usages before they get even further out of control. Now they are in one place we can look to generalise this rule. Additional changes: * Remove .page-banner rule - artifact from old experiment * Rename @contentMargin to contentPadding to reflect most common usages * Remove the .notifications-overlay .overlay-header .content, and .notifications-overlay .overlay-content .content rules - these selectors do not match with any elements in the UI Bug: T167538: Change-Id: Ia718927a01023377b3fae3ebf67e267b881de293 --- M minerva.less/minerva.variables.less M resources/mobile.backtotop/backtotop.less M resources/mobile.editor.common/editor.less M resources/mobile.gallery/gallery.less M resources/mobile.issues/issues.less M resources/mobile.messageBox.styles/messageBox.less M resources/mobile.pagelist.styles/pagelist.less M resources/mobile.pagesummary.styles/pagesummary.less M resources/mobile.startup/Overlay.less M resources/mobile.startup/drawer.less M resources/mobile.startup/panel.less M resources/mobile.talk.overlays/TalkOverlay.less M resources/skins.minerva.base.styles/pageactions.less M resources/skins.minerva.base.styles/ui.less M resources/skins.minerva.content.styles/main.less M resources/skins.minerva.mainPage.styles/common.less M skinStyles/mobile.notifications.overlay/minerva.less 17 files changed, 77 insertions(+), 94 deletions(-) Approvals: jenkins-bot: Verified VolkerE: Looks good to me, approved diff --git a/minerva.less/minerva.variables.less b/minerva.less/minerva.variables.less index aee2f92..eae04ea 100644 --- a/minerva.less/minerva.variables.less +++ b/minerva.less/minerva.variables.less @@ -18,6 +18,7 @@ @fontSizeH3: 1.2em; // Content +@contentPadding: 16px; @contentMargin: 16px; // Header diff --git a/resources/mobile.backtotop/backtotop.less b/resources/mobile.backtotop/backtotop.less index ee3c74a..240bafc 100644 --- a/resources/mobile.backtotop/backtotop.less +++ b/resources/mobile.backtotop/backtotop.less @@ -1,10 +1,6 @@ @import 'mobile.variables'; @import 'mediawiki.mixins.less'; -// FIXME: `mobile.` LESS modules should not import `minerva.` LESS modules. -// Move Minerva specific rules into skinStyles. -@import 'minerva.variables'; - .backtotop { /* initially hide the element */ visibility: hidden; @@ -17,7 +13,7 @@ border-radius: 100%; box-shadow: 0.1em 0.2em 0.3em #d3d3d3; bottom: 20px; - right: @contentMargin; + right: 0; cursor: pointer; z-index: @z-indexOverlay; background-color: @colorProgressive; diff --git a/resources/mobile.editor.common/editor.less b/resources/mobile.editor.common/editor.less index 4fc225a..bbae338 100644 --- a/resources/mobile.editor.common/editor.less +++ b/resources/mobile.editor.common/editor.less @@ -1,10 +1,6 @@ @import 'mobile.variables'; @import 'mediawiki.mixins.less'; -// FIXME: `mobile.` LESS modules should not import `minerva.` LESS modules. -// Move Minerva specific rules into skinStyles. -@import 'minerva.variables'; - .editor-overlay { .box-sizing( border-box ); @@ -14,7 +10,8 @@ .wikitext-editor { .box-sizing( border-box ); - padding: 10px @contentMargin; + padding-top: 10px; + padding-bottom: 10px; } .summary-request { diff --git a/resources/mobile.gallery/gallery.less b/resources/mobile.gallery/gallery.less index 4915c76..a8fe481 100644 --- a/resources/mobile.gallery/gallery.less +++ b/resources/mobile.gallery/gallery.less @@ -1,11 +1,7 @@ @import 'mobile.variables'; -// FIXME: `mobile.` LESS modules should not import `minerva.` LESS modules. -// Move Minerva specific rules into skinStyles. -@import 'minerva.variables'; - .image-list { - margin: 20px @contentMargin 0; + margin-top: 20px; li { list-style: none outside none; diff --git a/resources/mobile.issues/issues.less b/resources/mobile.issues/issues.less index 2447e06..aa62e58 100644 --- a/resources/mobile.issues/issues.less +++ b/resources/mobile.issues/issues.less @@ -1,9 +1,5 @@ @import 'mobile.variables'; -// FIXME: `mobile.` LESS modules should not import `minerva.` LESS modules. -// Move Minerva specific rules into skinStyles. -@import 'minerva.variables'; - @smallIconSize: 24px; @largeIconSize: 50px; @@ -21,7 +17,8 @@ li { border-bottom: solid 1px @grayLight; .issue-notice { - padding: ( @smallIconSize * 2.5 ) @contentMargin @smallIconSize @contentMargin; +
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: jsminplus: Fix JSNode memory leak from 'continue' statements
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362117 ) Change subject: jsminplus: Fix JSNode memory leak from 'continue' statements .. jsminplus: Fix JSNode memory leak from 'continue' statements During parsing of scripts containing a 'continue' statement, the JSNode for that statements, and all containing blocks (e.g. conditional blocks, for-loop/white-loop statements , etc.) were being held in memory indefinitely. Bug: T31784 Change-Id: Id7006c264a470ba665434f6f275e49a1516b73ae --- M includes/libs/jsminplus.php 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/jsminplus.php b/includes/libs/jsminplus.php index 40f22c5..7feac7d 100644 --- a/includes/libs/jsminplus.php +++ b/includes/libs/jsminplus.php @@ -973,8 +973,6 @@ } while (!$ss[$i]->isLoop && ($tt != KEYWORD_BREAK || $ss[$i]->type != KEYWORD_SWITCH)); } - - $n->target = $ss[$i]; break; case KEYWORD_TRY: -- To view, visit https://gerrit.wikimedia.org/r/362117 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id7006c264a470ba665434f6f275e49a1516b73ae Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: KrinkleGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Catrope Gerrit-Reviewer: Jforrester Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Config changes for deploying CodeMirror on testwiki
Niharika29 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362327 ) Change subject: Config changes for deploying CodeMirror on testwiki .. Config changes for deploying CodeMirror on testwiki Bug: T169284 Change-Id: Id4bdbf17a37aa0190ee13ec694b97fff36f29dfc --- M wmf-config/CommonSettings.php M wmf-config/InitialiseSettings.php 2 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/27/362327/1 diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index 2c12b52..6762935 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -1941,6 +1941,11 @@ $wgLoginNotifyEnableOnSuccess = false; } +if ( $wmgUseCodeMirror ) { + wfLoadExtension( 'CodeMirror' ); + $wgCodeMirrorBetaFeature = true; +} + $wgDefaultUserOptions['thumbsize'] = $wmgThumbsizeIndex; $wgDefaultUserOptions['showhiddencats'] = $wmgShowHiddenCats; diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 930322d..52d0570 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -18918,6 +18918,12 @@ 'testwiki' => true, ], +// Enable CodeMirror on testwiki (T169284) +'wmgUseCodeMirror' => [ + 'default' => false, + 'testwiki' => true, +], + 'wmgUseParserMigration' => [ 'default' => true, ], -- To view, visit https://gerrit.wikimedia.org/r/362327 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id4bdbf17a37aa0190ee13ec694b97fff36f29dfc Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Niharika29___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Early WIP: Unicode sections
MaxSem has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362326 ) Change subject: Early WIP: Unicode sections .. Early WIP: Unicode sections Does not really work yet, just a demo of my approach. Because Sanitizer::escapeId() is used in a bunch of places without escaping, I'm deprecating it without altering its behavior. Bug: T152540 Change-Id: Id304010a0342efbb7ef2d56c5b8b244f2e4fb2c5 --- M includes/DefaultSettings.php M includes/Linker.php M includes/Sanitizer.php M includes/Setup.php M includes/api/ApiMain.php M includes/parser/Parser.php M tests/parser/ParserTestRunner.php M tests/parser/parserTests.txt 8 files changed, 238 insertions(+), 62 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/26/362326/1 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 1459ab6..dd07dd4 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3372,17 +3372,53 @@ $wgDisableOutputCompression = false; /** - * Should we allow a broader set of characters in id attributes, per HTML5? If - * not, use only HTML 4-compatible IDs. This option is for testing -- when the - * functionality is ready, it will be on by default with no option. + * @deprecated since 1.30, use $wgFragmentMode * - * Currently this appears to work fine in all browsers, but it's disabled by - * default because it normalizes id's a bit too aggressively, breaking preexisting - * content (particularly Cite). See T29733, T29694, T29474. + * Abandoned experiment with HTML5-stlye ID escaping. Normalized IDs a bit + * too aggressively, breaking preexisting content (particularly Cite). + * See T29733, T29694, T29474. */ $wgExperimentalHtmlIds = false; /** + * How should section IDs be encoded? + * This array can contain 1 or 2 elements, each of them can be one of: + * - 'html5' is modern HTML5 style encoding with minimal escaping. Allows to + *display Unicode characters in many browsers' address bars. + * - 'legacy' is old MediaWiki-style encodng, e.g. 啤酒 turns into .E5.95.A4.E9.85.92 + * - 'html5-legacy' corresponds to DEPRECATED $wgExperimentalHtmlIds mode. DO NOT use + *it for anything but migration off that mode (see below). + * + * The first element of this array specifies the primary mode of escaping IDs. This + * is what users will see when they e.g. follow an [[#internal link]] to a section of + * a page. + * + * The optional second element defines an optional fallback mode, useful for migrations. + * If present, it will direct MediaWiki to add empty s to every section with its + * id attribute set to fallback encoded title so that links using the previous encoding + * would still work. + * + * Example: you want to migrate your wiki from 'legacy' to 'html5' + * + * On the first step, set this variable to [ 'legacy', 'html5' ]. After a while, when + * all caches (parser, HTTP, etc.) contain only pages generated with this setting, + * flip the value to [ 'html5', 'legacy' ]. This will result in all internal links being + * generated in the new encoding while old links (both external and cached internal) will + * still work. After a long time, you might want to ditch backwards compatibility and + * set it to [ 'http5' ]. After all, pages get edited, breaking incoming links no matter which + * fragment mode is used. + */ +$wgFragmentMode = [ 'legacy' ]; + +/** + * Which ID escaping mode should be used for external interwiki links? See documentation + * for $wgFragmentMode above for details of each mode. Because you can't control external sites, + * this setting should probably alwats be 'legacy', unless every wiki you link to has converted + * to 'html5'. + */ +$wgExternalInterwikiFragmentMode = 'legacy'; + +/** * Abstract list of footer icons for skins in place of old copyrightico and poweredbyico code * You can add new icons to the built in copyright or poweredby, or you can create * a new block. Though note that you may need to add some custom css to get good styling diff --git a/includes/Linker.php b/includes/Linker.php index 6942a39..e003593 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1605,22 +1605,24 @@ * a space and ending with '>' * This *must* be at least '>' for no attribs * @param string $anchor The anchor to give the headline (the bit after the #) -* @param string $html Html for the text of the header +* @param string $html HTML for the text of the header * @param string $link HTML to add for the section edit link -* @param bool|string $legacyAnchor A second, optional anchor to give for +* @param string|bool $fallbackAnchor A second, optional anchor to give for * backward compatibility (false to omit) * * @return string HTML headline */ public static function
[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Set --parallel=2 by default
Legoktm has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362325 ) Change subject: Set --parallel=2 by default .. Set --parallel=2 by default Bug: T169189 Change-Id: I4883b0b013fee2aab64079c4a41b1f826b49341d --- M phpcs.xml 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/codesniffer refs/changes/25/362325/1 diff --git a/phpcs.xml b/phpcs.xml index 2d92d4a..4c7d8f6 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -4,6 +4,7 @@ . + vendor */Tests/files/* -- To view, visit https://gerrit.wikimedia.org/r/362325 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4883b0b013fee2aab64079c4a41b1f826b49341d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/tools/codesniffer Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Exclude common folders
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362266 ) Change subject: Exclude common folders .. Exclude common folders * .git * vendor/ * node_modules/ Most MediaWiki extensions already exclude these. Bug: T122738 Change-Id: I15f1020402a5aa9da1263664081ed38c186fadd3 --- M MediaWiki/ruleset.xml 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/MediaWiki/ruleset.xml b/MediaWiki/ruleset.xml index b537a2c..65263be 100644 --- a/MediaWiki/ruleset.xml +++ b/MediaWiki/ruleset.xml @@ -112,4 +112,9 @@ + + + ^/.git + ^/vendor + ^/node_modules -- To view, visit https://gerrit.wikimedia.org/r/362266 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I15f1020402a5aa9da1263664081ed38c186fadd3 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/tools/codesniffer Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Legoktm Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] pywikibot/core[master]: [WIP] Add ability to thank Flow posts
Happy5214 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362324 ) Change subject: [WIP] Add ability to thank Flow posts .. [WIP] Add ability to thank Flow posts I still need to write the tests for this code. Change-Id: Ie629aaa46aa007a39e6d5dce6400504bf73e5980 --- M pywikibot/flow.py M pywikibot/site.py 2 files changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/24/362324/1 diff --git a/pywikibot/flow.py b/pywikibot/flow.py index 5f8a006..17f97e4 100644 --- a/pywikibot/flow.py +++ b/pywikibot/flow.py @@ -535,3 +535,7 @@ """ self.site.restore_post(self, reason) self._load() + +def thank(self): +"""Thank the user who made this post.""" +self.site.thank_post(self) diff --git a/pywikibot/site.py b/pywikibot/site.py index e2bc6cc..08b7b7a 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -6775,6 +6775,7 @@ comparison = data['compare']['*'] return comparison +# Thanks API calls @need_extension('Thanks') def thank_revision(self, revid, source=None): """Corresponding method to the 'action=thank' API action. @@ -6794,6 +6795,25 @@ raise api.APIError('Thanking unsuccessful') return data +@need_extension('Flow') +@need_extension('Thanks') +def thank_post(self, post): +"""Corresponding method to the 'action=flowthank' API action. + +@param post: The post to be thanked for. +@type post: Post +@raise APIError: On thanking oneself or other API errors. +@return: The API response. +""" +post_id = post.uuid +token = self.tokens['csrf'] +req = self._simple_request(action='flowthank', + postid=post_id, token=token) +data = req.submit() +if data['result']['success'] != 1: +raise api.APIError('Thanking unsuccessful') +return data + # Flow API calls @need_extension('Flow') def load_board(self, page): -- To view, visit https://gerrit.wikimedia.org/r/362324 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie629aaa46aa007a39e6d5dce6400504bf73e5980 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Happy5214___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...ShowMe[master]: Initial commit
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/334027 ) Change subject: Initial commit .. Initial commit Change-Id: Ic3c26955a2941afcc03927799ed0df0a0d6d2c76 --- A .eslintrc.json A .gitignore A Gruntfile.js A README.md A ShowMe.class.php A ShowMe.hooks.php A ShowMe.php A composer.json A extension.json A i18n/en.json A i18n/qqq.json A modules/ext.showMe.js A package.json A phpcs.xml 14 files changed, 293 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified tosfos: Looks good to me, approved 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/Gruntfile.js b/Gruntfile.js new file mode 100644 index 000..c30a729 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,29 @@ +/* eslint-env node */ +module.exports = function ( grunt ) { + grunt.loadNpmTasks( 'grunt-eslint' ); + grunt.loadNpmTasks( 'grunt-jsonlint' ); + grunt.loadNpmTasks( 'grunt-banana-checker' ); + + grunt.initConfig( { + eslint: { + all: [ + '*.js', + '**/*.js', + '!node_modules/**' + ] + }, + banana: { + all: 'i18n/' + }, + jsonlint: { + all: [ + '**/*.json', + '!node_modules/**', + '!vendor/**' + ] + } + } ); + + grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana' ] ); + grunt.registerTask( 'default', 'test' ); +}; diff --git a/README.md b/README.md new file mode 100644 index 000..4f59de1 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +This is a MediaWiki extension. Find the docs [https://www.mediawiki.org/wiki/Extension:ShowMe here]. diff --git a/ShowMe.class.php b/ShowMe.class.php new file mode 100644 index 000..45b2a06 --- /dev/null +++ b/ShowMe.class.php @@ -0,0 +1,54 @@ + + */ +class ShowMe { + private $type; + private $name; + private $options; + static protected $num = 0; + + /** +* +* @param string $type The type of input field, currently must be 'dropdown' +* @param string $name The name and ID to be assigned to the input field +* @param array $options Use the form label => value +* @param ParserOutput $out +*/ + function __construct( $type, $name, array $options, ParserOutput $out ) { + $this->type = $type; + $this->name = $name; + $this->options = $options; + + // Add this $name to he array of ShowMe field IDs that exist on this page + $configVars = $out->getJsConfigVars(); + $configVars['wgShowMeDropdownIDs'][] = $name; + $out->addJsConfigVars( 'wgShowMeDropdownIDs', $configVars['wgShowMeDropdownIDs'] ); + } + + /** +* Get the output HTML +* +* @return string +*/ + public function getHTML() { + // Theoretically, other types may be added in the future, such as radio buttons. + if ( $this->type == 'dropdown' ) { + return $this->getDropdownHTML(); + } + // invalid type + return ''; // Throw error? + } + + /** +* Get the output HTML for a dropdown +* +* @return string +*/ + protected function getDropdownHTML() { + $select = new XmlSelect( $this->name, $this->name ); + $select->addOptions( $this->options ); + return $select->getHTML(); + } +} diff --git a/ShowMe.hooks.php b/ShowMe.hooks.php new file mode 100644 index 000..4109ced --- /dev/null +++ b/ShowMe.hooks.php @@ -0,0 +1,57 @@ +setHook( 'showme', [ __CLASS__, 'showMeRender' ] ); + return true; + } + + /** +* +* @staticvar int $num +* @param string $input +* @param array $args +* @param Parser $parser +* @param PPFrame $frame +* @return string Output HTML +*/ + public static function showMeRender( $input, array $args, Parser $parser, PPFrame $frame ) { + $parser->getOutput()->addModuleScripts( 'ext.showMe' ); + +
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Config changes for LoginNotify
Niharika29 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362323 ) Change subject: Config changes for LoginNotify .. Config changes for LoginNotify Bug: T107707 Change-Id: I5dd77a0fb6b844ea1a4218900ea4f68be3e9c83c --- M wmf-config/CommonSettings.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/23/362323/1 diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index 2c12b52..61ddd89 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -1938,7 +1938,8 @@ if ( $wmgUseLoginNotify ) { wfLoadExtension( 'LoginNotify' ); - $wgLoginNotifyEnableOnSuccess = false; + $wgNotifyTypeAvailabilityByCategory['login-success']['web'] = false; + } $wgDefaultUserOptions['thumbsize'] = $wmgThumbsizeIndex; -- To view, visit https://gerrit.wikimedia.org/r/362323 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5dd77a0fb6b844ea1a4218900ea4f68be3e9c83c Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Niharika29___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...EventBus[master]: Revision-Create: Populate the rev_content_changed field.
Ppchelko has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362322 ) Change subject: Revision-Create: Populate the rev_content_changed field. .. Revision-Create: Populate the rev_content_changed field. Change-Id: Ibd32ceb99bc650e3927c1bde28c05d0145fc205b Depends-On: Ia5492563e8e88b60eba49eccf603b1599c6c3a74 --- M EventBus.php 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventBus refs/changes/22/362322/1 diff --git a/EventBus.php b/EventBus.php index 059d620..fa7c8cb 100644 --- a/EventBus.php +++ b/EventBus.php @@ -224,8 +224,16 @@ // must have a minimum value of 1, so omit it entirely when there is no // parent revision (i.e. page creation). $parentId = $revision->getParentId(); + // Assume that the content have changed by default + $attrs['rev_content_changed'] = true; if ( !is_null( $parentId ) ) { $attrs['rev_parent_id'] = $parentId; + if ( $parentId !== 0 ) { + $parentRev = Revision::newFromId( $parentId ); + if ( !is_null( $parentRev ) ) { + $attrs['rev_content_changed'] = $parentRev->getSha1() !== $revision->getSha1(); + } + } } return $attrs; -- To view, visit https://gerrit.wikimedia.org/r/362322 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd32ceb99bc650e3927c1bde28c05d0145fc205b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EventBus Gerrit-Branch: master Gerrit-Owner: Ppchelko___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/event-schemas[master]: Revision-Create: Include rev_content_changed field.
Ppchelko has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362321 ) Change subject: Revision-Create: Include rev_content_changed field. .. Revision-Create: Include rev_content_changed field. Some actions, for example protecting the pages, create a new revision but don't actually change the page content. If a major template on a wiki gets protected, we're doing an enormous amount of work rerendering dependencies while we know the result will not change. Change-Id: Ia5492563e8e88b60eba49eccf603b1599c6c3a74 --- A jsonschema/mediawiki/page/create/1.yaml M jsonschema/mediawiki/revision/create/1.yaml 2 files changed, 171 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/event-schemas refs/changes/21/362321/1 diff --git a/jsonschema/mediawiki/page/create/1.yaml b/jsonschema/mediawiki/page/create/1.yaml new file mode 100644 index 000..3ee33c4 --- /dev/null +++ b/jsonschema/mediawiki/page/create/1.yaml @@ -0,0 +1,167 @@ +title: mediawiki/revision/create +description: > + Represents a MW Revision Create event. +$schema: http://json-schema.org/draft-04/schema# +type: object +properties: + ### Meta data object. All events schemas should have this. + meta: +type: object +properties: + topic: +description: The queue topic name this message belongs to. +type: string + schema_uri: +description: > + The URI identifying the jsonschema for this event. This may be just + a short uri containing only the name and revision at the end of the + URI path. e.g. schema_name/12345 is acceptable. This field + is not required. +type: string + uri: +description: The unique URI identifying the event. +type: string +format: uri + request_id: +description: The unique UUID v1 ID of the event derived from the X-Request-Id header. +type: string +pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$' + id: +description: The unique ID of this event; should match the dt field. +type: string +pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$' + dt: +description: The time stamp of the event, in ISO8601 format. +type: string +format: date-time + domain: +description: The domain the event pertains to. +type: string +required: + - topic + - uri + - id + - dt + - domain + + + ### Mediawiki entity fields. All Mediawiki entity events should have these. + database: +description: The name of the wiki database this event belongs to. +type: string + + performer: +description: Represents the user that performed this change. +type: object +properties: + user_id: +description: > + The user id that performed this change. This is optional, and + will not be present for anonymous users. +type: integer + user_text: +description: The text representation of the user that performed this change. +type: string + user_groups: +description: A list of the groups this user belongs to. E.g. bot, sysop etc. +type: array +items: + type: string + user_is_bot: +description: > + True if this user is considered to be a bot. This is checked + via the $user->isBot() method, which considers both user_groups + and user permissions. +type: boolean + user_registration_dt: +description: > + The datetime of the user account registration. + Not present for anonymous users or if missing in the MW database. +type: string +format: date-time + user_edit_count: +description: > + The number of edits this user has made at the time this revision is created. + Not present for anonymous users. +type: integer +minimum: 0 +required: + - user_text + - user_groups + - user_is_bot + + comment: +description: The comment left by the user that performed this change. +type: string + + + ### revision entity fields - all revision related events should have these. + page_id: +description: The page ID of the page this revision belongs to. +type: integer +minimum: 1 + + page_title: +description: The normalized title of the page this revision belongs to. +type: string + + page_namespace: +description: The namespace of the page this revision belongs to. +type: integer + + rev_id: +description: The revision ID created by this event +type: integer +minimum: 0 + + rev_parent_id: +description: The parent revision of the revision that this event affects. +type: integer +minimum: 0 + + rev_timestamp: +description: > + The revision's creation time in
[MediaWiki-commits] [Gerrit] mediawiki...LoginNotify[master]: Allow notification emails for sucessful logins
Niharika29 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362320 ) Change subject: Allow notification emails for sucessful logins .. Allow notification emails for sucessful logins Bug: T107707 Change-Id: Iad330f1df4d05e3c17d093e4b6ace8986fb7bfb1 --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LoginNotify refs/changes/20/362320/1 diff --git a/i18n/en.json b/i18n/en.json index 764c890..01273fb 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -15,7 +15,7 @@ "loginnotify-primary-link": "Help", "notification-loginnotify-login-fail-email-subject": "{{PLURAL:$2|Failed attempt|Multiple failed attempts}} to log in to {{SITENAME}} as $1", "notification-loginnotify-login-success-email-subject": "Login to {{SITENAME}} as $1 from a computer you have not recently used", - "notification-header-login-success": "Someone has successfully logged into your account from a computer which you have not edited from recently.", + "notification-header-login-success": "Someone (probably you) recently logged in to your account from a new device. If this was you, then you can disregard this message. If it wasn't you, then it's recommended that you change your password, and check your account activity.", "notification-new-bundled-header-login-fail": "There {{PLURAL:$1|has been '''a failed attempt'''|have been '''$1 failed attempts'''}} to log in to your account from a new device since the last time you logged in. If it wasn't you, please make sure your account has a strong password.", "notification-known-header-login-fail": "There have been {{PLURAL:$1|has been '''a failed attempt'''|have been '''$1 failed attempts'''}} to log in to your account since the last time you logged in. If it wasn't you, please make sure your account has a strong password.", "notification-new-unbundled-header-login-fail": "There {{PLURAL:$1|has been '''a failed attempt'''|have been '''multiple failed attempts'''}} to log in to your account from a new device. Please make sure your account has a strong password." -- To view, visit https://gerrit.wikimedia.org/r/362320 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad330f1df4d05e3c17d093e4b6ace8986fb7bfb1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LoginNotify Gerrit-Branch: master Gerrit-Owner: Niharika29___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Collection[master]: [WIP] Render TOC with vivliostyle
Gergő Tisza has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362319 ) Change subject: [WIP] Render TOC with vivliostyle .. [WIP] Render TOC with vivliostyle Adds the ability to display books in vivliostyle viewer. (Note that vivliostyle has AGPL license. It is not included in the patch, needs to be installed via composer.) Bug: T168004 Change-Id: I1144c57ae3d23da0aa23b40122bdcf20d0ec7b94 --- M Collection.php M SpecialRenderBook.php M composer.json M includes/BookRenderer.php D modules/offline.css A modules/offline.less 6 files changed, 186 insertions(+), 49 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection refs/changes/19/362319/1 diff --git a/Collection.php b/Collection.php index fc989a6..adee851 100644 --- a/Collection.php +++ b/Collection.php @@ -258,10 +258,29 @@ 'dependencies' => 'ext.collection.bookcreator' ], 'ext.collection.offline' => $collResourceTemplate + [ - 'styles' => 'offline.css', + 'styles' => 'offline.less', + ], + 'vivliostyle' => [ + 'localBasePath' => __DIR__ . '/vivliostyle-viewer', + 'remoteExtPath' => 'Collection/vivliostyle-viewer', + 'scripts' => [ + 'js/main.js', + 'js/load.js', + ], + 'styles' => [ + 'resources/vivliostyle-viewport.css', + // skipping resources/vivliostyle-viewport-screen.css - not relevant for print + 'css/vivliostyle-viewer.css', + 'css/ui.arrows.css', + 'css/ui.menu-bar.css', + 'css/ui.message-dialog.css', + 'css/ui.loading-overlay.css', + ], ], ]; +$wgCollectionVivlioHtml = __DIR__ . '/vivliostyle-viewer/vivliostyle-viewer.html'; + # register global Ajax functions: function wfAjaxGetCollection() { diff --git a/SpecialRenderBook.php b/SpecialRenderBook.php index f45fa9c..2002533 100644 --- a/SpecialRenderBook.php +++ b/SpecialRenderBook.php @@ -2,7 +2,6 @@ use MediaWiki\Extensions\Collection\BookRenderer; use MediaWiki\Extensions\Collection\DataProvider; -use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; function d($x) { @@ -30,16 +29,27 @@ } public function execute( $subPage ) { + $key = null; $out = $this->getOutput(); + if ( substr( $subPage, 0, 6 ) === 'share/' ) { + $subPage = 'raw'; + $key = substr( $subPage, 6 ); + } switch ( $subPage ) { + case 'refresh': + $book = $this->getBook( '-' ); + $url = $this->getPageTitle()->getFullURL( [ 'key' => $book['key'] ] ); + $out->redirect( $url ); + return; + case 'raw': $context = new DerivativeContext( $this->getContext() ); $context->setSkin( new SkinApi() ); $out->setContext( $context ); // fall through case 'skinned': - $book = $this->getBook(); + $book = $this->getBook( $key ); $out->addModuleStyles( [ 'ext.collection.offline' ] ); $out->addModules( $book['modules'] ); $out->addModuleScripts( $book['modulescripts'] ); @@ -49,11 +59,13 @@ return; case 'electron': + case 'electron-vivlio': // FIXME should just redirect to /raw instead and make that cacheable but // need non-session-based storage for that $book = $this->getBook(); - $bookUrl = $this->getPageTitle( 'skinned' )->getFullURL( [ 'key' => $book['key'] ] ); + $mode = ( $subPage === 'electron-vivlio' ) ? 'vivlio' : 'skinned'; + $bookUrl = $this->getUrl( $mode, $book['key'] ); // hack hack $electronUrl = 'http://electron.local.wmftest.net:10241/pdf'; $accessKey = 'secret'; @@ -67,15 +79,23 @@ default: $options = [ + 'refresh' => 'purge cache & re-render book', 'raw' => 'HTML, raw',
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: RCFilters: Change tooltip messages for view buttons
Mooeypoo has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362318 ) Change subject: RCFilters: Change tooltip messages for view buttons .. RCFilters: Change tooltip messages for view buttons Bug: T167384 Change-Id: I30ec6b8931539ccaad8d2d1a609d117f2a13767d --- M languages/i18n/en.json M languages/i18n/qqq.json M resources/Resources.php M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuHeaderWidget.js M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js 5 files changed, 12 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/18/362318/1 diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 966439b..34c92f4 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -1443,6 +1443,9 @@ "rcfilters-tag-prefix-namespace-inverted": ":not $1", "rcfilters-tag-prefix-tags": "#$1", "rcfilters-view-tags": "Tagged edits", + "rcfilters-view-namespaces-tooltip": "Filter results by namespaces", + "rcfilters-view-tags-tooltip": "Filter results using edit tags", + "rcfilters-view-return-to-default-tooltip": "Return to main filter menu", "rcnotefrom": "Below {{PLURAL:$5|is the change|are the changes}} since $3, $4 (up to $1 shown).", "rclistfromreset": "Reset date selection", "rclistfrom": "Show new changes starting from $2, $3", diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json index d03da1f..d4f5285 100644 --- a/languages/i18n/qqq.json +++ b/languages/i18n/qqq.json @@ -1633,6 +1633,9 @@ "rcfilters-tag-prefix-namespace-inverted": "Prefix for the namespace inverted tags in [[Special:RecentChanges]]. Namespace tags use a colon (:) as prefix. Please keep this format.\n\nParameters:\n* $1 - Filter name.", "rcfilters-tag-prefix-tags": "Prefix for the edit tags in [[Special:RecentChanges]]. Edit tags use a hash (#) as prefix. Please keep this format.\n\nParameters:\n* $1 - Tag display name.", "rcfilters-view-tags": "Title for the tags view in [[Special:RecentChanges]]\n{{Identical|Tag}}", + "rcfilters-view-namespaces-tooltip": "Tooltip for the button that loads the namespace view in [[Special:RecentChanges]]", + "rcfilters-view-tags-tooltip": "Tooltip for the button that loads the tags view in [[Special:RecentChanges]]", + "rcfilters-view-return-to-default-tooltip": "Tooltip for the button that returns to the default filter view in [[Special:RecentChanges]]", "rcnotefrom": "This message is displayed at [[Special:RecentChanges]] when viewing recentchanges from some specific time.\n\nThe corresponding message is {{msg-mw|Rclistfrom}}.\n\nParameters:\n* $1 - the maximum number of changes that are displayed\n* $2 - (Optional) a date and time\n* $3 - a date\n* $4 - a time\n* $5 - Number of changes are displayed, for use with PLURAL", "rclistfromreset": "Used on [[Special:RecentChanges]] to reset a selection of a certain date range.", "rclistfrom": "Used on [[Special:RecentChanges]]. Parameters:\n* $1 - (Currently not use) date and time. The date and the time adds to the rclistfrom description.\n* $2 - time. The time adds to the rclistfrom link description (with split of date and time).\n* $3 - date. The date adds to the rclistfrom link description (with split of date and time).\n\nThe corresponding message is {{msg-mw|Rcnotefrom}}.", diff --git a/resources/Resources.php b/resources/Resources.php index ccfe970..5b44f7b 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1851,6 +1851,9 @@ 'rcfilters-tag-prefix-namespace-inverted', 'rcfilters-tag-prefix-tags', 'rcfilters-view-tags', + 'rcfilters-view-namespaces-tooltip', + 'rcfilters-view-tags-tooltip', + 'rcfilters-view-return-to-default-tooltip', 'blanknamespace', 'namespaces', 'invert', diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuHeaderWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuHeaderWidget.js index 0138884..d0ad8d5 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuHeaderWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterMenuHeaderWidget.js @@ -29,7 +29,7 @@ this.backButton = new OO.ui.ButtonWidget( { icon: 'previous', framed: false, - title: mw.msg( 'rcfilters-filterlist-title' ), + title: mw.msg( 'rcfilters-view-return-to-default-tooltip' ), classes: [ 'mw-rcfilters-ui-filterMenuHeaderWidget-backButton' ] } );
[MediaWiki-commits] [Gerrit] wikimedia...polloi[master]: Fix spline smoothing and add tests
Chelsyx has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362107 ) Change subject: Fix spline smoothing and add tests .. Fix spline smoothing and add tests - This patch fixes a bug wherein spline smoothing was broken. - This patch also adds a bunch of unit tests (via testthat) because if we had those earlier, we would have known that the previous patch actually broke spline smoothing. - There is now an example dataset (wdqs_usage) that is used in examples an some of the unit tests. - This patch also finally fixes the issue with compress() wherein it returned really weird results if the input vector contained a 0. - Also! There is lint checking now! It is included as a unit test. - While I was at it, I fixed a bunch of stylistic issues (spacing, line lengths, single vs double quotes) and documentation issues (e.g. missing descriptions that `R CMD check` would yell about). Bug: T169125, T153856 Change-Id: I5752d0a528bffb2bee6186d49efd4a751551cb95 --- M .Rbuildignore A .lintr M DESCRIPTION M NAMESPACE M NEWS.md M R/check_notify.R M R/data.R M R/dygraphs.R M R/manipulate.R M R/maths.R M R/reading.R M R/shiny.R M R/smoothing.R M R/utils.R A data/wdqs_usage.rda M man/automata_select.Rd M man/cbind_fill.Rd M man/compress.Rd M man/cond_color.Rd M man/cond_icon.Rd A man/get_sample_data.Rd M man/make_dygraph.Rd M man/parse_wikiid.Rd M man/percent_change.Rd M man/portal_regions.Rd M man/read_dataset.Rd M man/smart_palette.Rd M man/smooth_select.Rd M man/smoother.Rd M man/subset_by_date_range.Rd M man/timeframe_daterange.Rd M man/timeframe_select.Rd M man/update_prefixes.Rd M man/update_projects.Rd A man/wdqs_usage.Rd M polloi.Rproj A tests/testthat.R A tests/testthat/test-manipulation.R A tests/testthat/test-maths.R A tests/testthat/test-smoothing.R A tests/testthat/test-syntax.R 41 files changed, 412 insertions(+), 163 deletions(-) Approvals: Chelsyx: Verified; Looks good to me, approved diff --git a/.Rbuildignore b/.Rbuildignore index 8ed3933..a7ed3c6 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,4 +1,5 @@ ^.*\.Rproj$ ^\.Rproj\.user$ -.gitreview +^\.gitreview$ ^CONDUCT\.md$ +^\.lintr diff --git a/.lintr b/.lintr new file mode 100644 index 000..0c6cdb9 --- /dev/null +++ b/.lintr @@ -0,0 +1,4 @@ +linters: with_defaults(line_length_linter(120), object_usage_linter = NULL, closed_curly_linter = NULL, open_curly_linter = NULL) +exclude: "# Exclude Linting" +exclude_start: "# Begin Exclude Linting" +exclude_end: "# End Exclude Linting" diff --git a/DESCRIPTION b/DESCRIPTION index 933d209..94d9e10 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: polloi Type: Package Title: Common Functionality for Wikimedia Dashboards -Version: 0.1.9 -Date: 2017-06-26 +Version: 0.2.0 +Date: 2017-06-28 Authors@R: c( person("Mikhail", "Popov", email = "mikh...@wikimedia.org", role = c("aut", "cre")), person("Chelsy", "Xie", email = "c...@wikimedia.org", role = "aut"), @@ -36,7 +36,9 @@ zoo Suggests: datasets, -ISOcodes +ISOcodes, +lintr, +testthat LazyData: TRUE Roxygen: list(markdown = TRUE) RoxygenNote: 6.0.1 diff --git a/NAMESPACE b/NAMESPACE index 80881aa..1b06a9b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -44,7 +44,6 @@ importFrom(lubridate,ymd) importFrom(magrittr,"%>%") importFrom(magrittr,set_names) -importFrom(readr,read_delim) importFrom(rvest,html_nodes) importFrom(rvest,html_table) importFrom(shiny,icon) diff --git a/NEWS.md b/NEWS.md index 21243cb..713fb16 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,12 +1,20 @@ +polloi 0.2.0 + +- Adds unit tests and lint checking ([T145445](https://phabricator.wikimedia.org/T145445)). +- Adds an example dataset (`wdqs_usage`) that is used for running examples and tests. +- Fixes problem with spline smoothing ([T169125](https://phabricator.wikimedia.org/T169125)). +- Fixes a whole bunch of stylistic issues (removes lints). +- Fixes a bug with `compress()` wherein it would yield weird results if the input vector included a 0. + polloi 0.1.9 -- Adds geography datasets and functions ([T167913](https://phabricator.wikimedia.org/T167913)) +- Adds geography datasets and functions ([T167913](https://phabricator.wikimedia.org/T167913)). polloi 0.1.8 -- Updates dataset of prefixes -- Changes path to download datasets from -- Uses latest roxygen with markdown support +- Updates dataset of prefixes. +- Changes path to download datasets from. +- Uses latest roxygen with markdown support. polloi 0.1.7 diff --git a/R/check_notify.R b/R/check_notify.R index 1e5c840..c6ff3d0 100644 --- a/R/check_notify.R +++ b/R/check_notify.R @@ -16,7 +16,7 @@ # e.g. label = "desktop events" yesterday_date <- Sys.Date() - 1 if (!(yesterday_date %in% dataset$date)) { -return(notificationItem(text = paste("No", label," from yesterday."), +
[MediaWiki-commits] [Gerrit] mediawiki...CirrusSearch[wmf/1.30.0-wmf.7]: Explore similar widget for SpecialSearch
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362270 ) Change subject: Explore similar widget for SpecialSearch .. Explore similar widget for SpecialSearch Implements the 'explore similar' feature that adds extended meta-data to SRP search results Feature description: https://www.mediawiki.org/wiki/Cross-wiki_Search_Result_Improvements/explore_similar demo URL: http://sistersearch.wmflabs.org/w/index.php?search=~rainbow=Special:Search Bug: T149809 Change-Id: I2eac255738ec0a703da12af42325f060679b934d --- M CirrusSearch.php M i18n/en.json M i18n/qqq.json M includes/Hooks.php A resources/ext.cirrus.explore-similar.js A resources/ext.cirrus.explore-similar.less 6 files changed, 869 insertions(+), 7 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/CirrusSearch.php b/CirrusSearch.php index b05c3e3..43b2079 100644 --- a/CirrusSearch.php +++ b/CirrusSearch.php @@ -,9 +,14 @@ $wgCirrusSearchNewCrossProjectPage = false; /** - * Informs SpeciaSearch in core that we want - * to display multimedia search results alongside - * crossproject results + * Enables the explore similar feature for search results + * which adds links to related pages (morelike), categories and + * languages beside each search result on the SERP. + */ +$wgCirrusExploreSimilarResults = false; + +/** + * The number of results to return in cross-project search */ $wgCirrusSearchCrossProjectShowMultimedia = false; @@ -1379,7 +1384,7 @@ 'resources/ext.cirrus.serp.js', ], 'dependencies' => [ - 'mediawiki.Uri' + 'mediawiki.Uri', ], 'styles' => [], 'messages' => [], @@ -1387,6 +1392,30 @@ 'localBasePath' => __DIR__, 'targets' => [ 'desktop', 'mobile' ], ], + "ext.cirrus.explore-similar" => [ + 'scripts' => [ + 'resources/ext.cirrus.explore-similar.js', + ], + 'dependencies' => [ + 'mediawiki.api.messages', + 'mediawiki.template.mustache', + ], + 'styles' => [ + 'resources/ext.cirrus.explore-similar.less', + ], + 'remoteExtPath' => 'CirrusSearch', + 'localBasePath' => __DIR__, + 'targets' => [ 'desktop' ], + 'messages' => [ + 'cirrussearch-explore-similar-related', + 'cirrussearch-explore-similar-categories', + 'cirrussearch-explore-similar-languages', + 'otherlanguages', + 'cirrussearch-explore-similar-related-none', + 'cirrussearch-explore-similar-categories-none', + 'cirrussearch-explore-similar-languages-none', + ] + ] ]; /** diff --git a/i18n/en.json b/i18n/en.json index 29cb7b9..2e920ed 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -70,5 +70,11 @@ "cirrussearch-feature-too-many-conditions": "Too many conditions provided to '$1', truncating to $2.", "cirrussearch-incategory-feature-no-valid-categories": "No valid categories provided to '$1'.", "cirrussearch-mlt-feature-no-valid-titles": "No valid titles provided to '$1'.", - "cirrussearch-mlt-not-configured": "The '$1' feature is misconfigured. Ask an admin to fix $wgCirrusSearchMoreLikeThisFields" + "cirrussearch-mlt-not-configured": "The '$1' feature is misconfigured. Ask an admin to fix $wgCirrusSearchMoreLikeThisFields", + "cirrussearch-explore-similar-related": "Related", + "cirrussearch-explore-similar-categories": "Categories", + "cirrussearch-explore-similar-languages": "Languages", + "cirrussearch-explore-similar-related-none": "No related pages available", + "cirrussearch-explore-similar-categories-none": "No categories available", + "cirrussearch-explore-similar-languages-none": "Not available in local languages" } diff --git a/i18n/qqq.json b/i18n/qqq.json index c1070fd..bb1830a 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -79,5 +79,12 @@ "cirrussearch-feature-too-many-conditions": "Warning shown to users when more conditions than are allowed were provided to a keyword feature.", "cirrussearch-incategory-feature-no-valid-categories": "Warning shown to users when no valid categories were found with their incategory keyword.", "cirrussearch-mlt-feature-no-valid-titles": "Warning shown to users when no valid titles were found with the provided 'morelike' keyword.", - "cirrussearch-mlt-not-configured": "Warning shown to users when issuing a 'more like this' query and the wiki hasn't configured
[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Make multiple colons escaping interlanguage links invalid
Arlolra has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362317 ) Change subject: Make multiple colons escaping interlanguage links invalid .. Make multiple colons escaping interlanguage links invalid Depends-On: Icabd34bbf15781bb891bd8e0c079d1a65eb28595 Change-Id: I62c48afdeb7f237ab196e528b87cd935171026ec --- M lib/wt2html/tt/LinkHandler.js M tests/parserTests.txt 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/17/362317/1 diff --git a/lib/wt2html/tt/LinkHandler.js b/lib/wt2html/tt/LinkHandler.js index b05f57f..7360dca 100644 --- a/lib/wt2html/tt/LinkHandler.js +++ b/lib/wt2html/tt/LinkHandler.js @@ -84,6 +84,7 @@ // remove the colon escape info.href = info.href.substr(1); } + console.assert(!/^:/.test(info.href)); // strip ./ prefixes info.href = info.href.replace(/^(?:\.\/)+/, ''); diff --git a/tests/parserTests.txt b/tests/parserTests.txt index 909d036..37304a4 100644 --- a/tests/parserTests.txt +++ b/tests/parserTests.txt @@ -8793,6 +8793,25 @@ http://zh.wikipedia.org/wiki/Chinese; title="zh:Chinese"> zh : Chinese !! end +!! test +Multiple colons escaping interlanguage links +!! options +parsoid=wt2html +!! wikitext +[[:es:Spanish]] +[[::es:Spanish]] +[[:::es:Spanish]] +!! html/php +http://es.wikipedia.org/wiki/Spanish; class="extiw" title="es:Spanish">es:Spanish +[[::es:Spanish]] +[[:::es:Spanish]] + +!! html/parsoid +http://es.wikipedia.org/wiki/Spanish; title="es:Spanish">es:Spanish +[[::es:Spanish]] +[[:::es:Spanish]] +!! end + ## parsoid html2wt will normalize the space to _ !! test Space and question mark encoding in interlanguage links (T95473) -- To view, visit https://gerrit.wikimedia.org/r/362317 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I62c48afdeb7f237ab196e528b87cd935171026ec Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikimediaEvents[wmf/1.30.0-wmf.7]: Adding event-logging for explore-similar on SRP
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362265 ) Change subject: Adding event-logging for explore-similar on SRP .. Adding event-logging for explore-similar on SRP Adds event tracking for the cirrusSearch Explore Similar feature. Also sets up bucketing for Explore Similar AB test and updates the schema version. Bug: T149809 Change-Id: Ia58dc41f685bbd6d385dfb7cc5b171ce0098d8aa (cherry picked from commit 58094c8bc65394a7bfeb0cde2ef825dc05a14f65) --- M extension.json M modules/ext.wikimediaEvents.searchSatisfaction.js 2 files changed, 70 insertions(+), 5 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index 14ab13a..a6a5554 100644 --- a/extension.json +++ b/extension.json @@ -117,7 +117,7 @@ "schema.TestSearchSatisfaction2": { "class": "ResourceLoaderSchemaModule", "schema": "TestSearchSatisfaction2", - "revision": 16270835 + "revision": 16909631 }, "schema.GeoFeatures": { "class": "ResourceLoaderSchemaModule", diff --git a/modules/ext.wikimediaEvents.searchSatisfaction.js b/modules/ext.wikimediaEvents.searchSatisfaction.js index 62655f6..004f929 100644 --- a/modules/ext.wikimediaEvents.searchSatisfaction.js +++ b/modules/ext.wikimediaEvents.searchSatisfaction.js @@ -113,8 +113,8 @@ function initialize( session ) { var sessionId = session.get( 'sessionId' ), - // No sub-tests currently running - validBuckets = [], + // Explore Similar AB test + validBuckets = [ 'explore_similar_control', 'explore_similar_test' ], sampleSize = ( function () { var dbName = mw.config.get( 'wgDBname' ), // Provides a place to handle wiki-specific sampling, @@ -136,8 +136,8 @@ subTest: null }, enwiki: { - test: 2000, - subTest: null + test: 1000, + subTest: 2 }, enwiktionary: { test: 40, @@ -687,6 +687,71 @@ } ); + /** +* Loading Explore Similar module for A/B test +*/ + if ( session.get( 'subTest' ) === 'explore_similar_test' ) { + mw.loader.load( 'ext.cirrus.explore-similar' ); + } + /** +* Explore similar event logging +* Listens for custom event sent by the Explore Similar module. +* These events pass along extra data that conforms to the +* searchSatisfaction2 schema. +* +*/ + mw.trackSubscribe( 'ext.CirrusSearch.exploreSimilar.open', function ( topic, data ) { + // `params` is cloned to avoid overriding the `extraParam` property. + var esParams = $.extend( true, {}, params ), + extraParams = JSON.stringify( { + hoverId: data.hoverId, + section: data.section, + results: data.results + } ); + esParams.extraParams = extraParams; + + logEvent( 'hover-on', esParams ); + } ); + + mw.trackSubscribe( 'ext.CirrusSearch.exploreSimilar.close', function ( topic, data ) { + + var esParams = $.extend( true, {}, params ), + extraParams = JSON.stringify( { + hoverId: data.hoverId + } ); + + esParams.extraParams = extraParams; + +
[MediaWiki-commits] [Gerrit] mediawiki...OpenStackManager[master]: Split ext.openstack.base JavaScript from ext.openstack style...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362260 ) Change subject: Split ext.openstack.base JavaScript from ext.openstack style module .. Split ext.openstack.base JavaScript from ext.openstack style module The 'ext.openstack' module is only ever loaded through addModuleStyles() in this extension. Yet, it also contains JS code and dependencies (which are ignored by addModuleStyles). The other two modules (..Address and ..Instance) depended on this 'ext.openstack' pseudo-style module, which would then cause the styles to load for a second time, and this time with the JS code and dependencies as well. Split off this re-usable JS portion into its own module. Bug: T92459 Change-Id: Ia430fa103b7d2524fdc8ddbe9a0b73481d8f7137 --- M OpenStackManager.php 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: BryanDavis: Looks good to me, approved jenkins-bot: Verified diff --git a/OpenStackManager.php b/OpenStackManager.php index 9cb2f4e..0e0c738 100644 --- a/OpenStackManager.php +++ b/OpenStackManager.php @@ -239,21 +239,22 @@ 'position' => 'top', 'styles' => 'modules/ext.openstack.css', +] + $commonModuleInfo; +$wgResourceModules['ext.openstack.base'] = [ 'dependencies' => [ + 'ext.openstack', 'jquery.spinner', 'mediawiki.api', 'jquery.ui.dialog', ], - 'scripts' => [ - 'modules/ext.openstack.js', - ], + 'scripts' => 'modules/ext.openstack.js', ] + $commonModuleInfo; $wgResourceModules['ext.openstack.Instance'] = [ 'dependencies' => [ - 'ext.openstack', + 'ext.openstack.base', ], 'messages' => [ @@ -273,7 +274,7 @@ $wgResourceModules['ext.openstack.Address'] = [ 'dependencies' => [ - 'ext.openstack', + 'ext.openstack.base', ], 'messages' => [ -- To view, visit https://gerrit.wikimedia.org/r/362260 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia430fa103b7d2524fdc8ddbe9a0b73481d8f7137 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/OpenStackManager Gerrit-Branch: master Gerrit-Owner: KrinkleGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: Anomie Gerrit-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[wmf/1.30.0-wmf.7]: RCFilters: Fix typo in removing a saved query
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362113 ) Change subject: RCFilters: Fix typo in removing a saved query .. RCFilters: Fix typo in removing a saved query Bug: T169107 Change-Id: I7c1535f6ae75159a069ebde7db781f6a875fcb3c (cherry picked from commit 824f4981873968af0049a5beef99a806e6b54323) --- M resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js index efccc11..8536570 100644 --- a/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js +++ b/resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.SavedQueriesModel.js @@ -145,10 +145,10 @@ // Check if this item was the default if ( String( this.getDefault() ) === String( queryID ) ) { // Nulify the default - this.savedQueriesModel.setDefault( null ); + this.setDefault( null ); } - this.savedQueriesModel.removeItems( [ query ] ); + this.removeItems( [ query ] ); } }; -- To view, visit https://gerrit.wikimedia.org/r/362113 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7c1535f6ae75159a069ebde7db781f6a875fcb3c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.7 Gerrit-Owner: MooeypooGerrit-Reviewer: Catrope Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.7]: RCFilters: Followup I5cede87633147: Set actual value rather ...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362308 ) Change subject: RCFilters: Followup I5cede87633147: Set actual value rather than object .. RCFilters: Followup I5cede87633147: Set actual value rather than object Bug: T169042 Change-Id: Ib99981c212dbe1522defc1c1cc34fa01fff91dba --- M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js index 3f920f0..e74c729 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js @@ -149,7 +149,7 @@ this.input.getValidity() .done( function () { widget.controller.saveCurrentQuery( label ); - widget.input.setValue( this.input, '' ); + widget.input.setValue( '' ); widget.emit( 'saveCurrent' ); widget.popup.toggle( false ); } ); -- To view, visit https://gerrit.wikimedia.org/r/362308 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib99981c212dbe1522defc1c1cc34fa01fff91dba Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.7 Gerrit-Owner: MooeypooGerrit-Reviewer: Catrope Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.7]: RCFilters: Followup I200720ffde8ad: Hide extended footer if ...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362110 ) Change subject: RCFilters: Followup I200720ffde8ad: Hide extended footer if gater is disabled .. RCFilters: Followup I200720ffde8ad: Hide extended footer if gater is disabled Bug: T169163 Change-Id: I62f63cbf06a7e42864faca1a196903eb34ea077b --- M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js 2 files changed, 5 insertions(+), 2 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js index 70381f2..dc1556b 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterTagMultiselectWidget.js @@ -47,6 +47,7 @@ footers: [ { name: 'viewSelect', + disabled: !mw.config.get( 'wgStructuredChangeFiltersEnableExperimentalViews' ), // View select menu, appears on default view only $element: $( '' ) .append( new mw.rcfilters.ui.ViewSwitchWidget( this.controller, this.model ).$element ), diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js index 74f8bcd..1c808d4 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.MenuSelectWidget.js @@ -91,8 +91,10 @@ views: footerData.views }; - this.footers.push( adjustedData ); - this.$element.append( adjustedData.$element ); + if ( !footerData.disabled ) { + this.footers.push( adjustedData ); + this.$element.append( adjustedData.$element ); + } }.bind( this ) ); // Switch to the correct view -- To view, visit https://gerrit.wikimedia.org/r/362110 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I62f63cbf06a7e42864faca1a196903eb34ea077b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.7 Gerrit-Owner: MooeypooGerrit-Reviewer: Catrope Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/config[master]: Add PHP 7.0 tests for wikidiff2 and luasandbox
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362314 ) Change subject: Add PHP 7.0 tests for wikidiff2 and luasandbox .. Add PHP 7.0 tests for wikidiff2 and luasandbox Change-Id: I75528d8674864560b2fae191c7a465fb1a2f3523 --- M jjb/php-extensions.yaml M zuul/layout.yaml 2 files changed, 30 insertions(+), 0 deletions(-) Approvals: Paladox: Looks good to me, but someone else must approve Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/jjb/php-extensions.yaml b/jjb/php-extensions.yaml index 7d80c47..db09024 100644 --- a/jjb/php-extensions.yaml +++ b/jjb/php-extensions.yaml @@ -21,6 +21,30 @@ triggers: - zuul +- job: +name: 'php-compile-php70' +node: contintLabsSlave && DebianJessie +defaults: use-remoteonly-zuul +triggers: + - zuul +builders: + - shell: | +/usr/bin/phpize7.0 --version +/usr/bin/phpize7.0 +./configure +make +REPORT_EXIT_STATUS=1 make test +publishers: + - archive-test-logs + +- job: +!!merge : *php-compile-php70 +name: 'php-compile-php70-jessie' +node: ci-jessie-wikimedia +triggers: + - zuul + + - job: name: 'php-compile-hhvm' node: contintLabsSlave && DebianJessie diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 1ebff2b..d2a875e 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -6930,24 +6930,30 @@ test: - php-compile-hhvm-test - php-compile-php55 + - php-compile-php70 gate-and-submit: - php-compile-hhvm-test - php-compile-php55 + - php-compile-php70 experimental: - php-compile-hhvm-test-jessie - php-compile-php55-trusty + - php-compile-php70-jessie - name: mediawiki/php/wikidiff2 # no check pipeline since -build runs code :-) test: - php-compile-hhvm - php-compile-php55 + - php-compile-php70 gate-and-submit: - php-compile-hhvm - php-compile-php55 + - php-compile-php70 experimental: - php-compile-hhvm-jessie - php-compile-php55-trusty + - php-compile-php70-jessie - name: mediawiki/php/wmerrors # no check pipeline since -build runs code :-) -- To view, visit https://gerrit.wikimedia.org/r/362314 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I75528d8674864560b2fae191c7a465fb1a2f3523 Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Legoktm Gerrit-Reviewer: Paladox Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Stop reader surveys
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/360849 ) Change subject: Stop reader surveys .. Stop reader surveys Bug: T131949 Change-Id: Id2234f938596a7cc1ff54943854c3ff9b0ad113f --- M wmf-config/InitialiseSettings.php 1 file changed, 0 insertions(+), 266 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified Jdlrobson: Looks good to me, but someone else must approve diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 1621184..930322d 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -18729,276 +18729,10 @@ // https://phabricator.wikimedia.org/T110661 'wmgUseQuickSurveys' => [ 'default' => false, - 'arwiki' => true, - 'bnwiki' => true, - 'dewiki' => true, - 'enwiki' => true, - 'eswiki' => true, - 'hewiki' => true, - 'hiwiki' => true, - 'huwiki' => true, - 'jawiki' => true, - 'nlwiki' => true, - 'rowiki' => true, - 'ruwiki' => true, - 'ukwiki' => true, - 'zhwiki' => true, ], 'wgQuickSurveysConfig' => [ 'default' => [], - // T168196 - 'arwiki' => [ - [ - 'enabled' => true, - 'name' => 'Reader-segmentation-3-ar-main', - 'type' => 'external', - 'description' => 'Reader-segmentation-1-description', - 'link' => 'Reader-segmentation-3-link', - 'question' => 'Reader-segmentation-3-message', - 'privacyPolicy' => 'Reader-segmentation-3-privacy', - 'coverage' => 0.1, - 'platforms' => [ - 'desktop' => [ 'stable' ], - 'mobile' => [ 'stable' ], - ], - 'instanceTokenParameterName' => 'entry.901222064', - ], - ], - // T168500 - 'bnwiki' => [ - [ - 'enabled' => true, - 'name' => 'Reader-segmentation-3-bn-main', - 'type' => 'external', - 'description' => 'Reader-segmentation-1-description', - 'link' => 'Reader-segmentation-3-link', - 'question' => 'Reader-segmentation-3-message', - 'privacyPolicy' => 'Reader-segmentation-3-privacy', - 'coverage' => 1, - 'platforms' => [ - 'desktop' => [ 'stable' ], - 'mobile' => [ 'stable' ], - ], - 'instanceTokenParameterName' => 'entry.901222064', - ], - ], - // T168278 - 'dewiki' => [ - [ - 'enabled' => true, - 'name' => 'Reader-segmentation-3-de-main', - 'type' => 'external', - 'description' => 'Reader-segmentation-1-description', - 'link' => 'Reader-segmentation-3-link', - 'question' => 'Reader-segmentation-3-message', - 'privacyPolicy' => 'Reader-segmentation-3-privacy', - 'coverage' => 0.2, - 'platforms' => [ - 'desktop' => [ 'stable' ], - 'mobile' => [ 'stable' ], - ], - 'instanceTokenParameterName' => 'entry.901222064', - ], - ], - // T168197 - 'enwiki' => [ - [ - 'enabled' => true, - 'name' => 'Reader-segmentation-3-en-main', - 'type' => 'external', - 'description' => 'Reader-segmentation-1-description', - 'link' => 'Reader-segmentation-3-link', - 'question' => 'Reader-segmentation-3-message', - 'privacyPolicy' => 'Reader-segmentation-3-privacy', - 'coverage' => 0.025, - 'platforms' => [ - 'desktop' => [ 'stable' ], - 'mobile' => [ 'stable' ], - ], - 'instanceTokenParameterName' => 'entry.901222064', - ], - ], - // T168209 - 'eswiki' => [ - [ - 'enabled' => true, - 'name' => 'Reader-segmentation-3-es-main', - 'type' => 'external', - 'description' => 'Reader-segmentation-1-description', - 'link' => 'Reader-segmentation-3-link', -
[MediaWiki-commits] [Gerrit] integration/config[master]: Add mw-config to gate-and-submit-swat pipeline
Paladox has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362316 ) Change subject: Add mw-config to gate-and-submit-swat pipeline .. Add mw-config to gate-and-submit-swat pipeline Bug: T169279 Change-Id: I684bfab2491c7e47412bddb4b30f856049971d32 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/16/362316/1 -- To view, visit https://gerrit.wikimedia.org/r/362316 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I684bfab2491c7e47412bddb4b30f856049971d32 Gerrit-PatchSet: 1 Gerrit-Project: integration/config 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...Popups[master]: Allow events without linkInteractionToken to be logged
Pmiazga has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362315 ) Change subject: Allow events without linkInteractionToken to be logged .. Allow events without linkInteractionToken to be logged Changes: - when event doesn't have linkInteractionToken do not check for duplicated tokens - hygiene, move event duplication logic into separate functions for better readability Bug: T168449 Change-Id: I3ae197567ec9f67e104af109d4f1a1c1a6769d32 --- M resources/dist/index.js M resources/dist/index.js.map M src/changeListeners/eventLogging.js 3 files changed, 32 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/15/362315/1 -- To view, visit https://gerrit.wikimedia.org/r/362315 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ae197567ec9f67e104af109d4f1a1c1a6769d32 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: Pmiazga___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/config[master]: Add PHP 7.0 tests for wikidiff2 and luasandbox
Legoktm has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362314 ) Change subject: Add PHP 7.0 tests for wikidiff2 and luasandbox .. Add PHP 7.0 tests for wikidiff2 and luasandbox Change-Id: I75528d8674864560b2fae191c7a465fb1a2f3523 --- M jjb/php-extensions.yaml M zuul/layout.yaml 2 files changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/14/362314/1 diff --git a/jjb/php-extensions.yaml b/jjb/php-extensions.yaml index 7d80c47..db09024 100644 --- a/jjb/php-extensions.yaml +++ b/jjb/php-extensions.yaml @@ -21,6 +21,30 @@ triggers: - zuul +- job: +name: 'php-compile-php70' +node: contintLabsSlave && DebianJessie +defaults: use-remoteonly-zuul +triggers: + - zuul +builders: + - shell: | +/usr/bin/phpize7.0 --version +/usr/bin/phpize7.0 +./configure +make +REPORT_EXIT_STATUS=1 make test +publishers: + - archive-test-logs + +- job: +!!merge : *php-compile-php70 +name: 'php-compile-php70-jessie' +node: ci-jessie-wikimedia +triggers: + - zuul + + - job: name: 'php-compile-hhvm' node: contintLabsSlave && DebianJessie diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 1ebff2b..d2a875e 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -6930,24 +6930,30 @@ test: - php-compile-hhvm-test - php-compile-php55 + - php-compile-php70 gate-and-submit: - php-compile-hhvm-test - php-compile-php55 + - php-compile-php70 experimental: - php-compile-hhvm-test-jessie - php-compile-php55-trusty + - php-compile-php70-jessie - name: mediawiki/php/wikidiff2 # no check pipeline since -build runs code :-) test: - php-compile-hhvm - php-compile-php55 + - php-compile-php70 gate-and-submit: - php-compile-hhvm - php-compile-php55 + - php-compile-php70 experimental: - php-compile-hhvm-jessie - php-compile-php55-trusty + - php-compile-php70-jessie - name: mediawiki/php/wmerrors # no check pipeline since -build runs code :-) -- To view, visit https://gerrit.wikimedia.org/r/362314 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75528d8674864560b2fae191c7a465fb1a2f3523 Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Wikibase[master]: Add descriptions to ES index
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/336911 ) Change subject: Add descriptions to ES index .. Add descriptions to ES index Descriptions follow the same pattern as labels, 'descriptions' field includes per-language fields. Only one description per language. NOTE: descriptions are stored in the index, but are not indexed or searched for now. Bug: T125500 Change-Id: I459c619daf8f7e6c47c1a486428f0ca38f7c8faf --- M repo/Wikibase.php M repo/includes/Search/Elastic/ElasticTermResult.php M repo/includes/Search/Elastic/EntitySearchElastic.php M repo/includes/Search/Elastic/Fields/DescriptionProviderFieldDefinitions.php A repo/includes/Search/Elastic/Fields/DescriptionsField.php M repo/tests/phpunit/data/entitySearch/search_de-ch-en.expected M repo/tests/phpunit/data/entitySearch/search_de-ch.expected M repo/tests/phpunit/data/entitySearch/search_de-ch_strict.expected M repo/tests/phpunit/data/entitySearch/search_en.expected M repo/tests/phpunit/data/entitySearch/search_en_strict.expected M repo/tests/phpunit/data/entitySearch/search_zh-de-ch.expected M repo/tests/phpunit/data/entitySearch/search_zh.expected M repo/tests/phpunit/includes/Search/Elastic/ElasticTermResultTest.php M repo/tests/phpunit/includes/Search/Elastic/EntitySearchElasticTest.php 14 files changed, 155 insertions(+), 90 deletions(-) Approvals: Daniel Kinzler: Looks good to me, approved EBernhardson: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/repo/Wikibase.php b/repo/Wikibase.php index efef3c7..d8a0817 100644 --- a/repo/Wikibase.php +++ b/repo/Wikibase.php @@ -212,10 +212,6 @@ $entitySearchHelper = new Wikibase\Repo\Search\Elastic\EntitySearchElastic( $repo->getLanguageFallbackChainFactory(), $repo->getEntityIdParser(), - new Wikibase\Lib\Store\LanguageFallbackLabelDescriptionLookup( - $repo->getTermLookup(), - $repo->getLanguageFallbackChainFactory()->newFromLanguage( $lang ) - ), $lang, $repo->getContentModelMappings(), $settings diff --git a/repo/includes/Search/Elastic/ElasticTermResult.php b/repo/includes/Search/Elastic/ElasticTermResult.php index cf9cf0b..6820915 100644 --- a/repo/includes/Search/Elastic/ElasticTermResult.php +++ b/repo/includes/Search/Elastic/ElasticTermResult.php @@ -6,7 +6,6 @@ use CirrusSearch\Search\SearchContext; use Wikibase\DataModel\Entity\EntityIdParser; use Wikibase\DataModel\Entity\EntityIdParsingException; -use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup; use Wikibase\DataModel\Term\Term; use Wikibase\LanguageFallbackChain; use Wikibase\Lib\Interactors\TermSearchResult; @@ -16,11 +15,6 @@ * a Wikibase entity by its label or alias. */ class ElasticTermResult implements ResultsType { - - /** -* @var LabelDescriptionLookup -*/ - private $labelDescriptionLookup; /** * @var EntityIdParser @@ -35,13 +29,6 @@ private $searchLanguageCodes; /** -* List of language codes in the display fallback chain, the first -* is the preferred language. -* @var string[] -*/ - private $displayLanguageCodes; - - /** * Display fallback chain. * @var LanguageFallbackChain */ @@ -50,18 +37,15 @@ /** * ElasticTermResult constructor. * @param EntityIdParser $idParser -* @param LabelDescriptionLookup $labelDescriptionLookup * @param string[] $searchLanguageCodes Language fallback chain for search * @param LanguageFallbackChain $displayFallbackChain Fallback chain for display */ public function __construct( EntityIdParser $idParser, -LabelDescriptionLookup $labelDescriptionLookup, array $searchLanguageCodes, LanguageFallbackChain $displayFallbackChain ) { $this->idParser = $idParser; $this->searchLanguageCodes = $searchLanguageCodes; - $this->labelDescriptionLookup = $labelDescriptionLookup; $this->fallbackChain = $displayFallbackChain; } @@ -74,6 +58,7 @@ $fields = [ 'namespace', 'title' ]; foreach ( $this->fallbackChain->getFetchLanguageCodes() as $code ) { $fields[] = "labels.$code"; + $fields[] = "descriptions.$code"; } return $fields;
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Move fraud filter config to TestConfiguration
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362313 ) Change subject: Move fraud filter config to TestConfiguration .. Move fraud filter config to TestConfiguration Once upon a time I thought it was OK to do stuff in test case constructors. That was totally wrong, as all of the constructors are called before any of the tests are run. These maps don't need to be set dynamically - they can just live in the test config. Change-Id: I33c1260a8d7394ca1722d70eff0bf2c8ddae7a9f --- M tests/phpunit/Adapter/AstroPay/AstroPayTest.php M tests/phpunit/FraudFiltersTest.php M tests/phpunit/TestConfiguration.php 3 files changed, 64 insertions(+), 73 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/13/362313/1 diff --git a/tests/phpunit/Adapter/AstroPay/AstroPayTest.php b/tests/phpunit/Adapter/AstroPay/AstroPayTest.php index 5b6643a..95a7c34 100644 --- a/tests/phpunit/Adapter/AstroPay/AstroPayTest.php +++ b/tests/phpunit/Adapter/AstroPay/AstroPayTest.php @@ -446,7 +446,6 @@ * Test that we run the AntiFraud filters before redirecting */ function testAntiFraudFilters() { - DonationInterface_FraudFiltersTest::setupFraudMaps( $this ); $init = $this->getDonorTestData( 'BR' ); $init['payment_method'] = 'cc'; $init['bank_code'] = 'VD'; diff --git a/tests/phpunit/FraudFiltersTest.php b/tests/phpunit/FraudFiltersTest.php index b8726c7..96245bc 100644 --- a/tests/phpunit/FraudFiltersTest.php +++ b/tests/phpunit/FraudFiltersTest.php @@ -25,77 +25,6 @@ */ class DonationInterface_FraudFiltersTest extends DonationInterfaceTestCase { - /** -* @param $name string The name of the test case -* @param $data array Any parameters read from a dataProvider -* @param $dataName string|int The name or index of the data set -*/ - public function __construct( $name = null, array $data = array(), $dataName = '' ) { - $adapterclass = TESTS_ADAPTER_DEFAULT; - $this->testAdapterClass = $adapterclass; - - parent::__construct( $name, $data, $dataName ); - self::setupFraudMaps( $this ); - } - - public static function setupFraudMaps( $testContext ) { - // Declare so setMwGlobals can override. - global $wgGlobalCollectGatewayCustomFiltersFunctions; - $wgGlobalCollectGatewayCustomFiltersFunctions = null; - - - // Declare here cos reused. - $customFilters = array( - 'getScoreCountryMap' => 50, - 'getScoreUtmCampaignMap' => 50, - 'getScoreUtmSourceMap' => 15, - 'getScoreUtmMediumMap' => 15, - 'getScoreEmailDomainMap' => 75, - ); - - $testContext->setMwGlobals( array( - 'wgDonationInterfaceCustomFiltersActionRanges' => array ( - 'process' => array ( 0, 25 ), - 'review' => array ( 25, 50 ), - 'challenge' => array ( 50, 75 ), - 'reject' => array ( 75, 100 ), - ), - - 'wgDonationInterfaceCustomFiltersRefRules' => array ( - '/donate-error/i' => 5, - ), - - 'wgDonationInterfaceCustomFiltersSrcRules' => array ( '/wikimedia\.org/i' => 80 ), - - 'wgDonationInterfaceCustomFiltersFunctions' => $customFilters, - - 'wgGlobalCollectGatewayCustomFiltersFunctions' => array( - 'getCVVResult' => 20, - 'getAVSResult' => 25, - ) + $customFilters, - - 'wgDonationInterfaceCountryMap' => array ( - 'US' => 40, - 'CA' => 15, - 'RU' => -4, - ), - - 'wgDonationInterfaceUtmCampaignMap' => array ( - '/^(C14_)/' => 14, - '/^(spontaneous)/' => 5 - ), - 'wgDonationInterfaceUtmSourceMap' => array ( - '/somethingmedia/' => 70 - ), - 'wgDonationInterfaceUtmMediumMap' => array ( - '/somethingmedia/' => 80 - ), - 'wgDonationInterfaceEmailDomainMap' => array ( - 'wikimedia.org' => 42, - 'wikipedia.org' => 50, - ), - ) ); - } function
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: SpecialPageFactory::getPage can return null
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361919 ) Change subject: SpecialPageFactory::getPage can return null .. SpecialPageFactory::getPage can return null Change-Id: I12b4969ec0c6b8d5a1d8feeda27152ba6075c4fd --- M includes/specialpage/SpecialPageFactory.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specialpage/SpecialPageFactory.php b/includes/specialpage/SpecialPageFactory.php index 81e2b7e..88336dd 100644 --- a/includes/specialpage/SpecialPageFactory.php +++ b/includes/specialpage/SpecialPageFactory.php @@ -459,7 +459,7 @@ $pages = []; foreach ( self::getPageList() as $name => $rec ) { $page = self::getPage( $name ); - if ( $page->isListed() && !$page->isRestricted() ) { + if ( $page && $page->isListed() && !$page->isRestricted() ) { $pages[$name] = $page; } } @@ -482,8 +482,8 @@ } foreach ( self::getPageList() as $name => $rec ) { $page = self::getPage( $name ); - if ( - $page->isListed() + if ( $page + && $page->isListed() && $page->isRestricted() && $page->userCanExecute( $user ) ) { -- To view, visit https://gerrit.wikimedia.org/r/361919 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I12b4969ec0c6b8d5a1d8feeda27152ba6075c4fd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Legoktm 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...WikimediaMessages[master]: Follow-up 6401f1ec9b69: actually add the RTL version of the ...
Catrope has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362312 ) Change subject: Follow-up 6401f1ec9b69: actually add the RTL version of the feedback icon .. Follow-up 6401f1ec9b69: actually add the RTL version of the feedback icon Bug: T169271 Change-Id: I7818d8140cc33246f32ae7f8e960174e7f9ee227 --- A modules/images/feedback-blue-rtl.svg 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages refs/changes/12/362312/1 diff --git a/modules/images/feedback-blue-rtl.svg b/modules/images/feedback-blue-rtl.svg new file mode 100644 index 000..2e83228 --- /dev/null +++ b/modules/images/feedback-blue-rtl.svg @@ -0,0 +1,4 @@ + +http://www.w3.org/2000/svg; width="42" height="42" viewBox="0 0 42 42"> + + -- To view, visit https://gerrit.wikimedia.org/r/362312 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7818d8140cc33246f32ae7f8e960174e7f9ee227 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaMessages Gerrit-Branch: master Gerrit-Owner: Catrope___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Design fixes for Codemirror
Niharika29 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362311 ) Change subject: Design fixes for Codemirror .. Design fixes for Codemirror Bug: T165178 Change-Id: If5b7c0807ff6fcdb30e1b8fe935b53ee0ca46a0d --- M resources/ext.CodeMirror.less M resources/mode/mediawiki/mediawiki.css 2 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeMirror refs/changes/11/362311/1 diff --git a/resources/ext.CodeMirror.less b/resources/ext.CodeMirror.less index b8830a5..a83114f 100644 --- a/resources/ext.CodeMirror.less +++ b/resources/ext.CodeMirror.less @@ -3,8 +3,14 @@ .CodeMirror { line-height: 1.5em; padding: 0.1em; + + &.CodeMirror-wrap { + font-size: 12px; + line-height: 20px; + } } + .mw-codeMirror-classicToolbar { border: 1px solid #a2a9b1; } diff --git a/resources/mode/mediawiki/mediawiki.css b/resources/mode/mediawiki/mediawiki.css index abf6f73..1a3d937 100644 --- a/resources/mode/mediawiki/mediawiki.css +++ b/resources/mode/mediawiki/mediawiki.css @@ -26,8 +26,8 @@ .cm-mw-template-name { color: #70a; font-weight: bold; } .cm-mw-template-name-mnemonic { font-weight: normal; } .cm-mw-template-argument-name { color: #70a; font-weight: bold; } -.cm-mw-template-delimiter { color: #70a; font-weight: bold; } -.cm-mw-template-bracket { color: #70a; font-weight: bold; } +.cm-mw-template-delimiter { color: #803e9d; font-weight: bold; } +.cm-mw-template-bracket { color: #5b2c6f; font-weight: bold; } .cm-mw-templatevariable { color: #f50; font-weight: normal; } .cm-mw-templatevariable-name { color: #f50; font-weight: bold; } @@ -52,11 +52,11 @@ pre.cm-mw-tag-pre, .cm-mw-tag-pre { background-image: url( img/black4.png ); } pre.cm-mw-tag-nowiki, .cm-mw-tag-nowiki { background-image: url( img/black4.png ); } -.cm-mw-link-pagename { color: #219; font-weight: normal; } +.cm-mw-link-pagename { color: #36c; font-weight: normal; } .cm-mw-link-tosection { color: #08f; font-weight: normal; } .cm-mw-link-bracket { color: #219; font-weight: normal; } /* .cm-mw-link-text { } */ -.cm-mw-link-delimiter { color: #219; font-weight: normal; } +.cm-mw-link-delimiter { color: #2a4b8d; font-weight: normal; } .cm-mw-extlink, .cm-mw-free-extlink { color: #219; font-weight: normal; } .cm-mw-extlink-protocol, .cm-mw-free-extlink-protocol { color: #219; font-weight: bold; } -- To view, visit https://gerrit.wikimedia.org/r/362311 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If5b7c0807ff6fcdb30e1b8fe935b53ee0ca46a0d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CodeMirror Gerrit-Branch: master Gerrit-Owner: Niharika29___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] analytics/refinery[master]: Adding tag column to webrequest
Nuria has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362310 ) Change subject: Adding tag column to webrequest .. Adding tag column to webrequest This column would be populated by a UDF that understands webrequest data and can classify requests into types like "portal", "wikidata" and others. It holds an array of strings taht we call tags Bug: T164021 Change-Id: Ie855d6b3a2d12921a4a89de3f84ec5ff5d1fe01a --- M hive/webrequest/create_webrequest_table.hql 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/refinery refs/changes/10/362310/1 diff --git a/hive/webrequest/create_webrequest_table.hql b/hive/webrequest/create_webrequest_table.hql index bb6c0b0..532f67f 100644 --- a/hive/webrequest/create_webrequest_table.hql +++ b/hive/webrequest/create_webrequest_table.hql @@ -54,7 +54,8 @@ `normalized_host` struct, tld: String> COMMENT 'struct containing project_class (such as wikipedia or wikidata for instance), project (such as en or commons), qualifiers (a list of in-between values, such as m and/or zero) and tld (org most often)', `pageview_info` mapCOMMENT 'map containing project, language_variant and page_title values only when is_pageview = TRUE.', `page_id` bigint COMMENT 'MediaWiki page_id for this page title. For redirects this could be the page_id of the redirect or the page_id of the target. This may not always be set, even if the page is actually a pageview.', -`namespace_id` int COMMENT 'MediaWiki namespace_id for this page title. This may not always be set, even if the page is actually a pageview.' +`namespace_id` int COMMENT 'MediaWiki namespace_id for this page title. This may not always be set, even if the page is actually a pageview.', +'tag' array COMMENT 'Array of strings to inform consumers the of type/s of this request. Example: ['preview', 'api'] ' ) PARTITIONED BY ( `webrequest_source` string COMMENT 'Source cluster', -- To view, visit https://gerrit.wikimedia.org/r/362310 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie855d6b3a2d12921a4a89de3f84ec5ff5d1fe01a Gerrit-PatchSet: 1 Gerrit-Project: analytics/refinery Gerrit-Branch: master Gerrit-Owner: Nuria ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] integration/config[master]: (DO NOT SUBMIT) experimental R based job
Hashar has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362309 ) Change subject: (DO NOT SUBMIT) experimental R based job .. (DO NOT SUBMIT) experimental R based job https://integration.wikimedia.org/ci/job/ortiz-test-jessie/ Have to figure out how to install the package from source and dependencies from the cran repo. Warning message: package ‘.’ is not available (for R version 3.1.1) Bug: T153856 Change-Id: I56b5e3b059b2db4a3f3f88feba63c358e95cd5bd --- A jjb/discovery.yaml 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/09/362309/1 diff --git a/jjb/discovery.yaml b/jjb/discovery.yaml new file mode 100644 index 000..4fbea83 --- /dev/null +++ b/jjb/discovery.yaml @@ -0,0 +1,15 @@ +- job: +name: ortiz-test-jessie +defaults: use-remoteonly-zuul +node: integration-r-lang-01 +triggers: +- zuul +builders: +- shell: | +R_LIBS_USER="$(pwd)/Rpackages" +export R_LIBS_USER +mkdir -p "$R_LIBS_USER" + +R --no-site-file --no-environ --no-save --no-restore --quiet CMD build --no-resave-data --no-manual . +R --no-site-file --no-environ --no-save --no-restore --quiet -e 'install.packages(".", repos="http://cran.us.r-project.org;, type="source", dependencies=TRUE)' +R --no-site-file --no-environ --no-save --no-restore --quiet CMD check --timings --no-manual . -- To view, visit https://gerrit.wikimedia.org/r/362309 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I56b5e3b059b2db4a3f3f88feba63c358e95cd5bd Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Hashar___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikibaseLexeme[master]: Turn PHPDoc @param type hints into strict type hints if poss...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361875 ) Change subject: Turn PHPDoc @param type hints into strict type hints if possible .. Turn PHPDoc @param type hints into strict type hints if possible Relevant review happens on the parent patch. Change-Id: Ia161694fcad49514093587c090751ad50926fdd0 Depends-On: I745ba0bf28fee0368925dc8bde2099036f44ad73 --- M src/Specials/SpecialNewLexeme.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/src/Specials/SpecialNewLexeme.php b/src/Specials/SpecialNewLexeme.php index 2adfd31..57a9462 100644 --- a/src/Specials/SpecialNewLexeme.php +++ b/src/Specials/SpecialNewLexeme.php @@ -156,7 +156,7 @@ * * @return Summary */ - protected function createSummary( $lexeme ) { + protected function createSummary( EntityDocument $lexeme ) { $uiLanguageCode = $this->getLanguage()->getCode(); $summary = new Summary( 'wbeditentity', 'create' ); -- To view, visit https://gerrit.wikimedia.org/r/361875 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia161694fcad49514093587c090751ad50926fdd0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseLexeme Gerrit-Branch: master Gerrit-Owner: Thiemo Mättig (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...Wikibase[master]: Turn PHPDoc @param type hints into strict type hints if poss...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361820 ) Change subject: Turn PHPDoc @param type hints into strict type hints if possible .. Turn PHPDoc @param type hints into strict type hints if possible Found with a regular expression for @param tags that are followed by a class name, but where the corresponding function argument is missing this type hint. Change-Id: I745ba0bf28fee0368925dc8bde2099036f44ad73 --- M client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php M lib/tests/phpunit/Changes/EntityChangeFactoryTest.php M lib/tests/phpunit/EntityRevisionLookupTest.php M lib/tests/phpunit/Formatters/WikibaseValueFormatterBuildersTest.php M repo/Wikibase.hooks.php M repo/includes/Api/GetEntities.php M repo/includes/Api/SearchEntities.php M repo/includes/ChangeOp/ChangeOpsMerge.php M repo/includes/Hooks/LinkBeginHookHandler.php M repo/includes/Interactors/ItemMergeInteractor.php M repo/includes/OutputPageJsConfigBuilder.php M repo/includes/Specials/SpecialListProperties.php M repo/includes/Specials/SpecialMyLanguageFallbackChain.php M repo/includes/Specials/SpecialNewEntity.php M repo/includes/Specials/SpecialNewItem.php M repo/includes/Specials/SpecialNewProperty.php M repo/includes/Specials/SpecialWikibaseQueryPage.php M repo/includes/Store/Sql/EntityPerPageBuilder.php M repo/includes/Store/Sql/SqlEntityIdPager.php M repo/includes/UpdateRepo/UpdateRepoOnDeleteJob.php M repo/includes/UpdateRepo/UpdateRepoOnMoveJob.php M repo/tests/phpunit/includes/Actions/ActionTestCase.php M repo/tests/phpunit/includes/Diff/ClaimDifferenceTest.php M view/src/SnakHtmlGenerator.php 24 files changed, 121 insertions(+), 98 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php b/client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php index 1b1e255..cd79926 100644 --- a/client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php +++ b/client/tests/phpunit/includes/Hooks/InfoActionHookHandlerTest.php @@ -33,8 +33,15 @@ /** * @dataProvider handleProvider */ - public function testHandle( $expected, $context, $pageInfo, $enabled, $entityId, $message ) { - $hookHandler = $this->newHookHandler( $enabled, $entityId ); + public function testHandle( + array $expected, + IContextSource $context, + array $pageInfo, + $enabled, + ItemId $itemId = null, + $message + ) { + $hookHandler = $this->newHookHandler( $enabled, $itemId ); $pageInfo = $hookHandler->handle( $context, $pageInfo ); $this->assertEquals( $expected, $pageInfo, $message ); @@ -45,80 +52,82 @@ $labeledLink = 'https://www.wikidata.org/wiki/Q4; class="external">Berlin'; $unLabeledLink = 'https://www.wikidata.org/wiki/Q4; class="external">Q4'; $q5Link = 'https://www.wikidata.org/wiki/Q5; class="external">Q5'; - $cases = []; - $cases[] = [ + return [ [ - 'header-basic' => [ - [ - $context->msg( 'wikibase-pageinfo-entity-id' )->escaped(), - $unLabeledLink + [ + 'header-basic' => [ + [ + $context->msg( 'wikibase-pageinfo-entity-id' )->escaped(), + $unLabeledLink + ], ], - ], - 'header-properties' => [ - [ - $context->msg( 'wikibase-pageinfo-entity-usage' )->escaped(), - "$labeledLinkSitelink", - ], - ] - ], - $context, [ 'header-basic' => [] ], true, new ItemId( 'Q4' ), - 'item id link' - ]; - - $cases[] = [ - [ 'header-properties' => [ - [ - $context->msg( 'wikibase-pageinfo-entity-usage' )->escaped(), - "$labeledLinkSitelink", - ], - ] - ], -
[MediaWiki-commits] [Gerrit] mediawiki...EducationProgram[master]: Fix incomplete and out of sync PHPDoc blocks
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361418 ) Change subject: Fix incomplete and out of sync PHPDoc blocks .. Fix incomplete and out of sync PHPDoc blocks Change-Id: I39536ff70c6753de3baa53d07d0c0e844e46bc7e --- M includes/CourseActivityView.php M includes/Events/RecentPageEventGrouper.php M includes/api/ApiListStudents.php M includes/notifications/NotificationsManager.php M includes/pagers/ArticleTable.php M includes/pagers/OrgPager.php M includes/pages/EducationPage.php M includes/rows/Org.php M resources/ep.addstudents.js M tests/phpunit/ArticleAdderTest.php M tests/phpunit/Events/EventQueryTest.php M tests/phpunit/db/ORMTableTest.php 12 files changed, 49 insertions(+), 15 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/CourseActivityView.php b/includes/CourseActivityView.php index 78558d4..9d58f60 100644 --- a/includes/CourseActivityView.php +++ b/includes/CourseActivityView.php @@ -47,7 +47,7 @@ } /** -* @param int $courseId +* @param string $courseTitle * @param int $maxAgeInSeconds */ public function displayActivity( $courseTitle, $maxAgeInSeconds ) { diff --git a/includes/Events/RecentPageEventGrouper.php b/includes/Events/RecentPageEventGrouper.php index 2c12306..f5216ad 100644 --- a/includes/Events/RecentPageEventGrouper.php +++ b/includes/Events/RecentPageEventGrouper.php @@ -112,7 +112,7 @@ } /** -* @param Event[] $groups +* @param Event[] $events * * @return Event[] */ diff --git a/includes/api/ApiListStudents.php b/includes/api/ApiListStudents.php index 5c71b3d..6615b84 100644 --- a/includes/api/ApiListStudents.php +++ b/includes/api/ApiListStudents.php @@ -273,11 +273,10 @@ * For an array of user objects of instructors or course * volunteers, output their usernames or user IDs as query results. * -* @param array $participantsList -* @param string $propName -* @param \ApiResult $results -* @param int $courseId +* @param Course $course +* @param ApiResult $results * @param int $courseIndex +* @param string $courseRole */ protected function outputListOfNonStudentParticipantsProperties( $course, @@ -501,7 +500,8 @@ * * @param int $courseId * @param Course $course -* @param \ApiResult $results +* @param int $courseIndex +* @param ApiResult $results */ protected function outputCourseProperties( $courseId, @@ -620,6 +620,7 @@ * * @param int $courseIndex * @param string $userLabel +* @return array|string */ protected function usersPath( $courseIndex, $userLabel = 'students' ) { if ( !is_null( $courseIndex ) ) { @@ -636,6 +637,7 @@ * @param int $courseIndex * @param string $userLabel * @param int $userIndex +* @return array */ protected function userPath( $courseIndex, $userLabel, $userIndex = null ) { if ( !is_null( $courseIndex ) ) { @@ -651,6 +653,7 @@ * or as a top-level element. * * @param int $courseIndex +* @return int[]|null */ protected function articlesPath( $courseIndex ) { if ( !is_null( $courseIndex ) ) { diff --git a/includes/notifications/NotificationsManager.php b/includes/notifications/NotificationsManager.php index 4c8cc92..4025e92 100644 --- a/includes/notifications/NotificationsManager.php +++ b/includes/notifications/NotificationsManager.php @@ -130,6 +130,7 @@ * @param string $key The string key of the notification type to trigger * @param array $parameters The parameters for INotificationType::trigger() * (not the same as the parameters for EchoEvent::create()). +* @throws InvalidArgumentException */ public function trigger( $key, array $parameters ) { if ( !isset( $this->typesByKey[$key] ) ) { diff --git a/includes/pagers/ArticleTable.php b/includes/pagers/ArticleTable.php index d97d051..c8a8929 100644 --- a/includes/pagers/ArticleTable.php +++ b/includes/pagers/ArticleTable.php @@ -229,16 +229,14 @@ * * @since 0.1 * -* @param string $html -* @param array $articles +* @param string &$html +* @param EPArticle[] $articles * @param boolean $showArticleAddition +* @param int $studentUserId */ protected function addNonStudentHTML( &$html, array $articles, $showArticleAddition, $studentUserId ) { $isFirst = true; - /** -* @var EPArticle $article -
[MediaWiki-commits] [Gerrit] mediawiki/core[wmf/1.30.0-wmf.7]: RCFilters: Followup I5cede87633147: Set actual value rather ...
Mooeypoo has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362308 ) Change subject: RCFilters: Followup I5cede87633147: Set actual value rather than object .. RCFilters: Followup I5cede87633147: Set actual value rather than object Bug: T169042 Change-Id: Ib99981c212dbe1522defc1c1cc34fa01fff91dba --- M resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/08/362308/1 diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js index 3f920f0..e74c729 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.SaveFiltersPopupButtonWidget.js @@ -149,7 +149,7 @@ this.input.getValidity() .done( function () { widget.controller.saveCurrentQuery( label ); - widget.input.setValue( this.input, '' ); + widget.input.setValue( '' ); widget.emit( 'saveCurrent' ); widget.popup.toggle( false ); } ); -- To view, visit https://gerrit.wikimedia.org/r/362308 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib99981c212dbe1522defc1c1cc34fa01fff91dba Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.30.0-wmf.7 Gerrit-Owner: Mooeypoo___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: API: Don't handle non-preflight OPTIONS as CORS
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/360687 ) Change subject: API: Don't handle non-preflight OPTIONS as CORS .. API: Don't handle non-preflight OPTIONS as CORS If it's not a preflight, it's either a simple request or an actual request after a preflight. But simple requests can only be GET, HEAD, or POST, and we only return a successful response for a preflight if the actual request is going to be GET or POST. So either way it shouldn't be handled as CORS. This also adds a response header to indicate to the end user why something they probably intended as a CORS request wasn't handled as one, to help with debugging. And it renames a local variable that confused me when looking back at this code. Bug: T168558 Change-Id: Ia66c74e1cc8536c6c478237540abb4d7a98b9803 --- M includes/api/ApiMain.php 1 file changed, 18 insertions(+), 4 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index d7586e0..5cb7967 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -704,13 +704,17 @@ $request = $this->getRequest(); $response = $request->response(); - $matchOrigin = false; + $matchedOrigin = false; $allowTiming = false; $varyOrigin = true; if ( $originParam === '*' ) { // Request for anonymous CORS - $matchOrigin = true; + // Technically we should check for the presence of an Origin header + // and not process it as CORS if it's not set, but that would + // require us to vary on Origin for all 'origin=*' requests which + // we don't want to do. + $matchedOrigin = true; $allowOrigin = '*'; $allowCredentials = 'false'; $varyOrigin = false; // No need to vary @@ -737,7 +741,7 @@ } $config = $this->getConfig(); - $matchOrigin = count( $origins ) === 1 && self::matchOrigin( + $matchedOrigin = count( $origins ) === 1 && self::matchOrigin( $originParam, $config->get( 'CrossSiteAJAXdomains' ), $config->get( 'CrossSiteAJAXdomainExceptions' ) @@ -748,19 +752,21 @@ $allowTiming = $originHeader; } - if ( $matchOrigin ) { + if ( $matchedOrigin ) { $requestedMethod = $request->getHeader( 'Access-Control-Request-Method' ); $preflight = $request->getMethod() === 'OPTIONS' && $requestedMethod !== false; if ( $preflight ) { // This is a CORS preflight request if ( $requestedMethod !== 'POST' && $requestedMethod !== 'GET' ) { // If method is not a case-sensitive match, do not set any additional headers and terminate. + $response->header( 'MediaWiki-CORS-Rejection: Unsupported method requested in preflight' ); return true; } // We allow the actual request to send the following headers $requestedHeaders = $request->getHeader( 'Access-Control-Request-Headers' ); if ( $requestedHeaders !== false ) { if ( !self::matchRequestedHeaders( $requestedHeaders ) ) { + $response->header( 'MediaWiki-CORS-Rejection: Unsupported header requested in preflight' ); return true; } $response->header( 'Access-Control-Allow-Headers: ' . $requestedHeaders ); @@ -768,6 +774,12 @@ // We only allow the actual request to be GET or POST $response->header( 'Access-Control-Allow-Methods: POST, GET' ); + } elseif ( $request->getMethod() !== 'POST' && $request->getMethod() !== 'GET' ) { + // Unsupported non-preflight method, don't handle it as CORS + $response->header( + 'MediaWiki-CORS-Rejection: Unsupported method for simple request or actual request' + ); + return true;
[MediaWiki-commits] [Gerrit] mediawiki...RevisionSlider[master]: Simplyfied lint file selection
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362201 ) Change subject: Simplyfied lint file selection .. Simplyfied lint file selection Change-Id: I25f624db06d4c7f2cd4260c37cc7c1d11162b795 --- M Gruntfile.js 1 file changed, 8 insertions(+), 7 deletions(-) Approvals: Addshore: Looks good to me, approved jenkins-bot: Verified diff --git a/Gruntfile.js b/Gruntfile.js index d5c78ab..5d55bcc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -10,23 +10,24 @@ grunt.initConfig( { eslint: { all: [ - '*.js', - 'tests/**/*.js', - 'modules/**/*.js' + '**/*.js', + '!node_modules/**', + '!vendor/**' ] }, stylelint: { all: [ - 'modules/**/*.css', - '!node_modules/**' + '**/*.css', + '!node_modules/**', + '!vendor/**' ] }, banana: conf.MessagesDirs, jsonlint: { all: [ - '*.json', '**/*.json', - '!node_modules/**' + '!node_modules/**', + '!vendor/**' ] } } ); -- To view, visit https://gerrit.wikimedia.org/r/362201 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I25f624db06d4c7f2cd4260c37cc7c1d11162b795 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/RevisionSlider Gerrit-Branch: master Gerrit-Owner: WMDE-FischGerrit-Reviewer: Addshore Gerrit-Reviewer: Andrew-WMDE Gerrit-Reviewer: Tobias Gritschacher Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Fix function visibility in default getRequestProcessId
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362307 ) Change subject: Fix function visibility in default getRequestProcessId .. Fix function visibility in default getRequestProcessId Ugh. Sloppy error. I'd written unit tests, but they only covered the Paypal Express resultswitcher, whose gateway was overriding the function with public visibility. This commit adds a test for the GlobalCollect resultswitcher. TODO: AstroPay and Adyen resultswitcher tests. Change-Id: Ia1cd67b1823b5ad11a230758f8eb5f2ea7f24142 --- M gateway_common/gateway.adapter.php A tests/phpunit/Adapter/GlobalCollect/ResultSwitcherTest.php 2 files changed, 48 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/07/362307/1 diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index be079a7..dbba9c8 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -1460,7 +1460,7 @@ * @param array $requestValues * @return int|string Order id */ - protected function getRequestProcessId( $requestValues ) { + public function getRequestProcessId( $requestValues ) { return null; } diff --git a/tests/phpunit/Adapter/GlobalCollect/ResultSwitcherTest.php b/tests/phpunit/Adapter/GlobalCollect/ResultSwitcherTest.php new file mode 100644 index 000..94c1485 --- /dev/null +++ b/tests/phpunit/Adapter/GlobalCollect/ResultSwitcherTest.php @@ -0,0 +1,47 @@ +getDonorTestData( 'FR' ); + $donorTestData['payment_method'] = 'cc'; + $donorTestData['payment_submethod'] = 'visa'; + $donorTestData['email'] = 'innoc...@localhost.net'; + $donorTestData['order_id'] = mt_rand(); + $session['Donor'] = $donorTestData; + // Mark the order as already popped out of the iframe + $session['order_status'][$donorTestData['order_id']] = 'liberated'; + $request = array( + 'REF' => $donorTestData['order_id'], + 'CVVRESULT' => 'M', + 'AVSRESULT' => '0', +'language' => 'fr', // FIXME: verifyFormOutput conflates request with other stuff + ); + $assertNodes = array( + 'headers' => array( + 'Location' => function( $location ) use ( $donorTestData ) { + // Do this after the real processing to avoid side effects + $gateway = $this->getFreshGatewayObject( $donorTestData ); + $url = ResultPages::getThankYouPage( $gateway ); + return $location === $url; + } + ) + ); + + $this->verifyFormOutput( 'GlobalCollectGatewayResult', $request, $assertNodes, false, $session ); + $log = $this->testLogger->messages; + // Make sure we logged the expected cURL attempts + $messages = $this->getLogMatches( 'info', '/Preparing to send GET_ORDERSTATUS transaction to Global Collect/' ); + $this->assertNotEmpty( $messages ); + $messages = $this->getLogMatches( 'info', '/Preparing to send SET_PAYMENT transaction to Global Collect/' ); + $this->assertNotEmpty( $messages ); +} +} -- To view, visit https://gerrit.wikimedia.org/r/362307 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1cd67b1823b5ad11a230758f8eb5f2ea7f24142 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Ejegg___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Remove unused use statement
Addshore has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362306 ) Change subject: Remove unused use statement .. Remove unused use statement Change-Id: I473df95968efd4e892106858f293a8c8d9cddc6d --- M includes/NewsletterStore.php 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/06/362306/1 diff --git a/includes/NewsletterStore.php b/includes/NewsletterStore.php index bf12f3c..738b29a 100644 --- a/includes/NewsletterStore.php +++ b/includes/NewsletterStore.php @@ -1,7 +1,5 @@ https://gerrit.wikimedia.org/r/362306 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I473df95968efd4e892106858f293a8c8d9cddc6d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Addshore___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Use Wikimedia\Rdbms namespaces DB classes
Addshore has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362305 ) Change subject: Use Wikimedia\Rdbms namespaces DB classes .. Use Wikimedia\Rdbms namespaces DB classes Change-Id: Iea4a7c591ad8e114021c2b226e4ac42d84f47dea --- M includes/NewsletterDb.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/05/362305/1 diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php index ce0ada5..d6b2870 100644 --- a/includes/NewsletterDb.php +++ b/includes/NewsletterDb.php @@ -1,6 +1,8 @@ https://gerrit.wikimedia.org/r/362305 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iea4a7c591ad8e114021c2b226e4ac42d84f47dea Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Addshore___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Fix return type of getNewsletterSubscribersCount
Addshore has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362304 ) Change subject: Fix return type of getNewsletterSubscribersCount .. Fix return type of getNewsletterSubscribersCount Change-Id: Ifd33adc019a21de4867b97118d43c5b97f984d65 --- M includes/NewsletterDb.php M includes/NewsletterStore.php 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/04/362304/1 diff --git a/includes/NewsletterDb.php b/includes/NewsletterDb.php index 7f0cff6..ce0ada5 100644 --- a/includes/NewsletterDb.php +++ b/includes/NewsletterDb.php @@ -362,7 +362,7 @@ /** * @param $id -* @return array +* @return int */ public function getNewsletterSubscribersCount( $id ) { Assert::parameterType( 'integer', $id, '$id' ); diff --git a/includes/NewsletterStore.php b/includes/NewsletterStore.php index 88cc27b..bf12f3c 100644 --- a/includes/NewsletterStore.php +++ b/includes/NewsletterStore.php @@ -191,7 +191,7 @@ /** * @param $id -* @return array +* @return int */ public function getNewsletterSubscribersCount( $id ) { return $this->db->getNewsletterSubscribersCount( $id ); -- To view, visit https://gerrit.wikimedia.org/r/362304 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd33adc019a21de4867b97118d43c5b97f984d65 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Addshore___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: Stop returning void from $wgOut->setSubtitle()
Addshore has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362303 ) Change subject: Stop returning void from $wgOut->setSubtitle() .. Stop returning void from $wgOut->setSubtitle() Change-Id: Iff1e927caf39bc0581e784ea5100a76800cc717a --- M includes/content/NewsletterContent.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/03/362303/1 diff --git a/includes/content/NewsletterContent.php b/includes/content/NewsletterContent.php index 9adf0a0..a3206ea 100644 --- a/includes/content/NewsletterContent.php +++ b/includes/content/NewsletterContent.php @@ -207,7 +207,7 @@ $form->prepareForm(); !$this->newsletter ? $output->setText( $form->getBody() ) : $output->setText( - $this->getNavigationLinks( $options ) . $newsletterActionButtons . "" . + $newsletterActionButtons . "" . $form->getBody() ); return $output; @@ -391,7 +391,7 @@ $options->getUserLangObj()->pipeList( $links ) )->escaped(); - return $wgOut->setSubtitle( + $wgOut->setSubtitle( $options->getUserLangObj()->pipeList( [ $listLink, $newsletterLinks ] ) ); } -- To view, visit https://gerrit.wikimedia.org/r/362303 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff1e927caf39bc0581e784ea5100a76800cc717a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Newsletter Gerrit-Branch: master Gerrit-Owner: Addshore___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...CodeMirror[master]: Show a popup for first time Codemirror users
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361600 ) Change subject: Show a popup for first time Codemirror users .. Show a popup for first time Codemirror users Bug: T165003 Change-Id: I545a57bdb273ab6906711e2d65dc029293ecc02a --- M CodeMirror.hooks.php M extension.json M i18n/en.json M i18n/qqq.json M resources/ext.CodeMirror.js A resources/modules/popup.less 6 files changed, 112 insertions(+), 9 deletions(-) Approvals: jenkins-bot: Verified Kaldari: Looks good to me, approved diff --git a/CodeMirror.hooks.php b/CodeMirror.hooks.php index 34364fa..9c88320 100644 --- a/CodeMirror.hooks.php +++ b/CodeMirror.hooks.php @@ -127,6 +127,7 @@ */ public static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) { if ( self::isCodeMirrorEnabled( $out->getContext() ) ) { + $out->enableOOUI(); $out->addModules( 'ext.CodeMirror' ); } } diff --git a/extension.json b/extension.json index a24dd9c..db9d5af 100644 --- a/extension.json +++ b/extension.json @@ -28,16 +28,23 @@ "jquery.textSelection", "mediawiki.api", "mediawiki.api.options", - "user.options" + "user.options", + "oojs-ui" ], "scripts": [ "ext.CodeMirror.js" ], "styles": [ - "ext.CodeMirror.less" + "ext.CodeMirror.less", + "modules/popup.less" ], "messages": [ - "codemirror-toggle-label" + "codemirror-toggle-label", + "codemirror-popup-syntax", + "codemirror-popup-highlighting", + "codemirror-popup-desc", + "codemirror-popup-btn-yes", + "codemirror-popup-btn-no" ] }, "ext.CodeMirror.lib": { diff --git a/i18n/en.json b/i18n/en.json index 9087119..ee0733b 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -7,5 +7,10 @@ "codemirror-desc": "Provides syntax highlighting in wikitext editor", "codemirror-toggle-label": "Syntax highlighting", "codemirror-beta-title": "Syntax highlighting", - "codemirror-beta-desc": "Syntax highlighting makes editing easier by using color and shade to visually separate article text from the code for links, references and templates." + "codemirror-beta-desc": "Syntax highlighting makes editing easier by using color and shade to visually separate article text from the code for links, references and templates.", + "codemirror-popup-syntax": "Syntax", + "codemirror-popup-highlighting": "Highlighting", + "codemirror-popup-desc": "Syntax highlighting will help you easily distinguish different parts of your edit by color coding them.", + "codemirror-popup-btn-yes": "Try it", + "codemirror-popup-btn-no": "No, thank you" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 9496c89..ba7c0c1 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -10,5 +10,10 @@ "codemirror-desc": "{{desc|name=Code Mirror|url=https://www.mediawiki.org/wiki/Extension:CodeMirror}}\n\nAdditional info: Discription of \"Syntax highlighting\" in wiki\n[[mw:Extension:SyntaxHighlight GeSHi]]", "codemirror-toggle-label": "Title tooltip for button to toggle CodeMirror in the editing toolbar.", "codemirror-beta-title": "Title for syntax highlighting beta feature", - "codemirror-beta-desc": "Description for syntax highlight beta feature" + "codemirror-beta-desc": "Description for syntax highlight beta feature", + "codemirror-popup-syntax": "This message is combined with the message {{msg-mw|codemirror-popup-highlighting}} to form the title \"Syntax Highlighting\" (with the two words having different styling).", + "codemirror-popup-highlighting": "This message is combined with the message {{msg-mw|codemirror-popup-syntax}} to form the title \"Syntax Highlighting\" (with the two words having different styling).", + "codemirror-popup-desc": "Description of the syntax highlighting feature in the popup", + "codemirror-popup-btn-yes": "Text on the button for trying out codemirror", + "codemirror-popup-btn-no": "Text on the button for dismissing popup" } diff --git a/resources/ext.CodeMirror.js b/resources/ext.CodeMirror.js index 7f766dd..62b6b5f 100644 --- a/resources/ext.CodeMirror.js +++
[MediaWiki-commits] [Gerrit] mediawiki...Newsletter[master]: i18n API error messages & stop using dieUsage()
Addshore has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362302 ) Change subject: i18n API error messages & stop using dieUsage() .. i18n API error messages & stop using dieUsage() Change-Id: I1c06c6fb4ef387d1267f6142fd83d33dedb7f2cf --- M i18n/en.json M i18n/qqq.json M includes/api/ApiNewsletterManage.php M includes/api/ApiNewsletterSubscribe.php 4 files changed, 22 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter refs/changes/02/362302/1 diff --git a/i18n/en.json b/i18n/en.json index 850f2a3..68e862d 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -4,7 +4,8 @@ "Tina Johnson", "Thomas Arrow", "Glaisher", - "Divadsn" + "Divadsn", + "Addshore" ] }, "newsletter-extension-desc": "Enables users to publish and subscribe to newsletters", @@ -168,5 +169,10 @@ "newsletter-restore-failure-title": "Newsletter could not be restored.", "newsletter-diff-descheader": "Changes in the description:", "newsletter-diff-mainpageheader": "Changes in Main Page:", - "newsletter-diff-publishersheader": "Changes in publishers:" + "newsletter-diff-publishersheader": "Changes in publishers:", + "newsletter-api-error-notfound": "Newsletter does not exist", + "newsletter-api-error-nopermissions": "You do not have permission to manage newsletters.", + "newsletter-api-error-invalidpublisher-registered": "Publisher is not a registered user.", + "newsletter-api-error-managefailure": "Manage action: $1 failed.", + "newsletter-api-error-subscribe-notloggedin": "You must be logged-in to subscribe to newsletters." } diff --git a/i18n/qqq.json b/i18n/qqq.json index dd56817..b604712 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -11,7 +11,8 @@ "Verdy p", "Amire80", "Base", - "Divadsn" + "Divadsn", + "Addshore" ] }, "newsletter-extension-desc": "{{desc|name=Newsletter|url=https://www.mediawiki.org/wiki/Extension:Newsletter}};, @@ -175,5 +176,10 @@ "newsletter-restore-failure-title": "Title for \"newsletter-restore-failure\"", "newsletter-diff-descheader": "Header for the diff of the description between two revisions", "newsletter-diff-mainpageheader": "Header for the diff of Main Page between two revisions", - "newsletter-diff-publishersheader": "Header for the diff of publishers between two revisions" + "newsletter-diff-publishersheader": "Header for the diff of publishers between two revisions", + "newsletter-api-error-notfound": "Error message to be displayed in the API when a newsletter is not found.", + "newsletter-api-error-nopermissions": "Error message to be displayed in the API when the requesting user does not have the required permissions.", + "newsletter-api-error-invalidpublisher-registered": "Error message to be displayed in the API when a given publisher is not a registered account.", + "newsletter-api-error-managefailure": "Error message to be displayed in the API when the requested manage action has failed.", + "newsletter-api-error-subscribe-notloggedin": "Error message to be displayed in the API when a request is made to subscribe to a newsletter by an anonymous user.." } diff --git a/includes/api/ApiNewsletterManage.php b/includes/api/ApiNewsletterManage.php index 5b3e917..942 100644 --- a/includes/api/ApiNewsletterManage.php +++ b/includes/api/ApiNewsletterManage.php @@ -5,8 +5,6 @@ * * @license GNU GPL v2+ * @author Tina Johnson - * - * @todo Add i18n */ class ApiNewsletterManage extends ApiBase { @@ -17,16 +15,16 @@ $newsletter = Newsletter::newFromID( $params['id'] ); if ( !$newsletter ) { - $this->dieUsage( 'Newsletter does not exist', 'notfound' ); + $this->dieWithError( 'newsletter-api-error-notfound', 'notfound' ); } if ( !$newsletter->canManage( $user ) ) { - $this->dieUsage( 'You do not have permission to manage newsletters.', 'nopermissions' ); + $this->dieWithError( 'newsletter-api-error-nopermissions', 'nopermissions' ); } $publisher = User::newFromId( $params['publisher'] ); if ( !$publisher || $publisher->getId() === 0 ) { - $this->dieUsage( 'Publisher is not a registered user.', 'invalidpublisher' ); + $this->dieWithError( 'newsletter-api-error-invalidpublisher-registered', 'invalidpublisher' );
[MediaWiki-commits] [Gerrit] mediawiki...luasandbox[master]: Redo PHP->Lua data structure recursion protection
Anomie has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362301 ) Change subject: Redo PHP->Lua data structure recursion protection .. Redo PHP->Lua data structure recursion protection We've been getting a fairly significant level of false positives from the recursion protection in WMF production. One theory as to the cause of this is the following sequence of events: * Something runs into a Lua error while converting a nested data structure from PHP to Lua. Probably the memory limit. * Lua jumps via exception out of luasandbox_push_hashtable, without calling luasandbox_unprotect_recursion for the arrays/objects in the process of being converted. Thus, their addresses are left in protectionSet. * Later, some other call during another request happens to use the same address for a different array/object. Since the address is still in protectionSet, it gets reported as "recursion detected". This patch changes the recursion detection to use a locally-allocated hash table instead of a global set, like the Lua->PHP code path does. It also operates on the zvals rather than the HashTables because it turns out HHVM's Z_OBJPROP_P() returns a different HashTable on every call, even for the same object, while zval pointer identity seems to work fine. While the Zend versions of this code don't have the same issue as HHVM, that's mainly because there the recursed flag is stored in the HashTable instance itself so the garbage doesn't hang around like a land mine for some future request. It's still probably leaving nApplyCount with garbage that might break something somewhere before the zval in question goes away. Bug: T166348 Change-Id: I745a77011a1e134ffa4f19db89840f1cf9c6e53c --- M data_conversion.c M luasandbox.c M php_luasandbox.h A tests/datatypes-unsupported.phpt 4 files changed, 172 insertions(+), 66 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/php/luasandbox refs/changes/01/362301/1 diff --git a/data_conversion.c b/data_conversion.c index 46a78ea..9256ec3 100644 --- a/data_conversion.c +++ b/data_conversion.c @@ -14,22 +14,20 @@ #include "zend_exceptions.h" #ifdef HHVM -#include -static IMPLEMENT_THREAD_LOCAL(std::set, protectionSet); using std::isfinite; #endif static void luasandbox_throw_runtimeerror(lua_State * L, zval * sandbox_zval, const char *message TSRMLS_DC); -static inline int luasandbox_is_recursive(HashTable * ht); -static inline void luasandbox_protect_recursion(HashTable * ht); -static inline void luasandbox_unprotect_recursion(HashTable * ht); + +static inline int luasandbox_protect_recursion(zval * z, HashTable ** recursionGuard, int * allocated); +static inline void luasandbox_unprotect_recursion(zval * z, HashTable * recursionGuard, int allocated); static int luasandbox_lua_to_array(HashTable *ht, lua_State *L, int index, zval * sandbox_zval, HashTable * recursionGuard TSRMLS_DC); static int luasandbox_lua_pair_to_array(HashTable *ht, lua_State *L, zval * sandbox_zval, HashTable * recursionGuard TSRMLS_DC); static int luasandbox_free_zval_userdata(lua_State * L); -static int luasandbox_push_hashtable(lua_State * L, HashTable * ht); +static int luasandbox_push_hashtable(lua_State * L, HashTable * ht, HashTable * recursionGuard); static int luasandbox_has_error_marker(lua_State * L, int index, void * marker); extern zend_class_entry *luasandboxfunction_ce; @@ -65,7 +63,7 @@ * Convert a zval to an appropriate Lua type and push the resulting value on to * the stack. */ -int luasandbox_push_zval(lua_State * L, zval * z) +int luasandbox_push_zval(lua_State * L, zval * z, HashTable * recursionGuard) { switch (Z_TYPE_P(z)) { #ifdef IS_UNDEF @@ -93,14 +91,19 @@ lua_pushboolean(L, 0); break; #endif - case IS_ARRAY: - if (!luasandbox_push_hashtable(L, Z_ARRVAL_P(z))) { + case IS_ARRAY: { + int ret, allocated = 0; + if (!luasandbox_protect_recursion(z, , )) { return 0; } - break; + ret = luasandbox_push_hashtable(L, Z_ARRVAL_P(z), recursionGuard); + luasandbox_unprotect_recursion(z, recursionGuard, allocated); + return ret; + } case IS_OBJECT: { TSRMLS_FETCH(); zend_class_entry * objce; + int ret, allocated = 0; objce = Z_OBJCE_P(z); if (instanceof_function(objce, luasandboxfunction_ce TSRMLS_CC)) { @@ -114,17 +117,26 @@ break; } - if (!luasandbox_push_hashtable(L, Z_OBJPROP_P(z))) { +
[MediaWiki-commits] [Gerrit] mediawiki/core[fundraising/REL1_27]: Update DonationInterface for paypal reload bug 77f6260 Send ...
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362300 ) Change subject: Update DonationInterface for paypal reload bug 77f6260 Send resultswitcher reloaders to TY page .. Update DonationInterface for paypal reload bug 77f6260 Send resultswitcher reloaders to TY page Change-Id: Iedd51747989ca88ec11a29b3b8b38acbe10a91a4 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mepps: Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 74b8110..5890ce7 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 74b81105a97d2e207d921a1646a70fb61ae8b912 +Subproject commit 5890ce71247a561feb9da2c5d01687c2ca6719f0 -- To view, visit https://gerrit.wikimedia.org/r/362300 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iedd51747989ca88ec11a29b3b8b38acbe10a91a4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: MeppsGerrit-Reviewer: Mepps 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[fundraising/REL1_27]: Update DonationInterface for paypal reload bug 77f6260 Send ...
Mepps has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362300 ) Change subject: Update DonationInterface for paypal reload bug 77f6260 Send resultswitcher reloaders to TY page .. Update DonationInterface for paypal reload bug 77f6260 Send resultswitcher reloaders to TY page Change-Id: Iedd51747989ca88ec11a29b3b8b38acbe10a91a4 --- M extensions/DonationInterface 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/00/362300/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index 74b8110..5890ce7 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface @@ -1 +1 @@ -Subproject commit 74b81105a97d2e207d921a1646a70fb61ae8b912 +Subproject commit 5890ce71247a561feb9da2c5d01687c2ca6719f0 -- To view, visit https://gerrit.wikimedia.org/r/362300 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iedd51747989ca88ec11a29b3b8b38acbe10a91a4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_27 Gerrit-Owner: Mepps___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update restbase to 021f586
Mobrovac has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362299 ) Change subject: Update restbase to 021f586 .. Update restbase to 021f586 List of changes: 021f586 Protect special characters in PDF render backend requests Change-Id: I8dcac3abe982efc0e5212ebe4c9078ea1b3fde7d --- M restbase 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mobrovac: Verified; Looks good to me, approved diff --git a/restbase b/restbase index b33bf90..021f586 16 --- a/restbase +++ b/restbase @@ -1 +1 @@ -Subproject commit b33bf9067b8ca60d5f8a0ef97fe4b0be3dfa2892 +Subproject commit 021f5865bbb19f3002d9d405fa644cf93218c816 -- To view, visit https://gerrit.wikimedia.org/r/362299 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8dcac3abe982efc0e5212ebe4c9078ea1b3fde7d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/restbase/deploy Gerrit-Branch: master Gerrit-Owner: MobrovacGerrit-Reviewer: Mobrovac ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Update restbase to 021f586
Mobrovac has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362299 ) Change subject: Update restbase to 021f586 .. Update restbase to 021f586 List of changes: 021f586 Protect special characters in PDF render backend requests Change-Id: I8dcac3abe982efc0e5212ebe4c9078ea1b3fde7d --- M restbase 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/restbase/deploy refs/changes/99/362299/1 diff --git a/restbase b/restbase index b33bf90..021f586 16 --- a/restbase +++ b/restbase @@ -1 +1 @@ -Subproject commit b33bf9067b8ca60d5f8a0ef97fe4b0be3dfa2892 +Subproject commit 021f5865bbb19f3002d9d405fa644cf93218c816 -- To view, visit https://gerrit.wikimedia.org/r/362299 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8dcac3abe982efc0e5212ebe4c9078ea1b3fde7d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/restbase/deploy Gerrit-Branch: master Gerrit-Owner: Mobrovac___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...TextExtracts[master]: Keep math images while removing formulas from HTML output
Bmansurov has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362298 ) Change subject: Keep math images while removing formulas from HTML output .. Keep math images while removing formulas from HTML output `.mwe-math-fallback-image` and `.mwe-math-fallback-image-inline` are not being stripped from the HTML output. Rather the math formulas with the `.mwe-math-mathml-inline` class are being removed. In text mode formulas are kept, while all images are removed. Depends-on: Id1934e4fb9aaa16e6f0de2db278817b7149c2923 Change-Id: I916832afbf52f4a566af817be7e089a726b5ce94 Bug: T159065 --- M extension.json M includes/ExtractFormatter.php 2 files changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TextExtracts refs/changes/98/362298/1 diff --git a/extension.json b/extension.json index 259bbc4..d73a992 100644 --- a/extension.json +++ b/extension.json @@ -49,6 +49,15 @@ ".noexcerpt", ".sortkey" ], + "ExtractsRemoveClassesFromHTML": [ + ".mwe-math-mathml-inline" + ], + "ExtractsMediaClassesToKeep": { + "img": [ + "mwe-math-fallback-image", + "mwe-math-fallback-image-inline" + ] + }, "ExtractsExtendOpenSearchXml": false }, "manifest_version": 1 diff --git a/includes/ExtractFormatter.php b/includes/ExtractFormatter.php index 4dd7e92..df8b396 100644 --- a/includes/ExtractFormatter.php +++ b/includes/ExtractFormatter.php @@ -41,11 +41,13 @@ $this->plainText = $plainText; $this->setRemoveMedia( true ); + $this->keepMediaClass( $config->get( 'ExtractsMediaClassesToKeep' ) ); $this->remove( $config->get( 'ExtractsRemoveClasses' ) ); if ( $plainText ) { $this->flattenAllTags(); } else { + $this->remove ( $config->get( 'ExtractsRemoveClassesFromHTML' ) ); $this->flatten( [ 'a' ] ); } } -- To view, visit https://gerrit.wikimedia.org/r/362298 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I916832afbf52f4a566af817be7e089a726b5ce94 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TextExtracts Gerrit-Branch: master Gerrit-Owner: Bmansurov___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] HtmlFormatter[master]: Allow certain media elements not to be removed
Bmansurov has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362297 ) Change subject: Allow certain media elements not to be removed .. Allow certain media elements not to be removed Before this patch, if media was set to be removed all media files were removed from the output. This patch allows media files with certain class names to stay in the output. For example, the following code removes all images, while keeping math formulas rendered as an image: $fmt = new ExtractFormatter( 'some html text' ); $fmt->setRemoveMedia( true ); $fmt->keepMediaClass( 'img': [ 'mwe-math-fallback-image', 'mwe-math-fallback-image-inline' ] ); // $fmt->getText(); Bug: T159065 Change-Id: Id1934e4fb9aaa16e6f0de2db278817b7149c2923 --- M src/HtmlFormatter.php 1 file changed, 32 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/HtmlFormatter refs/changes/97/362297/1 diff --git a/src/HtmlFormatter.php b/src/HtmlFormatter.php index e93ab1f..a185a4d 100644 --- a/src/HtmlFormatter.php +++ b/src/HtmlFormatter.php @@ -33,7 +33,14 @@ private $itemsToRemove = []; private $elementsToFlatten = []; protected $removeMedia = false; - + /** +* @var array Media classes to keep when `$this->removeMedia` is `true`. +* +* For example, the value [ 'img' => [ 'mwe-math-fallback-image-inline' ] ] +* keeps `img` elements with class name `mwe-math-fallback-image-inline`, +* while all other `img` elements are removed. +*/ + private $mediaClassesToKeep = []; /** * Constructor * @@ -92,6 +99,16 @@ */ public function setRemoveMedia( $flag = true ) { $this->removeMedia = $flag; + } + + /** +* Adds class names of images/videos/sounds to keep. +* @param array $classes Array key is a tag name, e.g. 'img', and array +* value is an array of class names, e.g. [ 'mwe-math-fallback-image' ] +*/ + public function keepMediaClass( $classes ) { + $this->mediaClassesToKeep = array_merge( + $this->mediaClassesToKeep, $classes ); } /** @@ -159,8 +176,21 @@ foreach ( $removals['TAG'] as $tagToRemove ) { $tagToRemoveNodes = $doc->getElementsByTagName( $tagToRemove ); foreach ( $tagToRemoveNodes as $tagToRemoveNode ) { + $shouldRemoveTag = true; if ( $tagToRemoveNode ) { - $domElemsToRemove[] = $tagToRemoveNode; + if ( array_key_exists( $tagToRemove, $this->mediaClassesToKeep ) ) { + $classes = $tagToRemoveNode->getAttribute( 'class' ); + $mediaClassesToKeep = $this->mediaClassesToKeep[ $tagToRemove ]; + foreach ( $mediaClassesToKeep as $classToKeep ) { + if ( \preg_match( "/\b$classToKeep\b/", $classes ) ) { + $shouldRemoveTag = false; + break; + } + } + } + if ( $shouldRemoveTag ) { + $domElemsToRemove[] = $tagToRemoveNode; + } } } } -- To view, visit https://gerrit.wikimedia.org/r/362297 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1934e4fb9aaa16e6f0de2db278817b7149c2923 Gerrit-PatchSet: 1 Gerrit-Project: HtmlFormatter Gerrit-Branch: master Gerrit-Owner: Bmansurov___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Merge branch 'master' into deployment
Mepps has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362296 ) Change subject: Merge branch 'master' into deployment .. Merge branch 'master' into deployment 77f6260 Send resultswitcher reloaders to TY page Change-Id: I0222727ad5ee46bba23e293a1f2b074562669f98 --- D tests/phpunit/Adapter/PayPal/PayPalExpressTest.php D tests/phpunit/includes/test_gateway/TestingPaypalExpressAdapter.php 2 files changed, 0 insertions(+), 383 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/96/362296/1 diff --git a/tests/phpunit/Adapter/PayPal/PayPalExpressTest.php b/tests/phpunit/Adapter/PayPal/PayPalExpressTest.php deleted file mode 100644 index 31f58e1..000 --- a/tests/phpunit/Adapter/PayPal/PayPalExpressTest.php +++ /dev/null @@ -1,321 +0,0 @@ -<<< HEAD (f83144 Revert "Merge branch 'master' into deployment") -=== -setMwGlobals( array( - 'wgDonationInterfaceCancelPage' => 'https://example.com/tryAgain.php', - 'wgPaypalExpressGatewayEnabled' => true, - 'wgDonationInterfaceThankYouPage' => 'https://example.org/wiki/Thank_You', - ) ); - } - - protected function unsetVariableFields( &$message ) { - $fields = array( - 'date', 'source_enqueued_time', 'source_host', 'source_run_id', 'source_version', 'gateway_account' - ); - foreach ( $fields as $field ) { - unset( $message[$field] ); - } - } - - function testPaymentSetup() { - $init = array( - 'amount' => 1.55, - 'currency' => 'USD', - 'payment_method' => 'paypal', - 'utm_source' => 'CD1234_FR', - 'utm_medium' => 'sitenotice', - 'country' => 'US', - 'contribution_tracking_id' => strval( mt_rand() ), - 'language' => 'fr', - ); - $gateway = $this->getFreshGatewayObject( $init ); - $gateway->setDummyGatewayResponseCode( 'OK' ); - $result = $gateway->doPayment(); - $gateway->logPending(); // GatewayPage calls this for redirects - $this->assertEquals( - 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout=EC-8US12345X1234567U', - $result->getRedirect(), - 'Wrong redirect for PayPal EC payment setup' - ); - $message = DonationQueue::instance()->pop( 'pending' ); - $this->assertNotEmpty( $message, 'Missing pending message' ); - $this->unsetVariableFields( $message ); - $expected = array( - 'country' => 'US', - 'fee' => '0', - 'gateway' => 'paypal_ec', - 'gateway_txn_id' => null, - 'language' => 'fr', - 'contribution_tracking_id' => $init['contribution_tracking_id'], - 'order_id' => $init['contribution_tracking_id'] . '.0', - 'utm_source' => 'CD1234_FR..paypal', - 'currency' => 'USD', - 'email' => '', - 'gross' => '1.55', - 'recurring' => '', - 'response' => false, - 'utm_medium' => 'sitenotice', - 'payment_method' => 'paypal', - 'payment_submethod' => '', - 'gateway_session_id' => 'EC-8US12345X1234567U', - 'user_ip' => '127.0.0.1', - 'source_name' => 'DonationInterface', - 'source_type' => 'payments', - ); - $this->assertEquals( - $expected, - $message, - 'PayPal EC setup sending wrong pending message' - ); - } - - /** -* Check that the adapter makes the correct calls for successful donations -* and sends a good queue message. -*/ - function testProcessDonorReturn() { - $init = $this->getDonorTestData( 'US' ); - $init['contribution_tracking_id'] = '45931210'; - $this->setUpRequest( $init, array( 'Donor' => $init ) ); - - $gateway = $this->getFreshGatewayObject( $init ); - $gateway->setDummyGatewayResponseCode( 'OK' ); - $gateway->processDonorReturn( array( - 'token' => 'EC%2d4V987654XA123456V', - 'PayerID' => 'ASDASD' - ) ); - - $message = DonationQueue::instance()->pop( 'donations' ); -
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Send resultswitcher reloaders to TY page
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362295 ) Change subject: Send resultswitcher reloaders to TY page .. Send resultswitcher reloaders to TY page This restores some logic we used to have that kept track of processed orders in a key outside of the donor data. TODO: shouldn't globalcollectadapter return true for isReturnProcessingRequired() ? Cherry picked and sanitized of test code for deployment. Bug: T167990 Change-Id: I9d23953e180b85d0d7ae357442760dd5c4d4619c --- M gateway_common/GatewayPage.php M gateway_common/gateway.adapter.php M paypal_gateway/express_checkout/paypal_express.adapter.php 3 files changed, 59 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Ejegg: Looks good to me, approved diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php index 4b1f2ba..1d0d271 100644 --- a/gateway_common/GatewayPage.php +++ b/gateway_common/GatewayPage.php @@ -398,6 +398,17 @@ $this->setHeaders(); + if ( $this->isRepeatReturnProcess() ) { + $this->logger->warning( + 'Donor is trying to process an already-processed payment. ' . + "Adapter Order ID: $oid.\n" . + "Cookies: " . print_r( $_COOKIE, true ) ."\n" . + "User-Agent: " . $_SERVER['HTTP_USER_AGENT'] + ); + $this->displayThankYouPage( 'repeat return processing' ); + return; + } + if ( $deadSession ){ if ( $this->adapter->isReturnProcessingRequired() ) { wfHttpError( 403, 'Forbidden', wfMessage( 'donate_interface-error-http-403' )->text() ); @@ -429,6 +440,7 @@ // feed processDonorReturn all the GET and POST vars $requestValues = $this->getRequest()->getValues(); $result = $this->adapter->processDonorReturn( $requestValues ); + $this->markReturnProcessed(); $this->renderResponse( $result ); return; } else { @@ -567,4 +579,34 @@ ); } } + + protected function isRepeatReturnProcess() { + $request = $this->getRequest(); + $requestProcessId = $this->adapter->getRequestProcessId( + $request->getValues() + ); + $processedRequests = $request->getSessionData( 'processed_requests' ); + if ( !$requestProcessId || empty( $processedRequests ) ) { + return false; + } + return array_key_exists( $requestProcessId, $processedRequests ); + } + + protected function markReturnProcessed() { + $request = $this->getRequest(); + $requestProcessId = $this->adapter->getRequestProcessId( + $request->getValues() + ); + if ( !$requestProcessId ) { + return; + } + $processedRequests = $request->getSessionData( 'processed_requests' ); + if ( !$processedRequests ) { + $processedRequests = array(); + } + // TODO: we could store the results of the last process here, but for now + // we just indicate we did SOMETHING with it + $processedRequests[$requestProcessId] = true; + $request->setSessionData( 'processed_requests', $processedRequests ); + } } diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index f26ffd0..9a25296 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -1452,6 +1452,18 @@ } /** +* Gateways which return true from isReturnProcessingRequired must +* override this with logic to get an ID from the request which will +* identify repeated attempts to process the same payment. +* +* @param array $requestValues +* @return int|string Order id +*/ + protected function getRequestProcessId( $requestValues ) { + return null; + } + + /** * Process the API response obtained from the payment processor and set * properties of transaction_response. * Default implementation just says we got a response. @@ -2945,6 +2957,7 @@ 'PaymentForms', 'numAttempt', 'order_status', //for post-payment activities + 'processed_requests', //for post-payment activities
[MediaWiki-commits] [Gerrit] mediawiki...deploy[master]: Config: Support red links in ChangeProp
Mobrovac has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362278 ) Change subject: Config: Support red links in ChangeProp .. Config: Support red links in ChangeProp Bug: T133221 Change-Id: I98790e65ffd91fcae82a66de8ac686ccfcc46bd3 --- M scap/templates/config.yaml.j2 1 file changed, 60 insertions(+), 6 deletions(-) Approvals: Mobrovac: Verified; Looks good to me, approved diff --git a/scap/templates/config.yaml.j2 b/scap/templates/config.yaml.j2 index 7f5c714..7ffa612 100644 --- a/scap/templates/config.yaml.j2 +++ b/scap/templates/config.yaml.j2 @@ -245,6 +245,10 @@ cache-control: no-cache query: redirect: false + # The links to the deleted page should become red again + - method: post +uri: '/sys/links/backlinks/{message.page_title}' +body: '{{globals.message}}' # For page deletion RESTBase doesn't emit resource_change events, and to go through # the normal purge chain (html update -> html resource_change -> summary update -> summary resource_change) # we need to add many workarounds/shortcurst in RESTBase. So having this list here is an OK compromise. @@ -276,12 +280,16 @@ domain: /\.wikidata\.org$/ page_namespace: 120 exec: - method: get - uri: '<%= restbase_uri %>/{{message.meta.domain}}/v1/page/title/{message.page_title}' - headers: -cache-control: no-cache - query: -redirect: false + - method: get +uri: '<%= restbase_uri %>/{{message.meta.domain}}/v1/page/title/{message.page_title}' +headers: + cache-control: no-cache +query: + redirect: false + # The links to the restored page should not be red any more + - method: post +uri: '/sys/links/backlinks/{message.page_title}' +body: '{{globals.message}}' page_move: topic: mediawiki.page-move @@ -335,6 +343,52 @@ uri: '/sys/links/transcludes/{message.original_event.page_title}' body: '{{globals.message}}' + page_create: +topic: mediawiki.page-create +retry_on: + status: +- '5xx' +- 404 # Sometimes occasional 404s happen because of the mysql replication lag, so retry +match_not: + - meta: + domain: /\.wikidata\.org$/ +page_namespace: 0 + - meta: + domain: /\.wikidata\.org$/ +page_namespace: 120 +exec: + - method: post +uri: '/sys/links/backlinks/{message.page_title}' +body: '{{globals.message}}' + + on_backlinks_update: +topic: change-prop.backlinks.resource-change +limiters: + blacklist: '{message.meta.uri}' +cases: + - match: + meta: +schema_uri: 'resource_change/1' +uri: '/https?:\/\/[^\/]+\/wiki\/(?.+)/' + tags: [ 'backlinks' ] +exec: + method: get + uri: '<%= restbase_uri %>/{{message.meta.domain}}/v1/page/html/{{match.meta.uri.title}}' + headers: +cache-control: no-cache +if-unmodified-since: '{{date(message.meta.dt)}}' +x-restbase-mode: '{{message.tags[1]}}' + query: +redirect: false + - match: + meta: +schema_uri: 'continue/1' +exec: + method: post + uri: '/sys/links/backlinks/{message.original_event.page_title}' + body: '{{globals.message}}' + + # ORES caching updates <%- if ores_uris is not defined -%> <%- set ores_uris = [ ores_uri ] -%> -- To view, visit https://gerrit.wikimedia.org/r/362278 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I98790e65ffd91fcae82a66de8ac686ccfcc46bd3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/change-propagation/deploy Gerrit-Branch: master Gerrit-Owner: PpchelkoGerrit-Reviewer: GWicke
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Revert "Merge branch 'master' into deployment"
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362294 ) Change subject: Revert "Merge branch 'master' into deployment" .. Revert "Merge branch 'master' into deployment" This reverts commit 74b81105a97d2e207d921a1646a70fb61ae8b912, reversing changes made to c615ad97d44a6c9576b57e3ed756cb92cef9af84. Little problem with the queue cleanup. I think we can cherry-pick the PayPal session fix to deployment without this stuff. Change-Id: I04fbf0068afb435889ffb8e520db18136c6b848d --- M DonationInterface.alias.php M adyen_gateway/adyen.adapter.php M amazon_gateway/amazon.adapter.php M amazon_gateway/amazon.api.php M amazon_gateway/i18n/en.json M amazon_gateway/i18n/fr.json M amazon_gateway/i18n/qqq.json M amazon_gateway/i18n/ru.json M amazon_gateway/i18n/uk.json M extras/FraudFilter.php M extras/banner_history/BannerHistoryLogIdProcessor.php M gateway_common/DonationData.php M gateway_common/DonationQueue.php M gateway_common/GatewayType.php M gateway_common/NationalCurrencies.php M gateway_common/WmfFramework.drupal.php M gateway_common/WmfFramework.mediawiki.php M gateway_common/gateway.adapter.php M gateway_common/i18n/interface/ast.json M gateway_common/i18n/interface/bg.json M gateway_common/i18n/interface/bn.json M gateway_common/i18n/interface/bs.json M gateway_common/i18n/interface/en.json M gateway_common/i18n/interface/es.json M gateway_common/i18n/interface/fr.json M gateway_common/i18n/interface/hr.json M gateway_common/i18n/interface/ia.json M gateway_common/i18n/interface/it.json M gateway_common/i18n/interface/jv.json M gateway_common/i18n/interface/lt.json M gateway_common/i18n/interface/mk.json M gateway_common/i18n/interface/nb.json M gateway_common/i18n/interface/pt.json M gateway_common/i18n/interface/qqq.json M gateway_common/i18n/interface/ru.json M gateway_common/i18n/interface/sv.json M gateway_common/i18n/interface/uk.json M gateway_common/i18n/interface/ur.json M gateway_common/i18n/interface/yi.json M gateway_common/i18n/interface/zh-hans.json M gateway_common/i18n/interface/zh-hant.json M gateway_forms/mustache/forms.css M globalcollect_gateway/globalcollect_resultswitcher.body.php M globalcollect_gateway/i18n/es.json M globalcollect_gateway/orphan.adapter.php M paypal_gateway/express_checkout/paypal_express.adapter.php 46 files changed, 302 insertions(+), 307 deletions(-) Approvals: jenkins-bot: Verified Ejegg: Looks good to me, approved diff --git a/DonationInterface.alias.php b/DonationInterface.alias.php index 060dee0..725754d 100644 --- a/DonationInterface.alias.php +++ b/DonationInterface.alias.php @@ -1,9 +1,11 @@ [ 'GatewayFormChooser' ], - 'SystemStatus' => [ 'SystemStatus' ], -]; +$specialPageAliases['en'] = array( + 'GatewayFormChooser' => array( 'GatewayFormChooser' ), + 'SystemStatus' => array( 'SystemStatus' ), +); diff --git a/adyen_gateway/adyen.adapter.php b/adyen_gateway/adyen.adapter.php index 8129c3e..c86adb5 100644 --- a/adyen_gateway/adyen.adapter.php +++ b/adyen_gateway/adyen.adapter.php @@ -215,8 +215,8 @@ * whether to capture the payment or leave it for manual review. * @return array */ - protected function getQueueDonationMessage() { - $transaction = parent::getQueueDonationMessage(); + protected function getStompTransaction() { + $transaction = parent::getStompTransaction(); $transaction['risk_score'] = $this->risk_score; return $transaction; } diff --git a/amazon_gateway/amazon.adapter.php b/amazon_gateway/amazon.adapter.php index 08e499a..8d4473a 100644 --- a/amazon_gateway/amazon.adapter.php +++ b/amazon_gateway/amazon.adapter.php @@ -199,7 +199,7 @@ ) ); // Stash their info in pending queue and logs to fill in data for // audit and IPN messages - $details = $this->getQueueDonationMessage(); + $details = $this->getStompTransaction(); $this->logger->info( 'Got info for Amazon donation: ' . json_encode( $details ) ); $this->sendPendingMessage(); } diff --git a/amazon_gateway/amazon.api.php b/amazon_gateway/amazon.api.php index 3b9cd54..740b912 100644 --- a/amazon_gateway/amazon.api.php +++ b/amazon_gateway/amazon.api.php @@ -24,9 +24,7 @@ ), ); - $adapterClass = DonationInterface::getAdapterClassForGateway( 'amazon' ); - // @var AmazonAdapter - $adapter = new $adapterClass( $adapterParams ); + $adapter = new AmazonAdapter( $adapterParams ); if ( $adapter->getErrorState()->hasErrors() ) { $output->addValue( diff --git a/amazon_gateway/i18n/en.json b/amazon_gateway/i18n/en.json index 4b1ef57..d0ba913 100644 --- a/amazon_gateway/i18n/en.json +++
[MediaWiki-commits] [Gerrit] mediawiki...Linter[master]: Drop lints w/o dsr info
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362258 ) Change subject: Drop lints w/o dsr info .. Drop lints w/o dsr info Bug: T168900 Change-Id: Ia29629b4ad790f53cb99c6a6d3b20e20b7e35e54 --- M includes/ApiRecordLint.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/ApiRecordLint.php b/includes/ApiRecordLint.php index 0b4409d..c009f4f 100644 --- a/includes/ApiRecordLint.php +++ b/includes/ApiRecordLint.php @@ -72,6 +72,7 @@ 'lint' => $info['type'], ] ); + continue; } $info['location'] = array_slice( $info['dsr'], 0, 2 ); if ( isset( $info['templateInfo'] ) && $info['templateInfo'] ) { -- To view, visit https://gerrit.wikimedia.org/r/362258 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia29629b4ad790f53cb99c6a6d3b20e20b7e35e54 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Linter Gerrit-Branch: master Gerrit-Owner: ArlolraGerrit-Reviewer: Chad Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Subramanya Sastry Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[deployment]: Send resultswitcher reloaders to TY page
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362295 ) Change subject: Send resultswitcher reloaders to TY page .. Send resultswitcher reloaders to TY page This restores some logic we used to have that kept track of processed orders in a key outside of the donor data. TODO: shouldn't globalcollectadapter return true for isReturnProcessingRequired() ? Cherry picked and sanitized of test code for deployment. Bug: T167990 Change-Id: I9d23953e180b85d0d7ae357442760dd5c4d4619c --- M gateway_common/GatewayPage.php M gateway_common/gateway.adapter.php M paypal_gateway/express_checkout/paypal_express.adapter.php 3 files changed, 59 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/95/362295/1 diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php index 4b1f2ba..1d0d271 100644 --- a/gateway_common/GatewayPage.php +++ b/gateway_common/GatewayPage.php @@ -398,6 +398,17 @@ $this->setHeaders(); + if ( $this->isRepeatReturnProcess() ) { + $this->logger->warning( + 'Donor is trying to process an already-processed payment. ' . + "Adapter Order ID: $oid.\n" . + "Cookies: " . print_r( $_COOKIE, true ) ."\n" . + "User-Agent: " . $_SERVER['HTTP_USER_AGENT'] + ); + $this->displayThankYouPage( 'repeat return processing' ); + return; + } + if ( $deadSession ){ if ( $this->adapter->isReturnProcessingRequired() ) { wfHttpError( 403, 'Forbidden', wfMessage( 'donate_interface-error-http-403' )->text() ); @@ -429,6 +440,7 @@ // feed processDonorReturn all the GET and POST vars $requestValues = $this->getRequest()->getValues(); $result = $this->adapter->processDonorReturn( $requestValues ); + $this->markReturnProcessed(); $this->renderResponse( $result ); return; } else { @@ -567,4 +579,34 @@ ); } } + + protected function isRepeatReturnProcess() { + $request = $this->getRequest(); + $requestProcessId = $this->adapter->getRequestProcessId( + $request->getValues() + ); + $processedRequests = $request->getSessionData( 'processed_requests' ); + if ( !$requestProcessId || empty( $processedRequests ) ) { + return false; + } + return array_key_exists( $requestProcessId, $processedRequests ); + } + + protected function markReturnProcessed() { + $request = $this->getRequest(); + $requestProcessId = $this->adapter->getRequestProcessId( + $request->getValues() + ); + if ( !$requestProcessId ) { + return; + } + $processedRequests = $request->getSessionData( 'processed_requests' ); + if ( !$processedRequests ) { + $processedRequests = array(); + } + // TODO: we could store the results of the last process here, but for now + // we just indicate we did SOMETHING with it + $processedRequests[$requestProcessId] = true; + $request->setSessionData( 'processed_requests', $processedRequests ); + } } diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index f26ffd0..9a25296 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -1452,6 +1452,18 @@ } /** +* Gateways which return true from isReturnProcessingRequired must +* override this with logic to get an ID from the request which will +* identify repeated attempts to process the same payment. +* +* @param array $requestValues +* @return int|string Order id +*/ + protected function getRequestProcessId( $requestValues ) { + return null; + } + + /** * Process the API response obtained from the payment processor and set * properties of transaction_response. * Default implementation just says we got a response. @@ -2945,6 +2957,7 @@ 'PaymentForms', 'numAttempt', 'order_status', //for post-payment activities + 'processed_requests', //for post-payment
[MediaWiki-commits] [Gerrit] mediawiki...codesniffer[master]: Add sniff to verify type-casts use the short form (bool, int)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362171 ) Change subject: Add sniff to verify type-casts use the short form (bool, int) .. Add sniff to verify type-casts use the short form (bool, int) Bug: T145162 Change-Id: Ieabdfb31d490e946971332ae0dd060b842e94aa3 --- A MediaWiki/Sniffs/AlternativeSyntax/ShortCastSyntaxSniff.php A MediaWiki/Tests/files/AlternativeSyntax/short_cast.php A MediaWiki/Tests/files/AlternativeSyntax/short_cast.php.expect A MediaWiki/Tests/files/AlternativeSyntax/short_cast.php.fixed 4 files changed, 84 insertions(+), 0 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/MediaWiki/Sniffs/AlternativeSyntax/ShortCastSyntaxSniff.php b/MediaWiki/Sniffs/AlternativeSyntax/ShortCastSyntaxSniff.php new file mode 100644 index 000..222defc --- /dev/null +++ b/MediaWiki/Sniffs/AlternativeSyntax/ShortCastSyntaxSniff.php @@ -0,0 +1,65 @@ +http://www.gnu.org/copyleft/gpl.html + * + * @file + */ + +namespace MediaWiki\Sniffs\AlternativeSyntax; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; + +class ShortCastSyntaxSniff implements Sniff { + /** +* @return array +*/ + public function register() { + return [ + T_BOOL_CAST, + T_INT_CAST, + ]; + } + + /** +* @param File $phpcsFile File object +* @param int $stackPtr Position of error +*/ + public function process( File $phpcsFile, $stackPtr ) { + $token = $phpcsFile->getTokens()[$stackPtr]; + + if ( $token['code'] === T_BOOL_CAST && $token['content'] !== '(bool)' ) { + $fix = $phpcsFile->addFixableWarning( + 'Type-cast should use short "bool" form', + $stackPtr, + 'NotShortBoolForm' + ); + if ( $fix === true ) { + $phpcsFile->fixer->replaceToken( $stackPtr, '(bool)' ); + } + } elseif ( $token['code'] === T_INT_CAST && $token['content'] !== '(int)' ) { + $fix = $phpcsFile->addFixableWarning( + 'Type-cast should use short "int" form', + $stackPtr, + 'NotShortIntForm' + ); + if ( $fix === true ) { + $phpcsFile->fixer->replaceToken( $stackPtr, '(int)' ); + } + } + } + +} diff --git a/MediaWiki/Tests/files/AlternativeSyntax/short_cast.php b/MediaWiki/Tests/files/AlternativeSyntax/short_cast.php new file mode 100644 index 000..42c7308 --- /dev/null +++ b/MediaWiki/Tests/files/AlternativeSyntax/short_cast.php @@ -0,0 +1,7 @@ +https://gerrit.wikimedia.org/r/362171 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieabdfb31d490e946971332ae0dd060b842e94aa3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/tools/codesniffer Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Addshore 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...DonationInterface[deployment]: Revert "Merge branch 'master' into deployment"
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362294 ) Change subject: Revert "Merge branch 'master' into deployment" .. Revert "Merge branch 'master' into deployment" This reverts commit 74b81105a97d2e207d921a1646a70fb61ae8b912, reversing changes made to c615ad97d44a6c9576b57e3ed756cb92cef9af84. Little problem with the queue cleanup. I think we can cherry-pick the PayPal session fix to deployment without this stuff. Change-Id: I04fbf0068afb435889ffb8e520db18136c6b848d --- M DonationInterface.alias.php M adyen_gateway/adyen.adapter.php M amazon_gateway/amazon.adapter.php M amazon_gateway/amazon.api.php M amazon_gateway/i18n/en.json M amazon_gateway/i18n/fr.json M amazon_gateway/i18n/qqq.json M amazon_gateway/i18n/ru.json M amazon_gateway/i18n/uk.json M extras/FraudFilter.php M extras/banner_history/BannerHistoryLogIdProcessor.php M gateway_common/DonationData.php M gateway_common/DonationQueue.php M gateway_common/GatewayType.php M gateway_common/NationalCurrencies.php M gateway_common/WmfFramework.drupal.php M gateway_common/WmfFramework.mediawiki.php M gateway_common/gateway.adapter.php M gateway_common/i18n/interface/ast.json M gateway_common/i18n/interface/bg.json M gateway_common/i18n/interface/bn.json M gateway_common/i18n/interface/bs.json M gateway_common/i18n/interface/en.json M gateway_common/i18n/interface/es.json M gateway_common/i18n/interface/fr.json M gateway_common/i18n/interface/hr.json M gateway_common/i18n/interface/ia.json M gateway_common/i18n/interface/it.json M gateway_common/i18n/interface/jv.json M gateway_common/i18n/interface/lt.json M gateway_common/i18n/interface/mk.json M gateway_common/i18n/interface/nb.json M gateway_common/i18n/interface/pt.json M gateway_common/i18n/interface/qqq.json M gateway_common/i18n/interface/ru.json M gateway_common/i18n/interface/sv.json M gateway_common/i18n/interface/uk.json M gateway_common/i18n/interface/ur.json M gateway_common/i18n/interface/yi.json M gateway_common/i18n/interface/zh-hans.json M gateway_common/i18n/interface/zh-hant.json M gateway_forms/mustache/forms.css M globalcollect_gateway/globalcollect_resultswitcher.body.php M globalcollect_gateway/i18n/es.json M globalcollect_gateway/orphan.adapter.php M paypal_gateway/express_checkout/paypal_express.adapter.php 46 files changed, 302 insertions(+), 307 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/94/362294/1 diff --git a/DonationInterface.alias.php b/DonationInterface.alias.php index 060dee0..725754d 100644 --- a/DonationInterface.alias.php +++ b/DonationInterface.alias.php @@ -1,9 +1,11 @@ [ 'GatewayFormChooser' ], - 'SystemStatus' => [ 'SystemStatus' ], -]; +$specialPageAliases['en'] = array( + 'GatewayFormChooser' => array( 'GatewayFormChooser' ), + 'SystemStatus' => array( 'SystemStatus' ), +); diff --git a/adyen_gateway/adyen.adapter.php b/adyen_gateway/adyen.adapter.php index 8129c3e..c86adb5 100644 --- a/adyen_gateway/adyen.adapter.php +++ b/adyen_gateway/adyen.adapter.php @@ -215,8 +215,8 @@ * whether to capture the payment or leave it for manual review. * @return array */ - protected function getQueueDonationMessage() { - $transaction = parent::getQueueDonationMessage(); + protected function getStompTransaction() { + $transaction = parent::getStompTransaction(); $transaction['risk_score'] = $this->risk_score; return $transaction; } diff --git a/amazon_gateway/amazon.adapter.php b/amazon_gateway/amazon.adapter.php index 08e499a..8d4473a 100644 --- a/amazon_gateway/amazon.adapter.php +++ b/amazon_gateway/amazon.adapter.php @@ -199,7 +199,7 @@ ) ); // Stash their info in pending queue and logs to fill in data for // audit and IPN messages - $details = $this->getQueueDonationMessage(); + $details = $this->getStompTransaction(); $this->logger->info( 'Got info for Amazon donation: ' . json_encode( $details ) ); $this->sendPendingMessage(); } diff --git a/amazon_gateway/amazon.api.php b/amazon_gateway/amazon.api.php index 3b9cd54..740b912 100644 --- a/amazon_gateway/amazon.api.php +++ b/amazon_gateway/amazon.api.php @@ -24,9 +24,7 @@ ), ); - $adapterClass = DonationInterface::getAdapterClassForGateway( 'amazon' ); - // @var AmazonAdapter - $adapter = new $adapterClass( $adapterParams ); + $adapter = new AmazonAdapter( $adapterParams ); if ( $adapter->getErrorState()->hasErrors() ) { $output->addValue( diff --git a/amazon_gateway/i18n/en.json b/amazon_gateway/i18n/en.json index 4b1ef57..d0ba913 100644 ---
[MediaWiki-commits] [Gerrit] labs/icinga2[master]: Fix class
Paladox has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362293 ) Change subject: Fix class .. Fix class Change-Id: I0a97da10c169ecd7af50d30df04f00a288d16619 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/icinga2 refs/changes/93/362293/1 -- To view, visit https://gerrit.wikimedia.org/r/362293 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a97da10c169ecd7af50d30df04f00a288d16619 Gerrit-PatchSet: 1 Gerrit-Project: labs/icinga2 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] labs/icinga2[master]: Fix class
Paladox has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362293 ) Change subject: Fix class .. Fix class Change-Id: I0a97da10c169ecd7af50d30df04f00a288d16619 --- M manifests/web.pp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Paladox: Verified; Looks good to me, approved diff --git a/manifests/web.pp b/manifests/web.pp index f7587db..6dc90ce 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -29,7 +29,7 @@ include ::apache::mod::php5 } if os_version('debian >= stretch') { -include ::apache::mod::php7.0 +include ::apache::mod::php7 } include ::apache::mod::ssl include ::apache::mod::headers -- To view, visit https://gerrit.wikimedia.org/r/362293 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a97da10c169ecd7af50d30df04f00a288d16619 Gerrit-PatchSet: 2 Gerrit-Project: labs/icinga2 Gerrit-Branch: master Gerrit-Owner: PaladoxGerrit-Reviewer: Paladox ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] labs/icinga2[master]: Retrying mutante php 7.0 change part 2
Paladox has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362292 ) Change subject: Retrying mutante php 7.0 change part 2 .. Retrying mutante php 7.0 change part 2 Change-Id: I874e791bb1c010ce6b36aa2cfc1429572e0d36ca --- M manifests/web.pp 1 file changed, 7 insertions(+), 4 deletions(-) Approvals: Paladox: Verified; Looks good to me, approved diff --git a/manifests/web.pp b/manifests/web.pp index 3d0690c..f7587db 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -25,6 +25,12 @@ } include ::apache +if os_version('debian == jessie') { +include ::apache::mod::php5 +} +if os_version('debian >= stretch') { +include ::apache::mod::php7.0 +} include ::apache::mod::ssl include ::apache::mod::headers include ::apache::mod::cgi @@ -142,12 +148,9 @@ content => template('icinga2/icinga.wmflabs.org.erb'), } -if os_version('debian >= stretch') { -require_package('libapache2-mod-php') -} - file { '/etc/apache2/conf.d/icinga2.conf': ensure => absent, } } + -- To view, visit https://gerrit.wikimedia.org/r/362292 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I874e791bb1c010ce6b36aa2cfc1429572e0d36ca Gerrit-PatchSet: 2 Gerrit-Project: labs/icinga2 Gerrit-Branch: master Gerrit-Owner: PaladoxGerrit-Reviewer: Paladox ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...AdvancedSearch[master]: Fix indent in json files
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362275 ) Change subject: Fix indent in json files .. Fix indent in json files Change-Id: I54f2fb2ff1abf5f1db637bf741f040d42f7d831e --- M i18n/en.json M i18n/qqq.json 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/i18n/en.json b/i18n/en.json index 94e6109..4e7d676 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -44,6 +44,6 @@ "advancedSearch-namespaces-articles": "Articles", "advancedSearch-namespaces-search-in": "Search in:", "advancedSearch-namespaces-preset-all": "All", - "advancedSearch-beta-feature-message": "Advanced Search Interface", - "advancedSearch-beta-feature-description": "Easy access to advanced search capabilities on [[Special:Search]]." + "advancedSearch-beta-feature-message": "Advanced Search Interface", + "advancedSearch-beta-feature-description": "Easy access to advanced search capabilities on [[Special:Search]]." } diff --git a/i18n/qqq.json b/i18n/qqq.json index 2d7ec74..3356d5c 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -44,6 +44,6 @@ "advancedSearch-namespaces-articles": "Label for the 'Articles' namespace (usually with a an empty translated namespace label)", "advancedSearch-namespaces-search-in": "Label for the 'Search in' section heading of the namespace section", "advancedSearch-namespaces-preset-all": "Label for the namespace preset 'All namespaces'", - "advancedSearch-beta-feature-message": "Label for the AdvancedSearch Beta Feature.", - "advancedSearch-beta-feature-description": "Description for the AdvancedSearch Beta Feature, describing the feature that will be enabled." + "advancedSearch-beta-feature-message": "Label for the AdvancedSearch Beta Feature.", + "advancedSearch-beta-feature-description": "Description for the AdvancedSearch Beta Feature, describing the feature that will be enabled." } -- To view, visit https://gerrit.wikimedia.org/r/362275 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I54f2fb2ff1abf5f1db637bf741f040d42f7d831e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AdvancedSearch Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-Reviewer: Gabriel Birke Gerrit-Reviewer: Jforrester Gerrit-Reviewer: WMDE-Fisch 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/icinga2[master]: Retrying mutante php 7.0 change part 2
Paladox has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362292 ) Change subject: Retrying mutante php 7.0 change part 2 .. Retrying mutante php 7.0 change part 2 Change-Id: I874e791bb1c010ce6b36aa2cfc1429572e0d36ca --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/icinga2 refs/changes/92/362292/1 -- To view, visit https://gerrit.wikimedia.org/r/362292 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I874e791bb1c010ce6b36aa2cfc1429572e0d36ca Gerrit-PatchSet: 1 Gerrit-Project: labs/icinga2 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...VisualEditor[master]: Run stylelint for less file
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362274 ) Change subject: Run stylelint for less file .. Run stylelint for less file File was added with I151fc9bab3d3032f50c8d11be6b54e45a06fcc34 Change-Id: I5ef55e47a39e7ec3ea7c6066a048b1c4747b25ad --- M Gruntfile.js 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/Gruntfile.js b/Gruntfile.js index 2e6bd55..0ed9734 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -131,6 +131,7 @@ stylelint: { all: [ '**/*.css', + '**/*.less', '!coverage/**', '!dist/**', '!docs/**', -- To view, visit https://gerrit.wikimedia.org/r/362274 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ef55e47a39e7ec3ea7c6066a048b1c4747b25ad Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: UmherirrenderGerrit-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...GeoGebra[master]: build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362245 ) Change subject: build: Updating mediawiki/mediawiki-codesniffer to 0.9.0 .. build: Updating mediawiki/mediawiki-codesniffer to 0.9.0 Fix remaining phpcs issues: - Add explict var visibility - Fixed global - Break long lines Change-Id: I96abf88279f1ed97e4e1d8b5fdb4ee26452f18c0 --- M GeoGebra.body.php M GeoGebra.php M composer.json M phpcs.xml 4 files changed, 45 insertions(+), 38 deletions(-) Approvals: jenkins-bot: Verified Jforrester: Looks good to me, approved diff --git a/GeoGebra.body.php b/GeoGebra.body.php index 898a5d7..4996606 100644 --- a/GeoGebra.body.php +++ b/GeoGebra.body.php @@ -1,61 +1,69 @@ escaped(); return wfMessage( 'geogebra-error' )->rawParams( $error_message )->parseAsBlock() . $CRLF; } $parameters = ''; $shortKeyMap = [ - 'id'=>'material_id', - 'border' => 'borderColor', - 'rc'=>'enableRightClick', - 'ai'=>'showAlgebraInput', - 'sdz'=>'enableShiftDragZoom', - 'smb'=>'showMenuBar', - 'stb'=>'showToolBar', - 'stbh'=>'showToolBarHelp', - 'showtoolbar'=>'showToolBar', - 'enableRightClick'=>'enableRightClick' + 'id' => 'material_id', + 'border' => 'borderColor', + 'rc' => 'enableRightClick', + 'ai' => 'showAlgebraInput', + 'sdz' => 'enableShiftDragZoom', + 'smb' => 'showMenuBar', + 'stb' => 'showToolBar', + 'stbh' => 'showToolBarHelp', + 'showtoolbar' => 'showToolBar', + 'enableRightClick' => 'enableRightClick' ]; - foreach ( $args as $key => $value ){ - if ( $key == "filename" ){ - $ggbFile = wfLocalFile( $value ); - if ( !( $ggbFile->exists() ) ) { - return wfMessage( 'geogebra-file-not-found' )->rawParams( $ggbBinary )->escaped(); - } else { - $fc = file_get_contents( $ggbFile->getLocalRefPath() ); - $parameters .= ',ggbBase64:"'.base64_encode( $fc ).'"'; - } + foreach ( $args as $key => $value ) { + if ( $key == "filename" ) { + $ggbFile = wfLocalFile( $value ); + if ( !( $ggbFile->exists() ) ) { + return wfMessage( 'geogebra-file-not-found' ) + ->rawParams( $ggbBinary )->escaped(); + } else { + $fc = file_get_contents( $ggbFile->getLocalRefPath() ); + $parameters .= ',ggbBase64:"' . base64_encode( $fc ) . '"'; + } continue; } - $shortKey = isset( $shortKeyMap[$key] ) ? $shortKeyMap[$key] : htmlspecialchars( strip_tags( $key ) ); - $parameters .= ','.$shortKey . ':"' . htmlspecialchars( strip_tags( $value ) ) . '"'; + $shortKey = isset( $shortKeyMap[$key] ) + ? $shortKeyMap[$key] + : htmlspecialchars( strip_tags( $key ) ); + $parameters .= ',' . $shortKey . ':"' . htmlspecialchars( strip_tags( $value ) ) . '"'; } $div = md5( rand() ); self::$divs[] = $div; - $iframe = ' if(!window.ggbParams){window.ggbParams ={};}; window.ggbParams["'.$div.'"] = {'.substr( $parameters, 1 ).'}; '.$CRLF - .""; + $iframe = ' if(!window.ggbParams){window.ggbParams ={};}; window.ggbParams["' . + $div . '"] = {' . substr( $parameters, 1 ) . '}; ' . $CRLF . + ""; return $iframe; } static function injectJS( $out ) { + global $wgGeoGebraTechnology; - $technology = isset( $wgGeoGebraTechnology ) ? htmlspecialchars( strip_tags( $wgGeoGebraTechnology ) ) : "preferhtml5"; - $deployGGBUrl = isset( $wgGeoGebraDeployURL ) ? htmlspecialchars( strip_tags( $wgGeoGebraDeployURL
[MediaWiki-commits] [Gerrit] labs/icinga2[master]: Revert "Testing mutante php 7 apache change"
Paladox has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362291 ) Change subject: Revert "Testing mutante php 7 apache change" .. Revert "Testing mutante php 7 apache change" This reverts commit 3c595df5b30b52ef4c28ae38dc3fcb607c33774b. Change-Id: Ied61f356b5c2f86db5739da9c08c7a99229c065c --- M manifests/web.pp 1 file changed, 4 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/icinga2 refs/changes/91/362291/1 diff --git a/manifests/web.pp b/manifests/web.pp index 8125ad4..3d0690c 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -25,12 +25,6 @@ } include ::apache -if os_version('debian == jessie') { -include ::apache::mod::php5 -} -if os_version('debian >= stretch') { -include ::apache::mod::php7 -} include ::apache::mod::ssl include ::apache::mod::headers include ::apache::mod::cgi @@ -148,6 +142,10 @@ content => template('icinga2/icinga.wmflabs.org.erb'), } +if os_version('debian >= stretch') { +require_package('libapache2-mod-php') +} + file { '/etc/apache2/conf.d/icinga2.conf': ensure => absent, } -- To view, visit https://gerrit.wikimedia.org/r/362291 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied61f356b5c2f86db5739da9c08c7a99229c065c Gerrit-PatchSet: 1 Gerrit-Project: labs/icinga2 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] labs/icinga2[master]: Revert "Testing mutante php 7 apache change"
Paladox has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362291 ) Change subject: Revert "Testing mutante php 7 apache change" .. Revert "Testing mutante php 7 apache change" This reverts commit 3c595df5b30b52ef4c28ae38dc3fcb607c33774b. Change-Id: Ied61f356b5c2f86db5739da9c08c7a99229c065c --- M manifests/web.pp 1 file changed, 4 insertions(+), 6 deletions(-) Approvals: Paladox: Verified; Looks good to me, approved diff --git a/manifests/web.pp b/manifests/web.pp index 8125ad4..3d0690c 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -25,12 +25,6 @@ } include ::apache -if os_version('debian == jessie') { -include ::apache::mod::php5 -} -if os_version('debian >= stretch') { -include ::apache::mod::php7 -} include ::apache::mod::ssl include ::apache::mod::headers include ::apache::mod::cgi @@ -148,6 +142,10 @@ content => template('icinga2/icinga.wmflabs.org.erb'), } +if os_version('debian >= stretch') { +require_package('libapache2-mod-php') +} + file { '/etc/apache2/conf.d/icinga2.conf': ensure => absent, } -- To view, visit https://gerrit.wikimedia.org/r/362291 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied61f356b5c2f86db5739da9c08c7a99229c065c Gerrit-PatchSet: 1 Gerrit-Project: labs/icinga2 Gerrit-Branch: master Gerrit-Owner: PaladoxGerrit-Reviewer: Paladox ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] labs/icinga2[master]: Testing mutante php 7 apache change
Paladox has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362281 ) Change subject: Testing mutante php 7 apache change .. Testing mutante php 7 apache change Change-Id: I600f1421aea4a12b34d630d6aefbbf8125f0c973 --- M manifests/web.pp 1 file changed, 6 insertions(+), 4 deletions(-) Approvals: Paladox: Verified; Looks good to me, approved diff --git a/manifests/web.pp b/manifests/web.pp index 3d0690c..8125ad4 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -25,6 +25,12 @@ } include ::apache +if os_version('debian == jessie') { +include ::apache::mod::php5 +} +if os_version('debian >= stretch') { +include ::apache::mod::php7 +} include ::apache::mod::ssl include ::apache::mod::headers include ::apache::mod::cgi @@ -140,10 +146,6 @@ apache::site { 'gerrit-icinga.wmflabs.org': content => template('icinga2/icinga.wmflabs.org.erb'), -} - -if os_version('debian >= stretch') { -require_package('libapache2-mod-php') } file { '/etc/apache2/conf.d/icinga2.conf': -- To view, visit https://gerrit.wikimedia.org/r/362281 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I600f1421aea4a12b34d630d6aefbbf8125f0c973 Gerrit-PatchSet: 2 Gerrit-Project: labs/icinga2 Gerrit-Branch: master Gerrit-Owner: PaladoxGerrit-Reviewer: Paladox ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make mw.widgets.SearchInputWidget extend OO.ui.SearchInputWi...
Bartosz Dziewoński has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362283 ) Change subject: Make mw.widgets.SearchInputWidget extend OO.ui.SearchInputWidget .. Make mw.widgets.SearchInputWidget extend OO.ui.SearchInputWidget Mixin mw.widgets.TitleWidget instead of extending mw.widgets.TitleInputWidget. * Remove code that reimplemented pieces of OO.ui.SearchInputWidget. * Remove code that overrode pieces of mw.widgets.TitleInputWidget. * Copy the code from mw.widgets.TitleInputWidget that we actually want. This should result in no functional changes, other than losing the TitleInputWidget API (some methods and config options) that no one relied on, as far as I can tell. Bug: T169194 Change-Id: Ic1482b4c7cfde7d4cf0b8900654bd3a454776010 --- M includes/widget/SearchInputWidget.php M resources/Resources.php M resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js 3 files changed, 52 insertions(+), 82 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/83/362283/1 diff --git a/includes/widget/SearchInputWidget.php b/includes/widget/SearchInputWidget.php index 90792fc..47d3717 100644 --- a/includes/widget/SearchInputWidget.php +++ b/includes/widget/SearchInputWidget.php @@ -10,12 +10,10 @@ /** * Search input widget. */ -class SearchInputWidget extends TitleInputWidget { +class SearchInputWidget extends \OOUI\TextInputWidget { protected $pushPending = false; protected $performSearchOnClick = true; - protected $validateTitle = false; - protected $highlightFirst = false; protected $dataLocation = 'header'; /** @@ -30,7 +28,6 @@ */ public function __construct( array $config = [] ) { $config = array_merge( [ - 'maxLength' => null, 'icon' => 'search', ], $config ); diff --git a/resources/Resources.php b/resources/Resources.php index 66ea2a9..92d8c83 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -2526,9 +2526,9 @@ ], 'dependencies' => [ 'mediawiki.searchSuggest', - 'oojs-ui.styles.icons-interactions', - // FIXME: Needs TitleInputWidget only + // FIXME: Needs TitleWidget only 'mediawiki.widgets', + 'oojs-ui-widgets', ], ], 'mediawiki.widgets.SearchInputWidget.styles' => [ diff --git a/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js b/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js index b4a712e..824246d 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js +++ b/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js @@ -10,7 +10,9 @@ * Creates a mw.widgets.SearchInputWidget object. * * @class -* @extends mw.widgets.TitleInputWidget +* @extends OO.ui.SearchInputWidget +* @mixins mw.widgets.TitleWidget +* @mixins OO.ui.mixin.LookupElement * * @constructor * @param {Object} [config] Configuration options @@ -30,21 +32,25 @@ var $form = config.$input ? config.$input.closest( 'form' ) : $(); config = $.extend( { - icon: 'search', - maxLength: undefined, performSearchOnClick: true, - dataLocation: 'header', - namespace: 0 + dataLocation: 'header' }, config ); // Parent constructor - mw.widgets.SearchInputWidget.parent.call( this, config ); + mw.widgets.SearchInputWidget.parent.call( this, $.extend( {}, config, { + autocomplete: false + } ) ); + + // Mixin constructors + mw.widgets.TitleWidget.call( this, config ); + OO.ui.mixin.LookupElement.call( this, config ); // Initialization this.$element.addClass( 'mw-widget-searchInputWidget' ); this.lookupMenu.$element.addClass( 'mw-widget-searchWidget-menu' ); this.lastLookupItems = []; if ( !config.pushPending ) { + // TODO This actually overrides a method, that's pretty crazy. Surely there's a better way? this.pushPending = false; } if ( config.dataLocation ) { @@ -66,78 +72,29 @@ ) } ); }.bind( this ) ); - - this.$element.addClass( 'oo-ui-textInputWidget-type-search' ); - this.updateSearchIndicator(); - this.connect( this, { -
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: SearchInputWidget: Fix documented default for 'pushPending' ...
Bartosz Dziewoński has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362282 ) Change subject: SearchInputWidget: Fix documented default for 'pushPending' option .. SearchInputWidget: Fix documented default for 'pushPending' option Change-Id: Iadee48af255498c6608cfd00fca29eed9b14f1be --- M includes/widget/SearchInputWidget.php M resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/82/362282/1 diff --git a/includes/widget/SearchInputWidget.php b/includes/widget/SearchInputWidget.php index 49510da..90792fc 100644 --- a/includes/widget/SearchInputWidget.php +++ b/includes/widget/SearchInputWidget.php @@ -21,7 +21,7 @@ /** * @param array $config Configuration options * @param int|null $config['pushPending'] Whether the input should be visually marked as -* "pending", while requesting suggestions (default: true) +* "pending", while requesting suggestions (default: false) * @param boolean|null $config['performSearchOnClick'] If true, the script will start a search * whenever a user hits a suggestion. If false, the text of the suggestion is inserted into the * text field only (default: true) diff --git a/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js b/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js index 7880b55..b4a712e 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js +++ b/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js @@ -14,7 +14,7 @@ * * @constructor * @param {Object} [config] Configuration options -* @cfg {boolean} [pushPending=true] Visually mark the input field as "pending", while +* @cfg {boolean} [pushPending=false] Visually mark the input field as "pending", while * requesting suggestions. * @cfg {boolean} [performSearchOnClick=true] If true, the script will start a search when- * ever a user hits a suggestion. If false, the text of the suggestion is inserted into the -- To view, visit https://gerrit.wikimedia.org/r/362282 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iadee48af255498c6608cfd00fca29eed9b14f1be Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...DonationInterface[master]: Add tests around payments-antifraud messages
Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362284 ) Change subject: Add tests around payments-antifraud messages .. Add tests around payments-antifraud messages Change-Id: I3df20685d7940d6379b8cedd7f0a0d285bbc7cd9 --- M gateway_common/gateway.adapter.php M tests/phpunit/Adapter/AstroPay/AstroPayTest.php M tests/phpunit/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTest.php M tests/phpunit/FraudFiltersTest.php 4 files changed, 94 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/84/362284/1 diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index be079a7..2752870 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -1837,7 +1837,7 @@ } public function addStandardMessageFields( $transaction ) { - //bascially, add all the stuff we have come to take for granted, because syslog. + // basically, add all the stuff we have come to take for granted, because syslog. $transaction['gateway_txn_id'] = $this->getTransactionGatewayTxnId(); $transaction['date'] = UtcDate::getUtcTimestamp(); $transaction['server'] = gethostname(); @@ -1846,6 +1846,7 @@ 'gateway', 'contribution_tracking_id', 'order_id', + 'payment_method', ); foreach ( $these_too as $field ) { $transaction[$field] = $this->getData_Unstaged_Escaped( $field ); @@ -2089,7 +2090,6 @@ //for now, though, just taking the ones that make it to the logs. $keys = array( 'payment_submethod', - 'payment_method', 'country', 'amount', 'currency', diff --git a/tests/phpunit/Adapter/AstroPay/AstroPayTest.php b/tests/phpunit/Adapter/AstroPay/AstroPayTest.php index 5b6643a..bf16954 100644 --- a/tests/phpunit/Adapter/AstroPay/AstroPayTest.php +++ b/tests/phpunit/Adapter/AstroPay/AstroPayTest.php @@ -17,6 +17,9 @@ */ use \Psr\Log\LogLevel; +use SmashPig\Core\Configuration; +use SmashPig\Core\Context; +use SmashPig\CrmLink\Messages\SourceFields; use Wikimedia\TestingAccessWrapper; /** @@ -42,6 +45,8 @@ $this->setMwGlobals( array( 'wgAstroPayGatewayEnabled' => true, ) ); + $config = Configuration::createForView( 'astropay' ); + Context::initWithLogger( $config ); } /** @@ -463,6 +468,29 @@ $this->assertEquals( 'challenge', $gateway->getValidationAction(), 'Validation action is not as expected' ); $exposed = TestingAccessWrapper::newFromObject( $gateway ); $this->assertEquals( 60, $exposed->risk_score, 'RiskScore is not as expected' ); + $message = DonationQueue::instance()->pop( 'payments-antifraud' ); + SourceFields::removeFromMessage( $message ); + $expected = array( + 'validation_action' => 'challenge', + 'risk_score' => 60, + 'score_breakdown' => array( + 'initial' => 0, + 'getScoreUtmCampaignMap' => 0, + 'getScoreCountryMap' => 0, + 'getScoreUtmSourceMap' => 10.5, + 'getScoreUtmMediumMap' => 12, + 'getScoreEmailDomainMap' => 37.5, + ), + 'user_ip' => '127.0.0.1', + 'gateway_txn_id' => false, + 'date' => $message['date'], + 'server' => gethostname(), + 'gateway' => 'astropay', + 'contribution_tracking_id' => $gateway->getData_Unstaged_Escaped( 'contribution_tracking_id' ), + 'order_id' => $gateway->getData_Unstaged_Escaped( 'order_id' ), + 'payment_method' => 'cc', + ); + $this->assertEquals( $expected, $message ); } function testStageFiscalNumber() { diff --git a/tests/phpunit/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTest.php b/tests/phpunit/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTest.php index 9560034..3e2ed75 100644 --- a/tests/phpunit/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTest.php +++ b/tests/phpunit/Adapter/GlobalCollect/GlobalCollectOrphanAdapterTest.php @@ -17,6 +17,9 @@ */ use Psr\Log\LogLevel; +use SmashPig\Core\Configuration; +use SmashPig\Core\Context; +use SmashPig\CrmLink\Messages\SourceFields;
[MediaWiki-commits] [Gerrit] operations/puppet[production]: netmon: use existing role::network::monitor, clean up site.pp
Dzahn has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362127 ) Change subject: netmon: use existing role::network::monitor, clean up site.pp .. netmon: use existing role::network::monitor, clean up site.pp Change-Id: I4511f8215b596947e36c69dd95a37c6736d6f402 --- M manifests/site.pp M modules/role/manifests/network/monitor.pp 2 files changed, 4 insertions(+), 7 deletions(-) Approvals: jenkins-bot: Verified Filippo Giunchedi: Looks good to me, but someone else must approve Dzahn: Looks good to me, approved diff --git a/manifests/site.pp b/manifests/site.pp index b7bab95..5ed904e 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1741,10 +1741,7 @@ # network monitoring tool server node 'netmon1001.wikimedia.org' { -role(librenms, servermon::wmf, - network::monitor) -include ::passwords::network -include ::base::firewall +role(network::monitor, librenms, servermon::wmf) interface::add_ip6_mapped { 'main': } } @@ -1752,10 +1749,8 @@ # network monitoring tool server - replacement server (T125020) node 'netmon1002.wikimedia.org' { # TODO: role(librenms, servermon::wmf) -role(rancid, smokeping) +role(network::monitor, rancid, smokeping) -include ::passwords::network -include ::base::firewall interface::add_ip6_mapped { 'main': } } diff --git a/modules/role/manifests/network/monitor.pp b/modules/role/manifests/network/monitor.pp index cf09c2e..9a02d6c 100644 --- a/modules/role/manifests/network/monitor.pp +++ b/modules/role/manifests/network/monitor.pp @@ -1,5 +1,7 @@ class role::network::monitor { + include ::standard include ::base::firewall +include ::passwords::network include ::profile::prometheus::snmp_exporter } -- To view, visit https://gerrit.wikimedia.org/r/362127 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4511f8215b596947e36c69dd95a37c6736d6f402 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: DzahnGerrit-Reviewer: Dzahn Gerrit-Reviewer: Filippo Giunchedi Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] labs/icinga2[master]: Testing mutante php 7 apache change
Paladox has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/362281 ) Change subject: Testing mutante php 7 apache change .. Testing mutante php 7 apache change Change-Id: I600f1421aea4a12b34d630d6aefbbf8125f0c973 --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/icinga2 refs/changes/81/362281/1 -- To view, visit https://gerrit.wikimedia.org/r/362281 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I600f1421aea4a12b34d630d6aefbbf8125f0c973 Gerrit-PatchSet: 1 Gerrit-Project: labs/icinga2 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] apps...wikipedia[master]: Performance: update ReadingListData.listContainsTitle
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/362227 ) Change subject: Performance: update ReadingListData.listContainsTitle .. Performance: update ReadingListData.listContainsTitle Rather than getting all page rows containing the list and re-iterating over them, just get the page row for the page we're insterested in and check the list keys. Change-Id: I8e25404430b9e493ddf2f2f92888d30304930094 --- M app/src/main/java/org/wikipedia/readinglist/ReadingListData.java 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Dbrant: Looks good to me, approved jenkins-bot: Verified diff --git a/app/src/main/java/org/wikipedia/readinglist/ReadingListData.java b/app/src/main/java/org/wikipedia/readinglist/ReadingListData.java index c4c4052..c6f970e 100644 --- a/app/src/main/java/org/wikipedia/readinglist/ReadingListData.java +++ b/app/src/main/java/org/wikipedia/readinglist/ReadingListData.java @@ -199,11 +199,11 @@ } private synchronized boolean listContainsTitle(@NonNull String listKey, @NonNull String key) { -Cursor cursor = ReadingListPageDao.instance().pages(listKey); +Cursor cursor = ReadingListPageDao.instance().page(key); try { -while (cursor.moveToNext()) { +if (cursor.moveToFirst()) { ReadingListPage page = ReadingListPage.fromCursor(cursor); -if (page.key().equals(key)) { +if (page.listKeys().contains(listKey)) { return true; } } -- To view, visit https://gerrit.wikimedia.org/r/362227 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e25404430b9e493ddf2f2f92888d30304930094 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: MhollowayGerrit-Reviewer: Dbrant Gerrit-Reviewer: Niedzielski Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits