Commit graph

100927 commits

Author SHA1 Message Date
Timo Tijhof
3a044d0f02 exception: Remove "exception_id" key in favour of reqId
This key predates MediaWiki's standardised notion of request IDs,
and of PSR-3 and Monolog usage.

Bug: T199607
Change-Id: Ibdd5bf12591761ab45be12ba72943e9d94f678cb
2021-01-18 05:33:17 +00:00
Timo Tijhof
8c906e237f exception: Add the 'from' file/line to the logged exception trace
This should make error logs easier to work with through a couple
of ways:

* The stack trace is now complete, instead of missing the first
  crucial step, which is often the one used for filtering
  purposes and for identifying errors within a given deployed
  version of MediaWiki. (E.g. when filtering out an error that is
  expected to be fixed by the next release and/or when checking
  how prominent an error currently is).

* Logstash reports that report message + trace will not need to be
  edited by hand to include the file+line.

* The workflow for Logstash generally follows one of two patterns.

  The default is to filter by exception.file (including line number),
  which is very sure to catch all possible variants thrown from
  the same code, regardless of any variables in the message, but
  has the downside of not matching week-over-week consistency due to
  file paths (at least for WMF) containing the deployment version.

  The other option is to filter by message, which has the risk of
  possibly excluding too much if there are multiple unrelated ways
  to trigger the issue, but is a sensible second option. This is
  usually done by filtering on normalized_message for non-exception
  errors, but doesn't work well for exceptions because they contain
  the file paths and do so in-between the class and message words,
  and thus are not compatible with Logstash's default substring/term
  match. The alternative of exception.message is then considered but
  is lacking the class/type, which can be fragile.

  With this change applied, no editing is needed, and no multiple
  approaches need to be considered with the same option.
  Either filtering by exception.file as-is, or filtering by
  normalized_message as-is, regardless of whether it is an exception
  error or other message in another channel, will both work.

Bug: T271496
Change-Id: I5908ed53f9b97b3c9cde126aca89ab6fc197c845
2021-01-16 22:15:54 +00:00
jenkins-bot
3a39e433d8 Merge "resourceloader: Improve wgResourceModules documentation" 2021-01-16 22:03:40 +00:00
jenkins-bot
d5cb96bdfb Merge "Minor cleanup to XmlSelectTest" 2021-01-16 22:00:33 +00:00
jenkins-bot
da5fdf2755 Merge "Migrate oldimage to abstract schema" 2021-01-16 22:00:26 +00:00
Timo Tijhof
176a96b5ed resourceloader: Improve wgResourceModules documentation
- Restructure as a more readable and easier to scan list,
  rather than with large sections.

- Move examples out to their own section, and remove or combine
  trivial examples.

- Link to mediawiki.org docs for Package files,
  and document when the feature was added (since 1.33).

- Document the "factory" option, and use the same format
  for specifying when it was added.

- Add more @see references to this for discovery.
  (The @see syntax is required for Doxygen to link variables,
  unlike class names which can be linked bare from class/method
  descriptions.)

Bug: T232566
Change-Id: Idb295d034c0afbd75cc1f57bbed163654bda2ab5
2021-01-16 13:35:30 -08:00
Amir Sarabadani
dba59bc223 Migrate oldimage to abstract schema
For MySQL/Sqlite:
 - Changing oi_name and oi_archive_name to varbinary instead of "varchar
   binary"
 - Dropping default from oi_timestamp

For Postgres:
 - Adding the correct default to seven fields
 - Removing incorrect default from oi_metadata
 - Add missing index oi_actor_timestamp
 - Change four fields to have correct data type
 - Make oi_major_mime and oi_minor_mime not nullable
 - Drop foreign key on oi_name

Bug: T230428
Bug: T164898
Change-Id: I4dff0e48081a5797a29513f9c8b87f9ffcaadb5d
2021-01-16 21:18:25 +01:00
Taavi Väänänen
0996b0ca3d Deprecate User::getGrantName in favor of MWGrants::grantName
Move over only known use.

Bug: T245963
Change-Id: Id9ba9b3ddd4dc00ca2cd9ab617d2060742772bb6
2021-01-16 21:25:01 +02:00
Ammarpad
baf68f3c3f RevisionRenderer: Fix typos
Change-Id: I0acf10aa958dcd7d97eea64387964791752f9424
2021-01-16 09:46:00 +00:00
Ammarpad
001b1be162 Ignore empty lines in Release Notes test
Length of an empty line is always zero and so there's
no need to calculate it.

