Commit graph

12172 commits

Author SHA1 Message Date
jenkins-bot
124854562b Merge "Add namespace and deprecation alias to JavaScriptContent" 2024-05-17 11:08:50 +00:00
jenkins-bot
01c517be20 Merge "Add namespace and deprecation alias to WatchedItem" 2024-05-17 10:42:01 +00:00
Ebrahim Byagowi
ccde5085de Add namespace and deprecation alias to JavaScriptContent
This patch introduces a namespace declaration for the
MediaWiki\Content to JavaScriptContent and establishes a class
alias marked as deprecated since version 1.43.

Bug: T353458
Change-Id: I87c17327911e28a461feaf2ff46242454cff257a
2024-05-17 13:51:18 +03:30
Ebrahim Byagowi
03dc841a08 Add namespace and deprecation alias to WatchedItem
This patch introduces a namespace declaration for the
MediaWiki\Watchlist to WatchedItem and establishes a class
alias marked as deprecated since version 1.43.

Bug: T353458
Change-Id: Id2a582b624f21867240def2541c98ce5b1bd12b4
2024-05-17 13:26:36 +03:30
Ebrahim Byagowi
29bb97dd30 Add namespace and deprecation alias to RCFeed
This patch introduces a namespace declaration for the
MediaWiki\RCFeed to RCFeed and establishes a class
alias marked as deprecated since version 1.43.

Bug: T353458
Change-Id: I2e63e05901a75d8cf8a1e9d874dc916c0a5749a4
2024-05-17 13:18:07 +03:30
jenkins-bot
fe77b8cf5c Merge "tests: Add CodexModule tests for full library mode" 2024-05-16 20:53:55 +00:00
jenkins-bot
7240d4871a Merge "CodexModule: Remove CODEX_MODULE_DIR, instead use CODEX_LIBRARY_DIR" 2024-05-16 20:53:45 +00:00
Roan Kattouw
3211083394 tests: Add CodexModule tests for full library mode
Also convert the data provider to a generator.

Change-Id: Id9cfe88d789f655ae7fc26ce48c7bba08fbee33e
2024-05-16 12:00:46 -04:00
jenkins-bot
600e7aca09 Merge "filerepo: extract AuthenticatedFileEntryPoint from img_auth.php" 2024-05-16 15:26:34 +00:00
Ebrahim Byagowi
a717db8e60 Add namespace and deprecation alias to FormatJson
This patch introduces a namespace declaration for the
MediaWiki\Json to FormatJson and establishes a class
alias marked as deprecated since version 1.43.

Bug: T353458
Change-Id: I5e1311e4eb7a878a7db319b725ae262f40671c32
2024-05-16 16:28:01 +03:30
Ebrahim Byagowi
14b4269d83 Add namespace and deprecation alias to Xml and XmlSelect
This patch introduces a new namespace declaration,
MediaWiki\Xml and adds Xml and XmlSelect to it
and establishes class aliases marked as deprecated
since version 1.43.

Bug: T353458
Change-Id: I45cccd540b6e15f267d3ab588a064fbeb719d921
2024-05-16 15:23:14 +03:30
daniel
12aa2374ab filerepo: extract AuthenticatedFileEntryPoint from img_auth.php
The idea is that all entry points should share the code in the
MediaWikiEntryPoint base class. This change just moves code from
the file scope into a class, without any structural changes.

Bug: T354216
Change-Id: Ie2e827d30a070bcc63bdce56891c3aa0a4dacddd
2024-05-16 13:22:00 +02:00
Roan Kattouw
fe62ebafd2 CodexModule: Remove CODEX_MODULE_DIR, instead use CODEX_LIBRARY_DIR
CODEX_MODULE_DIR is always the /modules subdirectory of
CODEX_LIBRARY_DIR, so remove it and derive it that way instead.

- Update tests accordingly
- Rename test data files accordingly
- Use CODEX_LIBRARY_DIR in one place where we had neglected to use a
  constant

