Page MenuHomePhabricator

Add instrumentation to track the proportion of PII suppressions that appear in Special:AbuseReview
Closed, ResolvedPublic

Description

Background

For T435516: AbuseReview: Create Superset dashboard we want to chart:

percentage of mitigated edits that were seen on Special:AbuseReview for each tag type

We don't yet have enough information to calculate the following for PII:

  • We only want to include PII suppressions. In English the chart query should be able to detect these by checking the reason starts with "Disclosure of...", and since we are only tracking 5 languages here, we could do the equivalent for the other languages.
  • We preferably don't want to include subsequent suppressions (i.e. suppressions to subsequent good edits). Although there could be multiple PII-disclosing edits getting suppressed in one go, we can usually make the assumption that only the earliest edit disclosed PII.
Details

We could do this by adding a couple more things to RevisionVisibilityHandler:

foreach ( $newlySuppressedRevisionIds as $revisionId ) {
	$this->instrumentationClient->submitInteraction(
		RequestContext::getMain(),
		'revision_content_suppressed',
		[
			'action_subtype' => in_array( $revisionId, $revisionsIdsTaggedWithPersonalInfoTag, true )
				? 'personal-info-tagged'
				: 'personal-info-not-tagged',
			'identifier' => $revisionId,
			'identifier_type' => 'revision',
			// Add the page ID, so that the query can calculate which revision is likely to be the earliest on a page in a batch of suppressions
			// Add the suppress reason, so that the query can filter to suppressions likely due to PII violations
		]
	);
}

Note: In order to add the reason, we would need to pass the reason through "ArticleRevisionVisibilitySetHook".

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
wikimedia_antiabuse/abuse_review_interaction: Add reason fieldrepos/data-engineering/schemas-event-secondary!148dreamyjazzT437435master
Customize query in GitLab

Event Timeline

Change #1338220 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/WikimediaAntiAbuse@master] RevisionVisibilityHandler: Add page to suppression instrumentation

https://gerrit.wikimedia.org/r/1338220

Adding the reason is blocked by changes on T437347: Abuse review: Add page filter, as gitlab doesn't allow stacked MRs and we need to update the schema to add a field that would store the suppression reason

Adding the page information can be done, as there is an existing unused page field added by the base schema. So that's ready for review

Change #1339018 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Make RevDelRevisionListTest cover RevDelList

https://gerrit.wikimedia.org/r/1339018

We should be able to update the use of the ArticleRevisionVisibilitySetHook to instead use the PageHistoryVisibilityChangedEvent. Both cover the same types of events AFAICS, but the event provides the reason

I was able to update https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikimediaAntiAbuse/+/1338220 to use the domain event system and that worked for getting the reason in, so everything should be ready for review for this ticket

Change #1338220 merged by jenkins-bot:

[mediawiki/extensions/WikimediaAntiAbuse@master] Add page and reason to suppression instrumentation

https://gerrit.wikimedia.org/r/1338220

Change #1339018 merged by jenkins-bot:

[mediawiki/core@master] Make RevDelRevisionListTest cover RevDelList

https://gerrit.wikimedia.org/r/1339018