Commit graph

110264 commits

Author SHA1 Message Date
Amir Sarabadani
278c3dd230 ViewAction: Enable unconditional 1h hour CDN cache for any page views
Currently, MediaWiki avoids CDN caching if the URL is not among the list
of canonical URLs that we purge, which can cause all sorts of issues
including caching being extremely narrow.

ViewAction is cache invariant and better to be cached unconditionally.

This effectively undoes part of Ie38ae198b1735339371 (2012). Similar
to the existing setCdnMaxage() calls, this is not expected to risk
caching of private information given that a separate layer is
responsible for deciding whether caching is "safe" from an application
point of view. Callint setCdnMaxage() does not affect whether CDN
caching is allowed, its just that the default maxage is 0 for cases
where it is safe, and this change effectively raises it to 1h for
arbitrary URLs that effectively route to action=view, including e.g.
diff URLs and oldid URLs, but e.g. not any other action parameters.

Bug: T309063
Change-Id: I468caa8fd4baf650b419572b77b3df64ae72780d
2022-05-30 18:16:26 +00:00
jenkins-bot
54a77f0f7c Merge "Rest: Collect stats on Cache & Stash usage" 2022-05-30 15:21:10 +00:00
jenkins-bot
3a436a8f1f Merge "Localisation updates from https://translatewiki.net." 2022-05-30 14:04:22 +00:00
jenkins-bot
98882c31b2 Merge "SessionManage: Do not save when creating empty session" 2022-05-30 12:54:06 +00:00
Gergő Tisza
1682de5e83 SessionManage: Do not save when creating empty session
SessionBackend::save() results in the session provider unpersisting
when the session backend metadata is dirty (which is always true
for a new session). This breaks the tombstone mechanism introduced
in I3a76b67aa51159ebf0195db15cf7c34e00a64a2e: after the manager
refuses to load the tombstoned session, it will create an empty
session, and that will unpersist the session ID and log the user
out if the session ID was the only thing that kept them logged in.

Saving the session has two effects: the unpersisting (invalid
cookies are cleaned up) and saving the session data in in-process
cache (but not the real storage). The latter might cause an extra
session storage read per unauthenticated request, though in theory
it shouldn't as the SessionBackend itself gets cached so a new
session lookup only happens for a different WebRequest object.
Still, if it becomes a problem, we can just add some sort of
explicit cache warming step to empty session creation.

Skipping the unpersisting could mean that invalid (e.g. expired)
session cookies stick around and prevent the user from being
served from edge cache. But for non-tombstoned requests, as long
as there is a syntactically valid session ID and either no user
ID or a user ID pointing to a valid user, CookieSessionProvider
will return a non-null session info, and SessionManager will
reject it and unpersist; and CentralAuthSessionProvider behaves
similarly except for the case when there is no local session
cookie but there is a global session cookie on the second-level
domain. That seems a narrow enough edge case to ignore.

Bug: T299193
Change-Id: Ib34a84d1d3abbce4dcf7433b51abf6e694984c59
2022-05-30 12:32:47 +00:00
jenkins-bot
ef7956d7ea Merge "resourceloader: Improve internal type hints in FileModule class" 2022-05-30 11:23:40 +00:00
Derick Alangi
141b42c7ca Rest: Collect stats on Cache & Stash usage
As a means of understanding the usage of the stash FEAT for
/page/html & /revision/html endpoints used by VE extension,
this patch introduces the collection of stats using the
StatsDataFactory.

