Commit graph

67830 commits

Author SHA1 Message Date
Umherirrender
3b53613dcb api: Replace deprecated ApiPageSet::getGoodTitles in ApiPurge
Use existing variables instead of getting things every time

Change-Id: I889249fd0a4f2a0f4f2a7c1f9908109e87cf0e2a
2022-02-11 23:57:48 +01:00
Aaron Schulz
b144576f65 rdbms: add note about default DB domains to ILBFactory::(get|new)MainLB
Change-Id: I9539a4f81fa61107eb931f30d73744c58463b648
2022-02-11 18:43:00 +00:00
jenkins-bot
2bc6fddc40 Merge "EditPage: misc cleanup" 2022-02-11 12:52:05 +00:00
Daimona Eaytoy
bd371e2e94 EditPage: misc cleanup
Mostly, use strict comparisons, and use Html:: methods instead of
building strings manually when convenient. Also add typehints to private
methods and replace a couple of deprecated things.

Also ensure that $this->section is always a string (like the
documentation claims) by setting a default in importFormData.

Change-Id: Id7c8817e55b5deb85788b1d3491f9be4d2a95874
2022-02-11 11:46:19 +00:00
jenkins-bot
108f251694 Merge "Chinese Conversion Table Update 2021-3" 2022-02-11 00:14:31 +00:00
jenkins-bot
dae88d0636 Merge "Improve ObjectCache integration tests" 2022-02-11 00:05:53 +00:00
Tim Starling
e582572622 Improve ObjectCache integration tests
* Add BagOStuffTest subclasses for all core BagOStuff subclasses,
  replacing PHPUNIT_USE_BAGOSTUFF, as suggested in a todo comment.
* Add config $wgEnableRemoteBagOStuffTests which causes all tests
  enabled by $wgObjectCache to execute, which means that the memcached
  tests are executed by default.

I have verified all except RESTBagOStuff and WinCacheBagOStuff. The
memcached tests fail against memcached 1.5.x but pass against memcached
1.6.x.

Bug: T90875
Change-Id: Id74b5226669f8cb857f859fbc35bc58ab001e873
2022-02-11 10:20:33 +11:00
Umherirrender
0c8fdfe2e9 Sort services injected into specialpage pagers
Make the context source not-null

Bug: T290405
Change-Id: I20ba83caa35403a779f78c5e45af227b46dcf8f4
2022-02-10 23:15:41 +00:00
jenkins-bot
0607fc561a Merge "Don't double-escape the ellipses in Language::truncateForVisual()" 2022-02-10 22:47:33 +00:00
C. Scott Ananian
9e033de4f2 Don't double-escape the ellipses in Language::truncateForVisual()
It turns out this gets rid of a bunch of suppressed
"SecurityCheck-DoubleEscaped" that appear to have been accurate
warnings.

There seems to have been some confusion about how ::truncateForVisual()
is supposed to be used; in particular it is to be passed *unescaped*
output, because it is not (generally speaking) safe to truncate
HTML-escaped strings.  The goal of ::truncateForVisual() is to have
a specific number of codepoints in the output for display purposes,
the encoding of those codepoints is not an issue (htmlspecialchars
can be applied to the *return value*.)  If you need a specific number
of *bytes* you should be using ::truncateForDatabase().  If you want
a certain number of *HTML bytes* then the ::truncateHtml() method
is probably what you want.

Slightly refactor some code in RevDelLogItem to avoid a false positive.

Bug: T301205
Bug: T290624
Change-Id: I893362e049aedfa699043fcf27caf4815196f748
2022-02-10 17:09:18 -05:00
jenkins-bot
feba7354b5 Merge "rdbms: use existing config in MWLBFactory::applyDefaultConfig" 2022-02-10 21:39:49 +00:00
jenkins-bot
7c96930134 Merge "Introduce SkinComponent and SkinComponentLogos" 2022-02-10 21:14:13 +00:00
mainframe98
cda8543619 rdbms: use existing config in MWLBFactory::applyDefaultConfig
Calling the service locator in code used in the service wiring is
asking for trouble.
I found this using some arcane hack that calls applyDefaultConfig
in its own, pre-setup, service locator.

A perfectly good ServiceOptions is available, with much less
indirection. Makes the thing more testable too.

Follow-up to I1a691f01cd82e60bf41207d32501edb4b9835e37.

Change-Id: I38d4db2b7d897ebbceac8e773bb0512a8fc484d3
2022-02-10 19:46:40 +00:00
jenkins-bot
266ea54b37 Merge "ContentHandler: Avoding saving in ParserCache in search index jobs" 2022-02-10 18:25:43 +00:00
jenkins-bot
b955dcb47e Merge "Rename ForeignRepoWithMWAPI -> IForeignRepoWithMWApi" 2022-02-10 17:34:42 +00:00
Nikki Nikkhoui
d13745aac1 Add @throws annotation to getRedirectTarget()
T301346 was caused by a SpecialPage being passed
from this function down the chain to WikiPageFactory::newFromTitle
which only accepts a ProperPageIdentity.

