Commit graph

2734 commits

Author SHA1 Message Date
James D. Forrester
984076f98e Add namespace to includes/api classes
Bug: T353458
Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
2024-09-25 19:31:14 +00:00
jenkins-bot
ef41dedbd4 Merge "objectcache: Add regression test for MultiWrite dependency injection" 2024-09-24 04:38:56 +00:00
Timo Tijhof
70f9eb8f91 objectcache: Add regression test for MultiWrite dependency injection
Follows-up 4e596f5112 (I59266726ad), which fixed bug T318272, but
did not add a regression test for it.

Bug: T318272
Bug: T327158
Change-Id: Ia8af6671887d3914fdc761d8e5d10fd33fb40f88
2024-09-23 15:07:23 -07:00
jenkins-bot
b145754452 Merge "tests: Use ::class for class name resolution" 2024-09-21 13:48:10 +00:00
Umherirrender
8e039f2101 tests: Use ::class for class name resolution
Also use namespaced version of the class

Change-Id: Idce009e4d0a8e77f95244d95db008d64a2025c5f
2024-09-20 21:19:22 +02:00
daniel
84fe1b9ccd REST: Introduce discovery endpoint
The discovery endpoint provides basic information about accessing the
wiki's APIs, as well as a directory of available modules.

Bug: T365753
Change-Id: I161aa68566da91867b650e13c8aadc87cd0c428c
2024-09-20 17:02:59 +00:00
jenkins-bot
a335696207 Merge "build: Remove exclude of MediaWiki.Commenting.PropertyDocumentation" 2024-09-19 05:34:38 +00:00
Umherirrender
f09beca7ca build: Remove exclude of MediaWiki.Commenting.PropertyDocumentation
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.

Enable the sniff to avoids that new code is missing type declarations.

Depends-On: I4b182fda29e9cb9719c26fd01a609de2453be56d
Depends-On: I1106dd167dc2188ed91d1884e979b5cea303f722
Depends-On: I2606072015d71b4bdda70a7c149d9f55ac205a3c
Depends-On: I90ecf85cb6f639af4be1947ccfbfb16d5b84cab3
Depends-On: Ib0402017e602ad3e79b7ffbb5b02bcedae1fab6b
Depends-On: I29bc609c5148668e533a9ed9f72b29f780f00dba
Depends-On: Ib6081f5519d2294bb14f81bf399f9c45315f2b69
Depends-On: Ifbc2ce0c68865c5d32689e56c6215a5099f7478b
Depends-On: I72c7dab67ef12d229fb232311e404467260d742d
Depends-On: Id994553eaeac181775ac782423ff53928ad45466
Depends-On: Id08ee260e320d8c97c2c3576d998af1b70952f27
Depends-On: I65636f2b97b44387c4320ebfb4be6c81d6f771b9
Depends-On: I897106d15c9e43f75eb006c35a14ac49edeb3ecd
Depends-On: I39ce744ee4f4a9356b0788b6e38ece9635a5ca49
Depends-On: I8a45487483c54b50576c8cbef3f8ea7b3b19969a
Depends-On: Id7ccd48e3bf626095e2d3929831b5d87ed0be948
Depends-On: I07ce1f37d1bfb18d6e73dd008a712b3ca60a80e9
Depends-On: Id75cb2e5fbee0fe7600f92473d876f23730d46b7
Depends-On: I217b9c906972c1f335e8e7d2b340e86a4d92c5a1
Depends-On: Ia1302c9c0528691436a0411ca62b651471811c98
Depends-On: I45c62ed8b6c2893b66f12dc60580c0267b475945
Depends-On: Ia8bbdc4dee59dfb487582dd514486ec8542951be
Depends-On: I9e5330601ded043ad24a99932fe3fa0ea6c427aa
Depends-On: I67bb532efff05b7fb01abec540620239cb4031b2
Depends-On: Ia205d578b9620960d967e2cbeb418e7e5af94dd4
Depends-On: Idf17719c875466810313f0fbbf16bc67f3e40059
Depends-On: I8b33b5f4d91c1935228e7010327dbc6ce138fc00
Depends-On: I3afaba387663320187c49ff1cdb2ff3ae01681ad
Depends-On: I48014b6464f3e7e2b7f083e67f517af0b1a9367e
Depends-On: I6ff2b1e91f28340f8f467a1d5e50cc132e142b95
Depends-On: I113b040321d27c84fe9b807c162736909e96fb20
Depends-On: I7dec01892a987a87b1b79374a1c28f97d055e8fa
Depends-On: I921c5cbe5b811c5ade9d9fad56ad3499ef8373e0
Depends-On: I46f46f1855ca32c89a276b06f4e2051ff541886e
Depends-On: I41ad89cc3112a2911ad40c55583bff2d7787da68
Depends-On: I1f306a3925d6768209a06e70082598b2f70cd319
Depends-On: Ifc27750207edc09e94af030d882b6f1a5369cf98
Depends-On: I81544e367543846654b4d03fcad5adad71e23751
Depends-On: I56a1d27ba2dfbcdd929a0e0c96664bc2a31e38f2
Depends-On: I6dd402a5bca0c2136595faedae315959bbcf17d9
Depends-On: I82b4f543ed004fc960b6b1f8ac718db2a63a40fe
Depends-On: I1da4b272a6b28c419cc8e860d142dae19ca0bbcf
Depends-On: I6087dcdac761916359009548beb5210671a32ee5
Depends-On: I73c413727a63d14efb5028b27128784c98724110
Depends-On: Ifddb6a95d0d81fef4c480ef96dbc1fc9cbb93401
Change-Id: I97a8b6fbe17a24ddffcc6a3fd4ea4451b59ba790
2024-09-18 17:27:01 +00:00
Umherirrender
41f6d9eee4 tests: Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.

Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.

