Commit graph

6216 commits

Author SHA1 Message Date
daniel dfeff89317 Use a BlobStore for storing var dumps
AbuseFilter emulates the storage mechanism also used for page content.
Instead of duplicating the relevant code, AbuseFilter should use the
same BlobStore service also used by RevisionStore.

Note that this change is not strictly needed to resolve T198341, but is
needed to unblock T183490

Bug: T261889
Bug: T198341
Bug: T183490
Change-Id: I3fc8475dd8d50d73d705b706ff597a130267e990
2020-12-15 02:35:05 +00:00
jenkins-bot a7e965bbad Merge "Overhaul the interface for hiding AbuseLog entries" 2020-12-15 02:33:33 +00:00
DannyS712 7ccf758c4b AbuseFilterConsequencesTest: stop setting $wgUser
Shouldn't be needed anymore, not read by extension

Bug: T246733
Change-Id: I10dc21ad34402d83d57f23bc754a437b8a015af7
2020-12-14 20:53:00 +00:00
Translation updater bot 41b7ed09f8 Localisation updates from https://translatewiki.net.
Change-Id: I1a7891d656ef945c2f97daff93a1007b2baa7e33
2020-12-14 08:39:58 +01:00
jenkins-bot 3668ac1bd9 Merge "Simplify page handling in AFComputedVariable" 2020-12-13 19:31:18 +00:00
Daimona Eaytoy 9d288478fe Remove a bunch of deprecated methods
These are all unused.

Depends-On: Id99da02a98bb392cafed370768edcc8ac3d712ab
Change-Id: I9ff17714f94e1fbbd52da32ebf4f054a551edc1f
2020-12-13 18:31:27 +00:00
Umherirrender 90254368fc build: Remove unneeded phan suppression
Depends-On: Iab770702fd3a1d20f25f54057770dc03e28f1b0e
Change-Id: I3ce1816abb0f64843e9c8e3f866a6ef84c66285f
2020-12-13 00:37:20 +01:00
Daimona Eaytoy 5e609eb537 Add GlobalNameUtils class
This is just a temporary location for these two methods. Since they're
used a lot, having them in the AbuseFilter class means that the
dependency graph is unnecessarily complicated. Thus, since these methods
aren't doing much, they were moved to a dedicated class. Future todo is
finding an appropriate location, that might be either as part of another
service, or keep them in a Utilities class, perhaps a single class with
all util methods, rather than a specific class.

Change-Id: I52cc47a6b9a387cd1e68c5127f6598a4c43ca428
2020-12-12 17:49:48 +00:00
Daimona Eaytoy 2e703bdbb7 Simplify page handling in AFComputedVariable
Change-Id: I8a992a67222928e3a412470d1cb31653da4d172a
2020-12-12 17:17:10 +00:00
libraryupgrader 04f6c29fb5 build: Updating ini to 1.3.8
* https://npmjs.com/advisories/1589

Change-Id: I158f0fe11f6a5caabecb358c08cfc9bcb6dc1a61
2020-12-12 12:24:34 +00:00
jenkins-bot f7f34924d1 Merge "Partly decouple SpecialAbuseLog and AbuseLogPager" 2020-12-11 21:17:57 +00:00
jenkins-bot c992529f3d Merge "Create a separate view for hiding AbuseLog entries" 2020-12-11 21:15:47 +00:00
Daimona Eaytoy 21d7c08aa7 Overhaul the interface for hiding AbuseLog entries
The main change is the addition of checkboxes to hide/show multiple
entries at the same time. Also, tweaked some i18n and made the process
return more useful success/error messages.

This patch introduces some technical debt, caused by SpecialAbuseLog and
AbuseLogPager being tightly coupled (which is a pre-existing problem,
but it got worse here).

Bug: T260904
Bug: T144096
Bug: T206945
Bug: T206938
Change-Id: I13f476d8126f81b0417e7509784c83d4f21cf348
2020-12-11 20:55:08 +00:00
Daimona Eaytoy 86f308c6f0 Partly decouple SpecialAbuseLog and AbuseLogPager
Move to the latter some methods that make more sense in there. Inject
some more services, don't require a SpecialAbuseLog to be passed in the
constructor.

There are still a couple of static calls, but fixing those would require
factoring more classes out of SpecialAbuseLog (e.g. a service to
determine visibility of AbuseLog entries).

