Page MenuHomePhabricator

Move the logic for obtaining the UserLinkRenderer in the Linker to a common method
Closed, ResolvedPublic0.25 Estimated Story Points

Description

Background

  • The current implementation of the Linker obtains a LinkRenderer from a number of places, and the logic that does so is verbose:
    • It requires to obtain a reference to the service container first (sometimes stored into a local variable to make the code more readable)
    • Sometimes that requires using a different way of obtaining the service depending on the link options (i.e. get the renderer by directly calling the service container versus obtaining a factory that in turn obtains the renderer itself).
  • This verbosity makes it harder to follow the core logic of the link() method itself.
  • During the review of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1224698, refactoring the Linker to have the conditional logic to get a LinkRenderer instance was regarded as outside of the scope of the associated ticket.

Acceptance Criteria

  • The logic to obtain the LinkRenderer is moved into a common method

Event Timeline

hector.arroyo changed the task status from Open to In Progress.Jan 9 2026, 11:21 AM
hector.arroyo added a project: Essential-Work.
hector.arroyo updated the task description. (Show Details)

Change #1224918 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/core@master] Linker: Move instantiation of UserLinkRenderer to a common method

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

hector.arroyo closed this task as Resolved.EditedJan 9 2026, 3:13 PM

The change associated with this task is being merged now.

Given that the change is just a code refactor, it can bypass QA and rely only on the automated tests passing.

hector.arroyo set the point value for this task to 0.25.Jan 9 2026, 3:15 PM

Change #1224918 merged by jenkins-bot:

[mediawiki/core@master] Linker: Move instantiation of UserLinkRenderer to a common method

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