Commit graph

6098 commits

Author SHA1 Message Date
jenkins-bot d7204eaf73 Merge "Use a different message prefix for parser warnings" 2021-02-06 19:19:19 +00:00
jenkins-bot 3ea76b04ef Merge "Move all "secondary" hooks away from AbuseFilterHooks" 2021-02-06 18:46:01 +00:00
Daimona Eaytoy 4dbde4dcf0 Use a different message prefix for parser warnings
The abusefilter-warning prefix is reserved for filter warnings. Pointed
out by Matěj.

Change-Id: I169e4c3d29b08c7f5af2136a683fc4427f8e93f5
2021-02-06 15:42:33 +00:00
jenkins-bot 2de19b61d2 Merge "Introduce EditStashCache" 2021-02-06 15:36:52 +00:00
Matěj Suchánek 6bb44fd088 Introduce EditStashCache
This class is responsible for interaction with edit stash.

Bug: T271520
Change-Id: I7cc32de0494e76cd9ba12220235c1cdb6b1d5ee1
2021-02-06 12:43:34 +01:00
jenkins-bot c81f791804 Merge "Add a hook to allow computing variables from different types of RC rows" 2021-02-05 16:43:48 +00:00
Daimona Eaytoy 1893120748 Fix doc of AbuseFilterParser::evaluateExpression
It was changed to use AFPData::toNative, so it no longer returns a
string. Instead, it can return any PHP native type.

Change-Id: I92eba03a5fa1149860634a97318b5b15807eb5a5
2021-02-05 16:23:37 +01:00
jenkins-bot 707450c01c Merge "Add debug logging for edits presumably prevented by other extensions" 2021-02-05 11:20:29 +00:00
Translation updater bot b30f555015 Localisation updates from https://translatewiki.net.
Change-Id: Ie5108fc995a131942ae78d7c33da014992d1c995
2021-02-05 08:46:17 +01:00
jenkins-bot a94b2247f6 Merge "Cover some API modules by tests" 2021-02-04 23:43:02 +00:00
Daimona Eaytoy 634742324e Add debug logging for edits presumably prevented by other extensions
Bug: T211680
Change-Id: I0c9ac09044122521f67ffaf38a92e42b20f3ea43
2021-02-04 23:18:49 +00:00
jenkins-bot 07612675f4 Merge "Use Authority in TextExtractor" 2021-02-04 17:53:52 +00:00
jenkins-bot 38772b193d Merge "Partial integration of EditBoxBuilder with HTMLForm" 2021-02-04 17:41:29 +00:00
jenkins-bot 0de3ba31d9 Merge "Fix JS emptying warn/disallow message if filter group is changed" 2021-02-04 15:44:00 +00:00
jenkins-bot 69190af17a Merge "Mixed improvements for AbuseFilter pages and forms" 2021-02-04 15:25:53 +00:00
Matěj Suchánek a0fcfbcc32 Cover some API modules by tests
Change-Id: Icc57e260b3b06a58fc05f304d6e63dc40f970fe9
2021-02-04 15:17:00 +01:00
Translation updater bot 8c9f35146d Localisation updates from https://translatewiki.net.
Change-Id: I0edce48274f891744e87331bf9ebac5e6eb59a1a
2021-02-04 08:38:26 +01:00
Translation updater bot f49719c0f4 Localisation updates from https://translatewiki.net.
Change-Id: I439da8301fc7ee3217f20cdfaadef35065d2b8e9
2021-02-03 08:38:23 +01:00
Translation updater bot c3867cfae6 Localisation updates from https://translatewiki.net.
Change-Id: I972635fa9f0bac82946d7fc195c55d0b746ca5a2
2021-02-02 08:37:52 +01:00
Daimona Eaytoy b0058c0f1b Use Authority in TextExtractor
And make its test a pure unit test, as per TODO comment.

Change-Id: Ia3ca38702ea61c5e551a581248d2b9471ef881fb
2021-02-02 00:43:01 +00:00
Daimona Eaytoy da6165b3dd Move all "secondary" hooks away from AbuseFilterHooks
Every hook that is not directly responsible for filtering an action is
now moved to its own handler class. Some of these are still static
methods because the respective hooks still use the old system.

