Commit graph

1390 commits

Author SHA1 Message Date
jenkins-bot
ca44e87f00 Merge "jobqueue: Remove unused EnqueueJob class" 2022-09-29 18:19:04 +00:00
Amir Sarabadani
2b9fd5176d Drop support for doctrine/dbal < 3.0.0
Removes various hacks and back compat support

Bug: T270740
Change-Id: I17d74705cdd5a2e1af0bda66bfa466067b8387a8
2022-09-29 10:49:17 -04:00
jenkins-bot
6fbe889e26 Merge "Componentize menulink + footer" 2022-09-28 18:25:04 +00:00
Moh'd Khier Abualruz
58780e5279 Persistent contribution entry point on the mobile navigation menu
* Add new special page SpecialContribute
* Added messages and aliases for EN language
* Add classes to carry cards Data
* Added Hook ContributeCardsHook for adding/removing updating cards
* Moved HTML to template
* Added main page and 1st tab styles
* Removed the dependency on minerva skin code
* Added Unit Tests
* Fixed Jenkins, and qqq messages
* Added an override for getShortDescription in special pages to generate unified tab message keys

Bug: T286466
Change-Id: I7f064a954a77373dfec86efae7e378402f500198
2022-09-28 16:45:06 +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
Amir Sarabadani
c910301518 Drop useless maint scripts and sql files after 1.31-1.33 clean up
These files are not needed anymore. Either because they are orphan now
and no updater will run these sql files.

Or they are maint scripts to migrate the data and that has been removed
in I5ff9630a65 and I84bd1d3dbe7

Change-Id: I00c49d8d649e3fa7641f3c57bf3ea4440ae542df
2022-09-28 16:22:14 +02:00
jenkins-bot
1e60c7337a Merge "Create an HTMLForm field for selecting a timezone" 2022-09-23 18:16:06 +00:00
Daimona Eaytoy
ec09c19fba Create an HTMLForm field for selecting a timezone
This patch introduces HTMLTimezoneField, an HTMLForm field type that
allows the user to select a timezone, either from a geographic zone, by
manually entering an offset, or using the wiki/browser default. This
logic is extracted from DefaultPreferencesFactory so that it can be
reused elsewhere.

The widget itself is really just an HTMLSelectOrOtherField, it's just
the list of options and the JS logic that is special.

Bug: T309629
Change-Id: I99a00dff7e3319ce45883191daee16bec1ed68ba
2022-09-23 18:35:51 +02:00
Alexander Vorwerk
6b196b660d Remove the deprecated MWGrants class
Bug: T253077
Change-Id: I95c3e0668799e20e7e0abe5346e6d884502a5fb2
2022-09-16 17:07:20 +02:00
Amir Sarabadani
62a01b7e8c Introduce pruneUnusedLinkTargetRows maint script
To clean up unused linktarget rows

Bug: T299417
Change-Id: I59fd88368e84db7a22bf1e24c432b5bc669df1dc
2022-09-07 19:56:56 +02:00
Kunal Mehta
499a1fe497 rdbms: Move Database::factory() to DatabaseFactory service
We also bring along Database::attributesFromType(), which relied on the
private ::getClass(). This requires us to inject DatabaseFactory through
the LBFactory/LoadBalancer hierarchy.

Database::factory() is now soft deprecated. All callers outside of
includes/installer/ still need migration.

Bug: T299691
Bug: T315270
Change-Id: I7d057a9438f1b097554679975e4e9b2fc99e7c2b
2022-08-31 10:53:50 +10:00
C. Scott Ananian
d57c6ddcce Remove ParserGetVariableVarCacheHook, deprecated in 1.35
This exposed internal cache mechanisms of the Parser, and appears
to have been originally added in c08da372bc
but is unused in any code indexed by codesearch.

Bug: T236813
Change-Id: Iaa5da572d76b1d396ecc7e3d3eb29c8d7d4bcddd
2022-08-12 13:28:25 -04:00
Timo Tijhof
1016d3b9ba ResourceLoader: Fix confusing DependencyStoreException trace logs
After the roll-out of $wgResourceLoaderUseObjectCacheForDeps on
WMF wikis, there was an unrelated database spike that caused some
error messages:

> DependencyStoreException:
> Cannot access the database: Too many connections (db1132)

I found this confusing, because servers shouldn't be using old
DepStore class any more (ref T311788?). And because the new store
is x2.mainstash, whereas the reported hostname is an s1.enwiki host.

I wasted some time not trusting the code path as there was no Rdbms
trace available to confirm for sure that this isn't an unrelated query
that happens to be caught during the DepStore interaction (e.g. some
generic MW code running from a hook, or Rdbms internal query from
LoadMonitor etc).

Improve telemetry by preserving the original trace.

I considered passing `$e` as third parameter to
DependencyStoreException, but since the new implementation doesn't
actually use this class, it's effectively going to remain unused in the
future and would not reliably indicate anything in particular to callers
unaware of which implementation is in use. There's also some benefit
to being able to aggregate and filter out specific db issues, which
is made harder by the same issue being reported multiple different
ways through wrapped errors.

