Page MenuHomePhabricator

hCaptcha: Update instrumentation for risk score
Closed, ResolvedPublic

Description

Summary

For account creations, we store the risk score in serversideaccountcreation. We'll need to update or create a schema for tracking the risk score associated with an edit event, and write code in ConfirmEdit or WikimediaEvents to log the score to the schema.

Acceptance criteria

  • There is a schema for tracking the risk score associated with an edit event
  • The risk score associated with an hCaptcha interaction for edits is saved to an event logging stream

Event Timeline

Change #1196799 had a related patch set uploaded (by Samuel (WMF); author: Samuel (WMF)):

[mediawiki/extensions/WikimediaEvents@master] WIP: Instrument hCaptcha risk signal in edits

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

Change #1196799 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Instrument hCaptcha risk signal in edits

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

Change #1203824 had a related patch set uploaded (by Kosta Harlan; author: Samuel (WMF)):

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] Instrument hCaptcha risk signal in edits

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

Change #1203824 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] Instrument hCaptcha risk signal in edits

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

Mentioned in SAL (#wikimedia-operations) [2025-11-11T14:38:13Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1203824|Instrument hCaptcha risk signal in edits (T405597)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-11T14:40:35Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1203824|Instrument hCaptcha risk signal in edits (T405597)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-11T14:47:29Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1203824|Instrument hCaptcha risk signal in edits (T405597)]] (duration: 09m 15s)

Change #1203829 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[operations/mediawiki-config@master] (WIP) EventLogging: Register mediawiki.hcaptcha.risk_score stream

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

Change #1203842 had a related patch set uploaded (by Samuel (WMF); author: Samuel (WMF)):

[mediawiki/extensions/WikimediaEvents@master] Refactor CaptchaScoreHooks to use EventSubmitter

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

Change #1203842 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Refactor CaptchaScoreHooks to use EventSubmitter

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

Change #1204163 had a related patch set uploaded (by Kosta Harlan; author: Samuel (WMF)):

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] Refactor CaptchaScoreHooks to use EventSubmitter

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

Change #1204163 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] Refactor CaptchaScoreHooks to use EventSubmitter

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T09:13:28Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1204088|ext.confirmEdit.hCaptcha: Consider action=submit an edit interface (T409701 T409703 T409415)]], [[gerrit:1204163|Refactor CaptchaScoreHooks to use EventSubmitter (T405597)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-12T09:15:49Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1204088|ext.confirmEdit.hCaptcha: Consider action=submit an edit interface (T409701 T409703 T409415)]], [[gerrit:1204163|Refactor CaptchaScoreHooks to use EventSubmitter (T405597)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-12T09:22:49Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1204088|ext.confirmEdit.hCaptcha: Consider action=submit an edit interface (T409701 T409703 T409415)]], [[gerrit:1204163|Refactor CaptchaScoreHooks to use EventSubmitter (T405597)]] (duration: 09m 21s)

Change #1203829 merged by jenkins-bot:

[operations/mediawiki-config@master] EventLogging: Register mediawiki.hcaptcha.risk_score stream

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T09:27:27Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1203829|EventLogging: Register mediawiki.hcaptcha.risk_score stream (T405597)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-12T09:29:59Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1203829|EventLogging: Register mediawiki.hcaptcha.risk_score stream (T405597)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-12T09:38:09Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1203829|EventLogging: Register mediawiki.hcaptcha.risk_score stream (T405597)]] (duration: 10m 41s)

@sguebo_WMF @kostajh Where would I see these events? I have tried https://graphite.wikimedia.org/ and https://stream.wikimedia.org/v2/ui/ but cannot find mediawiki.hcaptcha.risk_score.

@sguebo_WMF @kostajh Where would I see these events? I have tried https://graphite.wikimedia.org/ and https://stream.wikimedia.org/v2/ui/ but cannot find mediawiki.hcaptcha.risk_score.

This is in event logging data, so you can query it with spark3-sql, or on stat1010.eqiad.wmnet, you can also do kafkacat -C -b 'kafka-jumbo1010.eqiad.wmnet:9092' -t codfw.mediawiki.hcaptcha.risk_score -o O | jq to monitor the stream of events.

@sguebo_WMF @kostajh Where would I see these events? I have tried https://graphite.wikimedia.org/ and https://stream.wikimedia.org/v2/ui/ but cannot find mediawiki.hcaptcha.risk_score.

This is in event logging data, so you can query it with spark3-sql, or on stat1010.eqiad.wmnet, you can also do kafkacat -C -b 'kafka-jumbo1010.eqiad.wmnet:9092' -t codfw.mediawiki.hcaptcha.risk_score -o O | jq to monitor the stream of events.

I don't think I have SSH access to production. It doesn't seem worth getting just for this. If someone else can check this, that would be great.