Page MenuHomePhabricator

Add ability for extensions to add db types to the installer
Closed, DeclinedPublic5 Estimated Story Points

Description

Requirements to PoC
  • installer should not require existing LocalSettings.php file before installation
  • installer should not require code injected via hook into installer
  • installer will scan extension directory for extension.json files that implement database support
  • if a database loaded from an extension is selected, then when the installer prompts for which extensions/skins to enable:
    • the selected database extension should be pre-selected and it should not be possible to disable it
    • no other database extensions should be listed/selectable
  • selected extensions are loaded before the database is created

determine if there is anything else that needs to happen for this to work correctly
it should be possible to check in CI that an extension that is marked as a database extension implements required interfaces/hooks for that to be so

Definition of done:
  • proof of concept of the above approach
  • decision on how to identify a database extension in extension.json
  • document what interfaces/hooks must be implemented in an extension for it to satisfy requirements to provide database support

Event Timeline

Change 598901 had a related patch set uploaded (by Art-Baltai; owner: Art-Baltai):
[mediawiki/core@master] PoC that allows the extension to add a new type of database to the installer

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

Worked PoC with minimal changes
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/598901

Test extension with db-engine: https://github.com/artbaltai/mediawiki-dbext

Tested with LocalSettings.php:

<?php
wfLoadExtension( 'DBExt' );

Technical minuses:

  • final LocalSettings.php is created without existed parameters
  • We need to make a universal hook injection to the installer (not only for DBType injection)
  • We need to use the correct method to read extension.json (now it is a reader from a temporary queue)
  • We need to use the hooks mechanism
  • We need to create some method like isLocalSettingsConfigured
  • autotest is broken: Fatal error: Interface 'Wikibase\Store' not found in /workspace/src/extensions/Wikibase/repo/includes/Store/Sql/SqlStore.php on line 64 - I did not touch this file
Helga_sf set the point value for this task to 5.

Here is more detail on the approach we discussed:

  • installer should not require existing LocalSettings.php file before installation
  • installer should not require code injected via hook into installer
  • installer will scan extension directory for extension.json files that implement database support
  • if a database loaded from an extension is selected, then when the installer prompts for which extensions/skins to enable:
    • the selected database extension should be pre-selected and it should not be possible to disable it
    • no other database extensions should be listed/selectable
  • selected extensions are loaded before the database is created
    • determine if there is anything else that needs to happen for this to work correctly
  • it should be possible to check in CI that an extension that is marked as a database extension implements required interfaces/hooks for that to be so

Definition of done:

  • proof of concept of the above approach
  • decision on how to identify a database extension in extension.json
  • document what interfaces/hooks must be implemented in an extension for it to satisfy requirements to provide database support

Change 601650 had a related patch set uploaded (by Art-Baltai; owner: Art-Baltai):
[mediawiki/core@master] PoC that allows the extension to add a new type of database to the installer from extension without config

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

Change 598901 abandoned by Art-Baltai:
PoC that allows the extension to add a new type of database to the installer

Reason:
works, but not actual by requirements

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

Change 604477 had a related patch set uploaded (by Art-Baltai; owner: Art-Baltai):
[mediawiki/core@master] Add a new type of database to the installer from extension

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

Change 601650 abandoned by Art-Baltai:
PoC that allows the extension to add a new type of database to the installer from extension without config

Reason:
see https://gerrit.wikimedia.org/r/c/mediawiki/core/ /604477

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

Peter.ovchyn renamed this task from PoC that allows the extension to add a new type of database to the installer to Add ability for and extension to add a new type of database to the installer.Jun 11 2020, 3:41 PM

@Helga_sf , will your team reassign Art Baltai's open tasks?

Krinkle renamed this task from Add ability for and extension to add a new type of database to the installer to Add ability for extensions to add db types to the installer.Sep 8 2020, 1:23 PM
Pppery subscribed.

Per parent being declined.