Page MenuHomePhabricator

Show labels for properties and items on Wikipedia watchlist summaries
Closed, ResolvedPublic

Description

On Wikidata watchlists, labels are currently shown alongside the Q/P numbers for items and properties.
In this ticket, we want to use similar logic to show these labels for Wikipedia watchlists as well.

Example Wikidata watchlist entry
(‎Changed claim: instance of (P31): administrative building (Q2519340))
Example Wikipedia watchlist entry
(‎Changed claim: Property:P1056: Q161928)

We have already investigated how this works and located the code in the ‘repo’ that will need to be used on the ‘client’ side.

Acceptance criteria

  • Labels are shown in Wikipedia watchlists summaries for wikidata items and properties, the same as how they are currently shown in Wikidata watchlists
  • Labels for Wikidata links coming from interwiki links in client page edit summaries (e.g. [[d:Q42]]) should not be resolved as part of this ticket

Tasks:

  • Architecture - if we use LinkerMakeExternalLinkHook hook, some other extensions override it and therefore will not have access to our improved summaries. An alternative decision would be to write a new separate hook
  • Make sure extra database lookups aren't a problem - We learned they will be a problem. Ticket T395138 will separately deal with this
  • Consider efficiency - e.g. with 'prefetch' - as above
  • Consider any implications to e.g. removing the word 'Property' - does anything currently depend on that? E.g. bots
  • Test with right-to-left text - our change does not break anything that is not already broken. However, there are existing issues - these will be investigated in the multilingual ticket T386353
  • Consider if a long label needs to be truncated, or if however it works on wikidata currently is sufficient - we are thinking to just cut it off after a certain number of letters OR do that and add '...' OR not show it at all. We might need to track this.
  • Implementation of the change
  • Roll out to pilot wikis first, to check for bugs and enable easier rollback via feature flag (see T393442 for more info)
  • NOTE: this ticket deployment is blocked by monitoring tracking beforehand first

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
SuzanneWood-WMDE renamed this task from Show labels for properties and items on Wikipedia watchlists to Show labels for properties and items on Wikipedia watchlist summaries.Mar 19 2025, 1:25 PM
SuzanneWood-WMDE updated the task description. (Show Details)
SuzanneWood-WMDE updated the task description. (Show Details)
SuzanneWood-WMDE updated the task description. (Show Details)

Change #1129955 had a related patch set uploaded (by Seanleong-wmde; author: Neslihan Turan):

[mediawiki/extensions/Wikibase@master] Resolve labels on Watchlist

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

Change #1129955 had a related patch set uploaded (by Seanleong-wmde; author: Neslihan Turan):

[mediawiki/extensions/Wikibase@master] Resolve labels on Watchlist

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

Change #1141852 had a related patch set uploaded (by Neslihan Turan; author: Neslihan Turan):

[operations/mediawiki-config@master] Create feature flags for resolving Wikibase item labels on Watchlist.

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

Change #1141852 had a related patch set uploaded (by Neslihan Turan; author: Neslihan Turan):

[operations/mediawiki-config@master] Create feature flags for resolving Wikibase item labels on Watchlist.

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

Change #1129955 had a related patch set uploaded (by Neslihan Turan; author: Neslihan Turan):

[mediawiki/extensions/Wikibase@master] Resolve labels on Watchlist

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

Change #1149683 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Wikibase@master] Fix edge-cases in SummaryParsingPrefetchHelper

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

Change #1149683 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Fix edge-cases in SummaryParsingPrefetchHelper

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

Change #1129955 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Resolve labels on Watchlist

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

Change #1155724 had a related patch set uploaded (by Joely Rooke WMDE; author: Joely Rooke WMDE):

[mediawiki/extensions/Wikibase@master] Remove old wikibase-itemlink translation keys from repo now they live in repo

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

Change #1155724 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove old wikibase-itemlink translation keys from repo now they live in repo

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

One edge case that is not currently handled is links to the repo where the link text is a valid (maybe namespaced) entity id that deviates from the actual link target. An example could be: [[wd:Item:Q42395533|Q42]].

