Page MenuHomePhabricator

Hard deprecate Revision::getContent(Model|Handler|Format)
Closed, ResolvedPublic

Description

Only remaining deployed uses are in core. Some already have patches pending from related fixes to the same code.

getContentHandler:

getContentModel

getContentFormat

Event Timeline

DannyS712 triaged this task as Medium priority.Apr 24 2020, 4:00 AM
DannyS712 created this task.
DannyS712 moved this task from Unsorted to In progress on the User-DannyS712 board.

Change 587904 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Replace uses and hard deprecate Article::getRevisionFetched

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

Change 592318 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] RollbackAction: Reduce uses of Revision objects

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

Change 591524 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] SpecialUndelete: Make showDiff private, use RevisionRecord

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

DannyS712 renamed this task from Hard deprecate Revision::getContentHandler to Hard deprecate Revision::getContent(Model|Handler|Format).Apr 27 2020, 7:06 AM
DannyS712 updated the task description. (Show Details)
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptApr 27 2020, 7:06 AM

Change 591524 merged by jenkins-bot:
[mediawiki/core@master] SpecialUndelete: Make showDiff private, use RevisionRecord

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

DannyS712 updated the task description. (Show Details)Apr 27 2020, 5:43 PM

Change 592732 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] FeedUtils: Remove use of Revision objects

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

Change 587904 merged by jenkins-bot:
[mediawiki/core@master] Replace uses and hard deprecate Article::getRevisionFetched

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

DannyS712 updated the task description. (Show Details)Apr 27 2020, 6:37 PM

Change 592736 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] SpecialComparePages: Remove use of Revision objects

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

DannyS712 updated the task description. (Show Details)Apr 27 2020, 6:43 PM
DannyS712 updated the task description. (Show Details)

Change 592732 merged by jenkins-bot:
[mediawiki/core@master] FeedUtils: Remove use of Revision objects

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

Change 592736 merged by jenkins-bot:
[mediawiki/core@master] SpecialComparePages: Remove use of Revision objects

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

DannyS712 updated the task description. (Show Details)May 1 2020, 7:44 PM
DannyS712 updated the task description. (Show Details)May 4 2020, 5:49 PM

Once the ResourceLoaderWikiModule::invalidateModuleCache patch merges, will send a patch following the rollback patch to make the hard deprecations (waiting for the first patch to merge to avoid merge conflicts)

Change 592318 merged by jenkins-bot:
[mediawiki/core@master] RollbackAction: Reduce uses of Revision objects

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

DannyS712 updated the task description. (Show Details)May 20 2020, 8:55 PM

https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/587571/ is the only thing blocking hard deprecation of these

Change 587571 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Use RevisionRecord in ResourceLoaderWikiModule::invalidateModuleCache

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

@daniel can you take a look? The patch has a -2 from @Krinkle asking Is this what typical/random code should do in order to get the content format of a revision? It seems like a lot of hard-to-get-right easy-to-forget boiler plate. Do we want to spread out and copy around this business logic? Or is/should there be a high-level thing for this? (where "this" refers to, when the main slot of a revision has no format defined, using ContentHandlerFactory::getContentHandler() for the main slot's model, and then ContentHandler::getDefaultFormat() to get the format if I'm understanding @Krinkle's concerns right)

@Krinkle fixed to use content model - can you take another look?

DannyS712 updated the task description. (Show Details)May 27 2020, 11:19 PM

Change 599138 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] EditPage::edit - remove use of Revision objects

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

Change 599138 merged by jenkins-bot:
[mediawiki/core@master] EditPage::edit - remove use of Revision objects

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

DannyS712 updated the task description. (Show Details)May 28 2020, 3:31 AM

@Krinkle fixed to use content model - can you take another look?

{{ping}}

Change 587571 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Use RevisionRecord in WikiModule::invalidateModuleCache

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

Change 602188 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Hard deprecate Revision::getContent(Model|Handler|Format)

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

DannyS712 updated the task description. (Show Details)Jun 3 2020, 11:55 PM

Change 602188 merged by jenkins-bot:
[mediawiki/core@master] Hard deprecate Revision::getContent(Model|Handler|Format)

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

DannyS712 closed this task as Resolved.Jun 4 2020, 2:13 AM