Bug: T261067
Change-Id: I157169f968a7d6a4d1bcfde09358e5a66a3353bf
2021-02-01 17:29:26 +01:00
Daimona Eaytoy bf9142a644 Partial integration of EditBoxBuilder with HTMLForm
This patch adds a transparent HTMLForm field that can be used to insert
the edit box inside an HTMLForm, and updates /test and /tools to use
that. The field class, together with the other editbox-related classes,
is now in a dedicated namespace. A future TODO is making it a real
HTMLForm field.

Also improve a bit the form in /test: add section labels and
avoid reusing the same label message used on Special:AbuseFilter.

Bug: T261584
Change-Id: Ib74bb5fdba4f8476169b754030fce6d4f72ce65a
2021-02-01 16:23:42 +00:00
Daimona Eaytoy db09ad81e0 Add a hook to allow computing variables from different types of RC rows
Bug: T115128
Change-Id: Ia6de35b70f491591ea6eb699106ba97c94510091
2021-02-01 14:57:10 +00:00
Daimona Eaytoy a4a0503174 Mixed improvements for AbuseFilter pages and forms
- Clarify the label of the search form on Special:AbuseFilter
- Move introductory paragraphs to the very beginning of the page:
-- Before the profiling data on Special:AbuseFilter
-- Before the search form on Special:AbuseLog
- Make the search form on Special:AbuseFilter collapsible, and collapsed
  by default
- Make a few buttons primary+progressive, specifically those that take
  the user to a different page or act as submit-like buttons

Bug: T261584
Change-Id: I54517b01a9ea81d276283140e5cfafef575c3e2b
2021-02-01 15:51:43 +01:00
Translation updater bot 648b05772f Localisation updates from https://translatewiki.net.
Change-Id: Id93a7fa7d04691af495afca7836d1690340e86e2
2021-02-01 08:45:53 +01:00
Daimona Eaytoy 7008aca2fe Fix JS emptying warn/disallow message if filter group is changed
Bug: T273390
Change-Id: Ia105de5c59644956300a817f23b6378c016be6f6
2021-01-31 23:35:34 +01:00
Translation updater bot 8c661b505e Localisation updates from https://translatewiki.net.
Change-Id: I9eaf1a9ea2788d629e0e3527b4521b5a6585dca2
2021-01-29 08:36:34 +01:00
libraryupgrader c00395f6c6 build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 34.0.0 → 35.0.0
  The following sniffs are failing and were disabled:
  * MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals

* mediawiki/minus-x: 1.1.0 → 1.1.1

npm:
* eslint-config-wikimedia: 0.18.0 → 0.18.1

Additional changes:
* Added the "composer phan" command to conveniently run phan.

Change-Id: Iaa3a8844fa93040a4f344b62d0d9173574ed3189
2021-01-28 21:17:54 +00:00
jenkins-bot bcdb317630 Merge "Consolidate the per-filter deferred profiling updates into one deferred update" 2021-01-28 15:31:04 +00:00
Translation updater bot af70861120 Localisation updates from https://translatewiki.net.
Change-Id: I758142c7c3d3b2180173ea31df4c36c25fc65168
2021-01-28 08:34:33 +01:00
Aaron Schulz dddfcd6f0f Consolidate the per-filter deferred profiling updates into one deferred update
This makes debug logs easier to follow without all of the update spam

Change-Id: I6fb0b3b16a05e35b086edc0a50e20c5265ee2a3a
2021-01-27 15:11:58 -08:00
Translation updater bot f81a111ae9 Localisation updates from https://translatewiki.net.
Change-Id: I42bc4488fd7d866c35ef8c1f2d933da300f1a563
2021-01-27 08:33:10 +01:00
Reedy 4f9982fe4e Add test case for space around - in IP range
Change-Id: Ie4563a0b150a95a7c460f4f46066fd79a3b7f2fd
2021-01-27 00:43:53 +00:00
jenkins-bot d96f0ea3f2 Merge "Introduce an EditRevUpdater service" 2021-01-27 00:33:29 +00:00
Daimona Eaytoy a04a601240 Introduce an EditRevUpdater service
This service allows linking the EditFilterMergedContent and
PageSaveComplete hooks for the same edit, so we can update rev IDs in
the abuse_filter_log table. Having such a services also avoids two hacky
static props, and should allow separating the hook handlers easily.

