Page MenuHomePhabricator

Deprecate Graph and Data namespaces on mediawiki.org and collab.wikimedia.org
Closed, ResolvedPublic

Description

Currently, three wikis are still configured to use Graph extension with the capability to store graph informations in specialized namespaces pages:

  • collab
  • mediawiki.org
  • zero

We should check if collab and zero use it, and consider a maintenance task on mediawiki.org to move the last namespace pages in templates or linline in graph tag.

Previous discussion for some context:

... No need to wait, but please don't use Graph namespace
(might want to disable it in config for new wikis)

...
@Yurik and me discussed the feature on the Gerrit change and on IRC. In a nutshell, we disabled the possibility for new wikis to use namespaces, and also, following @Krenair suggestion, for wikis still not using them.]

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

There isn't a Graph namespace any longer right ?
mediawiki.org at least only uses Data: namespace now as far as I can tell..

If someone can check the other wikis, we can get this closed off.

Aklapper renamed this task from Deprecate Graph namespace to Deprecate Graph namespace on mediawiki.org and collab.wikimedia.org.Aug 4 2022, 4:58 AM

From https://noc.wikimedia.org/conf/InitialiseSettings.php.txt :

'wmgUseGraphWithJsonNamespace' => [
	'default' => false,

	// Legacy Graph deployments, with a Graph: namespace.
	// Yurik would like new wikis only use <graph>...</graph>.
	// See T97027 discussion for context.
	'collabwiki' => true,
	'mediawikiwiki' => true,
],

https://www.mediawiki.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces lists no Graph.

Cannot access https://collab.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces

Change 888708 had a related patch set uploaded (by Aklapper; author: Aklapper):

[operations/mediawiki-config@master] Set wmgUseGraphWithJsonNamespace = false for mediawikiwiki

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

Change 888708 merged by jenkins-bot:

[operations/mediawiki-config@master] Set wmgUseGraphWithJsonNamespace = false for mediawikiwiki

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

