| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: I0d8d2237500ed6f18439410c902d47c42e4119bc
|
|
|
|
|
|
|
|
|
| |
In MediaWiki/Exception, to follow PSR-4 per plural vs. singular (this can be
changed later if people really care). Also, move the couple of exceptions in
here that were already namespaced in the MW-top-level into the new space.
Bug: T353458
Change-Id: I12ed850ae99effb699a6d7ada173f54e72f0570e
|
|
|
|
|
| |
Bug: T353458
Change-Id: I2ae4577de79832b082adca282ff73cfabc8f9392
|
|
|
|
|
| |
Bug: T353458
Change-Id: I7a9c74f2106655d41ae029742090253f541bd4a6
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Move duplicate brief and ingroup from file doc to class doc.
<https://gerrit.wikimedia.org/r/q/message:ingroup+owner:Krinkle>
* Ensure methods have an understable brief, separate from other text.
<https://www.mediawiki.org/wiki/Manual:Coding_conventions/Documentation>
* Remove obsolete `todo` comments.
Bug: T364652
Change-Id: I6eebbf20775e73d008ef86c592a7128456abcb06
|
|\ |
|
| |
| |
| |
| |
| |
| | |
No point doing array_merge() when the LHS is an empty array
Change-Id: Iaffe7cc11c65d9616b27e1afcf76004ae18aa426
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Why:
- When a transaction lifecycle callback such as
onTransactionPreCommitOrIdle() is invoked by rdbms, rdbms passes in
the DB connection handle the callback was scheduled on.
- However, the DB connection handle may have since been reset to a
different DB domain on the same physical cluster due to connection
reuse.
- We could implement bookkeeping to keep track of the expected DB domain
for each pending callback and ensure the passed-in DB handle matches
that before invoking the callback, but nobody seems to be making use
of the passed-in DB handle except for two call sites in core.
- As such, it seems more prudent to remove this functionality.
What:
- Update the only places that use the DB handle passed to transaction
lifecycle callbacks to not use it.
Bug: T386190
Change-Id: If682ec26d3599add9dbe06c7a386c95162b5184a
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Why:
- The title information stored in archived revisions may not represent a
valid title by current standards. This will cause Title::isValid() to
return false, which makes Title::canExist() return false, which causes
the constructor of RevisionArchiveRecord to throw an assertion error.
What:
- Use a PageIdentityValue to represent the page the archived revision
belongs to. PageIdentityValue doesn't perform validation or
normalization, so it is unaffected by changes to configuration.
Bug: T384628
Change-Id: I4cc1dabd9c7aee94e191f75addd44327788a5d13
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Use modern php syntax to call a callable.
Reduce the stack trace to improve performance
and better IDE and static analyzer support
Change-Id: I9ef131032a662a3b8db69aa7079dbd51f88f575a
|
| |/
|/|
| |
| |
| | |
Bug: T386162
Change-Id: Ie28653de99ea8b87f52b0e6ccae8179efb797a08
|
|/
|
|
|
|
|
|
|
|
|
|
| |
is_object is very rarely what we actually need. In many cases we know
exactly what the object can be, and should check for that specific
class or for null.
A database row is an instance of stdClass. Checking that with
is_object also works but is less correct and would allow stuff we
cannot accept in these places.
Change-Id: I1dc663d7325cabc059ef11c4845b0189208e907f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Same as Ia294bf4 did for 1-line comments. This patch removes slightly
more complex 2-line PHPDoc comments that don't add any new information
to the code, but literally repeat what the code already says.
They say "don't document the code, code the documentation", and we
are doing this more and more. We just tend to forget to remove the
obsolete comments.
Note I'm also removing a line of text in a few cases when it's very
short and literally says the same as the method name. Again, such
comments add zero new information.
Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I assume these are all either auto-generated by an IDE or the
language-level type declarations have been added later. In any case
the comments don't add any new information to what the code already
says. This is just extra clutter that makes the code harder to read,
I would argue.
There are many, many more comments like this. In this patch I
intentionally focus on the most trivial 1-line comments.
Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- Non-existing pages can't have revisions.
- If we look up a first revision during a page move, we may
wrongly get revisions of another page, due to a stale replica or
snapshot.
- Ideally, we'd avoid the staleness, instead of using this
work-around.
What:
- make getFirstRevision() return null if the page doesn't exist.
Bug: T380677
Change-Id: I009aef656ccb7eb142a6338a4d17597bcd5ca7f3
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
RevisionRecord::getPage() returns a PageIdentity, which may
be a Title or a WikiPage. In the context of an ongoing page deletion,
the state of these objects may change and the page ID may get set to 0.
To provide a reliable stable interface that can be used e.g. in a
deferred update or job, we need to return an immutable value object
instead.
NOTE: this may break callers of getPage() that downcast to Title,
or that rely on the page ID contained in the returned PageIdentity
to be updated dynamically during page creation or deletion.
This is a modified version of I7440f8f30b05949. It reverts I4ed5406a8b3aa9, which reverted the original patch. The main difference
to the original patch is the additional check in the constructor of the
RevisionRecord base class and the regression test in SignatureValidatorTest.
Bug: T380536
Change-Id: I0ea915983b6187090f46ad23c9b582196b4be85f
|
|/
|
|
|
|
|
|
|
| |
isset() should only be used to suppress errors, not for null check.
When the property is always defined, there is no need to use isset.
Found by a new phan plugin (2efea9f989)
https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#isset
Change-Id: Ia53b71dff3299837856ae3c004cd0227bd45e05b
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 1e7a520f1f42770f7eaeb4369805b427efa32634.
Reason for revert: Given end-of-year timeline and last train of the year,
it is more feasible to chase down the issues in 2025 and reapply this patch then.
Bug: T381982
Change-Id: I4ed5406a8b3aa9c038544bfac9ea361550b2c72f
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Ice76519 we lost the mechanism for triggering updates for the search
index and message cache on import and undeletion. This change restores
the trigger for these updates.
To achieve this, the logic for instantiating PageUpdatedEvents is moved
into DerivedPageDataUpdater. Perhaps the firing of the event can be
moved into that class eventually.
To improve consistency, the flags field in PageUpdatedEvent is changed
from a bitmap corresponding to the flags field in PageUpdater to an
array corresponding to the options array in DerivedPageDataUpdater.
For regression testing, this change defines new test traits, one for
each ingress. These traits define the expected behavior of each ingress
in each relevant situation (edit, move, import, and undeletion).
Bug: T381225
Bug: T381299
Change-Id: Ib0d1dd143160fb64d42cacfbc75fbb55f5614c1c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RevisionRecord::getPage() currently returns a PageIdentity, which may
be a Title or a WikiPage. In the context of an ongoing page deletion,
the state of these objects may change and the page ID may get set to 0.
To provide a reliable stable interface that can be used e.g. in a
deferred update or job, we need to return an immutable value object
instead.
NOTE: this may break callers of getPage() that downcast to Title,
or that rely on the page ID contained in the returned PageIdentity
to be updated dynamically during page creation or deletion.
Bug: T380536
Change-Id: I7440f8f30b05949842903094908232455f6a2239
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When accessing slot content and meta-data, most code wants to only
access the main slot. Add convenience methods for making this less
awkward.
Originally, the intent was for all code to support arbitrary slots. This
hasn't happened, instead we spread SlotREcord::MAIN all over the code
base. It seems better to adjust the interface of RevisionRecord to
reality.
Change-Id: I8603f95c8e39d6fc3522a47f74657798e7f7c061
|
|
|
|
|
|
|
|
|
|
|
| |
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead
Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a
Break one long line in SpecialPage.php
Bug: T376276
Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
|
|
|
|
|
| |
Bug: T353458
Change-Id: If02cc9b1ff78e26c1cf8c91ee4695845eb133829
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Also add @throws documentation, when the exception needs check by caller
Bug: T108495
Change-Id: I2c98381d9c3a639a71e6a8f8f8a5db6f98bcb073
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| | |
Bug: T353458
Change-Id: I3b736346550953e3b2977c14dc3eb10edc07cf97
|
|/
|
|
|
| |
Bug: T183490
Change-Id: I08e35ee64eab081de85ed8745361ebc4c9025d91
|
|
|
|
|
| |
Bug: T353458
Change-Id: I23cf7991f8792d4d000d1780463d8ce76dc0aee0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Callers should not catch an unchecked exception, so it doesn't belong
in a function signature. Unchecked exceptions indicate a coding error,
which by definition the code will not be able to handle correctly.
If any of these exceptions were supposed to be in response to an edge
case, user input, or initial conditions, then they should be changed
to a runtime error. If the exception class cannot be changed, then
the annotation should include a comment explaining its purpose and
prognosis.
Bug: T240672
Change-Id: I2e640b9737cb68090a8e1cb70067d1b74037d647
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch lays the groundwork for incremental/selective parsing in
Parsoid by ensuring that we can pass previous cached parses through
the parse pipeline to Parsoid. We do this by adding a new render
hint type, `previous-output`, and ensuring it is passed along.
Because revisions can contain a ParserOutput which is the combination
of separate ParserOutput objects for each of their slots, RenderedRevision
also contains a method to unsplit the combined ParserOutput to reconstruct
an original ParserOutput for use in incremental parsing. Currently this
is mostly a stub, but illustrates how slot combination and splitting can
work, assuming those transformations are reversible.
Extra calls to ParserCache::getDirty() are added to some code paths
in order to ensure that any previously-cached ParserOutput is available
for selective update. In order to mitigate any performance concerns,
these are only done for the Parsoid parser at the moment. Future
patches will add additional metrics to quantify the cost/benefit ratio
of the additional cache lookups on these paths.
Bug: T363421
Bug: T371713
Change-Id: I440884f1d7e09c1ff9806f848b7b53a636367690
|
|
|
|
|
| |
Bug: T353458
Change-Id: Ia0f3e22078550be410c4b87faf6aa4eabe6e270d
|
|
|
|
|
| |
Bug: T361023
Change-Id: Ibf1c93ddbf8f680e8fb9442816f6fed94a069c0a
|
|
|
|
|
|
|
|
|
| |
And deprecated aliases for the the no namespaced classes.
ReplicatedBagOStuff that already is deprecated isn't moved.
Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
|
|
|
|
|
| |
Bug: T49177
Change-Id: I33de62ce7447659c680562b8b9994511b29c41fd
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit replaces some of the uses of getErrorsArray(),
getWarningsArray(), getErrorsByType(), and getErrors().
In many cases the code becomes shorter and clearer.
Follow-up to Ibc4ce11594cf36ce7b2495d2636ee080d3443b04.
Change-Id: Id0ebeac26ae62231edb48458dbd2e13ddcbd0a9e
|
| |
| |
| |
| |
| |
| | |
Use narrow interface if no writes are done
Change-Id: I55148c8b6fda8830a29a235c63fc118f636ab3e6
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
This adds MediaWiki\Content namespace to FallbackContent
and FallbackContentHandler and declares the unnamespaced version
as deprecated since version 1.43.
Bug: T353458
Change-Id: I3ee80aea379788b71539cc1c7a4ec216b753e042
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* When wgAutoCreateTempUser['enabled'] is true, calling ActorStore
::acquireActorId for an IP address user will throw a
CannotCreateActorException to prevent attributing actions to IP
addresses.
* When using Special:Undelete to undelete a page that has IP
addresses who have made edits, the UndeletePage call to the
ActorStore::acquireActorId causes an exception.
* However, the revisions already existed so (similar to importing
revisions) it does not represent a leak of the IP address.
* As such, it should be possible to undelete a page with revisions
performed by IP addresses.
What:
* Add ActorStore::getActorStoreForUndelete which works the same
as ActorStore::getActorStoreForImport. Having methods that
are named for undelete / import avoids the usage for other
code that should use ::getActorStore instead.
* Add RevisionStoreFactory::getRevisionStoreForUndelete which
uses the ActorStore returned by ActorStore
::getActorStoreForUndelete.
* Update the PageCommandFactory to take the RevisionStoreFactory
and then call ::getRevisionStore for all but UndeletePage where
the ::getRevisionStoreForUndelete method is called.
Bug: T362019
Bug: T365669
Change-Id: Ia7c583c625843f4f400e1c4aa7ea360519e63c87
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is using SelectQueryBuilder::queryInfo to interact with legacy code
In the long term this needs refactor to get a SelectQueryBuilder from
the class instead of a query info array.
Bug: T344971
Depends-On: I5dff80a2819bba4e923654ef31816a54269354b3
Change-Id: Ibf44e7de30e71fe8dd6447f77dfd0bf726be0a9b
|
|/
|
|
| |
Change-Id: Ib9851907b00e0fcc94fb568380f5deda76713a42
|
|
|
|
|
| |
Bug: T344971
Change-Id: I2db52adebc930cb5621e75a125af80cfa7926a2b
|
|
|
|
|
|
|
| |
With this and soon T360517 be done, we can hard-deprecate this method.
Bug: T354194
Change-Id: Idad6ae65527fdb15ddd46cc41060726e3132620f
|