Commit graph

80 commits

Author SHA1 Message Date
jenkins-bot
f16784cc54 Merge "SettingsBuilder: report warnings" 2022-07-15 12:34:03 +00:00
daniel
cf39a40f16 SettingsBuilder: report warnings
This adds functionality to SettingsBuilder for collecting warnings to be
logged later, when the logging mechanism has been set up.

This also adds a validation step to update.php that aborts the update
if any warnings have been registered in SettingsBuilder, or the settings
fail to validate against the settings schema.

Change-Id: I387905289fb93591f79b96bf4c6cb5ec692b2aff
2022-07-15 12:24:20 +02:00
Timo Tijhof
68d4fe68b9 tests: Remove intermediary suites concept from /tests/qunit
I don't recall why I added this. Possibly in a confused effort
to match /tests/phpunit, except /tests/phpunit/suites is not
where test cases live, they live under /tests/phpunit/* directly,
mostly /tests/phpunit/includes named after the source directory.
The correct equivalent to that is /tests/qunit/resources for JS.

While at it, also remove mention of this concept from various other
places where it doesn't add value. It's one more word/concept to
learn, process, understand, or translate mentally. They're just tests,
or for the one or two places where we care about how they are
internally transmitted, a "test module".

Bug: T250045
Change-Id: I5ea22e4965d190357aa69883f29f9049ee8ebf13
2022-07-13 01:52:57 +00:00
jenkins-bot
3fc9cf4f51 Merge "Add support for write new for templatelinks migration" 2022-07-12 14:17:52 +00:00
Amir Sarabadani
692dde00df Add support for write new for templatelinks migration
- schema change to allow tl_namespace and tl_title being empty
   This is done by removing them from primary key. They don't need to be
   nullable as they have default value.
 - Make sure with WRITE_NEW, updater avoids writing to the old columns

Bug: T306674
Change-Id: I2b8a29043e952060e7a79b6a7a3d647d48cd16fb
2022-07-12 14:46:54 +02:00
daniel
5e928f39e8 Dynamic defaults: fix $wgLocaltimezone being empty
Apparently, $wgLocaltimezone is set to the empty string in many
existing LocalSettings.php file, presumably because the installer
failed to detect the correct time zone.

The new code for handling automatic defaults will only trigger if
$wgLocaltimezone is null, not when it is otherwise empty.

This adds fallback code in strategic places to ensure that the empty
string is handled correctly.

Bug: T305093
Change-Id: I39226466f2bb6a36823ae9032fc62f981eabc64a
2022-07-09 18:59:32 +02:00
Aryeh Gregor
b72b9a8c43 Move dynamic defaults into MainConfigSchema
The goal is to keep the actual default values for settings in the same
place as the setting is declared, and applied using the regular means
for loading the settings -- not in a separate piece of code that needs
to be loaded through some entirely different mechanism.

SetupDynamicConfig.php now contains a few categories of things:

* Post-processing of configuration settings, where already-set settings
  are altered. This could be moved to MainConfigSchema too as a separate
  set of methods.
* Processing of old aliases of settings (blacklist, slave) that are not
  registered as settings anymore and therefore are not available to
  MainConfigSchema. This could perhaps be moved to LocalSettings
  processing somehow?
* Setting $wgUseEnotif, which is also not registered as a setting.
  Easiest would be just to declare it as a setting and have it set
  unconditionally.
* Setting the actual timezone to $wgLocaltimezone. This is not related
  to configuration and should just be in Setup.php.

Bug: T305093
Change-Id: Ia5c23b52dbbfcb3d07ffcf5d3b7f2d7befba2a26
2022-07-07 09:55:48 +10:00
Lucas Werkmeister
c3c5b6c1b4 Remove 'ignoreKeys' from config schema
Unused since change I88754b52c2 (commit 9e95539fc9) – this was only used
for SessionProviders, which is now a map/object instead.

Change-Id: I8da686e6379eb33a63799874fb44f9b0030ab5ba
2022-07-06 10:46:58 +02:00
Lucas Werkmeister
9e95539fc9 Fix config type of SessionProviders
Bug: T307769
Change-Id: I88754b52c2fa69b6777ce6bee3825bfe97394e48
2022-07-05 15:42:35 +02:00
Tim Starling
bcbfc9ccfc Introduce new WRStats library for write-read stats
A library for storage of counter value time series statistics, based
around the observation that memcached getMulti() is apparently fast
enough to do this in a simple manner, with incremented values stored
in time window buckets.

Bug: T310662
Change-Id: I26b1cdba0a06ad16ad8bb71b455e1b6180924d17
2022-07-05 10:35:19 +10:00
daniel
f2df03704e Add support for nested property schemas in MainConfigSchema.
This adds support for JSONSchema style property declarations with nested
schemas. This is a step towards using more nested structured for
configuration, rather than adding to the over 700 keys already defined
in the main config schema.

Defaults from property schemas are aggregated into a default value in
the top level schema. Descriptions are however not yet aggregated.

Change-Id: Iaf46a9ecc83bee3566098c56137a1be66bff2ab9
2022-06-29 16:34:43 +10:00
Derick Alangi
1854fb02d9 Storage: Warm parsoid parser cache with parsoid outputs
This patch introduces a ParsoidOutputAccess service for
getting parsoid outputs and warms the cache with pregenerated
outputs.

It also introduces a config variable in ParsoidCacheConfig that
is turned off by default for controlling the cache warming.

Bug: T301371
Change-Id: I6152c42ea765d94093d8d62598b1b4278314adec
2022-06-28 09:05:41 +00:00
jenkins-bot
4cad183c51 Merge "Use array|null for the wordmark/tagline type" 2022-06-17 20:15:42 +00:00
daniel
842d181707 Rename parsoid stash backend config var.
This changes the name of a key in the ParsoidCacheConfig array:
StashType is more in line with other configuration variables that refer
to on aobject cache type.

This is not a breaking change since ParsoidCacheConfig was only
introduced recently and is not in used in WMF config nor present in any
release.

This is a Follow-up to Ic67dc43ed9843810e4b180127f9a3bb7608f7608.

Change-Id: I9e61a6f94ec8bf1716c7d735f9bb17af4461fc9c
2022-06-17 17:17:42 +02:00
Tim Starling
463577cdbc Use array|null for the wordmark/tagline type
Per Thiemo's comments at Id2712e2af3d8f33fd4.
Follow up to Ie33f8edf075f1216881428ec6aa29c.

Change-Id: Idea3dede510e0e46265a2f55665b99ef5c0029c3
2022-06-17 12:15:04 +10:00
jenkins-bot
439f89721d Merge "Configure caching parsoid output per wiki based on threshold" 2022-06-16 19:16:31 +00:00
jenkins-bot
052a25aec7 Merge "resourceloader: Don't raise notice when the logo wordmark is false" 2022-06-16 13:41:15 +00:00
Derick Alangi
270699ec34 Configure caching parsoid output per wiki based on threshold
Cache the parsoid outputs only if a certain time is exceeded on
parse and consider the parse operation within this time limit as
not expensive per that wiki and not cache the parsoid output at all.

Bug: T308588
Change-Id: I7793b77feab13400ccd04343e7878ad701f5e6a7
2022-06-16 11:42:06 +01:00
Tim Starling
a5b44d60f1 resourceloader: Don't raise notice when the logo wordmark is false
Fix notice on PHP 7.4+ when the wordmark is false. It is false on the
beta cluster and Mustache doesn't mind if it is false. Update docs.

Use !empty($x) as a shortcut for isset($x) && $x in two nearby places.

Bug: T310767
Change-Id: Ie33f8edf075f1216881428ec6aa29cae1dac4e64
2022-06-16 14:10:40 +10:00
daniel
6955380fbe Add rate limiting to ParsoidHTMLHelper
Bug: T267991
Change-Id: I52a83e7d3bdb0bcde59160e2d193f06908fda3d4
2022-06-15 13:40:56 +02:00
daniel
4dd7bd16b5 ParsoidOutputStash: make storage backend configurable.
This introduces the ParsoidOutputStash config setting, which defines the
storage backend and cache duration. The storage backend name refers to
an entry in the ObjectCache setting, and defaults to the main stash.

Bug: T267990
Bug: T309016
Change-Id: Ic67dc43ed9843810e4b180127f9a3bb7608f7608
2022-06-14 14:11:37 +01:00
jenkins-bot
41fe47cde9 Merge "REST: Hide exception message when wgShowExceptionDetails=false" 2022-06-09 21:51:45 +00:00
jenkins-bot
b494330aa7 Merge "ParserCache: always use JSON" 2022-06-07 14:12:29 +00:00
daniel
697f28df32 ParserCache: always use JSON
When JSON support was introduced into ParserCache in 1.36, it was
controlled by a feature flag, $wgParserCacheUseJson. The feature flag
was "born deprecated" in 1.36. It can now be removed.

This means that ParserCache will always store entries as JSON.
Support for reading old non-JSON entries remains intact.
This is needed when updating wikis from a version older than 1.36
to the current version.

Change-Id: Id04e42bfb458d98414bac50e0d6c505e8878e5c0
2022-06-07 15:19:45 +02:00
jenkins-bot
e1ce5bece4 Merge "resourceloader: Decouple some internal constructor args" 2022-06-06 01:05:04 +00:00
daniel
ad11b034ab Settings: Generate schema artefacts using a single maintenance script
Previously, each of the four derived config schema files had to be
regenerated using a separate maintenance script. This change simplifies
regeneration by combining all for scripts into a single command that can
be used to regenerate all relevant files after changing
MainConfigSchema.

Change-Id: I7d38d8a4aede60475c4bdd0053d2e10e298b9843
2022-06-05 19:17:29 +00:00
Timo Tijhof
519e95adc0 resourceloader: Decouple some internal constructor args
Move config defaults to ResourceLoader class, so that the defaults
reside within the component responsibility, and for future standalone
use and unit testing with the same set of defaults.

Bug: T32956
Change-Id: I4a268e11686e526c4377542d45e198a72e57f182
2022-06-02 18:27:33 +01:00
jenkins-bot
ff62deef6c Merge "Allow sharding in site_stats update" 2022-05-31 16:40:33 +00:00
diesel kapasule
e37619873b Remove unused config $wgInterwikiPrefixDisplayTypes
Bug: T306361
Change-Id: Ic6e43d5bbca873dd27e9e2a1f2bc9d0c9a43dfa4
2022-05-31 17:14:20 +02:00
diesel kapasule
8a31497c5f Remove unused configuration global $wgLegacySchemaConversion
I removed $wgLegacySchemaConversion from config-vars and
HistoryBlobCurStub.

Bug: T303684
Change-Id: I7f918ab61ffea377bd827721f9b41ae5d8f82226
2022-05-30 20:59:05 +02:00
Amir Sarabadani
5156ae0404 Allow sharding in site_stats update
This would be useful in cases that lots of edits happen at the same time
and this would reduce the time waiting to get the row lock.

Bug: T306589
Change-Id: I3b869e3b85dfd66575390ef4247f2f81f19c878e
2022-05-30 20:46:08 +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
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
jenkins-bot
5eff9433f7 Merge "objectcache: Simplify SqlBagOStuff class configuration" 2022-05-27 15:21:44 +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
Timo Tijhof
0bb1538929 REST: Hide exception message when wgShowExceptionDetails=false
This reverts parts of I8520d8cb16 and Ib941c22d6b7e.

The documentation of ShowExceptionDetails, as well as all other
uses of it (e.g. MWExeceptionRenderer for index.php, API, and
ResourceLoader) take it to mean to hide both exception message and
details.

This is why MWExceptionHandler didn't have, and didn't need,
the added complexity of this as a parameter as this method
simply wouldn't be called at all in that case.

* Rename the method added in I8520d8cb16 to match the one
  in MWExceptionRenderer.

* Update REST handling to now print any exception details
  when it is true.

* Remove the now-unused code introduced in Ib941c22d6b7e.

Change-Id: I1a9920dea0bafe315a20489efbe46ea9b55b0f74
2022-05-26 14:45:50 +01:00
Tim Starling
3e2653f83b ResourceLoader namespace (attempt 2)
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader itself.

Move the tests by analogy.

I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".

I did not address DependencyStore which continues to have a non-standard
location and namespace.

Revert of a241d83e0a.

Bug: T308718
Change-Id: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
2022-05-24 15:41:46 +00:00
Umherirrender
9d458f6df2 user: Add > to $wgInvalidUsernameCharacters, used by ExternalUserNames
Even when > is in $wgLegalTitleChars it is not allowed in user names

Bug: T308465
Change-Id: Ib9dc055c18837328f4cd858a3ddeb1b6452d9dc1
2022-05-23 22:32:21 +02:00
Amir Sarabadani
24115a8f4c Start clean up of revision_actor_temp table
It is being dropped in production

Bug: T215466
Change-Id: I66b2cb8653252e720c897351065978119f040ba7
2022-05-23 15:37:42 +00:00
mainframe98
0d90560e64 parser: Remove Priority Hints experiment for thumbnails
Both this feature and the web standard are experimental.
The standard was only exposed as a Google Chrome Origin Trial
and the standard has evolved in a non-compatible way.

Bug: T308707
Change-Id: I987c0fb9e3fbb1a9f727b3f171c747246d8adb77
2022-05-19 09:38:17 +02:00
mainframe98
ebffc4f6b1 parser: Remove Element Timing experiment for thumbnails
This feature was experimental, unsupported and untested.
It was disabled by default.

Bug: T308621
Change-Id: I9375f35d031f635af0d39ee0bc027ac719899d9d
2022-05-18 20:34:26 +00:00
daniel
237bbf089f Turn DefaultSettings.php into a deprecated stub
DefaultSettings.php has been replaced by MainConfigSchema.
Loading DefaultSettings.php is deprecated.

Code that needs to have access to configuration defaults should use the
ConfigSchema service object.

Bug: T300129
Change-Id: I7b2c0ca95a78990be1cdb9dd9ace92f6dcf1af15
2022-05-17 16:50:56 +02:00
Tim Starling
a124d003cf TempUser: ScrambleMapping
Add a mapping function which converts sequential integers to a sequence
in which most of the digits change each time, but without significantly
increasing the length.

Change-Id: I1011a96894fbf0b92d20a96149e68014f53e3c3c
2022-05-16 17:36:22 +00:00
Lucas Werkmeister (WMDE)
a241d83e0a Revert "ResourceLoader namespace"
This reverts commit e08ea8ccb9.

Reason for revert: Breaks Phan in extensions, and as far as I’m aware,
this change isn’t urgently needed for anything, so the simplest fix is
to revert it again for now. After PHP 7.4 it should be safer to try this
again (we hopefully won’t need the two “hack” classes by then).

Bug: T308443
Change-Id: Iff3318cbf97a67f821f78e60da62a583f63e389e
2022-05-16 14:43:33 +00:00
Tim Starling
e08ea8ccb9 ResourceLoader namespace
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader and
ResourceLoaderContext.

Move the tests by analogy.

I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".

I did not address DependencyStore which continues to have a non-standard
location and namespace.

Change-Id: I92998ae6a82e0b935c13e02a183e7c324fa410a3
2022-05-16 14:41:27 +10:00
Matěj Suchánek
e47c441078 Fix many typos in comments
Found using IntelliJ's "Typo" code inspection.

Change-Id: I746220ebe6e1e39f6cb503390ec9053e6518cf16
2022-05-10 12:46:11 +00:00
jenkins-bot
e7573c0e5d Merge "Remove support for $wgMaxRedirect" 2022-05-08 20:25:09 +00:00
Yuki Shira
d73a6a6a6f MainConfigSchema: fix @deprecated tag of $wgSquidPurgeUseHostHeader
$wgSquidPurgeUseHostHeader is @since 1.21 and @deprecated since 1.33.

Follow-Up: I9776d11d4e2d184af35b1117cd7950354c0e343e
Change-Id: Ibaa261fcce3498eba56ab37c8ed95f52e59cfef4
2022-05-06 21:00:29 +09:00