Commit graph

109856 commits

Author SHA1 Message Date
jenkins-bot
e9eb4f60d6 Merge "TempUser CentralAuth integration" 2022-05-10 10:34:07 +00:00
jenkins-bot
14bce5492d Merge "OutputPage: Handle language variants in getUnprefixedDisplayTitle" 2022-05-10 09:07:25 +00:00
bhsd
12e7f45215 OutputPage: Handle language variants in getUnprefixedDisplayTitle
When the namespace prefix is converted to a specific language variant,
the function getUnprefixedDisplayTitle() takes no effect.

This issue is visible on category pages, where the unprefixed display
title is used for subheadings.

Bug: T302161
Change-Id: I94684ca0760aafb7c41470210652abfffb7e0d51
2022-05-10 08:39:34 +00:00
jenkins-bot
783a763bd2 Merge "AutoLoader: provide methods for registering classes" 2022-05-10 06:05:52 +00:00
daniel
37af531721 AutoLoader: provide methods for registering classes
This introduces static methods for registering classes and namespaces,
so we don't have to mess with global variables and static members
fields.

Bug: T240535
Change-Id: I1abb27bd70898d04c9253e0b7467447fa96d15a4
2022-05-10 13:55:53 +10:00
Aaron Schulz
774abe3ba6 Split out slow ScopeStructureTest for easier paratest parallelization
Change-Id: I677f27847e635003c932102b3876fcf81d270c88
2022-05-10 11:18:24 +10:00
jenkins-bot
5037445aaa Merge "Add HtmlHelper::modifyElements() for small HTML modifications" 2022-05-10 00:50:13 +00:00
Tim Starling
5bac886e6e TempUser CentralAuth integration
Add a hook "TempUserCreatedRedirect" which allows an extension to modify
the post-save redirect after a temporary user is created. CentralAuth
will handle this hook in order to redirect to loginwiki. Loginwiki will
redirect back to the page being saved.

In LoginHelper::showReturnToPage add an "anchor" parameter to specify
the URL fragment to redirect to. This is intended for section editing
with a redirect via loginwiki.

In AuthManager::autoCreateUser(), just allow any valid username, don't
require it to be creatable. Previously a non-creatable username was
allowed only with $source=AUTOCREATE_SOURCE_TEMP, but CentralAuth
depends on user autocreation from the session during refreshCookies. The
session is already validated at this point, so it's not like a user can
exploit this to create arbitrary names.

Change-Id: I623330dbf5d0573c93ae22f962618d6ddbd126d9
2022-05-10 09:06:05 +10:00
diesel kapasule
6e97f2491b Schema: Updating user_editcount field to unsigned
I have updated user_editcount field to unsigned in
tables.json

This patch doesn't apply to Postgres.

Bug: T305340
Change-Id: I07a360944a10be9cc8ed8731c6286412294413a3
2022-05-09 21:34:11 +00:00
jenkins-bot
adf7a0b562 Merge "Introduce interface ComponentRegistryContext" 2022-05-09 20:54:29 +00:00
Clare Ming
ae6d0f33af Introduce interface ComponentRegistryContext
- To mitigate passing around Skin god object.
- Provide limited context for components.
- Update relevant classes.

Bug: T301722
Change-Id: Icb7ea7ae5b86a39adf6eb2805b2bf42fb71d3bd0
2022-05-09 20:36:36 +00:00
Derick Alangi
f749e04fb6
Title: Hard deprecate Title::newFromTitleValue()
I've updated callers to the deprecated code to use the new
method and we can completely remove the deprecated code in
mw 1.40

The deprecated method delegated to `::newFromLinkTarget()`
which is it's direct replacement, so that should be used
instead.

Depends-On: If799d6a1e722ca80f50b0f12c9b1c9f31a40a860
Depends-On: I276845ccf39ac7a65fca8ba268abbe1e02607a4b
Depends-On: I5d7213e9bcd84f5b674136d2d8b13577cbeead83
Depends-On: Idd222cc5ea94ee1215ab6d4c9e06d79c0a95d6aa
Change-Id: Ibc723aa30a2282222248669c3c195ecb7dfb2423
2022-05-09 21:14:13 +01:00
jenkins-bot
e8142e2356 Merge "Avoid accessing MW services in data provider" 2022-05-09 19:51:57 +00:00
jenkins-bot
de5116078c Merge "api: Add support for linksmigration in ApiQueryLinks" 2022-05-09 17:33:52 +00:00
jenkins-bot
8e8522af99 Merge "Add the Mooré language (mos)" 2022-05-09 16:57:09 +00:00
Derick Alangi
362380f67d Avoid accessing MW services in data provider
Change-Id: Ifce325abc72ac7c05636c350c82334a166009f17
2022-05-09 16:14:05 +00:00
jenkins-bot
e49af291c9 Merge "Remove duplicate contentRenderer assignment" 2022-05-09 08:36:48 +00:00
Matthias Mullie
2a25d90807 Remove duplicate contentRenderer assignment
AFAICT, this is a rebase artefact. See
https://gerrit.wikimedia.org/r/c/mediawiki/core/+/730808/11#message-6c552144fd4a0194942b268a441e050fa865ec96

