Commit graph

7584 commits

Author SHA1 Message Date
jenkins-bot eb1db27c77 Merge "Clean up ActionVariablesIntegrationTest" 2024-05-03 07:16:12 +00:00
Umherirrender 06ccd0c0b8 tests: Use IDatabase for mocking instead of DBConnRef
DBConnRef is internal, use of IDatabase interface is more common

Change-Id: Ib14496dd4e5c02bb80a1e7f43e9489d5c22bda39
2024-05-02 22:32:05 +02:00
jenkins-bot 9da1bf7dff Merge "Migrate to IReadableDatabase::newSelectQueryBuilder" 2024-05-02 20:13:30 +00:00
Translation updater bot 6d65e63add Localisation updates from https://translatewiki.net.
Change-Id: If38116bdc29cf67b9aba17e63bd2f3219360d1cb
2024-05-02 09:18:44 +02:00
libraryupgrader d8da059e83 build: Updating ejs to 3.1.10
* https://github.com/advisories/GHSA-ghr5-ch3p-vcr6

Change-Id: I064c94773b95a596dae4b5ef1659ecf88e5000f5
2024-05-02 01:04:27 +00:00
Suffusion of Yellow e4eb65524c Fix path of CodeEditor modules
This was changed to /CodeEditor/modules/lib/ace in 46ee5c493
and is breaking CTRL-F search and other features.

Bug: T362813
Change-Id: Ie1e2a5dc32a7f5c6275a64651e5230ad801d5455
2024-05-01 12:48:25 -07:00
Matěj Suchánek 7f3ded3004 Clean up ActionVariablesIntegrationTest
Change-Id: Ia9ad89b699dac351e6b14a3d33dc0ceea7ed74b3
2024-05-01 16:22:15 +02:00
Translation updater bot 9cd74c0bd4 Localisation updates from https://translatewiki.net.
Change-Id: Ib988462369aab0e411623f408d8ffb49244b949c
2024-05-01 09:21:34 +02:00
Umherirrender 6dccb17255 Migrate to IReadableDatabase::newSelectQueryBuilder
Also use expression builder to avoid raw sql

Bug: T312420
Change-Id: I83eb39f1c65a698108ae5bb72f633afda37a9f23
2024-04-30 20:45:51 +02:00
Translation updater bot 84b047f6e4 Localisation updates from https://translatewiki.net.
Change-Id: Ia6ccc1438190e8ec315f5eb3cde7f18de9e8d8d2
2024-04-30 09:20:19 +02:00
Umherirrender d0e85abda1 maintenance: Migrate to IReadableDatabase::newSelectQueryBuilder
Also use expression builder to avoid raw sql

Bug: T312420
Change-Id: I981f7d8107b7c4401056266c58db4457ad759f9c
2024-04-29 22:15:35 +02:00
Translation updater bot ca7c0232d3 Localisation updates from https://translatewiki.net.
Change-Id: Idcec502aa0134afc26950a27c8b1e96024d6b782
2024-04-29 09:22:23 +02:00
Matěj Suchánek 6526a5494b Simplify computation of derived links variables
Instead of having separate methods for each variable,
have one method which can work not only with "_links",
but with any array of strings.

Change-Id: I05f1b1cbd15f283b314c72259f183f7788e4e214
2024-04-27 10:56:58 +02:00
Translation updater bot 2ea686643f Localisation updates from https://translatewiki.net.
Change-Id: I415f042420c35fbdbfbb82ea09b9fd64ec4b57bf
2024-04-26 09:47:12 +02:00
Translation updater bot adc724bb76 Localisation updates from https://translatewiki.net.
Change-Id: Idc58d87d97d31fa5378709a8f791b8e7cf70d4b8
2024-04-25 09:16:58 +02:00
Alexander Vorwerk ce59b52c48 Add afl_var_dump to AbuseLogPager::getQueryInfo
Follow-Up: I08a399f1b6a66442317b151be5386c9d2485f1fb
Bug: T363213
Change-Id: I6cdd59687a7e23d472eb2aa7d5c55714967a77ee
2024-04-23 21:38:23 +02:00
Translation updater bot 1747dcaefd Localisation updates from https://translatewiki.net.
Change-Id: I5b482d2c585a9b5349ac59e5b0c30cd46f47a97f
2024-04-23 09:27:19 +02:00
Translation updater bot 0bd9d40f66 Localisation updates from https://translatewiki.net.
Change-Id: Ifd30d028b4a0d9813bca16704967ab58661af98c
2024-04-22 09:27:11 +02:00
jenkins-bot 0038f18b9b Merge "Migrate to IDatabase::newUpdateQueryBuilder" 2024-04-20 20:40:53 +00:00
Umherirrender 6c870529e4 tests: Return FakeResultWrapper from mocked IReadableDatabase::select
To match the return type documentation of IReadableDatabase::select