Mentioned in SAL (#wikimedia-operations) [2023-04-20T12:04:11Z] <ladsgroup@deploy2002> Started scap: Backport for [[gerrit:888708|Set wmgUseGraphWithJsonNamespace = false for mediawikiwiki (T124748)]]

Mentioned in SAL (#wikimedia-operations) [2023-04-20T12:05:30Z] <ladsgroup@deploy2002> aklapper and ladsgroup: Backport for [[gerrit:888708|Set wmgUseGraphWithJsonNamespace = false for mediawikiwiki (T124748)]] synced to the testservers: mwdebug2001.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2002.codfw.wmnet, mwdebug1002.eqiad.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-04-20T12:11:59Z] <ladsgroup@deploy2002> Finished scap: Backport for [[gerrit:888708|Set wmgUseGraphWithJsonNamespace = false for mediawikiwiki (T124748)]] (duration: 07m 48s)

Change 888708 merged by jenkins-bot:

[operations/mediawiki-config@master] Set wmgUseGraphWithJsonNamespace = false for mediawikiwiki

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

I think this needs to be reverted. As far as I can tell, in addition to (or instead of? idk) removing the Graph: namespace, it removed the Data: namespace (namespace 486), which is not empty – there are five pages in it:

mysql:research@dbstore1007.eqiad.wmnet [mediawikiwiki]> SELECT page_id, page_latest, page_title FROM page WHERE page_namespace = 486;
+---------+-------------+-------------------------------------------+
| page_id | page_latest | page_title                                |
+---------+-------------+-------------------------------------------+
| 1117504 |     3850362 | Data_demo.tab                             |
|  445024 |     3805669 | Json:Graph_demo                           |
|  445023 |     3805713 | Json:Graph_demo.json                      |
|  377536 |     3805714 | Json:Wikicon                              |
|  957051 |     3321193 | Sandbox/Sylvain_Boissel_WMFr/TestFnac.tab |
+---------+-------------+-------------------------------------------+
5 rows in set (0.001 sec)

Those five pages are now unreachable, and they also have a content model that no longer exists, which causes problems e.g. when dumping them (similar to T335130):

lucaswerkmeister-wmde@mwdebug2002:~$ mwscript dumpBackup mediawikiwiki --current --start 377536 --end 377537
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
  <siteinfo>
    <sitename>MediaWiki</sitename>
    <dbname>mediawikiwiki</dbname>
    <base>https://www.mediawiki.org/wiki/MediaWiki</base>
    <generator>MediaWiki 1.41.0-wmf.5</generator>
    <case>first-letter</case>
    <namespaces>
      <namespace key="-2" case="first-letter">Media</namespace>
      <namespace key="-1" case="first-letter">Special</namespace>
      <namespace key="0" case="first-letter" />
      <namespace key="1" case="first-letter">Talk</namespace>
      <namespace key="2" case="first-letter">User</namespace>
      <namespace key="3" case="first-letter">User talk</namespace>
      <namespace key="4" case="first-letter">Project</namespace>
      <namespace key="5" case="first-letter">Project talk</namespace>
      <namespace key="6" case="first-letter">File</namespace>
      <namespace key="7" case="first-letter">File talk</namespace>
      <namespace key="8" case="first-letter">MediaWiki</namespace>
      <namespace key="9" case="first-letter">MediaWiki talk</namespace>
      <namespace key="10" case="first-letter">Template</namespace>
      <namespace key="11" case="first-letter">Template talk</namespace>
      <namespace key="12" case="first-letter">Help</namespace>
      <namespace key="13" case="first-letter">Help talk</namespace>
      <namespace key="14" case="first-letter">Category</namespace>
      <namespace key="15" case="first-letter">Category talk</namespace>
      <namespace key="90" case="first-letter">Thread</namespace>
      <namespace key="91" case="first-letter">Thread talk</namespace>
      <namespace key="92" case="first-letter">Summary</namespace>
      <namespace key="93" case="first-letter">Summary talk</namespace>
      <namespace key="100" case="first-letter">Manual</namespace>
      <namespace key="101" case="first-letter">Manual talk</namespace>
      <namespace key="102" case="first-letter">Extension</namespace>
      <namespace key="103" case="first-letter">Extension talk</namespace>
      <namespace key="104" case="first-letter">API</namespace>
      <namespace key="105" case="first-letter">API talk</namespace>
      <namespace key="106" case="first-letter">Skin</namespace>
      <namespace key="107" case="first-letter">Skin talk</namespace>
      <namespace key="710" case="first-letter">TimedText</namespace>
      <namespace key="711" case="first-letter">TimedText talk</namespace>
      <namespace key="828" case="first-letter">Module</namespace>
      <namespace key="829" case="first-letter">Module talk</namespace>
      <namespace key="1198" case="first-letter">Translations</namespace>
      <namespace key="1199" case="first-letter">Translations talk</namespace>
      <namespace key="2300" case="case-sensitive">Gadget</namespace>
      <namespace key="2301" case="case-sensitive">Gadget talk</namespace>
      <namespace key="2302" case="case-sensitive">Gadget definition</namespace>
      <namespace key="2303" case="case-sensitive">Gadget definition talk</namespace>
      <namespace key="2600" case="first-letter">Topic</namespace>
      <namespace key="5500" case="first-letter">Newsletter</namespace>
      <namespace key="5501" case="first-letter">Newsletter talk</namespace>
    </namespaces>
  </siteinfo>
  <page>
    <title>Json:Wikicon</title>
    <ns>486</ns>
    <id>377536</id>
MWUnknownContentModelException from line 203 of /srv/mediawiki/php-1.41.0-wmf.5/includes/content/ContentHandlerFactory.php: The content model 'Json.JsonConfig' is not registered on this wiki.
See https://www.mediawiki.org/wiki/Content_handlers to find out which extensions handle this content model.
#0 /srv/mediawiki/php-1.41.0-wmf.5/includes/content/ContentHandlerFactory.php(273): MediaWiki\Content\ContentHandlerFactory->validateContentHandler('Json.JsonConfig', NULL)
#1 /srv/mediawiki/php-1.41.0-wmf.5/includes/content/ContentHandlerFactory.php(191): MediaWiki\Content\ContentHandlerFactory->createContentHandlerFromHook('Json.JsonConfig')
#2 /srv/mediawiki/php-1.41.0-wmf.5/includes/content/ContentHandlerFactory.php(97): MediaWiki\Content\ContentHandlerFactory->createForModelID('Json.JsonConfig')
#3 /srv/mediawiki/php-1.41.0-wmf.5/includes/export/XmlDumpWriter.php(474): MediaWiki\Content\ContentHandlerFactory->getContentHandler('Json.JsonConfig')
#4 /srv/mediawiki/php-1.41.0-wmf.5/includes/export/XmlDumpWriter.php(402): XmlDumpWriter->writeSlot(Object(MediaWiki\Revision\SlotRecord), 0)
#5 /srv/mediawiki/php-1.41.0-wmf.5/includes/export/WikiExporter.php(563): XmlDumpWriter->writeRevision(Object(stdClass), Array)
#6 /srv/mediawiki/php-1.41.0-wmf.5/includes/export/WikiExporter.php(501): WikiExporter->outputPageStreamBatch(Object(Wikimedia\Rdbms\MysqliResultWrapper), NULL)
#7 /srv/mediawiki/php-1.41.0-wmf.5/includes/export/WikiExporter.php(325): WikiExporter->dumpPages('page_id >= 3775...', false)
#8 /srv/mediawiki/php-1.41.0-wmf.5/includes/export/WikiExporter.php(208): WikiExporter->dumpFrom('page_id >= 3775...', false)
#9 /srv/mediawiki/php-1.41.0-wmf.5/maintenance/includes/BackupDumper.php(360): WikiExporter->pagesByRange(377536, 377537, false)
#10 /srv/mediawiki/php-1.41.0-wmf.5/maintenance/dumpBackup.php(84): BackupDumper->dump(2, 0)
#11 /srv/mediawiki/php-1.41.0-wmf.5/maintenance/includes/MaintenanceRunner.php(681): DumpBackup->execute()
#12 /srv/mediawiki/php-1.41.0-wmf.5/maintenance/run.php(51): MediaWiki\Maintenance\MaintenanceRunner->run()
#13 /srv/mediawiki/multiversion/MWScript.php(140): require_once('/srv/mediawiki/...')
#14 {main}

If the pages aren’t needed anymore, they should be deleted so they don’t disturb dumps and other stuff, but for that they first need to become reachable again.

Turns out it’s not just the dumps, and the pages aren’t as unreachable as I thought – you also get an MWUnknownContentModelException if you load them by page ID: https://www.mediawiki.org/w/index.php?curid=1117504

Change 910780 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[operations/mediawiki-config@master] Set wmgUseGraphWithJsonNamespace = true for mediawikiwiki

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

Change 910780 merged by jenkins-bot:

[operations/mediawiki-config@master] Set wmgUseGraphWithJsonNamespace = true for mediawikiwiki

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

Mentioned in SAL (#wikimedia-operations) [2023-04-21T15:47:13Z] <lucaswerkmeister-wmde@deploy2002> Started scap: Backport for [[gerrit:910780|Set wmgUseGraphWithJsonNamespace = true for mediawikiwiki (T124748 T335130)]]

Mentioned in SAL (#wikimedia-operations) [2023-04-21T15:48:48Z] <lucaswerkmeister-wmde@deploy2002> lucaswerkmeister-wmde: Backport for [[gerrit:910780|Set wmgUseGraphWithJsonNamespace = true for mediawikiwiki (T124748 T335130)]] synced to the testservers: mwdebug1002.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug1001.eqiad.wmnet, mwdebug2002.codfw.wmnet

I didn't see that coming. :-/ Thanks for the quick revert!

Mentioned in SAL (#wikimedia-operations) [2023-04-21T15:57:15Z] <lucaswerkmeister-wmde@deploy2002> Finished scap: Backport for [[gerrit:910780|Set wmgUseGraphWithJsonNamespace = true for mediawikiwiki (T124748 T335130)]] (duration: 10m 01s)

Okay, the Data: pages are properly reachable again:

Leaving it to someone else to decide whether we should delete them or do something else with them in the longer term :) courtesy ping @Ash_Crow, since that one file name looks more personal than the others ^^

As a MediaWiki.org admin, I'd be inclined to delete them all; the first one is a failed test related to T252711, the next 2 are tests by the same former WMF employee; the fourth one is an attempt to resolve a phab task that was later resolved in a different way, and the last one has no useful content. In the unlikely event there's something worth preserving it can presumably have its content model changed to JSON and be moved to a different namespace.

As a MediaWiki.org admin, I'd be inclined to delete them all; the first one is a failed test related to T252711, the next 2 are tests by the same former WMF employee; the fourth one is an attempt to resolve a phab task that was later resolved in a different way, and the last one has no useful content. In the unlikely event there's something worth preserving it can presumably have its content model changed to JSON and be moved to a different namespace.

Agreed, It is better off being deleted in my opinion. Or maybe.. just change the content model to text and then deleted ? Makes looking at the history easier later on I suspect.

I am not sure if it's relevant here, but in case it's useful: The is a way to keep page histories and diffs workign after a content model has been removed from a wiki. That's the job of FallbackContentHandler. Just register it for the relevant content model, e.g.:

$wgContentHandlers['Json.JsonConfig'] = FallbackContentHandler::class;
Jdlrobson triaged this task as Medium priority.Apr 25 2023, 10:08 PM
Jdlrobson subscribed.

@TheDJ do you have any idea about what is left to do here?

Since graphs is broken I'd like to get the deployed version into a more predictable state across projects.

do you have any idea about what is left to do here?

In my understanding, per last comments, change the content model of the five mediawiki.org pages to text, then delete these five pages , then reapply wmgUseGraphWithJsonNamespace = false for mediawikiwiki. After that, check the situation on collabwiki which I cannot access.

I found this task while trying to make sense of JsonConfig's crazy configuration options we have in production. Let me try to summarize and update.

We want to remove this: https://codesearch.wmcloud.org/deployed/?q=wmgUseGraphWithJsonNamespace which will remove the following config settings from the two wikis:

		$wgJsonConfigModels['Json.JsonConfig'] = null;
		$wgJsonConfigs['Json.JsonConfig'] = [
			'namespace' => 486,
			'nsName' => 'Data',
			'isLocal' => true,
			'pattern' => '/^Json:./',
			'cacheKey' => $jsonWiki,
		];

This will have two effects:

  • The Data: namespace (486) will no longer be defined
  • The Json.JsonConfig content model will no longer be defined (other JsonConfig content models are not affected)

We have tools to deal with these problems:

  • Running cleanupTitles.php, or moving the pages beforehand on-wiki. Once the config is removed, we could even move them back to the original titles (but not a proper namespace).
  • Setting $wgContentHandlers['Json.JsonConfig'] = FallbackContentHandler::class;, or changing the content model using Special:ChangeContentModel beforehand on-wiki (they can be set to the JSON content model)

The affected pages are:

  • On collabwiki, there is one page last edited in 2014 (I don't have access to the wiki, but I have access to its database replicas, heh). Pretty sure no one will miss it.
  • On mediawikiwiki, there are now 9 pages, up from 5…

I guess I can try to do this…

Including pages actually used: https://www.mediawiki.org/wiki/MediaWiki:Gadget-Global-AddAlternativeText.js for example loads data from the Data: namespace.

It doesn't actually use any JSONConfig features though, it just JSON parses it.

Including pages actually used: https://www.mediawiki.org/wiki/MediaWiki:Gadget-Global-AddAlternativeText.js for example loads data from the Data: namespace.

It doesn't actually use any JSONConfig features though, it just JSON parses it.

The page is https://www.mediawiki.org/wiki/Data:AddAlternativeText.tab, which uses a different JsonConfig content model. Everything should keep working if we move it back to the same title once the namespace is gone. Maybe the gadget should be storing that data in the Commons Data: namespace (since that's where the namespace is supposed to exist), but it can also stay like that indefinitely. cc @Sophivorus

matmarex renamed this task from Deprecate Graph namespace on mediawiki.org and collab.wikimedia.org to Deprecate Graph and Data namespaces on mediawiki.org and collab.wikimedia.org.Feb 26 2025, 12:57 AM

Change #1122709 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] Remove $wmgUseGraphWithJsonNamespace

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

I'll give y'all a few days to check if this plan is right (and give myself time to find someone who can access collabwiki), and if it looks good, I'll get the patch deployed and clean up the pages some time next week.

I've been trying to clean up ahead of time - if you just use Special:ChangeContentModel to change the content model to JSON like I tried it succeeds but then the page can't be edited by the UI as gives some error about content formats not matching. The least bad way to do it seemed to be to delete, recreate, and undelete.

Okay, the Data: pages are properly reachable again:

Leaving it to someone else to decide whether we should delete them or do something else with them in the longer term :) courtesy ping @Ash_Crow, since that one file name looks more personal than the others ^^

The last one can be deleted, as the title suggests, it was a test for a partnership that never saw the light of day.

I've been trying to clean up ahead of time - if you just use Special:ChangeContentModel to change the content model to JSON like I tried it succeeds but then the page can't be edited by the UI as gives some error about content formats not matching. The least bad way to do it seemed to be to delete, recreate, and undelete.

Hmm, that's funny, but I expect that this error will go away once we get rid of the JsonConfig settings.

Hi! Some time ago I created the following translation tables in the Data namespace to hold the translations for the interface messages of some gadgets:

However, I just moved them to Commons, so they can safely be deleted now.

Deleted those.

The only things left are

https://www.mediawiki.org/w/index.php?title=Data:Data_demo.tab&action=history (@AlexisJazz)

https://www.mediawiki.org/wiki/Data:Json:Wikicon (worth keeping for history's sake IMO - I already changed its content model, so just deploy the change and run CleanupTitles)

The collabwiki page has been deleted.

Hi! Some time ago I created the following translation tables in the Data namespace to hold the translations for the interface messages of some gadgets:

However, I just moved them to Commons, so they can safely be deleted now.

Thanks!

Looks like it was a test for Scribunto data access: https://www.mediawiki.org/wiki/User:Alexis_Jazz/Sandbox – which didn't work (because, in our current configuration, it can only access data from Commons).

https://www.mediawiki.org/wiki/Data:Json:Wikicon (worth keeping for history's sake IMO - I already changed its content model, so just deploy the change and run CleanupTitles)

Thanks.

Looks like it was a test for Scribunto data access: https://www.mediawiki.org/wiki/User:Alexis_Jazz/Sandbox – which didn't work (because, in our current configuration, it can only access data from Commons).

Correct, just a test, that page isn't important. Also see T252711 which I guess can also be closed soon.

Change #1122709 merged by jenkins-bot:

[operations/mediawiki-config@master] Remove $wmgUseGraphWithJsonNamespace

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

Mentioned in SAL (#wikimedia-operations) [2025-03-03T14:57:12Z] <ihurbain@deploy2002> Started scap sync-world: Backport for [[gerrit:1122709|Remove $wmgUseGraphWithJsonNamespace (T124748)]]

Mentioned in SAL (#wikimedia-operations) [2025-03-03T14:59:51Z] <ihurbain@deploy2002> matmarex, ihurbain: Backport for [[gerrit:1122709|Remove $wmgUseGraphWithJsonNamespace (T124748)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2025-03-03T15:09:07Z] <ihurbain@deploy2002> Finished scap sync-world: Backport for [[gerrit:1122709|Remove $wmgUseGraphWithJsonNamespace (T124748)]] (duration: 11m 55s)

And it's gone.

We ran the cleanupTitles maintenance script, and then I moved the only remaining page https://www.mediawiki.org/wiki/Data:Json:Wikicon back to its original title (with a "fake" namespace prefix now).

@matmarex: I ended up fixing dumps to work around a small problem this caused: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1164493

I'm forever a noob in this space, but it seems it might be a good idea to add this to mediawikiwiki's config:

$wgContentHandlers['Json.JsonConfig'] = 'FallbackContentHandler'

I'm forever a noob in this space, but it seems it might be a good idea to add this to mediawikiwiki's config:

$wgContentHandlers['Json.JsonConfig'] = 'FallbackContentHandler'

Yes, please. Except that it should be 'MediaWiki\\Content\\FallbackContentHandler'.

Change #1166236 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] Use FallbackContentHandler for undeployed JsonConfig content handlers

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

Change #1166236 merged by jenkins-bot:

[operations/mediawiki-config@master] Use FallbackContentHandler for undeployed JsonConfig content handlers

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

Mentioned in SAL (#wikimedia-operations) [2025-07-03T20:38:45Z] <arlolra@deploy1003> Started scap sync-world: Backport for [[gerrit:1166236|Use FallbackContentHandler for undeployed JsonConfig content handlers (T124748)]], [[gerrit:1166012|ExtensionDistributor: Mark 1.44 as stable; remove 1.42 as EOL (T390798 T389313)]]

Mentioned in SAL (#wikimedia-operations) [2025-07-03T20:40:42Z] <arlolra@deploy1003> arlolra, matmarex: Backport for [[gerrit:1166236|Use FallbackContentHandler for undeployed JsonConfig content handlers (T124748)]], [[gerrit:1166012|ExtensionDistributor: Mark 1.44 as stable; remove 1.42 as EOL (T390798 T389313)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-07-03T20:47:12Z] <arlolra@deploy1003> Finished scap sync-world: Backport for [[gerrit:1166236|Use FallbackContentHandler for undeployed JsonConfig content handlers (T124748)]], [[gerrit:1166012|ExtensionDistributor: Mark 1.44 as stable; remove 1.42 as EOL (T390798 T389313)]] (duration: 08m 27s)

Change #1166286 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] Use FallbackContentHandler for another undeployed content handler

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

Change #1166286 merged by jenkins-bot:

[operations/mediawiki-config@master] Use FallbackContentHandler for another undeployed content handler

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

Mentioned in SAL (#wikimedia-operations) [2025-07-29T20:04:56Z] <urbanecm@deploy1003> Started scap sync-world: Backport for [[gerrit:1166286|Use FallbackContentHandler for another undeployed content handler (T124748)]], [[gerrit:1159610|Simplify $wgContactConfig required checkboxes validation]]

Mentioned in SAL (#wikimedia-operations) [2025-07-29T20:07:05Z] <urbanecm@deploy1003> matmarex, urbanecm: Backport for [[gerrit:1166286|Use FallbackContentHandler for another undeployed content handler (T124748)]], [[gerrit:1159610|Simplify $wgContactConfig required checkboxes validation]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-07-29T20:16:39Z] <urbanecm@deploy1003> Finished scap sync-world: Backport for [[gerrit:1166286|Use FallbackContentHandler for another undeployed content handler (T124748)]], [[gerrit:1159610|Simplify $wgContactConfig required checkboxes validation]] (duration: 11m 43s)