Change-Id: Ieb347c2d128f3addfb11f6aca79d63969434f342
2024-05-15 17:12:20 -04:00
jenkins-bot
f8069112d0 Merge "Remove deprecated Linker methods" 2024-05-15 16:53:44 +00:00
C. Scott Ananian
ab660966d2 Remove deprecated Linker methods
The removed tests in LinkerTest were ported (or were previously
ported) to the new CommentFormatter framework in the CommentParserTest
class; some references to the LinkerTest class have been removed since
CommentParserTest is now the canonical location for these.

Cleaned up a bit more from the removed DummyLinker class as well
(I69689b2037269af3320b6203fc44755f93713489).

Followup-To: I69689b2037269af3320b6203fc44755f93713489
Change-Id: Ia743d13c4fe7f4e3e2bd11274895a261adbfd8e2
2024-05-15 15:18:07 +00:00
jenkins-bot
2354ec3184 Merge "Revert "Revert "Add ContributionsPager, an abstract parent for ContribsPager""" 2024-05-15 13:28:37 +00:00
jenkins-bot
29cb634a5c Merge "Revert "Revert "Make ContributionsSpecialPage parent for SpecialContributions""" 2024-05-15 13:21:27 +00:00
jenkins-bot
21a1d7c84e Merge "ThumbnailEntryPointTest: Fix PHP notice in data provider" 2024-05-14 18:14:58 +00:00
Bartosz Dziewoński
03b9490fe2 ThumbnailEntryPointTest: Fix PHP notice in data provider
Follow-up to 4b35d1e3ed.

Bug: T364879
Change-Id: Ic6d4ffd1f4ea36701407107981a7ca11e45affca
2024-05-14 16:32:05 +00:00
Lucas Werkmeister
8908074552 LinkFilter::makeLikeArray: Fix another 'path' access
If a news: or mailto: URL is specified with two slashes, it will have a
'host' rather than a 'path' after all, so this workaround is unnecessary
and should be skipped in that case; compare also change Idc6b389da9
(commit ec1b572362) for makeIndexes().

I’m not very sure that the test case makes much sense, but it’s at least
enough to trigger the error and verify the fix.

Bug: T364743
Change-Id: I09be813e661b80968da00d8a898b2add8c95fec7
2024-05-14 12:29:23 +02:00
jenkins-bot
7934a84307 Merge "Add Parsoid HTML version to wrapper div" 2024-05-14 04:36:58 +00:00
jenkins-bot
c7d6af3019 Merge "Migrate IReadableDatabase::buildGroupConcatField to SelectQueryBuilder" 2024-05-13 16:18:33 +00:00
jenkins-bot
cf6d252ead Merge "watchlist: Move un-namespaced watcheditem classes to /includes/watchlist/" 2024-05-13 16:07:36 +00:00
jenkins-bot
17e9c09d0c Merge "Move various job classes to relevant component directories" 2024-05-13 16:07:27 +00:00
jenkins-bot
12582c344d Merge "mail: Improve docs, fix file headers, widen @covers" 2024-05-13 16:03:02 +00:00
Thalia
5362096f27 Revert "Revert "Add ContributionsPager, an abstract parent for ContribsPager""
This reverts commit e6fb3df2a6.

This re-instates I08a5d39036047484e3b44fcd83989072006b88e2.

Bug: T363358
Change-Id: I847c60a493d9973554ceb1232f3799c42321ee2b
2024-05-13 15:38:34 +01:00
Thalia
c2041e87f5 Revert "Revert "Make ContributionsSpecialPage parent for SpecialContributions""
This reverts commit 1f4bb6651a.

This re-instates Ic00fa3297fb08eacf570d3ec3fcf64925fcf69c5.

Bug: T363358
Change-Id: Ibf4f382f5aaf4447cfe9404d5dd8b6b59b314cdc
2024-05-13 15:35:59 +01:00
jenkins-bot
822a0eea73 Merge "Add Special:TalkPage for redirecting to talk pages" 2024-05-13 14:13:12 +00:00
jenkins-bot
78637143f1 Merge "Remove all @package comments" 2024-05-13 12:21:22 +00:00
Lucas Werkmeister
3074f3f773 Add Special:TalkPage for redirecting to talk pages
This is useful to link to the talk page of a page that is only known by
its title without needing to parse it or make any API requests.

