Page MenuHomePhabricator

WikibaseQualityConstraints include extension name in UA for query service requests
Closed, ResolvedPublic5 Estimated Story Points


In T204267 the extension flooded the query service with requests and ended up getting all mediawiki requests banned.
In the future other less floody SPARQL requests may come from mediawiki and thus have the same UA & get banned (unless the banning is done by IP only?)
In order to avoid these blankety bans each sub product / service within mediawiki making the requests should add its own product to the UA in addition to the default mediawiki one.

We should also include the name of the wiki that the request is coming from. This is planning for a future where QualityConstraints may also be run on another wikibase instance within the WMF cluster (for example commons).

Current example UA:


Proposed UA:

MediaWiki/1.32.0-wmf.20 WikibaseQualityConstraints

User-Agent RFC:


The option probably needs to be added to however other usage should be checked..

Event Timeline

Addshore added a subscriber: Smalyshev.

@Smalyshev In order to decide if there is any point in this one....

Does the query service actually differentiate requests from a single IP with different UAs for rate limiting / banning?

TBD / TBA does the query service actually differentiate requests from a single IP with different UAs?

That sounds like a really easy way for any spammer to circumvent a ban, so I would be very surprised if we actually did this tbh.

Proposed UA:

MediaWiki/1.32.0-wmf.20 WikibaseQualityConstraints

I would think that WikibaseQualityConstraints should come first, since MediaWiki acts more like the “library” component here:

WikibaseQualityConstraints MediaWiki/1.32.0-wmf.20

Rate limiting is bucketing based on IP+User agent, so having distinctive user agent for WBQC is certainly a good idea.

Change 463923 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/WikibaseQualityConstraints@master] Set custom user agent in SparqlHelper

Change 463923 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Set custom user agent in SparqlHelper

This should be verified once deployed.
This should be deployed on the evening of the 17th October.
We can verify by making sure the query service gets requests with the new UA