Commit graph

57 commits

Author SHA1 Message Date
David Causse
9fbd8f500f Make the doc building for search aware of the revision
Added an optional RevisionRecord param to:
- ContentHandler::getParserOutputForIndexing
- ContentHandler::getDataForSearchIndex
- the SearchDataForIndex hook

So that they have a chance to build the content related to a specific
revision.

Ultimately we'd like to make this parameter mandatory.

Bug: T317309
Depends-On: I8b220cd6c4aeeca1d924bdd527409b8602318944
Depends-On: I8616b611caab3f5fa97ff0e655b19c3034304597
Change-Id: I3298ce7591069eb32f624b2c9fbb6de58ae04a29
2022-10-25 18:45:23 +02:00
Reedy
fb742a9872 Upgrading wikimedia/xmp-reader (0.8.4 => 0.9.0)
Bug: T320282
Change-Id: I6ab1ff865a98203410374fe7ae196ab49d9673ba
Depends-On: I52f44ec52a36d9d2ca4752bcd97972806aca83ba
2022-10-19 20:48:52 +01:00
jenkins-bot
2269acd4e7 Merge "lockmanager: remove MysqlLockManager and DBLockManager" 2022-10-18 22:31:20 +00:00
jenkins-bot
e52790fc72 Merge "Add Arakanese (rki) to Names.php" 2022-10-18 10:10:02 +00:00
jenkins-bot
a6778bfa62 Merge "Create Hook to check block's error messages from extensions" 2022-10-17 16:16:49 +00:00
Amir E. Aharoni
11e00bc1e1 Add Arakanese (rki) to Names.php
MessagesRki.php is mostly copied from MessagesMy.php.
Date format in the same as in Burmese, as confirmed
by User:YaThaWinTha, who also contributed namespaces at
https://incubator.wikimedia.org/wiki/Talk:Wp/rki/Main_Page

Bug: T320912
Depends-On: I582550df8fd5887b48dbf5c98e51551629d8e734
Change-Id: I4180431cf70c23eadd16c55389f08a78700f4777
2022-10-17 17:29:57 +03:00
Matthias Mullie
ea6c1ceebb Add preference to control Special:Search thumbnails
Bug: T320337
Change-Id: I828dcd3679a4869b3b58b05d7cdca6c9f8a45d3e
2022-10-17 13:48:12 +02:00
Aaron Schulz
8607105de9 lockmanager: remove MysqlLockManager and DBLockManager
This obscure class could only be used by running file_locks.sql and
customizing $wgLockManagers. It was not worth the overhead of having
to maintain it.

Remove DBLockManager since there are no subclasses now.

Change-Id: Id7e3fde02dfca02271bcec039be5c079de9de830
2022-10-14 17:43:44 -07:00
AnaïsGueyte
cc55e848e4 Create Hook to check block's error messages from extensions
Bug: T317201
Change-Id: I1c20e7e62e0f2b453735689e3dc543164b5fd067
2022-10-14 11:43:21 -04:00
Timo Tijhof
06245f3f4f SpecialVersion: Clean up count(), early return, strict types
* Remove some use of `count()` in favour of boolean checks.

* Where trivial to do, add native return types to remove doubt
  of the value possibly not being an array.

* Follow-up I7d97a4cdc9 (d4df7daa) and mark more methods as private
  that were wrongly marked public en-mass when we added visibility
  attributes but have no use outside core on a SpecialPage class that
  generally has no use case for being extended or instantiated
  outside core.

Change-Id: Iaf28b6132097fe34872c2a2da374ff00593ca6a9
2022-10-13 19:21:13 +01:00
C. Scott Ananian
4cb3957cf0 Remove $wgParserTestFiles, deprecated in MW 1.30
This global variable was replaced by auto-discovery of parser test
files in extensions and is no longer needed (or used).

Change-Id: Ib616e60f36db32ffd8bc69c71a096f23c0a27910
2022-10-13 09:22:22 -04:00
jenkins-bot
c77ea2cd6e Merge "lockmanager: remove PostgreSqlLockManager" 2022-10-13 05:54:57 +00:00
jenkins-bot
f221b44a08 Merge "Remove deprecated global function wfLogProfilingData" 2022-10-12 19:15:37 +00:00
Tim Starling
94e20db64b Add some helpers to filter properties out of var_dump()
Dumping many kinds of object with var_dump() leads to dumping the whole
address space, because a chain of references leads to MediaWikiServices.

