This will replace PageArchive::undeleteAsUser (and dependencies).
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T288958 Make PageArchive a proper service | |||
Resolved | Daimona | T290021 Create a new UndeletePage command object |
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
Change 715567 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/core@master] DeletePage cleanup, part 1
Change 715578 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/core@master] Change return format of UndeletePage::undeleteAsUser
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
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
Change 715565 merged by jenkins-bot:
[mediawiki/core@master] Move code from PageArchive to a new UndeletePage command
Change 715567 merged by jenkins-bot:
[mediawiki/core@master] UndeletePage cleanup, part 1
Change 715578 merged by jenkins-bot:
[mediawiki/core@master] Change return format of UndeletePage::undelete()
Change 724197 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/core@master] Use UndeletePage from ApiUndelete
Change 724208 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/core@REL1_37] Deprecate the UndeleteForm::showRevision hook
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
Change 724211 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/extensions/Newsletter@master] Switch to new PageUndelete hook
Change 724204 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/core@master] Deprecate the UndeleteForm::showRevision hook
Change 724213 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/core@master] Remove UndeleteForm::undelete hook
Change 724408 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/core@master] Use UndeletePage from Special:Undelete
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
Change 724384 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/core@REL1_37] Deprecate the UndeleteForm::undelete hook
Change 724384 merged by jenkins-bot:
[mediawiki/core@REL1_37] Deprecate the UndeleteForm::undelete hook
Change 724211 merged by jenkins-bot:
[mediawiki/extensions/Newsletter@master] Switch to new PageUndelete hook
Change 724975 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):
[mediawiki/extensions/Newsletter@REL1_37] Switch to new PageUndelete hook
Change 724975 merged by jenkins-bot:
[mediawiki/extensions/Newsletter@REL1_37] Switch to new PageUndelete hook
Change 724213 merged by jenkins-bot:
[mediawiki/core@master] Remove UndeleteForm::undelete hook
Change 715592 merged by jenkins-bot:
[mediawiki/core@master] Use fluent setters instead of optional params in UndeletePage
Change 715596 merged by jenkins-bot:
[mediawiki/core@master] Add perm checks to UndeletePage and make it a real service
Change 724197 merged by jenkins-bot:
[mediawiki/core@master] Use UndeletePage from ApiUndelete
Change 724408 merged by jenkins-bot:
[mediawiki/core@master] Use UndeletePage from Special:Undelete
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)
Sorry I don't have time to do a comprehensive write up, I will just bullet list broadly what I did:
- Restored articles and files, via UI and API
- Restored articles and files which had suppressed revisions, via UI (API does not support this)
- Selectively restored specific revisions and file versions, via UI and API
- Restored redirects
- Merging edit histories (see https://www.mediawiki.org/wiki/Manual:Administrators#Deletion)
- Splitting edit histories (see https://www.mediawiki.org/wiki/Manual:Administrators#Deletion)
- I could set tags and reason when restoring via API
- Limited amount of permissions testing
- Limited amount of error handling, such as trying to restore a page that does not exist
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.