Bug: T309017
Change-Id: I4e17d50e79da263637bdd55ab62e993df441fe38
2022-05-30 09:51:55 +01:00
jenkins-bot
e46d36c658 Merge "Update Breton messages." 2022-05-30 08:00:07 +00:00
Translation updater bot
d2585a0fec Localisation updates from https://translatewiki.net.
Change-Id: I2356e57e88b2f97a219883f1667e3e6648da3ffa
2022-05-30 09:07:50 +02:00
jenkins-bot
9f5aeeb3ed Merge "mailmap: Update Zabe's entry" 2022-05-30 04:15:09 +00:00
jenkins-bot
551808d9eb Merge "objectcache: handle object tokens in MediumSpecificBagOStuff::doCas()" 2022-05-29 23:54:19 +00:00
Alexander Vorwerk
a5aa408ad2 mailmap: Update Zabe's entry
Change-Id: Ia0caa257c3597d781ccd1d2fff9b42ecaabe7e37
2022-05-29 23:52:32 +02:00
Timo Tijhof
85892edce5 resourceloader: Minor doc changes following PSR-4 namepace change
Follows Id08a220e1d60 (after I92998ae6a82e).

Change-Id: I33d20201bfee4595baa39c01eaf8b7de6034a8ed
2022-05-29 16:41:19 +00:00
Timo Tijhof
10805be34b resourceloader: Improve internal type hints in FileModule class
Follows-up I56a0ee74595404e1, I38a0761ae4633 and I6c3d186de1877f73d4.

Remove most "Usage" examples as these are internal and
mostly-normalized class fields. This is not where end-users should
look for documentation. Besides, many of the examples were wrong or
outdated, and almost all were incomplete. It also had an inherent
dilimma between describing all possible valid input and describing
what we actually store in that instance variable after normalization
in the class constructor. The usage docs have long been moved
to the MW config file, so we can omit that.

In its stead, place more complete and accurate type hints for Phan
to understand the possible code paths, in particular to reflect
the use of FilePath objects.

Change-Id: I1cc002f350785d3f46f79be5defb7b3cadbebf34
2022-05-29 16:41:09 +00:00
Umherirrender
f01a391f0d tests: Fix types in documentation by adding use statements
Some types used in @param/@return are not correct,
because the class is not used with namespace

Change-Id: Ic2643687378a6addabc2c9cd402224e442257f86
2022-05-29 07:11:15 +00:00
jenkins-bot
29878a3f71 Merge "api: Remove deprecated class alias ApiQueryContributions" 2022-05-29 07:10:16 +00:00
jenkins-bot
778494c6bf Merge "Remove deprecated MediaWiki\Storage namespace for revision related class" 2022-05-29 07:09:17 +00:00
jenkins-bot
3dba007822 Merge "content: Remove UnknownContent/UnknownContentHandler class alias" 2022-05-29 07:07:42 +00:00
Umherirrender
f07295ade1 content: Remove UnknownContent/UnknownContentHandler class alias
Renamed in a67cad6 in 1.36
The fallback content is designed for internal use only

Change-Id: I6977a9cf1eab0e701fd6969b1a2b5d1dfcecfdfa
2022-05-29 06:20:45 +00:00
Umherirrender
a2a1a4ecd2 Remove deprecated MediaWiki\Storage namespace for revision related class
All revision related classes are namespaced MediaWiki\Revision
instead of MediaWiki\Storage since 1.32. The old namespaced
class names are deprecated and only kept for backwards-compatibility.

Bug: T305784
Change-Id: I48cdc65301a8cd20d2bedd031dbdae33b8c2a34d
2022-05-29 06:17:01 +00:00
Umherirrender
2f7c0d6166 api: Remove deprecated class alias ApiQueryContributions
Deprecated since 1.32

Change-Id: Ia4d2d01272175972f29a724c06c249bfeb522cfe
2022-05-29 06:15:38 +00:00
jenkins-bot
5337dfb013 Merge "fuzzTest.php: Simplify try/catch code" 2022-05-28 21:41:03 +00:00
Umherirrender
71974b4a3e language: Remove deprecated FakeConverter class alias
Deprecated since 1.35