Change-Id: Ifc27750207edc09e94af030d882b6f1a5369cf98
2024-09-18 17:25:42 +00:00
jenkins-bot
82b7b8469f Merge "language: Add missing documentation to class properties" 2024-09-17 22:58:47 +00:00
Umherirrender
eb28edd84e language: Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.

Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.

Change-Id: I73c413727a63d14efb5028b27128784c98724110
2024-09-17 18:25:25 +00:00
bpirkle
90494183bb REST: add restbase compat error handling mode
In order to replace certain /api/rest_v1 endpoints, we
need to have something in MediaWiki that generates a compatible
responser. The MediaWiki REST API error format does not match
RESTbase. So the easiest approach seemed to be to
add a compatibility mode, triggered using the x-restbase-compat
header. This can be set via the gateway when rerouting the request.

Bug: T374136
Change-Id: I73934940d367be52941bd27861c248ab5bcfb5d2
2024-09-16 18:09:12 -05:00
jenkins-bot
634373a3cf Merge "REST: add restbase compat mode for some endpoints" 2024-09-16 19:21:57 +00:00
jenkins-bot
102ab8b972 Merge "htmlform: Add missing documentation to class properties" 2024-09-16 13:35:00 +00:00
daniel
602f0ab595 REST: add restbase compat mode for some endpoints
In order to replace the /api/rest_v1/page/title/{title} endpoints, we
need to have something in MediaWiki that generates a compatible
responser. The v1/page/{title}/bare and v1/revision/{id}/bare endpoints
are functionally equivalent, so the easiest approach seemed to be to
add a compatibility mode to them. The compatibility mode is triggered
using the x-restbase-compat header, which can be set via the gateway
when routing the request from /api/rest_v1/page/title/.

Bug: T374136
Change-Id: I4af7ff5325660ae30faebb24753b9dc1c3acb2b3
2024-09-15 16:41:21 -05:00
Umherirrender
aed646001c htmlform: Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.

Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.

Change-Id: I1f306a3925d6768209a06e70082598b2f70cd319
2024-09-14 11:49:05 +00:00
jenkins-bot
df07b07b4a Merge "libs: Add missing documentation to class properties" 2024-09-14 02:38:58 +00:00
jenkins-bot
a27ade70ee Merge "Use const keyword for constant list of strings or ints" 2024-09-13 18:08:57 +00:00
Umherirrender
da63db52af libs: Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.

Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.