Change-Id: I3a32335f3ad0792a9bb9eedf28dab821a04c65ec
2022-05-09 09:26:14 +02:00
Amir E. Aharoni
c882697cb9 Add the Mooré language (mos)
Bug: T307887
Change-Id: I25f9a17923ffff01f3474942687d8ef433a90f6c
2022-05-09 09:37:58 +03:00
daniel
7d78c249ae Add benchmarks for applying dynamic config.
Bug: T305093
Change-Id: I7f4d6b2f2a4be01e5e5a65f94b7d91565e417b4b
2022-05-09 05:57:53 +00:00
Translation updater bot
1ac75f78d1 Localisation updates from https://translatewiki.net.
Change-Id: Iaa8ff72e186c5377dd5c882f7a8ad7e83e401391
2022-05-09 07:56:06 +02:00
Amir Sarabadani
43fc4c43a5 api: Add support for linksmigration in ApiQueryLinks
Bug: T304780
Change-Id: I958ddd996b1f3ed2ef1b085cb6c8827612680e24
2022-05-09 07:22:29 +02:00
jenkins-bot
80b03b277a Merge "Config builder optimisations (combined)" 2022-05-09 05:11:41 +00:00
jenkins-bot
7037aa419f Merge "Add tests for ConfigBuilderBase" 2022-05-09 05:06:36 +00:00
jenkins-bot
e7573c0e5d Merge "Remove support for $wgMaxRedirect" 2022-05-08 20:25:09 +00:00
Gergő Tisza
2557f96cb7
Add HtmlHelper::modifyElements() for small HTML modifications
Adds HtmlHelper, which is intended to be a static utility class
for doing simple modifications to HTML strings in a safe way,
without exposing the caller to the complex Remex interface.
Currently only has one method, which is mainly useful for
modifying element attributes.

The code is largely based on the Wikibase FormatEntities class.

Bug: T217850
Change-Id: I45db9e61e47eb69df32a167d9d1dd146a8719676
2022-05-08 15:55:00 +02:00
jenkins-bot
a8938359a9 Merge "Skip failing structure test in SettingsTest" 2022-05-06 15:02:30 +00:00
Lucas Werkmeister
2e9fa547a1 Skip failing structure test in SettingsTest
This is blocking merges in several important extensions.

Bug: T307769
Change-Id: Ib33989dc38fe3a0dec59fbac949d4c732fa5d5d7
2022-05-06 16:09:56 +02: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
Tim Starling
6e40c79954 Config builder optimisations (combined)
This is a modified rebase of a patch by Tim,
see I75f405930a7b14561389c59d147640e870146bec.

Some benchmark results (from my laptop):

Loading defaults from config-schema.php:
  - Master:              115/sec ( 8.7ms)
  - I75f4059: (Tim):     575/sec ( 1.7ms)
  - Id9dd0bf: (Daniel): 1120/sec ( 0.9ms)
  - This (Tim+Daniel):  1420/sec ( 0.7ms)

Loading defaults and merging settings (worst case):
  - Master:               80/sec (12.4ms)
  - I75f4059: (Tim):      93/sec (10.8ms)
  - Id9dd0bf: (Daniel):  200/sec ( 4.9ms)
  - This (Tim+Daniel):   682/sec ( 1.5ms)

Original commit message by Tim:

* Explicitly import function array_key_exists to activate the special
  opcode
* Batch creation of MergeStrategy objects
* Batch default assignment to ArrayConfigBuilder

The batches mostly help by allowing more inlining, eliminating some
function calls.

Reduced time for apply/finalize benchmark from 540µs to 170µs.

Co-Authored-By: Tim Starling <tstarling@wikimedia.org>
Change-Id: I3d4dd685eaaa4351801b3bac6ce1592eea925c5f
2022-05-06 11:28:15 +02:00
jenkins-bot
807e99d197 Merge "TempUser skin and client-side components" 2022-05-06 08:56:48 +00:00
daniel
66f3ab254c Remove support for $wgMaxRedirect
Redirect chains have never worked as intended.