So, introduce a trait which replaces the problematic properties with a
placeholder, if their doc comment contains @noVarDump.

Bug: T277618
Change-Id: Ifa685c26fbc5317d0359544289ec3f433ec4fedf
2022-10-12 12:42:23 -04:00
Aaron Schulz
2fa8eb2c80 lockmanager: remove PostgreSqlLockManager
This obscure class could only be used by customizing $wgLockManagers
and was not worth the overhead of maintaining it.

Change-Id: Ia8f802b2c68f0f6b4278d16c67464c3b814c87f6
2022-10-11 22:14:48 -07:00
jenkins-bot
b904257d47 Merge "Upgrading guzzlehttp/guzzle (7.4.5 => 7.5.0)" 2022-10-11 19:34:34 +00:00
Amir E. Aharoni
6107c3a885 Add Magahi language (mag)
All the values in MessagesMag.php are
copied from MessagesHi.php.

Bug: T320465
Change-Id: I43a852f02118eb227791dc3a95dcc9c9e17b8d4a
2022-10-11 17:54:19 +03:00
Daimona Eaytoy
7a494d1fa4 tests: Upgrade PHPUnit from 8.5+ to 9.5+
* DeprecatedHooksTest: Don't use assertContains().
* Replace uses of deprecated asserts:
  - assertFileNotExists() -> assertFileDoesNotExist()
* Update hierarchy of MediaWikiPHPUnitResultPrinter, since ResultPrinter
  is an interface in PHPUnit 9.
* Remove temporary forward-compat methods.
* Remove directories that don't exist from tests/phpunit/suite.xml, since
  they now make PHPUnit exit:
   - tests/phpunit/skins, it used to have SideBarTest, then moved to
     tests/phpunit/includes/skins
   - tests/phpunit/documentation, it used to have ReleaseNotesTest, then
     moved to tests/phpunit/unit/documentation
* Update configuration with --migrate-configuration and reformat.
* Avoid redefining getMockBuilder() in
  ActionModuleBasedHandlerTestTrait, use a @method annotation instead.
* In RCCacheEntryFactoryTest, avoid using internal PHPUnit logic for
  HTML validation, and use native PHP methods instead. The code was
  copied from Xml::load (moved to \Xml\Loader::load in PHPUnit 9) and
  simplified for this use case.

Bug: T243600
Bug: T262076
Change-Id: I851b9158b73d0cfc315eed9d63b15c54b05895e3
2022-10-08 02:03:55 +02:00
James D. Forrester
70b4f005b1 Follow-up b70581e4ca: Mention upgraded devLibs in RELEASE-NOTES
Change-Id: I138e171a33244c24fea90aab6e235b42c9473b4a
2022-10-07 15:40:17 -04:00
jenkins-bot
baf8e62ee5 Merge "ServiceWiring: Remove backcompat code and kill $wgShellboxUrl" 2022-10-06 03:49:34 +00:00
jenkins-bot
3319896200 Merge "Remove Collation::singleton()/factory()" 2022-10-05 15:19:57 +00:00
Derick Alangi
0ec96651f7 ServiceWiring: Remove backcompat code and kill $wgShellboxUrl
https://codesearch.wmcloud.org/search/?q=ShellboxUrl&i=nope&files=&excludeFiles=&repos=
shows that this is indeed not used and should have been removed by
1.38

Change-Id: I23cc10e4838050e20c24922145e551f3c070ff2f
2022-10-05 11:45:54 +00:00
Kevin Israel
47241a3520 Use OpenSSL if available for PBKDF2 password hashing
This at least doubles the speed, which would allow the number of
iterations to be doubled and computation of the password hash to
complete in the same amount of time as before, or maybe even a
slight bit less.

The doubling in speed is due to an optimization[1] that so far has not
been accepted into PHP's hash extension.[2] In addition, OpenSSL has
optimized assembly-language hash function implementations for several
common CPU architectures. These provide a further, yet more slight,
performance improvement.

