Page MenuHomePhabricator

Factor PageStore and PageRecord out of WikiPage
Open, MediumPublic1 Estimated Story Points

Description

Functionality related to updating the page table should be moved from WikiPage into a stateless PageStore service. For this purpose, entries in the page table are to be represented by PageRecord value objects.

Introducing a PageStore seems like a good opportunity to consolidate LinkCache with the internal title cache Logic in the Title class, and allow more code to be based on LinkTarget and PageIdentity (T208776) without being bound to Title.

Ad hoc draft of service interfaces:

interface PageLookup {
  function getPageById( int $pageId ) : ?PageRecord;
  function getPage( PageIdentity $identity ) : ?PageRecord;
  function getPageIdentity( int $namespace, string $name ) : PageIdentity;
}

interface PageBatchLookup {
  function getPageBatch( array $rows ) : array; // PageRecord[]
  function getPageIdentityBatch( array $rows ) : array; // PageIdentity[]
}

interface PageUpdaterFactory extends PageLookup  {
  function getPageUpdater( PageIdentity $page, User $actor ) : PageUpdater;
}

interface PageUpdaterBackend  { // internal, for use with PageUpdater
  function insertPageOn( PageIdentity $page, IDatabase $dbw );
  function updateRevisionOn( PageIdentity $page, RevisionRecord $revision, IDatabase $dbw, $options = [] );
}

interface PageStateBackend  { // internal, for use with LinksUpdate
  function updateTouched( PageIdentity $page, string $timestamp = null );
}

Note that this does not block T174038: Initial implementation of MCR page update interface, nor does it block T194750: Deploy Structured Data on Commons baseline .

Related Objects

StatusSubtypeAssignedTask
Declineddchen
OpenNone
OpenNone
DuplicateNone
OpenNone
OpenNone
OpenNone
StalledNone
OpenNone
DuplicateNone
ResolvedNone
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedppelberg
ResolvedKrinkle
OpenNone
ResolvedNone
ResolvedNone
StalledNone
OpenNone
OpenNone
Opendaniel
OpenNone
OpenNone
OpenNone
OpenNone
Resolveddaniel
Resolveddaniel
Opendaniel
Resolveddaniel
Opendaniel
Resolveddaniel
ResolvedJdforrester-WMF
ResolvedPRODUCTION ERRORUmherirrender
Resolveddaniel
Resolveddaniel
Resolveddaniel
ResolvedPeter.ovchyn
Opendaniel
OpenNone

Event Timeline

Vvjjkkii renamed this task from Factor PageStore and PageRecord out of WikiPage to qocaaaaaaa.Jul 1 2018, 1:09 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from qocaaaaaaa to Factor PageStore and PageRecord out of WikiPage.Jul 1 2018, 6:22 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

Change 425774 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] [MCR][Experiment] Introduce PageIdentity interface

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

Change 425774 abandoned by Daniel Kinzler:
[MCR][Experiment] Introduce PageIdentity interface

Reason:
I41f238dee0d38

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

daniel updated the task description. (Show Details)

Adding to PET roadmap per "Expedition: MVC" proposal

Change 644281 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] DNM: Introduce PageRecord interface

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

WDoranWMF set the point value for this task to 1.Feb 1 2021, 4:19 PM

Change 662927 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] WIP: Introduce PageStore

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

Change 662927 merged by jenkins-bot:
[mediawiki/core@master] Introduce PageStore

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