Wikimedia Apps/Team/MEP dev process
MEP schema creation and modification process for apps
Repositories involved:
Use schemas/event/secondary repo to create new schemas or to alter existing ones. Repo settings: https://gerrit.wikimedia.org/r/admin/repos/schemas/event/secondary
Each time you create a new schema, remember to add it to the mediawiki config: Repo settings: https://gerrit.wikimedia.org/r/admin/repos/operations/mediawiki-config
Steps to create a new schema:
- Clone the schemas/event/secondary repo with the msg-commit hook so that the Change-Id is added to the commit message automatically
- Create a new folder under jsonschema/analytics/mobile_apps for the schema you are about to create. Name it with care. This will be the name of the schema. Android app uses the android_ prefix to the name, IOS uses ios_ prefix.
- You only need to create the current.yaml file, the rest of them get created during your commit. For the pre-commit and commit hooks to be installed use npm install before making any commits.
- Things to remember while creating the field of the schema
- Indentation is very important
- Field name conventions
https://wikitech.wikimedia.org/wiki/Event_Platform/Schemas/Guidelines#Conventions
- Acclimatize yourself with the general guidelines for schemas:
https://wikitech.wikimedia.org/wiki/Event_Platform/Schemas/Guidelines
- Commit your changes with `npm run`
npm run build-new jsonschema/analytics/mobile_apps/android_article_link_preview_interaction/current.yaml and make sure you use the current package name, and verify that the commit hook kicked-in and generated the other files on the schema folder
- Push it for review : git review -R
- To create a stream config for the schema that you newly created, Add this to the mediawiki-config by making a config change PR like this: https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/639284
- The secondary schema changes are immediately deployed when they get merged, but the config changes will have to be deployed. Quoting from the instructions I received:
https://wikitech.wikimedia.org/wiki/Event_Platform/Instrumentation_How_To#Stream_Configuration If youâve made these changes in InitialiseSettings.php, youâll need to schedule a Backport window deployment to sync out your config change to the production cluster. See Deployments and Backport windows for instructions. Note: There will be no +2 or merge on this patch, it will be done during deployment
- When you are incharge of your deployment window, you need to be available on irc on Libera.Chat[make sure of this, and donât be on freenode], in #wikimedia-operations channel. For eg: if your deployment window is 11amPST, just log into the channel and announce that you are available for your patch to be deployed.
- You will need to test if the changes took. We can use this to check the schema we just created: https://meta.wikimedia.org/w/api.php?action=streamconfigs&streams=android.daily_stats&all_settings=1
Make sure you use the stream name you just created. If the schema is not deployed correctly, you will see an empty response, or else you will see a full response like above link.
- For more guidance, the Event_Platform schemas page is very helpful: https://wikitech.wikimedia.org/wiki/Event_Platform/Schemas
Updating an existing schema: For any schema changes, you will need to update its minor/major version number depending on how big the change is. You can see an example patch where a new field was added to an existing schema here: https://gerrit.wikimedia.org/r/c/schemas/event/secondary/+/766897 Use npm run build-modified for modifying existing schemas instead of npm run build-new Also refer to this if you need further guidance: https://wikitech.wikimedia.org/wiki/Event_Platform/Schemas#Modifying_schemas