Move source code to includes/resourceloader to match
test case. This is part of ResourceLoader and not meant
to be used elsewhere.
Merge two similar test cases for getting blobs and fetching
messages which were doing the same thing.
Rewrite the test names to be a better reflection of the stories
they test, add comments for why, and re-order them to put related
tests together.
Move test-utilities to the bottom and make them actually private.
Change-Id: I7a437eebf3ba6a722e286dfe77c2f9fe49ad222f
The maintenance script was previously in a subdirectory which
is a bit unusual. It's now a regular maintenance script,
with the YAML file in a more discoverable place as well.
Change-Id: I38690f23dbe89839bee0e1d43ecfd68adeb19c0f
The Taggable interface defines how to tag objects in MediaWiki.
For now there are only two Taggable objects:
- RecentChange
- ManualLogEntries
This interface should be used in places where we want to optionally
tag things, for example:
We want to tag all mobile web actions with 'web mobile edit'.
With that interface, we will be able to expect a Taggable object,
and call `addTags()` when we need to, without having a special check
to verify is it RecentChange, or is it ManualLogEntry. We will only
expect a Taggable object.
Additionally, added @deprecated note to ManualLogEntries::setTags()
as each call to this method will override all previous tags. This
action can be harmfull to parts of code that conditionally add tags.
If object was tagged in some way, we should preserve those tags.
If there are any special cases, where we want to override all tags,
we should provide `resetTags()` method.
Bug: T215675
Change-Id: Ia4c019db8ca6f37ce0f86bf7d134d6f1713daf56
This seems to have been intended as optimization for SiteStore,
but was never used as far as I can tell. Instead, SiteStore is
already cached via LocalServerCache (APC).
Keep the FileBasedSiteLookup class for one release cycle in case
third parties not indexed by MediaWiki Codesearch are using it.
== History
* 2013: Report of high memcached usage by Wikibase via SiteStore.
* 2014: Lazy-load the data in Wikibase (d3f2e99cb6).
* 2014: Implement the file-based cache (via T47532 and 90f6efc360).
* 2015: Use local-server cache (APC), per T58602.
The file-based code was never used. The related task marked
invalid (T47532).
Change-Id: I8e2d9edcf3880149f824cc3de37793ca57435b49
Make DerivedPageDataUpdater bundle all the related DataUpdate tasks
on page change with a RefreshSecondaryDataUpdate wrapper. If one of
the DataUpdate tasks fails, then the entire bundle of updates can be
re-run in the form of enqueueing a RefreshLinksJob instance (these
jobs are idempotent). If several of the bundled tasks fail, it is easy
for DeferredUpdates to know that only one RefreshLinksJob should be
enqueued.
The goal is to make DataUpdate tasks more reliable and resilient.
Most of these deferred update failures are due to ephemeral problems
like lock contention. Since the job queue is already able to reliably
store and retry jobs, and the time that a regular web request can spend
in post-send is more limited, it makes the most sense to just enqueue
tasks as jobs if they fail post-send.
Make LinkUpdate no longer defined as enqueueable as RefreshLinksJob
since they are not very congruent (LinksUpdate only does some of the
work that RefreshLinksJob does). Only the wrapper, with the bundle of
DataUpdate instances, is congruent to RefreshLinksJob.
This change does not itself implement the enqueue-on-failure logic
in DeferredUpdates, but is merely a prerequisite.
Bug: T206288
Change-Id: I191103c1aeff4c9fedbf524ee387dad9bdf5fab8
Basically turning Mediawiki to MediaWiki as all other classes exist
in that namespace
Bug: T217128
Change-Id: I95039a1a54c9900a2f2414b5a6ccce5fb6e5e612
So far, everything we had was vulnerable to newest advances in
GPU cracking and timing side-channel attacks. Argon2 was designed
specifically to address these problems.
Unfortunately, PHP support is lagging, with some builds missing
Argon2id or even Argon2i.
Change-Id: Ifdf648f5d8a734a663e630286724a6d0a87c7510
This way it can be subclassed in extensions, like AbuseFilter
(Ic755526d5f989c4a66b1d37527cda235f61cb437).
Bug: T188180
Change-Id: Idf320232011c72e39267b1f3c39848aea35d37fe
For config vars, add a virtual package file called 'config.js', and use
require( './config.js' ) in the module. For most data modules, add a
virtual package file called 'data.js', use require( './data.js' ) in the
module. Where needed, add wrapper files that put the data in the
relevant global object and in module.exports.
LanguageDataModule is the only special-purpose module not being removed
in this commit, because it uses languageScripts, and those are not
compatible with packageFiles (yet).
Also merge mediawiki.ForeignStructuredUpload.config into
mediawiki.ForeignStructuredUpload, since that was the only thing that
used it.
Change-Id: I203d4e3ecdeeeb16729eba2dcf40d11a41d2e582
When a unit test fails it is possible, perhaps even likely in some
cases, that some code that was run logged useful information about
how that failure came to be.
Help people out, tell them what happened!
Change-Id: I30bbc31799a65024868678d052fec9aafacc1aff
The classes were renamed in 9bf39163, this updates the test cases to
match. Also take care of XCF while we're at it too.
Change-Id: Iaaeee93e496af6cdd610df5bc75302ecfe273f64
Provide backward compatibility for callback functions in
GuzzleHttpRequest, which was missing in T202110, and restore
GuzzleHttpRequest as the default provided by HttpRequestFactory.
Bug: T212175
Depends-On: I4b45e79d35252d13f714f3271b87301ca515121a
Change-Id: I60d1a034b44874f6d24a04058db264eeb565f5e1
* Introduce MSCompoundFileReader, which reads the CFB directory and
detects the file type from well-known names in the root directory
* Do not detect a ZIP file if the EOCDR is not at the end. Other
containers, especially CFB files, may contain ZIP files embedded
within them in the last 64KB, but this is not a security concern
unless the EOCDR is exactly at the end of the file.
Bug: T40432
Change-Id: Id5b1a258ccf3c3c8951e32f6b7a5b1bafe941082
This was originally directly under includes/htmlform. This is
a specific type of field, so it should go here instead.
Follows-up d0c31ac988.
Change-Id: Iac196068ce2cbca063948bc78d21913482717d9a
This code doesn’t use any MediaWiki-specific code, so rename
MediaWiki\Services to Wikimedia\Services and move it below libs/. (Of
course, this does not apply to the MediaWikiServices subclass.)
Class aliases are added to retain backwards compatibity for now.
Bug: T211608
Change-Id: Ic14ea28ef21c359695b309d4293dbaaf5deedc09