Page MenuHomePhabricator

Split Hooks.php into seperate HookHandler files
Closed, ResolvedPublic2 Estimated Story Points

Description

Hooks.php should be split into separate HookHandler files. This makes it easier to read and update the files, including the associated tests.

Currently the Hooks.php file contains 1200 lines and HooksTest.php contains 1400 lines. These could be split into multiple Hook Handler files, including:

  • One for schema updates which are hard to test and often updated
  • One for ones that insert events into the checkuser tables, which can be grouped together to still keep the insertion methods private.

Details

SubjectRepoBranchLines +/-
mediawiki/extensions/CheckUsermaster+291 -407
mediawiki/extensions/CheckUsermaster+56 -117
mediawiki/extensions/CheckUsermaster+207 -126
mediawiki/extensions/CheckUsermaster+58 -100
mediawiki/extensions/CheckUsermaster+229 -221
mediawiki/extensions/CheckUsermaster+290 -411
mediawiki/extensions/CheckUsermaster+176 -137
mediawiki/extensions/CheckUsermaster+261 -152
mediawiki/extensions/CheckUsermaster+676 -609
mediawiki/extensions/CheckUsermaster+953 -859
mediawiki/extensions/CheckUsermaster+0 -91
mediawiki/extensions/CheckUsermaster+70 -63
mediawiki/extensions/CheckUsermaster+130 -116
mediawiki/extensions/CheckUsermaster+50 -13
mediawiki/extensions/CheckUsermaster+199 -145
mediawiki/extensions/CheckUsermaster+289 -281
Show related patches Customize query in gerrit

Event Timeline

Change 928481 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Move ::onLoadExtensionSchemaUpdates to hook handler file

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

Change 928493 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Move toollinks related hooks to a hook handler file

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

Change 928481 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Move ::onLoadExtensionSchemaUpdates to hook handler file

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

Change 928527 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Move Hooks::onRenameUserSQL to hook handler file and unit test

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

Change 928493 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Move toollinks related hooks to a hook handler file

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

Change 928527 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Move Hooks::onRenameUserSQL to hook handler file and unit test

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

Change 928553 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Move Hooks::onSpecialPage_initList to a hook handler file

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

Change 928553 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Move Hooks::onSpecialPage_initList to a hook handler file

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

Change 928893 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Move CheckUser services in the root folder to a new sub-folder

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

Change 928962 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Move Hooks::insertIntoCu* methods and Hooks::getAgent to a service

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

Change 929030 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Move Hooks::maybePruneIPData and ::pruneIPData to a new service

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

Change 929031 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Move all code in Hooks.php that inserts data to CU to new handler

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

Change 929032 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Remove unused private methods in Hooks.php

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

Change 928893 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Move CheckUser services in the root folder to a new sub-folder

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

Change 929032 abandoned by Dreamy Jazz:

[mediawiki/extensions/CheckUser@master] Remove unused private methods in Hooks.php

Reason:

Will re-create this as another patch. Some usages still exist in tests which will need to be removed before a patch like this can be used.

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

Change 928962 abandoned by Dreamy Jazz:

[mediawiki/extensions/CheckUser@master] Move many non-hook methods in Hooks.php to a service

Reason:

Intending to split this into multiple changes at a future time

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

Change 929031 abandoned by Dreamy Jazz:

[mediawiki/extensions/CheckUser@master] Move all code in Hooks.php that inserts data to CU to new handler

Reason:

Intend to split this into multiple smaller patches at a later time.

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

Change 928962 restored by Dreamy Jazz:

[mediawiki/extensions/CheckUser@master] Move many non-hook methods in Hooks.php to a service

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

Change 928962 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Move multiple Hooks.php methods to CheckUserInsert service

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

Change #1046774 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Add read new support to CheckUser autoblocking handling code

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

Change #1046774 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Add read new support to CheckUser autoblocking handling code

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

Change #1052729 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Remove wgCheckUserEventTablesMigrationStage for logout handler

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

Change #1052735 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Remove wgCheckUserEventTablesMigrationStage for login handler

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

Change #1052744 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Remove wgCheckUserEventTablesMigrationStage for email handler

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

Change #1052747 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Remove wgCheckUserEventTablesMigrationStage for reset email handler

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

Change #1052758 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Remove wgCheckUserEventTablesMigrationStage for user created handler

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

Change #1052787 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] [WIP] Remove wgCheckUserEventTablesMigrationStage for recentchange save

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

Change #1052788 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] [WIP] Move Hooks::updateCheckUserData to CheckUserInsert service

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

Change #1052729 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Remove wgCheckUserEventTablesMigrationStage for logout handler

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

Change #1052735 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Remove wgCheckUserEventTablesMigrationStage for login handler

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

Change #1052744 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Remove wgCheckUserEventTablesMigrationStage for email handler

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

Change #1052747 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Remove wgCheckUserEventTablesMigrationStage for reset email handler

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

Change #1052758 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Remove wgCheckUserEventTablesMigrationStage for user created handler

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

Change #1052788 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Move Hooks::updateCheckUserData to CheckUserInsert service

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

Change #1052787 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Move RecentChanges save handler to separate file

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