While this is a fairly pathological case, I think it might actually be hit during real usage.

Change #1141852 merged by jenkins-bot:

[operations/mediawiki-config@master] Create feature flags to resolve Wikibase item labels on the Watchlist.

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

Mentioned in SAL (#wikimedia-operations) [2025-06-23T15:04:43Z] <lucaswerkmeister-wmde@deploy1003> Started scap sync-world: Backport for [[gerrit:1141852|Create feature flags to resolve Wikibase item labels on the Watchlist. (T388685)]]

Mentioned in SAL (#wikimedia-operations) [2025-06-23T15:06:54Z] <lucaswerkmeister-wmde@deploy1003> neslihanturan, lucaswerkmeister-wmde: Backport for [[gerrit:1141852|Create feature flags to resolve Wikibase item labels on the Watchlist. (T388685)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-06-23T15:16:51Z] <lucaswerkmeister-wmde@deploy1003> Finished scap sync-world: Backport for [[gerrit:1141852|Create feature flags to resolve Wikibase item labels on the Watchlist. (T388685)]] (duration: 12m 07s)

Change #1163372 had a related patch set uploaded (by Joely Rooke WMDE; author: Joely Rooke WMDE):

[operations/mediawiki-config@master] Activate feature to resolve wikibase link labels in pilot wiki changelists

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

Change #1163372 merged by jenkins-bot:

[operations/mediawiki-config@master] Activate feature to resolve wikibase link labels in pilot wiki changelists

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

Mentioned in SAL (#wikimedia-operations) [2025-06-25T07:32:27Z] <kharlan@deploy1003> Started scap sync-world: Backport for [[gerrit:1163372|Activate feature to resolve wikibase link labels in pilot wiki changelists (T388685)]]

Mentioned in SAL (#wikimedia-operations) [2025-06-25T07:34:43Z] <kharlan@deploy1003> joelyrookewmde, kharlan: Backport for [[gerrit:1163372|Activate feature to resolve wikibase link labels in pilot wiki changelists (T388685)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-06-25T07:45:30Z] <kharlan@deploy1003> Finished scap sync-world: Backport for [[gerrit:1163372|Activate feature to resolve wikibase link labels in pilot wiki changelists (T388685)]] (duration: 13m 03s)

Change #1163372 merged by jenkins-bot:

[operations/mediawiki-config@master] Activate feature to resolve wikibase link labels in pilot wiki changelists

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

This patch was reverted due to a very high rate of errors (https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1163693, logs: https://logstash.wikimedia.org/goto/b55135916319237318f0f77abeed4093)

[Copied from Gerrit]

Attempted feature flag activation was reverted

What happened was:
This feature flag turned on a feature which was deployed as the following two changes:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/1129955 and https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/1150628/1

The second of these had not finished fully deploying on the train, which caused these errors:

[{reqId}] {exception_url} TypeError: Wikibase\Client\Hooks\LinkerMakeExternalLinkHookHandler::isRecentChangeOrWatchlist(): Argument #1 ($currentTitle) must be of type MediaWiki\Title\Title, null given, called in /srv/mediawiki/php-1.45.0-wmf.6/extension

https://logstash.wikimedia.org/app/dashboards#/view/mediawiki-errors?_g=h@89714be&_a=h@a539f8c

Therefore, we plan to turn on this feature flag on Thursday (26th June) after both of the feature patches are fully deployed by the train

Change #1163704 had a related patch set uploaded (by Hashar; author: Joely Rooke WMDE):

[operations/mediawiki-config@master] Revert^2 "Activate feature to resolve wikibase link labels in pilot wiki changelists"

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

This change is scheduled for deployment tonight (26.06.25) in the 'late afternoon' backport window at 22:00 (UTC+2) as it is dependent on all wikis using wmf.7, which will be deployed at 20:00 (UTC+2).

As I can't be there, and it is a simple change, @hashar has offered that they or the train deployer could do it for us (thanks 😇 ).

Steps to confirm the change:

  1. Go to recent changes on one of the pilot wikipedias (ca, he, or uk) and turn on Wikidata edits (you might need to turn off all other changes to make the wikidata ones more visible). We care about the last part of each change log (the auto edit summary).
  2. Where the auto edit summary has links to wikidata (e.g. Created or Removed claim), they should show the label of that item and property from wikidata. e.g. instead of Q64, we expect the link text to be Berlin (Q64), or instead of Property:P18 we expect image (P18)
  3. Repeat on the user watchlist

Examples in catalan of old vs new recent change log:

Screenshot from 2025-06-26 11-10-51.png (105×1 px, 51 KB)
Screenshot from 2025-06-26 11-23-47.png (138×1 px, 57 KB)

Some things we don't want to see:

  • Other wikis e.g. en wikipedia should still have the old link text (Q64 or Property:P18)
  • Other changelists on the pilot wikis e.g. related changes should still have the old link text.
  • TypeError: Wikibase\Client\Hooks\LinkerMakeExternalLinkHookHandler::isRecentChangeOrWatchlist(): Argument #1 ($currentTitle) must be of type MediaWiki\Title\Title, null given - The error that blocked deployment yesterday. This is accounted for in the dependent change within wmf.7
  • Other errors we have not predicted! Hopefully logs might flag that to us.

If these criteria are unclear of course feel free to skip the deployment and we can schedule it instead for Monday.

Change #1163704 merged by jenkins-bot:

[operations/mediawiki-config@master] Revert^2 "Activate feature to resolve wikibase link labels in pilot wiki changelists"

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

Mentioned in SAL (#wikimedia-operations) [2025-06-26T18:52:14Z] <jhuneidi@deploy1003> Started scap sync-world: Backport for [[gerrit:1163704|Revert^2 "Activate feature to resolve wikibase link labels in pilot wiki changelists" (T388685)]]

Mentioned in SAL (#wikimedia-operations) [2025-06-26T18:54:10Z] <jhuneidi@deploy1003> joelyrookewmde, jhuneidi: Backport for [[gerrit:1163704|Revert^2 "Activate feature to resolve wikibase link labels in pilot wiki changelists" (T388685)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-06-26T19:07:26Z] <jhuneidi@deploy1003> Finished scap sync-world: Backport for [[gerrit:1163704|Revert^2 "Activate feature to resolve wikibase link labels in pilot wiki changelists" (T388685)]] (duration: 15m 12s)

I have done the backport and confirmed the changes on cawiki in the recent changes list, confirmed no change to the related changes list, and no changes to English wikipedia. I haven't noticed the error in the logs.

@JoelyRooke-WMDE thank you for the very nice communication related to the deployment of the original change and the follows revert/restore etc :-]

Change #1169077 had a related patch set uploaded (by Joely Rooke WMDE; author: Joely Rooke WMDE):

[operations/mediawiki-config@master] Activate feature to resolve changelist wikibase link labels in all wikis

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

Change #1169077 merged by jenkins-bot:

[operations/mediawiki-config@master] Activate feature to resolve changelist wikibase link labels in all wikis

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

Mentioned in SAL (#wikimedia-operations) [2025-07-17T13:13:12Z] <lucaswerkmeister-wmde@deploy1003> Started scap sync-world: Backport for [[gerrit:1169077|Activate feature to resolve changelist wikibase link labels in all wikis (T388685)]]

Mentioned in SAL (#wikimedia-operations) [2025-07-17T13:15:26Z] <lucaswerkmeister-wmde@deploy1003> joelyrookewmde, lucaswerkmeister-wmde: Backport for [[gerrit:1169077|Activate feature to resolve changelist wikibase link labels in all wikis (T388685)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-07-17T13:24:43Z] <lucaswerkmeister-wmde@deploy1003> Finished scap sync-world: Backport for [[gerrit:1169077|Activate feature to resolve changelist wikibase link labels in all wikis (T388685)]] (duration: 11m 30s)