Page MenuHomePhabricator

Remove the Revision class [1.37]
Closed, ResolvedPublic

Description

Following T246284: Hard deprecate the Revision class all uses of Revision objects, and the class itself, can be removed in 1.37.

Specifically:

  • The Revision class itself is deleted
  • The following hooks are deleted
    • ArticleRevisionUndeleted - use RevisionUndeleted
    • ArticleRollbackComplete - use RollbackComplete
    • DiffRevisionTools - use DiffTools
    • DiffViewHeader - use DifferenceEngineViewHeader
    • HistoryRevisionTools - use HistoryTools
    • NewRevisionFromEditComplete - use RevisionFromEditComplete
    • PageContentInsertComplete - use PageSaveComplete
    • PageContentSaveComplete - use PageSaveComplete
    • ParserFetchTemplate - use BeforeParserFetchTemplateRevisionRecord
    • RevisionInsertComplete - use RevisionRecordInserted
    • TitleMoveComplete - use PageMoveComplete
    • TitleMoveCompleting - use PageMoveCompleting
    • UndeleteShowRevision - no replacement
    • UserRetrieveNewTalks - no replacement
  • The following methods and variables are removed
    • Article::$mRevision
    • Article::getRevisionFetched()
    • ContribsPager::tryToCreateValidRevision()
    • EditPage::$mBaseRevision
    • EditPage::getBaseRevision()
    • LinksUpdate::getRevision()
    • LinksUpdate::setRevision()
    • PageArchive::getArchivedRevision()
    • PageArchive::getPreviousRevision()
    • PageArchive::getRevision()
    • Parser::$mRevisionObject
    • Parser::fetchCurrentRevisionOfTitle()
    • Parser::getRevisionObject()
    • Parser::statelessFetchRevision()
    • ParserOptions::getCurrentRevisionCallback()
    • ParserOptions::setCurrentRevisionCallback()
    • Title::countAuthorsBetween()
    • Title::getFirstRevision()
    • User::getNewMessageLinks()
    • User::getNewMessageRevisionId()
    • User::setNewtalk()
    • WikiPage::getOldestRevision()
    • WikiPage::getRevision()
    • WikiPage::getUndoContent()
    • WikiPage::updateIfNewerOn()
  • The following methods no longer accept Revision objects as parameters:
    • CategoryMembershipChange::__construct()
    • ContentHandler::getUndoContent()
    • DerivedPageDataUpdater::prepareUpdate()
    • DifferenceEngine::getRevisionHeader()
    • Linker::buildRollbackLink()
    • Linker::generateRollback()
    • Linker::getRevDeleteLink()
    • Linker::getRollbackEditCount()
    • Linker::revComment()
    • Linker::revUserLink()
    • Linker::revUserTools()
    • WikiPage::doDeleteUpdates()
    • WikiPage::doEditUpdates()
    • WikiPage::hasDifferencesOutsideMainSlot()
    • WikiPage::onArticleEdit()
    • WikiPage::prepareContentForEdit()
    • WikiPage::updateRevisionOn()

Also:

  • The following methods return arrays that formerly included a 'revision' key that would emit deprecation warnings when accessed and return a Revision object. The Revision object has been removed from the arrays, and the 'revision-record' key should be used to get the relevant RevisionRecord instead:
    • PageUpdater::doCreate()
    • PageUpdater::doModify()
    • Parser::statelessFetchTemplate()
    • WikiPage::doEditContent()
  • The ParserOptions templateCallback option is a callback that is called in Parser::fetchTemplateAndTitle() and should return an array - the 'revision' key to that array used to be a Revision object and was used if no 'revision-record' was returned - it is now ignored.
  • Previously, the classes RevisionTestModifyableContent and RevisionTestModifyableContentHandler were loaded for use in tests, but were only used within the tests for the since-removed Revision class. This content and content handler class were removed without deprecation.

Details