Change-Id: I1b3012ca85bf049a07e0433fc0b357f502c355ad
2020-12-11 20:53:53 +00:00
Daimona Eaytoy 7243dd6cf9 Create a separate view for hiding AbuseLog entries
This is moving code away from SpecialAbuseLog, which is already too big
and has too many purposes. As such, the behaviour is not changed,
including for now bugs that were already present in the old version.

Change-Id: Idc13f7f746ada2e425662c6948c32aa744edac61
2020-12-11 20:34:52 +00:00
jenkins-bot 6f848578ea Merge "Allow the parsers to return extra info" 2020-12-11 16:35:25 +00:00
Daimona Eaytoy 3e0c30ff92 Allow the parsers to return extra info
This is achieved by creating a new ParserStatus class. Aside from the
result of parse(), it contains whether the cache was warm. This can be
used to differentiate profiling data as part of T231112.

Another use case is returning non-fatal warnings (T269770).

Change-Id: Ifcbda861ce1a44bbe9bffba5b83cd9ef338a8dba
2020-12-11 15:03:23 +00:00
Translation updater bot 7b6c7744bf Localisation updates from https://translatewiki.net.
Change-Id: Ib357bdbfafbacfe70a33c79541bf0827ad27f5ed
2020-12-11 08:34:00 +01:00
jenkins-bot 4e5b97b6d2 Merge "build: Updating mediawiki/mediawiki-phan-config to 0.10.5" 2020-12-11 00:29:04 +00:00
libraryupgrader 281eec8e4d build: Updating mediawiki/mediawiki-phan-config to 0.10.5
Change-Id: Ie3fcfdf733885aac2ef0ee07cc1a8d4f3fedb7d7
2020-12-10 18:28:54 +00:00
jenkins-bot 8c4265b4a0 Merge "Write afl_filter_id and afl_global by default" 2020-12-10 17:36:33 +00:00
Translation updater bot 62598f1a30 Localisation updates from https://translatewiki.net.
Change-Id: I1e9c85d57721694cfbdb542f8c0541733c3e0543
2020-12-10 08:33:21 +01:00
jenkins-bot 93c477d4b8 Merge "Move parser classes to a dedicated namespace" 2020-12-09 10:48:36 +00:00
Daimona Eaytoy 97cf7df3fa migrateAflFilter: Add missing quotes to raw value in a DB query
Change-Id: I365407eaa02bc57a25db9fa64157c3f3f54398e0
2020-12-09 09:26:43 +01:00
jenkins-bot ee93ee7ded Merge "Remove more BC code" 2020-12-09 02:11:40 +00:00
Daimona Eaytoy 8b21c994fd Remove more BC code
Bug: T187153
Change-Id: I0c74b855893c7da8ab531e67a0aac298aed32c2c
2020-12-09 02:40:55 +01:00
Daimona Eaytoy d16dde9a74 migrateAflFilter: fix DB substring usage
Indexes are 1-based for all DBMSs we support.

Change-Id: Ida4b2bf972d224b386b65d84807d532d33db8c95
2020-12-09 02:30:27 +01:00
Daimona Eaytoy da1c71ec4c Move parser classes to a dedicated namespace
Names were kept for now.

Change-Id: Ib2eb5d7b523a64f2a0f72fdcdde2043a76cc9a37
2020-12-09 01:30:20 +00:00
Daimona Eaytoy f41fe76df7 Kill $wgUser
Depends-On: Iadbce7501e42971901f6d9efcb2810ae42be51d8
Depends-On: I624610cb2372db200995c8d01d62b1d74efca19e
Change-Id: I51d99c30fbc0e87c038013bf5b8c27b1c735e977
2020-12-08 23:23:13 +00:00
Daimona Eaytoy ca3f652cd7 Almost kill the last use of wgUser
This is the last use, and it was a bit harder to remove because it was
buried inside AFComputedVariable. Starting with
I4444cada720ab62d187f2dd0c4760697e465f2ff, we can freely change the
parameters to AFComputedVariable without breaking old log entries.

Note, we still need a fallback for other extensions calling this
method...

Bug: T246733
Depends-On: I4444cada720ab62d187f2dd0c4760697e465f2ff
Change-Id: I5d786a518ef88fad9c8d9c25ef4553a0bf30b2b2
2020-12-08 23:28:24 +01:00
Daimona Eaytoy bcbfa66fe8 Write afl_filter_id and afl_global by default
The schema was introduced in 1.34, so there should be no issue in
starting off with writing the new columns.

