Page MenuHomePhabricator

AbuseFilter filter test does not work after API changes because of raw boolean
Closed, ResolvedPublic

Description

When trying to test an abuse filter using the “Examine individual changes” page, the API call used by the JS returns the raw boolean result, e.g. {"abusefiltercheckmatch":{"result":""}} for successful match (result is present), or {"abusefiltercheckmatch":[]} for nonmatch (result is not present). However, since ext.abuseFilter.examine.js in examinerTestProcess uses just a simple if ( data.abusefiltercheckmatch.result ), this is always falsy, so the test is always reported not to match.

I presume this is because of the recent API changes, and either the JS test needs to be changed, or formatversion=2 should be used or something like that.

Event Timeline

Mormegil created this task.May 15 2015, 1:01 PM
Mormegil raised the priority of this task from to Normal.
Mormegil updated the task description. (Show Details)
Mormegil added a subscriber: Mormegil.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 15 2015, 1:01 PM
Huji reopened this task as Open.May 16 2015, 2:33 PM

Change 211722 had a related patch set uploaded (by Anomie):
ApiResult::META_BC_BOOLS in ApiAbuseFilterCheckMatch

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

Change 211722 merged by jenkins-bot:
ApiResult::META_BC_BOOLS in ApiAbuseFilterCheckMatch

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

Change 211743 had a related patch set uploaded (by Anomie):
ApiResult::META_BC_BOOLS in ApiAbuseFilterCheckMatch

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

Change 211744 had a related patch set uploaded (by Anomie):
ApiResult::META_BC_BOOLS in ApiAbuseFilterCheckMatch

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

Anomie added a subscriber: Anomie.EditedMay 18 2015, 4:44 PM

Test cases for SWAT: (requires the 'abusefilter-modify' right)

https://en.wikipedia.org/w/api.php?action=abusefiltercheckmatch&filter=true&vars= should return

{
    "abusefiltercheckmatch": {
        "result": true
    }
}

https://en.wikipedia.org/w/api.php?action=abusefiltercheckmatch&filter=false&vars= should return

{
    "abusefiltercheckmatch": {
        "result": false
    }
}

I scheduled this for the SWAT window tomorrow morning, but if someone can run the above test cases feel free to rechedule for the evening window today.

He7d3r set Security to None.
He7d3r added a project: JavaScript.

Change 211743 merged by jenkins-bot:
ApiResult::META_BC_BOOLS in ApiAbuseFilterCheckMatch

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

Change 211744 merged by jenkins-bot:
ApiResult::META_BC_BOOLS in ApiAbuseFilterCheckMatch

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

Anomie closed this task as Resolved.May 19 2015, 3:51 PM
Anomie claimed this task.

Fixed and deployed.

Change 212003 had a related patch set uploaded (by Legoktm):
ApiResult::META_BC_BOOLS in ApiAbuseFilterCheckMatch

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

Change 212003 merged by jenkins-bot:
ApiResult::META_BC_BOOLS in ApiAbuseFilterCheckMatch

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

Restricted Application added a subscriber: Luke081515. · View Herald TranscriptAug 25 2015, 1:09 PM