Page MenuHomePhabricator

Test roundtrip-test.js locally and verify it works with a Parsoid/PHP endpoint
Closed, ResolvedPublic

Description

The current understanding is that roundtrip-test.js script should work as is against Parsoid/PHP since it simply posts to an API endpoint. We need to test and verify that this is the case.

Event Timeline

ssastry triaged this task as High priority.Jul 30 2019, 4:00 PM
ssastry moved this task from Backlog to Deployment on the Parsoid-PHP board.

The parsoid config is only used to get prefixes, which isn't really needed.

The parsoid config is only used to get prefixes, which isn't really needed.

Alright , that's good!

How do we pass in the rt testing flag to Parsoid? Metrics and logging? Linting, etc.

So, overall, I would feel better if we resolved this task (by testing this locally and confirming that everything works. Feel free to retitle and update description to capture actual work involved.

How do we pass in the rt testing flag to Parsoid?

rtTestMode is a property of the SiteConfig.

There's some discussion about that in https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/525341

Metrics and logging? Linting, etc.

We haven't got those working yet, have we? But in any case, those would presumably also be part of the SiteConfig.

Since it's up to Parsoid's caller to pass the SiteConfig, how and where that configuration takes place is outside its purview. In this case, the MediaWiki extension probably gets its conf from LocalSettings.php

All the roundtrip test script really wants is a --parsoidURL

Let me retitle this and create a new task for the local settings piece.

ssastry renamed this task from Adapt roundtrip-test.js for Parsoid/PHP to Test roundtrip-test.js locally and verify it works with a Parsoid/PHP endpoint.Jul 30 2019, 4:45 PM
ssastry updated the task description. (Show Details)

Change 527654 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Update docs about using the core rest api

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

A quick test with, node bin/roundtrip-test.js --domain ve --parsoidURL http://localhost/rest.php "Main Page", is returning,

'data-parsoid': 
   { headers: { 'content-type': 'application/json; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/data-parsoid/2.1.0"' },
     body: null } }
{\"message\":\"Invalid data-parsoid was provided.\",\"httpCode\":400,\"httpReason\":\"Bad Request\"}

So data-parsoid is staying inline in the response ... probably an indication that $env->pageBundle isn't true

Change 527654 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Update docs about using the core rest api

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

Change 527843 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Add some support for "pageBundle" to the entrypoint

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

With that ^ the rt test script at least runs

Change 527843 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Add some support for "pageBundle" to the entrypoint

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

Change 528218 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Match php storeInPageBundle with js

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

Change 528218 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Match php storeInPageBundle with js

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

Change 528248 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Enable selser in the php extension for the time being

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

Change 528248 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Enable selser in the php extension for the time being

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

Change 532717 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Resolve port-fix in DOMDataUtils

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

Change 532717 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Resolve semver PORT-FIXME in DOMDataUtils

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