Page MenuHomePhabricator

Add tags parameter to Wikibase APIs that create redirects
Open, Needs TriagePublic

Description

Add a tags parameter to all the APIs in Wikibase that create redirects: wbmergeitems and wbcreateredirect. This includes adding $tags to EntityStore::saveRedirect(), making it match EntityStore::saveEntity() (where this parameter was already added as part of T229917).

Event Timeline

Change 704985 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Remove unused EntityIdParser from MergeItems

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

wbcreateredirect still has no tags parameter.

This is about to become slightly more important due to T303682: Requested wiki configuration change: remove changetags right from users on wikidatawiki – there will be no way to tag edits made with the wbcreateredirect action at all.

I tried to figure out what the impact of this would be (Quarry query for tags on recent '/* wbcreateredirect' edits), but it turns out that edits with a /* wbcreateredirect summary are also created by the wbmergeitems API (which has a tags parameter, see T286778), which probably accounts for the majority of these edits. That is, a single wbmergeitems API request creates two edits, with summaries like /* wbmergeitems-to:0||Q35797306 */ and /* wbcreateredirect:0||Q10711559|Q35797306 */, and both of these edits will be tagged; the second of these edits could, I assume, also be made directly via the wbcreateredirect API, where the tags support is missing, but I’m not sure how this would actually happen. Note that the other entity type with support for redirects also has a dedicated API, wblmergelexemes, which also has a tags parameter. (Honestly, I’m not sure if the wbcreateredirect API has a reason to exist at all.)