Commit graph

13834 commits

Author SHA1 Message Date
jenkins-bot
b58397e2bf Merge "rdbms: Introduce ServerInfoHolder to limit access to servers in LB" 2023-02-21 16:30:09 +00:00
jenkins-bot
1ce6d56940 Merge "import: Add a syntax check for xml imports" 2023-02-21 15:44:22 +00:00
jenkins-bot
9a96857757 Merge "Reorg: Move HTML-related classes out of includes/ to Html/" 2023-02-21 15:37:53 +00:00
Amir Sarabadani
3909c1440a rdbms: Introduce ServerInfoHolder to limit access to servers in LB
For example, any part of LB can write and change number of servers.

Bug: T326274
Change-Id: I177d57e2e34aea176a53c4d96d58f428b9a16634
2023-02-20 18:58:15 +01:00
Derick Alangi
80b5684589 search: Namespace TitleMatcher class
Follow-up on: I09990e9f263c075a6ab137ee5bcb7285359f057c

Change-Id: Iff6ab10fe3b784b152992293695964d4c51803b8
2023-02-19 10:55:07 +02:00
jenkins-bot
10716e7c3c Merge "Allow some maintenance scripts to be called without a LocalSettings" 2023-02-18 00:08:35 +00:00
jenkins-bot
643b8b4d72 Merge "i18n: Reword action-deletedhistory" 2023-02-17 19:28:16 +00:00
Umherirrender
9a96df31fa i18n: Reword action-deletedhistory
Also reword action-deleterevision, action-deletelogentry,
action-deletedtext and action-suppressrevision to match its
corresponding right-* messages

Bug: T329720
Change-Id: I3f0d9a76c5fb0dddb7de055b3cf2c335cd63e6d1
2023-02-16 23:08:28 +01:00
daniel
7dcfbf2a62 Allow some maintenance scripts to be called without a LocalSettings
Subclasses of Maintenance that can function without database access can
now override canExecuteWithoutLocalSettings to return true.
This is useful for scripts that need to be able to run before or without
installing MediaWiki.

When no config file is present, the storage backend will be disabled.
Any attempt to access the database will result in an error.

NOTE: This makes MediaWikiServices::disableBackendServices() more
comprehensive, to avoid premature failures during service
construction. This change makes it necessary to adjust how the
installer manages service overrides.

The CLI installer is covered by CI, I tested the web installer
manually.

Change-Id: Ie84010c80f32cbdfd34aff9dde1bfde1ed531793
2023-02-16 21:11:33 +00:00
jenkins-bot
fd660e4c51 Merge "title: Handle user name equal to interwiki prefix in TitleParser" 2023-02-16 20:55:16 +00:00
Amir Sarabadani
7d8768e931 Reorg: Move HTML-related classes out of includes/ to Html/
Bug: T321882
Change-Id: I5dc1f7e9c303cd3f5b9dd7010d6bb470d8400a18
2023-02-16 20:40:01 +01:00
Amir Sarabadani
bfedab2eb8 Reorg: Move CSP class to Request/
Bug: T321882
Change-Id: Ic809656a31e08626d0e5a1172da02b2397096e14
2023-02-16 13:36:41 +01:00
jenkins-bot
ca5d953895 Merge "Reorg: Move EditPage.php to MediaWiki\EditPage" 2023-02-16 09:31:42 +00:00
jenkins-bot
013287114a Merge "Hard-deprecate MWHttpRequest::factory" 2023-02-16 04:09:25 +00:00
jenkins-bot
8f0cea6182 Merge "ResourceLoader: Permit partial failure of encodeJson() and add logging" 2023-02-16 00:21:41 +00:00
Umherirrender
1ac173f02e title: Handle user name equal to interwiki prefix in TitleParser
When a title is parsed with a default namespace of NS_USER a possible
interwiki at the begin would make the title external and ignores the
default namespace, but it would call IPUtils::sanitizeIP with empty
string, returning null

Bug: T329690
Change-Id: Id2a32c87d09d92ead20ad58547c22a513084ffa2
2023-02-15 23:01:30 +01:00
Amir Sarabadani
5323501d53 Reorg: Move EditPage.php to MediaWiki\EditPage
Also moving TemplatesOnThisPageFormatter to the same namesapce as it's
only used by EditPage

Bug: T321882
Change-Id: Ibefc44eb64aedb430148b109090584c3e35794ab
2023-02-15 22:40:10 +01:00
jenkins-bot
251e02be96 Merge "Drop 1.34 db updates" 2023-02-15 12:51:34 +00:00
jenkins-bot
d26c959284 Merge "Make it possible to override the session in REST API tests" 2023-02-15 02:02:42 +00:00
Timo Tijhof
2ab050f67b ResourceLoader: Permit partial failure of encodeJson() and add logging
Similar to the exception thrown by ResourceLoader::makeConfigSetScript,
but non-fatal so as to generally allow more things to continue working
without it being silent and without giving up visibility through
Logstash.

