Extension:GrowthExperiments/developer setup

Installation
If you're not using vagrant, download mediawiki and set it up with either  or a local server using the manual installation instructions.

Download and install the necessary skins and extensions:


 * Install and set up VisualEditor.
 * Install and set up CirrusSearch.

Suggested Edits
There are three basic approaches for setting up suggested edits, the main functionality of GrowthExperiments, in a developer setup:
 * 1) Have the extension use the search API of a remote (production) wiki. You won't have to deal with setting up search locally, and you will get a wide range of realistic task suggestions, but the articles suggested for those tasks won't exist on your wiki so most editing-related functionality won't work. This is the easiest way to get the homepage and guidance working in general, and to QA task suggestions. It doesn't work for structured link recommendations though since those aren't enabled on any production wiki yet.
 * 2) Set up search locally, copy-paste or import a couple articles from some real wiki. This is quite a bit more effort but doable (on Vagrant it should mostly work out of the box). It's good for backend development, probably not really worth the effort for frontend development.
 * 3) Mock all the backend logic involved with static PHP code. This is nice for frontend work as you get direct and full control over the responses from the backend.

Set up search locally
In Vagrant search can be set up with  (but it will be set up automatically as a dependency if you provision the   role). For other setups, a basic configuration is:

See the setup notes of Extension:CirrusSearch for more details.

You can use the CirrusSearch maintenance script  for setting the ORES topics of wiki pages.

To use settings from cswiki:


 * 1) Follow the ElasticSearch instructions from 1>Special:MyLanguage/MediaWiki-Docker/Configuration_recipes/ElasticSearch|MediaWiki-Docker/Configuration_recipes/ElasticSearch.


 * 1) Copy the contents of MediaWiki:NewcomerTopicsOres.json to http://localhost:8080/w/index.php?title=MediaWiki:NewcomerTopicsOres.json&action=edit.  (must be signed in as an admin on MediaWiki)


 * 1) Copy the contents of MediaWiki:NewcomerTasks.json to http://localhost:8080/w/index.php?title=MediaWiki:NewcomerTasks.json&action=edit.  (must be signed in as an admin on MediaWiki)


 * 1) Add   to  .


 * 1) Add  </> to <tvar|2> </>.


 * 1) Add <tvar|1> </> to <tvar|2> .</>

Link recommendations
Your local development environment can query the "external traffic" production release of the link recommendation service. Access is proxied via the api-gateway (api.wikimedia.org) which requires an access token to utilize the API. That means you need to generate a personal access token (https://api.wikimedia.org/wiki/Documentation/Getting_started/Authentication#Personal_API_tokens), when you will use the access token as the value for GELinkRecommendationServiceAccessToken in LocalSettings.php:

To allow non-existent pages (red links) as suggested edits, add the following to LocalSettings.php

Seeding Articles

 * 1) Get article titles for Growth tasks from Czech Wikipedia. Note: This assumes jq is installed.
 * 2) Paste the article titles into https://cs.wikipedia.org/wiki/Special:Export, leave "Include templmates" unchecked, and only get the most recent revision. Save XML file
 * 3) Import XML dump by running the following command inside mediawiki installation directory
 * 4) Create "Module:Wikidata" on your local site. Copy/paste the source of https://cs.wikipedia.org/wiki/Module:Wikidata and save it.
 * 5) Update ElasticSearch

Seeding ORES topics
To import ORES topics for articles imported from a production wiki (English Wikipedia in the example below), run To set ORES topics for some article manually, use