Background
Design and create a new database table to persist information about edits that users explicitly associate with an ongoing event. This table will be used later to compute collaboration metrics and populate the new event summary view.
We will represent bytes as one number for the MVP. So, for example, if someone removed 1000 bytes and added 100 bytes, we will show that they removed 900 bytes. This decision was reached because a) this is how it is represented on the wikis now and therefore how editors are accustomed to understanding and interpreting the numbers, and b) this is a simpler solution, and we have an upcoming MVP deadline.
We will count all edits made by an editor and associated with an event as a valid edit. This could include things like reverts, as long as they use the source editor/VE.
Page references will be stored as full page titles, similar to the campaign_events table. This is because we need to store pages cross-wiki, so:
- Storing a page ID won't give us the text to show in the contributions summary (unless we also query the page table for each involved DB, oof)
- There's no reliable way to go from namespace ID + title to a full prefixedtitle for foreign pages (namespace resolution is based on config, and we can't read config cross-wiki, see T226667 & related tasks)
We will additionally store the page ID so that the row can easily be updated in case of page moves and deletions (T403200)
In the future, we will also want to probably support other data points, post-MVP. Other potential data points can be fond in this spreadsheet and will later be converted into Phabricator tickets.
Acceptance Criteria
- A new database table is created that tracks at least the following:
- Event ID
- Page title
- Page ID
- Revision ID
- User ID
- Wiki ID
- Bytes delta
- Internal links delta
- Whether the edit is also a page creation
- Timestamp of the edit
- Whether the edit is visible (i.e. page still exists, revision not deleted)
Checklist
- Design the schema
- Make schema change patch for it
- Get initial reviews (+1s)
- Request DBA signoff: T402659
- Get approval
- Catalog the table
Deployment
- Merge the schema patch
- This will automatically create the new table in beta
- Wait until the patch reaches production
- Schedule a dedicated deployment window, note the time here
- Create the table everywhere:
- mwscript sql.php --wiki=testwiki --cluster=extension1 /srv/mediawiki/php-1.45.0-wmf.18/extensions/CampaignEvents/db_patches/mysql/patch-add-ce_event_contributions.sql
- mwscript sql.php --wiki=test2wiki --cluster=extension1 /srv/mediawiki/php-1.45.0-wmf.18/extensions/CampaignEvents/db_patches/mysql/patch-add-ce_event_contributions.sql
- mwscript sql.php --wiki=officewiki --cluster=extension1 /srv/mediawiki/php-1.45.0-wmf.18/extensions/CampaignEvents/db_patches/mysql/patch-add-ce_event_contributions.sql
- mwscript sql.php --wiki=metawiki --cluster=extension1 --wikidb wikishared /srv/mediawiki/php-1.45.0-wmf.18/extensions/CampaignEvents/db_patches/mysql/patch-add-ce_event_contributions.sql