* Replace Status::getErrorsArray() with StatusValue::getMessages()
* Replace PermissionManager::getPermissionErrors()
with PermissionManager::getPermissionStatus()
* Replace other error arrays with StatusValue objects
Change-Id: Ieaa7efb060430ca3aad8941e7d4d525f63efd95e
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
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
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
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
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
Replace them with PageIdentity/LinkTarget and UserIdentity. These
changes should all be backwards-compatible.
Change-Id: I94c38f584ea6b75c5fcfb0f8f2f6c34bca29ff3d
And deprecated aliases for the the no namespaced classes.
ReplicatedBagOStuff that already is deprecated isn't moved.
Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
Replace UserCache with UserIdentityLookup
UserIdentityLookup is implemented by ActorStore and
there is already a cache
Change-Id: I8a59e77391da45d2726aab3d5432f08ad0c9a84f
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
Minimal support for this language to
allow right to left reading and writing.
Similar to MessagesPhr.php.
Bug: T369578
Change-Id: I977c8aa3964ef0d04afda46ab29609d0c7ce5594
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