Commit graph

125345 commits

Author SHA1 Message Date
jenkins-bot
1a9b7eae2d Merge "MovePage::authorizeInternal: Replace call to deprecated Title::getTitleProtection()" 2024-07-10 12:52:30 +00:00
jenkins-bot
71285104f5 Merge "Add namespace to the root classes of ObjectCache" 2024-07-10 11:58:53 +00:00
jenkins-bot
3fc5ec3616 Merge "RecentChange: Replace use of legacy error arrays" 2024-07-10 11:40:11 +00:00
jenkins-bot
14229042e5 Merge "Replace some uses of deprecated PermissionManager::getPermissionErrors()" 2024-07-10 11:02:29 +00:00
jenkins-bot
21a02db4d0 Merge "specials: Use StatusValue::getMessages() instead of deprecated methods" 2024-07-10 11:00:55 +00:00
James D. Forrester
fb27ab830d Make Title::getPageViewLanguage() emit deprecation warnings
Already unused in production code(?).

Follows-Up: Ib130a055e46764544af0f1a46d2bc2b3a7ee85b7
Change-Id: I70932dd45812fd1a52ade92b21d78d8007a7d4fb
2024-07-10 11:57:11 +01:00
James D. Forrester
c522252185 Hard-deprecate Title::flushRestrictions
Change-Id: Icd91ba2c89ad10603ba9f670527a79df0810b1c9
2024-07-10 11:53:47 +01:00
James D. Forrester
cce1b62246 Hard-deprecate Title::loadRestrictions
Change-Id: I3b5340354076033ef436f757c63a8b81f4bb8ed1
2024-07-10 11:53:47 +01:00
James D. Forrester
cea63aaf52 Hard-deprecate Title::getTitleProtection
Change-Id: I2bfbf428e67263eb4809e33cb78ef5f8bc0273e2
2024-07-10 11:48:35 +01:00
James D. Forrester
24740eb329 MovePage::authorizeInternal: Replace call to deprecated Title::getTitleProtection()
Change-Id: I530cd1917512031b6001155d00d7b31d05a71287
2024-07-10 11:48:35 +01:00
Bartosz Dziewoński
a817bbaede specials: Use StatusValue::getMessages() instead of deprecated methods
A few easy-ish cases in various special pages.

Change-Id: If3f6bcf1825452c7241b5b059c96c8882cf223bc
2024-07-10 10:32:14 +00:00
Bartosz Dziewoński
ad1e36d6f6 SpecialMovePage: Replace use of legacy error arrays
* Replace Status::getErrorsArray() with StatusValue::getMessages()
* Replace PermissionManager::getPermissionErrors()
  with PermissionManager::getPermissionStatus()
* Replace other error arrays with StatusValue objects

Change-Id: Ieaa7efb060430ca3aad8941e7d4d525f63efd95e
2024-07-10 11:31:05 +01:00
thiemowmde
4bd95cd96b Use MainConfigNames constants in tests where possible
I believe this makes the code less brittle, and also makes it a bit
more obvious what these strings are meant to represent.

Change-Id: Ia39b5c80af4b495931d0a68fd091b783645dd709
2024-07-10 10:11:22 +00:00
Lucas Werkmeister
d19f2543c1 Update expected test output after i18n change
The Arabic translation of red-link-title was modified again in change
Id00b720194 (commit 30c622c091), requiring another fix mirroring change
I8f2930802a (commit 6cbd9e5263).

Test with:

    composer phpunit -- --testsuite parsertests --filter=T236183

Bug: T369694
Change-Id: I19090fe523e0a5c17bc1c30ee31edce24f541e6b
Follows-Up: Id00b720194d3a715050cbce55e40ca11b34212ce
2024-07-10 11:38:39 +02:00
Kosta Harlan
405cb9cad9
api-testing/REST/Creation.js: Reset REST client before each test run
Why:

- We need a clear state for each test run, because anonymous editing
  with temp accounts results in a temporary acocunt being generated, and
  the anonymous token is no longer valid.

What:

- Set a new REST client so that we have a clear cookie state before
  running a test

Bug: T365647
Change-Id: I79666ff92de090e69d32f1152ba330cf913e64e2
2024-07-10 10:24:27 +02:00
Arthur Taylor
1e2851d8d1 Add phpunit:prepare-parallel:extensions command
In T361190 and Quibble 1.9.0, we introduced parallel execution of
PHPUnit tests to speed up the CI jobs. The existing implementation
is purely Python/Quibble, and cannot directly be used by developers
locally. With this patch, we re-implement the test splitting logic
already implemented in CI as a composer task so that the parallel
tests can be run locally.

There are a couple of different approaches to running PHPUnit tests
in parallel. The different approaches have been discussed at length
in T50217. Ideally, we would just install the `paratest` extension
and use that to parallelise the execution. Unfortunately we have
complex test suites (specifically Parser tests and the Scribunto
test suite) that dynamically create tests as they run, which makes
it hard for `paratest` to work out which tests will run.

