As discussed in a recent engineering team meeting, there are several advantages to splitting MediaSearch out of WikibaseMediaInfo into its own extension:
- We can set up Jest for front-end testing without having to deal with the existing node-qunit frameowrk in WBMI
- We can use the opportunity to create some boilerplate code for future projects (test framework, potentially webpack config or Storybook implementation)
- If an opportunity to use MediaSeach on another wiki comes up in the future, the code will already be modular and separate from WBMI
- WBMI is becoming quite large and modular code will be easier to maintain going forward
Here's a rough outline of what needs to be done; I'll split some of this out into subtasks later:
- Request a new Gerrit repo
- Build new extension, get CR from team
- Determine if we need security readiness review and, if so, get the ball rolling on that
- Remove code from WBMI
- Coordinate deployment (part of which will be T278121)
- Documentation: extension page and help page on mediawiki.org, add to https://www.mediawiki.org/wiki/Developers/Maintainers
---
## Deployment process
Deployment 0 (can be regular deployment train)
- Prepare i18n messages:
-- Build MediaSearch i18n messages from 2 sources. Patch: [674609](https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MediaSearch/+/674609)
-- Use consistent prefix for mediasearch i18n messages. Patch: [682095](https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseMediaInfo/+/682095)
-- Remove messages. Patch: [682096](https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MediaSearch/+/682096)
- Get Extension:MediaSearch repo in production; see [documentation](https://wikitech.wikimedia.org/wiki/How_to_deploy_code#Add_new_extension_to_extension-list_and_release_tools): Patch: [682101](https://gerrit.wikimedia.org/r/c/mediawiki/tools/release/+/682101)
Deployment 1 (backport & config deployment window)
- testcommons
-- Prepare any new config vars that MediaSearch requires (if any) & include the extension on testcommons. Patch: [682102](https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/682102)
-- [Deploy config](https://wikitech.wikimedia.org/wiki/Heterogeneous_deployment#Change_wiki_configuration)
-- Verify that nothing break
- commons
-- Prepare any new config vars that MediaSearch requires (if any) & include the extension on commons. Patch: [682105](https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/682105)
-- [Deploy config](https://wikitech.wikimedia.org/wiki/Heterogeneous_deployment#Change_wiki_configuration)
-- Verify that all functionality of [Special:MediaSearch](https://commons.wikimedia.org/wiki/Special:MediaSearch) (from WikibaseMediaInfo) continues to work, and that it all works in [Special:NewMediaSearch](https://commons.wikimedia.org/wiki/Special:NewMediaSearch) (from MediaSearch)
Deployment 2 (backport & config deployment window)
- Prepare, merge, backport & [pull these patches onto deployment host](https://wikitech.wikimedia.org/wiki/How_to_deploy_code#Step_2:_get_the_code_on_the_deployment_host):
-- Disable search widget takeover (in WikibaseMediaInfo) - Patch: [674015](https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseMediaInfo/+/674015)
-- Enable search widget takeover (in MediaSearch) - Patch: [674010](https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MediaSearch/+/674010)
-- Rename Special:MediaSearch to Special:OldMediaSearch (in WikibaseMediaInfo) - Patch: [676613](https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseMediaInfo/+/676613)
-- Rename Special:NewMediaSearch to Special:MediaSearch (in MediaSearch) - Patch: [676614](https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MediaSearch/+/676614)
- Pull both of these WikibaseMediaInfo changes in [staging server](https://wikitech.wikimedia.org/wiki/WikimediaDebug#Staging_changes) & check that nothing unexpected breaks
- Pull both of these MediaSearch changes in [staging server](https://wikitech.wikimedia.org/wiki/WikimediaDebug#Staging_changes) & test that everything works
- [Sync](https://wikitech.wikimedia.org/wiki/How_to_deploy_code#Step_4:_synchronize_the_changes_to_the_cluster) both of these WikibaseMediaInfo changes (Special:MediaSearch will not be accessible for a couple of minutes until next step; search widget requests will go to Special:Search)
- [Sync](https://wikitech.wikimedia.org/wiki/How_to_deploy_code#Step_4:_synchronize_the_changes_to_the_cluster) both of these MediaSearch patches (Special:MediaSearch is back, and so is the search widget takeover)
- Verify all [Special:MediaSearch](https://commons.wikimedia.org/wiki/Special:MediaSearch) functionality again
Post-deployment 2: work with translatewiki folks to move messages from WBMI to MediaSearch (see subtask for details)
Deployment 3 (can be regular deployment train)
- Remove all relevant code from WikibaseMediaInfo
- Verify all [Special:MediaSearch](https://commons.wikimedia.org/wiki/Special:MediaSearch) functionality again