This will replace PageArchive::undeleteAsUser (and dependencies).
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.
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.