Bug: T220791
Change-Id: I8f956d4a27692a33368a413fbf4a8eb5da20afe1
2020-12-08 23:06:03 +01:00
jenkins-bot 5de037dea6 Merge "Simplify User handling in AFComputedVariable" 2020-12-08 20:58:30 +00:00
Daimona Eaytoy 815ef6051c Split afl_filter in afl_filter_id and afl_global
Add a script to migrate the columns (which can also
be executed in dry run), and a config option with the migration stage
(defaults to SCHEMA_COMPAT_OLD).
Some of the script-related code is stolen from
Ic755526d5f989c4a66b1d37527cda235f61cb437.

Bug: T220791
Change-Id: I7460a2d63f60c2933b36f8383a8abdbba8649e12
2020-12-08 18:31:27 +00:00
Daimona Eaytoy e91ab70175 Simplify User handling in AFComputedVariable
This is some more back-compat code that we can get rid of after cleaning
old entries.

Change-Id: I374fc4496c27cf50e6960a9ab07b9c80431b4a3a
2020-12-08 17:51:08 +00:00
Daimona Eaytoy 1c625eeae4 Drop back-compat code
This should be merged once T246539 is done.

Bug: T213006
Change-Id: I4444cada720ab62d187f2dd0c4760697e465f2ff
2020-12-08 17:15:47 +00:00
jenkins-bot 9a77dd91ea Merge "Fix Special:AbuseLog not to throw when global filters are not available anymore" 2020-12-08 12:56:37 +00:00
Translation updater bot c5d6373a7a Localisation updates from https://translatewiki.net.
Change-Id: I333c4b26c9ed599441d3256ce1d079888a895a89
2020-12-08 08:20:06 +01:00
Matěj Suchánek 08db320afe Fix Special:AbuseLog not to throw when global filters are not available anymore
There is a try-catch block but the same call was also done
unconditionally after it, making it throw when global filters
are disabled.

Change-Id: Ic8032592799756521a59ee23c0e76cb03a510b94
2020-12-07 20:12:06 +01:00
Translation updater bot ffa2d1b401 Localisation updates from https://translatewiki.net.
Change-Id: Ifc5c727df7e94f65ced00d537acb45b57e5168e3
2020-12-07 08:41:47 +01:00
jenkins-bot fe4a79bdd4 Merge "Add a hook for extensions to add custom actions" 2020-12-06 14:37:52 +00:00
libraryupgrader 9fbcbf0140 build: Updating mediawiki/mediawiki-codesniffer to 34.0.0
Change-Id: I4508b1b736ca52684335549353f46a14505ef450
2020-12-05 19:54:47 +00:00
Daimona Eaytoy 600f1735f2 Add a hook for extensions to add custom actions
The global is now deprecated, and it will be removed soon.

Bug: T265794
Change-Id: I4e6c9b143744cb72c441017921bac9cd1960609c
2020-12-04 16:10:44 +00:00
jenkins-bot 1c8eb3963e Merge "Always take into account custom actions" 2020-12-04 14:07:09 +00:00
jenkins-bot edd998f532 Merge "Move API modules to separate namespace and rename them" 2020-12-04 12:33:05 +00:00
jenkins-bot 6d678cb271 Merge "Add ConsequencesRegistry" 2020-12-04 11:29:20 +00:00
Translation updater bot 5e311ca34d Localisation updates from https://translatewiki.net.
Change-Id: Ia894f311329e37174ea9e265b61f78c491952e5b
2020-12-04 08:32:05 +01:00
Daimona Eaytoy af8c237559 Move API modules to separate namespace and rename them
Change-Id: I436e8fed4a1cbe4f1b36a16b213ede7976e871ba
2020-12-03 22:11:09 +00:00
Daimona Eaytoy d351d7150b Always take into account custom actions
$wgAbuseFilterActions shouldn't be used normally, as it excludes actions
registered by other extensions.

Note: mw:Extension:AbuseFilter#Integration_with_other_extensions should
be updated after merging.

Bug: T239348
Change-Id: I89b3f0228eacdf145e8f2dd2a5602d0c7ce75a86
2020-12-03 21:39:35 +00:00
Daimona Eaytoy c786c4adc6 Add ConsequencesRegistry
Change-Id: I91f4f28e09fa46b9ab2457b2a241b6f105320bdd
2020-12-03 22:39:25 +01:00
jenkins-bot a7670f2bb5 Merge "Move pagers to their own namespace" 2020-12-03 20:26:59 +00:00