Change-Id: I6a03c9468aa23f830f550e83eebf734ba0167c23
2024-04-19 21:20:07 +02:00
Translation updater bot 55f710b3df Localisation updates from https://translatewiki.net.
Change-Id: Iedd04fa4e626d4eb54579c829c06457accaa1e2b
2024-04-19 09:45:11 +02:00
jenkins-bot f48ea8b48a Merge "Replace SELECT * with real list of used fields" 2024-04-18 19:35:55 +00:00
Translation updater bot 293ce4115d Localisation updates from https://translatewiki.net.
Change-Id: I97d530ace146620eaf9eeeac4d53bc15819c1aef
2024-04-18 09:19:36 +02:00
Translation updater bot 31d58fb5cb Localisation updates from https://translatewiki.net.
Change-Id: I9c305d3a9daaf0898ffd0b51cd154376bda25f2c
2024-04-17 09:27:21 +02:00
Timo Tijhof 4743f9d267 tests: Widen @covers tags in phpunit tests
Follows-up I5a5420df13893386.

> We lose useful coverage and waste valuable time on keeping tags
> accurate through refactors (or worse, forget to do so).
>
> Tracking tiny per-method details wastes time in realizing (and
> fixing) when people inevitably don't keep them in sync, and time
> lost in finding uncovered code to write tests to realize it was
> already covered but "not yet claimed".
>
> Given all used methods are de-facto and liberally claimed, and
> that we keep the coverage limited to the subject class, this
> maintains the spirit and intent. PHPUnit offers a more precise
> tool when you need it (i.e. when testing legacy monster classes),
> but for well-written code, the class-wide tag suffices.

Ref https://gerrit.wikimedia.org/r/q/owner:Krinkle+is:merged+message:Widen

Change-Id: If7304d8b5b43ab8a051fbcecced331a787bab960
2024-04-17 01:44:40 +01:00
Umherirrender 0a601acd6f Replace SELECT * with real list of used fields
It is a common pattern to avoid SELECT * and use the fields used by
the application to avoid loading to much data into memory and maybe use
performance benefits when fields are covered by index.

Change-Id: I08a399f1b6a66442317b151be5386c9d2485f1fb
2024-04-16 21:14:10 +02:00
Translation updater bot d654cdf804 Localisation updates from https://translatewiki.net.
Change-Id: I75d4c6fd3e5db58956d44327313bfd9e943214d6
2024-04-16 09:26:41 +02:00
Umherirrender 3691d773d3 Migrate to IDatabase::newUpdateQueryBuilder
Change-Id: I0b3fd864e5227068114ca7aa9e98361046f393c1
2024-04-15 23:07:44 +02:00
jenkins-bot f17f231a70 Merge "tests: Widen @covers tags in SpecsTest" 2024-04-15 16:56:57 +00:00
jenkins-bot 1807a07755 Merge "Remove small pieces of unused code from SpecsFormatterTest" 2024-04-15 16:02:31 +00:00
Timo Tijhof 56c0f6313e tests: Widen @covers tags in SpecsTest
> We lose useful coverage and waste valuable time on keeping tags
> accurate through refactors (or worse, forget to do so).
>
> Tracking tiny per-method details wastes time in realizing (and
> fixing) when people inevitably don't keep them in sync, and time
> lost in finding uncovered code to write tests to realize it was
> already covered but "not yet claimed".
>
> Given all used methods are de-facto and liberally claimed, and
> that we keep the coverage limited to the subject class, this
> maintains the spirit and intent. PHPUnit offers a more precise
> tool when you need it (i.e. when testing legacy monster classes),
> but for well-written code, the class-wide tag suffices.

Ref https://gerrit.wikimedia.org/r/q/owner:Krinkle+is:merged+message:Widen