Change-Id: I71f932de7225f142130c483c526e42aecd303047
2021-01-16 06:26:14 +00:00
jenkins-bot
e845067ab6 Merge "Adopt pipe trick with Arabic comma" 2021-01-16 03:29:36 +00:00
DannyS712
4b0069c379 Minor cleanup to XmlSelectTest
Change-Id: I34aead5acfea9fd64759899b6a3176005c577eb6
2021-01-16 02:32:44 +00:00
James D. Forrester
a547ef3b9e Revert "Make WikiPage a ProperPageIdentity"
This reverts commit 8f46ef5ff4.

This has seemingly broken FlaggedRevs and thus a bunch of repos.

Bug: T272170
Change-Id: I67de3dbbbc9163aae937f710ecb0e40db0d483a0
2021-01-15 12:30:30 -08:00
James D. Forrester
a8fe6c9841 Revert "Define equality for PageIdentity and LinkTarget"
This reverts commit 36f1adf670.

This has seemingly broken FlaggedRevs and thus a bunch of repos.

Bug: T272170
Change-Id: I26c6fd656c75a6b209fb17965dc9109edf68642b
2021-01-15 12:30:14 -08:00
jenkins-bot
6017caafbc Merge "Define equality for PageIdentity and LinkTarget" 2021-01-15 17:23:37 +00:00
daniel
36f1adf670 Define equality for PageIdentity and LinkTarget
This allows Title and WikiPage objects to be compared with PageIdentity
and LinkTarget instances consistently.

Change-Id: I1bbd15d17d046359393ecfc1acd2778273260a95
2021-01-15 17:53:28 +01:00
jenkins-bot
398c39b6de Merge "deferred: make DeferredUpdates::doUpdates() recursion more uniform" 2021-01-15 16:52:31 +00:00
jenkins-bot
9fe9d76577 Merge "Make WikiPage a ProperPageIdentity" 2021-01-15 16:17:44 +00:00
jenkins-bot
321372db70 Merge "Introduce Authority interface" 2021-01-15 16:07:17 +00:00
daniel
0ac16e53aa Introduce Authority interface
This introduces the Authority interface and an implementation of basic
functionality. This serves as a basis for spike exploring the concept.

Bug: T261963
Change-Id: Idd4e8bd934f191296eada443450bc69500102937
2021-01-15 16:18:03 +01:00
daniel
8f46ef5ff4 Make WikiPage a ProperPageIdentity
This makes it so methods that take a WikiPage can be narrowed to a
PageIdentity, and prepares WikiPage for the introduction of the PageRecord
interface.

Bug: T208776
Change-Id: Iab8bd75a1948873baab9c91c76f966d606b23c0f
2021-01-15 12:34:24 +01:00
DannyS712
edb2072c68 Remove unused definition of NS_UNITTEST(_TALK) in UserTest
Change-Id: I813f188050183aa468feb9ca877b7d238c6dd09d
2021-01-15 10:37:02 +00:00
jenkins-bot
f862b790d3 Merge "Remove WatchedItemStoreUnitTest::getFakeRow" 2021-01-15 10:35:52 +00:00
DannyS712
b88c06197b HTMLCheckMatrixTest: use data providers
Also remove duplicate case validating with a submission
of an empty array []

Change-Id: I9e088c7ac281658eda6611892c3f8cea637bba63
2021-01-15 09:30:18 +00:00
DannyS712
18eee995b3 Remove WatchedItemStoreUnitTest::getFakeRow
Replace with (object) casts

Change-Id: Ib1c9e1b7a6e038223f7b2308c9913da752b8db68
2021-01-15 09:21:48 +00:00
DannyS712
be174c4dc1 Make WatchedItemQueryServiceUnitTest a pure unit test
The `testGetWatchedItemsWithRecentChangeInfo_watchlistOwnerAndInvalidToken`
method (and its data provider) moved to the remaining integration test,
since those actually do require integration

Also do some minor clean up to the unit tests:
* Replace ::getFakeRow with manual (object) casts
* Combine duplicate getMockNonAnonUserWithIdAndRestrictedPermissions
and getMockNonAnonUserWithIdAndNoPatrolRights

