Page MenuHomePhabricator

Factor PageStore and PageRecord out of WikiPage
Closed, ResolvedPublic1 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
OpenBUG REPORTNone
OpenNone
StalledNone
OpenNone
OpenNone
DuplicateNone
OpenFeatureNone
DuplicateNone
OpenFeatureNone
ResolvedNone
OpenNone
OpenNone
OpenFeatureNone
OpenNone
ResolvedNone
ResolvedNone
OpenFeatureNone
OpenNone
OpenFeatureNone
StalledNone
OpenNone
Opendaniel
Openpmiazga
ResolvedNone
InvalidNone
OpenNone
ResolvedNone
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
Resolveddaniel
ResolvedJdforrester-WMF
ResolvedPRODUCTION ERRORUmherirrender
Resolveddaniel
Resolveddaniel
Resolveddaniel
ResolvedPeter.ovchyn
Resolveddaniel

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
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

Change 714823 had a related patch set uploaded (by Krinkle; author: Bartosz Dziewoński):

[mediawiki/core@master] PageStore: Pass query flags to getPageByName()

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

Change 714823 merged by jenkins-bot:

[mediawiki/core@master] PageStore: Pass query flags to getPageByName()

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

Change 714684 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@wmf/1.37.0-wmf.20] PageStore: Pass query flags to getPageByName()

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

Change 714684 merged by jenkins-bot:

[mediawiki/core@wmf/1.37.0-wmf.20] PageStore: Pass query flags to getPageByName()

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

Mentioned in SAL (#wikimedia-operations) [2021-08-25T21:32:48Z] <urbanecm@deploy1002> Synchronized php-1.37.0-wmf.20/includes/page/PageStore.php: rMW34fb2b99104d: PageStore: Pass query flags to getPageByName() (T289717; T195069) (duration: 01m 06s)

Change 715051 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] PageStore: Pass query flags to getPageById() too

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

Change 714864 had a related patch set uploaded (by Ahmon Dancy; author: Bartosz Dziewoński):

[mediawiki/core@wmf/1.37.0-wmf.20] PageStore: Pass query flags to getPageById() too

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

Change 715051 merged by jenkins-bot:

[mediawiki/core@master] PageStore: Pass query flags to getPageById() too

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

Change 714864 merged by jenkins-bot:

[mediawiki/core@wmf/1.37.0-wmf.20] PageStore: Pass query flags to getPageById() too

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

Mentioned in SAL (#wikimedia-operations) [2021-08-26T17:26:26Z] <dancy@deploy1002> Synchronized php-1.37.0-wmf.20/includes/page/PageStore.php: Backport: [[gerrit:714864|PageStore: Pass query flags to getPageById() too (T289717 T195069)]] (duration: 01m 05s)