Show related patches Customize query in gerrit

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 614026 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/Video@master] Stop running the UndeleteShowRevision hook, require 1.36+

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

Change 614027 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Remove unused hooks that use Revision objects

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

Change 614027 abandoned by DannyS712:
[mediawiki/core@master] Remove unused hooks that use Revision objects

Reason:

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

Change 614026 abandoned by DannyS712:
[mediawiki/extensions/Video@master] Stop running the UndeleteShowRevision hook, require 1.36+

Reason:

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

DannyS712 renamed this task from Remove deprecated revision methods [1.36] to Remove the Revision class [1.37].Sep 29 2020, 12:32 PM
DannyS712 changed the task status from Open to Stalled.
DannyS712 removed a project: Patch-For-Review.

Waiting until 1.37

DannyS712 changed the status of subtask T248423: Remove Revision::getTimestampFromId from Open to Stalled.
DannyS712 changed the status of subtask T248424: Remove Revision::newFromPageId from Open to Stalled.
DannyS712 changed the status of subtask T246411: Remove Revision::userCanBitfield from Open to Stalled.
DannyS712 changed the status of subtask T248504: Remove Revision::newFromRow from Open to Stalled.
DannyS712 changed the status of subtask T245703: Remove Revision::newNullRevision from Open to Stalled.
DannyS712 changed the status of subtask T248549: Remove Revision::getRevisionText from Open to Stalled.
DannyS712 changed the status of subtask T250705: Remove Revision::newFromTitle from Open to Stalled.
DannyS712 changed the status of subtask T254704: Remove Revision::newFromId from Open to Stalled.
DannyS712 changed the task status from Stalled to Open.Apr 11 2021, 8:41 PM

1.36 was branched, master is now 1.37

Change 678414 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Remove hooks that use Revision objects

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

Change 681377 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/extensions/FlaggedRevs@master] Stop running the NewRevisionFromEditComplete hook

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

Change 681379 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Start removing places using Revision objects

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

Change 681380 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/extensions/WikibaseMediaInfo@master] Stop mocking WikiPage::getRevision

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

Change 681381 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Remove Revision from PageArchive

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

Change 681644 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Linker: remove support for Revision parameters

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

Change 681380 merged by jenkins-bot:

[mediawiki/extensions/WikibaseMediaInfo@master] WikibaseMediaInfoHooksTest: fix WikiPage mock

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

Change 681730 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] WikiPage: remove use of Revision objects

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

Change 681377 merged by jenkins-bot:

[mediawiki/extensions/FlaggedRevs@master] Stop running the NewRevisionFromEditComplete hook

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

Change 678414 merged by jenkins-bot:

[mediawiki/core@master] Remove hooks that use Revision objects

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

Change 681379 merged by jenkins-bot:

[mediawiki/core@master] Start removing places using Revision objects

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

Change 681381 merged by jenkins-bot:

[mediawiki/core@master] Remove Revision from PageArchive

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

Change 683957 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Remove deprecated talk page message handling in User class

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

Change 683964 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Remove the rest of the places Revision objects are used

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

Change 683965 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] ApiRevisionDeleteTest: remove use of Revision objects

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

Change 683965 merged by jenkins-bot:

[mediawiki/core@master] ApiRevisionDeleteTest: remove use of Revision objects

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

Change 684071 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] EPIC: Remove the Revision class entirely

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

Change 684072 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/extensions/Wikibase@master] Require MW 1.37+ and remove support for Revision objects

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

Change 684073 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/extensions/EntitySchema@master] Require MW 1.37+ and remove support for Revision objects

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

Change 684074 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/services/parsoid@master] Extension: require MW 1.37+ and remove support for Revision objects

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

