Page MenuHomePhabricator

Find out how many external uses the wbcheckconstraints API action has
Closed, DeclinedPublic


The WikibaseQualityConstraints extension offers a wbcheckconstraints action in the MediaWiki action API, but the main user of that action is the extension itself: when a logged-in user visits a Wikibase entity page, we inject a ResourceLoader module which performs a request against that API and injects the results into the page, showing which statements of the entity violate quality constraints.

We would like to know how many other users this API action has, so that we can plan how careful we need to be about making breaking changes to it – right now we adhere to the Wikidata Stable Interface Policy, but we’re not aware of any external users of the API that would actually be affected by the breaking changes.

To this end, we added a header X-MediaWiki-Gadget to the API requests performed by our ResourceLoader module (T180780), so that we could compare the number of requests with that header (our own code) and without it (external users). We were under the impression that this header would be recorded for later use in analytics, but it turns out that only the special X-Analytics header is recorded, so the X-MediaWiki-Gadget header is useless right now.

Possible options:

  • Ditch X-MediaWiki-Gadget and use X-Analytics instead. I’m not sure how this would work… is X-Analytics even used for requests coming from clients, or only for responses going from the application server to the caching layer?
  • Keep X-MediaWiki-Gadget and parse it inside the wbcheckconstraints API, incrementing statsd counters depending on the presence or absence of the header. This is a fairly simple solution, but also fairly custom? But the situation isn’t exactly common either (the normal case would be to just include the constraint reports in the page we send initially, without an API request), so perhaps that’s okay.
  • Other options?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 18 2018, 1:47 PM
Mvolz added a subscriber: Mvolz.Oct 11 2018, 9:29 AM
Lucas_Werkmeister_WMDE closed this task as Declined.Oct 16 2019, 2:44 PM

This never went anywhere, and I don’t think it’s really needed anymore – we’ve heard through other means that there are external users of the constraints API, so treating it as a stable interface really is the right thing to do. Closing.

Change 543470 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseQualityConstraints@master] Revert "Add HTTP header indicating gadget to API requests"

Change 543470 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Revert "Add HTTP header indicating gadget to API requests"