Page MenuHomePhabricator

Create a new UndeletePage command object
Closed, ResolvedPublic3 Estimated Story Points

Description

This will replace PageArchive::undeleteAsUser (and dependencies).

Event Timeline

Change 715565 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Move code from PageArchive to a new DeletePage command

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

Change 715567 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] DeletePage cleanup, part 1

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

Change 715578 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Change return format of UndeletePage::undeleteAsUser

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

Change 715592 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Use fluent setters instead of optional params in UndeletePage

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

Change 715596 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Add perm checks to UndeletePage and make it a real service

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

Change 715565 merged by jenkins-bot:

[mediawiki/core@master] Move code from PageArchive to a new UndeletePage command

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

Change 715567 merged by jenkins-bot:

[mediawiki/core@master] UndeletePage cleanup, part 1

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

Change 715578 merged by jenkins-bot:

[mediawiki/core@master] Change return format of UndeletePage::undelete()

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

Change 724197 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Use UndeletePage from ApiUndelete

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

Change 724208 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@REL1_37] Deprecate the UndeleteForm::showRevision hook

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

Change 724208 abandoned by Daimona Eaytoy:

[mediawiki/core@REL1_37] Deprecate the UndeleteForm::showRevision hook

Reason:

Urgh, I should have written this against master instead

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

Change 724211 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/Newsletter@master] Switch to new PageUndelete hook

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

Change 724204 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Deprecate the UndeleteForm::showRevision hook

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

Change 724213 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Remove UndeleteForm::undelete hook

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

Change 724408 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Use UndeletePage from Special:Undelete

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

I think at this point, everything needed for this task should be up for review on gerrit. There are still a few things that can be improved (e.g. moving more code to UndeletePage that is executed in both ApiUndelete and SpecialUndelete), but that can be done later.

Change 724204 merged by jenkins-bot:

[mediawiki/core@master] Deprecate the UndeleteForm::undelete hook

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

Change 724384 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@REL1_37] Deprecate the UndeleteForm::undelete hook

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

Change 724384 merged by jenkins-bot:

[mediawiki/core@REL1_37] Deprecate the UndeleteForm::undelete hook

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

Change 724211 merged by jenkins-bot:

[mediawiki/extensions/Newsletter@master] Switch to new PageUndelete hook

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

Change 724975 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/Newsletter@REL1_37] Switch to new PageUndelete hook

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

Change 724975 merged by jenkins-bot:

[mediawiki/extensions/Newsletter@REL1_37] Switch to new PageUndelete hook

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

Change 724213 merged by jenkins-bot:

[mediawiki/core@master] Remove UndeleteForm::undelete hook

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

Change 715592 merged by jenkins-bot:

[mediawiki/core@master] Use fluent setters instead of optional params in UndeletePage

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

Change 715596 merged by jenkins-bot:

[mediawiki/core@master] Add perm checks to UndeletePage and make it a real service

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

Change 724197 merged by jenkins-bot:

[mediawiki/core@master] Use UndeletePage from ApiUndelete

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

Change 724408 merged by jenkins-bot:

[mediawiki/core@master] Use UndeletePage from Special:Undelete

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

No new features were added, so we would like to make sure that Special:Undelete and the undelete API module are still working as expected; a few suggestions:

  • Ensure consistency when undeleting files (as opposed to articles)
  • Test behaviour when selectively restoring only some file versions and/or page revisions
  • No need to test this on pages with many deleted revisions; in fact, that will probably timeout and fail
  • Ensure that errors are displayed correctly, for instance if there are no revisions to undelete (e.g. submit the form twice)
dom_walden added a subscriber: dom_walden.

Sorry I don't have time to do a comprehensive write up, I will just bullet list broadly what I did:

What I didn't test:

  • That the information on the Special:Undelete form itself was correct (although I saw nothing obviously wrong)
  • Other parts of the software that do undelete/restore (if these exist, I didn't have time to look)

Where I was unsure about the behaviour, I compared to what the behaviour was like before the start of this project.

I also had logstash open the whole time to check any errors on testwiki. I saw none.

Test environment: https://test.wikipedia.org MediaWiki 1.38.0-wmf.12 (rMW365159bc6352) 12:49, 9 December 2021.