Document that this function will @throw even though its
param is only typed to accept PageIdentity.

Bug: T301346
Change-Id: Ie61abd74d1be6942d98efa16f8f440e25dc6db88
2022-02-10 11:25:43 -05:00
jdlrobson
f7693089a8 Introduce SkinComponent and SkinComponentLogos
In preparation for refactoring SkinTemplate so that SkinMustache
extends Skin rather than SkinTemplate, we take the opportunity
to reorganize the skin code around the concept of components.

Going forward a skin will consist of multiple components, each
of which must return template data that can be passed to an
associated template.

This will result in code that is easier to work with, compared
with the existing 3000 line skin class.

This is the beginning of that journey. Other components will follow
while maintaining backwards compatibility

Bug: T263213
Change-Id: Ib62724c24601e04aa13ab09b3242e70d7d6436ca
2022-02-10 08:10:24 -08:00
jenkins-bot
7db80245b7 Merge "RefreshLinksJob: Restructure refreshlinks.* metrics and improve docs" 2022-02-10 11:36:53 +00:00
jenkins-bot
7e19c4749d Merge "Add OutputPage::disableClientCache() and deprecate ::enableClientCache(false)" 2022-02-10 07:01:21 +00:00
jenkins-bot
67a5c78758 Merge "Use $parserOutput to refer to instances of ParserOutput" 2022-02-10 06:53:51 +00:00
jenkins-bot
ec6f95c6ac Merge "Add parameter type to ParserOutput::setEnableOOUI()" 2022-02-10 06:50:02 +00:00
jenkins-bot
55814d0a58 Merge "Add return types to methods in ParserOutput" 2022-02-10 06:49:20 +00:00
Bartosz Dziewoński
41d167ff52 LogEventsList: Set context page for {{PAGENAME}} etc. in showLogExtract()
Bug: T300184
Change-Id: I6e9356a6cc3b9df9b508c3d37a0b9b75d6825efd
2022-02-10 05:34:40 +00:00
jenkins-bot
5a8dc8f177 Merge "DerivedPageDataUpdater: Set ParserOutput when it's passed to it" 2022-02-10 04:39:24 +00:00
jenkins-bot
13b91c70e7 Merge "Add hook to allow extensions to prevent preferences being exported client-side" 2022-02-10 03:35:00 +00:00
jenkins-bot
dd5de8b4a8 Merge "Reduce WANObjectCache hits on page view" 2022-02-10 02:01:33 +00:00
Amir Sarabadani
3dc1b21110 ContentHandler: Avoding saving in ParserCache in search index jobs
This is adding a lot of PC entries for pages that possibly won't ever
be visited. This is similar to what Refreshlinks job does and doesn't
save at all.

Bug: T285993
Change-Id: I68c14932d568795ab54074e073eab2a80517ed70
2022-02-10 01:07:44 +00:00
jenkins-bot
1a0d3d0e5d Merge "Title: Optimize invoking newFromText() with empty string" 2022-02-10 01:03:52 +00:00
Timo Tijhof
8eee142af2 RefreshLinksJob: Restructure refreshlinks.* metrics and improve docs
Change the metric names such that they do not overlap between
logically unrelated categories.

One non-overlapping metric for outcomes.

One misc metric for warnings and other unusual observations which
may overlap with outcomes.

Within outcomes, don't require metric queries to the names and/or
manually group them as positive or negative. Use a prefix to
distinguish between early exists that are bad (logged as failure and
will retry), and those that are considered good (no problem,
job superseded, no retry needed).

Bug: T301432
Change-Id: I2d5f3cc7cc2229cd910f341cf1f51d1e26be6e58
2022-02-10 00:37:27 +00:00
Tim Starling
a72c58e276 Reduce WANObjectCache hits on page view
When a nonexistent message is requested, a WAN cache request results,
because nonexistent keys are suppressed in the main cache by
isMainCacheable(). There is some performance degradation when such
keys are requested on every page view.

So:

* Make it so that keys prefixed with accesskey-, tooltip- and nstab-
  use Message::isDisabled() instead of Message::exists(), so that they
  can be blank instead of missing by default.
* Add blank messages for several such keys.

Change-Id: Ie70d849a8ecbf9ab70e58f582b9ba89afe9f2829
2022-02-10 11:04:54 +11:00
jenkins-bot
c6255e1545 Merge "RefreshLinksJob: assert proper title" 2022-02-09 23:13:27 +00:00
Amir Sarabadani
a965ceab7b DerivedPageDataUpdater: Set ParserOutput when it's passed to it
This fixes duplicate parsing in RefreshLinksJob

Bug: T301309
Change-Id: I3e75621a4e4fccd46836a6f9da5778aa521ca09a
2022-02-09 23:40:48 +01:00
jenkins-bot
aab0f8f075 Merge "Modernize some warnings about account not being registered" 2022-02-09 22:02:35 +00:00
Bartosz Dziewoński
858e7af980 Modernize some warnings about account not being registered
The "error" class nowadays is only supposed to be used by Parser and
related code. It renders as red text with no special formatting.
Instead use Html::warningBox(), which renders a yellow box around the
text. (Not Html::errorBox(), because these are not really errors.)