Okay, we're getting close! Current status:
First couple patches, removing the hooks that use Revision objects and starting to remove deprecated support for Revision in other places, has already merged and will go out with the train.
Next batch is ready to go, but I'm waiting until after the train to split them up a bit. Once https://gerrit.wikimedia.org/r/c/mediawiki/core/+/683964 merges, the only remaining use of Revision in core will be in the Revision class itself, and in its tests. At that point

  • update extensions that, like core, supported deprecated Revision object parameters: Wikibase (repo), EntitySchema, and Parsoid
  • Wait for a new version of Parsoid to be tagged and deployed to vendor
  • Wait at least a week since the rest of the changes to remove the uses of the Revision class in core

Then we can merge the actual removal (https://gerrit.wikimedia.org/r/c/mediawiki/core/+/684071)

Change 684075 had a related patch set uploaded (by DannyS712; author: DannyS712):

[mediawiki/core@master] Post Revision-removal cleanup

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

Change 681644 merged by jenkins-bot:

[mediawiki/core@master] Linker: remove support for Revision parameters

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

Change 681730 merged by jenkins-bot:

[mediawiki/core@master] WikiPage: remove use of Revision objects

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

Change 683957 merged by jenkins-bot:

[mediawiki/core@master] Remove deprecated talk page message handling in User class

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

Change 683964 merged by jenkins-bot:

[mediawiki/core@master] Remove remaining non-test uses of Revision objects

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

Okay, we're getting close! Current status:
First couple patches, removing the hooks that use Revision objects and starting to remove deprecated support for Revision in other places, has already merged and will go out with the train.
Next batch is ready to go, but I'm waiting until after the train to split them up a bit. Once https://gerrit.wikimedia.org/r/c/mediawiki/core/+/683964 merges, the only remaining use of Revision in core will be in the Revision class itself, and in its tests. At that point

  • update extensions that, like core, supported deprecated Revision object parameters: Wikibase (repo), EntitySchema, and Parsoid
  • Wait for a new version of Parsoid to be tagged and deployed to vendor
  • Wait at least a week since the rest of the changes to remove the uses of the Revision class in core

Then we can merge the actual removal (https://gerrit.wikimedia.org/r/c/mediawiki/core/+/684071)

Update: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/683964 has merged, so the only use of Revision objects in core is in the Revision class itself and its tests. Now its time to update extensions that still support Revision object parameters:

Change 684074 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Extension: require MW 1.37+ and remove support for Revision objects

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

Change 684072 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Repo: remove support for Revision objects

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

Change 684073 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Remove support for Revision objects

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

Okay, all deployed extensions have been updated, just need to wait for a new version of parsoid to be tagged, released, and used

Hopeful timeline:

  • New version of parsoid tagged and used before the branch cut on Monday
  • Merge actual removal of the Revision class later this week, to roll out on a later branch

Okay, all deployed extensions have been updated, just need to wait for a new version of parsoid to be tagged, released, and used

Hopeful timeline:

  • New version of parsoid tagged and used before the branch cut on Monday
  • Merge actual removal of the Revision class later this week, to roll out on a later branch

So the latest version of parsoid 0.14.0-a4 was tagged and released, and /vendor was updated in time for 1.37.0-wmf.7, so this should be good to go with the removal being merged, but to be on the safe side I'd like to wait until 1.37.0-wmf.7 is rolled out everywhere and stable, in case it might be reverted. We can merge the actual removal once T281148 is done

Change 684071 merged by jenkins-bot:

[mediawiki/core@master] EPIC: Remove the Revision class entirely

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

Change 699314 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] GenericZObjectsTest: Account for upstream deleting the Revision class

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

Change 699314 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] GenericZObjectsTest: Account for upstream deleting the Revision class

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

This is almost done, the actual class was removed. Also that is left is a cleanup patch (https://gerrit.wikimedia.org/r/c/mediawiki/core/+/684075) but we are waiting until after the next train, to make sure its easy to revert the actual removal if it turns out to be needed (see T281152#7150360)

Change 684075 merged by jenkins-bot:

[mediawiki/core@master] Post Revision-removal cleanup

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

DannyS712 removed a project: Patch-For-Review.

Train was cut and is proceeding, cleanup patch has merged, this is finally done