Change-Id: If3f1eb881db9ebd89b39545285f0540e76ef62b6
2022-05-28 16:05:41 +02:00
Umherirrender
9832c7f9ba fuzzTest.php: Simplify try/catch code
Change-Id: I925dd6b6f18118c8c4c577795e373f73337851d6
2022-05-28 09:05:18 +02:00
jenkins-bot
ffb983ea77 Merge "objectcache: Deprecate BagOStuff::addBusyCallback() and reduce to a stub" 2022-05-28 01:48:17 +00:00
Aaron Schulz
b16875216e objectcache: handle object tokens in MediumSpecificBagOStuff::doCas()
Some subclasses, like APCUBagOStuff, use the whole cache value itself
as the CAS token. Previously, in such cases, an error would be thrown
when the key held a PHP object, and the comparison would fail if the
key held an array that contained an object.

Make RedisBagOStuff and HashBagOStuff return null CAS tokens if the
value is false, to match other subclasses.

Make WinCacheBagOStuff CAS tokens distinguish int and digit strings.

Change-Id: I797f036e53aae7a4fdcb8586fbd4ebdbd7e8bae3
2022-05-27 18:10:27 -07:00
jenkins-bot
c60f455dec Merge "installer,rdbms: Remove hints to Oracle and Microsoft SQL Server" 2022-05-28 00:06:42 +00:00
Umherirrender
e3acf723de installer,rdbms: Remove hints to Oracle and Microsoft SQL Server
Fix i18n messages still refers to both rdbms

Bug: T230418
Change-Id: I830c192331786d0dcf58eaf09e34f49fa4c88a06
2022-05-27 23:47:42 +00:00
Umherirrender
8557249ac6 tests: Update namespace for MediaWiki\SpecialPage\SpecialPageFactory
MediaWiki\Special\SpecialPageFactory is deprecated since 1.35

Change-Id: I558a59e781edef4a78b4e902961809ba07f4f695
2022-05-28 01:31:53 +02:00
jenkins-bot
05f9489b45 Merge "tests: Do not use class alias in @covers" 2022-05-27 23:14:41 +00:00
jenkins-bot
907c80de45 Merge "tests: Use namespaced IDatabase class" 2022-05-27 23:13:16 +00:00
Umherirrender
b0398654c5 tests: Do not use class alias in @covers
Also fix case for the XMLTypeCheck test

Change-Id: I809510c8085a36e20fd0eefb5e77d2671b3148f2
2022-05-28 00:37:43 +02:00
jenkins-bot
9353eb69e0 Merge "resourceloader: Allow using FilePath directly in 'packageFiles' array" 2022-05-27 22:21:52 +00:00
Umherirrender
770f905900 tests: Use namespaced IDatabase class
Change-Id: I7171ff26faee00d9eaabc33c2f3d91049ea0b40d
2022-05-28 00:09:55 +02:00
jenkins-bot
2eb08f7371 Merge "resourceloader: Tweak RL\FilePath handling in packageFiles" 2022-05-27 22:03:18 +00:00
jenkins-bot
f7a729f076 Merge "Add codex-search v0.1.0-alpha.6" 2022-05-27 21:54:13 +00:00
Bartosz Dziewoński
7f9aaf26e3 resourceloader: Allow using FilePath directly in 'packageFiles' array
This already works in 'scripts', 'styles' etc.

Change-Id: I56a0ee74595404e1c40483b84400056d6f87b07d
2022-05-27 21:41:13 +00:00
Bartosz Dziewoński
566b185e9c resourceloader: Tweak RL\FilePath handling in packageFiles
ResourceLoader's FilePath is designed to allow a FileModule
to include files that exist outside of the module's localBasePath,
to allow skins and extensions to extend core MediaWiki modules.
This is accomplished by having the FileModule use the FilePath's
localBasePath instead, in FileModule::getLocalPath.
(Similarly for remoteBasePath, but these are going out of fashion.)

However, the code processing 'packageFiles' did not handle this right:
it used FilePath's localBasePath when it appeared as a 'file',
but not when it was returned by a 'callback' or 'versionCallback',
using the FileModule's localBasePath instead in that case. Most
existing uses of FilePath in 'packageFiles' required the same base
path as the module, so it was convenient to avoid providing it twice.