Change-Id: I7a7046bf9b9765cbb82ec3caa1530de7f05e0da4
2022-02-09 21:25:19 +00:00
C. Scott Ananian
1f309f9aa5 Use $parserOutput to refer to instances of ParserOutput
This just helps distinguish ParserOutput and OutputPage in code search,
since they have many identically-named methods.

(See Ie4d6bbe258cc483d5693f7a27dbccb60d8f37e2c for instance.)

Change-Id: I786381c98c6d7e1f5e9d7333d6f53a282985fbbc
2022-02-09 16:23:15 -05:00
jenkins-bot
70546d6a6c Merge "Add simple configuration doc generator" 2022-02-09 20:11:34 +00:00
jenkins-bot
499f36d60f Merge "HTMLMultiSelectField: Add forced-on options to the output of filter" 2022-02-09 19:53:08 +00:00
jenkins-bot
aa9530f3cf Merge "Clean up SpecialEditTags" 2022-02-09 19:52:16 +00:00
daniel
b1e3100feb RefreshLinksJob: assert proper title
If a RefreshLinksJob is created with an improper/invalid title,
executing the job later will fail with a PageAssertionException
while trying to create a WikiPage for that title. Better check
the title when constructing the job, so the offending code is on the
stack when it happens.

Bug: T293291
Depends-On: I7dcfac0eacdd5b22bdf443e88f8e6ddb883b92cc
Change-Id: I77a622591836873415f097453da01ca7e61c41be
2022-02-09 20:39:08 +01:00
Ammarpad
7a85d17d52 Title: Optimize invoking newFromText() with empty string
Title::newFromText with empty string will always yields null.

But the decision to return null is only made after applying
various normalization and filtering routines, which will
eventually have zero effect on the return value. So we may
just return the null early as we do with null itself.

Change-Id: Ic277a6e8c8c0b2a0b6af78f6524b80574c4602af
2022-02-09 18:22:52 +00:00
jenkins-bot
563ff0dc1f Merge "TemplateParser: Only hash unique files" 2022-02-09 18:22:27 +00:00
C. Scott Ananian
735670adba Add parameter type to ParserOutput::setEnableOOUI()
This is a tiny cleanup.  All the callers have been checked to pass boolean
values here.

Change-Id: I113648ea8262065dbfc0a6b61f3bc7abb2611b98
2022-02-09 12:47:05 -05:00
C. Scott Ananian
98615667f7 Add return types to methods in ParserOutput
Just added the low-hanging fruit: the methods where the return type was
obvious from local inspection.

Change-Id: If6aabfc8f0dacb156167745808fd5c57cdb3eb23
2022-02-09 12:47:05 -05:00
Petr Pchelko
ef73bfafd9 Add simple configuration doc generator
This is a first draft of the configuration doc renderer.
The resulting markdown certainly needs some love, but
we can work on improvements incrementally. This gives
us a baseline to reference on doc.wikimedia.org

Bug: T296647
Change-Id: I3c426b9fc37b1cf7ce8423969b2d7589767ee6cc
2022-02-09 07:09:32 -08:00
Alexander Vorwerk
c4649ddaee SearchHandler: skip search results which are no proper pages
Bug: T301346
Change-Id: Iaf38791bb0cb98983d8a1c8dc87a7ebdd96e4235
2022-02-09 16:06:13 +01:00
Sam Smith
f18338fadd TemplateParser: Only hash unique files
LightnCandy resolves recursively-defined partials twice, which leads to
the template file being hashed twice. While the cost of hashing the
partial the second time is minimised due to
FileContentsHasher::getFileContentsHash() caching the hash of a file in
APCu, it need not be paid.

Bug: T300210
Change-Id: Id3f62bf32c47f21181b1ec6d77a5ae9a703952b1
2022-02-09 14:12:24 +00:00
Func
3722dc30d6 HTMLMultiSelectField: Add forced-on options to the output of filter
Forced-on options (selected as default but disabled) should always in
the loaded data, like what HTMLCheckMatrix do.

Change-Id: I342928eca01ae8a9f34ee7156a515524c3a0d9dd
2022-02-09 07:32:12 +00:00
Funcer8
14b0b7c25a Clean up SpecialEditTags
Permission checks is already done in checkPermissions(), remove extra checks.

Change-Id: Ia2d70455c1bd0dc271c817c4e27851385cd39fb7
2022-02-09 15:16:29 +08:00
Translation updater bot
44e0788728 Localisation updates from https://translatewiki.net.
Change-Id: I67560b0421813794b150dac2f12e639ba2e2e7a8
2022-02-09 08:01:45 +01:00
jenkins-bot
2dbd73b526 Merge "skins: Memoize buildSidebar()" 2022-02-09 05:25:39 +00:00