Change-Id: I46f46f1855ca32c89a276b06f4e2051ff541886e
2024-09-13 17:24:12 +00:00
jenkins-bot
ab14c236cd Merge "rdbms: Add missing documentation to class properties" 2024-09-12 23:25:03 +00:00
Umherirrender
465777f188 Use const keyword for constant list of strings or ints
Also changed visiblity of some to private

Change-Id: I113b040321d27c84fe9b807c162736909e96fb20
2024-09-11 23:16:24 +02:00
Umherirrender
e38e3d1c49 rdbms: Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.

Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.

Change-Id: I9e5330601ded043ad24a99932fe3fa0ea6c427aa
2024-09-11 21:24:59 +02:00
Umherirrender
503bff0b04 Rest: Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.

Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.

Change-Id: Idf17719c875466810313f0fbbf16bc67f3e40059
2024-09-07 21:49:56 +02:00
Ebrahim Byagowi
ea43a44a2e Remove wfRemoveDotSegments, deprecated since 1.39
It didn't have any use outside the core so went for the removal
instead of raising warning and hard deprecation.

Change-Id: I08dab348a89f1fe1adccfad4f003d9fb8b233f0d
2024-09-06 22:00:09 +03:30
Ebrahim Byagowi
c0d1f7694c objectcache: Remove ReplicatedBagOStuff, deprecated since 1.42
Bug: T352481
Change-Id: I4e1ee5680b7ba0207dfe30a1208db35eca07e218
2024-09-04 20:21:29 +00:00
Umherirrender
0a69e0bc53 tests: Use const for some static data in test files
Change-Id: Id7ccd48e3bf626095e2d3929831b5d87ed0be948
2024-09-01 23:24:11 +02:00
Umherirrender
574e8b702c utils: Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.

Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.

Improve a mixed type to string

Change-Id: Id994553eaeac181775ac782423ff53928ad45466
2024-09-01 14:40:01 +00:00
jenkins-bot
b5a1f97c2e Merge "Revision,Storage: Widen @covers tags in tests" 2024-08-30 12:08:24 +00:00
Timo Tijhof
311b2d0e98 Revision,Storage: Widen @covers tags in tests
> Given all called same-class 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 as a whole 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, especially private functions (or worse,
> forget to update it).
> 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

Change-Id: If90fc5285a067ec8f706d87b2ba1ae85020e2ba0
2024-08-30 04:23:11 +00:00
Timo Tijhof
8fb118cb8b recentchanges: Move rcfeed/ to includes/recentchanges/RCFeed/
It is part of the component at
https://phabricator.wikimedia.org/tag/mediawiki-recent-changes/
and
https://www.mediawiki.org/wiki/Developers/Maintainers
and
since Ifac20da51f7e809f under the same "Recent changes" doc group.

The Maintainers list oddly enough lists only rcfeed and completely
forgets the majority of it under /includes/changes (or now,
/includes/recentchanges).

Bug: T364652
Change-Id: I94e6705672c1e2821bdc726aa7a383d9e7c1f7b5
2024-08-29 03:51:40 +01:00
jenkins-bot
51a167f58f Merge "Replace a few more uses of deprecated Status / StatusValue methods" 2024-08-22 23:25:55 +00:00
Bartosz Dziewoński
d46fdf645b Replace a few more uses of deprecated Status / StatusValue methods
Change-Id: I017bcaffe6945d633d7387f9391803845369bfed
2024-08-22 19:34:51 +00:00
Bartosz Dziewoński
4948fbe4f9 Message: Validate ScalarParam and ListParam types
* Add getters for the lists of valid types
  (named cases() like in PHP 8.1 enums)
* Validate that the provided type is in the list
* Replace funky use of reflection in Converter