While OpenSSL's PKCS5_PBKDF2_HMAC() is not the fastest implementation
around, using it does not add a new library dependency. And although
better password hashing functions exist, PBKDF2 is still the default
in MediaWiki. For these reasons, I think this change makes sense.

[1]: https://github.com/openssl/openssl/commit/c10e3f0cffb3820d
[2]: https://github.com/php/php-src/issues/9604

Change-Id: I7b06590d4c42581f8749336f9c17777f973a506c
2022-10-04 19:46:14 -04:00
Matthias Mullie
c4a36b0023 Introduce SearchResultThumbnailProvider & move hook + NS_FILE thumbs in
What was previously a REST API-only feature (the thumbnails
hook allowing for thumbnails for non-file pages via the
PageImages extension) is now also being adopted in the main
search page.

That hook will now be called with NS_FILE result thumbnails
pre-filled, which was not the case previously. PageImages
essentially duplicated NS_FILE thumbnail logic that was
already present in Special:Search, so that can (and will
in a follow-up patch) then be removed there. Special:Search
will then simply take whatever is produced from the provider
(which will include both NS_FILE thumbs - which it handled
already - as well as whatever else it receives from the hook),
as will the REST API (which already received both)

Since thumbnails can now come in for multiple namespaces &
having some of those results with & others without a thumbnail
can be quite jarring, it was decided that we'd display
placeholder images (for certain namespaces). This is now
controlled by $wgThumbnailNamespaces.

I also split up a few things in FullSearchResultWidget::
generateFileHtml for more clarity.

Meanwhile also updated mediawiki.special.search.styles.less
to use variables for known colors.

Also implemented a 'transform' (required for testing this
change properly) and 'getDisplayWidthHeight' (it became
needed after implementing transform) callback function for
mock Files, and updated some existing tests in response to
these changes.

And some more Rest test files have been updated to allow
passing around a HookContainer instead of only an array of
hooks (from which a new HookContainer would then be created)
to allow the same container to be used across all relevant
objects, who may have it injected as dependency.

Bug: T306883
Change-Id: I2a679b51758020d3e822da01a1bde1ae632b0b0a
2022-10-03 10:52:50 +00:00
jenkins-bot
d65fe42169 Merge "wgPasswordPolicy: Raise default password length for basic users to 8 characters" 2022-10-01 04:45:20 +00:00
Umherirrender
56adfea4d3 context: Remove deprecated IContextSource::getStats() implementations
Hard-deprecated since a6fe660.

Change-Id: Id26aabcb6cbcedfe45224af161a998bda3aff451
2022-09-30 19:52:40 +00:00
Umherirrender
3029a7ecef Remove Collation::singleton()/factory()
Deprecated in 5b3d3ef, hard deprecated in 18734e0

Change-Id: I677bb722630b6f5bb9273e8a308f6de41b4ffacb
2022-09-30 19:47:34 +00:00
Umherirrender
b7f52e2fb9 Remove deprecated global function wfLogProfilingData
Deprecated in 296b485
Fix comment about this function and wrong mention of pre-send,
but it is post-send, documented in c49a45f

Change-Id: I29448377ca785843d7cd16f8c458d31b77b8bbe6
2022-09-30 21:24:48 +02:00
Umherirrender
c34db14fbe Remove deprecated global function wfQueriesMustScale
Last usage was in FlaggedRevs, removed in Ie3d8ab35c978458ee.
Deprecated in core since 1.39 with Ic2971c31f29babb48fb.

Change-Id: Ieaccaab3e8805ecb387480990f945bca6f989c2d
2022-09-30 18:48:11 +00:00
Reedy
86052bef70 Upgrading guzzlehttp/guzzle (7.4.5 => 7.5.0)
PHP 8.2 support

