Page MenuHomePhabricator

Make AttributionDataBuilder into a MediaWiki service via service wiring
Closed, ResolvedPublic2 Estimated Story Points

Description

Originally T417672.

It would be increasingly useful to make the AttributionDataBuilder a service and inject it into the Handler class instead of making the Handler class have to handle constructing an increasing number of dependencies to pass to AttributionDataBuilder::__construct(). This came up in several places, including https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaCustomizations/+/1265557 .

Event Timeline

BPirkle triaged this task as Medium priority.Apr 7 2026, 10:09 PM
BPirkle moved this task from Incoming (Needs Triage) to Backlog on the MW-Interfaces-Team board.

Picking this up as part of T421891 so the new Handler injects the builder as a service

  • Idea is to optimize handler by passing the data builder as a service.
  • The data builder is currently extremely hard coded to page signals. A possible follow up is to generalize the builder for other use cases like site signals.
  • The tracer will also have to be passed since it is per request

Change #1270990 had a related patch set uploaded (by Pmiazga; author: Pmiazga):

[mediawiki/extensions/WikimediaCustomizations@master] Attribution: AttributionDataBuilder becomes a service

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

Change #1270990 merged by jenkins-bot:

[mediawiki/extensions/WikimediaCustomizations@master] Attribution: AttributionDataBuilder becomes a service

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