Change-Id: I5a5420df1389338644a099ebfd072063653e6849
2024-04-15 16:36:36 +01:00
Translation updater bot 9d66ffb4ba Localisation updates from https://translatewiki.net.
Change-Id: I4213f0519b69b98ea79d73924e6bd342274debf3
2024-04-15 09:27:06 +02:00
jenkins-bot be54bef5d8 Merge "Clean up injection of DatabaseBlockStore" 2024-04-15 04:01:23 +00:00
jenkins-bot e673b1e585 Merge "BlockedDomainFilter: Always return Status from filter()" 2024-04-14 21:15:31 +00:00
jenkins-bot 5c61521cbb Merge "Migrate to IDatabase::newInsertQueryBuilder/newDeleteQueryBuilder" 2024-04-14 18:28:13 +00:00
Bartosz Dziewoński c458651370 Fix Status combining MessageSpecifier and parameters array
Constructing a Status like this does not make sense (and I want
to deprecate it in I0675e557bb93a1c990fa923c50b9f6ee8a9836c8),
because the parameters are ignored by most Status methods:

  $error = Message::newFromSpecifier( 'abusefilter-blocked-domains-attempted' );
  $status = Status::newFatal( $error, 'blockeddomain', 'blockeddomain' );

But it worked here, because FilteredActionsHandler::getApiStatus()
used a deprecated method that allowed inspecting them.

I feel like this code in BlockedDomainFilter has been added to make
the tests pass without thinking about what it actually does, which is
to output a bunch of useless incorrect data in API errors.

I'm not sure if we can remove that now without breaking API
compatibility, so add the useless data in FilteredActionsHandler
instead, closer to where it's output.

Change-Id: Ic12241bd3029bc1b0e7a0023689a2be35ccd30a8
2024-04-14 00:02:32 +00:00
Bartosz Dziewoński a5e0851dc0 BlockedDomainFilter: Always return Status from filter()
From Status class documentation:
> The recommended pattern for Status objects is to return a Status object
> unconditionally, i.e. both on success and on failure -- so that the
> developer of the calling code is reminded that the function can fail, and
> so that a lack of error-handling will be explicit.

Change-Id: Ie6a55e297a35374fbdef880dd40e65f5cd00b6bf
2024-04-13 01:05:01 +02:00
jenkins-bot bd2e33e3e5 Merge "Replace array_merge in tests with the [ ... ] syntax" 2024-04-12 09:32:57 +00:00
jenkins-bot bce13e31a7 Merge "Fix wrong getMockMessage() calls in tests" 2024-04-12 09:32:55 +00:00
jenkins-bot 098ff0b880 Merge "Use modern str_starts_with() and [ ... ] syntax" 2024-04-12 09:32:53 +00:00
Matěj Suchánek ad2600b6c0 Clean up injection of DatabaseBlockStore
The static method has already been migrated.

Also rewrite the test cases to avoid non-static provider (T337144).

Change-Id: Ibf98539f442e1ba8a9e9eb510784d40778123f17
2024-04-12 11:01:00 +02:00
thiemowmde 07a04b74d7 Remove small pieces of unused code from SpecsFormatterTest
Change-Id: Ifbef4f3c73b5744dd1ead9df1743631753bd306a
2024-04-12 08:37:00 +00:00
Translation updater bot 7560067181 Localisation updates from https://translatewiki.net.
Change-Id: Ie11f736705eb077feba1f13878600b87ef186b47
2024-04-12 09:41:03 +02:00
thiemowmde 0b0fab9d1b Fix wrong getMockMessage() calls in tests
MessageLocalizer::msg( $key, ...$params ) accepts a variable number
of arguments, but getMockMessage does not. Passing only the first
argument as a string to getMockMessage is not supported.

Required for I86ff2d6.

Change-Id: I30ab799ceab36b80c330d1233f3009814d7f6c98
2024-04-11 15:32:17 +00:00
thiemowmde c9f8343173 Use modern str_starts_with() and [ ... ] syntax
Change-Id: I2f2182e1e0850d7ebf832b7b8e0630ce56aad88b
2024-04-11 14:07:43 +02:00
thiemowmde 7f214ec15c Replace array_merge in tests with the [ ... ] syntax
It does the same and is well supported in the PHP versions we
currently use, at least when the arrays contain integer keys.

Change-Id: Id038142621dab47bfc03db48ce676ed0b2cdc28b
2024-04-11 14:01:25 +02:00
jenkins-bot 09db8e6bb9 Merge "Add new variable for last edit time" 2024-04-11 11:57:33 +00:00
jenkins-bot 6bdde6553b Merge "Fix new Phan errors" 2024-04-11 11:34:03 +00:00
Translation updater bot d51d4a014d Localisation updates from https://translatewiki.net.
Change-Id: I15d4293c9d3e0c49e57a34333505214b979570d0
2024-04-11 09:19:58 +02:00
Matěj Suchánek 68ff668543 Add new variable for last edit time
Bug: T269769
Change-Id: Ia41ecc2f8e6921ef3d5a16fec58202d584ad0727
2024-04-10 23:12:45 +00:00