Change-Id: I20b5f7743cdee36f1274bcfad02ecb6e89a28ac8
Depends-On: I7c12ec0bb4dac2a6d4bf8923da03e56c2367fe0f
2022-09-30 17:57:47 +01:00
Reedy
28a7b6eea2 Upgrading pear/net_smtp (1.10.0 => 1.10.1)
Depends-On: I989e5262d0c5d9c5e263741e1f4e7763e00d4808
Change-Id: Ic1a7a9507e186e4c7bac8b0d252a3f3804bd6f4d
2022-09-30 00:27:55 +01:00
jenkins-bot
ca44e87f00 Merge "jobqueue: Remove unused EnqueueJob class" 2022-09-29 18:19:04 +00:00
jenkins-bot
056421a7b2 Merge "rdbms: Drop deprecated functions from LoadBalancer" 2022-09-29 17:31:18 +00:00
Amir Sarabadani
6b1d6e622d rdbms: Drop deprecated functions from LoadBalancer
- ::haveIndex()
  - ::isNonZeroLoad()

Deprecated in 1.34 and unused.

Change-Id: I08f8d8cad51ab1ec3c385c06737116d7ab71f2ca
2022-09-29 17:10:59 +00:00
jenkins-bot
eb8c59035c Merge "ApiSandbox: use formatversion=latest by default" 2022-09-29 16:18:02 +00:00
C. Scott Ananian
1898f04369 ApiSandbox: use formatversion=latest by default
Developers using ApiSandbox often don't realize they should be using
the "modern" formatversion=2 because our UX defaults to
formatversion=1.  We can't change the default in the action API due to
b/c, but we can hack things so that when you use ApiSandbox we
initialize the query to set formatversion=latest.  Hopefully this will
encourage adoption of the most modern formatversion and avoid client
bugs caused by the "falsey but present" values returned by
formatversion=1.

Change-Id: Ia7c8582a2589f971f1fb22fdc5afb3ee9bde1d50
2022-09-29 11:59:11 -04:00
James D. Forrester
a3828a7b25 Follow-up 0024c71: Move REL-NOT entry to 1.40, this didn't make REL1_39
Change-Id: Ibd2eedd840845768d5f1753bb18dfdc3a8be2e10
2022-09-28 16:32:34 -04:00
C. Scott Ananian
dd32fe1a34 Mark ParserOptions::{get,set}MaxTemplateDepth() @internal
This option is not used outside core, according to codesearch:

 https://codesearch.wmcloud.org/deployed/?q=etMaxTemplateDepth&i=nope&files=&excludeFiles=&repos=

ParserTests can set this in the site config; this doesn't need to be
a parser option.

Bug: T318826
Change-Id: I815d340a43870249db5e36084a5e5403bb71b6ca
2022-09-28 15:22:10 -04:00
C. Scott Ananian
b7b13c87f4 Mark ParserOptions::{get,set}ExternalLinkTarget() @internal
This option is not used outside core code, according to codesearch:

  https://codesearch.wmcloud.org/deployed/?q=etExternalLinkTarget&i=nope&files=&excludeFiles=&repos=

Users should set this in the site config, not as a parser option.

The installer will eventually invoke Parsoid directly (T317644) with
a custom site config.

Bug: T317647
Change-Id: I099c04045de256ef0fb4cb114ee3c2be350dfdc4
2022-09-28 15:17:33 -04:00
jenkins-bot
6fbe889e26 Merge "Componentize menulink + footer" 2022-09-28 18:25:04 +00:00
Timo Tijhof
4ecfa8e11d jobqueue: Remove unused EnqueueJob class
This was introduced in 2015 with 8e3721a2b9 (Iadb34f24d8b, T89308)
as part of the Multi-DC initiative, with the plan being to use this
job when queueng jobs during a requests that are not guruanteed to
be routed to a primary DC (e.g. during a GET request).

Its use was removed as part of T181216, but the job was kept and has
seen numerous maintenance changes since. I propose we remove it as it
is no longer used in any Wikimedia Gerrit hosted code.

The expectation now is that JobQueue backends are responsible for
making sure new jobs can be accepted in any DC. At WMF this happens
by writing to local EventBus/Kafka and the internal streams converging
and mirroring in both directions.

The built-in JobQueueDB implementation is unlikely to be used in for
large wiki farms, but it too would support writes from secondary DCs
from post-send. I haven't tested JobQueueRedis, but it seems like that
could likely also be used in a way that writes locally and replicates
writes from secondary to primary.

