[MediaWiki-commits] [Gerrit] a file was added for testting - change (mediawiki...examples)
Sirishjoshi has uploaded a new change for review. https://gerrit.wikimedia.org/r/293258 Change subject: a file was added for testting .. a file was added for testting Change-Id: I611935fc3319272ff4a7ef0d11fa04a8fabae49c --- A new test file.txt 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/examples refs/changes/58/293258/1 diff --git a/new test file.txt b/new test file.txt new file mode 100644 index 000..e69de29 --- /dev/null +++ b/new test file.txt -- To view, visit https://gerrit.wikimedia.org/r/293258 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I611935fc3319272ff4a7ef0d11fa04a8fabae49c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/examples Gerrit-Branch: master Gerrit-Owner: Sirishjoshi___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] hello test - change (mediawiki...examples)
Sirishjoshi has uploaded a new change for review. https://gerrit.wikimedia.org/r/293257 Change subject: hello test .. hello test Change-Id: I7c871d70818c6bc1db523277993e3568395714ea --- A test.txt 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/examples refs/changes/57/293257/1 diff --git a/test.txt b/test.txt new file mode 100644 index 000..e69de29 --- /dev/null +++ b/test.txt -- To view, visit https://gerrit.wikimedia.org/r/293257 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7c871d70818c6bc1db523277993e3568395714ea Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/examples Gerrit-Branch: master Gerrit-Owner: Sirishjoshi___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] changed - change (mediawiki...examples)
Sirishjoshi has uploaded a new change for review. https://gerrit.wikimedia.org/r/293256 Change subject: changed .. changed Change-Id: Ibeb60d7f2565c927c9b6dfc3651565e1c3c1746e --- M new test.txt 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/examples refs/changes/56/293256/1 diff --git a/new test.txt b/new test.txt index e69de29..eca92df 100644 --- a/new test.txt +++ b/new test.txt @@ -0,0 +1 @@ +this for test -- To view, visit https://gerrit.wikimedia.org/r/293256 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibeb60d7f2565c927c9b6dfc3651565e1c3c1746e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/examples Gerrit-Branch: master Gerrit-Owner: Sirishjoshi___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] test in master - change (mediawiki...examples)
Sirishjoshi has uploaded a new change for review. https://gerrit.wikimedia.org/r/293255 Change subject: test in master .. test in master Change-Id: Ieae48ce02f391332cc22ea882fe354339a968ed6 --- A new test.txt 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/examples refs/changes/55/293255/1 diff --git a/new test.txt b/new test.txt new file mode 100644 index 000..e69de29 --- /dev/null +++ b/new test.txt -- To view, visit https://gerrit.wikimedia.org/r/293255 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieae48ce02f391332cc22ea882fe354339a968ed6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/examples Gerrit-Branch: master Gerrit-Owner: Sirishjoshi___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Modify access rules - change (All-Projects)
Sirishjoshi has uploaded a new change for review. https://gerrit.wikimedia.org/r/293254 Change subject: Modify access rules .. Modify access rules --- M project.config 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/All-Projects refs/changes/54/293254/1 diff --git a/project.config b/project.config index 68f04c6..2fa67fd 100644 --- a/project.config +++ b/project.config @@ -20,6 +20,7 @@ publishDrafts = group security forgeCommitter = group platform-engineering rebase = group Project Owners + exclusiveGroupPermissions = read create [access "refs/for/refs/*"] push = group Registered Users pushMerge = group Registered Users @@ -32,6 +33,7 @@ submit = group Administrators submit = group Project Owners push = group Administrators + exclusiveGroupPermissions = read push [capability] administrateServer = group Administrators administrateServer = group ldap/ops @@ -85,6 +87,7 @@ create = group platform-engineering push = group Project Owners push = group platform-engineering + exclusiveGroupPermissions = create push [access "refs/meta/*"] label-Code-Review = -2..+2 group Administrators label-Verified = -1..+2 group Administrators -- To view, visit https://gerrit.wikimedia.org/r/293254 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib191f02203439d22c0ce924f75751985ed6e2eb3 Gerrit-PatchSet: 1 Gerrit-Project: All-Projects Gerrit-Branch: refs/meta/config Gerrit-Owner: Sirishjoshi___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Normalize page titles in list=projectpages response - change (mediawiki...PageAssessments)
MusikAnimal has uploaded a new change for review. https://gerrit.wikimedia.org/r/293253 Change subject: Normalize page titles in list=projectpages response .. Normalize page titles in list=projectpages response Bug T137172 Change-Id: Ia237aa91bb2bd41392444a7d0412dcabf0546bd1 --- M api/ApiQueryProjectPages.php 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageAssessments refs/changes/53/293253/1 diff --git a/api/ApiQueryProjectPages.php b/api/ApiQueryProjectPages.php index edb44a5..51bd240 100644 --- a/api/ApiQueryProjectPages.php +++ b/api/ApiQueryProjectPages.php @@ -169,10 +169,13 @@ } private function generateResultVals( $row ) { + // fallback to row title if Title class considers it illegal + $title = Title::newFromText( $row->title ) ?: $row->title; + $vals = array( 'pageid' => (int)$row->page_id, 'ns' => (int)$row->namespace, - 'title' => $row->title, + 'title' => $title, ); if ( isset( $row->class ) && isset( $row->importance ) ) { -- To view, visit https://gerrit.wikimedia.org/r/293253 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia237aa91bb2bd41392444a7d0412dcabf0546bd1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageAssessments Gerrit-Branch: master Gerrit-Owner: MusikAnimal___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed styling - change (mediawiki...Kartographer)
Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/293252 Change subject: Fixed styling .. Fixed styling Bug: T136260 Change-Id: Ib2c65cf1de03a65d4a09fe311a9b7bf159099ded --- M styles/kartographer.less 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer refs/changes/52/293252/1 diff --git a/styles/kartographer.less b/styles/kartographer.less index 864daed..9a980a1 100644 --- a/styles/kartographer.less +++ b/styles/kartographer.less @@ -35,6 +35,9 @@ a.mw-kartographer-link { cursor: pointer; + display: inline; + font-weight: bold; + padding: 0 0.35em 0 0.35em; } .mw-kartographer-autostyled { -- To view, visit https://gerrit.wikimedia.org/r/293252 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2c65cf1de03a65d4a09fe311a9b7bf159099ded Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: Yurik___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] tools: Add role::toollabs::merlbot_proxy - change (operations/puppet)
Yuvipanda has submitted this change and it was merged. Change subject: tools: Add role::toollabs::merlbot_proxy .. tools: Add role::toollabs::merlbot_proxy Role to provision an nginx server acting as an HTTP -> HTTPS reverse proxy. This is a temporary solution for issues with MerlBot and the impending closure of the HTTP POST loophole. Bug: T137235 Change-Id: Id49c79d524654b409cc991634effb473b38fb78b --- A modules/role/manifests/toollabs/merlbot_proxy.pp A modules/role/templates/toollabs/merlbot_proxy/nginx.conf.erb 2 files changed, 58 insertions(+), 0 deletions(-) Approvals: Yuvipanda: Verified; Looks good to me, approved diff --git a/modules/role/manifests/toollabs/merlbot_proxy.pp b/modules/role/manifests/toollabs/merlbot_proxy.pp new file mode 100644 index 000..ef34326 --- /dev/null +++ b/modules/role/manifests/toollabs/merlbot_proxy.pp @@ -0,0 +1,12 @@ +# Class: role::toollabs::merlbot_proxy +# +# Provision an nginx server acting as an HTTP -> HTTPS reverse proxy. +# +class role::toollabs::merlbot_proxy() { +class { '::nginx': +variant => 'light', +} +nginx::site { 'merlbot_proxy': +content => template('role/toollabs/merlbot_proxy/nginx.conf.erb'), +} +} diff --git a/modules/role/templates/toollabs/merlbot_proxy/nginx.conf.erb b/modules/role/templates/toollabs/merlbot_proxy/nginx.conf.erb new file mode 100644 index 000..dba415c --- /dev/null +++ b/modules/role/templates/toollabs/merlbot_proxy/nginx.conf.erb @@ -0,0 +1,46 @@ +# This file is managed by Puppet +# See modules/role/templates/toollabs/merlbot_proxy/nginx.conf.erb +## +# HTTP to HTTPS reverse proxy for MerlBot +# +# Copyright (c) 2016 Bryan Davis and the Wikimedia Foundation +# License: Apache-2.0 +## + +server { +listen 80 default_server; +listen [::]:80 default_server; +server_name _; + +location / { +# Access control +# We only want to allow requests from internal Labs hosts. +# Ideally we would only allow Tool Labs exec nodes, but there +# is no easy way to find those by IP. +allow 10.68.16.0/21; # All of Labs +allow 127.0.0.1; +deny all; + +# Only allow if User-Agent contains "MerlBot" +if ($http_user_agent !~ (MerlBot)) { +return 403; +} + +# Use these DNS servers to resolve proxied names +resolver <%= scope['::nameservers'].join(' ') %>; + +# Act as a non-caching reverse proxy +proxy_http_version 1.1; +proxy_cache_bypass "1"; +proxy_no_cache "1"; +proxy_read_timeout 600s; +proxy_redirect off; + +# Change the protocol to https when contacting upstream +proxy_pass https://$host$uri; + +# Add a header just to remind folks that this is proxied +add_header Labs-TLS-Bandaid "on"; +} +} +# vim:sw=4:ts=4:sts=4:et:ft=nginx: -- To view, visit https://gerrit.wikimedia.org/r/293223 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id49c79d524654b409cc991634effb473b38fb78b Gerrit-PatchSet: 4 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BryanDavisGerrit-Reviewer: Andrew Bogott Gerrit-Reviewer: BryanDavis Gerrit-Reviewer: Yuvipanda Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix color extraction - change (mediawiki...Kartographer)
Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/293251 Change subject: Fix color extraction .. Fix color extraction Bug: T136890 Change-Id: I5c3530f62c6a19b8685edb57ca154cc8197c70f0 (cherry picked from commit 8ba17eed70473c2d0e1e2d768813b0cdc596e595) --- M includes/Tag/MapLink.php M tests/parserTests.txt 2 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer refs/changes/51/293251/1 diff --git a/includes/Tag/MapLink.php b/includes/Tag/MapLink.php index 2e778ac..841dc3f 100644 --- a/includes/Tag/MapLink.php +++ b/includes/Tag/MapLink.php @@ -61,7 +61,7 @@ // if the color is invalid preg_match( '/^#?(([0-9a-fA-F]{3}){1,2})$/', $this->markerProperties->{'marker-color'}, $m ); if ( $m && $m[2] ) { - return "background: #{$m[2]};"; + return "background: #{$m[1]};"; } } diff --git a/tests/parserTests.txt b/tests/parserTests.txt index 039e4df..57d2732 100644 --- a/tests/parserTests.txt +++ b/tests/parserTests.txt @@ -182,7 +182,7 @@ }, "properties": { "marker-symbol": "-letter", - "marker-color": "#abc" + "marker-color": "#abcdef" } }, { @@ -207,12 +207,12 @@ }, "properties": { "marker-symbol": "-number", - "marker-color": "fff" + "marker-color": "FFF" } } !! result -A -2 +A +2 !! end -- To view, visit https://gerrit.wikimedia.org/r/293251 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c3530f62c6a19b8685edb57ca154cc8197c70f0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: wmf/1.28.0-wmf.4 Gerrit-Owner: YurikGerrit-Reviewer: MaxSem ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused import in Searcher - change (mediawiki...CirrusSearch)
Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/293250 Change subject: Remove unused import in Searcher .. Remove unused import in Searcher Change-Id: I47006ddbccd763c9ed1b31a8bf937df924cf73f0 --- M includes/Searcher.php 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch refs/changes/50/293250/1 diff --git a/includes/Searcher.php b/includes/Searcher.php index 2acd101..88f001a 100644 --- a/includes/Searcher.php +++ b/includes/Searcher.php @@ -20,7 +20,6 @@ use Status; use Title; use UsageException; -use RequestContext; use User; /** -- To view, visit https://gerrit.wikimedia.org/r/293250 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I47006ddbccd763c9ed1b31a8bf937df924cf73f0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: Aude___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] adding install params for mw2215 to mw2250 Bug: TT135466 - change (operations/puppet)
Dzahn has submitted this change and it was merged. Change subject: adding install params for mw2215 to mw2250 Bug: TT135466 .. adding install params for mw2215 to mw2250 Bug: TT135466 Change-Id: I63a9cb4cfe772ca8f6d28089115c099803b92ec7 --- M modules/install_server/files/autoinstall/netboot.cfg 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Dzahn: Verified; Looks good to me, approved diff --git a/modules/install_server/files/autoinstall/netboot.cfg b/modules/install_server/files/autoinstall/netboot.cfg index 5066a87..29ff5f3 100755 --- a/modules/install_server/files/autoinstall/netboot.cfg +++ b/modules/install_server/files/autoinstall/netboot.cfg @@ -115,6 +115,7 @@ mw1259) echo partman/mw-raid1.cfg ;; \ mw12[6-9][0-9]) echo partman/mw-raid1.cfg ;; \ mw13*) echo partman/mw-raid1.cfg ;; \ +mw22*) echo partman/mw-raid1.cfg;; \ mw[0-9]*|osmium|rcs[0-9]*) echo partman/mw.cfg ;; \ mx1001|mx2001) echo partman/flat.cfg virtual.cfg ;; \ labservices1001|labservices1002|radium|scandium|silver|uranium) echo partman/raid1.cfg ;; \ -- To view, visit https://gerrit.wikimedia.org/r/293246 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I63a9cb4cfe772ca8f6d28089115c099803b92ec7 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: PapaulGerrit-Reviewer: Dzahn ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add the predis library - change (wikimedia...SmashPig)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/293249 Change subject: Add the predis library .. Add the predis library Change-Id: Id5472b9eb344bde7fd19d21e16fb5a94aac44c7e --- M composer.json 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig refs/changes/49/293249/1 diff --git a/composer.json b/composer.json index 031151a..0631dd7 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "fusesource/stomp-php": "2.*", "php": ">=5.3.3", "phpmailer/phpmailer": "5.2.6", +"predis/predis": "1.*", "symfony/event-dispatcher": ">=2.1,<2.4-dev", "symfony/http-foundation": ">=2.1,<2.4-dev", "symfony/yaml": "2.8.3", -- To view, visit https://gerrit.wikimedia.org/r/293249 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5472b9eb344bde7fd19d21e16fb5a94aac44c7e Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] Implement popAtomic for Redis - change (wikimedia...php-queue)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/293248 Change subject: [WIP] Implement popAtomic for Redis .. [WIP] Implement popAtomic for Redis Change-Id: I7108a897360b6e398309d7d51e08f2b8e35f66b3 --- M src/PHPQueue/Backend/Predis.php M src/PHPQueue/Interfaces/AtomicReadBuffer.php 2 files changed, 38 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/php-queue refs/changes/48/293248/1 diff --git a/src/PHPQueue/Backend/Predis.php b/src/PHPQueue/Backend/Predis.php index fbe8e0f..c330333 100644 --- a/src/PHPQueue/Backend/Predis.php +++ b/src/PHPQueue/Backend/Predis.php @@ -28,7 +28,10 @@ */ class Predis extends Base -implements FifoQueueStore, KeyValueStore +implements +AtomicReadBuffer, +FifoQueueStore, +KeyValueStore { const TYPE_STRING='string'; const TYPE_HASH='hash'; @@ -198,6 +201,38 @@ return json_decode($data, true); } +public function popAtomic($callback) { +if (!$this->hasQueue()) { +throw new BackendException("No queue specified."); +} +if ($this->order_key) { +throw new BackendException("atomicPop not yet supported for zsets"); +} + +// Pop and process the first element, erring on the side of +// at-least-once processing where the callback might get the same +// element before it's popped in the case of a race. +$options = array( +'cas' => true, +'watch' => $this->queue_name, +'retry' => 3, +); +$data = null; +$this->getConnection()->transaction($options, function ($tx) use (&$data) { +// Begin transaction. +$tx->multi(); + +$data = $tx->lpop($this->queue_name); +$data = json_decode($data, true); +$callback($data); +}); +if (!$data) { +return null; +} + +return $data; +} + /** * Return the top element in the queue. * diff --git a/src/PHPQueue/Interfaces/AtomicReadBuffer.php b/src/PHPQueue/Interfaces/AtomicReadBuffer.php index d6fea1a..c644fa6 100644 --- a/src/PHPQueue/Interfaces/AtomicReadBuffer.php +++ b/src/PHPQueue/Interfaces/AtomicReadBuffer.php @@ -11,7 +11,7 @@ * consumed in case of failure. * * @param callable $callback A processing function with the signature, - * function( $message ) throws Exception + * void function( $message ) throws Exception * This function accepts an array $message, the next message to be * popped from your buffer. In normal operation, the message is popped * after the function returns successfully, which gives us the @@ -37,5 +37,5 @@ * causes "queue jam", something we alert about loudly and should * eventually shunt these messages into a reject stream. */ -public function popAtomic( $callback ); +public function popAtomic($callback); } -- To view, visit https://gerrit.wikimedia.org/r/293248 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7108a897360b6e398309d7d51e08f2b8e35f66b3 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/php-queue Gerrit-Branch: master Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix indefined index warning - change (mediawiki...LiquidThreads)
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/293247 Change subject: Fix indefined index warning .. Fix indefined index warning Bug: T136837 Change-Id: I24776a66087d49c7fcd786f1c21f697cdc201da9 --- M classes/Hooks.php 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads refs/changes/47/293247/1 diff --git a/classes/Hooks.php b/classes/Hooks.php index 6b65664..6a68269 100644 --- a/classes/Hooks.php +++ b/classes/Hooks.php @@ -946,7 +946,9 @@ foreach ( $data as $pageid => $page ) { if ( $page == 'page' ) continue; - if ( LqtDispatch::isLqtPage( Title::newFromText( $page['title'] ) ) ) { + if ( isset( $page['title'] ) + && LqtDispatch::isLqtPage( Title::newFromText( $page['title'] ) ) + ) { $result->addValue( array( 'query', 'pages' ), $pageid, array( 'islqttalkpage' => '' ) ); } } -- To view, visit https://gerrit.wikimedia.org/r/293247 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24776a66087d49c7fcd786f1c21f697cdc201da9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LiquidThreads Gerrit-Branch: master Gerrit-Owner: MaxSem___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] adding install params for mw2215 to mw2250 Bug: TT135466 - change (operations/puppet)
Papaul has uploaded a new change for review. https://gerrit.wikimedia.org/r/293246 Change subject: adding install params for mw2215 to mw2250 Bug: TT135466 .. adding install params for mw2215 to mw2250 Bug: TT135466 Change-Id: I63a9cb4cfe772ca8f6d28089115c099803b92ec7 --- M modules/install_server/files/autoinstall/netboot.cfg 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/46/293246/1 diff --git a/modules/install_server/files/autoinstall/netboot.cfg b/modules/install_server/files/autoinstall/netboot.cfg index 5066a87..855b8fc 100755 --- a/modules/install_server/files/autoinstall/netboot.cfg +++ b/modules/install_server/files/autoinstall/netboot.cfg @@ -115,6 +115,7 @@ mw1259) echo partman/mw-raid1.cfg ;; \ mw12[6-9][0-9]) echo partman/mw-raid1.cfg ;; \ mw13*) echo partman/mw-raid1.cfg ;; \ +mw22[1-4][0-9]) echo partman/mw-raid1.cfg;; \ mw[0-9]*|osmium|rcs[0-9]*) echo partman/mw.cfg ;; \ mx1001|mx2001) echo partman/flat.cfg virtual.cfg ;; \ labservices1001|labservices1002|radium|scandium|silver|uranium) echo partman/raid1.cfg ;; \ -- To view, visit https://gerrit.wikimedia.org/r/293246 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63a9cb4cfe772ca8f6d28089115c099803b92ec7 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Papaul___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Merge master into deploy - change (wikimedia...tools)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/293245 Change subject: Merge master into deploy .. Merge master into deploy 8f781d6e3c46b8b9423c70a7c314b2a0dbe0f2a9 Clean up some warnings e670fac67e5c971b4bf613d958d3407b4958d43d Fix state truncation warnings a0814fe9109b080178b22b8feeb4f99a6c8c5a01 Log number of rows exported 10de83cefdd363623e84c52c781eeec33ca7f3d5 Keep Civi users off suppression list Change-Id: I80e7316aedfbe4dc43cbc81d9f1d7c276a6ad09a --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/tools refs/changes/45/293245/1 -- To view, visit https://gerrit.wikimedia.org/r/293245 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I80e7316aedfbe4dc43cbc81d9f1d7c276a6ad09a Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/tools Gerrit-Branch: deploy Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Merge master into deploy - change (wikimedia...tools)
jenkins-bot has submitted this change and it was merged. Change subject: Merge master into deploy .. Merge master into deploy 8f781d6e3c46b8b9423c70a7c314b2a0dbe0f2a9 Clean up some warnings e670fac67e5c971b4bf613d958d3407b4958d43d Fix state truncation warnings a0814fe9109b080178b22b8feeb4f99a6c8c5a01 Log number of rows exported 10de83cefdd363623e84c52c781eeec33ca7f3d5 Keep Civi users off suppression list Change-Id: I80e7316aedfbe4dc43cbc81d9f1d7c276a6ad09a --- 0 files changed, 0 insertions(+), 0 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified -- To view, visit https://gerrit.wikimedia.org/r/293245 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I80e7316aedfbe4dc43cbc81d9f1d7c276a6ad09a Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/tools Gerrit-Branch: deploy Gerrit-Owner: AwightGerrit-Reviewer: Awight Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add index to results in generator mode - change (mediawiki...GeoData)
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/293244 Change subject: Add index to results in generator mode .. Add index to results in generator mode Bug: T137171 Change-Id: I1fecc0b5f3b04c611839d8491e7919f690763f02 --- M includes/api/ApiQueryGeoSearchElastic.php 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData refs/changes/44/293244/1 diff --git a/includes/api/ApiQueryGeoSearchElastic.php b/includes/api/ApiQueryGeoSearchElastic.php index d6df0b4..608b3d0 100644 --- a/includes/api/ApiQueryGeoSearchElastic.php +++ b/includes/api/ApiQueryGeoSearchElastic.php @@ -183,6 +183,11 @@ } } else { $resultPageSet->populateFromQueryResult( $this->getDB(), $res ); + $res->rewind(); + foreach ( $res as $row ) { + $title = Title::newFromRow( $row ); + $resultPageSet->setGeneratorData( $title, [ 'index' => $res->key() - 1 ] ); + } } } -- To view, visit https://gerrit.wikimedia.org/r/293244 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1fecc0b5f3b04c611839d8491e7919f690763f02 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GeoData Gerrit-Branch: master Gerrit-Owner: MaxSem___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use callable type-hint in a few places - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Use callable type-hint in a few places .. Use callable type-hint in a few places Mostly places which immediately had a: if ( !is_callable( $callback ) ) { throw new Exception(...); } check at the beginning of the function. Change-Id: Ia78663b2231629010816bd1cda8814b996968d1d --- M includes/db/DBConnRef.php M includes/db/Database.php M includes/db/IDatabase.php M includes/libs/objectcache/BagOStuff.php M includes/libs/objectcache/EmptyBagOStuff.php M includes/libs/objectcache/MemcachedBagOStuff.php M includes/libs/objectcache/ReplicatedBagOStuff.php M includes/libs/objectcache/WinCacheBagOStuff.php M includes/objectcache/SqlBagOStuff.php 9 files changed, 9 insertions(+), 29 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/db/DBConnRef.php b/includes/db/DBConnRef.php index d73ba85..af5f8f9 100644 --- a/includes/db/DBConnRef.php +++ b/includes/db/DBConnRef.php @@ -433,7 +433,7 @@ return $this->__call( __FUNCTION__, func_get_args() ); } - public function doAtomicSection( $fname, $callback ) { + public function doAtomicSection( $fname, callable $callback ) { return $this->__call( __FUNCTION__, func_get_args() ); } diff --git a/includes/db/Database.php b/includes/db/Database.php index 92e89b0..6bdcb24 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2561,11 +2561,7 @@ } } - final public function doAtomicSection( $fname, $callback ) { - if ( !is_callable( $callback ) ) { - throw new UnexpectedValueException( "Invalid callback." ); - }; - + final public function doAtomicSection( $fname, callable $callback ) { $this->startAtomic( $fname ); try { call_user_func_array( $callback, [ $this, $fname ] ); diff --git a/includes/db/IDatabase.php b/includes/db/IDatabase.php index 710efb2..0a71df2 100644 --- a/includes/db/IDatabase.php +++ b/includes/db/IDatabase.php @@ -1313,7 +1313,7 @@ * @throws UnexpectedValueException * @since 1.27 */ - public function doAtomicSection( $fname, $callback ); + public function doAtomicSection( $fname, callable $callback ); /** * Begin a transaction. If a transaction is already in progress, diff --git a/includes/libs/objectcache/BagOStuff.php b/includes/libs/objectcache/BagOStuff.php index dd22d91..1a2711a 100644 --- a/includes/libs/objectcache/BagOStuff.php +++ b/includes/libs/objectcache/BagOStuff.php @@ -267,11 +267,7 @@ * @return bool Success * @throws InvalidArgumentException */ - public function merge( $key, $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { - if ( !is_callable( $callback ) ) { - throw new InvalidArgumentException( "Got invalid callback." ); - } - + public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { return $this->mergeViaLock( $key, $callback, $exptime, $attempts, $flags ); } diff --git a/includes/libs/objectcache/EmptyBagOStuff.php b/includes/libs/objectcache/EmptyBagOStuff.php index 4321b25..408212a 100644 --- a/includes/libs/objectcache/EmptyBagOStuff.php +++ b/includes/libs/objectcache/EmptyBagOStuff.php @@ -39,7 +39,7 @@ return true; } - public function merge( $key, $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { + public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { return true; // faster } } diff --git a/includes/libs/objectcache/MemcachedBagOStuff.php b/includes/libs/objectcache/MemcachedBagOStuff.php index 7a36214..ba8c736 100644 --- a/includes/libs/objectcache/MemcachedBagOStuff.php +++ b/includes/libs/objectcache/MemcachedBagOStuff.php @@ -75,11 +75,7 @@ $this->fixExpiry( $exptime ) ); } - public function merge( $key, $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { - if ( !is_callable( $callback ) ) { - throw new Exception( "Got invalid callback." ); - } - + public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { return $this->mergeViaCas( $key, $callback, $exptime, $attempts ); } diff --git a/includes/libs/objectcache/ReplicatedBagOStuff.php b/includes/libs/objectcache/ReplicatedBagOStuff.php index 40ac1bb..5f2c509 100644 --- a/includes/libs/objectcache/ReplicatedBagOStuff.php +++ b/includes/libs/objectcache/ReplicatedBagOStuff.php @@ -112,7 +112,7 @@ return $this->writeStore->unlock( $key );
[MediaWiki-commits] [Gerrit] Use LinkCache::getSelectFields() in OutputPage::addCategoryL... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Use LinkCache::getSelectFields() in OutputPage::addCategoryLinks() .. Use LinkCache::getSelectFields() in OutputPage::addCategoryLinks() Change-Id: I71d95cbb6c22ae92586c883e7de5353d26c4838f --- M includes/OutputPage.php 1 file changed, 4 insertions(+), 9 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 6f62ae6..ad7c976 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1277,15 +1277,10 @@ # Fetch existence plus the hiddencat property $dbr = wfGetDB( DB_SLAVE ); - $fields = [ 'page_id', 'page_namespace', 'page_title', 'page_len', - 'page_is_redirect', 'page_latest', 'pp_value' ]; - - if ( $this->getConfig()->get( 'ContentHandlerUseDB' ) ) { - $fields[] = 'page_content_model'; - } - if ( $this->getConfig()->get( 'PageLanguageUseDB' ) ) { - $fields[] = 'page_lang'; - } + $fields = array_merge( + LinkCache::getSelectFields(), + [ 'page_namespace', 'page_title', 'pp_value' ] + ); $res = $dbr->select( [ 'page', 'page_props' ], $fields, -- To view, visit https://gerrit.wikimedia.org/r/293240 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I71d95cbb6c22ae92586c883e7de5353d26c4838f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add a project namespace on tg.wikipedia - change (operations/mediawiki-config)
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/293243 Change subject: Add a project namespace on tg.wikipedia .. Add a project namespace on tg.wikipedia New namespaces: * 102: Лоиҳа * 103: Баҳси Лоиҳа Bug: T137200 Change-Id: I68cf09bd1bd14f64dabda81880c48e1324009b2f --- M wmf-config/InitialiseSettings.php 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/43/293243/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index cf627c1..705a413 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -5291,6 +5291,8 @@ 'tgwiki' => [ 100 => 'Портал', 101 => 'Баҳси_портал', + 102 => 'Лоиҳа', // T137200 - Project + 103 => 'Баҳси_Лоиҳа', ], 'thwiki' => [ 100 => 'สถานีย่อย', -- To view, visit https://gerrit.wikimedia.org/r/293243 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68cf09bd1bd14f64dabda81880c48e1324009b2f Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Handle StatusValue in authmanager events properly - change (mediawiki...WikimediaEvents)
jenkins-bot has submitted this change and it was merged. Change subject: Handle StatusValue in authmanager events properly .. Handle StatusValue in authmanager events properly Change-Id: I6300095e49854c57f8abf76fe0e679eaab78cdb3 --- M includes/AuthManagerStatsdHandler.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Anomie: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/AuthManagerStatsdHandler.php b/includes/AuthManagerStatsdHandler.php index f8436da..02e1955 100644 --- a/includes/AuthManagerStatsdHandler.php +++ b/includes/AuthManagerStatsdHandler.php @@ -45,6 +45,7 @@ $successful = isset( $record['context']['successful'] ) ? $record['context']['successful'] : null; $error = null; if ( $status instanceof Status || $status instanceof StatusValue ) { + $status = Status::wrap( $status ); $successful = $status->isGood(); if ( !$successful ) { $errorArray = $status->getErrorsArray() ?: $status->getWarningsArray(); -- To view, visit https://gerrit.wikimedia.org/r/293242 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6300095e49854c57f8abf76fe0e679eaab78cdb3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaEvents Gerrit-Branch: master Gerrit-Owner: Gergő TiszaGerrit-Reviewer: Anomie Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Avoid contention in updateLinksTimestamp() - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Avoid contention in updateLinksTimestamp() .. Avoid contention in updateLinksTimestamp() Since LinksUpdate::doUpdate() already flushes the transaction, go ahead and flush before other DataUpdates might run (e.g. from RefreshLinksJob). Also release the lock before running the LinksUpdateComplete handlers, as the lock is just to keep LinksUpdate instances from racing with each other. Change-Id: Ied97fa36fbca0203123e9fc966d2e23bfd621c0e --- M includes/deferred/LinksUpdate.php 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index 07b5614..d4a61fa 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -155,10 +155,11 @@ Hooks::run( 'LinksUpdate', [ &$this ] ); $this->doIncrementalUpdate(); - $this->mDb->onTransactionIdle( function() use ( &$scopedLock ) { + // Commit and release the lock + ScopedCallback::consume( $scopedLock ); + // Run post-commit hooks without DBO_TRX + $this->mDb->onTransactionIdle( function() { Hooks::run( 'LinksUpdateComplete', [ &$this ] ); - // Release the lock *after* the final COMMIT for correctness - ScopedCallback::consume( $scopedLock ); } ); } @@ -243,15 +244,14 @@ $changed = $propertiesDeletes + array_diff_assoc( $this->mProperties, $existing ); $this->invalidateProperties( $changed ); - # Update the links table freshness for this title - $this->updateLinksTimestamp(); - # Refresh links of all pages including this page # This will be in a separate transaction if ( $this->mRecursive ) { $this->queueRecursiveJobs(); } + # Update the links table freshness for this title + $this->updateLinksTimestamp(); } /** -- To view, visit https://gerrit.wikimedia.org/r/293239 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied97fa36fbca0203123e9fc966d2e23bfd621c0e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.5 Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Handle StatusValue in authmanager events properly - change (mediawiki...WikimediaEvents)
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/293242 Change subject: Handle StatusValue in authmanager events properly .. Handle StatusValue in authmanager events properly Change-Id: I6300095e49854c57f8abf76fe0e679eaab78cdb3 --- M includes/AuthManagerStatsdHandler.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents refs/changes/42/293242/1 diff --git a/includes/AuthManagerStatsdHandler.php b/includes/AuthManagerStatsdHandler.php index f8436da..02e1955 100644 --- a/includes/AuthManagerStatsdHandler.php +++ b/includes/AuthManagerStatsdHandler.php @@ -45,6 +45,7 @@ $successful = isset( $record['context']['successful'] ) ? $record['context']['successful'] : null; $error = null; if ( $status instanceof Status || $status instanceof StatusValue ) { + $status = Status::wrap( $status ); $successful = $status->isGood(); if ( !$successful ) { $errorArray = $status->getErrorsArray() ?: $status->getWarningsArray(); -- To view, visit https://gerrit.wikimedia.org/r/293242 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6300095e49854c57f8abf76fe0e679eaab78cdb3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikimediaEvents Gerrit-Branch: master Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Avoid contention in updateLinksTimestamp() - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Avoid contention in updateLinksTimestamp() .. Avoid contention in updateLinksTimestamp() Since LinksUpdate::doUpdate() already flushes the transaction, go ahead and flush before other DataUpdates might run (e.g. from RefreshLinksJob). Also release the lock before running the LinksUpdateComplete handlers, as the lock is just to keep LinksUpdate instances from racing with each other. Change-Id: Ied97fa36fbca0203123e9fc966d2e23bfd621c0e --- M includes/deferred/LinksUpdate.php 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index 07b5614..d4a61fa 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -155,10 +155,11 @@ Hooks::run( 'LinksUpdate', [ &$this ] ); $this->doIncrementalUpdate(); - $this->mDb->onTransactionIdle( function() use ( &$scopedLock ) { + // Commit and release the lock + ScopedCallback::consume( $scopedLock ); + // Run post-commit hooks without DBO_TRX + $this->mDb->onTransactionIdle( function() { Hooks::run( 'LinksUpdateComplete', [ &$this ] ); - // Release the lock *after* the final COMMIT for correctness - ScopedCallback::consume( $scopedLock ); } ); } @@ -243,15 +244,14 @@ $changed = $propertiesDeletes + array_diff_assoc( $this->mProperties, $existing ); $this->invalidateProperties( $changed ); - # Update the links table freshness for this title - $this->updateLinksTimestamp(); - # Refresh links of all pages including this page # This will be in a separate transaction if ( $this->mRecursive ) { $this->queueRecursiveJobs(); } + # Update the links table freshness for this title + $this->updateLinksTimestamp(); } /** -- To view, visit https://gerrit.wikimedia.org/r/293190 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied97fa36fbca0203123e9fc966d2e23bfd621c0e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron SchulzGerrit-Reviewer: Legoktm Gerrit-Reviewer: MaxSem Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use callable type-hint in a few places - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/293241 Change subject: Use callable type-hint in a few places .. Use callable type-hint in a few places Mostly places which immediately had a: if ( !is_callable( $callback ) ) { throw new Exception(...); } check at the beginning of the function. Change-Id: Ia78663b2231629010816bd1cda8814b996968d1d --- M includes/db/DBConnRef.php M includes/db/Database.php M includes/db/IDatabase.php M includes/libs/objectcache/BagOStuff.php M includes/libs/objectcache/EmptyBagOStuff.php M includes/libs/objectcache/MemcachedBagOStuff.php M includes/libs/objectcache/ReplicatedBagOStuff.php M includes/libs/objectcache/WinCacheBagOStuff.php M includes/objectcache/SqlBagOStuff.php 9 files changed, 9 insertions(+), 29 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/41/293241/1 diff --git a/includes/db/DBConnRef.php b/includes/db/DBConnRef.php index d73ba85..af5f8f9 100644 --- a/includes/db/DBConnRef.php +++ b/includes/db/DBConnRef.php @@ -433,7 +433,7 @@ return $this->__call( __FUNCTION__, func_get_args() ); } - public function doAtomicSection( $fname, $callback ) { + public function doAtomicSection( $fname, callable $callback ) { return $this->__call( __FUNCTION__, func_get_args() ); } diff --git a/includes/db/Database.php b/includes/db/Database.php index 92e89b0..6bdcb24 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2561,11 +2561,7 @@ } } - final public function doAtomicSection( $fname, $callback ) { - if ( !is_callable( $callback ) ) { - throw new UnexpectedValueException( "Invalid callback." ); - }; - + final public function doAtomicSection( $fname, callable $callback ) { $this->startAtomic( $fname ); try { call_user_func_array( $callback, [ $this, $fname ] ); diff --git a/includes/db/IDatabase.php b/includes/db/IDatabase.php index 710efb2..0a71df2 100644 --- a/includes/db/IDatabase.php +++ b/includes/db/IDatabase.php @@ -1313,7 +1313,7 @@ * @throws UnexpectedValueException * @since 1.27 */ - public function doAtomicSection( $fname, $callback ); + public function doAtomicSection( $fname, callable $callback ); /** * Begin a transaction. If a transaction is already in progress, diff --git a/includes/libs/objectcache/BagOStuff.php b/includes/libs/objectcache/BagOStuff.php index dd22d91..1a2711a 100644 --- a/includes/libs/objectcache/BagOStuff.php +++ b/includes/libs/objectcache/BagOStuff.php @@ -267,11 +267,7 @@ * @return bool Success * @throws InvalidArgumentException */ - public function merge( $key, $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { - if ( !is_callable( $callback ) ) { - throw new InvalidArgumentException( "Got invalid callback." ); - } - + public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { return $this->mergeViaLock( $key, $callback, $exptime, $attempts, $flags ); } diff --git a/includes/libs/objectcache/EmptyBagOStuff.php b/includes/libs/objectcache/EmptyBagOStuff.php index 4321b25..408212a 100644 --- a/includes/libs/objectcache/EmptyBagOStuff.php +++ b/includes/libs/objectcache/EmptyBagOStuff.php @@ -39,7 +39,7 @@ return true; } - public function merge( $key, $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { + public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { return true; // faster } } diff --git a/includes/libs/objectcache/MemcachedBagOStuff.php b/includes/libs/objectcache/MemcachedBagOStuff.php index 7a36214..ba8c736 100644 --- a/includes/libs/objectcache/MemcachedBagOStuff.php +++ b/includes/libs/objectcache/MemcachedBagOStuff.php @@ -75,11 +75,7 @@ $this->fixExpiry( $exptime ) ); } - public function merge( $key, $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { - if ( !is_callable( $callback ) ) { - throw new Exception( "Got invalid callback." ); - } - + public function merge( $key, callable $callback, $exptime = 0, $attempts = 10, $flags = 0 ) { return $this->mergeViaCas( $key, $callback, $exptime, $attempts ); } diff --git a/includes/libs/objectcache/ReplicatedBagOStuff.php b/includes/libs/objectcache/ReplicatedBagOStuff.php index 40ac1bb..5f2c509 100644 --- a/includes/libs/objectcache/ReplicatedBagOStuff.php +++ b/includes/libs/objectcache/ReplicatedBagOStuff.php @@ -112,7 +112,7 @@ return
[MediaWiki-commits] [Gerrit] Use LinkCache::getSelectFields() in OutputPage::addCategoryL... - change (mediawiki/core)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/293240 Change subject: Use LinkCache::getSelectFields() in OutputPage::addCategoryLinks() .. Use LinkCache::getSelectFields() in OutputPage::addCategoryLinks() Change-Id: I71d95cbb6c22ae92586c883e7de5353d26c4838f --- M includes/OutputPage.php 1 file changed, 4 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/40/293240/1 diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 6f62ae6..ad7c976 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1277,15 +1277,10 @@ # Fetch existence plus the hiddencat property $dbr = wfGetDB( DB_SLAVE ); - $fields = [ 'page_id', 'page_namespace', 'page_title', 'page_len', - 'page_is_redirect', 'page_latest', 'pp_value' ]; - - if ( $this->getConfig()->get( 'ContentHandlerUseDB' ) ) { - $fields[] = 'page_content_model'; - } - if ( $this->getConfig()->get( 'PageLanguageUseDB' ) ) { - $fields[] = 'page_lang'; - } + $fields = array_merge( + LinkCache::getSelectFields(), + [ 'page_namespace', 'page_title', 'pp_value' ] + ); $res = $dbr->select( [ 'page', 'page_props' ], $fields, -- To view, visit https://gerrit.wikimedia.org/r/293240 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I71d95cbb6c22ae92586c883e7de5353d26c4838f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core 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] Disable Wikivoyage mode by default - change (mediawiki...Kartographer)
jenkins-bot has submitted this change and it was merged. Change subject: Disable Wikivoyage mode by default .. Disable Wikivoyage mode by default Bug: T129106 Change-Id: I9478b0ad3877137dd4161df807f57ef3cafc8ef4 --- M extension.json M tests/parserTests.txt 2 files changed, 53 insertions(+), 3 deletions(-) Approvals: Yurik: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index c47251d..9431ee6 100644 --- a/extension.json +++ b/extension.json @@ -228,10 +228,8 @@ "ParserTestFiles": [ "tests/parserTests.txt" ], - - "@comment-config": "TODO: KartographerWikivoyageMode should be false by default", "config": { - "KartographerWikivoyageMode": true, + "KartographerWikivoyageMode": false, "KartographerDfltStyle": "osm-intl", "KartographerStyles": ["osm-intl", "osm"], "KartographerSrcsetScales": [1.3, 1.5, 2, 2.6, 3], diff --git a/tests/parserTests.txt b/tests/parserTests.txt index 784e766..6e15c7b 100644 --- a/tests/parserTests.txt +++ b/tests/parserTests.txt @@ -253,3 +253,55 @@ A !! end + +!! test +Wikivoyage mode enabled +!! config +wgKartographerWikivoyageMode=true +!! input + + +{ +"type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.3988, 37.8013] + }, + "properties": { + "marker-symbol": "-letter", + "marker-color": "#abcdef" + } +} + +!! result +0°0′0″N 0°0′0″E + + + +!! end + +!! test +Wikivoyage mode disabled +!! config +wgKartographerWikivoyageMode=false +!! input + + +{ +"type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-122.3988, 37.8013] + }, + "properties": { + "marker-symbol": "-letter", + "marker-color": "#abcdef" + } +} + +!! result +0°0′0″N 0°0′0″E + + + +!! end \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/292742 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9478b0ad3877137dd4161df807f57ef3cafc8ef4 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: MaxSemGerrit-Reviewer: Yurik Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Check responses of synchronous network requests - change (apps...wikipedia)
jenkins-bot has submitted this change and it was merged. Change subject: Check responses of synchronous network requests .. Check responses of synchronous network requests A follow up to 9a21153, check the response statuses of synchronous network requests. Probably simply because synchronous requests are less common, I don't see checking the status called out explicitly in the docs for the synchronous case. However, the status is checked in many usages of the asynchronous Callback.onResponse(), and it seems surprising not to for either case. There is also mention of checking the synchronous status in this sample[0]. [0] https://github.com/square/retrofit/blob/0e4fe60/samples/src/main/java/com/example/retrofit/DeserializeErrorBody.java#L60 Change-Id: I37042a3d4a36b63988d350a90ff7d5df02bfaff4 --- M app/src/main/java/org/wikipedia/dataclient/mwapi/MwQueryResponse.java M app/src/main/java/org/wikipedia/server/mwapi/MwPageService.java M app/src/main/java/org/wikipedia/server/restbase/RbPageService.java M app/src/main/java/org/wikipedia/useroption/dataclient/DefaultUserOptionDataClient.java 4 files changed, 44 insertions(+), 9 deletions(-) Approvals: Dbrant: Looks good to me, approved jenkins-bot: Verified diff --git a/app/src/main/java/org/wikipedia/dataclient/mwapi/MwQueryResponse.java b/app/src/main/java/org/wikipedia/dataclient/mwapi/MwQueryResponse.java index 179c9aa..42e1cde 100644 --- a/app/src/main/java/org/wikipedia/dataclient/mwapi/MwQueryResponse.java +++ b/app/src/main/java/org/wikipedia/dataclient/mwapi/MwQueryResponse.java @@ -31,6 +31,10 @@ return query; } +public boolean success() { +return error == null && query != null; +} + @VisibleForTesting protected void setQuery(@Nullable T query) { this.query = query; diff --git a/app/src/main/java/org/wikipedia/server/mwapi/MwPageService.java b/app/src/main/java/org/wikipedia/server/mwapi/MwPageService.java index 291fa49..2aff978 100644 --- a/app/src/main/java/org/wikipedia/server/mwapi/MwPageService.java +++ b/app/src/main/java/org/wikipedia/server/mwapi/MwPageService.java @@ -8,9 +8,12 @@ import org.wikipedia.server.PageRemaining; import org.wikipedia.server.PageService; import org.wikipedia.server.PageSummary; +import org.wikipedia.server.ServiceError; import org.wikipedia.server.restbase.RbPageEndpointsCache; import org.wikipedia.settings.RbSwitch; import org.wikipedia.zero.WikipediaZeroHandler; + +import java.io.IOException; import retrofit2.Call; import retrofit2.Callback; @@ -19,8 +22,6 @@ import retrofit2.http.GET; import retrofit2.http.Headers; import retrofit2.http.Query; - -import java.io.IOException; /** * Retrofit web service client for MediaWiki PHP API. @@ -132,7 +133,14 @@ @Override public MwPageCombo pageCombo(String title, boolean noImages) throws IOException { -return webService.pageCombo(title, noImages).execute().body(); +Response rsp = webService.pageCombo(title, noImages).execute(); +if (rsp.isSuccessful() && !rsp.body().hasError()) { +return rsp.body(); +} +ServiceError err = rsp.body() == null || rsp.body().getError() == null +? null +: rsp.body().getError(); +throw new IOException(err == null ? rsp.message() : err.getDetails()); } /** diff --git a/app/src/main/java/org/wikipedia/server/restbase/RbPageService.java b/app/src/main/java/org/wikipedia/server/restbase/RbPageService.java index 0f2050a..85649a1 100644 --- a/app/src/main/java/org/wikipedia/server/restbase/RbPageService.java +++ b/app/src/main/java/org/wikipedia/server/restbase/RbPageService.java @@ -8,6 +8,7 @@ import org.wikipedia.server.PageRemaining; import org.wikipedia.server.PageService; import org.wikipedia.server.PageSummary; +import org.wikipedia.server.ServiceError; import org.wikipedia.settings.RbSwitch; import org.wikipedia.zero.WikipediaZeroHandler; @@ -146,7 +147,14 @@ @Override public RbPageCombo pageCombo(String title, boolean noImages) throws IOException { -return webService.pageCombo(title, noImages).execute().body(); +Response rsp = webService.pageCombo(title, noImages).execute(); +if (rsp.isSuccessful() && !rsp.body().hasError()) { +return rsp.body(); +} +ServiceError err = rsp.body() == null || rsp.body().getError() == null +? null +: rsp.body().getError(); +throw new IOException(err == null ? rsp.message() : err.getDetails()); } /* Not defined in the PageService interface since the Wiktionary definition endpoint exists only diff --git a/app/src/main/java/org/wikipedia/useroption/dataclient/DefaultUserOptionDataClient.java b/app/src/main/java/org/wikipedia/useroption/dataclient/DefaultUserOptionDataClient.java index a698d82..cc9194f 100644 ---
[MediaWiki-commits] [Gerrit] Add option to see EventLogging happen on page views - change (mediawiki...EventLogging)
jenkins-bot has submitted this change and it was merged. Change subject: Add option to see EventLogging happen on page views .. Add option to see EventLogging happen on page views This simplifies some debugging work, along with showing how an eventlogging schema works to other team members such as analysts that will be reviewing the data. It also makes it possible for normal users to see how they are being tracked, although I'm not sure the right place to expose it in the user interface. As implemented this is mostly a debug flag because it needs to be manually turned on for a user rather than enabled from the web interface. To enable, run the following in the console: mw.loader.using('mediawiki.api.options').then(function () { new mw.Api().saveOption('eventlogging-display-web', '1'); }); With WikimediaEvents installed, an easy way to trigger it is: mw.track('mw.deprecate', 'foo'); Change-Id: I1ac4a55762367b8433d203e2dce4d2108aff3797 --- M EventLogging.php M includes/EventLoggingHooks.php A modules/ext.eventLogging.debug.js 3 files changed, 92 insertions(+), 2 deletions(-) Approvals: Bearloga: Looks good to me, but someone else must approve Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/EventLogging.php b/EventLogging.php index 708f576..37b8e47 100644 --- a/EventLogging.php +++ b/EventLogging.php @@ -164,12 +164,16 @@ // Modules $wgResourceModules[ 'ext.eventLogging' ] = [ - 'scripts' => 'modules/ext.eventLogging.core.js', + 'scripts' => [ + 'modules/ext.eventLogging.core.js', + 'modules/ext.eventLogging.debug.js', + ], 'localBasePath' => __DIR__, 'remoteExtPath' => 'EventLogging', 'dependencies' => [ 'json', 'ext.eventLogging.subscriber', + 'user.options', ], 'targets' => [ 'desktop', 'mobile' ], ]; @@ -216,11 +220,15 @@ $wgHooks[ 'ResourceLoaderTestModules' ][] = 'EventLoggingHooks::onResourceLoaderTestModules'; $wgHooks[ 'ResourceLoaderRegisterModules' ][] = ( 'EventLoggingHooks::onResourceLoaderRegisterModules' ); +$wgHooks[ 'GetPreferences' ][] = 'EventLoggingHooks::onGetPreferences'; // Registers hook and content handlers for JSON schema content iff // running on the MediaWiki instance housing the schemas. $wgExtensionFunctions[] = 'JsonSchemaHooks::registerHandlers'; +// Hidden option for users to see EventLogging as it happens +$wgDefaultUserOptions['eventlogging-display-web'] = 0; + // Unit Tests $wgHooks[ 'UnitTestsList' ][] = function ( &$files ) { diff --git a/includes/EventLoggingHooks.php b/includes/EventLoggingHooks.php index f755d86..e1982f7 100644 --- a/includes/EventLoggingHooks.php +++ b/includes/EventLoggingHooks.php @@ -94,9 +94,10 @@ * @return bool */ public static function onResourceLoaderGetConfigVars( &$vars ) { - global $wgEventLoggingBaseUri; + global $wgEventLoggingBaseUri, $wgEventLoggingSchemaApiUri; $vars[ 'wgEventLoggingBaseUri' ] = $wgEventLoggingBaseUri; + $vars[ 'wgEventLoggingSchemaApiUri' ] = $wgEventLoggingSchemaApiUri; return true; } @@ -114,4 +115,14 @@ ]; return true; } + + /** +* @param User $user +* @param array &$preferences +*/ + public static function onGetPreferences( User $user, array &$preferences ) { + $preferences['eventlogging-display-web'] = [ + 'type' => 'api', + ]; + } } diff --git a/modules/ext.eventLogging.debug.js b/modules/ext.eventLogging.debug.js new file mode 100644 index 000..ce6056f --- /dev/null +++ b/modules/ext.eventLogging.debug.js @@ -0,0 +1,71 @@ +( function ( mw, $ ) { + 'use stict'; + + if ( Number( mw.user.options.get( 'eventlogging-display-web' ) ) !== 1 ) { + return; + } + + function initDialogPromise() { + return mw.loader.using( 'oojs-ui-windows' ) + .then( function () { + /*global OO */ + var wm = new OO.ui.WindowManager(), + dialog = new OO.ui.MessageDialog(); + + wm.addWindows( [ dialog ] ); + dialog.setSize( 'large' ); + $( 'body' ).append( wm.$element ); + + return function ( args ) { + wm.openWindow( dialog, $.extend( { + verbose: true, + actions: [ + { +
[MediaWiki-commits] [Gerrit] Avoid contention in updateLinksTimestamp() - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/293239 Change subject: Avoid contention in updateLinksTimestamp() .. Avoid contention in updateLinksTimestamp() Since LinksUpdate::doUpdate() already flushes the transaction, go ahead and flush before other DataUpdates might run (e.g. from RefreshLinksJob). Also release the lock before running the LinksUpdateComplete handlers, as the lock is just to keep LinksUpdate instances from racing with each other. Change-Id: Ied97fa36fbca0203123e9fc966d2e23bfd621c0e --- M includes/deferred/LinksUpdate.php 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/39/293239/1 diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index 07b5614..d4a61fa 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -155,10 +155,11 @@ Hooks::run( 'LinksUpdate', [ &$this ] ); $this->doIncrementalUpdate(); - $this->mDb->onTransactionIdle( function() use ( &$scopedLock ) { + // Commit and release the lock + ScopedCallback::consume( $scopedLock ); + // Run post-commit hooks without DBO_TRX + $this->mDb->onTransactionIdle( function() { Hooks::run( 'LinksUpdateComplete', [ &$this ] ); - // Release the lock *after* the final COMMIT for correctness - ScopedCallback::consume( $scopedLock ); } ); } @@ -243,15 +244,14 @@ $changed = $propertiesDeletes + array_diff_assoc( $this->mProperties, $existing ); $this->invalidateProperties( $changed ); - # Update the links table freshness for this title - $this->updateLinksTimestamp(); - # Refresh links of all pages including this page # This will be in a separate transaction if ( $this->mRecursive ) { $this->queueRecursiveJobs(); } + # Update the links table freshness for this title + $this->updateLinksTimestamp(); } /** -- To view, visit https://gerrit.wikimedia.org/r/293239 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied97fa36fbca0203123e9fc966d2e23bfd621c0e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.5 Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] User rights configuration for meta. wmf-supportsafety group - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: User rights configuration for meta. wmf-supportsafety group .. User rights configuration for meta. wmf-supportsafety group Bug: T136864 Change-Id: I440483b3d5d5aa8c435e5b8ba608efeec17cb8fa --- M wmf-config/InitialiseSettings.php 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 5ec770f..cf627c1 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -8237,12 +8237,15 @@ 'noratelimit' => true, 'tboverride' => true, ], - 'wmf-supportsafety' => [ // T136046 + 'wmf-supportsafety' => [ // T136046, T136864 'userrights-interwiki' => true, 'centralauth-lock' => true, 'globalblock' => true, 'centralauth-rename' => true, 'userrights' => true, + 'editcontentmodel' => true, // TODO: remove when a change for T85847 is deployed + 'massmessage' => true, + 'centralauth-oversight' => true, ], ], 'mkwiki' => [ -- To view, visit https://gerrit.wikimedia.org/r/292518 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I440483b3d5d5aa8c435e5b8ba608efeec17cb8fa Gerrit-PatchSet: 3 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: DerecksonGerrit-Reviewer: Alex Monk Gerrit-Reviewer: Dereckson Gerrit-Reviewer: Florianschmidtwelzow Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: Jalexander Gerrit-Reviewer: Luke081515 Gerrit-Reviewer: MarcoAurelio Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use proper index type - change (mediawiki...GeoData)
jenkins-bot has submitted this change and it was merged. Change subject: Use proper index type .. Use proper index type Bug: T137177 Change-Id: I54cb3a3eda887d877f18c8ab8f617ba8338c321c --- M includes/Searcher.php M includes/api/ApiQueryGeoSearchElastic.php 2 files changed, 8 insertions(+), 6 deletions(-) Approvals: EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Searcher.php b/includes/Searcher.php index ce6d3bc..03c6cbb 100644 --- a/includes/Searcher.php +++ b/includes/Searcher.php @@ -25,12 +25,14 @@ * Perform search * * @param \Elastica\Query $query +* @param int[] $namespaces Namespaces used * @param string $queryType Query description for logging * @return \Elastica\ResultSet * @throws ExceptionInterface */ - public function performSearch( \Elastica\Query $query, $queryType ) { - $pageType = $this->connection->getPageType( wfWikiID() ); + public function performSearch( \Elastica\Query $query, array $namespaces, $queryType ) { + $indexType = $this->connection->pickIndexTypeForNamespaces( $namespaces ); + $pageType = $this->connection->getPageType( wfWikiID(), $indexType ); $search = $pageType->createSearch( $query ); try { diff --git a/includes/api/ApiQueryGeoSearchElastic.php b/includes/api/ApiQueryGeoSearchElastic.php index 29fccda..d6df0b4 100644 --- a/includes/api/ApiQueryGeoSearchElastic.php +++ b/includes/api/ApiQueryGeoSearchElastic.php @@ -24,6 +24,7 @@ $this->resetQueryParams(); //@fixme: refactor to make this unnecessary $params = $this->params = $this->extractRequestParams(); + $namespaces = array_map( 'intval', $params['namespace'] ); $filter = new \Elastica\Query\BoolQuery(); @@ -68,11 +69,10 @@ $nested = new \Elastica\Query\Nested(); $nested->setPath( 'coordinates' )->setQuery( $filter ); - if ( count( $params['namespace'] ) < count( MWNamespace::getValidNamespaces() ) ) { + if ( count( $namespaces ) < count( MWNamespace::getValidNamespaces() ) ) { $outerFilter = new \Elastica\Query\BoolQuery(); $outerFilter->addFilter( $nested ); - $outerFilter->addFilter( new \Elastica\Query\Terms( 'namespace', - $params['namespace'] ) ); + $outerFilter->addFilter( new \Elastica\Query\Terms( 'namespace', $namespaces ) ); $query->setPostFilter( $outerFilter ); } else { $query->setPostFilter( $nested ); @@ -93,7 +93,7 @@ $searcher = new Searcher( $this->getUser() ); - $resultSet = $searcher->performSearch( $query, 'GeoData_spatial_search' ); + $resultSet = $searcher->performSearch( $query, $namespaces, 'GeoData_spatial_search' ); if ( isset( $params['debug'] ) && $params['debug'] ) { $this->addDebugInfo( $resultSet, $query ); -- To view, visit https://gerrit.wikimedia.org/r/293216 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I54cb3a3eda887d877f18c8ab8f617ba8338c321c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GeoData Gerrit-Branch: master Gerrit-Owner: MaxSemGerrit-Reviewer: EBernhardson Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for I3ebe147827afaae1b94cf778413c65967d4f3a67 - change (mediawiki...GeoData)
jenkins-bot has submitted this change and it was merged. Change subject: Fix for I3ebe147827afaae1b94cf778413c65967d4f3a67 .. Fix for I3ebe147827afaae1b94cf778413c65967d4f3a67 Don't set coordinates if GD isn't supposed to be using Cirrus at all (and thus, ES doesn't have this filed in the mapping). Change-Id: Ib6b6d83cc0d0dfcb5231de3bca892ab23f42ad27 --- M includes/Hooks.php 1 file changed, 7 insertions(+), 6 deletions(-) Approvals: EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Hooks.php b/includes/Hooks.php index 4b05fa5..3fb6f7d 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -298,20 +298,21 @@ { global $wgGeoDataUseCirrusSearch, $wgGeoDataBackend; + if ( ( $wgGeoDataUseCirrusSearch || $wgGeoDataBackend == 'elastic' ) ) { + $allCoords = isset( $parserOutput->geoData ) + ? $parserOutput->geoData->getAll() + : []; + $coords = []; - $coords = []; - if ( ( $wgGeoDataUseCirrusSearch || $wgGeoDataBackend == 'elastic' ) - && isset( $parserOutput->geoData ) - ) { /** @var Coord $coord */ - foreach ( $parserOutput->geoData->getAll() as $coord ) { + foreach ( $allCoords as $coord ) { if ( $coord->globe !== 'earth' ) { continue; } $coords[] = self::coordToElastic( $coord ); } + $doc->set( 'coordinates', $coords ); } - $doc->set( 'coordinates', $coords ); } /** -- To view, visit https://gerrit.wikimedia.org/r/293145 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6b6d83cc0d0dfcb5231de3bca892ab23f42ad27 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GeoData Gerrit-Branch: master Gerrit-Owner: MaxSemGerrit-Reviewer: EBernhardson Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Localisation in Tajik language - change (mediawiki...Scribunto)
Dereckson has uploaded a new change for review. https://gerrit.wikimedia.org/r/293238 Change subject: Localisation in Tajik language .. Localisation in Tajik language Translation author: Илья Драконов (Ilya2015) Bug: T137200 Change-Id: I73c88917b8ab72e013660807099aac66e410e221 --- M Scribunto.namespaces.php 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Scribunto refs/changes/38/293238/1 diff --git a/Scribunto.namespaces.php b/Scribunto.namespaces.php index 5e66a57..f6e5ceb 100644 --- a/Scribunto.namespaces.php +++ b/Scribunto.namespaces.php @@ -387,6 +387,11 @@ 829 => 'మాడ్యూల్_సంభాషణ', ); +$namespaceNames['tg'] = array( + 828 => 'Модул', + 829 => 'Баҳси_Модул', +); + $namespaceNames['th'] = array( 828 => 'มอดูล', 829 => 'คุยเรื่องมอดูล', -- To view, visit https://gerrit.wikimedia.org/r/293238 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73c88917b8ab72e013660807099aac66e410e221 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Scribunto Gerrit-Branch: master Gerrit-Owner: Dereckson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix skipping delete updates - change (wikidata...rdf)
jenkins-bot has submitted this change and it was merged. Change subject: Fix skipping delete updates .. Fix skipping delete updates Bug: T128947 Change-Id: Iddef2a6b39dfdb74ef04b4f17a5d5a1a237fa366 --- M tools/src/main/java/org/wikidata/query/rdf/tool/change/RecentChangesPoller.java M tools/src/test/java/org/wikidata/query/rdf/tool/change/RecentChangesPollerUnitTest.java 2 files changed, 55 insertions(+), 3 deletions(-) Approvals: Smalyshev: Looks good to me, approved jenkins-bot: Verified diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/change/RecentChangesPoller.java b/tools/src/main/java/org/wikidata/query/rdf/tool/change/RecentChangesPoller.java index 3910f77..64415da 100644 --- a/tools/src/main/java/org/wikidata/query/rdf/tool/change/RecentChangesPoller.java +++ b/tools/src/main/java/org/wikidata/query/rdf/tool/change/RecentChangesPoller.java @@ -94,6 +94,7 @@ * * @throws RetryableException on parse failure */ +@SuppressWarnings("checkstyle:cyclomaticcomplexity") private Batch batch(Date lastNextStartTime, JSONObject lastNextContinue) throws RetryableException { try { JSONObject recentChanges = wikibase.fetchRecentChanges(lastNextStartTime, lastNextContinue, batchSize); @@ -111,13 +112,20 @@ continue; } Date timestamp = df.parse(rc.get("timestamp").toString()); -Change change = new Change(rc.get("title").toString(), (long) rc.get("revid"), timestamp, (long)rc.get("rcid")); +Change change; +if (rc.get("type").toString().equals("log") && (long)rc.get("revid") == 0) { +// Deletes should always be processed, so put negative revision +change = new Change(rc.get("title").toString(), -1L, timestamp, (long)rc.get("rcid")); +} else { +change = new Change(rc.get("title").toString(), (long) rc.get("revid"), timestamp, (long)rc.get("rcid")); +} /* * Remove duplicate changes by title keeping the latest - * revision. + * revision. Note that negative revision means always update, so those + * are kept. */ Change dupe = changesByTitle.put(change.entityId(), change); -if (dupe != null && dupe.revision() > change.revision()) { +if (dupe != null && (dupe.revision() > change.revision() || dupe.revision() < 0)) { // need to remove so that order will be correct changesByTitle.remove(change.entityId()); changesByTitle.put(change.entityId(), dupe); diff --git a/tools/src/test/java/org/wikidata/query/rdf/tool/change/RecentChangesPollerUnitTest.java b/tools/src/test/java/org/wikidata/query/rdf/tool/change/RecentChangesPollerUnitTest.java index 72b9c57..8f7beeb 100644 --- a/tools/src/test/java/org/wikidata/query/rdf/tool/change/RecentChangesPollerUnitTest.java +++ b/tools/src/test/java/org/wikidata/query/rdf/tool/change/RecentChangesPollerUnitTest.java @@ -50,6 +50,7 @@ rc.put("timestamp", date); rc.put("revid", Long.valueOf(i)); rc.put("rcid", Long.valueOf(i)); +rc.put("type", "edit"); recentChanges.add(rc); } when(repository.fetchRecentChanges(startTime, null, batchSize)).thenReturn(result); @@ -88,6 +89,7 @@ rc.put("timestamp", date); rc.put("revid", 1L); rc.put("rcid", 1L); +rc.put("type", "edit"); recentChanges.add(rc); rc = new JSONObject(); rc.put("ns", Long.valueOf(0)); @@ -95,6 +97,7 @@ rc.put("timestamp", date); rc.put("revid", 7L); rc.put("rcid", 7L); +rc.put("type", "edit"); recentChanges.add(rc); query.put("recentchanges", recentChanges); @@ -122,6 +125,47 @@ assertEquals(contJson, argument.getValue()); } +@Test +@SuppressWarnings("unchecked") +public void delete() throws RetryableException { +Date startTime = new Date(); +int batchSize = 10; +// Build a result from wikibase with duplicate recent changes +JSONObject result = new JSONObject(); +JSONObject query = new JSONObject(); +result.put("query", query); +JSONArray recentChanges = new JSONArray(); +query.put("recentchanges", recentChanges); +String date = WikibaseRepository.inputDateFormat().format(new Date()); +JSONObject rc = new JSONObject(); +rc.put("ns", Long.valueOf(0)); +rc.put("title", "Q424242"); +rc.put("timestamp", date); +rc.put("revid", Long.valueOf(0)); +rc.put("rcid", 42L); +rc.put("type", "log"); +recentChanges.add(rc); + +
[MediaWiki-commits] [Gerrit] Update DonationInterface submodule - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Update DonationInterface submodule .. Update DonationInterface submodule Change-Id: I2e66abda5acfdeb4cf61caec7c0304a93ce8e5b6 --- M extensions/DonationInterface 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/DonationInterface b/extensions/DonationInterface index e0fe477..d62ecca 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface -Subproject commit e0fe477eb262a4028fedc4159268b71179e11847 +Subproject commit d62eccafdd767c252b62c98ae202b4b0009246ad -- To view, visit https://gerrit.wikimedia.org/r/293237 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e66abda5acfdeb4cf61caec7c0304a93ce8e5b6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_25 Gerrit-Owner: AwightGerrit-Reviewer: Awight Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add time to display results logging for search satisfaction - change (mediawiki...WikimediaEvents)
jenkins-bot has submitted this change and it was merged. Change subject: Add time to display results logging for search satisfaction .. Add time to display results logging for search satisfaction This should finish off reimplementing features of the old search schema into the satisfaction schema. Adds the number of ms to display to all searchResultPage events. Bug: T132516 Change-Id: Iae6cbb49a4398c06208debb51ef7e9ad2c378357 --- M extension.json M modules/ext.wikimediaEvents.searchSatisfaction.js 2 files changed, 20 insertions(+), 7 deletions(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index 27a6a65..5e1d2ad 100644 --- a/extension.json +++ b/extension.json @@ -114,7 +114,7 @@ "schema.TestSearchSatisfaction2": { "class": "ResourceLoaderSchemaModule", "schema": "TestSearchSatisfaction2", - "revision": 15357244 + "revision": 15644862 }, "schema.GeoFeatures": { "class": "ResourceLoaderSchemaModule", diff --git a/modules/ext.wikimediaEvents.searchSatisfaction.js b/modules/ext.wikimediaEvents.searchSatisfaction.js index 385559a..0a1caa1 100644 --- a/modules/ext.wikimediaEvents.searchSatisfaction.js +++ b/modules/ext.wikimediaEvents.searchSatisfaction.js @@ -413,7 +413,8 @@ * @param {SessionState} session */ function setupSearchTest( session ) { - var logEvent = genLogEventFn( 'fulltext', session ); + var params, + logEvent = genLogEventFn( 'fulltext', session ); if ( isSearchResultPage ) { // When a new search is performed reset the session lifetime. @@ -434,10 +435,14 @@ } ); - logEvent( 'searchResultPage', { + params = { query: mw.config.get( 'searchTerm' ), hitsReturned: $( '.mw-search-result-heading' ).length - } ); + }; + if ( window.performance && window.performance.timing ) { + params.msToDisplayResults = window.performance.timing.domComplete - window.performance.timing.navigationStart; + } + logEvent( 'searchResultPage', params ); } else if ( search.cameFromSearch ) { logEvent( 'visitPage', { position: search.resultPosition @@ -459,18 +464,26 @@ function setupAutocompleteTest( session ) { var logEvent = genLogEventFn( 'autocomplete', session ), track = function ( topic, data ) { - if ( data.action === 'impression-results' ) { + var params; + + if ( data.action === 'session-start' ) { + session.set( 'autocompleteStart', new Date().getTime() ); + } else if ( data.action === 'impression-results' ) { // When a new search is performed reset the session lifetime. session.refresh( 'sessionId' ); session.refresh( 'subTest' ); // run every time an autocomplete result is shown - logEvent( 'searchResultPage', { + params = { hitsReturned: data.numberOfResults, query: data.query, inputLocation: data.inputLocation, autocompleteType: data.resultSetType - } ); + }; + if ( session.has( 'autocompleteStart' ) ) { + params.msToDisplayResults = Math.round( new Date().getTime() - session.get( 'autocompleteStart' ) ); + } + logEvent( 'searchResultPage', params ); } else if ( data.action === 'render-one' ) { // run when rendering anchors for suggestion results. Attaches a wprov // to the link so we know when the user arrives they came from autocomplete -- To view, visit https://gerrit.wikimedia.org/r/290268 To unsubscribe, visit
[MediaWiki-commits] [Gerrit] Remove referrer from queue messages - change (mediawiki...DonationInterface)
jenkins-bot has submitted this change and it was merged. Change subject: Remove referrer from queue messages .. Remove referrer from queue messages It's saved in the contribution_tracking table via db connection, nowhere else. No need for it to show up in logs or queue messages. Bug: T110564 Change-Id: I1f1ab26653e091443f237116452ee31750be6eaf --- M gateway_common/DonationData.php M gateway_common/DonationQueue.php M tests/Adapter/AstroPay/AstroPayTest.php M tests/DonationQueueTest.php 4 files changed, 0 insertions(+), 5 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/gateway_common/DonationData.php b/gateway_common/DonationData.php index 34f246d..b49297e 100644 --- a/gateway_common/DonationData.php +++ b/gateway_common/DonationData.php @@ -910,7 +910,6 @@ 'utm_medium', 'utm_campaign', 'language', - 'referrer', 'email', 'fname', 'lname', diff --git a/gateway_common/DonationQueue.php b/gateway_common/DonationQueue.php index d0b1afc..5ca49c1 100644 --- a/gateway_common/DonationQueue.php +++ b/gateway_common/DonationQueue.php @@ -209,7 +209,6 @@ 'language' => $transaction['language'], 'payment_method' => $transaction['payment_method'], 'payment_submethod' => $transaction['payment_submethod'], - 'referrer' => $transaction['referrer'], 'response' => $transaction['response'], 'user_ip' => $transaction['user_ip'], 'utm_source' => $transaction['utm_source'], diff --git a/tests/Adapter/AstroPay/AstroPayTest.php b/tests/Adapter/AstroPay/AstroPayTest.php index 52b0ad0..5f9f7ad 100644 --- a/tests/Adapter/AstroPay/AstroPayTest.php +++ b/tests/Adapter/AstroPay/AstroPayTest.php @@ -481,7 +481,6 @@ preg_match( '/Redirecting for transaction: (.*)$/', $logged[0], $matches ); $detailString = $matches[1]; $expected = array( - 'referrer' => 'www.yourmom.com', 'currency_code' => 'BRL', 'payment_submethod' => 'test_bank', 'fname' => 'Nome', diff --git a/tests/DonationQueueTest.php b/tests/DonationQueueTest.php index 8aabe05..f8cf1b3 100644 --- a/tests/DonationQueueTest.php +++ b/tests/DonationQueueTest.php @@ -62,7 +62,6 @@ 'payment_method' => 'cc', 'payment_submethod' => 'visa', 'php-message-class' => 'SmashPig\CrmLink\Messages\DonationInterfaceMessage', - 'referrer' => 'http://localhost.net/Ref', 'response' => 'Gateway response something', 'state' => 'AK', 'street' => '1 Fake St.', @@ -75,7 +74,6 @@ 'contribution_tracking_id' => $this->transaction['contribution_tracking_id'], 'utm_source' => 'testing', 'language' => 'en', - 'referrer' => 'http://localhost.net/Ref', 'email' => 'nob...@wikimedia.org', 'first_name' => 'Jen', 'last_name' => 'Russ', -- To view, visit https://gerrit.wikimedia.org/r/289888 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f1ab26653e091443f237116452ee31750be6eaf Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: AndyRussG Gerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: Ssmith Gerrit-Reviewer: XenoRyet Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove referrer from DI messages - change (wikimedia...SmashPig)
jenkins-bot has submitted this change and it was merged. Change subject: Remove referrer from DI messages .. Remove referrer from DI messages Not used by anything reading the queue Deploy after DonationInterface patch I1f1ab26653e091443 Bug: T110564 Change-Id: I11771f81e1934578a38d6258eb2246272ff32f92 --- M CrmLink/Messages/DonationInterfaceMessage.php M PaymentProviders/Adyen/Tests/Data/pending.json M PaymentProviders/Adyen/Tests/faker/templates/pending.json 3 files changed, 1 insertion(+), 3 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/CrmLink/Messages/DonationInterfaceMessage.php b/CrmLink/Messages/DonationInterfaceMessage.php index 3f9c391..1538dbe 100644 --- a/CrmLink/Messages/DonationInterfaceMessage.php +++ b/CrmLink/Messages/DonationInterfaceMessage.php @@ -34,7 +34,6 @@ public $postal_code_2 = ''; public $premium_language = ''; public $recurring = ''; - public $referrer = ''; public $response = ''; public $risk_score = ''; public $size = ''; diff --git a/PaymentProviders/Adyen/Tests/Data/pending.json b/PaymentProviders/Adyen/Tests/Data/pending.json index 0a16bc9..3f86e18 100644 --- a/PaymentProviders/Adyen/Tests/Data/pending.json +++ b/PaymentProviders/Adyen/Tests/Data/pending.json @@ -26,7 +26,6 @@ "postal_code_2": "", "premium_language": "", "recurring": "", - "referrer": "https:\/\/mediawiki.dev\/index.php\/Main_Page", "response": false, "risk_score": 10, "size": "", diff --git a/PaymentProviders/Adyen/Tests/faker/templates/pending.json b/PaymentProviders/Adyen/Tests/faker/templates/pending.json index ff51935..fcf87d9 100644 --- a/PaymentProviders/Adyen/Tests/faker/templates/pending.json +++ b/PaymentProviders/Adyen/Tests/faker/templates/pending.json @@ -1 +1 @@ -raw={"headers":{"expires":"0","source_host":"lakitu","correlation-id":"adyen-[[ORDERID]]","source_enqueued_time":"1458060070","destination":"\/queue\/pending","php-message-class":"SmashPig\\CrmLink\\Messages\\DonationInterfaceMessage","source_type":"payments","priority":"4","source_version":"unknown","source_run_id":"2027","message-id":"ID:lakitu-33375-[[AUTHID]]-2:5:-1:1:1","persistent":"true","source_name":"DonationInterface","gateway":"adyen","timestamp":"1458060070309"},"body":"{\"contribution_tracking_id\":\"[[CTID]]\",\"country\":\"US\",\"order_id\":\"[[ORDERID]]\",\"date\":1458060070,\"email\":\"test[[CTID]]@example.com\",\"fee\":\"0\",\"gateway_account\":\"WikimediaCOM\",\"gateway\":\"adyen\",\"gateway_txn_id\":false,\"language\":\"en\",\"payment_method\":\"cc\",\"payment_submethod\":\"visa\",\"referrer\":\"https:\\\/\\\/mediawiki.dev\\\/index.php\\\/Main_Page\",\"response\":false,\"user_ip\":\"127.0.0.1\",\"utm_source\":\"..cc\",\"city\":\"Columbus\",\"currency\":\"USD\",\"first_name\":\"Testy[[CTID]]\",\"gross\":\"10.00\",\"last_name\":\"Testerson[[CTID]]\",\"recurring\":\"\",\"risk_score\":10,\"state_province\":\"OH\",\"street_address\":\"123 Fake St\",\"utm_campaign\":\"\",\"utm_medium\":\"\",\"postal_code\":\"12345\"}"} +raw={"headers":{"expires":"0","source_host":"lakitu","correlation-id":"adyen-[[ORDERID]]","source_enqueued_time":"1458060070","destination":"\/queue\/pending","php-message-class":"SmashPig\\CrmLink\\Messages\\DonationInterfaceMessage","source_type":"payments","priority":"4","source_version":"unknown","source_run_id":"2027","message-id":"ID:lakitu-33375-[[AUTHID]]-2:5:-1:1:1","persistent":"true","source_name":"DonationInterface","gateway":"adyen","timestamp":"1458060070309"},"body":"{\"contribution_tracking_id\":\"[[CTID]]\",\"country\":\"US\",\"order_id\":\"[[ORDERID]]\",\"date\":1458060070,\"email\":\"test[[CTID]]@example.com\",\"fee\":\"0\",\"gateway_account\":\"WikimediaCOM\",\"gateway\":\"adyen\",\"gateway_txn_id\":false,\"language\":\"en\",\"payment_method\":\"cc\",\"payment_submethod\":\"visa\",\"response\":false,\"user_ip\":\"127.0.0.1\",\"utm_source\":\"..cc\",\"city\":\"Columbus\",\"currency\":\"USD\",\"first_name\":\"Testy[[CTID]]\",\"gross\":\"10.00\",\"last_name\":\"Testerson[[CTID]]\",\"recurring\":\"\",\"risk_score\":10,\"state_province\":\"OH\",\"street_address\":\"123 Fake St\",\"utm_campaign\":\"\",\"utm_medium\":\"\",\"postal_code\":\"12345\"}"} -- To view, visit https://gerrit.wikimedia.org/r/289966 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I11771f81e1934578a38d6258eb2246272ff32f92 Gerrit-PatchSet: 3 Gerrit-Project: wikimedia/fundraising/SmashPig Gerrit-Branch: master Gerrit-Owner: EjeggGerrit-Reviewer: Awight Gerrit-Reviewer: Cdentinger Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] Update payments role test links - change (mediawiki/vagrant)
jenkins-bot has submitted this change and it was merged. Change subject: Update payments role test links .. Update payments role test links New case for AstroPay special page, more Adyen test links, PayPal legacy and express checkout links. Change-Id: I3edbbe057aaa73baec4f24e8fcd01965a49426eb --- M puppet/modules/payments/files/Main_Page.wiki 1 file changed, 28 insertions(+), 23 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified diff --git a/puppet/modules/payments/files/Main_Page.wiki b/puppet/modules/payments/files/Main_Page.wiki index bf11c7f..9b8108c 100644 --- a/puppet/modules/payments/files/Main_Page.wiki +++ b/puppet/modules/payments/files/Main_Page.wiki @@ -27,30 +27,31 @@ = Some donation forms = Donate links: - * Adyen -** [{{fullurl:Special:AdyenGateway|appeal=JimmyQuote_method=cc==en=en_code=USD=10=US}} Credit card in US, English, USD] -** [{{fullurl:Special:AdyenGateway|appeal=JimmyQuote_method=cc==en=en_code=GBP=10=GB}} Credit card in GB, English, GBP] +** [{{fullurl:Special:AdyenGateway|appeal=JimmyQuote_method=cc==en=en_code=USD=10=US=adyen}} Credit card in US, English, USD] +** [{{fullurl:Special:AdyenGateway|appeal=JimmyQuote_method=cc==fr=fr_code=EUR=10=FR=adyen}} Credit card in FR, French, EUR] +** [{{fullurl:Special:AdyenGateway|appeal=JimmyQuote_method=cc==ja=ja_code=JPY=250=JP=adyen}} Credit card in JP, Japanese, JPY] +** [{{fullurl:Special:AdyenGateway|appeal=JimmyQuote_method=cc==he=he_code=ILS=100=IL=adyen}} Credit card in IL, Hebrew, ILS] +** [{{fullurl:Special:AdyenGateway|appeal=JimmyQuote_method=cc==uk=uk_code=UAH=100=UA=adyen}} Credit card in UA, Ukrainian, UAH] * Amazon ** [{{fullurl:Special:AmazonGateway|currency_code=USD=US=1=amazon}} In US, no language specified, USD] * AstroPay -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=cc==en=en_code=BRL=100=BR=astropay}} Credit card in BR, English, BRL] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=cash==en=en_code=BRL=100=BR=astropay}} Cash (Boletos) in BR, English, BRL] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=bt==en=en_code=BRL=100=BR=astropay}} Bank transfer in BR, English, BRL] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=cc==es=es_code=MXN=100=MX=astropay-mx}} Credit card in MX, Spanish, MXN] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=cash==es=es_code=MXN=100=MX=astropay-mx}} Cash in MX, Spanish, MXN] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=cc==es=es_code=ARS=100=AR=astropay-ar}} Credit card in AR, Spanish, ARS] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=bt==es=es_code=ARS=100=AR=astropay-ar}} Bank Transfer in AR, Spanish, ARS] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=cash==es=es_code=ARS=100=AR=astropay-ar}} Cash in AR, Spanish, ARS] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=cc==es=es_code=CLP=5000=CL=astropay-cl}} Credit card in CL, Spanish, CLP] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=bt==es=es_code=CLP=5000=CL=astropay-cl}} Bank Transfer in CL, Spanish, CLP] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=cc==es=es_code=COP=5000=CO=astropay-co}} Credit card in CO, Spanish, COP] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=bt==es=es_code=COP=5000=CO=astropay-co}} Bank transfer in CO, Spanish, COP] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=cash==es=es_code=COP=5000=CO=astropay-co}} Cash in CO, Spanish, COP] -** [{{fullurl:Special:AstropayGateway|appeal=JimmyQuote_method=cash==es=es_code=UYU=5000=UY=astropay-uy}} Cash in UY, Spanish, UYU] - +** [{{fullurl:Special:AstroPayGateway|appeal=JimmyQuote_method=cc==en=en_code=BRL=100=BR=astropay}} Credit card in BR, English, BRL] +** [{{fullurl:Special:AstroPayGateway|appeal=JimmyQuote_method=cash==en=en_code=BRL=100=BR=astropay}} Cash (Boletos) in BR, English, BRL] +** [{{fullurl:Special:AstroPayGateway|appeal=JimmyQuote_method=bt==en=en_code=BRL=100=BR=astropay}} Bank transfer in BR, English, BRL] +** [{{fullurl:Special:AstroPayGateway|appeal=JimmyQuote_method=cc==es=es_code=MXN=100=MX=astropay-mx}} Credit card in MX, Spanish, MXN] +** [{{fullurl:Special:AstroPayGateway|appeal=JimmyQuote_method=cash==es=es_code=MXN=100=MX=astropay-mx}} Cash in MX, Spanish, MXN] +** [{{fullurl:Special:AstroPayGateway|appeal=JimmyQuote_method=cc==es=es_code=ARS=100=AR=astropay-ar}} Credit card in AR, Spanish, ARS] +** [{{fullurl:Special:AstroPayGateway|appeal=JimmyQuote_method=bt==es=es_code=ARS=100=AR=astropay-ar}} Bank Transfer in AR, Spanish, ARS] +** [{{fullurl:Special:AstroPayGateway|appeal=JimmyQuote_method=cash==es=es_code=ARS=100=AR=astropay-ar}} Cash in AR, Spanish, ARS] +**
[MediaWiki-commits] [Gerrit] Fix Status::getMessage for the multiple errors, $shortContex... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Fix Status::getMessage for the multiple errors, $shortContext only case .. Fix Status::getMessage for the multiple errors, $shortContext only case Remove $msgCount++ which does not seem to have any non-harmful purpose. Also try to explain what the hell the method does. Change-Id: Ibdf40ff13a4a9d294a6bc6f778a14fb2633c2f70 (cherry picked from commit 4d294bceab9669ee7169248e92fe747a3b5fce7c) --- M includes/Status.php 1 file changed, 15 insertions(+), 9 deletions(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Status.php b/includes/Status.php index d01f269..45d8bed 100644 --- a/includes/Status.php +++ b/includes/Status.php @@ -251,12 +251,22 @@ } /** -* Get the error list as a Message object +* Get a bullet list of the errors as a Message object. * -* @param string|string[] $shortContext A short enclosing context message name (or an array of -* message names), to be used when there is a single error. -* @param string|string[] $longContext A long enclosing context message name (or an array of -* message names), for a list. +* $shortContext and $longContext can be used to wrap the error list in some text. +* $shortContext will be preferred when there is a single error; $longContext will be +* preferred when there are multiple ones. In either case, $1 will be replaced with +* the list of errors. +* +* $shortContext is assumed to use $1 as an inline parameter: if there is a single item, +* it will not be made into a list; if there are multiple items, newlines will be inserted +* around the list. +* $longContext is assumed to use $1 as a standalone parameter; it will always receive a list. +* +* If both parameters are missing, and there is only one error, no bullet will be added. +* +* @param string|string[] $shortContext A message name or an array of message names. +* @param string|string[] $longContext A message name or an array of message names. * @param string|Language $lang Language to use for processing messages * @return Message */ @@ -286,10 +296,6 @@ } else { $msgs = $this->getErrorMessageArray( $rawErrors, $lang ); $msgCount = count( $msgs ); - - if ( $shortContext ) { - $msgCount++; - } $s = new RawMessage( '* $' . implode( "\n* \$", range( 1, $msgCount ) ) ); $s->params( $msgs )->parse(); -- To view, visit https://gerrit.wikimedia.org/r/293234 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibdf40ff13a4a9d294a6bc6f778a14fb2633c2f70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.5 Gerrit-Owner: Gergő TiszaGerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Merge master into deployment - change (mediawiki...DonationInterface)
jenkins-bot has submitted this change and it was merged. Change subject: Merge master into deployment .. Merge master into deployment ea2c99bf7638689bdba65f0946d3f7c0dfc49408 Localisation updates from https://translatewiki.net. 0183b974e62487bac7f6efa71cb6d40565347d4e Wrap gateway URL in an accessor function and clean up redirect logic 4c948c860437e2111d7937896e15c0e92a238136 Support certificate authentication Change-Id: Ia27d54717b8fe866fd71ea0d46e87c4bdfd523ba --- 0 files changed, 0 insertions(+), 0 deletions(-) Approvals: Awight: Looks good to me, approved jenkins-bot: Verified -- To view, visit https://gerrit.wikimedia.org/r/293233 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia27d54717b8fe866fd71ea0d46e87c4bdfd523ba Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: AwightGerrit-Reviewer: Awight Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix Message::newFromSpecifier for nested RawMessage - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Fix Message::newFromSpecifier for nested RawMessage .. Fix Message::newFromSpecifier for nested RawMessage This can happen e.g. when something processes Status contents and expects [$key, $param1, ...] and instead gets [$messageObject] Change-Id: I346b35e08bd38ce231e16d0616438ea408b55bff --- M includes/Message.php M tests/phpunit/includes/MessageTest.php 2 files changed, 14 insertions(+), 5 deletions(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Message.php b/includes/Message.php index c204aee..712d3f1 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -384,22 +384,30 @@ /** * Transform a MessageSpecifier or a primitive value used interchangeably with -* specifiers (a message key string, or a key + params array) into a proper Message +* specifiers (a message key string, or a key + params array) into a proper Message. +* +* Also accepts a MessageSpecifier inside an array: that's not considered a valid format +* but is an easy error to make due to how StatusValue stores messages internally. +* Further array elements are ignored in that case. +* * @param string|array|MessageSpecifier $value * @return Message * @throws InvalidArgumentException * @since 1.27 */ public static function newFromSpecifier( $value ) { + $params = []; + if ( is_array( $value ) ) { + $params = $value; + $value = array_shift( $params ); + } + if ( $value instanceof RawMessage ) { $message = new RawMessage( $value->getKey(), $value->getParams() ); } elseif ( $value instanceof MessageSpecifier ) { $message = new Message( $value ); - } elseif ( is_array( $value ) ) { - $key = array_shift( $value ); - $message = new Message( $key, $value ); } elseif ( is_string( $value ) ) { - $message = new Message( $value ); + $message = new Message( $value, $params ); } else { throw new InvalidArgumentException( __METHOD__ . ': invalid argument type ' . gettype( $value ) ); diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index 224b0cb..8aa1361 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -603,6 +603,7 @@ 'Message' => [ new Message( 'youhavenewmessages', [ 'foo', 'bar' ] ), 'You have foo (bar).' ], 'RawMessage' => [ new RawMessage( 'foo ($1)', [ 'bar' ] ), 'foo (bar)' ], 'MessageSpecifier' => [ $messageSpecifier, 'Main Page' ], + 'nested RawMessage' => [ [ new RawMessage( 'foo ($1)', [ 'bar' ] ) ], 'foo (bar)' ], ]; } } -- To view, visit https://gerrit.wikimedia.org/r/293232 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I346b35e08bd38ce231e16d0616438ea408b55bff Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.5 Gerrit-Owner: Gergő TiszaGerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix Message::newFromSpecifier for nested RawMessage - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Fix Message::newFromSpecifier for nested RawMessage .. Fix Message::newFromSpecifier for nested RawMessage This can happen e.g. when something processes Status contents and expects [$key, $param1, ...] and instead gets [$messageObject] Change-Id: I346b35e08bd38ce231e16d0616438ea408b55bff --- M includes/Message.php M tests/phpunit/includes/MessageTest.php 2 files changed, 14 insertions(+), 5 deletions(-) Approvals: Anomie: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Message.php b/includes/Message.php index c204aee..712d3f1 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -384,22 +384,30 @@ /** * Transform a MessageSpecifier or a primitive value used interchangeably with -* specifiers (a message key string, or a key + params array) into a proper Message +* specifiers (a message key string, or a key + params array) into a proper Message. +* +* Also accepts a MessageSpecifier inside an array: that's not considered a valid format +* but is an easy error to make due to how StatusValue stores messages internally. +* Further array elements are ignored in that case. +* * @param string|array|MessageSpecifier $value * @return Message * @throws InvalidArgumentException * @since 1.27 */ public static function newFromSpecifier( $value ) { + $params = []; + if ( is_array( $value ) ) { + $params = $value; + $value = array_shift( $params ); + } + if ( $value instanceof RawMessage ) { $message = new RawMessage( $value->getKey(), $value->getParams() ); } elseif ( $value instanceof MessageSpecifier ) { $message = new Message( $value ); - } elseif ( is_array( $value ) ) { - $key = array_shift( $value ); - $message = new Message( $key, $value ); } elseif ( is_string( $value ) ) { - $message = new Message( $value ); + $message = new Message( $value, $params ); } else { throw new InvalidArgumentException( __METHOD__ . ': invalid argument type ' . gettype( $value ) ); diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index 224b0cb..8aa1361 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -603,6 +603,7 @@ 'Message' => [ new Message( 'youhavenewmessages', [ 'foo', 'bar' ] ), 'You have foo (bar).' ], 'RawMessage' => [ new RawMessage( 'foo ($1)', [ 'bar' ] ), 'foo (bar)' ], 'MessageSpecifier' => [ $messageSpecifier, 'Main Page' ], + 'nested RawMessage' => [ [ new RawMessage( 'foo ($1)', [ 'bar' ] ) ], 'foo (bar)' ], ]; } } -- To view, visit https://gerrit.wikimedia.org/r/293210 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I346b35e08bd38ce231e16d0616438ea408b55bff Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gergő TiszaGerrit-Reviewer: Anomie Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update DonationInterface submodule - change (mediawiki/core)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/293237 Change subject: Update DonationInterface submodule .. Update DonationInterface submodule Change-Id: I2e66abda5acfdeb4cf61caec7c0304a93ce8e5b6 --- M extensions/DonationInterface 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/37/293237/1 diff --git a/extensions/DonationInterface b/extensions/DonationInterface index e0fe477..d62ecca 16 --- a/extensions/DonationInterface +++ b/extensions/DonationInterface -Subproject commit e0fe477eb262a4028fedc4159268b71179e11847 +Subproject commit d62eccafdd767c252b62c98ae202b4b0009246ad -- To view, visit https://gerrit.wikimedia.org/r/293237 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e66abda5acfdeb4cf61caec7c0304a93ce8e5b6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: fundraising/REL1_25 Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix skipping delete updates - change (wikidata...rdf)
Smalyshev has uploaded a new change for review. https://gerrit.wikimedia.org/r/293236 Change subject: Fix skipping delete updates .. Fix skipping delete updates Bug: T128947 Change-Id: Iddef2a6b39dfdb74ef04b4f17a5d5a1a237fa366 --- M tools/src/main/java/org/wikidata/query/rdf/tool/change/RecentChangesPoller.java M tools/src/test/java/org/wikidata/query/rdf/tool/change/RecentChangesPollerUnitTest.java 2 files changed, 55 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf refs/changes/36/293236/1 diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/change/RecentChangesPoller.java b/tools/src/main/java/org/wikidata/query/rdf/tool/change/RecentChangesPoller.java index 3910f77..64415da 100644 --- a/tools/src/main/java/org/wikidata/query/rdf/tool/change/RecentChangesPoller.java +++ b/tools/src/main/java/org/wikidata/query/rdf/tool/change/RecentChangesPoller.java @@ -94,6 +94,7 @@ * * @throws RetryableException on parse failure */ +@SuppressWarnings("checkstyle:cyclomaticcomplexity") private Batch batch(Date lastNextStartTime, JSONObject lastNextContinue) throws RetryableException { try { JSONObject recentChanges = wikibase.fetchRecentChanges(lastNextStartTime, lastNextContinue, batchSize); @@ -111,13 +112,20 @@ continue; } Date timestamp = df.parse(rc.get("timestamp").toString()); -Change change = new Change(rc.get("title").toString(), (long) rc.get("revid"), timestamp, (long)rc.get("rcid")); +Change change; +if (rc.get("type").toString().equals("log") && (long)rc.get("revid") == 0) { +// Deletes should always be processed, so put negative revision +change = new Change(rc.get("title").toString(), -1L, timestamp, (long)rc.get("rcid")); +} else { +change = new Change(rc.get("title").toString(), (long) rc.get("revid"), timestamp, (long)rc.get("rcid")); +} /* * Remove duplicate changes by title keeping the latest - * revision. + * revision. Note that negative revision means always update, so those + * are kept. */ Change dupe = changesByTitle.put(change.entityId(), change); -if (dupe != null && dupe.revision() > change.revision()) { +if (dupe != null && (dupe.revision() > change.revision() || dupe.revision() < 0)) { // need to remove so that order will be correct changesByTitle.remove(change.entityId()); changesByTitle.put(change.entityId(), dupe); diff --git a/tools/src/test/java/org/wikidata/query/rdf/tool/change/RecentChangesPollerUnitTest.java b/tools/src/test/java/org/wikidata/query/rdf/tool/change/RecentChangesPollerUnitTest.java index 72b9c57..8f7beeb 100644 --- a/tools/src/test/java/org/wikidata/query/rdf/tool/change/RecentChangesPollerUnitTest.java +++ b/tools/src/test/java/org/wikidata/query/rdf/tool/change/RecentChangesPollerUnitTest.java @@ -50,6 +50,7 @@ rc.put("timestamp", date); rc.put("revid", Long.valueOf(i)); rc.put("rcid", Long.valueOf(i)); +rc.put("type", "edit"); recentChanges.add(rc); } when(repository.fetchRecentChanges(startTime, null, batchSize)).thenReturn(result); @@ -88,6 +89,7 @@ rc.put("timestamp", date); rc.put("revid", 1L); rc.put("rcid", 1L); +rc.put("type", "edit"); recentChanges.add(rc); rc = new JSONObject(); rc.put("ns", Long.valueOf(0)); @@ -95,6 +97,7 @@ rc.put("timestamp", date); rc.put("revid", 7L); rc.put("rcid", 7L); +rc.put("type", "edit"); recentChanges.add(rc); query.put("recentchanges", recentChanges); @@ -122,6 +125,47 @@ assertEquals(contJson, argument.getValue()); } +@Test +@SuppressWarnings("unchecked") +public void delete() throws RetryableException { +Date startTime = new Date(); +int batchSize = 10; +// Build a result from wikibase with duplicate recent changes +JSONObject result = new JSONObject(); +JSONObject query = new JSONObject(); +result.put("query", query); +JSONArray recentChanges = new JSONArray(); +query.put("recentchanges", recentChanges); +String date = WikibaseRepository.inputDateFormat().format(new Date()); +JSONObject rc = new JSONObject(); +rc.put("ns", Long.valueOf(0)); +rc.put("title", "Q424242"); +rc.put("timestamp", date); +rc.put("revid", Long.valueOf(0)); +rc.put("rcid", 42L); +rc.put("type",
[MediaWiki-commits] [Gerrit] Change invalid password reset form language - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Change invalid password reset form language .. Change invalid password reset form language The old workflow was login -> go to a password change form (at which point the user is fully logged on and can just abandon the form). The AuthManager workflow is go through a string of login providers (including the password reset), and get logged in at the very end - so the user has to submit the form. The submit button text for not updating the password was changed from Cancel to Skip to account for that; this patch updates the messages which reference that text. Bug: T136894 Change-Id: I38ac7883d2acfc73c5662dc2c382a395ef1b91c1 --- M languages/i18n/en.json 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 9432cad..a028283 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -585,8 +585,8 @@ "resetpass-temp-password": "Temporary password:", "resetpass-abort-generic": "Password change has been aborted by an extension.", "resetpass-expired": "Your password has expired. Please set a new password to log in.", - "resetpass-expired-soft": "Your password has expired and needs to be reset. Please choose a new password now, or click \"{{int:resetpass-submit-cancel}}\" to reset it later.", - "resetpass-validity-soft": "Your password is not valid: $1\n\nPlease choose a new password now, or click \"{{int:resetpass-submit-cancel}}\" to reset it later.", + "resetpass-expired-soft": "Your password has expired and needs to be reset. Please choose a new password now, or click \"{{int:authprovider-resetpass-skip-label}}\" to reset it later.", + "resetpass-validity-soft": "Your password is not valid: $1\n\nPlease choose a new password now, or click \"{{int:authprovider-resetpass-skip-label}}\" to reset it later.", "passwordreset": "Reset password", "passwordreset-text-one": "Complete this form to receive a temporary password via email.", "passwordreset-text-many": "{{PLURAL:$1|Fill in one of the fields to receive a temporary password via email.}}", -- To view, visit https://gerrit.wikimedia.org/r/293231 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38ac7883d2acfc73c5662dc2c382a395ef1b91c1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.5 Gerrit-Owner: Gergő TiszaGerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Reject authentication data change when there are warnings - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Reject authentication data change when there are warnings .. Reject authentication data change when there are warnings AuthManager uses a status which is OK but not good for authentication data which is discouraged but still accepted for authentication. Users should not be allowed to change credentials into such invalid state. This change brings the web logic and the AuthPlugin fallback in sync with the API which already used the stricter check. Change-Id: I4ff54fcc901f6fe11f15ed60fc1a3d8753de9f6c (cherry picked from commit d850025e603fc6f2bec3a80cdd17c027d8813341) --- M includes/Preferences.php M includes/auth/AuthManagerAuthPlugin.php M includes/specialpage/AuthManagerSpecialPage.php M includes/user/User.php 4 files changed, 4 insertions(+), 4 deletions(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Preferences.php b/includes/Preferences.php index 9a55ae3..3083a8d 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -296,7 +296,7 @@ $allowPasswordChange = $wgDisableAuthManager ? $wgAuth->allowPasswordChange() : AuthManager::singleton()->allowsAuthenticationDataChange( - new PasswordAuthenticationRequest(), false ); + new PasswordAuthenticationRequest(), false )->isGood(); if ( $canEditPrivateInfo && $allowPasswordChange ) { $link = Linker::link( SpecialPage::getTitleFor( 'ChangePassword' ), $context->msg( 'prefs-resetpass' )->escaped(), [], diff --git a/includes/auth/AuthManagerAuthPlugin.php b/includes/auth/AuthManagerAuthPlugin.php index bf1e021..8d85b44 100644 --- a/includes/auth/AuthManagerAuthPlugin.php +++ b/includes/auth/AuthManagerAuthPlugin.php @@ -131,7 +131,7 @@ $reqs = AuthenticationRequest::loadRequestsFromSubmission( $reqs, $data ); foreach ( $reqs as $req ) { $status = AuthManager::singleton()->allowsAuthenticationDataChange( $req ); - if ( !$status->isOk() ) { + if ( !$status->isGood() ) { $this->logger->info( __METHOD__ . ': Password change rejected: {reason}', [ 'username' => $data['username'], 'reason' => $status->getWikiText( null, null, 'en' ), diff --git a/includes/specialpage/AuthManagerSpecialPage.php b/includes/specialpage/AuthManagerSpecialPage.php index 7866c12..41380f0 100644 --- a/includes/specialpage/AuthManagerSpecialPage.php +++ b/includes/specialpage/AuthManagerSpecialPage.php @@ -375,7 +375,7 @@ $req = reset( $requests ); $status = $authManager->allowsAuthenticationDataChange( $req ); Hooks::run( 'ChangeAuthenticationDataAudit', [ $req, $status ] ); - if ( !$status->isOK() ) { + if ( !$status->isGood() ) { return AuthenticationResponse::newFail( $status->getMessage() ); } $authManager->changeAuthenticationData( $req ); diff --git a/includes/user/User.php b/includes/user/User.php index 9e50f36..8ecf468 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -2569,7 +2569,7 @@ $reqs = AuthenticationRequest::loadRequestsFromSubmission( $reqs, $data ); foreach ( $reqs as $req ) { $status = $manager->allowsAuthenticationDataChange( $req ); - if ( !$status->isOk() ) { + if ( !$status->isGood() ) { \MediaWiki\Logger\LoggerFactory::getInstance( 'authentication' ) ->info( __METHOD__ . ': Password change rejected: ' . $status->getWikiText() ); return false; -- To view, visit https://gerrit.wikimedia.org/r/293230 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4ff54fcc901f6fe11f15ed60fc1a3d8753de9f6c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.5 Gerrit-Owner: Gergő TiszaGerrit-Reviewer: Anomie Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Whitelist [lL]adsgroup - change (integration/config)
Ladsgroup has uploaded a new change for review. https://gerrit.wikimedia.org/r/293235 Change subject: Whitelist [lL]adsgroup .. Whitelist [lL]adsgroup My gerrit settings got a little bit crazy and sometimes sends Ladsgroup instead of ladsgroup. Change-Id: I55c8f372498352ba5688cf18de266633adc9322b --- M zuul/layout.yaml 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/integration/config refs/changes/35/293235/1 diff --git a/zuul/layout.yaml b/zuul/layout.yaml index 1e02691..888c9d2 100644 --- a/zuul/layout.yaml +++ b/zuul/layout.yaml @@ -120,7 +120,7 @@ | krinklemail@gmail\.com | kumariankita002@gmail\.com | l10n-bot@translatewiki\.net -| ladsgroup@gmail\.com +| [Ll]adsgroup@gmail\.com | legoktm\.wikipedia@gmail\.com | lewis@lewiscawte\.me | liangent@gmail\.com @@ -374,7 +374,7 @@ - ^karsten@hoffmeyer\.info$ # Kghbln - ^krenair@gmail\.com$ - ^kumariankita002@gmail\.com$ - - ^ladsgroup@gmail\.com$ # Pywikibot maintainer + - ^[lL]adsgroup@gmail\.com$ # Pywikibot maintainer - ^lewis@lewiscawte\.me$ - ^liangent@gmail\.com$ - ^lokal\.profil@gmail\.com$ -- To view, visit https://gerrit.wikimedia.org/r/293235 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I55c8f372498352ba5688cf18de266633adc9322b Gerrit-PatchSet: 1 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Ladsgroup___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix Status::getMessage for the multiple errors, $shortContex... - change (mediawiki/core)
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/293234 Change subject: Fix Status::getMessage for the multiple errors, $shortContext only case .. Fix Status::getMessage for the multiple errors, $shortContext only case Remove $msgCount++ which does not seem to have any non-harmful purpose. Also try to explain what the hell the method does. Change-Id: Ibdf40ff13a4a9d294a6bc6f778a14fb2633c2f70 (cherry picked from commit 4d294bceab9669ee7169248e92fe747a3b5fce7c) --- M includes/Status.php 1 file changed, 15 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/34/293234/1 diff --git a/includes/Status.php b/includes/Status.php index d01f269..45d8bed 100644 --- a/includes/Status.php +++ b/includes/Status.php @@ -251,12 +251,22 @@ } /** -* Get the error list as a Message object +* Get a bullet list of the errors as a Message object. * -* @param string|string[] $shortContext A short enclosing context message name (or an array of -* message names), to be used when there is a single error. -* @param string|string[] $longContext A long enclosing context message name (or an array of -* message names), for a list. +* $shortContext and $longContext can be used to wrap the error list in some text. +* $shortContext will be preferred when there is a single error; $longContext will be +* preferred when there are multiple ones. In either case, $1 will be replaced with +* the list of errors. +* +* $shortContext is assumed to use $1 as an inline parameter: if there is a single item, +* it will not be made into a list; if there are multiple items, newlines will be inserted +* around the list. +* $longContext is assumed to use $1 as a standalone parameter; it will always receive a list. +* +* If both parameters are missing, and there is only one error, no bullet will be added. +* +* @param string|string[] $shortContext A message name or an array of message names. +* @param string|string[] $longContext A message name or an array of message names. * @param string|Language $lang Language to use for processing messages * @return Message */ @@ -286,10 +296,6 @@ } else { $msgs = $this->getErrorMessageArray( $rawErrors, $lang ); $msgCount = count( $msgs ); - - if ( $shortContext ) { - $msgCount++; - } $s = new RawMessage( '* $' . implode( "\n* \$", range( 1, $msgCount ) ) ); $s->params( $msgs )->parse(); -- To view, visit https://gerrit.wikimedia.org/r/293234 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibdf40ff13a4a9d294a6bc6f778a14fb2633c2f70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.5 Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Merge master into deployment - change (mediawiki...DonationInterface)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/293233 Change subject: Merge master into deployment .. Merge master into deployment ea2c99bf7638689bdba65f0946d3f7c0dfc49408 Localisation updates from https://translatewiki.net. 0183b974e62487bac7f6efa71cb6d40565347d4e Wrap gateway URL in an accessor function and clean up redirect logic 4c948c860437e2111d7937896e15c0e92a238136 Support certificate authentication Change-Id: Ia27d54717b8fe866fd71ea0d46e87c4bdfd523ba --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/33/293233/1 -- To view, visit https://gerrit.wikimedia.org/r/293233 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia27d54717b8fe866fd71ea0d46e87c4bdfd523ba Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: deployment Gerrit-Owner: Awight___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix Message::newFromSpecifier for nested RawMessage - change (mediawiki/core)
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/293232 Change subject: Fix Message::newFromSpecifier for nested RawMessage .. Fix Message::newFromSpecifier for nested RawMessage This can happen e.g. when something processes Status contents and expects [$key, $param1, ...] and instead gets [$messageObject] Change-Id: I346b35e08bd38ce231e16d0616438ea408b55bff --- M includes/Message.php M tests/phpunit/includes/MessageTest.php 2 files changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/32/293232/1 diff --git a/includes/Message.php b/includes/Message.php index c204aee..712d3f1 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -384,22 +384,30 @@ /** * Transform a MessageSpecifier or a primitive value used interchangeably with -* specifiers (a message key string, or a key + params array) into a proper Message +* specifiers (a message key string, or a key + params array) into a proper Message. +* +* Also accepts a MessageSpecifier inside an array: that's not considered a valid format +* but is an easy error to make due to how StatusValue stores messages internally. +* Further array elements are ignored in that case. +* * @param string|array|MessageSpecifier $value * @return Message * @throws InvalidArgumentException * @since 1.27 */ public static function newFromSpecifier( $value ) { + $params = []; + if ( is_array( $value ) ) { + $params = $value; + $value = array_shift( $params ); + } + if ( $value instanceof RawMessage ) { $message = new RawMessage( $value->getKey(), $value->getParams() ); } elseif ( $value instanceof MessageSpecifier ) { $message = new Message( $value ); - } elseif ( is_array( $value ) ) { - $key = array_shift( $value ); - $message = new Message( $key, $value ); } elseif ( is_string( $value ) ) { - $message = new Message( $value ); + $message = new Message( $value, $params ); } else { throw new InvalidArgumentException( __METHOD__ . ': invalid argument type ' . gettype( $value ) ); diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index 224b0cb..8aa1361 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -603,6 +603,7 @@ 'Message' => [ new Message( 'youhavenewmessages', [ 'foo', 'bar' ] ), 'You have foo (bar).' ], 'RawMessage' => [ new RawMessage( 'foo ($1)', [ 'bar' ] ), 'foo (bar)' ], 'MessageSpecifier' => [ $messageSpecifier, 'Main Page' ], + 'nested RawMessage' => [ [ new RawMessage( 'foo ($1)', [ 'bar' ] ) ], 'foo (bar)' ], ]; } } -- To view, visit https://gerrit.wikimedia.org/r/293232 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I346b35e08bd38ce231e16d0616438ea408b55bff Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.5 Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] new role: pageassessments - change (mediawiki/vagrant)
MusikAnimal has submitted this change and it was merged. Change subject: new role: pageassessments .. new role: pageassessments Change-Id: I13316feb0752faed79fd9581357a7af8dcd8d5cd --- A puppet/modules/role/manifests/pageassessments.pp 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: MusikAnimal: Checked; Looks good to me, approved jenkins-bot: Verified diff --git a/puppet/modules/role/manifests/pageassessments.pp b/puppet/modules/role/manifests/pageassessments.pp new file mode 100644 index 000..b603a08 --- /dev/null +++ b/puppet/modules/role/manifests/pageassessments.pp @@ -0,0 +1,10 @@ +# == Class: role::pageassessments +# This extension is for the purposes of storing article assessments (for +# WikiProjects) in a new database table. +# +class role::pageassessments { +mediawiki::extension { 'PageAssessments': +needs_update => true, +} +} + -- To view, visit https://gerrit.wikimedia.org/r/293226 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I13316feb0752faed79fd9581357a7af8dcd8d5cd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: BryanDavisGerrit-Reviewer: Dduvall Gerrit-Reviewer: MusikAnimal Gerrit-Reviewer: Niharika29 Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] ores: Add support for Norwegian - change (operations/puppet)
Yuvipanda has submitted this change and it was merged. Change subject: ores: Add support for Norwegian .. ores: Add support for Norwegian Change-Id: Iaf8533802e3318a0234874d7a7991738bc94fb17 --- M modules/ores/manifests/base.pp 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Yuvipanda: Verified; Looks good to me, approved diff --git a/modules/ores/manifests/base.pp b/modules/ores/manifests/base.pp index 059e155..fce0a68 100644 --- a/modules/ores/manifests/base.pp +++ b/modules/ores/manifests/base.pp @@ -28,6 +28,7 @@ 'myspell-he', 'myspell-hu', 'myspell-it', +'myspell-nb', 'myspell-nl', 'myspell-pt', 'myspell-ru', -- To view, visit https://gerrit.wikimedia.org/r/293225 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaf8533802e3318a0234874d7a7991738bc94fb17 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: LadsgroupGerrit-Reviewer: Yuvipanda Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Change invalid password reset form language - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Change invalid password reset form language .. Change invalid password reset form language The old workflow was login -> go to a password change form (at which point the user is fully logged on and can just abandon the form). The AuthManager workflow is go through a string of login providers (including the password reset), and get logged in at the very end - so the user has to submit the form. The submit button text for not updating the password was changed from Cancel to Skip to account for that; this patch updates the messages which reference that text. Bug: T136894 Change-Id: I38ac7883d2acfc73c5662dc2c382a395ef1b91c1 --- M languages/i18n/en.json 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Anomie: Looks good to me, approved jenkins-bot: Verified diff --git a/languages/i18n/en.json b/languages/i18n/en.json index e6a8141..f9a31d1 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -585,8 +585,8 @@ "resetpass-temp-password": "Temporary password:", "resetpass-abort-generic": "Password change has been aborted by an extension.", "resetpass-expired": "Your password has expired. Please set a new password to log in.", - "resetpass-expired-soft": "Your password has expired and needs to be reset. Please choose a new password now, or click \"{{int:resetpass-submit-cancel}}\" to reset it later.", - "resetpass-validity-soft": "Your password is not valid: $1\n\nPlease choose a new password now, or click \"{{int:resetpass-submit-cancel}}\" to reset it later.", + "resetpass-expired-soft": "Your password has expired and needs to be reset. Please choose a new password now, or click \"{{int:authprovider-resetpass-skip-label}}\" to reset it later.", + "resetpass-validity-soft": "Your password is not valid: $1\n\nPlease choose a new password now, or click \"{{int:authprovider-resetpass-skip-label}}\" to reset it later.", "passwordreset": "Reset password", "passwordreset-text-one": "Complete this form to receive a temporary password via email.", "passwordreset-text-many": "{{PLURAL:$1|Fill in one of the fields to receive a temporary password via email.}}", -- To view, visit https://gerrit.wikimedia.org/r/293094 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38ac7883d2acfc73c5662dc2c382a395ef1b91c1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gergő TiszaGerrit-Reviewer: Anomie Gerrit-Reviewer: Brian Wolff Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Change invalid password reset form language - change (mediawiki/core)
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/293231 Change subject: Change invalid password reset form language .. Change invalid password reset form language The old workflow was login -> go to a password change form (at which point the user is fully logged on and can just abandon the form). The AuthManager workflow is go through a string of login providers (including the password reset), and get logged in at the very end - so the user has to submit the form. The submit button text for not updating the password was changed from Cancel to Skip to account for that; this patch updates the messages which reference that text. Bug: T136894 Change-Id: I38ac7883d2acfc73c5662dc2c382a395ef1b91c1 --- M languages/i18n/en.json 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/31/293231/1 diff --git a/languages/i18n/en.json b/languages/i18n/en.json index 9432cad..a028283 100644 --- a/languages/i18n/en.json +++ b/languages/i18n/en.json @@ -585,8 +585,8 @@ "resetpass-temp-password": "Temporary password:", "resetpass-abort-generic": "Password change has been aborted by an extension.", "resetpass-expired": "Your password has expired. Please set a new password to log in.", - "resetpass-expired-soft": "Your password has expired and needs to be reset. Please choose a new password now, or click \"{{int:resetpass-submit-cancel}}\" to reset it later.", - "resetpass-validity-soft": "Your password is not valid: $1\n\nPlease choose a new password now, or click \"{{int:resetpass-submit-cancel}}\" to reset it later.", + "resetpass-expired-soft": "Your password has expired and needs to be reset. Please choose a new password now, or click \"{{int:authprovider-resetpass-skip-label}}\" to reset it later.", + "resetpass-validity-soft": "Your password is not valid: $1\n\nPlease choose a new password now, or click \"{{int:authprovider-resetpass-skip-label}}\" to reset it later.", "passwordreset": "Reset password", "passwordreset-text-one": "Complete this form to receive a temporary password via email.", "passwordreset-text-many": "{{PLURAL:$1|Fill in one of the fields to receive a temporary password via email.}}", -- To view, visit https://gerrit.wikimedia.org/r/293231 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38ac7883d2acfc73c5662dc2c382a395ef1b91c1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.5 Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Reject authentication data change when there are warnings - change (mediawiki/core)
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/293230 Change subject: Reject authentication data change when there are warnings .. Reject authentication data change when there are warnings AuthManager uses a status which is OK but not good for authentication data which is discouraged but still accepted for authentication. Users should not be allowed to change credentials into such invalid state. This change brings the web logic and the AuthPlugin fallback in sync with the API which already used the stricter check. Change-Id: I4ff54fcc901f6fe11f15ed60fc1a3d8753de9f6c (cherry picked from commit d850025e603fc6f2bec3a80cdd17c027d8813341) --- M includes/Preferences.php M includes/auth/AuthManagerAuthPlugin.php M includes/specialpage/AuthManagerSpecialPage.php M includes/user/User.php 4 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/30/293230/1 diff --git a/includes/Preferences.php b/includes/Preferences.php index 9a55ae3..3083a8d 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -296,7 +296,7 @@ $allowPasswordChange = $wgDisableAuthManager ? $wgAuth->allowPasswordChange() : AuthManager::singleton()->allowsAuthenticationDataChange( - new PasswordAuthenticationRequest(), false ); + new PasswordAuthenticationRequest(), false )->isGood(); if ( $canEditPrivateInfo && $allowPasswordChange ) { $link = Linker::link( SpecialPage::getTitleFor( 'ChangePassword' ), $context->msg( 'prefs-resetpass' )->escaped(), [], diff --git a/includes/auth/AuthManagerAuthPlugin.php b/includes/auth/AuthManagerAuthPlugin.php index bf1e021..8d85b44 100644 --- a/includes/auth/AuthManagerAuthPlugin.php +++ b/includes/auth/AuthManagerAuthPlugin.php @@ -131,7 +131,7 @@ $reqs = AuthenticationRequest::loadRequestsFromSubmission( $reqs, $data ); foreach ( $reqs as $req ) { $status = AuthManager::singleton()->allowsAuthenticationDataChange( $req ); - if ( !$status->isOk() ) { + if ( !$status->isGood() ) { $this->logger->info( __METHOD__ . ': Password change rejected: {reason}', [ 'username' => $data['username'], 'reason' => $status->getWikiText( null, null, 'en' ), diff --git a/includes/specialpage/AuthManagerSpecialPage.php b/includes/specialpage/AuthManagerSpecialPage.php index 7866c12..41380f0 100644 --- a/includes/specialpage/AuthManagerSpecialPage.php +++ b/includes/specialpage/AuthManagerSpecialPage.php @@ -375,7 +375,7 @@ $req = reset( $requests ); $status = $authManager->allowsAuthenticationDataChange( $req ); Hooks::run( 'ChangeAuthenticationDataAudit', [ $req, $status ] ); - if ( !$status->isOK() ) { + if ( !$status->isGood() ) { return AuthenticationResponse::newFail( $status->getMessage() ); } $authManager->changeAuthenticationData( $req ); diff --git a/includes/user/User.php b/includes/user/User.php index 9e50f36..8ecf468 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -2569,7 +2569,7 @@ $reqs = AuthenticationRequest::loadRequestsFromSubmission( $reqs, $data ); foreach ( $reqs as $req ) { $status = $manager->allowsAuthenticationDataChange( $req ); - if ( !$status->isOk() ) { + if ( !$status->isGood() ) { \MediaWiki\Logger\LoggerFactory::getInstance( 'authentication' ) ->info( __METHOD__ . ': Password change rejected: ' . $status->getWikiText() ); return false; -- To view, visit https://gerrit.wikimedia.org/r/293230 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ff54fcc901f6fe11f15ed60fc1a3d8753de9f6c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.28.0-wmf.5 Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Enable AuthManager on group0 - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Enable AuthManager on group0 .. Enable AuthManager on group0 Bug: T135504 Change-Id: I1ec8750215033e92b78909bd247c306d84fb92ec --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index e521da5..5ec770f 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -86,6 +86,7 @@ 'wgDisableAuthManager' => [ 'default' => true, + 'group0' => false, 'labtestwiki' => false, ], -- To view, visit https://gerrit.wikimedia.org/r/293227 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1ec8750215033e92b78909bd247c306d84fb92ec Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Gergő TiszaGerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow multiple options for --ids - change (wikidata...rdf)
jenkins-bot has submitted this change and it was merged. Change subject: Allow multiple options for --ids .. Allow multiple options for --ids Change-Id: I3cc48bd91d20baa3aca951b39049f05c5d3f3b02 --- M tools/src/main/java/org/wikidata/query/rdf/tool/Update.java M tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java 2 files changed, 49 insertions(+), 9 deletions(-) Approvals: Smalyshev: Looks good to me, approved jenkins-bot: Verified diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java index d371632..3404b7c 100644 --- a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java +++ b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java @@ -9,6 +9,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashMap; @@ -70,9 +71,12 @@ @Option(shortName = "s", defaultToNull = true, description = "Start time in 2015-02-11T17:11:08Z or 20150211170100 format.") String start(); -@Option(defaultToNull = true, description = "If specified must be or -. Ids are iterated instead of recent " +@Option(defaultToNull = true, description = "If specified must be or list of , comma or space separated.") +List ids(); + +@Option(defaultToNull = true, description = "If specified must be -. Ids are iterated instead of recent " + "changes. Start and end are inclusive.") -String ids(); +String idrange(); @Option(shortName = "u", description = "URL to post updates and queries.") String sparqlUrl(); @@ -129,12 +133,8 @@ @SuppressWarnings("checkstyle:cyclomaticcomplexity") private static Change.Source buildChangeSource(Options options, RdfRepository rdfRepository, WikibaseRepository wikibaseRepository) { -if (options.ids() != null) { -if (options.ids().contains(",")) { -// Id list -return new IdListChangeSource(options.ids().split(","), options.batchSize()); -} -String[] ids = options.ids().split("-"); +if (options.idrange() != null) { +String[] ids = options.idrange().split("-"); long start; long end; switch (ids.length) { @@ -151,11 +151,23 @@ end = Long.parseLong(ids[1]); break; default: -log.error("Invalid format for --ids. Need -."); +log.error("Invalid format for --idrange. Need -."); return null; } return IdRangeChangeSource.forItems(start, end, options.batchSize()); } +if (options.ids() != null) { +List parsedIds = new ArrayList(); +for (String idOpt: options.ids()) { +if (idOpt.contains(",")) { +// Id list +parsedIds.addAll(Arrays.asList(idOpt.split(","))); +continue; +} +parsedIds.add(idOpt); +} +return new IdListChangeSource(parsedIds.toArray(new String[parsedIds.size()]), options.batchSize()); +} long startTime; if (options.start() != null) { try { diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java b/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java index 0adb611..fbcd267 100644 --- a/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java +++ b/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java @@ -267,6 +267,23 @@ } /** + * Delete entity from repository. + * @param entityId + * @throws RetryableException thrown if there is an error communicating with + * wikibase + */ +public void delete(String entityId) throws RetryableException { +URI uri = uris.delete(entityId); +log.debug("Deleting entity {} using {}", entityId, uri); +try { +JSONObject result = checkApi(getJson(postWithToken(uri))); +log.debug("Deleted: {}", result); +} catch (IOException | ParseException e) { +throw new RetryableException("Error deleting page", e); +} +} + +/** * Post with a csrf token. * * @throws IOException if its thrown while communicating with wikibase @@ -447,6 +464,17 @@ } /** + * Uri for deleting an entity. + * @param entityId Entity ID to delete + */ +public URI delete(String entityId) { +URIBuilder builder = apiBuilder(); +builder.addParameter("action",
[MediaWiki-commits] [Gerrit] Split flow into flow and wikimediaflow - change (mediawiki/vagrant)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/293229 Change subject: Split flow into flow and wikimediaflow .. Split flow into flow and wikimediaflow 'flow' is a more or less minimal Flow installation that doesn't use externalstore (for either core or Flow content). 'wikimediaflow' depends on 'flow' and adds additional dependencies that are useful when developers want a more production-like environment. WARNING: If you already had 'flow' installed, you will need to do one of: * Enable 'wikimediaflow' (if you care about existing Flow content) * Enable 'externalstore' (if you care about existint non-Flow content that is using External Store already). * Manually tweak configuration * Just ignore the problems with old content * Destroy and re-create your Vagrant However, future users using 'flow' will not be affected by External Store or other optional Flow dependencies. Bug: T133629 Bug: T136969 Change-Id: I9d4d74235ea4822e59ef766ad0de55726f8a5804 --- M puppet/modules/role/manifests/flow.pp A puppet/modules/role/manifests/wikimediaflow.pp M puppet/modules/role/templates/flow/conf.php.erb 3 files changed, 43 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/29/293229/1 diff --git a/puppet/modules/role/manifests/flow.pp b/puppet/modules/role/manifests/flow.pp index 81dda32..35f45bd 100644 --- a/puppet/modules/role/manifests/flow.pp +++ b/puppet/modules/role/manifests/flow.pp @@ -1,16 +1,10 @@ # == Class: role::flow # Configures Flow, a MediaWiki discussion system. class role::flow { -include ::role::antispam -include ::role::checkuser -include ::role::eventlogging -include ::role::externalstore include ::role::memcached include ::role::parserfunctions include ::role::parsoid include ::role::echo -include ::role::betafeatures -include ::role::varnish mediawiki::extension { 'Flow': needs_update => true, @@ -26,25 +20,6 @@ 'flow-create-board', ], } - -$privileged_username = 'Selenium Flow user' -mediawiki::user { $privileged_username: -password => $::mediawiki::admin_pass, -wiki => $::mediawiki::db_name, -groups => [ -'sysop', -'suppress', -'flow-creator', -], -} - -$regular_username = 'Selenium Flow user 2' -mediawiki::user { $regular_username: -password => $::mediawiki::admin_pass, -wiki => $::mediawiki::db_name, -} - -role::centralauth::migrate_user { [ $privileged_username, $regular_username ]: } file { '/etc/logrotate.d/mediawiki_Flow': source => 'puppet:///modules/role/flow/logrotate.d-mediawiki-Flow', diff --git a/puppet/modules/role/manifests/wikimediaflow.pp b/puppet/modules/role/manifests/wikimediaflow.pp new file mode 100644 index 000..e5d0d5a --- /dev/null +++ b/puppet/modules/role/manifests/wikimediaflow.pp @@ -0,0 +1,43 @@ +# -- Class: role::wikimediaflow +# Flow with a closer configuration to production +# Depends on role::flow +class role::wikimediaflow { +require ::role::flow + +include ::role::antispam +include ::role::checkuser +include ::role::cldr +include ::role::confirmedit +include ::role::eventlogging +include ::role::externalstore +include ::role::betafeatures +include ::role::varnish +include ::role::visualeditor + +$privileged_username = 'Selenium Flow user' +mediawiki::user { $privileged_username: +password => $::mediawiki::admin_pass, +wiki => $::mediawiki::db_name, +groups => [ +'sysop', +'suppress', +'flow-creator', +], +} + +$regular_username = 'Selenium Flow user 2' +mediawiki::user { $regular_username: +password => $::mediawiki::admin_pass, +wiki => $::mediawiki::db_name, +} + +role::centralauth::migrate_user { [ $privileged_username, $regular_username ]: } + +mediawiki::settings { 'Wikimedia Flow': +values => [ +'$wgDefaultUserOptions[\'flow-editor\'] = \'visualeditor\';', +'$wgFlowExternalStore = $wgDefaultExternalStore;', +], +priority => 25, # Load after Flow extension +} +} diff --git a/puppet/modules/role/templates/flow/conf.php.erb b/puppet/modules/role/templates/flow/conf.php.erb index 231f0b4..a72e9eb 100644 --- a/puppet/modules/role/templates/flow/conf.php.erb +++ b/puppet/modules/role/templates/flow/conf.php.erb @@ -26,4 +26,3 @@ $wgGroupPermissions['sysop']['flow-suppress'] = true; $wgDebugLogGroups['Flow'] = '/vagrant/logs/mediawiki-Flow.log'; -$wgFlowExternalStore = $wgDefaultExternalStore; -- To view, visit https://gerrit.wikimedia.org/r/293229 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange
[MediaWiki-commits] [Gerrit] Put interwiki search results after local results - change (mediawiki/core)
EBernhardson has uploaded a new change for review. https://gerrit.wikimedia.org/r/293228 Change subject: Put interwiki search results after local results .. Put interwiki search results after local results When showing both local and interwiki results both sets of results end up being floated left. This means that on certain screen sizes the results are shown side by side rather than one above the other. Fix that by making the interwiki header clear: both. Change-Id: Ife0df1fd2020b0b8b28e1ec9e6c58bbc23906573 --- M resources/src/mediawiki.special/mediawiki.special.search.styles.css 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/28/293228/1 diff --git a/resources/src/mediawiki.special/mediawiki.special.search.styles.css b/resources/src/mediawiki.special/mediawiki.special.search.styles.css index 26c500d..da356b1 100644 --- a/resources/src/mediawiki.special/mediawiki.special.search.styles.css +++ b/resources/src/mediawiki.special/mediawiki.special.search.styles.css @@ -35,6 +35,9 @@ margin-left: 0; float: left; } +.mw-search-interwiki-header { + clear: both; +} .mw-search-results li { padding-bottom: 1.2em; list-style: none; -- To view, visit https://gerrit.wikimedia.org/r/293228 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife0df1fd2020b0b8b28e1ec9e6c58bbc23906573 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: EBernhardson___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Enable AuthManager on group0 - change (operations/mediawiki-config)
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/293227 Change subject: Enable AuthManager on group0 .. Enable AuthManager on group0 Bug: T135504 Change-Id: I1ec8750215033e92b78909bd247c306d84fb92ec --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/27/293227/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index e521da5..5ec770f 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -86,6 +86,7 @@ 'wgDisableAuthManager' => [ 'default' => true, + 'group0' => false, 'labtestwiki' => false, ], -- To view, visit https://gerrit.wikimedia.org/r/293227 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1ec8750215033e92b78909bd247c306d84fb92ec Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] DHCP: Add MAC address entries for mw2215-mw2238 skipping mw2... - change (operations/puppet)
Dzahn has submitted this change and it was merged. Change subject: DHCP: Add MAC address entries for mw2215-mw2238 skipping mw2218 Bug:T135466 .. DHCP: Add MAC address entries for mw2215-mw2238 skipping mw2218 Bug:T135466 Change-Id: I1f42fd235a60abe4c4c0b8f8be95bd417a4e2c46 --- M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 1 file changed, 115 insertions(+), 0 deletions(-) Approvals: jenkins-bot: Verified Dzahn: Looks good to me, approved diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 index 578c4bc..19474df 100644 --- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 +++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 @@ -5829,6 +5829,121 @@ fixed-address mw2214.codfw.wmnet; } +host mw2215 { +hardware ethernet 14:18:77:69:BE:8D; +fixed-address mw2215.codfw.wmnet; +} + +host mw2216 { +hardware ethernet 14:18:77:6A:00:C8; +fixed-address mw2216.codfw.wmnet; +} + +host mw2217 { +hardware ethernet 14:18:77:6A:16:C7; +fixed-address mw2217.codfw.wmnet; +} + +host mw2219 { +hardware ethernet 14:18:77:6A:1C:51; +fixed-address mw2219.codfw.wmnet; +} + +host mw2220 { +hardware ethernet 14:18:77:6A:28:B6; +fixed-address mw2220.codfw.wmnet; +} + +host mw2221 { +hardware ethernet 14:18:77:6A:0F:F8; +fixed-address mw2221.codfw.wmnet; +} + +host mw { +hardware ethernet 14:18:77:69:D3:EF; +fixed-address mw.codfw.wmnet; +} + +host mw2223 { +hardware ethernet 14:18:77:6A:04:19; +fixed-address mw2223.codfw.wmnet; +} + +host mw2224 { +hardware ethernet 14:18:77:69:D0:6A; +fixed-address mw2224.codfw.wmnet; +} + +host mw2225 { +hardware ethernet 14:18:77:69:D2:77; +fixed-address mw2225.codfw.wmnet; +} + +host mw2226 { +hardware ethernet 14:18:77:69:BD:98; +fixed-address mw2226.codfw.wmnet; +} + +host mw2227 { +hardware ethernet 14:18:77:6A:24:BE; +fixed-address mw2227.codfw.wmnet; +} + +host mw2228 { +hardware ethernet 14:18:77:6A:29:7C; +fixed-address mw2228.codfw.wmnet; +} + +host mw2229 { +hardware ethernet 14:18:77:69:BD:CE; +fixed-address mw2229.codfw.wmnet; +} + +host mw2230 { +hardware ethernet 14:18:77:69:CD:44; +fixed-address mw2230.codfw.wmnet; +} + +host mw2231 { +hardware ethernet 14:18:77:6A:38:C6; +fixed-address mw2231.codfw.wmnet; +} + +host mw2232 { +hardware ethernet 14:18:77:66:65:43; +fixed-address mw2232.codfw.wmnet; +} + +host mw2233 { +hardware ethernet 14:18:77:6A:1E:78; +fixed-address mw2233.codfw.wmnet; +} + +host mw2234 { +hardware ethernet 14:18:77:6A:0D:DC; +fixed-address mw2234.codfw.wmnet; +} + +host mw2235 { +hardware ethernet 14:18:77:6A:18:0A; +fixed-address mw2235.codfw.wmnet; +} + +host mw2236 { +hardware ethernet 14:18:77:6A:15:A1; +fixed-address mw2236.codfw.wmnet; +} + +host mw2237 { +hardware ethernet 14:18:77:6A:1A:CE; +fixed-address mw2237.codfw.wmnet; +} + +host mw2238 { +hardware ethernet 14:18:77:69:F5:06; +fixed-address mw2238.codfw.wmnet; +} + host neodymium { hardware ethernet 90:B1:1C:2D:79:8C; fixed-address neodymium.eqiad.wmnet; -- To view, visit https://gerrit.wikimedia.org/r/293218 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f42fd235a60abe4c4c0b8f8be95bd417a4e2c46 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: PapaulGerrit-Reviewer: Dzahn Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] new role: pageassessments - change (mediawiki/vagrant)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/293226 Change subject: new role: pageassessments .. new role: pageassessments Change-Id: I13316feb0752faed79fd9581357a7af8dcd8d5cd --- A puppet/modules/role/manifests/pageassessments.pp 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/26/293226/1 diff --git a/puppet/modules/role/manifests/pageassessments.pp b/puppet/modules/role/manifests/pageassessments.pp new file mode 100644 index 000..b603a08 --- /dev/null +++ b/puppet/modules/role/manifests/pageassessments.pp @@ -0,0 +1,10 @@ +# == Class: role::pageassessments +# This extension is for the purposes of storing article assessments (for +# WikiProjects) in a new database table. +# +class role::pageassessments { +mediawiki::extension { 'PageAssessments': +needs_update => true, +} +} + -- To view, visit https://gerrit.wikimedia.org/r/293226 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13316feb0752faed79fd9581357a7af8dcd8d5cd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: BryanDavis___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Hygiene: refactor code around triggering hovercards - change (mediawiki...Popups)
Bmansurov has uploaded a new change for review. https://gerrit.wikimedia.org/r/293224 Change subject: Hygiene: refactor code around triggering hovercards .. Hygiene: refactor code around triggering hovercards Move two functions to the files where they are used and make make private. Change-Id: I7f0cf3421977daf49d6836d2b1edf646ee1bcde1 --- M Popups.hooks.php M resources/ext.popups.core.js M resources/ext.popups.targets/desktopTarget.js M resources/ext.popups.targets/mobileTarget.js M tests/qunit/ext.popups.core.test.js A tests/qunit/ext.popups.targets/desktopTarget.test.js 6 files changed, 85 insertions(+), 108 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/24/293224/1 diff --git a/Popups.hooks.php b/Popups.hooks.php index c81db91..90f1f37 100644 --- a/Popups.hooks.php +++ b/Popups.hooks.php @@ -229,6 +229,7 @@ 'scripts' => array( 'tests/qunit/ext.popups.renderer/desktopRenderer.test.js', 'tests/qunit/ext.popups.renderer.article.test.js', + 'tests/qunit/ext.popups.targets/desktopTarget.test.js', 'tests/qunit/ext.popups.core.test.js', 'tests/qunit/ext.popups.schemaPopups.utils.test.js', 'tests/qunit/ext.popups.settings.test.js', diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js index 28a941b..a42df0c 100644 --- a/resources/ext.popups.core.js +++ b/resources/ext.popups.core.js @@ -36,49 +36,6 @@ ]; /** -* Temporarily remove the title attribute of the links so that -* the yellow tooltips don't show up alongside the Hovercard. -* -* @method removeTooltips -*/ - mw.popups.removeTooltips = function ( $elements ) { - $elements - .filter( '[title]:not([title=""])' ) - .on( 'mouseenter focus', function () { - // We shouldn't empty the title attribute of links that - // can't have Hovercards, ie. TextExtracts didn't return - // anything. Its set in the article.init after attempting - // to make an API request. - if ( $( this ).data( 'dont-empty-title' ) !== true ) { - $( this ) - .data( 'title', $( this ).attr( 'title' ) ) - .attr( 'title', '' ); - } - } ) - .on( 'mouseleave blur', function () { - $( this ) - .attr( 'title', $( this ).data( 'title' ) ); - } ); - }; - - /** -* Register a hover event that may render a popup on an appropriate link. -* -* @method setupTriggers -* @param {jQuery.Object} $elements to bind events to -* @param {string} events to bind to -*/ - mw.popups.setupTriggers = function ( $elements, events ) { - $elements.on( events, function ( event ) { - if ( mw.popups.scrolled ) { - return; - } - - mw.popups.render.render( $( this ), event, mw.now(), mw.popups.getRandomToken() ); - } ); - }; - - /** * Given an href string for the local wiki, return the title, or undefined if * the link is external, has extra query parameters, or contains no title. * diff --git a/resources/ext.popups.targets/desktopTarget.js b/resources/ext.popups.targets/desktopTarget.js index 29ebb5a..e1ed780 100644 --- a/resources/ext.popups.targets/desktopTarget.js +++ b/resources/ext.popups.targets/desktopTarget.js @@ -1,4 +1,32 @@ ( function ( $, mw ) { + + /** +* Temporarily remove the title attribute of the links so that +* the yellow tooltips don't show up alongside the Hovercard. +* +* @method removeTooltips +* @param {jQuery.Object} $elements elements for which to remove tooltips +*/ + function removeTooltips( $elements ) { + $elements + .filter( '[title]:not([title=""])' ) + .on( 'mouseenter focus', function () { + // We shouldn't empty the title attribute of links that + // can't have Hovercards, ie. TextExtracts didn't return + // anything. Its set in the article.init after attempting + // to make an API request. +
[MediaWiki-commits] [Gerrit] ores: Add support for Norwegian - change (operations/puppet)
Ladsgroup has uploaded a new change for review. https://gerrit.wikimedia.org/r/293225 Change subject: ores: Add support for Norwegian .. ores: Add support for Norwegian Change-Id: Iaf8533802e3318a0234874d7a7991738bc94fb17 --- M modules/ores/manifests/base.pp 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/25/293225/1 diff --git a/modules/ores/manifests/base.pp b/modules/ores/manifests/base.pp index 059e155..fce0a68 100644 --- a/modules/ores/manifests/base.pp +++ b/modules/ores/manifests/base.pp @@ -28,6 +28,7 @@ 'myspell-he', 'myspell-hu', 'myspell-it', +'myspell-nb', 'myspell-nl', 'myspell-pt', 'myspell-ru', -- To view, visit https://gerrit.wikimedia.org/r/293225 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf8533802e3318a0234874d7a7991738bc94fb17 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ladsgroup___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] role::toollabs::merlbot_proxy - change (operations/puppet)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/293223 Change subject: role::toollabs::merlbot_proxy .. role::toollabs::merlbot_proxy Role to provision an nginx server acting as an HTTP -> HTTPS reverse proxy. This is a temporary solution for issues with MerlBot and the impending closure of the HTTP POST loophole. Bug: T137235 Change-Id: Id49c79d524654b409cc991634effb473b38fb78b --- A modules/role/manifests/toollabs/merlbot_proxy.pp A modules/role/templates/toollabs/merlbot_proxy/nginx.conf.erb 2 files changed, 58 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/23/293223/1 diff --git a/modules/role/manifests/toollabs/merlbot_proxy.pp b/modules/role/manifests/toollabs/merlbot_proxy.pp new file mode 100644 index 000..ef34326 --- /dev/null +++ b/modules/role/manifests/toollabs/merlbot_proxy.pp @@ -0,0 +1,12 @@ +# Class: role::toollabs::merlbot_proxy +# +# Provision an nginx server acting as an HTTP -> HTTPS reverse proxy. +# +class role::toollabs::merlbot_proxy() { +class { '::nginx': +variant => 'light', +} +nginx::site { 'merlbot_proxy': +content => template('role/toollabs/merlbot_proxy/nginx.conf.erb'), +} +} diff --git a/modules/role/templates/toollabs/merlbot_proxy/nginx.conf.erb b/modules/role/templates/toollabs/merlbot_proxy/nginx.conf.erb new file mode 100644 index 000..6f55570 --- /dev/null +++ b/modules/role/templates/toollabs/merlbot_proxy/nginx.conf.erb @@ -0,0 +1,46 @@ +# This file is managed by Puppet +# See modules/role/templates/toollabs/merlbot_proxy/nginx.conf.erb +## +# HTTP to HTTPS reverse proxy +# +# Copyright (c) 2016 Bryan Davis and the Wikimedia Foundation +# License: Apache-2.0 +## + +# Respect XFF headers set by the Labs proxy +real_ip_header X-Forwarded-For; +set_real_ip_from 10.68.21.68; + +server { +listen 80 default_server; +listen [::]:80 default_server; +server_name _; + +location / { +# Access control +# We only want to allow requests from internal Labs hosts. +# Ideally we would only allow Tool Labs exec nodes, but there +# is no easy way to find those by IP. +deny 10.68.21.68;# IP we see if XFF unwrapping didn't work +allow 10.68.16.0/21; # All of Labs +allow 127.0.0.1; +deny all; + +# Use these DNS servers to resolve proxied names +resolver <%= scope['::nameservers'].join(' ') %>; + +# Act as a non-caching reverse proxy +proxy_http_version 1.1; +proxy_cache_bypass "1"; +proxy_no_cache "1"; +proxy_read_timeout 600s; +proxy_redirect off; + +# Change the protocol to https when contacting upstream +proxy_pass https://$host$uri; + +# Add a header just to remind folks that this is proxied +add_header Labs-TLS-Bandaid "on"; +} +} +# vim:sw=4:ts=4:sts=4:et:ft=nginx: -- To view, visit https://gerrit.wikimedia.org/r/293223 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id49c79d524654b409cc991634effb473b38fb78b Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BryanDavis___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Hygiene: extremely light clean up - change (apps...wikipedia)
jenkins-bot has submitted this change and it was merged. Change subject: Hygiene: extremely light clean up .. Hygiene: extremely light clean up • Replace deprecated method call. • Add missing @Override. • Remove unused namespace. No functional changes intended. Change-Id: Ieb8d172269f5f721f45823d53d9f1f4a13669e4c --- M app/src/main/java/org/wikipedia/login/authmanager/AMLoginTask.java M app/src/main/java/org/wikipedia/page/PageActivity.java M app/src/main/res/layout/item_gallery_thumbnail.xml 3 files changed, 54 insertions(+), 54 deletions(-) Approvals: Mholloway: Looks good to me, approved jenkins-bot: Verified diff --git a/app/src/main/java/org/wikipedia/login/authmanager/AMLoginTask.java b/app/src/main/java/org/wikipedia/login/authmanager/AMLoginTask.java index 8a01bdd..a4f1d3c 100644 --- a/app/src/main/java/org/wikipedia/login/authmanager/AMLoginTask.java +++ b/app/src/main/java/org/wikipedia/login/authmanager/AMLoginTask.java @@ -21,7 +21,7 @@ this.password = password; } -public RequestBuilder buildRequest(Api api) { +@Override public RequestBuilder buildRequest(Api api) { // HACK: T124384 WikipediaApp.getInstance().getEditTokenStorage().clearAllTokens(); diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java b/app/src/main/java/org/wikipedia/page/PageActivity.java index 1fa1bc8..aa17648 100644 --- a/app/src/main/java/org/wikipedia/page/PageActivity.java +++ b/app/src/main/java/org/wikipedia/page/PageActivity.java @@ -1,12 +1,58 @@ package org.wikipedia.page; +import android.annotation.TargetApi; +import android.app.SearchManager; +import android.appwidget.AppWidgetManager; +import android.content.ComponentName; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.res.Configuration; +import android.location.Location; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.design.widget.BottomSheetDialog; +import android.support.design.widget.BottomSheetDialogFragment; +import android.support.design.widget.NavigationView; +import android.support.design.widget.Snackbar; +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentTransaction; +import android.support.v4.content.ContextCompat; +import android.support.v4.view.GravityCompat; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBarDrawerToggle; +import android.support.v7.app.AlertDialog; +import android.support.v7.preference.PreferenceManager; +import android.support.v7.view.ActionMode; +import android.support.v7.widget.Toolbar; +import android.text.Html; +import android.text.TextUtils; +import android.text.format.DateUtils; +import android.view.KeyEvent; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.WindowManager; +import android.widget.ProgressBar; +import android.widget.TextView; + +import com.squareup.otto.Bus; +import com.squareup.otto.Subscribe; + +import net.hockeyapp.android.metrics.MetricsManager; + import org.wikipedia.BackPressedHandler; import org.wikipedia.R; import org.wikipedia.Site; -import org.wikipedia.activity.ActivityUtil; -import org.wikipedia.activity.ThemedActionBarActivity; import org.wikipedia.ViewAnimations; import org.wikipedia.WikipediaApp; +import org.wikipedia.activity.ActivityUtil; +import org.wikipedia.activity.ThemedActionBarActivity; import org.wikipedia.analytics.IntentFunnel; import org.wikipedia.analytics.ReadingListsFunnel; import org.wikipedia.analytics.WikipediaZeroUsageFunnel; @@ -38,53 +84,8 @@ import org.wikipedia.widgets.WidgetProviderFeaturedPage; import org.wikipedia.zero.ZeroConfig; -import com.squareup.otto.Bus; -import com.squareup.otto.Subscribe; - -import android.annotation.TargetApi; -import android.app.SearchManager; -import android.appwidget.AppWidgetManager; -import android.content.ComponentName; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.res.Configuration; -import android.location.Location; -import android.net.Uri; -import android.os.Build; -import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.design.widget.BottomSheetDialog; -import android.support.design.widget.BottomSheetDialogFragment; -import android.support.design.widget.NavigationView; -import android.support.design.widget.Snackbar; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; -import
[MediaWiki-commits] [Gerrit] Support certificate authentication - change (mediawiki...DonationInterface)
jenkins-bot has submitted this change and it was merged. Change subject: Support certificate authentication .. Support certificate authentication Bug: T136743 Change-Id: I3a4817f76ffab6d83f1e3dfe666e1e39e9bdde8b --- M DonationInterface.php M gateway_common/gateway.adapter.php M paypal_gateway/express_checkout/paypal_express.adapter.php 3 files changed, 77 insertions(+), 23 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/DonationInterface.php b/DonationInterface.php index a7f8a0c..f3feaf6 100644 --- a/DonationInterface.php +++ b/DonationInterface.php @@ -411,23 +411,32 @@ $wgPaypalGatewayXclickCountries = array(); +# Example PayPal Express Checkout account: +# +# $wgPaypalExpressGatewayAccountInfo['test'] = array( +# 'User' => 'abc', +# 'Password' => '12345', +# +# // Use either certificate (preferred) OR signature authentication: +# // 'Signature' => 'or 123123123', +# 'CertificatePath' => '/absolute path to cert_key_pem.txt', +# +# // TODO: Use parameter substitution. +# 'RedirectURL' => 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout=commit=', +# ); + +# Example legacy PayPal # $wgPaypalGatewayAccountInfo['example'] = array( # 'AccountEmail' => "", # ); -$wgPaypalExpressGatewayAccountInfo['test'] = array( - //'User' => 'abc', - //'Password' => '12345', - //'Signature' => 'or 123123123', - //TODO: credential authentication is not supported, yet. - //XXX 'Credential' => '123123123123', #OR - // TODO: Use parameter substitution. - 'RedirectURL' => 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout=commit=', -); -# FIXME: These are only for signature authentication. # https://developer.paypal.com/docs/classic/api/endpoints/ -$wgPaypalExpressGatewayURL = 'https://api-3t.paypal.com/nvp'; -$wgPaypalExpressGatewayTestingURL = 'https://api-3t.sandbox.paypal.com/nvp'; +# TODO: Move to configuration. +# We use different URLs depending on: authentication method and testingness. +$wgPaypalExpressGatewayCertificateURL = 'https://api.paypal.com/nvp'; +$wgPaypalExpressGatewaySignatureURL = 'https://api-3t.paypal.com/nvp'; +$wgPaypalExpressGatewayTestingCertificateURL = 'https://api.sandbox.paypal.com/nvp'; +$wgPaypalExpressGatewayTestingSignatureURL = 'https://api-3t.sandbox.paypal.com/nvp'; $wgAdyenGatewayURL = 'https://live.adyen.com'; $wgAdyenGatewayTestingURL = 'https://test.adyen.com'; diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index f87773d..f69f8db 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -1882,6 +1882,11 @@ } } + /** +* Build the parameters sent with the next request. +* +* @return array Parameters as a map. +*/ protected function buildRequestParams() { // Look up the request structure for our current transaction type in the transactions array $structure = $this->getTransactionRequestStructure(); diff --git a/paypal_gateway/express_checkout/paypal_express.adapter.php b/paypal_gateway/express_checkout/paypal_express.adapter.php index 1add90f..e7e7099 100644 --- a/paypal_gateway/express_checkout/paypal_express.adapter.php +++ b/paypal_gateway/express_checkout/paypal_express.adapter.php @@ -19,10 +19,36 @@ const IDENTIFIER = 'paypal_ec'; const GLOBAL_PREFIX = 'wgPaypalExpressGateway'; - const API_VERSION = 124; + // https://developer.paypal.com/docs/classic/release-notes/#ec + const API_VERSION = 204; public function getCommunicationType() { return 'namevalue'; + } + + /** +* @return true if the adapter is configured for SSL client certificate +* authentication. +*/ + protected function isCertificateAuthentication() { + return isset( $this->account_config['CertificatePath'] ); + } + + protected function getCommunicationUrl() { + if ( !self::getGlobal( 'Test' ) ) { + if ( $this->isCertificateAuthentication() ) { + $url = self::getGlobal( 'CertificateURL' ); + } else { + $url = self::getGlobal( 'SignatureURL' ); + } + } else { + if ( $this->isCertificateAuthentication() ) { + $url = self::getGlobal( 'TestingCertificateURL' ); + } else { + $url = self::getGlobal( 'TestingSignatureURL' ); + } + } + return $url; } public function getResponseType() { @@ -55,6 +81,17 @@ } function
[MediaWiki-commits] [Gerrit] Copy from DOM instead of using vector-view-edit - change (mediawiki...GuidedTour)
jenkins-bot has submitted this change and it was merged. Change subject: Copy from DOM instead of using vector-view-edit .. Copy from DOM instead of using vector-view-edit This solves a CI issue with message dependencies. Bug: T132989 Change-Id: I4b355214dd0480d803e3882cfa29636d4cf4c9c4 --- M extension.json M i18n/en.json M modules/tours/firstedit.js M modules/tours/firsteditve.js 4 files changed, 6 insertions(+), 5 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index 02c27a1..9e246fe 100644 --- a/extension.json +++ b/extension.json @@ -93,7 +93,6 @@ "editsection", "savearticle", "showpreview", - "vector-view-edit", "guidedtour-tour-firstedit-edit-page-title", "guidedtour-tour-firstedit-edit-page-description", "guidedtour-tour-firstedit-edit-section-title", @@ -109,7 +108,6 @@ "dependencies": "ext.guidedTour", "messages": [ "editsection", - "vector-view-edit", "visualeditor-toolbar-savedialog", "guidedtour-tour-firstedit-edit-page-title", "guidedtour-tour-firsteditve-edit-page-description", diff --git a/i18n/en.json b/i18n/en.json index 64692a3..d45cfcc 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -24,7 +24,7 @@ "guidedtour-tour-test-launch-tour-description": "Guiders can launch other guided tours. Pretty cool, huh?", "guidedtour-tour-test-launch-using-tours": "Launch a tour on using tours", "guidedtour-tour-firstedit-edit-page-title": "{{GENDER:|Edit}} the whole page…", - "guidedtour-tour-firstedit-edit-page-description": "{{GENDER:|Click}} the \"{{int:vector-view-edit}}\" button to make your changes.", + "guidedtour-tour-firstedit-edit-page-description": "{{GENDER:|Click}} the \"$1\" button to make your changes.", "guidedtour-tour-firstedit-edit-section-title": "Or {{GENDER:|edit}} a section", "guidedtour-tour-firstedit-edit-section-description": "There are \"{{int:editsection}}\" links for each major section in a page, so you can focus on just that part.", "guidedtour-tour-firstedit-preview-title": "{{GENDER:|Preview}} your changes (optional)", diff --git a/modules/tours/firstedit.js b/modules/tours/firstedit.js index 870f3f7..622a4a7 100644 --- a/modules/tours/firstedit.js +++ b/modules/tours/firstedit.js @@ -26,7 +26,10 @@ tour.firstStep( { name: 'intro', titlemsg: 'guidedtour-tour-firstedit-edit-page-title', - descriptionmsg: 'guidedtour-tour-firstedit-edit-page-description', + description: mw.message( + 'guidedtour-tour-firstedit-edit-page-description', + $( '#ca-edit a' ).text() + ).parse(), attachTo: '#ca-edit', position: 'bottom', allowAutomaticNext: false, diff --git a/modules/tours/firsteditve.js b/modules/tours/firsteditve.js index beda919..c1a17d4 100644 --- a/modules/tours/firsteditve.js +++ b/modules/tours/firsteditve.js @@ -41,7 +41,7 @@ editPageDescription = mw.message( 'guidedtour-tour-firsteditve-edit-page-description', - mw.message( 'vector-view-edit' ).parse() + $( '#ca-edit a' ).text() ).parse(); editSectionDescription = mw.message( -- To view, visit https://gerrit.wikimedia.org/r/293159 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4b355214dd0480d803e3882cfa29636d4cf4c9c4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GuidedTour Gerrit-Branch: master Gerrit-Owner: MattflaschenGerrit-Reviewer: Catrope Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Phuedx Gerrit-Reviewer: Siebrand Gerrit-Reviewer: Swalling Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow multiple options for --ids - change (wikidata...rdf)
Smalyshev has uploaded a new change for review. https://gerrit.wikimedia.org/r/293222 Change subject: Allow multiple options for --ids .. Allow multiple options for --ids Change-Id: I3cc48bd91d20baa3aca951b39049f05c5d3f3b02 --- M tools/src/main/java/org/wikidata/query/rdf/tool/Update.java M tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java 2 files changed, 49 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/rdf refs/changes/22/293222/1 diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java index d371632..3404b7c 100644 --- a/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java +++ b/tools/src/main/java/org/wikidata/query/rdf/tool/Update.java @@ -9,6 +9,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashMap; @@ -70,9 +71,12 @@ @Option(shortName = "s", defaultToNull = true, description = "Start time in 2015-02-11T17:11:08Z or 20150211170100 format.") String start(); -@Option(defaultToNull = true, description = "If specified must be or -. Ids are iterated instead of recent " +@Option(defaultToNull = true, description = "If specified must be or list of , comma or space separated.") +List ids(); + +@Option(defaultToNull = true, description = "If specified must be -. Ids are iterated instead of recent " + "changes. Start and end are inclusive.") -String ids(); +String idrange(); @Option(shortName = "u", description = "URL to post updates and queries.") String sparqlUrl(); @@ -129,12 +133,8 @@ @SuppressWarnings("checkstyle:cyclomaticcomplexity") private static Change.Source buildChangeSource(Options options, RdfRepository rdfRepository, WikibaseRepository wikibaseRepository) { -if (options.ids() != null) { -if (options.ids().contains(",")) { -// Id list -return new IdListChangeSource(options.ids().split(","), options.batchSize()); -} -String[] ids = options.ids().split("-"); +if (options.idrange() != null) { +String[] ids = options.idrange().split("-"); long start; long end; switch (ids.length) { @@ -151,11 +151,23 @@ end = Long.parseLong(ids[1]); break; default: -log.error("Invalid format for --ids. Need -."); +log.error("Invalid format for --idrange. Need -."); return null; } return IdRangeChangeSource.forItems(start, end, options.batchSize()); } +if (options.ids() != null) { +List parsedIds = new ArrayList(); +for (String idOpt: options.ids()) { +if (idOpt.contains(",")) { +// Id list +parsedIds.addAll(Arrays.asList(idOpt.split(","))); +continue; +} +parsedIds.add(idOpt); +} +return new IdListChangeSource(parsedIds.toArray(new String[parsedIds.size()]), options.batchSize()); +} long startTime; if (options.start() != null) { try { diff --git a/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java b/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java index 0adb611..fbcd267 100644 --- a/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java +++ b/tools/src/main/java/org/wikidata/query/rdf/tool/wikibase/WikibaseRepository.java @@ -267,6 +267,23 @@ } /** + * Delete entity from repository. + * @param entityId + * @throws RetryableException thrown if there is an error communicating with + * wikibase + */ +public void delete(String entityId) throws RetryableException { +URI uri = uris.delete(entityId); +log.debug("Deleting entity {} using {}", entityId, uri); +try { +JSONObject result = checkApi(getJson(postWithToken(uri))); +log.debug("Deleted: {}", result); +} catch (IOException | ParseException e) { +throw new RetryableException("Error deleting page", e); +} +} + +/** * Post with a csrf token. * * @throws IOException if its thrown while communicating with wikibase @@ -447,6 +464,17 @@ } /** + * Uri for deleting an entity. + * @param entityId Entity ID to delete + */ +public URI delete(String entityId) { +URIBuilder builder = apiBuilder(); +
[MediaWiki-commits] [Gerrit] git.wikimedia.org -> Diffusion redirects - change (operations/puppet)
Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/293221 Change subject: git.wikimedia.org -> Diffusion redirects .. git.wikimedia.org -> Diffusion redirects Bug:T137224 Change-Id: Ide401ee9526995bcc23e8e8f2ddfde9818161a34 --- M modules/mediawiki/files/apache/sites/redirects/redirects.dat 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/21/293221/1 diff --git a/modules/mediawiki/files/apache/sites/redirects/redirects.dat b/modules/mediawiki/files/apache/sites/redirects/redirects.dat index c03d135..da971be 100644 --- a/modules/mediawiki/files/apache/sites/redirects/redirects.dat +++ b/modules/mediawiki/files/apache/sites/redirects/redirects.dat @@ -117,7 +117,6 @@ override education.wikimedia.org/illustrating //commons.wikimedia.org/wiki/File:Illustrating_Wikipedia_brochure.pdf override education.wikimedia.org/casestudies //outreach.wikimedia.org/wiki/Education/Case_Studies - override education.wikimedia.org/content //outreach.wikimedia.org/wiki/Education/Case_Studies/content override education.wikimedia.org/copyediting //outreach.wikimedia.org/wiki/Education/Case_Studies/copyediting override education.wikimedia.org/definitions //outreach.wikimedia.org/wiki/Education/Case_Studies/definitions @@ -139,6 +138,12 @@ funnel education.wikimedia.org //outreach.wikimedia.org/wiki/Special:MyLanguage/Education +# git.wikimedia.org -> Diffusion/Phabricator (T137224, T111465) +overridegit.wikimedia.org/repositories //phabricator.wikimedia.org/diffusion/query/all/ + +# if none of the specific rules match we send people to Diffusion main page +funnel git.wikimedia.org/summary //phabricator.wikimedia.org/diffusion/ + # Localised TLDs rewrite*wikinews.de//de.wikinews.org -- To view, visit https://gerrit.wikimedia.org/r/293221 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide401ee9526995bcc23e8e8f2ddfde9818161a34 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Dzahn___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adding full stop to end of comment. - change (mediawiki...PageAssessments)
MusikAnimal has uploaded a new change for review. https://gerrit.wikimedia.org/r/293220 Change subject: Adding full stop to end of comment. .. Adding full stop to end of comment. This commit is only to test gerrit intergration. Does not need to be merged Change-Id: I57ee43e63c1e978868cf1a3e96df8cdef81cd633 --- M api/ApiQueryProjectPages.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageAssessments refs/changes/20/293220/1 diff --git a/api/ApiQueryProjectPages.php b/api/ApiQueryProjectPages.php index edb44a5..d9b41bd 100644 --- a/api/ApiQueryProjectPages.php +++ b/api/ApiQueryProjectPages.php @@ -54,7 +54,7 @@ break; } - // Change project id back into its corresponding project title + // Change project id back into its corresponding project title. $projectTitle = $row->project_name; if ( !$projectTitle ) { continue; -- To view, visit https://gerrit.wikimedia.org/r/293220 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I57ee43e63c1e978868cf1a3e96df8cdef81cd633 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/PageAssessments Gerrit-Branch: master Gerrit-Owner: MusikAnimal___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Wrap gateway URL in an accessor function and clean up redire... - change (mediawiki...DonationInterface)
jenkins-bot has submitted this change and it was merged. Change subject: Wrap gateway URL in an accessor function and clean up redirect logic .. Wrap gateway URL in an accessor function and clean up redirect logic Wrapping makes it simple to override when a gateway requires e.g. different URLs depending on flags or API call. Redirects include parameters now, which is usually what we want. Bug: T136743 Change-Id: Ib2865d971baac57b3b6b5e53bd8f060e52171477 --- M adyen_gateway/adyen.adapter.php M gateway_common/gateway.adapter.php M paypal_gateway/legacy/paypal_legacy.adapter.php M worldpay_gateway/worldpay.adapter.php 4 files changed, 31 insertions(+), 30 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/adyen_gateway/adyen.adapter.php b/adyen_gateway/adyen.adapter.php index fe8d623..a5b23bc 100644 --- a/adyen_gateway/adyen.adapter.php +++ b/adyen_gateway/adyen.adapter.php @@ -193,7 +193,7 @@ switch ( $transaction ) { case 'donate': - $formaction = $this->url . '/hpp/pay.shtml'; + $formaction = $this->getProcessorUrl() . '/hpp/pay.shtml'; // Run API call hooks here because we don't cURL anything $this->runApiCallHooks(); $this->runAntifraudHooks(); diff --git a/gateway_common/gateway.adapter.php b/gateway_common/gateway.adapter.php index 2b8394e..f87773d 100644 --- a/gateway_common/gateway.adapter.php +++ b/gateway_common/gateway.adapter.php @@ -83,7 +83,6 @@ protected $account_name; protected $account_config; protected $accountInfo; - protected $url; protected $transactions; /** @@ -244,12 +243,6 @@ $this->logger->info( "Creating a new adapter of type: [{$this->getGatewayName()}]" ); - if ( !self::getGlobal( 'Test' ) ) { - $this->url = self::getGlobal( 'URL' ); - } else { - $this->url = self::getGlobal( 'TestingURL' ); - } - // so we know we can skip all the visual stuff. if ( $options['api_request'] ) { $this->setApiRequest(); @@ -320,6 +313,22 @@ return $this->config[$key]; } return null; + } + + /** +* Return the base URL to use for the current transaction. +* +* Some adapters will append a path component and query parameters. +* That variation should be handled by the request controller. Customize +* things like varying server endpoints by overriding this function. +*/ + protected function getProcessorUrl() { + if ( !self::getGlobal( 'Test' ) ) { + $url = self::getGlobal( 'URL' ); + } else { + $url = self::getGlobal( 'TestingURL' ); + } + return $url; } // For legacy support. @@ -1028,7 +1037,17 @@ $this->session_pushFormName( $this->getData_Unstaged_Escaped( 'ffname' ) ); $this->transaction_response->setCommunicationStatus( true ); - $this->transaction_response->setRedirect( $this->url ); + + // Build the redirect URL. + $redirectUrl = $this->getProcessorUrl(); + $redirectParams = $this->buildRequestParams(); + if ( $redirectParams ) { + // Add GET parameters, if provided. + $redirectUrl .= '?' . http_build_query( $redirectParams ); + } + + $this->transaction_response->setRedirect( $redirectUrl ); + return $this->transaction_response; } elseif ( $commType === 'xml' ) { @@ -1161,7 +1180,7 @@ $path = ''; } $opts = array( - CURLOPT_URL => $this->url . $path, + CURLOPT_URL => $this->getProcessorUrl() . $path, CURLOPT_USERAGENT => WmfFramework::getUserAgent(), CURLOPT_HEADER => 1, CURLOPT_RETURNTRANSFER => 1, @@ -1209,21 +1228,6 @@ } else { $this->current_transaction = $transaction_name; } - - // XXX WIP - $override_options = array( - 'url', - ); - foreach ( $override_options as
[MediaWiki-commits] [Gerrit] setting install params for relforge100[12] - change (operations/puppet)
RobH has submitted this change and it was merged. Change subject: setting install params for relforge100[12] .. setting install params for relforge100[12] setting dhcp and netboot updates T136708 Change-Id: Ib5b7609dcc317215819d8756cd2f31f186d18838 --- M modules/install_server/files/autoinstall/netboot.cfg M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 2 files changed, 15 insertions(+), 1 deletion(-) Approvals: RobH: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/install_server/files/autoinstall/netboot.cfg b/modules/install_server/files/autoinstall/netboot.cfg index f1b06ad..5066a87 100755 --- a/modules/install_server/files/autoinstall/netboot.cfg +++ b/modules/install_server/files/autoinstall/netboot.cfg @@ -131,7 +131,7 @@ restbase200[7-9]) echo partman/cassandrahosts-4ssd-srv.cfg ;; \ rheniumi) echo partman/raid1-gpt.cfg ;; \ sarin) echo partman/raid1-lvm-ext4-srv.cfg ;; \ -analytics1003|sc[ab]200[1-2]|sinistra) echo partman/raid10-gpt-srv-lvm-ext4.cfg ;; \ +analytics1003|relforge100[12]|sc[ab]200[1-2]|sinistra) echo partman/raid10-gpt-srv-lvm-ext4.cfg ;; \ snapshot[1-4]|snapshot100[1-4]) echo partman/snapshot.cfg ;; \ snapshot100[5-7]) echo partman/lvm-ext-srv.cfg ;; \ stat1002) echo partman/lvm-noraid-large.a.cfg ;; \ diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 index 051a556..578c4bc 100644 --- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 +++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 @@ -6060,6 +6060,20 @@ fixed-address rdb2003.codfw.wmnet; } +host relforge1001 { +hardware ethernet 14:58:d0:49:08:c4; +fixed-address relforge1001.eqiad.wmnet; +option pxelinux.pathprefix "trusty-installer/"; +filename "trusty-installer/ubuntu-installer/amd64/pxelinux.0"; +} + +host relforge1002 { +hardware ethernet 14:58:d0:49:c8:ec; +fixed-address relforge1002.eqiad.wmnet; +option pxelinux.pathprefix "trusty-installer/"; +filename "trusty-installer/ubuntu-installer/amd64/pxelinux.0"; +} + host restbase1007 { hardware ethernet 44:A8:42:2D:FE:83; fixed-address restbase1007.eqiad.wmnet; -- To view, visit https://gerrit.wikimedia.org/r/293219 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib5b7609dcc317215819d8756cd2f31f186d18838 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: RobHGerrit-Reviewer: RobH Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] setting install params for relforge100[12] - change (operations/puppet)
RobH has uploaded a new change for review. https://gerrit.wikimedia.org/r/293219 Change subject: setting install params for relforge100[12] .. setting install params for relforge100[12] setting dhcp and netboot updates T136708 Change-Id: Ib5b7609dcc317215819d8756cd2f31f186d18838 --- M modules/install_server/files/autoinstall/netboot.cfg M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 2 files changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/19/293219/1 diff --git a/modules/install_server/files/autoinstall/netboot.cfg b/modules/install_server/files/autoinstall/netboot.cfg index f1b06ad..5066a87 100755 --- a/modules/install_server/files/autoinstall/netboot.cfg +++ b/modules/install_server/files/autoinstall/netboot.cfg @@ -131,7 +131,7 @@ restbase200[7-9]) echo partman/cassandrahosts-4ssd-srv.cfg ;; \ rheniumi) echo partman/raid1-gpt.cfg ;; \ sarin) echo partman/raid1-lvm-ext4-srv.cfg ;; \ -analytics1003|sc[ab]200[1-2]|sinistra) echo partman/raid10-gpt-srv-lvm-ext4.cfg ;; \ +analytics1003|relforge100[12]|sc[ab]200[1-2]|sinistra) echo partman/raid10-gpt-srv-lvm-ext4.cfg ;; \ snapshot[1-4]|snapshot100[1-4]) echo partman/snapshot.cfg ;; \ snapshot100[5-7]) echo partman/lvm-ext-srv.cfg ;; \ stat1002) echo partman/lvm-noraid-large.a.cfg ;; \ diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 index 051a556..578c4bc 100644 --- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 +++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 @@ -6060,6 +6060,20 @@ fixed-address rdb2003.codfw.wmnet; } +host relforge1001 { +hardware ethernet 14:58:d0:49:08:c4; +fixed-address relforge1001.eqiad.wmnet; +option pxelinux.pathprefix "trusty-installer/"; +filename "trusty-installer/ubuntu-installer/amd64/pxelinux.0"; +} + +host relforge1002 { +hardware ethernet 14:58:d0:49:c8:ec; +fixed-address relforge1002.eqiad.wmnet; +option pxelinux.pathprefix "trusty-installer/"; +filename "trusty-installer/ubuntu-installer/amd64/pxelinux.0"; +} + host restbase1007 { hardware ethernet 44:A8:42:2D:FE:83; fixed-address restbase1007.eqiad.wmnet; -- To view, visit https://gerrit.wikimedia.org/r/293219 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5b7609dcc317215819d8756cd2f31f186d18838 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: RobH___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] DHCP: Add MAC address entries for mw2215-mw2238 skipping mw2... - change (operations/puppet)
Papaul has uploaded a new change for review. https://gerrit.wikimedia.org/r/293218 Change subject: DHCP: Add MAC address entries for mw2215-mw2238 skipping mw2218 Bug:T135466 .. DHCP: Add MAC address entries for mw2215-mw2238 skipping mw2218 Bug:T135466 Change-Id: I1f42fd235a60abe4c4c0b8f8be95bd417a4e2c46 --- M modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 1 file changed, 115 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/18/293218/1 diff --git a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 index 4f1d8f5..8a6de47 100644 --- a/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 +++ b/modules/install_server/files/dhcpd/linux-host-entries.ttyS1-115200 @@ -6045,6 +6045,121 @@ fixed-address mw2214.codfw.wmnet; } +host mw2215 { +hardware ethernet 14:18:77:69:BE:8D; +fixed-address mw2215.codfw.wmnet; +} + +host mw2216 { +hardware ethernet 14:18:77:6A:00:C8; +fixed-address mw2216.codfw.wmnet; +} + +host mw2217 { +hardware ethernet 14:18:77:6A:16:C7; +fixed-address mw2217.codfw.wmnet; +} + +host mw2219 { +hardware ethernet 14:18:77:6A:1C:51; +fixed-address mw2017.codfw.wmnet; +} + +host mw2220 { +hardware ethernet 14:18:77:6A:28:B6; +fixed-address mw2220.codfw.wmnet; +} + +host mw2221 { +hardware ethernet 14:18:77:6A:0F:F8; +fixed-address mw2221.codfw.wmnet; +} + +host mw { +hardware ethernet 14:18:77:69:D3:EF; +fixed-address mw.codfw.wmnet; +} + +host mw2223 { +hardware ethernet 14:18:77:6A:04:19; +fixed-address mw2223.codfw.wmnet; +} + +host mw2224 { +hardware ethernet 14:18:77:69:D0:6A; +fixed-address mw2224.codfw.wmnet; +} + +host mw2225 { +hardware ethernet 14:18:77:69:D2:77; +fixed-address mw2225.codfw.wmnet; +} + +host mw2226 { +hardware ethernet 14:18:77:69:BD:98; +fixed-address mw2226.codfw.wmnet; +} + +host mw2227 { +hardware ethernet 14:18:77:6A:24:BE; +fixed-address mw2227.codfw.wmnet; +} + +host mw2228 { +hardware ethernet 14:18:77:6A:29:7C; +fixed-address mw2228.codfw.wmnet; +} + +host mw2229 { +hardware ethernet 14:18:77:69:BD:CE; +fixed-address mw2229.codfw.wmnet; +} + +host mw2230 { +hardware ethernet 14:18:77:69:CD:44; +fixed-address mw2230.codfw.wmnet; +} + +host mw2231 { +hardware ethernet 14:18:77:6A:38:C6; +fixed-address mw2231.codfw.wmnet; +} + +host mw2232 { +hardware ethernet 14:18:77:66:65:43; +fixed-address mw2232.codfw.wmnet; +} + +host mw2233 { +hardware ethernet 14:18:77:6A:1E:78; +fixed-address mw2233.codfw.wmnet; +} + +host mw2234 { +hardware ethernet 14:18:77:6A:0D:DC; +fixed-address mw2234.codfw.wmnet; +} + +host mw2235 { +hardware ethernet 14:18:77:6A:18:0A; +fixed-address mw2235.codfw.wmnet; +} + +host mw2236 { +hardware ethernet 14:18:77:6A:15:A1; +fixed-address mw2236.codfw.wmnet; +} + +host mw2237 { +hardware ethernet 14:18:77:6A:1A:CE; +fixed-address mw2237.codfw.wmnet; +} + +host mw2238 { +hardware ethernet 14:18:77:69:F5:06; +fixed-address mw2238.codfw.wmnet; +} + host neodymium { hardware ethernet 90:B1:1C:2D:79:8C; fixed-address neodymium.eqiad.wmnet; -- To view, visit https://gerrit.wikimedia.org/r/293218 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f42fd235a60abe4c4c0b8f8be95bd417a4e2c46 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Papaul___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix Status::getMessage for the multiple errors, $shortContex... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Fix Status::getMessage for the multiple errors, $shortContext only case .. Fix Status::getMessage for the multiple errors, $shortContext only case Remove $msgCount++ which does not seem to have any non-harmful purpose. Also try to explain what the hell the method does. Change-Id: Ibdf40ff13a4a9d294a6bc6f778a14fb2633c2f70 --- M includes/Status.php 1 file changed, 15 insertions(+), 9 deletions(-) Approvals: Anomie: Looks good to me, approved Gergő Tisza: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Status.php b/includes/Status.php index d01f269..45d8bed 100644 --- a/includes/Status.php +++ b/includes/Status.php @@ -251,12 +251,22 @@ } /** -* Get the error list as a Message object +* Get a bullet list of the errors as a Message object. * -* @param string|string[] $shortContext A short enclosing context message name (or an array of -* message names), to be used when there is a single error. -* @param string|string[] $longContext A long enclosing context message name (or an array of -* message names), for a list. +* $shortContext and $longContext can be used to wrap the error list in some text. +* $shortContext will be preferred when there is a single error; $longContext will be +* preferred when there are multiple ones. In either case, $1 will be replaced with +* the list of errors. +* +* $shortContext is assumed to use $1 as an inline parameter: if there is a single item, +* it will not be made into a list; if there are multiple items, newlines will be inserted +* around the list. +* $longContext is assumed to use $1 as a standalone parameter; it will always receive a list. +* +* If both parameters are missing, and there is only one error, no bullet will be added. +* +* @param string|string[] $shortContext A message name or an array of message names. +* @param string|string[] $longContext A message name or an array of message names. * @param string|Language $lang Language to use for processing messages * @return Message */ @@ -286,10 +296,6 @@ } else { $msgs = $this->getErrorMessageArray( $rawErrors, $lang ); $msgCount = count( $msgs ); - - if ( $shortContext ) { - $msgCount++; - } $s = new RawMessage( '* $' . implode( "\n* \$", range( 1, $msgCount ) ) ); $s->params( $msgs )->parse(); -- To view, visit https://gerrit.wikimedia.org/r/293165 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibdf40ff13a4a9d294a6bc6f778a14fb2633c2f70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gergő TiszaGerrit-Reviewer: Anomie Gerrit-Reviewer: Gergő Tisza Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add ssh:userkey for eventlogging user - change (operations/puppet)
20after4 has uploaded a new change for review. https://gerrit.wikimedia.org/r/293217 Change subject: Add ssh:userkey for eventlogging user .. Add ssh:userkey for eventlogging user Needed for scap deployment since the scap::target resource for eventlogging has `manage_user => false` Bug: T137192 Change-Id: I93573375df5339a4c880b5d32659c8428e5e1756 --- M modules/eventlogging/manifests/server.pp 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/17/293217/1 diff --git a/modules/eventlogging/manifests/server.pp b/modules/eventlogging/manifests/server.pp index 34bd6ec..a7da544 100644 --- a/modules/eventlogging/manifests/server.pp +++ b/modules/eventlogging/manifests/server.pp @@ -69,6 +69,11 @@ managehome => false, } +ssh::userkey { 'eventlogging': +ensure => 'present', +content => secret('keyholder/eventlogging.pub'), +} + $eventlogging_directories = [ '/etc/eventlogging.d', '/etc/eventlogging.d/consumers', -- To view, visit https://gerrit.wikimedia.org/r/293217 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93573375df5339a4c880b5d32659c8428e5e1756 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: 20after4___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use proper index type - change (mediawiki...GeoData)
MaxSem has uploaded a new change for review. https://gerrit.wikimedia.org/r/293216 Change subject: Use proper index type .. Use proper index type Bug: T137177 Change-Id: I54cb3a3eda887d877f18c8ab8f617ba8338c321c --- M includes/Searcher.php M includes/api/ApiQueryGeoSearchElastic.php 2 files changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GeoData refs/changes/16/293216/1 diff --git a/includes/Searcher.php b/includes/Searcher.php index ce6d3bc..03c6cbb 100644 --- a/includes/Searcher.php +++ b/includes/Searcher.php @@ -25,12 +25,14 @@ * Perform search * * @param \Elastica\Query $query +* @param int[] $namespaces Namespaces used * @param string $queryType Query description for logging * @return \Elastica\ResultSet * @throws ExceptionInterface */ - public function performSearch( \Elastica\Query $query, $queryType ) { - $pageType = $this->connection->getPageType( wfWikiID() ); + public function performSearch( \Elastica\Query $query, array $namespaces, $queryType ) { + $indexType = $this->connection->pickIndexTypeForNamespaces( $namespaces ); + $pageType = $this->connection->getPageType( wfWikiID(), $indexType ); $search = $pageType->createSearch( $query ); try { diff --git a/includes/api/ApiQueryGeoSearchElastic.php b/includes/api/ApiQueryGeoSearchElastic.php index 29fccda..d6df0b4 100644 --- a/includes/api/ApiQueryGeoSearchElastic.php +++ b/includes/api/ApiQueryGeoSearchElastic.php @@ -24,6 +24,7 @@ $this->resetQueryParams(); //@fixme: refactor to make this unnecessary $params = $this->params = $this->extractRequestParams(); + $namespaces = array_map( 'intval', $params['namespace'] ); $filter = new \Elastica\Query\BoolQuery(); @@ -68,11 +69,10 @@ $nested = new \Elastica\Query\Nested(); $nested->setPath( 'coordinates' )->setQuery( $filter ); - if ( count( $params['namespace'] ) < count( MWNamespace::getValidNamespaces() ) ) { + if ( count( $namespaces ) < count( MWNamespace::getValidNamespaces() ) ) { $outerFilter = new \Elastica\Query\BoolQuery(); $outerFilter->addFilter( $nested ); - $outerFilter->addFilter( new \Elastica\Query\Terms( 'namespace', - $params['namespace'] ) ); + $outerFilter->addFilter( new \Elastica\Query\Terms( 'namespace', $namespaces ) ); $query->setPostFilter( $outerFilter ); } else { $query->setPostFilter( $nested ); @@ -93,7 +93,7 @@ $searcher = new Searcher( $this->getUser() ); - $resultSet = $searcher->performSearch( $query, 'GeoData_spatial_search' ); + $resultSet = $searcher->performSearch( $query, $namespaces, 'GeoData_spatial_search' ); if ( isset( $params['debug'] ) && $params['debug'] ) { $this->addDebugInfo( $resultSet, $query ); -- To view, visit https://gerrit.wikimedia.org/r/293216 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54cb3a3eda887d877f18c8ab8f617ba8338c321c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GeoData Gerrit-Branch: master Gerrit-Owner: MaxSem___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] AuthManagerSpecialPage: Don't use fixed submit/info class fo... - change (mediawiki/core)
Florianschmidtwelzow has uploaded a new change for review. https://gerrit.wikimedia.org/r/293215 Change subject: AuthManagerSpecialPage: Don't use fixed submit/info class for submit button check .. AuthManagerSpecialPage: Don't use fixed submit/info class for submit button check It's possible that an authentication extension implements its own HTMLForm classes for a submit button or info field. To omit the default submit button of HTMLForm in these cases, too, it's necessary to check if one of the provided HTMLForm field classes inherit from HTMLSubmitField or HTMLInfoField (assuming, that subclasses in extensions inherit from one of them). Bug: T137236 Change-Id: Id0ec914088b527a9c7224d545b04986068138f93 --- M includes/specialpage/AuthManagerSpecialPage.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/15/293215/1 diff --git a/includes/specialpage/AuthManagerSpecialPage.php b/includes/specialpage/AuthManagerSpecialPage.php index 41380f0..9833c73 100644 --- a/includes/specialpage/AuthManagerSpecialPage.php +++ b/includes/specialpage/AuthManagerSpecialPage.php @@ -570,7 +570,8 @@ } elseif ( array_key_exists( 'type', $item ) ) { $class = HTMLForm::$typeMappings[$item['type']]; } - return !in_array( $class, [ 'HTMLInfoField', 'HTMLSubmitField' ], true ); + return !is_a( $class, \HTMLInfoField::class, true ) && + !is_a( $class, \HTMLSubmitField::class, true ); } ); } -- To view, visit https://gerrit.wikimedia.org/r/293215 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id0ec914088b527a9c7224d545b04986068138f93 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] nginx: bump session cache by 10x - change (operations/puppet)
BBlack has submitted this change and it was merged. Change subject: nginx: bump session cache by 10x .. nginx: bump session cache by 10x experimenting further with the limits and tradeoffs here. Note labs is differentiated so we don't oom a small VM. Change-Id: I4061ae09b375eae58ca2023fdc1be663cfc23715 --- M modules/tlsproxy/templates/nginx.conf.erb 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: BBlack: Verified; Looks good to me, approved diff --git a/modules/tlsproxy/templates/nginx.conf.erb b/modules/tlsproxy/templates/nginx.conf.erb index e67dfff..6c6f2ce 100644 --- a/modules/tlsproxy/templates/nginx.conf.erb +++ b/modules/tlsproxy/templates/nginx.conf.erb @@ -76,7 +76,11 @@ # probably less than ideal, as we'll want to vary it based on cluster # traffic levels and pybal node weightings, but for now we're just # experimenting with the fixed value to get ballpark ideas. -ssl_session_cache shared:SSL:200m; +<% if realm == 'labs' then -%> +ssl_session_cache shared:SSL:32m; +<% else -%> +ssl_session_cache shared:SSL:2048m; +<% end -%> ssl_session_timeout 15m; # Disable RFC5077 tickets (may revisit later when client support is better) -- To view, visit https://gerrit.wikimedia.org/r/293213 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4061ae09b375eae58ca2023fdc1be663cfc23715 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlackGerrit-Reviewer: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] text VCL: fixup hfp for X-Cache-Int - change (operations/puppet)
BBlack has submitted this change and it was merged. Change subject: text VCL: fixup hfp for X-Cache-Int .. text VCL: fixup hfp for X-Cache-Int Change-Id: Ia7e6bbebd304ff4393668fa5f0fd3de3a08c7110 --- M templates/varnish/text-common.inc.vcl.erb 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: BBlack: Verified; Looks good to me, approved diff --git a/templates/varnish/text-common.inc.vcl.erb b/templates/varnish/text-common.inc.vcl.erb index 07bfd0a..7735157 100644 --- a/templates/varnish/text-common.inc.vcl.erb +++ b/templates/varnish/text-common.inc.vcl.erb @@ -130,7 +130,7 @@ //avoids us accidentally replacing a good stale/grace object with //an hfp (and then repeatedly passing on potentially-cacheable //content) due to an isolated 5xx response, and the exception for - //underlying cache hits (detected from X-Cache) is to avoid + //underlying cache hits (detected from X-Cache-Int) is to avoid //creating a persist HFP object when a lower-level varnish //returned an expired object under grace-mode rules. // 2) Token=1 + Vary:Cookie @@ -142,7 +142,7 @@ ( beresp.ttl <= 0s && beresp.status < 500 - && (!beresp.http.X-Cache || beresp.http.X-Cache !~ " hit\(") + && (!beresp.http.X-Cache-Int || beresp.http.X-Cache-Int !~ " hit") ) || ( req.http.Cookie == "Token=1" && beresp.http.Vary ~ "(?i)(^|,)\s*Cookie\s*(,|$)" -- To view, visit https://gerrit.wikimedia.org/r/293212 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia7e6bbebd304ff4393668fa5f0fd3de3a08c7110 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlackGerrit-Reviewer: BBlack ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] nginx: bump session cache by 10x - change (operations/puppet)
BBlack has uploaded a new change for review. https://gerrit.wikimedia.org/r/293213 Change subject: nginx: bump session cache by 10x .. nginx: bump session cache by 10x experimenting further with the limits and tradeoffs here. Note labs is differentiated so we don't oom a small VM. Change-Id: I4061ae09b375eae58ca2023fdc1be663cfc23715 --- M modules/tlsproxy/templates/nginx.conf.erb 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/13/293213/1 diff --git a/modules/tlsproxy/templates/nginx.conf.erb b/modules/tlsproxy/templates/nginx.conf.erb index e67dfff..6c6f2ce 100644 --- a/modules/tlsproxy/templates/nginx.conf.erb +++ b/modules/tlsproxy/templates/nginx.conf.erb @@ -76,7 +76,11 @@ # probably less than ideal, as we'll want to vary it based on cluster # traffic levels and pybal node weightings, but for now we're just # experimenting with the fixed value to get ballpark ideas. -ssl_session_cache shared:SSL:200m; +<% if realm == 'labs' then -%> +ssl_session_cache shared:SSL:32m; +<% else -%> +ssl_session_cache shared:SSL:2048m; +<% end -%> ssl_session_timeout 15m; # Disable RFC5077 tickets (may revisit later when client support is better) -- To view, visit https://gerrit.wikimedia.org/r/293213 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4061ae09b375eae58ca2023fdc1be663cfc23715 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlack___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Hygiene: extremely light clean up - change (apps...wikipedia)
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/293214 Change subject: Hygiene: extremely light clean up .. Hygiene: extremely light clean up • Replace deprecated method call. • Add missing @Override. • Remove unused namespace. No functional changes intended. Change-Id: Ieb8d172269f5f721f45823d53d9f1f4a13669e4c --- M app/src/main/java/org/wikipedia/login/authmanager/AMLoginTask.java M app/src/main/java/org/wikipedia/page/PageActivity.java M app/src/main/res/layout/item_gallery_thumbnail.xml 3 files changed, 54 insertions(+), 54 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/14/293214/1 diff --git a/app/src/main/java/org/wikipedia/login/authmanager/AMLoginTask.java b/app/src/main/java/org/wikipedia/login/authmanager/AMLoginTask.java index 8a01bdd..a4f1d3c 100644 --- a/app/src/main/java/org/wikipedia/login/authmanager/AMLoginTask.java +++ b/app/src/main/java/org/wikipedia/login/authmanager/AMLoginTask.java @@ -21,7 +21,7 @@ this.password = password; } -public RequestBuilder buildRequest(Api api) { +@Override public RequestBuilder buildRequest(Api api) { // HACK: T124384 WikipediaApp.getInstance().getEditTokenStorage().clearAllTokens(); diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java b/app/src/main/java/org/wikipedia/page/PageActivity.java index 1fa1bc8..aa17648 100644 --- a/app/src/main/java/org/wikipedia/page/PageActivity.java +++ b/app/src/main/java/org/wikipedia/page/PageActivity.java @@ -1,12 +1,58 @@ package org.wikipedia.page; +import android.annotation.TargetApi; +import android.app.SearchManager; +import android.appwidget.AppWidgetManager; +import android.content.ComponentName; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.res.Configuration; +import android.location.Location; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.design.widget.BottomSheetDialog; +import android.support.design.widget.BottomSheetDialogFragment; +import android.support.design.widget.NavigationView; +import android.support.design.widget.Snackbar; +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentTransaction; +import android.support.v4.content.ContextCompat; +import android.support.v4.view.GravityCompat; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBarDrawerToggle; +import android.support.v7.app.AlertDialog; +import android.support.v7.preference.PreferenceManager; +import android.support.v7.view.ActionMode; +import android.support.v7.widget.Toolbar; +import android.text.Html; +import android.text.TextUtils; +import android.text.format.DateUtils; +import android.view.KeyEvent; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.WindowManager; +import android.widget.ProgressBar; +import android.widget.TextView; + +import com.squareup.otto.Bus; +import com.squareup.otto.Subscribe; + +import net.hockeyapp.android.metrics.MetricsManager; + import org.wikipedia.BackPressedHandler; import org.wikipedia.R; import org.wikipedia.Site; -import org.wikipedia.activity.ActivityUtil; -import org.wikipedia.activity.ThemedActionBarActivity; import org.wikipedia.ViewAnimations; import org.wikipedia.WikipediaApp; +import org.wikipedia.activity.ActivityUtil; +import org.wikipedia.activity.ThemedActionBarActivity; import org.wikipedia.analytics.IntentFunnel; import org.wikipedia.analytics.ReadingListsFunnel; import org.wikipedia.analytics.WikipediaZeroUsageFunnel; @@ -38,53 +84,8 @@ import org.wikipedia.widgets.WidgetProviderFeaturedPage; import org.wikipedia.zero.ZeroConfig; -import com.squareup.otto.Bus; -import com.squareup.otto.Subscribe; - -import android.annotation.TargetApi; -import android.app.SearchManager; -import android.appwidget.AppWidgetManager; -import android.content.ComponentName; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.res.Configuration; -import android.location.Location; -import android.net.Uri; -import android.os.Build; -import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.design.widget.BottomSheetDialog; -import android.support.design.widget.BottomSheetDialogFragment; -import android.support.design.widget.NavigationView; -import android.support.design.widget.Snackbar; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import
[MediaWiki-commits] [Gerrit] text VCL: fixup hfp for X-Cache-Int - change (operations/puppet)
BBlack has uploaded a new change for review. https://gerrit.wikimedia.org/r/293212 Change subject: text VCL: fixup hfp for X-Cache-Int .. text VCL: fixup hfp for X-Cache-Int Change-Id: Ia7e6bbebd304ff4393668fa5f0fd3de3a08c7110 --- M templates/varnish/text-common.inc.vcl.erb 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/12/293212/1 diff --git a/templates/varnish/text-common.inc.vcl.erb b/templates/varnish/text-common.inc.vcl.erb index 07bfd0a..7735157 100644 --- a/templates/varnish/text-common.inc.vcl.erb +++ b/templates/varnish/text-common.inc.vcl.erb @@ -130,7 +130,7 @@ //avoids us accidentally replacing a good stale/grace object with //an hfp (and then repeatedly passing on potentially-cacheable //content) due to an isolated 5xx response, and the exception for - //underlying cache hits (detected from X-Cache) is to avoid + //underlying cache hits (detected from X-Cache-Int) is to avoid //creating a persist HFP object when a lower-level varnish //returned an expired object under grace-mode rules. // 2) Token=1 + Vary:Cookie @@ -142,7 +142,7 @@ ( beresp.ttl <= 0s && beresp.status < 500 - && (!beresp.http.X-Cache || beresp.http.X-Cache !~ " hit\(") + && (!beresp.http.X-Cache-Int || beresp.http.X-Cache-Int !~ " hit") ) || ( req.http.Cookie == "Token=1" && beresp.http.Vary ~ "(?i)(^|,)\s*Cookie\s*(,|$)" -- To view, visit https://gerrit.wikimedia.org/r/293212 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia7e6bbebd304ff4393668fa5f0fd3de3a08c7110 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BBlack___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 6a6d3b9..953422a - change (mediawiki/extensions)
Jenkins-mwext-sync has uploaded a new change for review. https://gerrit.wikimedia.org/r/293211 Change subject: Syncronize VisualEditor: 6a6d3b9..953422a .. Syncronize VisualEditor: 6a6d3b9..953422a Change-Id: I76d5a6957f63c64e6d22c3fe63c4523ec8908b9d --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions refs/changes/11/293211/1 diff --git a/VisualEditor b/VisualEditor index 6a6d3b9..953422a 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit 6a6d3b93680834fd4998491a383136493c054ccc +Subproject commit 953422a6059f9330bdf50e57016ddcdf435c0c05 -- To view, visit https://gerrit.wikimedia.org/r/293211 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I76d5a6957f63c64e6d22c3fe63c4523ec8908b9d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-sync___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Syncronize VisualEditor: 6a6d3b9..953422a - change (mediawiki/extensions)
Jenkins-mwext-sync has submitted this change and it was merged. Change subject: Syncronize VisualEditor: 6a6d3b9..953422a .. Syncronize VisualEditor: 6a6d3b9..953422a Change-Id: I76d5a6957f63c64e6d22c3fe63c4523ec8908b9d --- M VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Jenkins-mwext-sync: Verified; Looks good to me, approved diff --git a/VisualEditor b/VisualEditor index 6a6d3b9..953422a 16 --- a/VisualEditor +++ b/VisualEditor -Subproject commit 6a6d3b93680834fd4998491a383136493c054ccc +Subproject commit 953422a6059f9330bdf50e57016ddcdf435c0c05 -- To view, visit https://gerrit.wikimedia.org/r/293211 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I76d5a6957f63c64e6d22c3fe63c4523ec8908b9d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions Gerrit-Branch: master Gerrit-Owner: Jenkins-mwext-syncGerrit-Reviewer: Jenkins-mwext-sync ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] relforge1002 mgmt dns update - change (operations/dns)
RobH has submitted this change and it was merged. Change subject: relforge1002 mgmt dns update .. relforge1002 mgmt dns update had to swap which chassis was used for system allocation T136708 Change-Id: I5604a4f7dd2ff4d87de3e03f4ae029ebf2813bb8 --- M templates/10.in-addr.arpa M templates/wmnet 2 files changed, 2 insertions(+), 3 deletions(-) Approvals: RobH: Looks good to me, approved jenkins-bot: Verified diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa index b56d361..92f72be 100644 --- a/templates/10.in-addr.arpa +++ b/templates/10.in-addr.arpa @@ -1693,11 +1693,11 @@ 110 1H IN PTR wmf4657.mgmt.eqiad.wmnet. 110 1H IN PTR relforge1001.mgmt.eqiad.wmnet. 111 1H IN PTR wmf4658.mgmt.eqiad.wmnet. -111 1H IN PTR relforge1002.mgmt.eqiad.wmnet. 112 1H IN PTR wmf4659.mgmt.eqiad.wmnet. 112 1H IN PTR labmon1001.mgmt.eqiad.wmnet. 113 1H IN PTR wmf4660.mgmt.eqiad.wmnet. 114 1H IN PTR wmf4661.mgmt.eqiad.wmnet. +114 1H IN PTR relforge1002.mgmt.eqiad.wmnet. 115 1H IN PTR wmf4665.mgmt.eqiad.wmnet. 115 1H IN PTR cp1071.mgmt.eqiad.wmnet. 116 1H IN PTR wmf4666.mgmt.eqiad.wmnet. diff --git a/templates/wmnet b/templates/wmnet index 8457412..9c706b9 100644 --- a/templates/wmnet +++ b/templates/wmnet @@ -2161,13 +2161,12 @@ wmf4657 1H IN A10.65.2.110 relforge10011H IN A10.65.2.110 wmf4658 1H IN A10.65.2.111 -relforge10021H IN A10.65.2.111 wmf4659 1H IN A10.65.2.112 labmon1001 1H IN A10.65.2.112 wmf4660 1H IN A10.65.2.113 restbase10051H IN A10.65.2.113 wmf4661 1H IN A10.65.2.114 -restbase10061H IN A10.65.2.114 +relforge10021H IN A10.65.2.114 restbase10071H IN A10.65.2.119 restbase10081H IN A10.65.2.120 restbase10091H IN A10.65.2.121 -- To view, visit https://gerrit.wikimedia.org/r/293208 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5604a4f7dd2ff4d87de3e03f4ae029ebf2813bb8 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: RobHGerrit-Reviewer: RobH Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix Message::newFromSpecifier for nested RawMessage - change (mediawiki/core)
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/293210 Change subject: Fix Message::newFromSpecifier for nested RawMessage .. Fix Message::newFromSpecifier for nested RawMessage Change-Id: I346b35e08bd38ce231e16d0616438ea408b55bff --- M includes/Message.php M tests/phpunit/includes/MessageTest.php 2 files changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/10/293210/1 diff --git a/includes/Message.php b/includes/Message.php index c204aee..d3ac57a 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -391,15 +391,18 @@ * @since 1.27 */ public static function newFromSpecifier( $value ) { + $params = []; + if ( is_array( $value ) ) { + $params = $value; + $value = array_shift( $params ); + } + if ( $value instanceof RawMessage ) { $message = new RawMessage( $value->getKey(), $value->getParams() ); } elseif ( $value instanceof MessageSpecifier ) { $message = new Message( $value ); - } elseif ( is_array( $value ) ) { - $key = array_shift( $value ); - $message = new Message( $key, $value ); } elseif ( is_string( $value ) ) { - $message = new Message( $value ); + $message = new Message( $value, $params ); } else { throw new InvalidArgumentException( __METHOD__ . ': invalid argument type ' . gettype( $value ) ); diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index 224b0cb..8aa1361 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -603,6 +603,7 @@ 'Message' => [ new Message( 'youhavenewmessages', [ 'foo', 'bar' ] ), 'You have foo (bar).' ], 'RawMessage' => [ new RawMessage( 'foo ($1)', [ 'bar' ] ), 'foo (bar)' ], 'MessageSpecifier' => [ $messageSpecifier, 'Main Page' ], + 'nested RawMessage' => [ [ new RawMessage( 'foo ($1)', [ 'bar' ] ) ], 'foo (bar)' ], ]; } } -- To view, visit https://gerrit.wikimedia.org/r/293210 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I346b35e08bd38ce231e16d0616438ea408b55bff Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Push index selection by namespace into Connection class - change (mediawiki...CirrusSearch)
jenkins-bot has submitted this change and it was merged. Change subject: Push index selection by namespace into Connection class .. Push index selection by namespace into Connection class GeoData needs to reuse this code to select the appropriate indexes to query against. Shift the code from Searcher class into Connection class to enable that reusability. Bug: T137177 Change-Id: I8bc7f87ca2558665fa09e02b786ecf1683b4126a --- M includes/Connection.php M includes/Searcher.php 2 files changed, 24 insertions(+), 21 deletions(-) Approvals: MaxSem: Looks good to me, approved Cindy-the-browser-test-bot: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/Connection.php b/includes/Connection.php index 002b243..d8adbc9 100644 --- a/includes/Connection.php +++ b/includes/Connection.php @@ -282,6 +282,26 @@ return $count; } + /** +* @param int[]|null $namespaces List of namespaces to check +* @return string|false The suffix to use (e.g. content or general) to +* query the namespaces, or false if both need to be queried. +*/ + public function pickIndexTypeForNamespaces( array $namespaces = null ) { + $indexTypes = array(); + if ( $namespaces ) { + foreach ( $namespaces as $namespace ) { + $indexTypes[] = $this->getIndexSuffixForNamespace( $namespace ); + } + $indexTypes = array_unique( $indexTypes ); + } + if ( count( $indexTypes ) === 1 ) { + return $indexTypes[0]; + } else { + return false; + } + } + public function destroyClient() { self::$pool = array(); parent::destroyClient(); diff --git a/includes/Searcher.php b/includes/Searcher.php index 2acd101..ebd0ea1 100644 --- a/includes/Searcher.php +++ b/includes/Searcher.php @@ -899,7 +899,9 @@ *or an error if there was an error */ public function get( array $pageIds, $sourceFiltering ) { - $indexType = $this->pickIndexTypeFromNamespaces(); + $indexType = $this->connection->pickIndexTypeForNamespaces( + $this->getNamespaces() + ); return Util::doPoolCounterWork( 'CirrusSearch-Search', $this->user, @@ -1054,8 +1056,8 @@ $query->setParam( 'fields', $this->resultsType->getFields() ); $extraIndexes = array(); - $indexType = $this->pickIndexTypeFromNamespaces(); $namespaces = $this->getNamespaces(); + $indexType = $this->connection->pickIndexTypeForNamespaces( $namespaces ); if ( $namespaces ) { $extraIndexes = $this->getAndFilterExtraIndexes(); if ( $this->needNsFilter( $extraIndexes, $indexType ) ) { @@ -1544,25 +1546,6 @@ $fields[] = "file_text${fieldSuffix}^${fileTextWeight}"; } return $fields; - } - - /** -* Pick the index type to search based on the list of namespaces to search. -* @return string|false either an index type or false to use all index types -*/ - private function pickIndexTypeFromNamespaces() { - $namespaces = $this->getNamespaces(); - if ( !$namespaces ) { - return false; // False selects all index types - } - - $indexTypes = array(); - foreach ( $namespaces as $namespace ) { - $indexTypes[] = - $this->connection->getIndexSuffixForNamespace( $namespace ); - } - $indexTypes = array_unique( $indexTypes ); - return count( $indexTypes ) > 1 ? false : $indexTypes[0]; } /** -- To view, visit https://gerrit.wikimedia.org/r/293143 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8bc7f87ca2558665fa09e02b786ecf1683b4126a Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: EBernhardsonGerrit-Reviewer: Cindy-the-browser-test-bot Gerrit-Reviewer: DCausse Gerrit-Reviewer: Gehel Gerrit-Reviewer: Manybubbles Gerrit-Reviewer: MaxSem Gerrit-Reviewer: Smalyshev Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org
[MediaWiki-commits] [Gerrit] relforge1002 mgmt dns update - change (operations/dns)
RobH has uploaded a new change for review. https://gerrit.wikimedia.org/r/293208 Change subject: relforge1002 mgmt dns update .. relforge1002 mgmt dns update had to swap which chassis was used for system allocation T136708 Change-Id: I5604a4f7dd2ff4d87de3e03f4ae029ebf2813bb8 --- M templates/10.in-addr.arpa M templates/wmnet 2 files changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dns refs/changes/08/293208/1 diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa index b56d361..92f72be 100644 --- a/templates/10.in-addr.arpa +++ b/templates/10.in-addr.arpa @@ -1693,11 +1693,11 @@ 110 1H IN PTR wmf4657.mgmt.eqiad.wmnet. 110 1H IN PTR relforge1001.mgmt.eqiad.wmnet. 111 1H IN PTR wmf4658.mgmt.eqiad.wmnet. -111 1H IN PTR relforge1002.mgmt.eqiad.wmnet. 112 1H IN PTR wmf4659.mgmt.eqiad.wmnet. 112 1H IN PTR labmon1001.mgmt.eqiad.wmnet. 113 1H IN PTR wmf4660.mgmt.eqiad.wmnet. 114 1H IN PTR wmf4661.mgmt.eqiad.wmnet. +114 1H IN PTR relforge1002.mgmt.eqiad.wmnet. 115 1H IN PTR wmf4665.mgmt.eqiad.wmnet. 115 1H IN PTR cp1071.mgmt.eqiad.wmnet. 116 1H IN PTR wmf4666.mgmt.eqiad.wmnet. diff --git a/templates/wmnet b/templates/wmnet index 8457412..9c706b9 100644 --- a/templates/wmnet +++ b/templates/wmnet @@ -2161,13 +2161,12 @@ wmf4657 1H IN A10.65.2.110 relforge10011H IN A10.65.2.110 wmf4658 1H IN A10.65.2.111 -relforge10021H IN A10.65.2.111 wmf4659 1H IN A10.65.2.112 labmon1001 1H IN A10.65.2.112 wmf4660 1H IN A10.65.2.113 restbase10051H IN A10.65.2.113 wmf4661 1H IN A10.65.2.114 -restbase10061H IN A10.65.2.114 +relforge10021H IN A10.65.2.114 restbase10071H IN A10.65.2.119 restbase10081H IN A10.65.2.120 restbase10091H IN A10.65.2.121 -- To view, visit https://gerrit.wikimedia.org/r/293208 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5604a4f7dd2ff4d87de3e03f4ae029ebf2813bb8 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: RobH___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Limit the number of results stored in CirrusSearchRequestSet - change (mediawiki...CirrusSearch)
jenkins-bot has submitted this change and it was merged. Change subject: Limit the number of results stored in CirrusSearchRequestSet .. Limit the number of results stored in CirrusSearchRequestSet Some api consumers are allowed to return 5000 results from search APIs. We don't really need to store them all, this patch limits the number of results being stored. This is causing failures in kafka (we reach message size limit), currently MW ignores such errors because it uses ack=0 but this will be changed soon. Change-Id: Ife0d9eb722b5a3fab9c04ee9558f06a1875207e7 --- M includes/ElasticsearchIntermediary.php 1 file changed, 7 insertions(+), 2 deletions(-) Approvals: Cindy-the-browser-test-bot: Looks good to me, but someone else must approve EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/ElasticsearchIntermediary.php b/includes/ElasticsearchIntermediary.php index 0207231..584c683 100644 --- a/includes/ElasticsearchIntermediary.php +++ b/includes/ElasticsearchIntermediary.php @@ -36,6 +36,11 @@ */ class ElasticsearchIntermediary { /** +* @const int max number of results to store in CirrusSearchRequestSet logs (per request) +*/ + const LOG_MAX_RESULTS = 50; + + /** * @var Connection */ protected $connection; @@ -182,7 +187,7 @@ 'suggestionRequested' => isset( $context['suggestion'] ), 'maxScore' => isset( $context['maxScore'] ) ? $context['maxScore'] : -1, 'payload' => array(), - 'hits' => isset( $context['hits'] ) ? $context['hits'] : array(), + 'hits' => isset( $context['hits'] ) ? array_slice( $context['hits'], 0, self::LOG_MAX_RESULTS ) : array(), ); if ( isset( $context['hits'] ) ) { $allHits = array_merge( $allHits, $context['hits'] ); @@ -262,7 +267,7 @@ 'userAgent' => $wgRequest->getHeader( 'User-Agent') ?: '', 'backendUserTests' => UserTesting::getInstance()->getActiveTestNamesWithBucket(), 'tookMs' => 1000 * $tookS, - 'hits' => $resultHits, + 'hits' => array_slice( $resultHits, 0, self::LOG_MAX_RESULTS ), 'payload' => array( // useful while we are testing accept-lang based interwiki 'acceptLang' => (string) ($wgRequest->getHeader( 'Accept-Language' ) ?: ''), -- To view, visit https://gerrit.wikimedia.org/r/293078 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ife0d9eb722b5a3fab9c04ee9558f06a1875207e7 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: DCausseGerrit-Reviewer: Cindy-the-browser-test-bot Gerrit-Reviewer: EBernhardson Gerrit-Reviewer: Gehel Gerrit-Reviewer: Manybubbles Gerrit-Reviewer: Smalyshev Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused test files - change (apps...wikipedia)
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/293187 Change subject: Remove unused test files .. Remove unused test files A follow-up to 5ef1ca7, remove test files no longer in use. Change-Id: I7dba687c3813ab24f3b9a02f594c8a05651eac71 --- D app/src/test/res/raw/gather_get_collection_pages.json D app/src/test/res/raw/gather_get_collections.json D app/src/test/res/raw/gather_not_logged_in.json 3 files changed, 0 insertions(+), 54 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/87/293187/1 diff --git a/app/src/test/res/raw/gather_get_collection_pages.json b/app/src/test/res/raw/gather_get_collection_pages.json deleted file mode 100644 index c4a26b6..000 --- a/app/src/test/res/raw/gather_get_collection_pages.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "batchcomplete": "", - "query": { -"listpages": [ - { -"ns": 0, -"title": "Test" - }, - { -"ns": 1, -"title": "Talk:Test" - } -] - } -} \ No newline at end of file diff --git a/app/src/test/res/raw/gather_get_collections.json b/app/src/test/res/raw/gather_get_collections.json deleted file mode 100644 index 68d1a2d..000 --- a/app/src/test/res/raw/gather_get_collections.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "batchcomplete": true, - "query": { -"lists": [ - { -"id": 0, -"watchlist": true, -"label": "Watchlist", -"owner": "someUser", -"perm": "private", -"description": "", -"image": false, -"updated": "2016-02-19T00:05:07Z", -"count": 1 - }, - { -"id": 11, -"label": "firstlist", -"owner": "someUser", -"perm": "public", -"description": "a simple test list", -"image": "sample_picture", -"imageurl": "//upload.wikimedia.org/wikipedia/commons/7/79/sample_picture.jpg", -"imagewidth": 1402, -"imageheight": 830, -"updated": "2016-01-06T20:19:58Z", -"count": 4 - } -] - } -} \ No newline at end of file diff --git a/app/src/test/res/raw/gather_not_logged_in.json b/app/src/test/res/raw/gather_not_logged_in.json deleted file mode 100644 index 82ace44..000 --- a/app/src/test/res/raw/gather_not_logged_in.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "servedby": "mw1205", - "error": { -"code": "lstnotloggedin", -"info": "You must be logged-in or use owner and/or ids parameters", -"*": "See https://en.wikipedia.org/w/api.php for API usage" - } -} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/293187 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7dba687c3813ab24f3b9a02f594c8a05651eac71 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Niedzielski___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Various output fixes - change (mediawiki...mobileapps)
Mholloway has uploaded a new change for review. https://gerrit.wikimedia.org/r/293188 Change subject: Various output fixes .. Various output fixes 1) Remove revids, which aren't needed since we check etags instead 2) Fix etags for most-read and aggregated endpoints (they had an 'undefined' segment before) 3) Make most-read endpoint 'date' field return an ISO 8601 date Change-Id: I0c1240413b64580cf10b41fff130dcaab602c8bb --- M lib/dateUtil.js M lib/feed/featured.js M lib/feed/most-read.js M lib/mobile-util.js M lib/mwapi.js M routes/aggregated.js M routes/most-read.js M test/features/aggregated/aggregated.js M test/features/most-read/most-read.js 9 files changed, 42 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/88/293188/1 diff --git a/lib/dateUtil.js b/lib/dateUtil.js index 0984871..11a1b3e 100644 --- a/lib/dateUtil.js +++ b/lib/dateUtil.js @@ -40,6 +40,10 @@ return req.params. + '/' + req.params.mm + '/' + req.params.dd; } +function iso8601DateFrom(req) { +return req.params. + '-' + req.params.mm + '-' + req.params.dd + 'Z'; +} + function pad(number) { if (number < 10) { return '0' + number; @@ -60,6 +64,7 @@ formatDateEnglish: formatDateEnglish, getRequestedDate: getRequestedDate, dateStringFrom: dateStringFrom, +iso8601DateFrom: iso8601DateFrom, pad: pad, yesterday: yesterday, ONE_DAY: ONE_DAY diff --git a/lib/feed/featured.js b/lib/feed/featured.js index c67bedc..1f07600 100644 --- a/lib/feed/featured.js +++ b/lib/feed/featured.js @@ -113,7 +113,6 @@ payload: buildResponse(pageTitle, extractPageObj), meta: { etag: tfaPageObj.pageid + '/' + getRevision(extractPageObj), -revid: getRevision(extractPageObj) } }; }); diff --git a/lib/feed/most-read.js b/lib/feed/most-read.js index 03d6a97..c5add62 100644 --- a/lib/feed/most-read.js +++ b/lib/feed/most-read.js @@ -9,6 +9,7 @@ var api = require('../api-util'); var mwapi = require('../mwapi'); var blacklist = require('./blacklist'); +var uuid = require('cassandra-uuid').TimeUuid; /** @@ -75,9 +76,6 @@ description: entry.terms && entry.terms.description && entry.terms.description[0], -revid: entry.revisions - && entry.revisions[0] - && entry.revisions[0].revid, thumbnail: entry.thumbnail && entry.thumbnail.source ? mwapi.buildListThumbUrls(entry.thumbnail.source) @@ -91,8 +89,13 @@ if (results.length) { return { -date: dateUtil.dateStringFrom(req), -articles: results +payload: { +date: dateUtil.iso8601DateFrom(req), +articles: results +}, +meta: { +etag: mUtil.getDateStringEtag(dateUtil.dateStringFrom(req)) +} }; } mUtil.throw404('No results found; something is probably wrong.'); diff --git a/lib/mobile-util.js b/lib/mobile-util.js index 95337e3..db8555f 100644 --- a/lib/mobile-util.js +++ b/lib/mobile-util.js @@ -159,6 +159,14 @@ } } +/** + * Construct an etag using the date from the feed endpoint request. + * Example: '2016/03/05' -> '20160305/bb6b7552-2cea-11e6-8490-df3f275c37a6' + */ +function getDateStringEtag(dateString) { +return dateString.split('/').join('') + '/' + uuid.now().toString(); +} + function throw404(message) { throw new HTTPError({ status: 404, @@ -174,6 +182,7 @@ defaultVal: defaultVal, setETagToValue: setETagToValue, setETag: setETag, +getDateStringEtag: getDateStringEtag, mobileToCanonical: mobileToCanonical, removeTLD: removeTLD, mergeByProp: mergeByProp, diff --git a/lib/mwapi.js b/lib/mwapi.js index 05bd02e..300d95e 100644 --- a/lib/mwapi.js +++ b/lib/mwapi.js @@ -156,8 +156,7 @@ action: 'query', format: 'json', formatversion: 2, -prop: 'revisions|pageimages|pageterms', -rvprop: 'ids', +prop: 'pageimages|pageterms', piprop: 'thumbnail', pilimit: API_QUERY_MAX_TITLES, pithumbsize: DEFAULT_THUMB_WIDTH, diff --git a/routes/aggregated.js b/routes/aggregated.js index f6322a0..1e59ae8 100644 --- a/routes/aggregated.js +++ b/routes/aggregated.js @@ -28,18 +28,26 @@ * Returns aggregated feed content for the date requested. */ router.get('/featured/:/:mm/:dd', function (req, res) { +var dateString = dateUtil.dateStringFrom(req); return BBPromise.props({ tfa: featured.promise(app, req), mostread: mostRead.promise(app,
[MediaWiki-commits] [Gerrit] Avoid contention in updateLinksTimestamp() - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/293190 Change subject: Avoid contention in updateLinksTimestamp() .. Avoid contention in updateLinksTimestamp() Since LinksUpdate::doUpdate() already flushes the transaction, go ahead and flush before other DataUpdates might run (e.g. from RefreshLinksJob). Also release the lock before running the LinksUpdateComplete handlers, as the lock is just to keep LinksUpdate instances from racing with each other. Change-Id: Ied97fa36fbca0203123e9fc966d2e23bfd621c0e --- M includes/deferred/LinksUpdate.php 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/90/293190/1 diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index 07b5614..d4a61fa 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -155,10 +155,11 @@ Hooks::run( 'LinksUpdate', [ &$this ] ); $this->doIncrementalUpdate(); - $this->mDb->onTransactionIdle( function() use ( &$scopedLock ) { + // Commit and release the lock + ScopedCallback::consume( $scopedLock ); + // Run post-commit hooks without DBO_TRX + $this->mDb->onTransactionIdle( function() { Hooks::run( 'LinksUpdateComplete', [ &$this ] ); - // Release the lock *after* the final COMMIT for correctness - ScopedCallback::consume( $scopedLock ); } ); } @@ -243,15 +244,14 @@ $changed = $propertiesDeletes + array_diff_assoc( $this->mProperties, $existing ); $this->invalidateProperties( $changed ); - # Update the links table freshness for this title - $this->updateLinksTimestamp(); - # Refresh links of all pages including this page # This will be in a separate transaction if ( $this->mRecursive ) { $this->queueRecursiveJobs(); } + # Update the links table freshness for this title + $this->updateLinksTimestamp(); } /** -- To view, visit https://gerrit.wikimedia.org/r/293190 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied97fa36fbca0203123e9fc966d2e23bfd621c0e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add most read models and unmarshaller tests - change (apps...wikipedia)
Niedzielski has uploaded a new change for review. https://gerrit.wikimedia.org/r/293179 Change subject: Add most read models and unmarshaller tests .. Add most read models and unmarshaller tests Add models for the most read Feed card. Since the models specify unmarshalling annotations and have a tiny bit of deserialization logic themselves, add tests. Bug: T129082 Change-Id: I9771f06ea563c66cbc6d03c030d8c48f15721fa4 --- A app/src/main/java/org/wikipedia/feed/mostread/MostReadArticle.java A app/src/main/java/org/wikipedia/feed/mostread/MostReadArticles.java A app/src/test/java/org/wikipedia/feed/mostread/MostReadArticleTest.java A app/src/test/java/org/wikipedia/feed/mostread/MostReadArticlesTest.java A app/src/test/res/raw/most_read_many_articles.json A app/src/test/res/raw/most_read_no_articles.json 6 files changed, 646 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/79/293179/1 diff --git a/app/src/main/java/org/wikipedia/feed/mostread/MostReadArticle.java b/app/src/main/java/org/wikipedia/feed/mostread/MostReadArticle.java new file mode 100644 index 000..8396c03 --- /dev/null +++ b/app/src/main/java/org/wikipedia/feed/mostread/MostReadArticle.java @@ -0,0 +1,60 @@ +package org.wikipedia.feed.mostread; + +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; + +import com.google.gson.annotations.SerializedName; + +import java.net.URL; +import java.util.Collections; +import java.util.Map; + +public final class MostReadArticle { +@SerializedName("normalizedtitle") @SuppressWarnings("NullableProblems") @NonNull private String normalizedTitle; +@SuppressWarnings("NullableProblems") @NonNull private String title; +@Nullable private String description; +@SerializedName("pageid") private int pageId; +@SerializedName("revid") private long revId; +@SerializedName("thumbnail") @SuppressWarnings("NullableProblems") @NonNull private Mapthumbnails; +private int rank; +private int views; + +@NonNull public String normalizedTitle() { +return normalizedTitle; +} + +@NonNull public String title() { +return title; +} + +@Nullable public String description() { +return description; +} + +public int pageId() { +return pageId; +} + +public long revId() { +return revId; +} + +public Map thumbnails() { +return thumbnails; +} + +public int rank() { +return rank; +} + +public int views() { +return views; +} + +private MostReadArticle() { +//noinspection ConstantConditions +if (thumbnails == null) { +thumbnails = Collections.emptyMap(); +} +} +} \ No newline at end of file diff --git a/app/src/main/java/org/wikipedia/feed/mostread/MostReadArticles.java b/app/src/main/java/org/wikipedia/feed/mostread/MostReadArticles.java new file mode 100644 index 000..13da633 --- /dev/null +++ b/app/src/main/java/org/wikipedia/feed/mostread/MostReadArticles.java @@ -0,0 +1,27 @@ +package org.wikipedia.feed.mostread; + +import android.support.annotation.NonNull; + +import java.util.Collections; +import java.util.Date; +import java.util.List; + +public final class MostReadArticles { +@SuppressWarnings("NullableProblems") @NonNull private Date date; +@SuppressWarnings("NullableProblems") @NonNull private List articles; + +@NonNull public Date date() { +return date; +} + +@NonNull public List articles() { +return articles; +} + +private MostReadArticles() { +//noinspection ConstantConditions +if (articles == null) { +articles = Collections.emptyList(); +} +} +} \ No newline at end of file diff --git a/app/src/test/java/org/wikipedia/feed/mostread/MostReadArticleTest.java b/app/src/test/java/org/wikipedia/feed/mostread/MostReadArticleTest.java new file mode 100644 index 000..e89407f --- /dev/null +++ b/app/src/test/java/org/wikipedia/feed/mostread/MostReadArticleTest.java @@ -0,0 +1,59 @@ +package org.wikipedia.feed.mostread; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.wikipedia.test.TestRunner; + +import java.net.URL; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.notNullValue; + +@RunWith(TestRunner.class) +@SuppressWarnings("checkstyle:magicnumber") +public class MostReadArticleTest { +private List subjects; + +@Before public void setUp() throws Throwable { +subjects = MostReadArticlesTest.unmarshal("most_read_many_articles.json").articles(); +} + +@Test public void testUnmarshalThumbnails() throws Throwable {
[MediaWiki-commits] [Gerrit] Fix Status::getMessage for the multiple errors, $shortContex... - change (mediawiki/core)
Gergő Tisza has uploaded a new change for review. https://gerrit.wikimedia.org/r/293165 Change subject: Fix Status::getMessage for the multiple errors, $shortContext only case .. Fix Status::getMessage for the multiple errors, $shortContext only case Remove $msgCount++ which does not seem to have any non-harmful purpose. Also try to explain what the hell the method does. Change-Id: Ibdf40ff13a4a9d294a6bc6f778a14fb2633c2f70 --- M includes/Status.php 1 file changed, 15 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/65/293165/1 diff --git a/includes/Status.php b/includes/Status.php index d01f269..45d8bed 100644 --- a/includes/Status.php +++ b/includes/Status.php @@ -251,12 +251,22 @@ } /** -* Get the error list as a Message object +* Get a bullet list of the errors as a Message object. * -* @param string|string[] $shortContext A short enclosing context message name (or an array of -* message names), to be used when there is a single error. -* @param string|string[] $longContext A long enclosing context message name (or an array of -* message names), for a list. +* $shortContext and $longContext can be used to wrap the error list in some text. +* $shortContext will be preferred when there is a single error; $longContext will be +* preferred when there are multiple ones. In either case, $1 will be replaced with +* the list of errors. +* +* $shortContext is assumed to use $1 as an inline parameter: if there is a single item, +* it will not be made into a list; if there are multiple items, newlines will be inserted +* around the list. +* $longContext is assumed to use $1 as a standalone parameter; it will always receive a list. +* +* If both parameters are missing, and there is only one error, no bullet will be added. +* +* @param string|string[] $shortContext A message name or an array of message names. +* @param string|string[] $longContext A message name or an array of message names. * @param string|Language $lang Language to use for processing messages * @return Message */ @@ -286,10 +296,6 @@ } else { $msgs = $this->getErrorMessageArray( $rawErrors, $lang ); $msgCount = count( $msgs ); - - if ( $shortContext ) { - $msgCount++; - } $s = new RawMessage( '* $' . implode( "\n* \$", range( 1, $msgCount ) ) ); $s->params( $msgs )->parse(); -- To view, visit https://gerrit.wikimedia.org/r/293165 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibdf40ff13a4a9d294a6bc6f778a14fb2633c2f70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Gergő Tisza___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Copy from DOM instead of using vector-view-edit - change (mediawiki...GuidedTour)
Mattflaschen has uploaded a new change for review. https://gerrit.wikimedia.org/r/293159 Change subject: Copy from DOM instead of using vector-view-edit .. Copy from DOM instead of using vector-view-edit This solves a CI issue with message dependencies. Bug: T132989 Change-Id: I4b355214dd0480d803e3882cfa29636d4cf4c9c4 --- M extension.json M i18n/en.json M modules/tours/firstedit.js M modules/tours/firsteditve.js 4 files changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GuidedTour refs/changes/59/293159/1 diff --git a/extension.json b/extension.json index 02c27a1..9e246fe 100644 --- a/extension.json +++ b/extension.json @@ -93,7 +93,6 @@ "editsection", "savearticle", "showpreview", - "vector-view-edit", "guidedtour-tour-firstedit-edit-page-title", "guidedtour-tour-firstedit-edit-page-description", "guidedtour-tour-firstedit-edit-section-title", @@ -109,7 +108,6 @@ "dependencies": "ext.guidedTour", "messages": [ "editsection", - "vector-view-edit", "visualeditor-toolbar-savedialog", "guidedtour-tour-firstedit-edit-page-title", "guidedtour-tour-firsteditve-edit-page-description", diff --git a/i18n/en.json b/i18n/en.json index 64692a3..d45cfcc 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -24,7 +24,7 @@ "guidedtour-tour-test-launch-tour-description": "Guiders can launch other guided tours. Pretty cool, huh?", "guidedtour-tour-test-launch-using-tours": "Launch a tour on using tours", "guidedtour-tour-firstedit-edit-page-title": "{{GENDER:|Edit}} the whole page…", - "guidedtour-tour-firstedit-edit-page-description": "{{GENDER:|Click}} the \"{{int:vector-view-edit}}\" button to make your changes.", + "guidedtour-tour-firstedit-edit-page-description": "{{GENDER:|Click}} the \"$1\" button to make your changes.", "guidedtour-tour-firstedit-edit-section-title": "Or {{GENDER:|edit}} a section", "guidedtour-tour-firstedit-edit-section-description": "There are \"{{int:editsection}}\" links for each major section in a page, so you can focus on just that part.", "guidedtour-tour-firstedit-preview-title": "{{GENDER:|Preview}} your changes (optional)", diff --git a/modules/tours/firstedit.js b/modules/tours/firstedit.js index 870f3f7..622a4a7 100644 --- a/modules/tours/firstedit.js +++ b/modules/tours/firstedit.js @@ -26,7 +26,10 @@ tour.firstStep( { name: 'intro', titlemsg: 'guidedtour-tour-firstedit-edit-page-title', - descriptionmsg: 'guidedtour-tour-firstedit-edit-page-description', + description: mw.message( + 'guidedtour-tour-firstedit-edit-page-description', + $( '#ca-edit a' ).text() + ).parse(), attachTo: '#ca-edit', position: 'bottom', allowAutomaticNext: false, diff --git a/modules/tours/firsteditve.js b/modules/tours/firsteditve.js index beda919..c1a17d4 100644 --- a/modules/tours/firsteditve.js +++ b/modules/tours/firsteditve.js @@ -41,7 +41,7 @@ editPageDescription = mw.message( 'guidedtour-tour-firsteditve-edit-page-description', - mw.message( 'vector-view-edit' ).parse() + $( '#ca-edit a' ).text() ).parse(); editSectionDescription = mw.message( -- To view, visit https://gerrit.wikimedia.org/r/293159 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b355214dd0480d803e3882cfa29636d4cf4c9c4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GuidedTour Gerrit-Branch: master Gerrit-Owner: Mattflaschen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits