Commit graph

4522 commits

Author SHA1 Message Date
jenkins-bot 81a4fdc964 Merge "Improve Ace syntax highlight" 2018-08-23 10:14:57 +00:00
Daimona Eaytoy 0e2ae113fb Improve parser coverage
On the way to 100%...

Bug: T201193
Change-Id: I5fd311f861acccb31f346da9acb379b0366488e7
2018-08-23 12:13:47 +02:00
jenkins-bot afbf9b5f15 Merge "Improve code coverage" 2018-08-23 10:06:41 +00:00
Matěj Suchánek 853936316f Filter AbuseLog by triggering action
For now, there is an "Other" field which will show all but hard-coded actions.

Bug: T187971
Change-Id: If564aced2e9cd933d8cfcf7cb96166aa279f2823
2018-08-23 11:40:15 +02:00
Daimona Eaytoy 03b52c2b37 Remove unused function and improve unit test
AbuseFilterParser::setVars is only used in a parser test. In the past it
was also used in the actual code (see for instance
https://phabricator.wikimedia.org/diffusion/EABF/browse/master/;5cc8dac63ca585c288ca4c8605db810774e39666?grep=setVars), but at the moment it's pretty unuseful.
This patch removes such function and makes the unit test use literals
instead of variables to avoid calling it.

Change-Id: I80cbc4033ff96f2fe8c1da263b1877bfb4c7c0c4
2018-08-23 11:00:16 +02:00
Daimona Eaytoy 90260edad0 Add _age variables to tests
Tests for new variables introduced in
I0993cecc322806382a1b567b60c0a4af69054841.

Change-Id: Iadaa33c20eb26d6e76ac02e3e9c0066b904833bc
2018-08-23 10:50:52 +02:00
Translation updater bot 88f714fed1 Localisation updates from https://translatewiki.net.
Change-Id: I68c433a15d3be6bfc6acf78d14b32796208da77e
2018-08-22 22:35:28 +02:00
Daimona Eaytoy 447d434e2a Improve code coverage
Add some parser tests, improve existing ones, and add missing @covers.

Bug: T201193
Change-Id: I9c0d2d83560baa4a3e1d4465b7919a48c4e26ac1
2018-08-22 19:07:14 +02:00
jenkins-bot 46d78623f4 Merge "Add page_age variable to AbuseFilter" 2018-08-22 16:17:36 +00:00
jenkins-bot 21547083c0 Merge "Add missing @covers tag" 2018-08-22 15:31:12 +00:00
Daimona Eaytoy e8a4517d6b Improve Ace syntax highlight
Several improvements, this is the list:
*Added highlighting for disabled and deprecated variables
*Simplified a bit Ace's keyword mapper
*Added highlighting for ternary operator
*Added logic to retrieve operators from AF tokenizer
*Removed $ symbol since it's not usable in declaring stuff
*Customized highlighting via CSS

Depends-On: I5c370b54e6516889624088e27928ad3a1f48a821
Change-Id: If95e34fc7260413c4fb39c18a1ef44f5a93e1a68
2018-08-22 15:23:35 +00:00
rarohde e1865fca74 Add page_age variable to AbuseFilter
Adds page_age variable that reports the number of seconds since the
first edit to the current article (or 0 for new articles).

Bug: T30844
Change-Id: I0993cecc322806382a1b567b60c0a4af69054841
2018-08-22 17:10:39 +02:00
Daimona Eaytoy d35c42757c Add missing @covers tag
This should help with tracking code coverage and also explains some
coverage discrepancies encountered while writing other tests.

Bug: T201193
Change-Id: I8b20abc46c2d6c6f582953139b9a9f3710b2e4ea
2018-08-22 17:00:38 +02:00
Daimona Eaytoy 4399be933d Use OOUI infusion for the change tags field in ViewEdit
Since this is what it's meant to be for. Better, cleaner, safer.

Change-Id: Ib5f632ac708aeff62b50c91ef60c547036481834
2018-08-22 15:27:06 +02:00
jenkins-bot 55b49e4470 Merge "Make Ace config pass eslint" 2018-08-22 12:45:41 +00:00
jenkins-bot d94cc34649 Merge "Add deprecated variables to PHPUnit tests" 2018-08-22 12:44:23 +00:00
jenkins-bot a762c82fe7 Merge "Add aliases for "_text" and "article_" variables" 2018-08-22 12:44:20 +00:00
jenkins-bot 5561abe296 Merge "Add a placeholder for the no-js changetags input field" 2018-08-22 12:44:19 +00:00
jenkins-bot da12b6e087 Merge "Focus the Ace editor after having added text from dropdown" 2018-08-22 12:22:47 +00:00
jenkins-bot 777a86314e Merge "Improve code coverage for AbuseFilterParser" 2018-08-22 11:15:00 +00:00
Daimona Eaytoy 83ccb376f0 Make Ace config pass eslint
Just a tiny change to be safer.

Change-Id: Id0e188ab6e5d0e14ef5f0fdcce74be5ec7f24470
2018-08-22 11:21:13 +02:00
Daimona Eaytoy e526295123 Add a placeholder for the no-js changetags input field
There is already one for the js field, but we can't reuse it since "one
by one" doesn't make any sense here.

Change-Id: Iaf01e19f4006b3d578bb2201cf9108fe46d56085
2018-08-22 11:02:51 +02:00
Daimona Eaytoy 2fc44e9d18 Focus the Ace editor after having added text from dropdown
The classic editor (textarea) already takes focus, while for Ace we need
to explicitly call its focus() method.

Bug: T202480
Change-Id: I8dcf54e46e730b2879b09b4e21198b2ef1131706
2018-08-22 10:57:15 +02:00
Daimona Eaytoy cd30d5146f Add deprecated variables to PHPUnit tests
Check a bunch of them, they should be computed and be identical to the
ones with new syntax.

Bug: T173889
Depends-On: I5c370b54e6516889624088e27928ad3a1f48a821
Change-Id: I276913a98e06b5f2ff1c5f5f3ba5bcc7b1e8c997
2018-08-22 08:38:31 +00:00
jenkins-bot 47acf13b4d Merge "Show an extract of suppression log for Special:AbuseLog" 2018-08-22 02:38:53 +00:00
Translation updater bot 35a621470b Localisation updates from https://translatewiki.net.
Change-Id: Ica826b21c2e558ed486c5ed20b0035d43b1676ff
2018-08-21 23:37:36 +02:00
Daimona Eaytoy 66774b8d7a Show an extract of suppression log for Special:AbuseLog
Like we do in core for similar special pages. This is really helpful
when (un)hiding an entry.

Bug: T200645
Change-Id: I16450a2573e8987e31a83ec34f3dbb16fac94f81
2018-08-21 19:19:10 +02:00
jenkins-bot ae45c61870 Merge "Raise tolerance for time-related unit tests to 10 seconds" 2018-08-21 17:16:44 +00:00
Matěj Suchánek 10ad58a6f3 Migrate AbuseFilter suppress log
Also make entries in Special:Log/suppress filterable.

Change-Id: Ic23e724997e4748c8d0da8138aa73d31b17b7064
2018-08-21 16:05:54 +00:00
Daimona Eaytoy c962203ad2 Raise tolerance for time-related unit tests to 10 seconds
This helps avoiding failures with tests depending on execution time.

Bug: T202073
Change-Id: I4da859cfb3e49314ca20329e2ad4a3a7c4fae897
2018-08-21 17:18:24 +02:00
Daimona Eaytoy 6bc630cfef Add aliases for "_text" and "article_" variables
Variables regarding title (full list in task description) are quite
deceiving, since they use "text" instead of "title". As proposed in the
task, this is the first patch to add aliases for those variables and
slightly deprecate the old ones. In the future we may be able to replace
every occurrence (either with a search function or directly on the
database), but even a coexistence would be enough to avoid
confusion. A wfDebug log is generated whenever a deprecated variable is
parsed. The "article_" prefix is also changed to "title_", in the same
way as above.
Also, added a hook which other extension may use to specify their
deprecated variables, which will be handled the same as core ones.

Bug: T173889
Change-Id: I5c370b54e6516889624088e27928ad3a1f48a821
2018-08-21 16:59:56 +02:00
jenkins-bot a6c5aa8927 Merge "Avoid variable reuse to pass taint-check" 2018-08-20 23:19:33 +00:00
Translation updater bot 25151a949c Localisation updates from https://translatewiki.net.
Change-Id: Iec3d91a788e0d2249dff968f7cc1f1dbc32a22a4
2018-08-20 22:20:35 +02:00
Umherirrender 2b615cfa29 Avoid variable reuse to pass taint-check
Also set param-taint for value of WebRequest::getText

Bug: T197002
Change-Id: I9e52d24f88789c99c726e32df20840707d1b47ae
2018-08-20 19:54:20 +02:00
Daimona Eaytoy 4f3b020f5d Improve code coverage for AbuseFilterParser
Add some tests and improve others to raise coverage percentage. This
should lead to almost 100% for the AbuseFilterParser class. Aside from
this, a couple of changes:
* Remove an unused function
* Let equals_to_any return a genuine result with empty strings
* Remove an if which will never be true in skipOverBraces, since the
function is called after checking the same conditions.

Bug: T201193
Change-Id: I7020b2ed996236c38c5784d161ad98ec44163406
2018-08-20 14:38:40 +02:00
jenkins-bot 50a295a6e7 Merge "Include CheckUser in phan config" 2018-08-20 01:52:54 +00:00
Translation updater bot 50ff368194 Localisation updates from https://translatewiki.net.
Change-Id: Id215438322326b4954ccd3413b583c3dd472b102
2018-08-19 22:38:41 +02:00
jenkins-bot 55f0cd2580 Merge "Change priority order for messages in hidden abuselog entries" 2018-08-19 19:21:41 +00:00
Daimona Eaytoy b8645753ca Remove deprecated method in AbuseFilterVariableHolder
It was soft-deprecated in 2013 and nothing is using it in MW code.

Change-Id: I1300bb18c518b61a2dbce9ad43beeb69c1b615e5
2018-08-19 19:02:45 +02:00
Daimona Eaytoy 9d21c7d03d Change priority order for messages in hidden abuselog entries
Check if the entry is deleted first, since it's the strongest deletion
here (oversight level). Bonus: don't use implicit conversion when
checking the return value of SpecialAbuseLog::isHidden.

Bug: T200644
Change-Id: Ie5c4575ad29fe3dcb85a26cc74f1c59207df2852
2018-08-19 18:22:07 +02:00
Translation updater bot 01df24418a Localisation updates from https://translatewiki.net.
Change-Id: Ia99e4123423cad2fbb0e8b15e8f20d6879cc89f5
2018-08-17 23:36:22 +02:00
Umherirrender c954b412c6 Include CheckUser in phan config
Depends-On: I51421184485c3117bbab9ce3dd42f2dbb6c6180c
Change-Id: Ida17580b301ff4a6b0d3d0020c48f65eb1e21026
2018-08-17 17:38:01 +02:00
Translation updater bot a79dbf5488 Localisation updates from https://translatewiki.net.
Change-Id: Ifab4d658d65b2abee003fc0e8d31fb61538e77be
2018-08-16 22:28:09 +02:00
Daimona Eaytoy bb476e2c45 Fix wrong error message for PHPUnit
We're currently emitting the same error twice, but in one of those cases
it's completely wrong. Damned copy&pasting!

Bug: T202073
Change-Id: I7687826a85f3ef0abaf15d7cd973afc4e55758b2
2018-08-16 17:11:41 +00:00
Translation updater bot 0c496d0118 Localisation updates from https://translatewiki.net.
Change-Id: Id6f137359ab5718087a95d01d65e22c484d5b511
2018-08-15 22:18:15 +02:00
Translation updater bot 2148d06632 Localisation updates from https://translatewiki.net.
Change-Id: Iafe001dca01005c6ab5337738a8e9463773bd2be
2018-08-14 22:34:47 +02:00
Brian Wolff 429b7c6705 Update phan-taint-check to 1.3.0. Hopefully should pass now
Change-Id: If8f78dd08152b68e534cdb72704ccbd81afbd822
Bug: T197002
2018-08-13 23:57:29 +00:00
Translation updater bot 825e5939b4 Localisation updates from https://translatewiki.net.
Change-Id: Ib987d0e1eb5616ce01e57ac8418fae91f373d6a2
2018-08-13 22:14:00 +02:00
Translation updater bot 20f4fb9a8c Localisation updates from https://translatewiki.net.
Change-Id: If8f78dd08152b68e534cdb72704ccbd81afbd898
2018-08-12 22:17:08 +02:00
Translation updater bot 2716696221 Localisation updates from https://translatewiki.net.
Change-Id: I455d6d615d20dc3428eaeb16e95cee280c1b9207
2018-08-11 22:17:14 +02:00