Page MenuHomePhabricator

Stop managing both interwiki.list and interwiki.sql
Closed, ResolvedPublic

Description

DatabaseUpdater::populateInterwikiTable() says Common function for databases that don't understand the MySQLish syntax of interwiki.sql.

It seems daft to be maintaining basically two lists and ways of doing the same sort of thing.

The SQL version does have REPLACE INTO which would allow a form of updating... But the MysqlUpdater code doesn't actually allow that to happen, and doesn't run the SQL file if the interwiki table already exists...

Do we have documentation telling people to run/use it in another way? If not, why are we using REPLACE INTO etc?

	/**
	 * Check that interwiki table exists; if it doesn't source it
	 */
	protected function doInterwikiUpdate() {
		global $IP;

		if ( !$this->doTable( 'interwiki' ) ) {
			return;
		}

		if ( $this->db->tableExists( "interwiki", __METHOD__ ) ) {
			$this->output( "...already have interwiki table\n" );

			return;
		}

		$this->applyPatch( 'patch-interwiki.sql', false, 'Creating interwiki table' );
		$this->applyPatch(
			"$IP/maintenance/interwiki.sql",
			true,
			'Adding default interwiki definitions'
		);
	}

This seems ripe for cleaning up in some way or another.... Especially as it starts being relevant to T259771: RFC: Drop support for older database upgrades and potentially as part of the Abstract Schema initiative.

Maybe even MW should be updating the interwiki table when there are changes to the files/lists too?

Event Timeline

Maybe even MW should be updating the interwiki table when there are changes to the files/lists too?

A significant caveat with silently adding interwikis upon upgrading the site is that it can conflict with namespaces as well as article titles that happen to start with a certain prefix. For that reason, I believe, we have never provided new interwikis for existing wikis.

On an entirely unrelated note, I think interwiki links as a concept may also be worth evaluating whether they still make sense to keep around as a feature for new content and new wikis, perhaps freezing them for compat with existing content. This semi-random subset of external link abstractions has, to me, at least always been of questionable value with not insignificant costs and confusions associated with them for developers and end-users alike.

Maybe even MW should be updating the interwiki table when there are changes to the files/lists too?

A significant caveat with silently adding interwikis upon upgrading the site is that it can conflict with namespaces as well as article titles that happen to start with a certain prefix. For that reason, I believe, we have never provided new interwikis for existing wikis.

Even more reason to call into question why we have an SQL patch with MySQL's REPLACE INTO - https://dev.mysql.com/doc/refman/8.0/en/replace.html

On an entirely unrelated note, I think interwiki links as a concept may also be worth evaluating whether they still make sense to keep around as a feature for new content and new wikis, perhaps freezing them for compat with existing content. This semi-random subset of external link abstractions has, to me, at least always been of questionable value with not insignificant costs and confusions associated with them for developers and end-users alike.

Indeed. Possibly worth a wider conversation, which would then answer if we do tasks such as T146850: Add WikiApiary to interwiki.list, the default interwiki table at time of wiki installation (or we just point blank decline them as we're not adding more entries etc)

From what I'm understanding is that this was added before 1.2 for updating to 1.2 and further. I don't see a point in maintaining that list specially given that it skips the patch if interwiki table exists and that's the case in almost everywhere (unless it's from 1.1 or before).

Technically the T259771 means we can just drop it. Am I missing something obvious?

Change 675217 had a related patch set uploaded (by Ladsgroup; author: Ladsgroup):
[mediawiki/core@master] Drop doInterwikiUpdate

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

Change 675217 merged by jenkins-bot:
[mediawiki/core@master] Drop doInterwikiUpdate

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

Ladsgroup claimed this task.

Change 675854 had a related patch set uploaded (by Ladsgroup; author: Ladsgroup):
[mediawiki/core@master] Drop now unused patch-interwiki.sql

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

Change 675854 merged by jenkins-bot:

[mediawiki/core@master] Drop now unused patch-interwiki.sql

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