Change-Id: I8da89edbb943fae8920c15b1bc6856ce97a4de7a
2024-08-21 06:53:04 +02:00
jenkins-bot
a8c88777b6 Merge "Parsoid SiteConfig: allow stat counters incremented by arbitrary values" 2024-08-19 21:56:59 +00:00
C. Scott Ananian
149832cf46 Parsoid SiteConfig: allow stat counters incremented by arbitrary values
Bug: T354908
Bug: T369719
Change-Id: I9ad5cbb9e26138fda1965f3fa4a677c15cb41d07
2024-08-19 12:02:18 -04:00
jenkins-bot
458acc43c3 Merge "tests: Silence JsonBodyValidator deprecation warning in data provider" 2024-08-17 15:42:02 +00:00
Bartosz Dziewoński
0fdea6470d tests: Silence JsonBodyValidator deprecation warning in data provider
Follow-up to e93d7f0705.

Change-Id: I975b0dee68b712e1c82679b45b5be8d17703c856
2024-08-16 23:37:56 +02:00
jenkins-bot
550bd3c835 Merge "tests: Make use of upstream NullLogger in tests" 2024-08-16 19:09:32 +00:00
thiemowmde
e92544c8ea tests: Make use of upstream NullLogger in tests
No need to manually create a mock that doesn't do anything. There is
a convenient null implementation that behaves the same.

Change-Id: I1955f6f5941c852fcee84191baf57790c25bd2bf
2024-08-15 11:58:13 +02:00
thiemowmde
ba36bf46a1 tests: Make use of ??= and ?? operators in various tests
The main benefit is that this syntax avoids repeating the variable
name. It does the same as before.

Change-Id: I2040be889c749f4e2416ca9948ba261345858af2
2024-08-15 11:44:46 +02:00
James D. Forrester
bc662aec9b Move Language and friends into Language namespace
Bug: T353458
Change-Id: Id3202c0c4f4a2043bf97b7caee081acab684155c
2024-08-10 13:36:30 +02:00
jenkins-bot
22163e47a7 Merge "Add MediaWiki\Registration namespace to registration classes" 2024-08-10 11:33:27 +00:00
Ebrahim Byagowi
697e19e461 Add MediaWiki\Registration namespace to registration classes
Bug: T353458
Change-Id: Ifa3b6a6e0353bb4ce21a3f4456f1fc696c8d377c
2024-08-10 10:08:22 +00:00
James D. Forrester
f7ce0a0976 Move remaining four classes in includes/content into Content namespace
Bug: T353458
Change-Id: Ia0f3e22078550be410c4b87faf6aa4eabe6e270d
2024-08-10 10:40:53 +02:00
jenkins-bot
fe02025a50 Merge "deferred: pass $fname to MWCallableUpdate callbacks and improve comments" 2024-08-09 07:32:29 +00:00
jenkins-bot
1270ae1bab Merge "Hard-deprecate getBodyValidator" 2024-08-08 16:12:38 +00:00
Aaron Schulz
8454bf2314 deferred: pass $fname to MWCallableUpdate callbacks and improve comments
This is more convenient for callers since they can avoid the pattern
of setting $fname to __METHOD__ and needing $fname in the "use" clause.
This is also more consistent with AutoCommitUpdate/AtomicSectionUpdate.

Remove @since tags from @internal MWCallableUpdate class.

Change-Id: I67c58897dc366a55f43e0a61d56064b26d520c17
2024-08-08 15:50:00 +00:00
thiemowmde
52963bbcc0 tests: Make use of ?? and ??= operators in test code
I believe the more recent syntax is quite a bit more readable. The
most obvious benefit is that it allows for much less duplication.

Note this patch is intentionally only touching tests, so it can't
have any effect on production code.

Change-Id: Ibdde9e37edf80f0d3bb3cb9056bee5f7df8010ee
2024-08-08 15:51:20 +02:00
Ebrahim Byagowi
c586a7207c Add namespace to ContentModelChange
It adds MediaWiki\Content namespace to ContentModelChange

Bug: T353458
Change-Id: Ia9fbff3b7d25a83be58fffbfc01274c9fcc7a482
2024-08-08 11:14:45 +02:00
Ebrahim Byagowi
35867f0e21 Add namespace to FileContentHandler
It adds MediaWiki\Content namespace to FileContentHandler

Change-Id: I2db36de12a60c78524ea6ee2d8866ff901a48cac
2024-08-07 09:34:01 +03:30