Page MenuHomePhabricator

[Spike] Explore technical considerations to surfacing usage tracking of Data pages
Closed, ResolvedPublic5 Estimated Story PointsSpike

Assigned To
Authored By
CCiufo-WMF
Jan 10 2025, 9:46 PM
Referenced Files
F58349232: image.png
Feb 3 2025, 8:11 PM
F58349236: image.png
Feb 3 2025, 8:11 PM
F58292590: image.png
Jan 27 2025, 8:04 PM
F58292588: image.png
Jan 27 2025, 8:04 PM

Description

We already track where .tab and .chart pages are used in order to know when to update the downstream pages and refresh the cache, but we aren't surfacing this information in any way to users.

We should explore what would be needed to surface this information to users for both .tab and .chart pages. Essentially, we'd want to be able to list all the charts that use a given tabular data set, and list all the wiki pages that invoke a given chart. The expected UI would be similar to the "File usage on ..." lists for pages in the Commons File namespace.

What we'd want to be able to have for data pages:

File usage on Commons

The following 48 pages use this file:

  • ABC.chart
  • ...
File usage on other wikis

The following other wikis use this file:
Usage on en.wikipedia.org

  • Example article

Usage on fr.wikipedia.org

  • ...

Event Timeline

CCiufo-WMF set the point value for this task to 5.
CCiufo-WMF moved this task from Up Next to Sprint 14 on the Charts board.
CCiufo-WMF edited projects, added: Charts (Sprint 14); removed: Charts.
bvibber moved this task from Incoming to Doing on the Charts (Sprint 14) board.
bvibber subscribed.

taking this spike task for the week

i'm pretty sure i'll reach rough parity with the file: page/globalimagelinks implementation by the end of the week but if not we'll know how far we are :D

(Adding JsonConfig tag as this work lives in the JsonConfig side, working with the usage tracking tables we added...)

Change #1111690 had a related patch set uploaded (by Bvibber; author: Bvibber):

[mediawiki/extensions/JsonConfig@master] WIP spike work on Data: page global usage display

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

Change #1114071 had a related patch set uploaded (by Bvibber; author: Bvibber):

[mediawiki/extensions/Chart@master] Restore globaljsonlinks updates that got removed by mistake

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

Change #1114071 merged by jenkins-bot:

[mediawiki/extensions/Chart@master] Restore globaljsonlinks updates that got removed by mistake

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

Current in-progress patch is showing up links (now that regression is fixed), needs to finish the namespace handling and fix the local configuration to confirm the links work as expected when wiki farm is configured correctly. This works for all NS_DATA pages that have links stored, including both .chart and .tab pages: it will detect both loading tabular data through the JsonConfig Lua module and chart/tabular usage in Chart with latest version.

The links are failing to apply correctly in this screenshot due to incomplete local configuration of the wiki farm, this is using the same code as GlobalUsage for linking and I'll fix it shortly :D

Formatting is similar to GlobalUsage for images, pulling the storage wiki (Commons in production) first and then the rest of the wikis next in alpha sort order of key. Each item should be a working page view link -- due to limitations with namespace localization this will probably end up showing the canonical form for some namespaces that are gendered, such as the Polish Wikipedia's User: pages, but the links should work. This is still a work in progress and should be done later in the week on the implementation.

Other than the regression in linkage no major surprises encountered, expect to finish this up in a few days.

image.png (1,464×1,020 px, 137 KB)

image.png (1,500×1,114 px, 111 KB)

In the final version of the spike patch links are correct as long as site info table is filled out, and namespaces are fetched:

image.png (1,540×948 px, 129 KB)

image.png (1,580×1,112 px, 120 KB)

There is a known edge case in namespace naming with Polish and any other language that uses gendered User namespaces; only the default masculine form will be used.

The only good way to resolve that is to make a further refactor to the globaljsonlinks schema to include the namespace text form, which we originally didn't do to save space but GlobalUsage clearly had the same problem and just saved them all. :)

Seddon reassigned this task from bvibber to CCiufo-WMF.
Seddon moved this task from Doing to Ready for Signoff on the Charts (Sprint 14) board.
Seddon moved this task from Ready for Signoff to Doing on the Charts (Sprint 14) board.
Seddon moved this task from Doing to Ready for Signoff on the Charts (Sprint 14) board.