I originally had the class extend RedirectSpecialPage, but couldn’t make
the form work properly that way, so eventually I opted to extend
FormSpecialPage instead and implement the redirect behavior directly.

Cache behavior is moderately aggressive, pinned to the parser cache
expiry, as these redirects should only need to change when the
namespace settings are updated.

Bug: T242346
Change-Id: I531b0b061d1ff1fef9ceffd6c82dc34940ba653d
2024-05-13 11:54:39 +02:00
Brian Wolff
89f59b39b6 Extract XMP & Exif from WebP files
In addition to the webp spec, this also detects two non-standard
conventions sometimes found in real files: Allowing a fourcc
of "XMP\0" instead of the standard "XMP " and allowing the prefix
"Exif\0\0" at the beginning of the EXIF chunk.

Bug: T338341
Bug: T353981
Change-Id: I0ddc3322e1c2f4d4d7bb11732e05fd4ffb5eb692
2024-05-11 09:41:21 +00:00
jenkins-bot
37d2a081ba Merge "block: Deprecate and stop using $wgBlockTargetMigrationStage" 2024-05-11 00:47:21 +00:00
Timo Tijhof
c68eb007ea watchlist: Move un-namespaced watcheditem classes to /includes/watchlist/
Bug: T364652
Change-Id: I264024784e8147fa421c8a13e8ae4541d8735f78
2024-05-10 21:07:20 +01:00
Timo Tijhof
b432fd2f20 Move various job classes to relevant component directories
Motivation:

* Remove need to hardcode out-of-component files in various places.
  Especially for Gerrit queries, this not only reduces effort but
  also makes these files more likely to show up in the first place.
* Clarify component boundaries and ownership, e.g. when filing tasks
  with a stack trace.
* Now rather than later, to avoid need for multiple class renames and
  aliases when PSR-4 namespaces are applied later (T166010).

Background:

Similar to how jobs in extensions belong to that extension, the same
is true within core. There is a distinction between the JobQueue system,
and individual jobs belonging to a specific feature or component,
likewise for deferred updates, and special pages.

To make a begin with this, I propose moving the job classes to their
respective components for cases where component boundaries are already
clear. E.g. due to exclusively being queued by that same component,
being named/introduced by the same commit, being already documented
as such in component descriptions on mediawiki.org.

Bug: T364652
Change-Id: I73d6b97c6ca9f5abd29f4277d0f845426aa23bd0
2024-05-10 20:14:00 +01:00
Timo Tijhof
949c9c932e mail: Improve docs, fix file headers, widen @covers
* Add missing `ingroup` to class blocks (and remove from any file blocks)
  as otherwise the file is indexed twice (e.g. in Doxygen) which makes
  navigation on doc.wikimedia.org rather messy.

  Remove duplicate descriptions from file blocks in favour of class
  doc blocks. This reduces needless duplication and was often
  incorrect or outdated, and helps make file headers more consistently
  (visually) ignorable.

  Ref https://gerrit.wikimedia.org/r/q/message:ingroup+is:merged

* Widen `@covers` tags in phpunit tests

  Given all called methods are de-facto and liberally claimed, and
  that we keep the coverage limited to the subject class, it maintains
  the spirit and intent by listing the class explicitly instead.

  PHPUnit offers a more precise tool when you need it (i.e. when testing
  legacy monster/god classes), but for well-written code, the
  class-wide tag is exactly what you want.

  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".

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

While at it, improve purposes and explainations of several mail-related
classes, and set `@since`:

- EmailNotification introduced in r22110 (1.11.0), git a6f6e04841,
  later moved to a separate file in bf8810d6bc (Ic435bbdbb6).

- MailAddress introduced in r12082 (1.6.0, 1.5.7), git 5cfddf9a82.

- UserMailer converted to class with ::send in r26357 (1.12.0),
  git 353f203ce2.