Change-Id: Ie853f465b39f06dadd65582df061a9c44068b63a
2021-01-15 00:50:18 -08:00
jenkins-bot
cb2dbd01b5 Merge "Improve some function documentation in tests" 2021-01-15 08:44:01 +00:00
Translation updater bot
9020223637 Localisation updates from https://translatewiki.net.
Change-Id: Id6a2e6afcda168e86c95d2de74f8a52faa87eda7
2021-01-15 08:37:52 +01:00
jenkins-bot
fc25878444 Merge "WatchedItemStore: Use REPLACE when inserting expiries after page move" 2021-01-15 05:28:46 +00:00
jenkins-bot
927a423d5b Merge "Change wording of searchsuggest-containing message" 2021-01-14 23:45:17 +00:00
Aaron Schulz
4b7ddd3c67 deferred: make DeferredUpdates::doUpdates() recursion more uniform
Follow-up ba6490aa1e.

That patch worked around $executeContext iteration errors due to the
lack of recursion support in doUpdates()/handleUpdateQueue(). Errors
were triggered by MediaWiki::schedulePostSendJobs() enqueueing deferred
updates that invoke JobRunner::run(), which, in turn, invoke doUpdates()
for each job via JobRunner:: doExecuteJob(). The doUpdates() method was
changed to operate on the sub-queue for the in-progress DeferrableUpdate.

Further improve the recursion logic:
* Use classes for the scope stack and scope queues.
* Put *all* updates added during a DeferrableUpdate::doUpdate() call into
  the subqueue, regardless of "defer until" stage or whether it implements
  MergeableUpdate. Now, doUpdate() can run *everything* it enqueued instead
  of a non-obvious subset. Note that the TransactionRoundDefiningUpdate
  that invokes JobRunner was already a POSTSEND update before ba6490aa1eb;
  the only effect of this change is that MergeableUpdate instances from jobs
  will once again run in doExecuteJob().
* Make recursive DeferredUpdates::doUpdate() calls error out immediately
  unless the DeferrableUpdate responsible is a TransactionRoundAwareUpdate
  with the TRX_ROUND_ABSENT flag. This covers the schedulePostSendJobs()
  scenario and only prohibits insane call patterns. Failing early avoids
  the risk of handleUpdateQueue() dropping all the updates due to the same
  DBTransactionError error in DeferredUpdates::attemptUpdate().
* Avoid recursion loop in tryOpportunisticExecute() when JobQueueDB is in
  use and a large number of tasks are pending. This happened due to methods
  like onTransactionPreCommitOrIdle() being used within JobQueueDB.

Mark DeferredUpdates::doUpdates()/tryOpportunisticExecute() as @internal
and create a Maintenance::shutdown() method to avoid a direct call in the
doMaintenance.php file.

Bug: T249069
Bug: T268840
Change-Id: Ib369f0e74243a48ababdb9cd83b155c9a0f5e741
2021-01-14 15:37:58 -08:00
jenkins-bot
e63675f1cf Merge "exception: Add test for MWExceptionHandler trace formatting" 2021-01-14 23:36:37 +00:00
jenkins-bot
89945d0b53 Merge "exception: Minor clean up in MWExceptionHandler test case" 2021-01-14 23:36:30 +00:00
jenkins-bot
48f43e98cc Merge "mediawiki.language: Add special characters useful in Korean" 2021-01-14 22:45:38 +00:00
jenkins-bot
8781399b82 Merge "Relax User to UserIdentity in ManualLogEntry and RecentChange" 2021-01-14 21:49:57 +00:00
shubham656
9ca62997e4 mediawiki.language: Add special characters useful in Korean
New characters:

