Page MenuHomePhabricator

Build the page delete UI from DeleteAction, not Article
Closed, ResolvedPublic8 Estimated Story Points

Description

The code responsible for creating the deletion form should live in DeleteAction, not in Article.

Rough plan:

  • Move code from Article to DeleteAction, without changing anything: r712948
  • Remove legacy code from Article after 1 train: r712975
  • Make FileDeleteForm a subclass of DeleteAction, enabled via getActionOverrides(): r711477
  • Clean up DeleteAction and FileDeleteForm: factor out common stuff, fix drifts, reduce differences in showForm: r711605, r711756, r712325, r712715, r712747, r713299, r713327, r713338

[] Make DeleteAction a FormAction

Any further cleanup should be outside of the scope of this task.

Event Timeline

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

[mediawiki/core@master] Build the page deletion form in DeleteAction, not Article

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

Daimona set the point value for this task to 3.

Note for the second bullet (merging FileDeleteForm into DeleteAction): FileDeleteForm was introduced 14 years ago, in commit 65d74391fd69b34541d846ee867d3714d8a13bcd. Since Article and FileDeleteForm do not share any common code path (before WikiPage::doDeleteArticleReal is called) but they serve similar purposes, it's possible that in those 14 years, something was added to Article XOR WikiPage which should've been added to both. I want to analyze those files as of 2007 and diff them carefully to find out if this is the case.

Failing to find those drift would mean that:

  1. The code becomes harder to read, since there are more conditionals for Image vs Article
  2. Once we merge those classes, it won't be as obvious that conditional logic could be the result of a drift (e.g. if somebody doesn't look at the git history and realize that the code was previously split into two files)

So I'm going to try and be very careful before opening the review phase. I will also send preliminary patches if there are many drifts (or big ones) for easing CR and keeping a cleaner git blame.

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

[mediawiki/core@master] Move some methods from FileDeleteForm to a subclass of DeleteAction

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

ldelench_wmf changed the point value for this task from 3 to 5.Aug 11 2021, 2:51 PM

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

[mediawiki/core@master] Clean up DeleteAction and FileDeleteAction, part 1

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

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

[mediawiki/core@master] Further clean up DeleteAction and FileDeleteAction

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

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

[mediawiki/core@master] DeleteAction-related cleanup, part 3

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

Change 710630 merged by jenkins-bot:

[mediawiki/core@master] Build the page deletion form in DeleteAction, not Article

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

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

[mediawiki/core@master] DeleteAction: allow easy override of form messages

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

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

[mediawiki/core@master] Final sync of DeleteAction and FileDeleteAction forms

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

I still have to write a patch or two for this, but most things are already up for review.

Change 712967 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@master] Temporarily skip LexemePageTest

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

Change 712967 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Temporarily skip LexemePageTest

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

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

[mediawiki/core@master] Remove Article::delete() Article::confirmDelete() and ImagePage::delete()

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

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

[mediawiki/core@master] Make DeleteAction and FileDeleteAction share showForm

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

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

[mediawiki/core@master] Deprecate $hasHistory param to ContentHandler::getAutoDeleteReason()

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

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

[mediawiki/core@master] Convert DeleteAction to use HTMLForm

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

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

[mediawiki/core@master] Rearrange code in DeleteAction

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

β€’ NRodriguez changed the point value for this task from 5 to 8.Aug 26 2021, 5:36 PM

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

[mediawiki/core@REL1_37] Remove Article::delete() Article::confirmDelete() and ImagePage::delete()

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

Change 712975 merged by jenkins-bot:

[mediawiki/core@master] Remove Article::delete() Article::confirmDelete() and ImagePage::delete()

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

Change 720851 merged by jenkins-bot:

[mediawiki/core@REL1_37] Remove Article::delete() Article::confirmDelete() and ImagePage::delete()

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

Change 711477 merged by jenkins-bot:

[mediawiki/core@master] Move some methods from FileDeleteForm to a subclass of DeleteAction

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

Change 711605 merged by jenkins-bot:

[mediawiki/core@master] Clean up DeleteAction and FileDeleteAction, part 1

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

Change 711756 merged by jenkins-bot:

[mediawiki/core@master] Clean up DeleteAction and FileDeleteAction, part 2

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

Change 712325 merged by jenkins-bot:

[mediawiki/core@master] DeleteAction-related cleanup, part 3

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

Change 712715 merged by jenkins-bot:

[mediawiki/core@master] DeleteAction: allow easy override of form messages

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

Change 712747 merged by jenkins-bot:

[mediawiki/core@master] Final sync of DeleteAction and FileDeleteAction forms

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

Change 713299 merged by jenkins-bot:

[mediawiki/core@master] Make DeleteAction and FileDeleteAction share showForm

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

Change 713327 merged by jenkins-bot:

[mediawiki/core@master] Deprecate $hasHistory param to ContentHandler::getAutoDeleteReason()

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

This is ready for QA, but my suggestion is to test it together with T288758, once the last two patches (r730775 and r730197) are merged.

dom_walden subscribed.

Testing for this was done as part of T288758#7549416.

I assume product sign-off can be done as part of that ticket as well. Moving directly to Done and Resolving.

I see that "[] Make DeleteAction a FormAction" was crossed out from the task description. Was there any blocker for this part or any reason why this was not pursued?