Bug: T296430
Change-Id: If0e514c57b8f3d857d956a581f1b549518ecb099
2022-05-06 10:52:56 +02:00
jenkins-bot
45290388c9 Merge "phpunit: Add tests for SearchSuggestionSet::fromTitles()" 2022-05-06 08:51:21 +00:00
Translation updater bot
b665a547e6 Localisation updates from https://translatewiki.net.
Change-Id: I4ee6ca8a33226bb1ae6aa8689617b00868334d0e
2022-05-06 07:57:20 +02:00
daniel
67c0766a84 Use inverted schema definition for fast loading.
If we pre-generate the data structure for holding schemas in a way
that is optimized for the way we typically access this information
we can save time on initialization:

Instead of having the schema for a given setting in one array with keys
for the default, type, etc, this puts all defaults into one array, all
types into another array, etc. This allows the default values to be
copied in bulk, without having to iterate over the 700+ settings and
look for a default value in each schema array.

Benchmark results from my laptop: 0.85ms for loading config-schema.php,
that is a 85% improvement over the 6.3ms it took before.
It's even 32% faster than loading DefaultSettings.php, which takes 1.26ms.

Bug: T300129
Change-Id: Id9dd0bff6a6d4b501e74237b5d7198088c38c302
2022-05-06 12:56:26 +10:00
jenkins-bot
4ece9d46fe Merge "rdbms: Remove db name from error message" 2022-05-06 02:37:21 +00:00
Tim Starling
08164d93a8 TempUser skin and client-side components
* Treat temp users as anons for skin login, logout and create account
  links. Suppress temp user preferences and watchlist UI.
* Show a post-edit notification box after a temporary account is
  created.

Change-Id: Ib935fc04387100f25cafd75c632ac5ae7114d5d5
2022-05-06 11:28:43 +10:00
jenkins-bot
3baedf2c19 Merge "ConfigBuilder: introduce setMulti() for bulk updates" 2022-05-06 01:26:37 +00:00
Derick Alangi
4c1107fb47
phpunit: Add tests for SearchSuggestionSet::fromTitles()
Change-Id: Icda5f3ce5d804c11414220cbe035648cfa7017b1
2022-05-06 01:39:28 +01:00
jenkins-bot
44a87077a8 Merge "docs: Fix 'the the' typo" 2022-05-05 16:01:12 +00:00
jenkins-bot
2f6b7d813f Merge "styling: Use a mixin for positon:sticky browser prefixes" 2022-05-05 15:54:39 +00:00
jenkins-bot
955a74c2ec Merge "build: Update stylelint-config-wikimedia to 0.13.0" 2022-05-05 15:50:12 +00:00
jenkins-bot
990881f89d Merge "WikiFarm: remove site detection based on domain name." 2022-05-05 15:41:06 +00:00
Klein Muçi
803b873beb docs: Fix 'the the' typo
Bug: T201491
Change-Id: Idd776953dcf7dadc136e57d586c09b24363005a6
2022-05-05 15:40:26 +00:00
Ed Sanders
9777de4650 styling: Use a mixin for positon:sticky browser prefixes
Change-Id: I1fcc872d0cd4334a011147d5ac861ce29435644f
2022-05-05 15:35:35 +00:00
jenkins-bot
d97222dd8f Merge "Add messages for the "named" user group" 2022-05-05 15:27:14 +00:00
jenkins-bot
aa7ebdd61b Merge "Suppress "named" group when TempUser system is disabled" 2022-05-05 15:26:49 +00:00
daniel
3f80c28909 Add tests for ConfigBuilderBase
This adds tests for the abstract base class, to make sure the generic
implementation matches the contracts. Tests for existing subclasses may
not be using the generic code, and new subclasses may run into trouble.

Change-Id: I2c652c3028862ad52dbd0edaa454bec953e94506
2022-05-05 17:00:16 +02:00
jenkins-bot
08f0bd6603 Merge "Settings: Skip merging logic for defaults when possible" 2022-05-05 14:59:07 +00:00
daniel
0f374c67a5 ConfigBuilder: introduce setMulti() for bulk updates
When no merge strategies are needed, config values can be set in bulk.

This patch only uses it for config-overrides, but it is intended to be
used for config-schema in a follow-up.

Change-Id: Ic7e62513ad5227887f8a83bb8b757b5667643989
2022-05-05 14:42:23 +00:00