Change-Id: I1216781240bcfabdebf109cef8f995355db0f659
2024-05-10 19:48:43 +01:00
jenkins-bot
e782b3edcb Merge "Break streamThumb() into private methods" 2024-05-10 18:27:40 +00:00
thiemowmde
52ddf3e8ce Remove all @package comments
I don't think these do anything with the documentation generators
we currently use. Especially not in tests. How are tests part of a
"package" when the code is not?

Note how most of these are simply identical to the namespace. They
are most probably auto-generated by some IDEs but don't actually
mean anything.

Change-Id: I771b5f2041a8e3b077865c79cbebddbe028543d1
2024-05-10 13:53:15 +02:00
Tim Starling
a5372218b7 block: Deprecate and stop using $wgBlockTargetMigrationStage
* Deprecate and stop using $wgBlockTargetMigrationStage. Remove
  block_target migration code.
* Make the $schema parameters to DatabaseBlockStore methods default to
  SCHEMA_BLOCK. Avoid passing these parameters where possible.
* Remove cleanupBlocks.php
* Deprecate DatabaseBlock static methods which try to present the old
  schema for b/c.

Bug: T362133
Change-Id: I845bad8cc09a4528fef46a6f9d490ebdec881d99
2024-05-10 15:54:17 +10:00
DannyS712
ee75e1c6f9 Tests: remove a bunch of DummyServicesTrait-related comments
Not sure why I added these, it should be clear from the method names

Change-Id: Ie49881e6f31fad52bb65b0d2ac3e9379dbb7bfc5
2024-05-10 04:07:59 +00:00
jenkins-bot
205892a73b Merge "block: Migrate to the new block schema on non-WMF wikis" 2024-05-10 01:48:46 +00:00
jenkins-bot
9f5a0be099 Merge "Revert "Make ContributionsSpecialPage parent for SpecialContributions"" 2024-05-09 19:40:05 +00:00
jenkins-bot
04787125e8 Merge "Revert "Add ContributionsPager, an abstract parent for ContribsPager"" 2024-05-09 19:39:16 +00:00
DannyS712
1f4bb6651a Revert "Make ContributionsSpecialPage parent for SpecialContributions"
This reverts commit 4e5917441d.

Reason for revert: breaking change, caused T364569

Bug: T364569
Bug: T363358
Change-Id: Ie5b899c31844a1ff1c3fba279638980d3e0ef176
2024-05-09 17:29:45 +00:00
DannyS712
e6fb3df2a6 Revert "Add ContributionsPager, an abstract parent for ContribsPager"
This reverts commit e1ffed0af6.

Reason for revert: breaking change, caused T364569

Bug: T364569
Bug: T363358
Change-Id: I08a5d39036047484e3b44fcd83989072006b88e2
2024-05-09 17:28:32 +00:00
jenkins-bot
efa364e059 Merge "Skin: Fix UrlUtils calls" 2024-05-09 17:24:16 +00:00
jenkins-bot
c11836d115 Merge "Remove auto-generated "Class ClassName" comments" 2024-05-09 17:07:07 +00:00
Lucas Werkmeister
e376d6ed54 Skin: Fix UrlUtils calls
This was broken in change I9a55545e4c (commit b90e0e4261):
wfUrlProtocols() without argument is equivalent to validProtocols(), not
validAbsoluteProtocols() (wfUrlProtocols()’s $includeProtocolRelative
defaults to true).

Bug: T364539
Change-Id: I050ed65624928ee8277468f70b8b80a3080f190a
2024-05-09 17:26:23 +02:00
Tim Starling
2998d9bd47 block: Migrate to the new block schema on non-WMF wikis
Migrate from ipblocks to block/block_target and drop the ipblocks
table. Update tests.

In PostgresUpdater, change some schema update functions to skip field
updates if the table doesn't exist, by analogy with
DatabaseUpdater::modifyField.

Bug: T346293
Change-Id: Icf91b35f7f729cead7c800429653eb30731762a1
2024-05-09 10:14:43 -04:00
jenkins-bot
47987acdfd Merge "Add ContributionsPager, an abstract parent for ContribsPager" 2024-05-09 13:13:38 +00:00
jenkins-bot
5b9bde475a Merge "Make ContributionsSpecialPage parent for SpecialContributions" 2024-05-09 12:51:56 +00:00