The ::getProperty() naming is too generic and doesn't clearly indicate
that these are "page properties" (which have their own table in the DB).
As part of refactoring a clean API out of ParserOutput which can be used
by Parsoid, clean up the naming here.
Soft-deprecation in this patch, there are a handful of external users
which need to be cleaned up before we hard-deprecate.
Bug: T287216
Change-Id: Ie963eea5aa0f0e984ced7c4dfa0fd65d57313cfa
This does a breaking change, but all (2) known usages
of the LinksUpdate::getTriggeringUser are satisfied
by UserIdentity.
Change-Id: I682ee65f7b3d30fe6c0fe76d5106857ddfa6da5d
Use ObjectFactory specs for collation classes
Avoid the language construction in the factory class,
make it a detail of the implementation of each class
Follow-Up of Ifc96f851e6091ce834dbaf0e91695c648a42169c
Bug: T286079
Change-Id: Ib581f64aec8619986fb8dd49ceee0524d59a1b84
There is no lock to release since 6d315fb7f7. Static analysis
is not reporting this because it is allowed to pass an unset
variable by reference.
Change-Id: I819cf438fe074cbe06e103566f61adecee018c1e
No longer need to save more than one, which was previously
needed to be able to call User::setEditCountInternal(), but
that method has been removed.
It turns out we can't just rely on the user id alone, because
UserEditTracker requires a UserIdentity object and the name
of the user matters.
Follow-up: Ie3fb4887d9f2d96b32598865030351bf3bf20ce5
Change-Id: I4ba1300837cf2cf624c563d4445a2a7dc6b88d86
UserEditTracker now returns null for anonymous users
instead of throwing an exception.
Added new UserEditTracker::setCachedUserEditCount()
method (internal) to handle the user_editcount field
in User::loadFromRow()'s row. This now means that
the creation of one User object can set the cached
value for any other object for the same underlying user
- the alternative (just ignoring the value) would mean
that an extra database read might be needed. This is
only used for users created with a row that includes
the user id - we silently discard the value if
the row doesn't have a user id (or the user id is 0)
to avoid issues with UserEditTracker trying to fetch
the user id and potentially triggering another load.
A follow-up will simplify the UserEditCountUpdate class
to remove storing full UserIdentity objects now that
only the id is needed.
Follow-up: Ibf1482bcbcbf4d56fc06531bb3e17e2a6e3e2e6f
Change-Id: Ie3fb4887d9f2d96b32598865030351bf3bf20ce5
The original documentation was probably copied from somewhere else.
It never corresponded to what the method actually does.
Change-Id: I21491ec97cc24a36450466a090079f63402c8c1c
Doesn't cost anything to compute and include in logs, and would be
useful for understanding serial processing of DeferredUpdates
(basically, non-deferred deferred updates) in CI are slowing down
browser tests.
Bug: T225968
Change-Id: Id55bde5d8f4e465723d8db6df29b4c554fc1bc9c
- UserEditCountUpdate: accept UserIdentity instead of User
- Move User::incEditCount() to UserEditTracker
Change-Id: Ibf1482bcbcbf4d56fc06531bb3e17e2a6e3e2e6f
In all these cases the property is unconditionally set in
the constructor. The extra initialisation is effectively
dead code and an extra source of errors and confusion.
Change-Id: Icae13390d5ca5c14e2754f3be4eb956dd7f54ac4
This allows deferred update tasks to be constructed with a PageIdentity
rather than a Title instance.
Bug: T278459
Change-Id: Ifa2888fdef9ecc97f5bf09ae0b3fa7be48a0e9ef
LinksUpdate may encounter a non-existing page due to race conditions,
when the page has been deleted or renamed before the update is executed
or even created. We should log such incidents to detect anomalities,
but we should not crash hard.
Similarly, RefreshLinksJob should not attempt to run on a page that
no longer exists.
Bug: T281802
Change-Id: Ic73c3e339ff0478710bd57a9f707c1284dcce2d9
- EditPage::$mBaseRevision
- EditPage::getBaseRevision()
- Title::getFirstRevision()
- LinksUpdate::setRevision()
- LinksUpdate::getRevision()
- Article::$mRevision
- Article::getRevisionFetched()
- WikiPage::getOldestRevision()
- WikiPage::getRevision()
- ContribsPager::tryToCreateValidRevision()
To make things easier, instead of rewritting
the Revision tests that were using WikiPage::getRevision,
just delete them, its not worth the effort to rewrite
them since the class is going away. For the WikiPage
tests, replace uses of getRevision with getRevisionRecord,
manually converting to a Revision object where needed
Bug: T247143
Change-Id: I52bc1f49649f8bd25797e3f7a090bec9c63ac2d1
This logic is not needed to run on every PHP process and was making
it difficult to run offline maintenance scripts without additional
complexity based on Maintenance::getDbType and DB_NONE.
Instead of skipping this only for DB_NONE, and establishing a pattern
that may spread to other ad-hoc places throughout the codebase, instead
remove this entirely from the eager set up code for all PHP processes
and move it to the service wiring and dependency injection.
That way, it naturally doesn't happen until and unless the DB service
is actually called upon. Scripts and entry point that need to disable
the DB service, can continue to use
MediaWikiServices::disableStorageBackend.
== Impact on SiteStatsUpdate ==
With wgCommandLineMode no longer being read at run-time from a global,
but in service wiring, this means SiteStatsUpdateTest can't change
the behaviour between CLI-like and Web-like, unless it e.g. resets
the 'DBLoadBalancerFactory' service first. Unfortunately, while most
any reset is supported, a reset of the 'DBLoadBalancerFactory' would
be unsupported as that would lose the temporary db clone context and
such, bringing us to either the developer's live db, or a broken set
up altogether. If there is a strong need for toggling oppertunistic
updates off and on at run-time, this could be supported in the
DeferredUpdates class perhaps, but we already have numerous methods
there (incl db begin/commit being a good proxy already), which this
test already used, so for now I've just removed the extra assertion
for this as it wasn't essential to that test.
Bug: T228895
Bug: T238436
Change-Id: Icf29bc484c155f52b6d8f61e5902233a15ba0c6d
This introduces 2 new tags to track changes in media usage
across articles. These tags are both hidden & disabled by
default.
Bug: T266067
Change-Id: Ia230eadf7dcf6f52facab17b92293f25de38bb1c
In the commit that introduced ActorMigration, the ActiveUsers query was
modified to use RecentChange::getQueryInfo() instead of building the
query directly. Now that actor migration is complete in the
recentchanges table, we can revert that.
I also took the opportunity to migrate the query to SelectQueryBuilder.
Bug: T278917
Change-Id: I46f97081286185ecd28ab45fd66eb3d116873ec9
This is no longer useful. The schema update it supports
has been removed: patch-pp_sortkey.sql/(I76b4235)
Bug: T273978
Change-Id: Ida469a5401f98a028b7a69242105dc1595af3613
The intended word in all these cases was the adjective "dependent".
Whilst the "dependant" does exist, it is a noun and generally
refers to a person. The word is rare used in general, but
especially so in a technology context.
Change-Id: Ic7e2d2ea6a566f4139ff1fdb77f38b0e962ccd9c
This is micro-optimization of closure code to avoid binding the closure
to $this where it is not needed.
Created by I25a17fb22b6b669e817317a0f45051ae9c608208
Change-Id: I0ffc6200f6c6693d78a3151cb8cea7dce7c21653
Follows-up I4ed471c0b50a, which introduced the bug by copying code
from SquidPurgeClient but applied it to Curl, which works differently
from raw sockets.
The issue is that Curl returns the following when using just the path:
> curl: (3) URL using bad/illegal format or missing URL
Curl needs a full url, including host.
Change-Id: Id97b38ef9e0104a3034e5bd69f93d877e663576f
Follow-up ba6490aa1e.
That patch worked around $executeContext iteration errors due to the
lack of recursion support in doUpdates()/handleUpdateQueue(). Errors
were triggered by MediaWiki::schedulePostSendJobs() enqueueing deferred
updates that invoke JobRunner::run(), which, in turn, invoke doUpdates()
for each job via JobRunner:: doExecuteJob(). The doUpdates() method was
changed to operate on the sub-queue for the in-progress DeferrableUpdate.
Further improve the recursion logic:
* Use classes for the scope stack and scope queues.
* Put *all* updates added during a DeferrableUpdate::doUpdate() call into
the subqueue, regardless of "defer until" stage or whether it implements
MergeableUpdate. Now, doUpdate() can run *everything* it enqueued instead
of a non-obvious subset. Note that the TransactionRoundDefiningUpdate
that invokes JobRunner was already a POSTSEND update before ba6490aa1eb;
the only effect of this change is that MergeableUpdate instances from jobs
will once again run in doExecuteJob().
* Make recursive DeferredUpdates::doUpdate() calls error out immediately
unless the DeferrableUpdate responsible is a TransactionRoundAwareUpdate
with the TRX_ROUND_ABSENT flag. This covers the schedulePostSendJobs()
scenario and only prohibits insane call patterns. Failing early avoids
the risk of handleUpdateQueue() dropping all the updates due to the same
DBTransactionError error in DeferredUpdates::attemptUpdate().
* Avoid recursion loop in tryOpportunisticExecute() when JobQueueDB is in
use and a large number of tasks are pending. This happened due to methods
like onTransactionPreCommitOrIdle() being used within JobQueueDB.
Mark DeferredUpdates::doUpdates()/tryOpportunisticExecute() as @internal
and create a Maintenance::shutdown() method to avoid a direct call in the
doMaintenance.php file.
Bug: T249069
Bug: T268840
Change-Id: Ib369f0e74243a48ababdb9cd83b155c9a0f5e741