Page MenuHomePhabricator

Copyvio: Create PageTriage API module to receive copyvio info
Closed, ResolvedPublic

Description

Create an api.php module that lets bots like EranBot submit copyvio information to PageTriage

Only bots with the pagetriage-copyvio right would be allowed to do this.

Create "copyvio" PageTriage tag and populate it with a positive value when the API is called. The value can be 1 but it can also be the last revision id for which copyvio was detected, if it can be of any use.

Event Timeline

Catrope created this task.Aug 16 2018, 8:06 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 16 2018, 8:06 AM

Change 453098 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/Copyvio@master] Add API module for submitting copyvio scores

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

Catrope claimed this task.Aug 16 2018, 8:09 AM
Catrope added a subscriber: SBisson.

While writing this, I realized that the most awkward parts were that the client needs to specify a reportId that is then interpreted by code on the server to generate a report URL, and that we don't support storing scores for different providers so the client can't meaningfully indicate what type of score this is (what provider it came from) and by extension what code the reportId->reportURL mapping should be delegated to (since that lives in the provider).

While writing this, I realized that the most awkward parts were that the client needs to specify a reportId that is then interpreted by code on the server to generate a report URL, and that we don't support storing scores for different providers so the client can't meaningfully indicate what type of score this is (what provider it came from) and by extension what code the reportId->reportURL mapping should be delegated to (since that lives in the provider).

The architecture document specifies this API module to be part of PageTriage, not Copyvio. If you really want to keep the Copyvio extension and use it here we would have to make it understand that what it receives is a reportUrl that doesn't need to be processed on the way out.

SBisson renamed this task from Create API module for pushing scores into Copyvio extension to Copyvio: Create PageTriage API module to receive copyvio info.Aug 16 2018, 7:52 PM
SBisson updated the task description. (Show Details)
Catrope updated the task description. (Show Details)Aug 16 2018, 8:12 PM

Change 453308 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/PageTriage@master] Add an API module for tagging a revision as copyvio

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

Change 453308 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/PageTriage@master] Add an API module for tagging a revision as copyvio
https://gerrit.wikimedia.org/r/453308

This patch creates the API module, but doesn't yet expose the information or add filtering capabilities. I wasn't sure if we wanted a "only copyvio" or "only non-copyvio" filter, or both.

Change 453308 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/PageTriage@master] Add an API module for tagging a revision as copyvio
https://gerrit.wikimedia.org/r/453308

This patch creates the API module, but doesn't yet expose the information or add filtering capabilities. I wasn't sure if we wanted a "only copyvio" or "only non-copyvio" filter, or both.

This task is only about the API module. Showing the info in the feed is T201070: Copyvio: Show copyvio info in PageTriage feed

Change 453308 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Add an API module for tagging a revision as copyvio

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

Checked in betalabs - the tag is in pagetriage_tag

23 | copyvio            | Latest revision ID that has been tagged as a likely copyright violation, if any

copyvio rights are needed to make API requests:

https://en.wikipedia.beta.wmflabs.org/wiki/Special:ApiSandbox#action=pagetriagetagcopyvio&format=json&revid=382764&token=1a490b96351e3c5e45158f358ef1e2905b807837%2B%5C

{
    "error": {
        "code": "permissiondenied",
        "info": "You don't have permission to tag pages as likely copyright violations.",
        "*": "See https://en.wikipedia.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
    },
    "servedby": "deployment-mediawiki-09"
}
Etonkovidova closed this task as Resolved.Aug 28 2018, 12:22 AM

Checked in betalabs:

  • copyviobot right is added
  • /w/api.php?action=pagetriagetagcopyvio&format=json&revid=382508&token=e11f08451284f2a317f3427ea2eeadea5b84949e%2B%5C
{
    "pagetriagetagcopyvio": {
        "result": "success"
    }
}
  • the db records the revision:
[enwiki]> select * from pagetriage_page_tags where ptrpt_tag_id=23;
+---------------+--------------+-------------+
| ptrpt_page_id | ptrpt_tag_id | ptrpt_value |
+---------------+--------------+-------------+
|        192276 |           23 | 382508      |
+---------------+--------------+-------------+
1 row in set (0.00 sec)

Change 453098 abandoned by MarcoAurelio:
Add API module for submitting copyvio scores

Reason:
Extension is being archived (T228087).

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