Bug: T329330
Change-Id: I89832142b55ec0f4d1168314a897624e13ac8a0f
2023-02-14 23:40:20 +00:00
jenkins-bot
83301c36bb Merge "Introduce a DatabaseBlockStoreFactory" 2023-02-14 19:13:02 +00:00
jenkins-bot
52e179de25 Merge "LinkFilter: Get rid of concept of field prefix in ::getQueryConditions" 2023-02-14 18:23:47 +00:00
Amir Sarabadani
a344672519 LinkFilter: Get rid of concept of field prefix in ::getQueryConditions
This made some sense in tables like pagelinks or templatelinks where
there are several tables with similar schemas (it's better to use a
central class intead but understandable).

For externallinks, it's completely useless. There is no other table with
_index_60 field and as result, no code actual use this option either.

It makes grepping harder, it's prone to errors and complicates the code
more than it needs to be.

Bug: T326251
Change-Id: I72ad81d5c3e8f62ceee30d9a44d71f37655ef506
2023-02-14 17:28:48 +01:00
Martin Urbanec
80bf808bb6 ApiQueryLanguageinfoTest: Do not pass a float to setFakeTime
ConvertibleTimestamp::setFakeTime is documented to
only take callbacks returning an int. ApiQueryLanguageinfoTest
violated this expectation, resulting in test breakage
(see I06c625abe351b2f189f5dbf6f331d34bb56004b2).

To get some integers to chose from, bump MAX_EXECUTE_SECONDS
to three.

Bug: T329609
Change-Id: I82d49a5e3a52c14dbd7e5324eb4c75cf7c33f3d2
2023-02-14 11:53:42 +00:00
Umherirrender
a486e302ac Hard-deprecate MWHttpRequest::factory
Bug: T324918
Change-Id: I360d57b5aa9e2e8cbfc8b5c5654ab1aaf1d944b3
2023-02-13 23:22:11 +01:00
jenkins-bot
b917df7c99 Merge "phpunit: Generalize LanguageConverterTestTrait and simplify tests" 2023-02-13 21:29:37 +00:00
Func
9c40fc6e81 phpunit: Generalize LanguageConverterTestTrait and simplify tests
I will need to mark the LanguageConverterIntegrationTest as
`@group Database` and move testHasVariant() to LanguageConverterTest
in the follow-up. Split this part out for smoother review.

Change-Id: I4f65669d982cc477992708d9dd49d1dc22c905c8
2023-02-13 21:12:33 +00:00
jenkins-bot
8905bd9fae Merge "Apply variant conversion to page bundles" 2023-02-13 20:29:06 +00:00
Alexander Vorwerk
ef52ed41bb Introduce a DatabaseBlockStoreFactory
The DatabaseBlockStoreFactory is a new service which allows fetching
of a wiki-specific DatabaseBlockStore by fetching the correct
LoadBalancer via a LBFactory and then injecting it into the
DatabaseBlockStore. It also creates a wiki-specific ReadOnlyMode
and BlockRestrictionStore, which are also being injected.

This is being done as a part of the project of supporting cross-wiki
blocking.

The future plan is that BlockUser and UnblockUser are being updated to
properly support creating, updating and deleting cross-wiki blocks.
BlockUser and UnblockUser are then going to use a newly injected
DatabaseBlockStoreFactory to fetch the correct DatabaseBlockStore to
then insert/update/remove the block into/from the correct database.

Bug: T291849
Change-Id: I1051beedfd67c4e2c546b9eec04b6d592d969af3
2023-02-13 01:59:55 +00:00
jenkins-bot
1ec7ef8fe4 Merge "upload: Allow attributes starting with "on" in inkscape SVG namespace" 2023-02-13 00:58:17 +00:00
Derk-Jan Hartman
c64a8faab6 upload: Allow attributes starting with "on" in inkscape SVG namespace
Inkscape has an attribute only-selected in it's namespace which
is not interpreted by browsers and should be safe upload.

Bug: T288186
Change-Id: I044f225aef813efc708eb96f588fc55733d165f3
2023-02-13 00:41:22 +00:00
jenkins-bot
752297c8c9 Merge "permissions: Check cascade protection only if page can exists" 2023-02-10 23:37:45 +00:00
Umherirrender
607dde7c0c permissions: Check cascade protection only if page can exists
No need to ask the database for special pages

Set valid title in tests to pass canExists check

Change-Id: Ic6db74cf671484db475a0a646b372c814ea41918
2023-02-10 20:11:07 +00:00
C. Scott Ananian
d5b39490ca Remove back-compatibility code for ToC marker
Before 1.39 we used <mw:toc> and in 1.39 we switched to <mw:tocplace/>
(commit 24949480eb).  This was changed
to a <meta> tag in 1.40 (commit
0b10563895 and
fa8646ca7b) and the old content has long
since expired from the ParserCache.  Clean up the old ParserCache
transition code.

