Page MenuHomePhabricator

Cleanup WMF production extensions that still reference undeployed UserMerge hook
Open, Needs TriagePublic

Description

While going through the OAuth extension codebase, I found tech debt worth cleaning up.

In T216089: Undeploy UserMerge Extension from WMF production, the UserMerge extension (which declared the MergeAccountFromTo hook) was undeployed. After the extension was undeployed, I think other WMF-deployed extensions that still reference that hook: https://codesearch.wmcloud.org/deployed/?q=MergeAccountFromTo should be cleaned up? Do the hook handlers actually do anything now that the hook is no longer available and a matching hook is not available in MW core?

Also, surveying callers, it seems other extensions still use the former namespace (use MediaWiki\Extension\UserMerge\Hooks\MergeAccountFromToHook;) where this used to exist in the extension, which is now no longer in production (at the very least).

It seems like we don't have a huge list:

  • Echo
  • FlaggedRevs
  • Flow (may not be worth it since this is also going away soon?)
  • OAuth
  • Translate

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Would these be in use by 3rd-party wikis that have the UserMerge extension (& one of these listed extensions) installed?

Would these be in use by 3rd-party wikis that have the UserMerge extension (& one of these listed extensions) installed?

Maybe! That's an interesting question. I can see OAuth, Translate, and Echo being candidates.

I'm not very sure about FlaggedRevs or Flow.

I just want to make sure that we bear in mind that Wikimedia production is not gonna be the only place that these extensions are necessarily used :)

I'm not very sure about FlaggedRevs or Flow.

Personally speaking, I would be cautious about assuming that something isn't in use by third parties. (just my own opinion :))
I know e.g. that FlaggedRevs & Flow are in use by Miraheze (xref https://meta.miraheze.org/wiki/Extensions / https://meta.miraheze.org/wiki/Special:ManageWiki/extensions)

I just want to make sure that we bear in mind that Wikimedia production is not gonna be the only place that these extensions are necessarily used :)

Acknowledged. Yes, this will need discussion and more surveying. I filed it for that purpose. If it ends up not being needed, the task can always be closed as "Invalid/Declined" :)

Personally speaking, I would be cautious about assuming that something isn't in use by third parties. (just my own opinion :))
I know e.g. that FlaggedRevs & Flow are in use by Miraheze (xref https://meta.miraheze.org/wiki/Extensions / https://meta.miraheze.org/wiki/Special:ManageWiki/extensions)

Thanks for noting that.

Huh, it's listed under 'Global Extensions' on https://meta.miraheze.org/wiki/Extensions. Judging by https://issue-tracker.miraheze.org/T8671, maybe that page needs updating? Apologies if that is the case, & if this isn't actually applicable to Miraheze.
Regardless of that, though, IMO my general point still applies

I think we can leave them as they are. It is tech debt, but it doesn't seem to have cost us much to maintain it so far, and it can be useful for other MediaWiki users. If that changes, though (e.g. a new feature or a database schema change conflicts with this code somehow; or if the extension stops working due to MediaWiki changes and no one steps up to fix it), we should reconsider this.

(BTW fun fact, you can use classes in PHP that don't exist, or even look up their canonical names with ::class: https://3v4l.org/M37C3. Only operations that trigger autoloading of that class, like using its methods/properties/constructor, cause an error.)

I strongly oppose removing support for UserMerge unless UserMerge got archived. Previously an extension did actively dropped UserMerge support, and I now proposed to revert it: T412877: Revert dropping support of UserMerge from PageTriage

Novem_Linguae renamed this task from Cleanup WMF production extension that still reference undeployed UserMerge hook to Cleanup WMF production extensions that still reference undeployed UserMerge hook.Dec 17 2025, 12:26 AM

I think we can leave them as they are. It is tech debt, but it doesn't seem to have cost us much to maintain it so far, and it can be useful for other MediaWiki users. If that changes, though (e.g. a new feature or a database schema change conflicts with this code somehow; or if the extension stops working due to MediaWiki changes and no one steps up to fix it), we should reconsider this.

These pieces add up. The hook handlers might not like much but we also have the same thing with barely used skins too (T115430#10341646). Each might not be a big deal but they add up. We do have around 3M LOC in production (just mw) and all of WMF engineering can't reasonably maintain this amount of code. I'd argue we need to cut as much as we can any where we can.

Do the hook handlers actually do anything now that the hook is no longer available and a matching hook is not available in MW core?

I even think we should move this hook to MediaWiki core. See T393592: Unify reassignEdits.php and UserMerge

These pieces add up.

If we have five hook handlers that require zero maintenance per year, that’s exactly the same amount as zero hook handlers that require zero maintenance per year. So long as there is no actual maintenance need, nothing adds up.

For FlaggedRevs specifically, there’s a solution without losing functionality: move the features to core and UserMerge. The FlaggedRevs hook handler merges autopromote data, but none of the data it merges is actually FR-specific – if these autopromote parameters were handled by core, UserMerge itself could take care of merging them.

I agree with the sentiment that all code has a maintenance cost. Because of 1) complexity and 2) bitrot. It's very hard to say with certainty that a line of code will "require zero maintenance" ever again. I see maintenance done on code all the time. And if I'm reading other code in that file and stumble across this hook and I spend 5 minutes trying to figure out why a hook is there for an extension I've never heard of, that's complexity and it has a cost, even if I don't end up writing a patch that modifies that code.

Also, fun fact. If I recall correctly, FlaggedRevs has the most hooks of any Wikimedia-deployed extension, clocking in at 60-something.

I have no opinion on this particular situation though. Maybe it is cheap enough to keep, maybe not. Will let others decide.

I believe UserMerge is still commonly used in many third party individual (i.e. not farm) wikis.