* Allow for DI of config and PoolCounterConnectionManager.
* Manage the PoolCounterConnectionManager singleton without using
a global/static field.
* Allow for test overrides (in ParserOutputAccessTest) without needing
to bring all of ObjectFactory and 'factory' and thus exposing class
constructors to stable interface (except not really since the args
are hardcoded in practice).
Bug: T201223
Change-Id: I514fee20b388f04f9c85c5a1373845d621c65395
Introduce migrateRevisionCommentTemp which copies data from
revision_comment_temp to rev_comment_id. The code is similar to
migrateRevisionActorTemp.php.
Bug: T299954
Change-Id: I3140d7efb18d4dfda783831ecb1549262e4bdc32
Add a --no-session option to shell.php for easier manual
testing/debugging of code for which that flag is relevant.
Exempt from autoloading to avoid breaking ScopeStructureTest.
Change-Id: I97548c8fe76a833837b131a5cd5bd0006a5f7326
Mixing Handlers with Helpers doesn't look nice for consistency
reasons. Helpers should be in their own place (grouped) in the
Handlers directory as they're really "helpers for the handlers".
Change-Id: Ieeb7a0a706a4cb38778f312bfbfe781a1f366d14
This allows methods to be defined instead of global functions, which in
this case, were missing the "wf" prefix.
Change-Id: I2413675f46a29d914cb756071cd6abbcf38b500e
This maintenance script takes the page, target variant code, and
a username to compare the output from Parser to Parsoid.
To distinguish if Parsoid use the core LanguageConverter, added
a comment to the output.
Bug: T323303
Change-Id: Idab6ee7e6e832b9937e2bd6f1bf64027ad23b668
This patch introduces ParsoidParserCachePrewarm job
that is used to warm PC with parsoid outputs in order
to speed up page reads on large wikis.
Bug: T322427
Change-Id: Ib63a02d3cf5348b36f4f166ff6939f4d2e7fef6f
The script fixes a specific problem of a version which is long EOL
and from which we do not support any upgrade anymore.
Change-Id: Iab8589065e504ae479ffecf3158595a6c0e6c609
so that extensions (i.e. CheckUser) can implement their own comment
store without having a lot of code duplication
basically the comment store version of I3a6486532f2ef36
Bug: T233004
Change-Id: Ib40f99e00a514d41776ce521baf113e46d37e9cd
Convert these two old scripts to Maintenance subclasses.
* Uncomment the resolveStub() call in moveToExternal and fix one obvious
bug with it, i.e. the fact that stubs need to be resolved after CGZ
blobs are moved.
* Replace get_class() with instanceof.
* Make the "tiny text" threshold configurable. Normally this is not
wanted in WMF production since new revisions are written to ES
unconditionally.
* Add a dry run mode.
* Add an undo log.
* Add --skip-resolve option.
* Make resolveStub() be much more defensive about what it resolves.
* In moveToExternal, make compression optional and do it also for plain
text.
* Optionally convert the legacy encoding to UTF-8.
Bug: T299387
Change-Id: I52d54e3b6b785ac072796031be06499221340f51
This may seem a bit weird but anything else related to actor is already
under user/ including ActorCache, ActorNormalization, ActorStore and
ActorStoreFactory.
Bug: T321882
Change-Id: I7072b374bba7a0cd9d905e399c822bf30bd5c0d8
This introduces an interface HtmlOutputHelper that is implemented
by both HtmlMessageOutputHelper or HtmlOutputRendererHelper based
on the page we're dealing with.
Bug: T323558
Change-Id: I1fb8dcc5cc05ce3f32f3c1862b88045f1c8e612b
To follow Message. This is approved as part of RFC T166010.
Also namespace it but doing it properly with PSR-4 would require
namespacing every class under language/ and that will take some time.
Bug: T321882
Change-Id: I195cf4c67bd51410556c2dd1e33cc9c1033d5d18
The history page renders an extensible list of tools for each
change list row. I've factored this code out so that it
can also be used on other pages that use the Pager class.
This generalizes the logic for the rollback link and makes sure
the control is standardized across pages. It also allows
the onHistoryTools hook run. I suggest we rename this to something
more generic in a follow up.
Right now usages of onHistoryTools are low but there should be
no issues with running it on more than the history page. One of
the benefits of this is the thanks link will now show on the
contributions page, watchlist and recent changes.
Bug: T51541
Change-Id: Ia03038e86c6a607c8b75eefedbf0285ca1a2f8c8
Remove 'insertSelectIsSafe' option, unused.
Remove 'topologicalPrimaryConnRef' option, no longer used as of two
months ago with I41a57247503 (8c9398f7f9).
Remove unneeded DatabaseSqlite::getTopologyBasedServerId
implementation which can inherit null instead of overriding with string
of "0". Only caller is SqlBagOStuff::makeTimestampedModificationToken
which can be used as MainStash DB, where its important that a given
server always has the same unique name within a set of db hosts that
may replicate to each other. By inheriting null as topology server ID,
it SqlBagOStuff will use IDatabase::getServerName instead. That in turn
uses the 'host' connection parameter, which defaults to null in
DatabaseFactory, and then falls back to the string "unknown" which is
as good as "0" for this purpose.
Bug: T299691
Change-Id: Iceb65c28cdd3c4a89b3c8b34c3f95d3285718ec0
Code moved as-is from the extension repo with minor changes:
* Adopt PSR-4 namespace.
* Keep backward-compatibility with "PoolCounter_Client"
in LocalSettings, from before the extension was namespaced recently.
* Document how `connect_timeout` actually works, and that it
was introduced in MW 1.28 (via extension).
* Add stable interface annotations.
Bug: T201223
Change-Id: Iadec5b4b5d2fc7e76509c9be0a8fa605d95c64a7
We should slowly migrate page/ to have proper namespace too but that'll
be pretty big.
Bug: T321882
Change-Id: I3e57be8aa8ac08971f190233196e84ea33023d4a
It misrepresents the users contribution to show empty text for a
revision when in fact the revision contained some text which we later
lost.
Also, errors from SqlBlobStore::fetchBlobs() did not stop a cache entry
from being written, so a subsequent cache hit would show the bad
revision as empty.
So, in Storage:
* Add BadBlobException, which is thrown by the Storage layer to
indicate that a revision is marked as bad.
* Have SqlBlobStore::getBlobStore() return an error for bad blobs
instead of an empty string.
* Duplicate the check for flags=error into SqlBlobStore::expandBlob().
This avoids an unnecessary cache fetch, and avoids making
decompressData() throw on error, which would be a b/c break.
* In SqlBlobStore::getBlob(), suppress the cache when there was an
error.
In Revision:
* Add BadRevisionException, to wrap BadBlobException in the Revision
layer.
* Return null from RevisionRecord::getContent() on a broader set of
errors. Make it mostly non-throwing.
* Add RevisionRecord::getContentOrThrow() which returns a non-nullable
Content.
* Note that SlotRecord::getContent() returns a non-nullable Content so
now throws in more cases.
In the UI:
* In Article::view(), catch the exception and show an error message.
* In DifferenceEngine, catch the exception and make a suitable error
message available via getRevisionLoadErrors(). In the diff page, show
the error message in a box.
* In ApiComparePages and the legacy rvdiffto, show a warning.
* In RawAction, show a 404 by analogy with other error cases.
* In EditPage, there was already handling for $content=null with an
appropriate error message (missing-revision-content). But having
$this->textbox1 = null caused PHP 8.1 deprecation warnings, so I fixed
that.
* In EditPage undo, there was already handling for null content, but I
improved the error message: "does not exist or was deleted" seems more
appropriate than "conflicting intermediate edits".
Change-Id: Idd1278d6d756ef37d64addb7b5f3be30747ea603
* Share logic previously implemented for html/with formats through
a trait class
* source/bare formats doesn't execute a temporary redirect. the
JSON body will contain a key "redirect_target" instead if a wiki
redirect is found
* Introduce PageRedirectHandlerTest to test redirect logic shared
between multiple handlers
* Move Handler instatiation to HandlerTestTrait
* Update api-testing tests in Update.js
Change-Id: Id66e33e19adabdb3c9621eaea4a5d441f23edafd
* Add a safe unserialize() wrapper for HistoryBlob classes
* Add a safe unserialize() wrapper for plain array data as used for
compressed internal storage by ConcatenatedGzipHistoryBlob and
DiffHistoryBlob.
* Fix tests broken by this.
* Fix unnecessary call to uncompress(), __wakeup() does this already.
Was a phan error now that we have more information about the type of
$obj.
* Add tests for successful unserialize and wakeup of WMF production
data.
Change-Id: Ic995dda16d9c6045b33f2fdae7f6575ac8329976
None are used in WMF-deployed extensions and have been hard deprecated
for multiple releases as well.
Change-Id: I62cfa22291f81295b4908192de8657a750c6716d
Part one, none of these hooks are used in extensions deployed in
production. I skipped any hook that has silenced its deprecation
warnings.
Change-Id: Idf1fd12cc61ca30867dc9f8aeb1701fe035fc5ff
This branch fails to compile against PHP 7.4.3, our lowest supported
version, and will not be updated to support that or any newer version:
https://tideways.com/profiler/blog/releasing-new-tideways-xhprof-extension
In doing so, remove the Xhprof class. At this point, it doesn't do
anything other than calling either of two functions from whichever
extension is installed, which can just be done in ProfilerXhprof.
Change-Id: Iba1c16f47c68b36982f5d2dcda3bdf4dcb83501d
These three classes:
- TitleArray
- TitleArrayFromResult
- TitleFactory
We need to move these and the rest of files under title/ to Title/ (and
namespace them) but the patch will become way too big given that Title class is
also one of them.
Bug: T321882
Change-Id: Iac1688172ee457348a08a470c86e047571feb8e0
This allows extensions like VisualEditor to safely instantiate REST
helper objects. It also reduces the number of services that need to be
injected into REST handlers from route definitions.
Change-Id: I10af85b2da96568cfffd03867d1cb299645fb371
Remove workarounds for the lack of proper autoloading for aliased
parameter type declarations which was fixed in PHP 7.4.
Change-Id: Ic4485d06e7ad8d02859dc3e5c67867c4b084386f
This patch will implement a one-way transliterator (Latin->Cyrillic), per community consensus.
Bug: T268033
Change-Id: I6f3e7efe3630e9960584dca3a5ee55cb92ea722c
Co-Authored-By: Deni <deni@deni.dk>
Co-Authored-By: Winston Sung <winston21.sung@gmail.com>