You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org
GrowthExperiments setup: Difference between revisions
imported>Urbanecm (typo) |
imported>Urbanecm (update docs to make them more useful for a classical GE deployment) |
||
Line 1: | Line 1: | ||
This is a documentation for developers for adding [[mw:Growth|Growth features]] to a Wikimedia wiki. For requesting these features as a community member, see [[mw:Growth/Communities/Get the Growth experiments on your wiki]] instead. | This is a documentation for developers for adding [[mw:Growth|Growth features]] to a Wikimedia wiki. For requesting these features as a community member, see [[mw:Growth/Communities/Get the Growth experiments on your wiki]] instead. | ||
== Preparation == | |||
=== Some time ahead... === | |||
Add [[mw:Manual:Special_pages#The_aliases_file|special page aliases]] for the new language. (Example patch: {{gerrit|643084}} Note: do not include namespace names.) Unlike the other changes described here, this is deployed via the [[Deployments/Train|train]] so it's worth doing ahead of the rest. This is an i18n change so if you need to backport it, you have to use [[Scap#scap_sync-world|scap sync-world]]. | |||
This can be omitted if needed. | |||
=== Server configuration (<code>operations/mediawiki-config</code>) === | |||
First, you need to enable the extension itself (<code>wmgUseGrowthExperiments</code>). This enables all main features. In rare cases, you might need to be disabled for the wiki (<code>wgWelcomeSurveyEnabled</code>, <code>wgGEHelpPanelEnabled</code>, <code>wgGEHomepageEnabled</code>, ...). You might also wish to set wmgGEFeaturesMayBeAvailableToNewcomers to false in case you are deploying the features in the dark mode (not available to newcomers). | |||
In addition to <code>wmgUseGrowthExperiments</code>, you need to add the wiki to the growthexperiments [[Configuration_files#dblists|dblist]] by adding <code>growthexperiments</code> to the <code>inheritsFrom</code> list in <code>wmf-config/config/{wiki id}.yaml</code> in the <code>operations/mediawiki-config</code> repo and running <code>composer buildDBLists</code> (which updates <code>dblists/growthexperiments.dblist</code>). | |||
Once this is done, you need to configure the features. Overview of the configuration variables that are commonly set is below: | |||
{| class="wikitable" | |||
|+ | |||
!Feature | |||
!Variable | |||
!Mandatory/Optional | |||
!Notes | |||
|- | |||
| rowspan="4" |Help panel | |||
|<code>wgGEHelpPanelHelpDeskTitle</code> | |||
|Optional | |||
| | |||
|- | |||
|<code>wgGEHelpPanelLinks</code> | |||
|Optional | |||
| | |||
*The <code>title</code> field is the page title of the wiki page to link to. Interwiki prefixes and section fragments can be used here, e.g. <code>mw:Help/VisualEditor/User_guide/pt#Editar_referências</code> | |||
*The <code>text</code> field is the link text. The Phabricator task requesting the deployment should specify both the title and the text for each link, but it sometimes doesn't. If the text is not specified, you can usually the page title without namespace, but use your best judgement and ask the requesting community member to confirm your guesses. Use spaces not underscores (everywhere else it doesn't matter). | |||
* The <code>id</code> field is somewhat arbitrary (only used for analytics), you can try to follow conventions from other languages but ultimately it doesn't matter much. | |||
|- | |||
|<code>wgGEHelpPanelReadingModeNamespaces</code> | |||
|Optional | |||
| | |||
|- | |||
|<code>wgGEHelpPanelViewMoreTitle</code> | |||
|Mandatory | |||
| | |||
|- | |||
| rowspan="2" |Homepage | |||
|<code>wgGEHomepageMentorsList</code> | |||
|Optional | |||
| | |||
|- | |||
|<code>wgGEHomepageSuggestedEditsIntroLinks</code> | |||
|Mandatory | |||
| | |||
|} | |||
=== Wiki configuration === | |||
On-wiki config needs to be done in <code>MediaWiki:NewcomerTasks.json</code>. You can copy&customize [[w:cs:MediaWiki:NewcomerTasks.json|Czech Wikipedia's copy]] to do this easily. This means your wiki account needs to be in staff, sysop or a similar user group. Use a descriptive edit summary such as <code>Configuration for <nowiki>[[mw:Growth/Personalized first day/Newcomer homepage]]</nowiki>. See <nowiki>[[phab:XXX]]</nowiki> for more information.</code> | |||
=== Deployment === | |||
Deploy the changes in a [[Backport windows|backport window]]. After you do so, please: | |||
# ''(Placeholder for adding tables. This is not needed today, but by the time this page is next used, it probably will be.)'' Run <code>mwscript extensions/WikimediaMaintenance/createExtensionTables.php --wiki=xxwiki GrowthExperiments</code> | |||
# Test by enabling ''User profile > Display newcomer homepage'' and ''Editing > Enable the editor help panel'' in Special:Preferences, visiting Special:ClaimMentee (this will validate the mentor page as a side effect), visiting Special:Homepage, and clicking on a suggested task to bring up the help panel in suggested editing mode. | |||
#Check that there are enough tasks, by running <code>mwscript extensions/GrowthExperiments/maintenance/listTaskCounts.php --wiki=xxwiki</code>. It's especially important for the <code>copyedit</code> and <code>links</code> task types to have some tasks for each topic. | |||
#*Ideally, we would check whether there are enough tasks before deployment, but we don't have the tooling for that yet, | |||
== Validation of translations (back-up from old docs) == | |||
Verify that the translations are complete. You should also do this ahead of the other steps, so that translators have time to add any missing translations. | |||
*Add the new language to the <code>requireCompleteTranslationLanguages</code> array in <code>Gruntfile.js</code> in the GrowthExperiments repo ([[gerrit:c/mediawiki/extensions/GrowthExperiments/+/609885|example patch]]) | |||
*Run <code>grunt banana:translations</code>. This will output a list of message keys for each language with missing translations. | |||
**Note that the list is grouped first by i18n subdirectory, then by language, so the missing messages for each language may be split across multiple lists | |||
**Optional messages that don't have to be translated are also listed as missing, so there are a few false positives. You can check whether a message is optional in qqq, and you can get an idea of which messages are likely to be false positives by looking at which messages are reported as missing in almost every language, and/or in languages with very few missing translations | |||
*It's recommended that you wait until most or all translations have been completed and have been deployed via the train | |||
**When you're not sure which translations caught the train, you can check by checking out the relevant wmf branch (e.g. <code>git checkout wmf/1.36.0-wmf.22</code>) and running <code>grunt banana:translations</code> | |||
**Backporting translation changes is possible, but is recommended against because it requires usng [[Scap#scap_sync-world|scap sync-world]]. If the number of translations that missed the train is small, consider using temporary overrides in the MediaWiki namespace instead. (If message <code>growthexperiments-foo</code> is missing, copy+paste its translation into the <code>MediaWiki:Growthexperiments-foo</code> wiki page, then set a reminder to delete that page after the translation has been deployed via the train.) | |||
[[Category:How-To]] | [[Category:How-To]] |
Revision as of 20:21, 10 March 2021
This is a documentation for developers for adding Growth features to a Wikimedia wiki. For requesting these features as a community member, see mw:Growth/Communities/Get the Growth experiments on your wiki instead.
Preparation
Some time ahead...
Add special page aliases for the new language. (Example patch: 643084 Note: do not include namespace names.) Unlike the other changes described here, this is deployed via the train so it's worth doing ahead of the rest. This is an i18n change so if you need to backport it, you have to use scap sync-world.
This can be omitted if needed.
Server configuration (operations/mediawiki-config
)
First, you need to enable the extension itself (wmgUseGrowthExperiments
). This enables all main features. In rare cases, you might need to be disabled for the wiki (wgWelcomeSurveyEnabled
, wgGEHelpPanelEnabled
, wgGEHomepageEnabled
, ...). You might also wish to set wmgGEFeaturesMayBeAvailableToNewcomers to false in case you are deploying the features in the dark mode (not available to newcomers).
In addition to wmgUseGrowthExperiments
, you need to add the wiki to the growthexperiments dblist by adding growthexperiments
to the inheritsFrom
list in wmf-config/config/{wiki id}.yaml
in the operations/mediawiki-config
repo and running composer buildDBLists
(which updates dblists/growthexperiments.dblist
).
Once this is done, you need to configure the features. Overview of the configuration variables that are commonly set is below:
Feature | Variable | Mandatory/Optional | Notes |
---|---|---|---|
Help panel | wgGEHelpPanelHelpDeskTitle
|
Optional | |
wgGEHelpPanelLinks
|
Optional |
| |
wgGEHelpPanelReadingModeNamespaces
|
Optional | ||
wgGEHelpPanelViewMoreTitle
|
Mandatory | ||
Homepage | wgGEHomepageMentorsList
|
Optional | |
wgGEHomepageSuggestedEditsIntroLinks
|
Mandatory |
Wiki configuration
On-wiki config needs to be done in MediaWiki:NewcomerTasks.json
. You can copy&customize Czech Wikipedia's copy to do this easily. This means your wiki account needs to be in staff, sysop or a similar user group. Use a descriptive edit summary such as Configuration for [[mw:Growth/Personalized first day/Newcomer homepage]]. See [[phab:XXX]] for more information.
Deployment
Deploy the changes in a backport window. After you do so, please:
- (Placeholder for adding tables. This is not needed today, but by the time this page is next used, it probably will be.) Run
mwscript extensions/WikimediaMaintenance/createExtensionTables.php --wiki=xxwiki GrowthExperiments
- Test by enabling User profile > Display newcomer homepage and Editing > Enable the editor help panel in Special:Preferences, visiting Special:ClaimMentee (this will validate the mentor page as a side effect), visiting Special:Homepage, and clicking on a suggested task to bring up the help panel in suggested editing mode.
- Check that there are enough tasks, by running
mwscript extensions/GrowthExperiments/maintenance/listTaskCounts.php --wiki=xxwiki
. It's especially important for thecopyedit
andlinks
task types to have some tasks for each topic.- Ideally, we would check whether there are enough tasks before deployment, but we don't have the tooling for that yet,
Validation of translations (back-up from old docs)
Verify that the translations are complete. You should also do this ahead of the other steps, so that translators have time to add any missing translations.
- Add the new language to the
requireCompleteTranslationLanguages
array inGruntfile.js
in the GrowthExperiments repo (example patch) - Run
grunt banana:translations
. This will output a list of message keys for each language with missing translations.- Note that the list is grouped first by i18n subdirectory, then by language, so the missing messages for each language may be split across multiple lists
- Optional messages that don't have to be translated are also listed as missing, so there are a few false positives. You can check whether a message is optional in qqq, and you can get an idea of which messages are likely to be false positives by looking at which messages are reported as missing in almost every language, and/or in languages with very few missing translations
- It's recommended that you wait until most or all translations have been completed and have been deployed via the train
- When you're not sure which translations caught the train, you can check by checking out the relevant wmf branch (e.g.
git checkout wmf/1.36.0-wmf.22
) and runninggrunt banana:translations
- Backporting translation changes is possible, but is recommended against because it requires usng scap sync-world. If the number of translations that missed the train is small, consider using temporary overrides in the MediaWiki namespace instead. (If message
growthexperiments-foo
is missing, copy+paste its translation into theMediaWiki:Growthexperiments-foo
wiki page, then set a reminder to delete that page after the translation has been deployed via the train.)
- When you're not sure which translations caught the train, you can check by checking out the relevant wmf branch (e.g.