To overcome this limitation, we use the `phpunit --list-tests`
function to create a list of test classes that would be included in
the execution of the test suite, then scan the filesystem for
classes named in the `tests-list.xml` output. The classes we find
are then collected into smaller groups (`split_group_X`) which we
can run in parallel in separate processes.

We split into 7-8 groups here, as that experimentally leads to an
even spread of the tests and consumes 100% of all cores on a 4-core
processor.

Because `ParserIntegrationTest.php` is a single test class that
generates thousands of integration tests, we put that in its own
bucket rather than allocating it round-robin to one of the split
buckets. This again helps to keep the buckets roughly the same size.

The current implementation only supports splitting the `extensions`
test suite. We need to do some more development and testing to
support splitting other suites.

The new composer command `phpunit:prepare-parallel:extensions` will
generate a `phpunit.xml` file with the same contents as
`phpunit.xml.dist`, but with the split-group suites added. The
result of running all of the split groups should be the same as the
result of running the whole test suite.

Bug: T365976
Change-Id: I2d841ab236c5367961603bb526319053551bec2e
2024-07-10 07:59:23 +00:00
Translation updater bot
30c622c091
Localisation updates from https://translatewiki.net.
Change-Id: Id00b720194d3a715050cbce55e40ca11b34212ce
2024-07-10 09:04:15 +02:00
jenkins-bot
c3f8d61ed0 Merge "Add temporary account case for page history count" 2024-07-10 06:51:07 +00:00
jenkins-bot
bf1fb532c7 Merge "Add a MessagesTrw.php file" 2024-07-10 04:18:59 +00:00
jenkins-bot
585901a35c Merge "SkinModule: Always pass language code to get logos" 2024-07-10 00:48:56 +00:00
Daimona Eaytoy
817dee64b4 Make PageUpdater accept PageIdentity
Internally it still uses WikiPage. While this change shouldn't have any
effect in theory, this is not guaranteed because WikiPage is not
stateless and if different parts of the code use different instances we
may see unexpected errors. Hence, this patch is limited to the bare
minimum so that it's easier to revert if necessary.

Change-Id: I2c18a62ccc04720a2ef25298515850e91fb288e9
2024-07-10 01:32:21 +02:00
Daimona Eaytoy
6469955810 Replace User, Title, and WikiPage in more signatures
Change-Id: I04e408e734edc5498c32c4433f02da613bbfafa6
2024-07-10 01:25:57 +02:00
Daimona Eaytoy
52c8f1ec94 Remove Title and User from signatures
Replace them with PageIdentity/LinkTarget and UserIdentity. These
changes should all be backwards-compatible.

Change-Id: I94c38f584ea6b75c5fcfb0f8f2f6c34bca29ff3d
2024-07-10 01:16:01 +02:00
Daimona Eaytoy
1a12ea930b includes: Replace usages of deprecated WikiPage::doDeleteArticleReal
Change-Id: Icdf1b25f2f5202e4f1f83bbea5b6436ccbb7f3b5
2024-07-10 00:11:18 +02:00
Bartosz Dziewoński
252bacff34 RecentChange: Replace use of legacy error arrays
Replace uses of soon-to-be-deprecated methods:
* ApiBase::errorArrayToStatus
* PermissionStatus::toLegacyErrorArray

Deprecate and replace uses of:
* RecentChange::doMarkPatrolled

Change-Id: I2311d1fa3772ba6be378ad6f497ed4c0df9b7aa8
2024-07-09 21:48:34 +00:00
Ebrahim Byagowi
fab78547ad Add namespace to the root classes of ObjectCache
And deprecated aliases for the the no namespaced classes.

ReplicatedBagOStuff that already is deprecated isn't moved.

Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
2024-07-10 00:14:54 +03:30
jenkins-bot
e299707c98 Merge "ApiFormatTestBase: Fix test failures with extensions" 2024-07-09 20:38:36 +00:00
Umherirrender
41439e607f permissions: Use UserIdentityLookup in PermissionManager
Replace UserCache with UserIdentityLookup
UserIdentityLookup is implemented by ActorStore and
there is already a cache

Change-Id: I8a59e77391da45d2726aab3d5432f08ad0c9a84f
2024-07-09 19:57:40 +00:00
jenkins-bot
4450407a66 Merge "Minor clarity improvement in mw.widgets.MediaSearchWidget" 2024-07-09 19:42:21 +00:00
jenkins-bot
be39c1696d Merge "filerepo: Document guaranteed sort order for File::getHistory" 2024-07-09 17:32:49 +00:00
Ebrahim Byagowi
3a7539bad0 Minor clarity improvement in mw.widgets.MediaSearchWidget
Following I03b26af0ee9b425a7d6b17bfda7bf61f5aacc657 now I think
this can be a more clear version.

