Page MenuHomePhabricator

Parsoid PageConfigFactory should accept a revision record, not wikitextOverride
Closed, ResolvedPublic

Description

You can create a new MutableRevisionRecord if you want to override wikitext, but in most cases the input to PageConfigFactory is a revision.

Right now we pass in the revid and then have a lot of tricky code in PageConfigFactory::create() to lookup the revid and/or create a MutableRevisionRecord. This code should be moved into the callers -- ParserTestRunner (for example) already has code to create a mock RevisionRecord with a specific revid and wikitext for its test cases.

This would also allow parser tests to override $revId for tests like the legacy parser does. With the lookup embedded inside PageConfigFactory::create() it's difficult to supply a fake revID without causing the lookup in PageConfigFactory to break.

Event Timeline

ssastry triaged this task as Medium priority.Dec 16 2020, 4:36 PM
ssastry updated the task description. (Show Details)
ssastry moved this task from Needs Triage to Tech Debt / Big changes on the Parsoid board.

Change 785130 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/core@master] WIP: Have Parsoid\Config\PageConfigFactory take a revision record

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

Change 785130 merged by jenkins-bot:

[mediawiki/core@master] Have Parsoid\Config\PageConfigFactory take a rev instead of wikitext

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