Change-Id: I622d15225ee3af202cb5730a7112652aef8ca71a
2021-01-27 00:24:39 +01:00
Daimona Eaytoy 5c43c0ab35 Allow single IPs in ip_in_range
Also add a bunch of tests for this function.

REMINDER: Change the docs on mw.org when this will be merged.

Bug: T218074
Depends-On: I155024341e8e6b13240e37b30c31b95dc83a47e0
Change-Id: I979e45110bc0e76b499679184993085062ffcac5
2021-01-26 04:37:51 +00:00
James D. Forrester 48b1b509fc build: Upgrade eslint-config-wikimedia from 0.17.0 to 0.18.0 and make pass
Change-Id: I2053ee5521434bc04a28b137eb3745e2c6f3c06a
2021-01-25 10:10:44 -08:00
Translation updater bot c5fa9900f4 Localisation updates from https://translatewiki.net.
Change-Id: I4371e646c6e103eb75b3b2e2611467ed1a7a5626
2021-01-25 08:51:59 +01:00
jenkins-bot 726da46c16 Merge "Catch FilterNotFoundException in ApiQueryAbuseLog" 2021-01-22 11:24:11 +00:00
Translation updater bot b2c466feb7 Localisation updates from https://translatewiki.net.
Change-Id: I1d8bfd3a7be2f5f714ec05361b901251cdb34a23
2021-01-22 08:29:48 +01:00
Daimona Eaytoy 44dd0f6c96 Catch FilterNotFoundException in ApiQueryAbuseLog
And report an invalid ID in this case. Also, assume that the filter is
hidden if the global DB is not available, for consistency with the UI.

Bug: T272593
Change-Id: Ic08023161d95be5cadc8837d3aaaf941cacd89bd
2021-01-22 01:54:40 +00:00
jenkins-bot 4f9676677c Merge "Don't return the status of doBlockInternal when processing block actions" 2021-01-21 10:25:46 +00:00
jenkins-bot 825537c232 Merge "Catch CentralDBNotAvailableException in ViewExamine" 2021-01-21 10:24:01 +00:00
Translation updater bot 4eb0981383 Localisation updates from https://translatewiki.net.
Change-Id: I547d0530f1f2d6b35515e4301aa4e7ad5616865e
2021-01-21 08:30:48 +01:00
jenkins-bot 5d6f81981b Merge "Catch ClosestFilterVersionNotFoundException in ViewDiff" 2021-01-20 17:33:24 +00:00
jenkins-bot 5e3d5189d1 Merge "Do not mock User in TextExtractorTest." 2021-01-20 17:06:05 +00:00
Daimona Eaytoy 2c9f2faa9f Catch ClosestFilterVersionNotFoundException in ViewDiff
Use null if no version can be found, like the previous code.
Follow-up: I747216df65c2f34f7167612e90506890bc61880a

Bug: T272505
Change-Id: Ie574523fb8a779dda495b05ed6d56fd3f4086f1d
2021-01-20 17:25:47 +01:00
Petr Pchelko 6aa8f6f67b Do not mock User in TextExtractorTest.
In I63d9807264d7e2295afef51fc9d982447f92fcbd we are
changing how the permission checks are applied for revision,
so it uses passed User instance as Authority. However, when
user is mocked, the tests are breaking since the new user methods
are not mocked. Pass a real user for now to fix the test. Once
Authority reaches maturity and is ok to use in extensions, the
test should be rewritten to use authority directly.

Bug: T271458
Change-Id: Iacab813b253cc6e1439007e573e8ace06645860f
2021-01-20 09:32:18 -06:00
Translation updater bot eede3a6903 Localisation updates from https://translatewiki.net.
Change-Id: Ie951f144d7bc213233264e1e094157827d635328
2021-01-20 08:26:01 +01:00
Daimona Eaytoy 0a45c0abc8 Don't return the status of doBlockInternal when processing block actions
This will not be correct if the target already has a partial block
applied (which is very rare BTW). Leaving a TODO because this is low
priority.

Also keep returning the status in tests, because it makes tests easier
to write.

Change-Id: Ifac795125927d584a31d95e1b4c4241eef860fa1
2021-01-19 22:38:20 +00:00