Change-Id: I07694711e093fc70a5550dfc8deec867d6104a7c
2024-07-09 21:02:12 +03:30
jenkins-bot
54fbe3a3cc Merge "Turn mw.widgets.MediaSearchWidget to LESS" 2024-07-09 15:44:27 +00:00
jenkins-bot
814f1bda11 Merge "Use LESS more effectively in mw.widgets.MediaResultWidget" 2024-07-09 15:40:26 +00:00
jenkins-bot
0985ed781c Merge "mediawiki.specialblock: Select to block last IP by default" 2024-07-09 12:36:12 +00:00
Ebrahim Byagowi
62284fb61c Use LESS more effectively in mw.widgets.MediaResultWidget
Just as an cleanup

Change-Id: I0b5d03447b53c4b432a06a353d24a01afbd82deb
2024-07-09 15:58:07 +03:30
STran
9d1f0813a9 Add temporary account case for page history count
Edits made by temporary accounts could not be counted independently
when accessing `v1/page/Test2/history/counts/{type}`.

- Add a `temporary` case for page history revision counts.

Bug: T365673
Change-Id: Ib5279684e2843c84a56eea04721dc62700c12577
2024-07-09 05:12:11 -07:00
Ebrahim Byagowi
e469e79fd4 Turn mw.widgets.MediaSearchWidget to LESS
Change-Id: I03b26af0ee9b425a7d6b17bfda7bf61f5aacc657
2024-07-09 15:38:45 +03:30
Translation updater bot
839e38173c
Localisation updates from https://translatewiki.net.
Change-Id: I580366e9838482844f1db700dc3337daba6b1cef
2024-07-09 09:07:50 +02:00
Amir E. Aharoni
96c23fe7ba Add a MessagesTrw.php file
Minimal support for this language to
allow right to left reading and writing.
Similar to MessagesPhr.php.

Bug: T369578
Change-Id: I977c8aa3964ef0d04afda46ab29609d0c7ce5594
2024-07-08 19:52:02 -04:00
jenkins-bot
8eaf4e5fda Merge "Use ES6 const/let in mediawiki.action.edit.editWarning" 2024-07-08 22:54:26 +00:00
jenkins-bot
d3d8f0787d Merge "Use more modern JS syntax in mediawiki.action.protect" 2024-07-08 22:54:19 +00:00
jenkins-bot
8465c74fc0 Merge "Turn mediawiki.widgets.Table styles from CSS to LESS" 2024-07-08 22:49:31 +00:00
jenkins-bot
d6e95491c2 Merge "Turn mw.widgets.SelectWithInputWidget.base from CSS to LESS" 2024-07-08 22:44:48 +00:00
jenkins-bot
c5771c9c30 Merge "AuthManager: Read from primary in account autocreation" 2024-07-08 19:43:33 +00:00
jenkins-bot
b3ecbf29ec Merge "REST: Enable strict type validation in JSON request bodies" 2024-07-08 19:29:52 +00:00
Kosta Harlan
742fd566bf AuthManager: Read from primary in account autocreation
Why:

- User::loadFromId must avoid doing a replica read when the newly
  autocreated user record isn't replicated yet; that would turn $user
  into an anonymous user object, and eventually log the user out.
  The old code tried to avoid this by using the same recency flag
  for which UserIdentityLookup::getUserIdentityByName() returned a
  non-anonymous user identity, but that's not actually a guarantee
  that the user is in the database, because getUserIdentityByName()
  has an internal in-process cache.
- For a specific example of this, Icf6be65a91437aa32684769c2858 broke
  temp account autocreation because inserting the log entry triggered
  ActorNormalization::acquireActorId() which set the in-process cache.
  With this patch applied, temp account autocreation will work again
  on wikis with database replication setup.

What:

- Use READ_LATEST flag when loading a user in an account
  autocreation context
- See also I5456f88ebb78d2fcac685efd4a1f7a9f60d2bc0e for a proposed
  follow-up to this patch

Bug: T369372
Change-Id: I04932d84aa0b0b5939706f3905f0fe7700d81327
2024-07-08 19:18:29 +00:00
Ebrahim Byagowi
423d222ea5 Turn mediawiki.widgets.Table styles from CSS to LESS
They have repetition of selectors which can be improved using LESS.

Change-Id: I78971a0040c8986b71b0cec5044a489fd18fb8b2
2024-07-08 22:17:23 +03:30
jenkins-bot
6d58c6b43a Merge "Replace some uses of raw SQL with expression builder" 2024-07-08 18:18:06 +00:00
Ebrahim Byagowi
9d93e4faf5 Turn mw.widgets.SelectWithInputWidget.base from CSS to LESS
The repeated selectors the file has benefits from LESS.

Change-Id: Ie374e46434f423666321f9251d027e522c3b2604
2024-07-08 21:45:57 +03:30
Func
382f8c34a2 SkinModule: Always pass language code to get logos
Bug: T369537
Change-Id: I0f71cb839e23e8989cec72fef6f643ed4408839a
2024-07-09 02:12:02 +08:00