The old implementation will remain for one release as default, and
probably one release after that as option for any third parties that
encounter an issue during upgrade so as to not block their upgrade
while we find/address the issue in question.

Bug: T113916
Change-Id: Iaa3907fc3aa0622daa9648eabfdd7efabdd4f2a9
2022-08-01 20:46:26 -07:00
Umherirrender
9d37bc876c Remove deprecated maintenance script resetUserTokens.php
Change-Id: Icb4992e27e0a545dd81ece1368012d300550a25e
2022-07-12 21:07:13 +02:00
Timo Tijhof
051e127bdb language: Move l10n-related classes from /cache to /language
* Make the code easier to own and maintain by being part of a topical
  area of expertise rather than a generic catch-all bucket.
  This also helps Gerrit team dashboards, [[mw:Git/Reviewers]]
  subscription patterns, more meaningful component prefix for
  [[mw:Commit_message_guidelines]].

* Prep for possible CODEOWNERS adoption.

* Prep for T166010 to give us better PSR-4 namespaces that we won't
  have to break/migrate again shortly after for the above.

Bug: T225756
Change-Id: I62c701d574d2a79365b1c5350f92bef47770e3ce
2022-06-28 16:27:20 -07:00
Moh'd Khier Abualruz
a7831e4e37 Remove poweredbyico SkinTemplate variable AND SkinGetPoweredBy hook
- poweredbyico removed
- copyrightico removed
- SkinGetPoweredBy, SkinGetPoweredByHook removed
- Release Notes updated

Bug: T306138
Change-Id: I6171b487e1ab0235b81a8a21a1decaf5cfdc4c1c
2022-06-28 22:39:33 +00:00
Aaron Schulz
da9e4b52a5 rdbms: Add multi-statement query support to Database
Add Database::queryMulti(), which will execute an array of
queries as a batch with minimal roundtrips.

SQLite fallbacks to looping through each statement and
invoking doQuery().

Add QueryStatus class to reduce complexity in Database.

Rewrite doQuery() as doSingleStatementQuery().

Change-Id: I3d51083e36ab06fcc1d94558e51b38e106f71bb9
2022-06-09 11:45:38 +10:00
Derick Alangi
2a83d6bf84 maintenance: Display the birth date & age of a wiki install
This maint script computes and displays a wiki's birth date and
birthday in yy, mm, dd format.

Sometimes, one would like to know when a wiki was installed and
potentially the age of the wiki.

Change-Id: If42c74a04491d4331dcd7f6fc00c9460d6e1d51f
2022-06-07 11:50:24 +01:00
jenkins-bot
cf7f61fcf9 Merge "Settings: Generate schema artefacts using a single maintenance script" 2022-06-05 19:34:45 +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
Umherirrender
0441ea0371 specialpage: Remove deprecated class alias SpecialPageFactory
Deprecated since 1.35

Change-Id: I71682316a4aa7b7b1c9dc5af37b2b1a09126b57a
2022-06-03 14:07:22 +02:00
jenkins-bot
29878a3f71 Merge "api: Remove deprecated class alias ApiQueryContributions" 2022-05-29 07:10:16 +00:00
jenkins-bot
778494c6bf Merge "Remove deprecated MediaWiki\Storage namespace for revision related class" 2022-05-29 07:09:17 +00:00
jenkins-bot
3dba007822 Merge "content: Remove UnknownContent/UnknownContentHandler class alias" 2022-05-29 07:07:42 +00:00
Umherirrender
f07295ade1 content: Remove UnknownContent/UnknownContentHandler class alias
Renamed in a67cad6 in 1.36
The fallback content is designed for internal use only

Change-Id: I6977a9cf1eab0e701fd6969b1a2b5d1dfcecfdfa
2022-05-29 06:20:45 +00:00
Umherirrender
a2a1a4ecd2 Remove deprecated MediaWiki\Storage namespace for revision related class
All revision related classes are namespaced MediaWiki\Revision
instead of MediaWiki\Storage since 1.32. The old namespaced
class names are deprecated and only kept for backwards-compatibility.

Bug: T305784
Change-Id: I48cdc65301a8cd20d2bedd031dbdae33b8c2a34d
2022-05-29 06:17:01 +00:00
Umherirrender
2f7c0d6166 api: Remove deprecated class alias ApiQueryContributions
Deprecated since 1.32

Change-Id: Ia4d2d01272175972f29a724c06c249bfeb522cfe
2022-05-29 06:15:38 +00:00
Umherirrender
71974b4a3e language: Remove deprecated FakeConverter class alias
Deprecated since 1.35

