Page MenuHomePhabricator

Cognate output using sql.php on wiktionary
Closed, ResolvedPublic

Description

$ mwscript sql.php angwiktionary
...cognate_pages table already exists.
...cognate_titles table already exists.
...cognate_sites table already exists.
>

Seems to be the same on all wiktionaries.... Why are the cognate things being output?

Details

Related Gerrit Patches:
mediawiki/extensions/Cognate : masterDon't run updates in onLoadExtensionSchemaUpdates hook itself
mediawiki/extensions/Cognate : masterWIP Use AfterDatabaseUpdaterDoUpdates hook
mediawiki/core : masterWIP Add AfterDatabaseUpdaterDoUpdates hook

Event Timeline

Reedy created this task.Aug 30 2017, 12:41 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 30 2017, 12:41 AM
Restricted Application added a project: User-Addshore. · View Herald TranscriptAug 30 2017, 8:41 AM

So, this is due to Cognate probably slightly abusing the 'LoadExtensionSchemaUpdates' hook.
https://github.com/wikimedia/mediawiki-extensions-Cognate/blob/master/src/CognateHooks.php#L123

A DatabaseUpdater object gets constructed when you run sql.php apparently, the __construct method triggers the hook and calls the doUpdates method.

We could:

  1. Have a separate maint script for doing the Cognate install?
  2. Make the hook not fire on __construct but instead later on in processing?
  3. Add another hook RunExtensionSchemaUpdates

Right now I'm all for #3

Change 374757 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] WIP Add AfterDatabaseUpdaterDoUpdates hook

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

Change 374758 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/Cognate@master] WIP Use AfterDatabaseUpdaterDoUpdates hook

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

Change 374846 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/Cognate@master] Don't run updates in onLoadExtensionSchemaUpdates hook itself

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

Change 374757 abandoned by Addshore:
WIP Add AfterDatabaseUpdaterDoUpdates hook

Reason:
See https://gerrit.wikimedia.org/r/#/c/374846

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

Change 374758 abandoned by Addshore:
WIP Use AfterDatabaseUpdaterDoUpdates hook

Reason:
See https://gerrit.wikimedia.org/r/#/c/374846

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

Addshore moved this task from Doing to Review on the WMDE-QWERTY-Sprint-2017-08-22 board.

Change 374846 merged by jenkins-bot:
[mediawiki/extensions/Cognate@master] Don't run updates in onLoadExtensionSchemaUpdates hook itself

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

Addshore closed this task as Resolved.Aug 31 2017, 9:15 AM
Addshore moved this task from Active 🚁 to Closing ✔️ on the User-Addshore board.
Addshore moved this task from Review to Done on the WMDE-QWERTY-Sprint-2017-08-22 board.