Change-Id: I3254d0acba31e107b50767797a2b0ad28aba59ee
2023-02-10 00:03:54 -05:00
Alexander Vorwerk
599b5a0918 Drop 1.34 db updates
Per official policy, updates from versions older than two TLS releases
are not supported.

Change-Id: I3dc98fe61c8a508aa3ade694f8c0a6a00115031b
2023-02-09 23:28:10 +00:00
jenkins-bot
9f2e36641c Merge "Reorg: Move category-related classes from includes/ to Category/" 2023-02-09 23:20:40 +00:00
Amir Sarabadani
c8116223b4 Reorg: Move category-related classes from includes/ to Category/
Bug: T321882
Change-Id: I0b86acfdeaa3a2a0a14b7763fd088122820bafdc
2023-02-09 20:18:54 +01:00
jenkins-bot
f2053bd1b2 Merge "rdbms: clean up LoadBalancer/ChronologyProtector primary pos methods" 2023-02-09 17:36:29 +00:00
Aaron Schulz
8e1bb24eed rdbms: clean up LoadBalancer/ChronologyProtector primary pos methods
In LoadBalancer:
* Make the "chronologyCallback" return the DBPrimaryPos and make
  loadSessionPrimaryPos() set the "waitForPos" more directly by
  calling setSessionPrimaryPosIfHigher(). Previously, it relied
  on the callback calling waitFor() to set the position as a side
  effect.
* Remove redundant debug log entry in loadSessionPrimaryPos().
* Use type hints for waitFor()/waitForAll(). All callers already check
  this for before invocation.
* Mark getReplicaResumePos() as @internal.

In ChronologyProtector:
* Update applySessionReplicationPosition() to return the position.
* Rename applySessionReplicationPosition() to yieldSessionPrimaryPos()
  and stageSessionReplicationPosition() to stageSessionPrimaryPos() for
  for consistency LoadBalancer/DBPrimaryPos.

Bug: T314434
Change-Id: I32aa784b424e7534047c9240e32fa5e0a2ac90b0
2023-02-09 17:19:36 +00:00
C. Scott Ananian
310d335136 Improve ApiQuerySiteInfo handling of deprecated and "extra" language links
Fix documentation related to ExtraInterlanguageLinkPrefixes
configuration: it should be a list, not a map, and described usage
better.

In ApiQuerySiteInfo, third-party clients (like Parsoid) need to know
whether a given language link core corresponds to a deprecated
language code or a "real" one; the API was also missing information
regarding which language code an "extra language link" prefix
corresponds to (given by InterlanguageLinkCodeMap in the
configuration).

Finally, add the corresponding bcp47 codes for these interlanguage
links, so third-party clients don't need to know details of mediawiki
internal and deprecated language codes.

Change-Id: I82465261bc66f0b0cd30d361c299f08066494762
2023-02-09 16:27:24 +00:00
daniel
f598760239 Apply variant conversion to page bundles
Bug: T277059
Change-Id: I27348684097cac7f2c4246cd689da3ec41995c27
2023-02-09 14:04:27 +01:00
jenkins-bot
fef17d0d82 Merge "phpunit: Add PHPUNIT_LOGS flag" 2023-02-09 08:49:12 +00:00
Gergő Tisza
09357c46c5
phpunit: Add PHPUNIT_LOGS flag
Dumping logs can be useful for interpreting CI test failures, but
is rarely needed when running phpunit locally and it makes the
output unreadable. In theory it should be possible to disable them
with the --no-extensions flag but that doesn't seem to work.

Allow disabling log dumping by prefixing the phpunit command with
PHPUNIT_LOGS=0.

Change-Id: I071ff3228e922c9aaf705e32e9e1a2351bb1e973
2023-02-08 22:15:32 -08:00
jenkins-bot
6494f7b6dd Merge "Remove unused arguments to private functions" 2023-02-08 22:42:46 +00:00
Umherirrender
ed169d991e Remove unused arguments to private functions
Found by phan dead detection

Change-Id: I93379b7b9a733206d0e53add04fcdb9478c58755
2023-02-08 19:00:47 +00:00
jenkins-bot
b4e039dc60 Merge "ResourceLoader: Remove SVG fallback hack from SkinModule" 2023-02-08 13:14:02 +00:00
jenkins-bot
c3e74c2f99 Merge "ResourceLoader: Remove SVG fallback hack from ImageModule" 2023-02-08 13:13:55 +00:00
jenkins-bot
0aafada46a Merge "unittests: rename some files to match the class name" 2023-02-08 07:42:51 +00:00
Aaron Schulz
d467d00834 unittests: rename some files to match the class name
This avoids paratest worker crashes

Change-Id: Ic58384298c630ab83d65e4c4c4da85ed2138fcce
2023-02-08 07:27:44 +00:00
Bartosz Dziewoński
d3c64c5ce6 ResourceLoader: Remove SVG fallback hack from SkinModule
Bug: T329127
Change-Id: I28c02efc137c3a9ceacdc07366ac374c70b0fb7e
2023-02-08 00:32:52 +00:00