* `¹` – U+00B9 Superscript One
* `²` – U+00B2 Superscript Two
* `³` – U+00B3 Superscript Three
* `↘` – U+2198 South East Arrow
* `↗` – U+2197 North East Arrow
* `⇐` – U+21D0 Leftwards Double Arrow
* `⇒` – U+21D2 Rightwards Double Arrow
* `⇘` – U+21D8 South East Double Arrow
* `⇗` – U+21D7 North East Double Arrow
* `⇔` – U+21D4 Left Right Double Arrow
* `△` – U+25B3 White Up-Pointing Triangle
* `▲` – U+25B2 Black Up-Pointing Triangle
* `□` – U+25A1 White Square
* `■` – U+25A0 Black Square
* `○` – U+25CB White Circle
* `◎` – U+25CE Bullseye
* `●` – U+25CF Black Circle
* `☆` – U+2606 White Star
* `★` – U+2605 Black Star
* `◁` – U+25C1 White Left-Pointing Triangle
* `◀` – U+25C0 Black Left-Pointing Triangle
* `▷` – U+25B7 White Right-Pointing Triangle
* `▶` – U+25B6 Black Right-Pointing Triangle
* `◇` – U+25C7 White Diamond
* `◆` – U+25C6 Black Diamond
* `㈜` – U+321C Parenthesized Hangul Cieuc U[
* `¥` – U+FFE5 Fullwidth Yen Sign
* `₩` – U+FFE6 Fullwidth Won Sign
* `―` – U+2015 Horizontal Bar
* `〈` and `〉` – U+3008 Left Angle Bracket and U+3009 Right Angle Bracket (encapsulation)
* `《` and `》` – U+300A Left Double Angle Bracket and U+300B Right Double Angle Bracket (encapsulation)

Bug: T270157
Change-Id: Idbcb0a3e08d215de26523f3f0bb5137c715d6291
2021-01-14 13:49:40 -08:00
Umherirrender
0347fd0631 Improve some function documentation in tests
Also fix some whitespaces

Change-Id: Ibed50a4f07442d3f299cf545c16f5dbb5f27a411
2021-01-14 22:13:55 +01:00
jenkins-bot
a4c8e863c1 Merge "move the registration of SevenZipStream in dump module" 2021-01-14 21:09:09 +00:00
jenkins-bot
d7441dc09a Merge "SpecialContributions: Guard against unset parameter index" 2021-01-14 20:25:44 +00:00
jenkins-bot
5f7e7fb238 Merge "Make WatchedItemUnitTest a pure unit test" 2021-01-14 20:13:51 +00:00
jenkins-bot
dccd62660a Merge "Introduce PageIdentity interface" 2021-01-14 20:12:09 +00:00
Ammarpad
82805bb946 SpecialContributions: Guard against unset parameter index
Bug: T271979
Change-Id: Ic4f209048ac7c5a212b0b11ed018761c8b9bdc7e
2021-01-14 19:59:07 +00:00
jenkins-bot
d84350ea6d Merge "Fix SpecialPage alias test" 2021-01-14 19:58:52 +00:00
MusikAnimal
56ccf11a6c WatchedItemStore: Use REPLACE when inserting expiries after page move
Sometimes when moving pages, a row for the target page may already exist
in the watchlist_expiry table. The exact scenario that's causing the
prod errors could not be repo'd in tests or locally, but using REPLACE
should be a safe solution.

Tests updated to actually verify the expiry of the new title, if
present, is overriden with the old one following the page move.

Bug: T271971
Change-Id: Id4d46fcdea4816e5714d266985ba86fdc6450cfb
2021-01-14 14:22:06 -05:00
daniel
1a60008a9a Introduce PageIdentity interface
PageIdentity is intended as a lightweight alternative to Title,
similar to LinkTarget, but providing a page ID. It follows the precedent
of UserIdentity.

Bug: T208776
Change-Id: Iaed4871e0d32c67d4fb13e487625527f6a21e9c5
2021-01-14 13:18:05 -06:00
Thiemo Kreuz
ac205fa84c Fix incomplete/bogus PHPDoc tags in various tests
Most of these are found by the not yet released I10559d8.

I remove the type MockObject in some cases when the calling
code really does not need to know if he get's a mock or the
real thing. However, I do this only in places that are very
closely related to the fixes.

Change-Id: I26a4c3c5a8ae141bf56161b52b54bce7e68f2e30
2021-01-14 19:02:00 +00:00
jenkins-bot
567e436518 Merge "Remove "@group Database" from non-integration tests" 2021-01-14 18:56:21 +00:00
jenkins-bot
731aba87db Merge "Use a standard tab width when editfont is used" 2021-01-14 18:56:09 +00:00
jenkins-bot
611ae5eee3 Merge "Do inverse namespace filtering of links tables with a big IN()" 2021-01-14 18:45:34 +00:00
jenkins-bot
accd7df6e6 Merge "Sync up with Parsoid parserTests.txt" 2021-01-14 16:13:59 +00:00