Page MenuHomePhabricator

Preparing ContentTranslation for Parsoid-PHP switch
Closed, ResolvedPublic0 Estimated Story Points

Description

This is a tracker task to figure out testing / qa needs and any work / changes needed to VisualEditor to switchover from Parsoid/JS to Parsoid/PHP.

T229015: Tracking: Direct live production traffic at Parsoid/PHP is the tracker task for deployment. But, we don't anticipate a deploy before mid-September 2019 at this time. But, let us handle this as if we are going to be deploying around mid to end September.

Since CX talks to RESTBase, there is nothing that will change on that end. However, T229025: Add ability to RESTBase to partition client traffic to Parsoid/PHP and T229018: RESTBase should be able to store Parsoid/PHP contents in Cassandra alongwith Parsoid/JS contents implies that CX might have to handle cookies tracking which version of Parsoid generated its HTML unless we come with a mechanism for handling it in RESTBase / Parsoid that is transparent to clients. But, for now, it is probably safe to assume that CX might need to handle a cookie related to this.

We will also do an early deployment to the beta cluster so that clients can do early testing there. But, please comment on the ticket / edit the description adding any other requirements to ensure we cover all our bases.

Using Parsoid/PHP with VE (Note copied from T229074)

In order to test Parsoid/PHP output and transformations, the client (VE) needs to send the X-Parsoid-Variant: php header with the request. This needs to be done consistently for the same domain, i.e. all VE -> RB requests (both GETs and POSTs) need to contain the header for the domain in question (one can go on a per-session basis as well but this is prone to errors). An important thing to note here: this means that even initial GET requests need to be made explicitly with the header. This means that VE cannot use preloaded content for such edits, as it will result in a 404 from RESTBase during transforms.

Event Timeline

ssastry renamed this task from Preparing ContentTranslation fo Parsoid-PHP switch to Preparing ContentTranslation for Parsoid-PHP switch.Jul 26 2019, 12:45 AM

@ssastry, when it is ready, let us know. We can do required testing and changes if any.

@ssastry, when it is ready, let us know. We can do required testing and changes if any.

We are ready for you to start testing starting Monday.

@ssastry, when it is ready, let us know. We can do required testing and changes if any.

We are ready for you to start testing starting Monday.

RESTBase support for Parsoid/PHP is now live in both Beta and production, so you can start using the X-Parsoid-Variant: php header to have pages parsed and transformed using Parsoid/PHP.

@mobrovac @ssastry How do I know that the response is coming from Parsoid/PHP? Am I doing this correctly here? I see x-parsoid-variant: js in the response and I guess we expect PHP there?

$ curl -I -H "X-Parsoid-Variant: php" https://en.wikipedia.org/api/rest_v1/page/html/Sushi  
HTTP/2 200 
date: Tue, 29 Oct 2019 06:44:10 GMT
content-type: text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/HTML/2.1.0"
content-language: en
cache-control: s-maxage=1209600, max-age=0, must-revalidate
x-parsoid-variant: js
access-control-allow-origin: *
access-control-allow-methods: GET,HEAD

@santhosh try again now :)

Ok, I get x-parsoid-variant: php now.

$ curl -I -H "X-Parsoid-Variant: php" https://en.wikipedia.org/api/rest_v1/page/html/Sushi  
HTTP/2 200 
date: Tue, 29 Oct 2019 07:04:12 GMT
content-type: text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/HTML/2.1.0"
cache-control: s-maxage=1209600, max-age=0, must-revalidate
content-language: en
x-parsoid-variant: php
access-control-allow-origin: *

We have enabled X-Parsoid-Variant: php in our cxserver labs instance so that our testing systems will use output coming from parsoid/PHP

https://gerrit.wikimedia.org/r/c/mediawiki/services/cxserver/+/546908 is cherrypicked to cxserver.wmflabs.org

We have enabled X-Parsoid-Variant: php in our cxserver labs instance so that our testing systems will use output coming from parsoid/PHP

https://gerrit.wikimedia.org/r/c/mediawiki/services/cxserver/+/546908 is cherrypicked to cxserver.wmflabs.org

Thanks! Let us know if your test reveals any bugs. If all goes well, we are hoping to switch over all services the week before Thanksgiving.

Language Team: We want to catch problems sooner than later, so checking in about updates on how testing is going here. Anything that you need from us? Or, is everything looking good on your end?

Language team: As of yesterday, new code is on both beta cluster and production that can handle new pages. You may have already inferred it by the resolution of the blocking subtask, but just in case you hadn't, this is FYI about it.

So, please continue testing again. Thanks!

Change 551734 had a related patch set uploaded (by Mobrovac; owner: Mobrovac):
[mediawiki/services/cxserver@master] [DO NOT MERGE] Test for Parsoid/PHP

https://gerrit.wikimedia.org/r/551734

test.wikipedia.org and test2.wikipedia.org have been switched to serve Parsoid/PHP HTML only. Please test and report any issues you spot.

Change 551734 abandoned by Mobrovac:
[DO NOT MERGE] Test for Parsoid/PHP

https://gerrit.wikimedia.org/r/551734