To keep that convenience (already relied on by some extensions too)
while also allowing skins and extensions to add files from their own
directories to existing modules, the code processing 'packageFiles'
now uses FilePath's base paths in all cases, but they are optional,
and will fall back to the FileModule's paths when not provided.

Follow-up to 2890bca27d.

Change-Id: I38a0761ae4633a567b685b52c1d73b6ce280ffb7
2022-05-27 22:40:41 +01:00
jenkins-bot
13326760a7 Merge "Follow-up I8d62aedb: Fix .rotation mixin" 2022-05-27 16:46:34 +00:00
Arlo Breault
2cf5e8d9bd Sync up with Parsoid parserTests
This now aligns with Parsoid commit 4eb378d8c7cbdc9d6a939d6068f1c13e94e2b0ac

Change-Id: I3647805b5c909c227a828093bef600afb1ca475b
2022-05-27 12:16:06 -04:00
Ed Sanders
80c448fe90 Follow-up I8d62aedb: Fix .rotation mixin
Change-Id: I342384c822554840e0cd5638cf7129365d9ee696
2022-05-27 17:07:34 +01:00
jenkins-bot
e2fbdb26e0 Merge "parserTests.php: Default to --parsoid if you pass a parsoid-specific option" 2022-05-27 16:00:29 +00:00
jenkins-bot
6475f05e79 Merge "ParserTestRunner: Use standard PHP mechanism for array defaults in constructor" 2022-05-27 15:59:02 +00:00
jenkins-bot
54974a312f Merge "Emit mw:File typeof for media" 2022-05-27 15:58:54 +00:00
jenkins-bot
5eff9433f7 Merge "objectcache: Simplify SqlBagOStuff class configuration" 2022-05-27 15:21:44 +00:00
jenkins-bot
f26b6e3a1b Merge "rdbms: Deprecate DBO_SSL" 2022-05-27 15:16:57 +00:00
Tim Starling
dbd52291a0 objectcache: Deprecate BagOStuff::addBusyCallback() and reduce to a stub
It's not called by anything since it was removed from
ChronologyProtector, and it is not needed for production.

Pass the timeout directly to LoadBalancer::waitForAll() instead of
using a WaitConditionLoop, as it was before e99bb1b7dc

Change-Id: I5a1903e6e9ac145c06f77c690a0f6a487b4aa43f
2022-05-27 15:05:10 +00:00
Tim Starling
bcfb90cdd7 objectcache: Simplify SqlBagOStuff class configuration
Substantive changes:

* Remove the parameters globalKeyLB and localKeyLB, not needed in
  production, probably not used anywhere.
* Add a "cluster" parameter, for production.
* Don't call markServerDown() in LoadBalancer mode.

Style changes:

* Document config parameters separately from constructor parameters, to
  clarify the role of the wiring normalisation.
* Inject a load balancer from ObjectCache to SqlBagOStuff, using a
  closure to defer construction.
* Clarify the split between LoadBalancer mode and server array mode by
  introducing a useLB property. Use it instead of special shard index
  values and array counts.
* multiPrimaryModeType wasn't needed anywhere and wasn't available in
  the constructor, so it just became a boolean multiPrimaryMode.
* Add a test covering most of the server array (!useLB) branches.

Bug: T212129
Change-Id: Ib097082efb40b514a29a42286dc362f2e3743ee4
2022-05-27 15:04:43 +00:00
Tim Starling
472d60d249 rdbms: Deprecate DBO_SSL
Using a bitfield breaks server array template merging in LBFactoryMulti.

The only nice thing about flags compared to boolean constructor
parameters is the existence of setFlag(), clearFlag() and
restoreFlags(). But that is not useful for parameters that are used
during connect.

Bug: T134809
Change-Id: I088ef4a0e4c11a2cfe17415b325b455164004c1e
2022-05-27 14:57:31 +00:00
jenkins-bot
6e07c7b6c1 Merge "Add mw:File to media styles" 2022-05-27 14:33:54 +00:00