Page MenuHomePhabricator

Use PHP Virtual REST Service to access Parsoid
Closed, ResolvedPublic8 Story Points

Description

Write a Parsoid backend for VirtualRestService, and replace VisualEditor's and Flow's hacks with that. Incorporate the cookie forwarding hacks from VE as well.

See https://www.mediawiki.org/wiki/Requests_for_comment/PHP_Virtual_REST_Service and https://github.com/wikimedia/mediawiki/tree/master/includes/libs/virtualrest

This would also be a good opportunity to clean up the way the Parsoid URL (and whether it's available) is configured in mediawiki-config

See also: T74988

Related Objects

StatusAssignedTask
OpenNone
OpenNone
ResolvedKrenair
Resolved GWicke
Resolved GWicke
Resolved GWicke
Resolvedfgiunchedi
Resolvedfgiunchedi
ResolvedCmjohnson
ResolvedCmjohnson
ResolvedJoe
Resolvedfgiunchedi
Resolved GWicke
Resolved Jdouglas
Resolved GWicke
Resolved GWicke
ResolvedArlolra
Resolved GWicke
Resolvedmobrovac
Resolvedmobrovac
Resolvedmobrovac
Resolvedmobrovac
Duplicate Jdouglas
ResolvedAndrew
Resolved GWicke
Resolvedfgiunchedi
Resolvedfgiunchedi
Resolvedfgiunchedi
ResolvedEevans
Resolvedfgiunchedi
Resolved GWicke
Resolved GWicke
Resolvedfgiunchedi
Resolvedmobrovac
Resolved GWicke

Event Timeline

bd808 created this task.Nov 10 2014, 9:53 PM
bd808 raised the priority of this task from to Normal.
bd808 updated the task description. (Show Details)
bd808 added a project: Scrum-of-Scrums.
bd808 changed Security from none to None.
Catrope renamed this task from use PHP Virtual REST Service to access Parsoid on private wikis (e.g. officewiki) to Use PHP Virtual REST Service to access Parsoid.Dec 16 2014, 8:25 PM
Catrope updated the task description. (Show Details)
Jdforrester-WMF raised the priority of this task from Normal to High.Dec 16 2014, 8:27 PM
Catrope updated the task description. (Show Details)Dec 16 2014, 10:00 PM
GWicke added a subscriber: GWicke.EditedDec 16 2014, 10:06 PM

It might be nice to model the internal interface somewhat similar to the way the RESTBase interface will look like:

  • GET /v1/local/page/Foo/html/123456 -- HTML for page Foo at revision 123456
  • GET /v1/local/page/Foo/data-mw/123456 -- data-mw for same
  • POST /v1/local/convert/html/to/wikitext -- convert html to wikitext, body tbd

The local bit here could be shorthand for the local domain / wiki. Page titles are percent-encoded, so slashes are no problem.

The cookie authentication business should be doable in the virtualrest backend handler for the parsoid end point, so that users don't need to deal with it. The backend is also the only place that needs to deal with actual host names etc from the config.

GWicke updated the task description. (Show Details)Dec 16 2014, 10:51 PM
GWicke added a subscriber: aaron.
Krenair claimed this task.Dec 18 2014, 8:53 PM

I ran into issues with the way I was trying to use VirtualRESTService. My onResponses function was not getting called. Aaron said "seems like there should be a $execReqsByService for the second loop to over so onReponse is called for non-replaced requests too" (referring to code in VirtualRESTServiceClient::runMulti)

Change 181011 had a related patch set uploaded (by Alex Monk):
Make a VirtualRESTService class for Parsoid, and use it

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

Patch-For-Review

I ran into issues with the way I was trying to use VirtualRESTService. My onResponses function was not getting called. Aaron said "seems like there should be a $execReqsByService for the second loop to over so onReponse is called for non-replaced requests too" (referring to code in VirtualRESTServiceClient::runMulti)

We fixed the issue I was running into in https://gerrit.wikimedia.org/r/181121, @aaron made https://gerrit.wikimedia.org/r/181119 to fix the issue we found last night.

@Krenair: Ahh, great news! @aaron: Thank you!

ssastry moved this task from Backlog to In Progress on the Parsoid board.Dec 20 2014, 4:28 AM
Krenair moved this task from Backlog to Doing on the VisualEditor-MediaWiki board.Dec 20 2014, 6:17 AM
Krenair moved this task from Bug Fixes to Blocked on the VisualEditor board.

Change 181706 had a related patch set uploaded (by Alex Monk):
Make a VirtualRESTService class for Parsoid

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

Patch-For-Review

Change 181706 merged by jenkins-bot:
Make a VirtualRESTService class for Parsoid

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

Change 181011 merged by jenkins-bot:
Use ParsoidVirtualRESTService

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

Jdforrester-WMF moved this task from Blocked to Q4 on the VisualEditor board.Jan 7 2015, 9:18 PM
Krenair moved this task from Doing to Done on the VisualEditor-MediaWiki board.Jan 7 2015, 9:29 PM
Jdforrester-WMF edited a custom field.Feb 2 2015, 7:43 PM
Milimetric moved this task from Scheduled to Done on the Scrum-of-Scrums board.Feb 25 2015, 6:56 PM