Change-Id: If3f1eb881db9ebd89b39545285f0540e76ef62b6
2022-05-28 16:05:41 +02:00
jenkins-bot
efa485a54d Merge "Extract parameter handling from Maintenance base class." 2022-05-26 17:53:53 +00:00
daniel
a9f47fd5ad Extract parameter handling from Maintenance base class.
We will need parameter handling in the runner as well as in the actual
maintenance script. So pull it out, so we can re-use it.

Change-Id: Ib67667fead8350e0a539323fb05b160f4c2d882e
2022-05-25 10:40:24 +02: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
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
daniel
824ddac27b Move code from doMaintenance.php into a runner class.
This is the first step toweards having a proper script runner.

Change-Id: I121ef0186b7112f12d30229293baf89c93c971b4
2022-05-21 16:09:57 +02: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
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
Alexander Vorwerk
ea1c106ea9 Remove the deprecated MWNamespace class
Bug: T291389
Change-Id: I98ec284bdf8599ee2edfad55096dc42ba3ed23d4
2022-05-14 11:38:43 +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
Amir Sarabadani
ca5b162c23 rdbms: Start using SQLPlatform and move more methods there
The first of many changes decoupling SQL building blocks from Database
class.

Bug: T299691
Depends-On: I5d1d5b9b875bced7bda234f45d6d22ed59db4871
Change-Id: I784e78361f5ee629d31c68629d669ee0ddddf929
2022-05-04 18:34:13 +00:00
Tim Starling
05701ffc40 rdbms: Remove instance ownership concept
Instance ownership is supposed to protect LoadBalancer and Database
against unauthorized calls to internal methods other than by the owning
LoadBalancer/LBFactory. This seems like unnecessary complexity. It was
introduced for T231443 and T217819, but the link was speculative and in
the end it didn't help to fix or isolate those bugs. Since then it has
caused a production error (T303885) and an intermittent CI failure
(T292239).

Instead, split the ILoadBalancer interface, introducing
ILoadBalancerForOwner, which contains the methods which are only safe
to call by LBFactory or by the caller of LBFactory::newMainLB(). This
allows phan to statically detect inappropriate calls to internal
methods.

Ownership was used for convenience for two things unrelated to its
original purpose:

* Suppressing calls to ScopedCallback::newScopedIgnoreUserAbort() when
  the caller has already called it. But nested calls are apparently
  harmless, so I just called it unconditionally.
* Suppressing exceptions from Database::close(). I extended the
  behaviour for owned instances to apply to all instances, so even
  unowned instances will no longer throw on close.

CodeSearch suggests nothing in extensions is calling these methods with
an owner parameter. One extension (Wikibase) overrides a method with an
owner parameter in a test mock class and so needs to be simultaneously
updated.

Depends-On: Ib03aba9d8f5f05b875a321d00b14483633a636a8
Change-Id: I27ba4973d24d759c88b3868c95e7db875801ca0c
2022-04-26 11:48:46 +10:00
Amir Sarabadani
236a0941c0 rdmbs: Start of SQLPlatform to split out of Database
This is the first step to split parts of Database that doesn't require a
connection and are used for query parts.

Bug: T299691
Change-Id: I140aa4328865994499926f898233867ce383908c
2022-04-24 16:07:44 +00:00
Aaron Schulz
db36853718 rdbms: make automatic connection recovery more robust
Rename canRecoverFromDisconnect() in order to better describe
its function. Make it use the transaction ID and query walltime
as arguments and return an ERR_* class constant instead of a bool.
Avoid retries of slow queries that yield lost connection errors.

Track session state errors caused by the loss of named locks or
temp tables (e.g. during connection loss). Such errors will prevent
further queries except for rollback() and flushSession(), which must
be issued to resolve the error.

Add flushPrimarySessions() methods to LBFactory/LoadBalancer
and use it in places where session state loss is meant to be
safely aknowledged.

Change-Id: I60532f86e629c83b357d4832d1963eca17752944
2022-04-14 11:09:31 +10:00
jenkins-bot
2a92b07ad3 Merge "Create ParserFetchTemplateData hook" 2022-04-07 06:00:40 +00:00
jenkins-bot
a45305e498 Merge "file: Move json metadata storage out of LocalFile" 2022-04-07 01:28:25 +00:00
Amir Sarabadani
5da58d6028 file: Move json metadata storage out of LocalFile
So ArchivedFile could use it as well

Bug: T298417
Bug: T298398
Change-Id: Idd258437d9f91824195ed0c12b5694841cb365b0
2022-04-07 01:11:46 +00:00
jenkins-bot
75435bce48 Merge "maintenance: Move MWTerm classes to /tests/parser/" 2022-04-05 17:10:39 +00:00
jenkins-bot
6da4f4b9a8 Merge "Create ParserLogLinterData hook" 2022-04-05 05:39:53 +00:00
jenkins-bot
18782a3dc9 Merge "Benchmark script for settings loading." 2022-04-04 00:05:38 +00:00
daniel
14978e264c Benchmark script for settings loading.
Change-Id: I323a3469c574b55ad78abb35863f30b1007f3135
2022-03-31 16:36:34 +02:00