Bug: T89308
Change-Id: Ia84d0e9ca047cd78ab8c0d0d055d4199d0e3e5b6
2022-09-28 16:10:01 +01:00
Clare Ming
9c4f70c222 Componentize menulink + footer
- Add new menu components: Menu, Link, ListItem, Footer
- Add footer component which leverages menu components for
generating template data.
- Add footer to the component registry to be used in Skin class.
- Update Skin methods to leverage new Menu and related components.
- Move footer data generation methods from Skin and SkinTemplate
into SkinComponentFooter class  methods.
- Remove Skin::getFooterLinks, Skin::getSiteFooterLinks
- Deprecate Skin::footerLink.
- Update RELEASE-NOTES with breaking changes, deprecations.
- No visual regressions for the footer or menus.
- SkinComponentRegistryContext::getLanguage now returns language
object (interface is marked as @unstable so changes here acceptable)

Bug: T302116
Depends-On: I97512d06df6f86236379a16fb0fbd6aa3f61deb5
Change-Id: I06054c2dead4773789b8c3d88a6b1ed8f78cd614
2022-09-28 14:57:37 +00:00
James D. Forrester
6ab12893fd Update OOUI to v0.45.0
Release notes:
 https://gerrit.wikimedia.org/g/oojs/ui/+/v0.45.0/History.md

Bug: T311514
Bug: T315240
Bug: T316516
Depends-On: Ib700ffcc891a42591d85c8524e51a9ce1457dfb9
Change-Id: I6761406a37284c29e4d5b7247d53cc7d1c22ff77
2022-09-28 10:50:48 -04:00
James D. Forrester
2368233e2f wgPasswordPolicy: Raise default password length for basic users to 8 characters
This policy was just the fall-back set in 2015 with the default length
of 1. As pointed out on MediaWiki-l, it is a bit short nowadays, so
raise it to 8 characters, which is what we use in Wikimedia production.

Change-Id: I4e0e57ed910a16804e015c9f1aaf48a5603bf95f
2022-09-27 22:10:16 +00:00
James D. Forrester
c7ae41e325 resources: Drop jquery.throttle-debounce, deprecated since 1.33
Bug: T213426
Depends-On: I4c12c11c08b5a1ca41ddff685c187a86ac3aa888
Depends-On: Ic2d4e3e6322cd4037eda858698995769493e77fa
Depends-On: Id89711a056974ce63ba7950dc441de609654221e
Depends-On: I12bbd191fcc078e1b1a8f26520c9b085f62af231
Change-Id: I1dac28c84c534bf81c0ca664f47cf9f1e5593b63
2022-09-27 14:26:37 +00:00
Alexander Vorwerk
22dca3ab89 BadTitleError: Enable 1 hour CDN cache for this error response
Varnish is unable to cache these currently. However since pages with an
invalid title will never have any variable/editable content, we can
cache them unconditionally.

Also, undeprecate OutputPage::enableClientCache for this since it
is clearly useful here, but the parameter is being removed since
OutputPage::disableClientCache should be used to disable client side
caching instead.

Bug: T316932
Change-Id: Ib98fd165bffd9ca3dcbbcb8c6f06964dba7c90b7
2022-09-26 20:27:24 +00:00
Umherirrender
e0dfa35032 Remove JobQueueGroup::singleton()/destroySingletons()
Bug: T301016
Change-Id: Ia059bff9a9e0c61dcd803c5a69261827b1fc0fa3
2022-09-26 18:10:44 +02:00
Umherirrender
04bd85cd5e Remove hard-deprecated wfReadOnly/wfReadOnlyReason
Bug: T283978
Change-Id: I2ef829bb9f5b89d4b9c77718ca2e090b0cbd3264
2022-09-23 22:44:44 +02:00
jenkins-bot
a8edb65c0e Merge "Update justinrainbow/json-schema to 5.2.12" 2022-09-21 19:12:23 +00:00
jenkins-bot
a2bab26fd0 Merge "Update symfony/yaml to 5.4.12" 2022-09-21 19:09:49 +00:00