Page MenuHomePhabricator

Add change_tag also to Wikidata contenttranslation edits
Open, In Progress, MediumPublic

Description

Currently ContentTranslation adds "contenttranslation", "contenttranslation-v2" change_tags to Wikipedia edits. However, when articles are linked in Wikidata there is no change_tag.

Adding change_tag also to Wikidata edits would allow querying the language links additions afterwards on ToolForge which is currently impossible as one would need to query them from revision_comment using text-search which is super slow.

Event Timeline

Zache renamed this task from Add change_tag also to Wikidata content translation edits to Add change_tag also to Wikidata contenttranslation edits.Apr 24 2023, 4:14 AM
Wangombe changed the task status from Open to In Progress.Jul 4 2023, 7:59 AM
Wangombe claimed this task.

Change 935399 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/ContentTranslation@master] SX: Add change_tag to Wikidata SX edits

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

Change 935400 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/ContentTranslation@master] CX: Add change_tag to Wikidata CX edits

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

Change 935399 merged by Nik Gkountas:

[mediawiki/extensions/ContentTranslation@master] SX: Add change_tag to Wikidata SX edits

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

Change 935400 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX: Add change_tag to Wikidata CX edits

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

Change 946931 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230808

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

Change 946931 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.2.0+20230808

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

@Wangombe can you pls help where I can go see these tags during edits ?

I think the change tags should be displayed on Wikidata which does not appear to be working. I'm not seeing those tags on wikidata: https://www.wikidata.org/wiki/Special:NewPages?tagfilter=contenttranslation

After discussing this issue with Niklas, we think the reason these tags are not being applied is because they don't exist on Wikidata as CX is not installed there. They tags are also not listed in https://www.wikidata.org/wiki/Special:Tags

However, the CX extension edits wikidata so there is no reason why it would not be able to add change_tags to these edits.

And generally I don't really care if you end up to add the change_tags using abuse filter even if it shitty as hell as a solution, but there is no reason why it could not be done.

Is it possible to request somewhere to add these tags manually to Wikidata?

Wikidata:Project chat seems to be a place where previous tags were requested. Administrators have technical right for creating and deleting tags. (:mw:Manual:Tags )

Btw, afaik there is difference between user created tags and system tags. If tag is created by system (for example AbuseFilter or extensions) users cannot add/remove them. If the tag is created manually by user other users can add/remove them.

Is that a good or bad thing in your opinion? We don't want to install CX on Wikidata, so the other option would be to use SoftwareTags configuration variable.

I think that you would like to use system tags so that user are not able to touch them if it is possible.

Looks like SoftwareTags doesn't quite do what I thought it does. Could use hooks in config or perhaps in the WikimediaMessages extension.

Is CX is using wblinktitles API for adding languagelinks?

If so one clean method could be adding tags parameter to wblinktitles API similar to other wikibase edit API calls (see wbeditentity , wbsetsitelink)

Then ask wikidata admins to register the changetag use it when adding the langlink.

Users could edit it which is little bit annoying, but not really something what nobody cares.

Is CX is using wblinktitles API for adding languagelinks?

wbsetsitelink should allow pass the tags to Wikidata using this API. However, we should attempt to register the tags on Wikidata first.

Change 962941 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/ContentTranslation@master] CX: Add change_tags to Wikidata using wblinktitles API

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

Change 962942 had a related patch set uploaded (by Wangombe; author: Wangombe):

[mediawiki/extensions/ContentTranslation@master] SX: Add change_tags to Wikidata using wblinktitles API

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

Change 962942 abandoned by Wangombe:

[mediawiki/extensions/ContentTranslation@master] SX: Add change_tags to Wikidata using wblinktitles API

Reason:

Addressed in Ic301759d26d75f702f3520b0a5294465692bcbed

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

Change 962941 abandoned by Wangombe:

[mediawiki/extensions/ContentTranslation@master] CX: Add change_tags to Wikidata using wblinktitles API

Reason:

Addressed in I180963bc6029294809d8c87a950b4f9771bf33e6

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

Is CX is using wblinktitles API for adding languagelinks?

If so one clean method could be adding tags parameter to wblinktitles API similar to other wikibase edit API calls (see wbeditentity , wbsetsitelink)

Then ask wikidata admins to register the changetag use it when adding the langlink.

Users could edit it which is little bit annoying, but not really something what nobody cares.

From my understanding the patches above were abandoned because regardless of the fact that we can use`wbsetsitelink` API, these change_tags will still have to be registered on Wikidata to show up. I think the easiest route will be to contact a Wikidata admin to register these tags. Thus, we don't need to use this API as a hack to achieve this.

Change 962941 restored by Wangombe:

[mediawiki/extensions/ContentTranslation@master] CX: Add change_tags to Wikidata using wblinktitles API

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

Change 962942 restored by Wangombe:

[mediawiki/extensions/ContentTranslation@master] SX: Add change_tags to Wikidata using wblinktitles API

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

Change 962941 abandoned by Wangombe:

[mediawiki/extensions/ContentTranslation@master] CX: Add change_tags to Wikidata using wblinktitles API

Reason:

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

Change 962942 abandoned by Wangombe:

[mediawiki/extensions/ContentTranslation@master] SX: Add change_tags to Wikidata using wblinktitles API

Reason:

This would require changes in Mediawiki Core which is undesirable. The tags only had to (and were) registered on Wikidata. This patch is not valid.

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

These tags are now available on Wikidata tags. However, no activity is being registered. After some investigation by @ngkountas, it turns out that this might be user rights issue.

image.png (238×617 px, 53 KB)

The wblinktitles API is called prior to the tag API request. In this instance, it's not clear whether the tag API is being called anonymously (user is not logged in. Arguably, they are). In https://www.wikidata.org/wiki/Special:ListGroupRights, the 'User' group is allowed to perform the applychangetags request "along with one's changes". The 'along' part of the description matters.

Is CX is using wblinktitles API for adding languagelinks?

If so one clean method could be adding tags parameter to wblinktitles API similar to other wikibase edit API calls (see wbeditentity , wbsetsitelink)

Ultimately, this suggestion carries a lot of merit and is ideal for this ticket. A few changes would have to be made to LinkTitles::class to accommodate this. Additionally, we'll have to revert the changes submitted for the tag API call on ContentTranslation and SectionTranslation.

@Pginer-WMF, "wblinktitles requests (i.e. the requests that link the published article with the source article on Wikidata), can also silently fail, but we do not notify the users (although we theoretically could) that the Wikidata link is not created. This is true for both desktop and mobile versions. Just bringing this to your attention." by @ngkountas.

Info: We have T155109 for adding tag parameters to remaining api modules.

Info: We have T155109 for adding tag parameters to remaining api modules.

Is finishing that task in your plans currently?

We currently don't have it high on our list unfortunately but we'd be happy to review patches if someone wants to submit one.

Nikerabbit removed a project: Patch-For-Review.
Nikerabbit added a subscriber: Wangombe.