Commit graph

13821 commits

Author SHA1 Message Date
jenkins-bot
063cf142b0 Merge "Fix changes list "hide myself" feature" 2021-05-12 00:13:00 +00:00
Tim Starling
8327d2f0ca Fix changes list "hide myself" feature
Broken by fd01c53778

Bug: T282183
Change-Id: I0ae68702f9ea160a1e649ca6c52f88cdf9a8e8e5
2021-05-12 09:45:59 +10:00
jenkins-bot
343015b83a Merge "getFooterIcons should not return empty arrays, part 2, Electric Boogaloo" 2021-05-11 23:29:38 +00:00
jenkins-bot
333b30069e Merge "Rewrite UserEditTrackerTest as an integration test" 2021-05-11 19:08:56 +00:00
jenkins-bot
e916b376e2 Merge "Return the action name instead of action id in API response" 2021-05-11 18:43:36 +00:00
jenkins-bot
8aa57b1d26 Merge "Introduce Block interface and replace AbstractBlock." 2021-05-11 18:13:54 +00:00
jenkins-bot
f2ba3c5bf8 Merge "Replace User::idFromName with ActorStore" 2021-05-11 15:21:08 +00:00
STran
a3e8ca737b Return the action name instead of action id in API response
When block restrictions are queried from the API, return the name
of the action blocked

Bug: T280566
Change-Id: I2e639864cfcdd3854fd67173b138fe8eb6f877cb
2021-05-11 07:48:52 -07:00
Petr Pchelko
7136d671d2 Replace User::idFromName with ActorStore
Depends-On: I87fdac02a88aba52a2174949f8736a9a36d3edf7
Depends-On: I812c49009665515778cd354d6c62a17ee24f3625
Change-Id: I5369e9714a3ec653c19ad81f02402e4aa1b22553
2021-05-11 07:44:38 -07:00
Petr Pchelko
695e61ce14 Clean up hard deprecated Title methods
Depends-On: If27bb6b5142d09bc9293d080e97b6642462219f4
Change-Id: I37f012e53d1c881292a19aac87eb107636c6bfbe
2021-05-11 07:41:18 -07:00
daniel
753b1bcaff Introduce Block interface and replace AbstractBlock.
In order to allow Authority to know about user blocks,
we need a narrow interface to represent such blocks.

This deprecates some methods on AbstractBlocks in favor
of new methods on the Block interface that avoid binding to
the User class.

Bug: T271494
Change-Id: I7bb950533970984a014de0434518fbbefb695131
2021-05-11 11:36:11 +02:00
Tim Starling
02ae9aa0ba Rewrite UserEditTrackerTest as an integration test
As previously discussed, the database should usually not be mocked. I'm
changing many of these queries for the next stage of the actor
migration, and just copying my own query from the code to the test file
does not give me any confidence that the query I'm writing is correct.
The unit test was simply ensuring that the implementation of the class
doesn't change, it wasn't verifying correct operation.

Change-Id: Id3ee02fd547d0a7b5b7f35866ee317e8b09e6c18
2021-05-11 13:03:45 +10:00
jenkins-bot
1bfa8e0791 Merge "Pass PageReference as possible parameter to LinkRenderer methods" 2021-05-11 01:28:31 +00:00
James D. Forrester
269e7e1d44 Drop global function wfNegotiateType, deprecated in 1.36
No uses known in code search.

Bug: T264984
Change-Id: Ia69d3a11653671d46e71f9248e0e62445f4f9d54
2021-05-10 15:09:49 -07:00
James D. Forrester
cd9cf8d081 Drop global function wfDebugMem, deprecated in 1.36
No uses known in code search.

Bug: T264976
Change-Id: I9f7553ea405cc096a1d6596e1d6511e7dd634009
2021-05-10 15:05:45 -07:00
Vadim Kovalenko
9dc884a130 Pass PageReference as possible parameter to LinkRenderer methods
Refactor LinkRenderer
- ::makeLink()
- ::makePreloadedLink(),
- ::makeKnownLink()
- ::makeBrokenLink()
- ::getLinkClasses()

Bug: T278428
Change-Id: I37367c0e3a08d07ad93fdba91656f7ef504303b8
2021-05-10 16:01:27 -04:00
DannyS712
7855f60aa3 SqlBlobStoreTest: test against tt:10000 instead of tt:1000
The removal of the Revision class led to this test failing, since
tt:1000 started to have content - not sure why but I assume something
in the Revision tests was clearing the store - the text
was "UTContent" which is used in many tests via helper
method MediaWikiIntegrationTestCase::getExistingTestPage()
which can create pages with that text.

Change-Id: I04c669ad8c8a7166138eabc973140205b60536a5
2021-05-10 19:00:29 +00:00
jenkins-bot
b2480a7efe Merge "Add a JobQueueGroupFactory service" 2021-05-10 18:59:51 +00:00
jenkins-bot
e56ca63098 Merge "IntegrationTestCase: Fix incomplete error message" 2021-05-10 17:53:23 +00:00
Ammarpad
d90bff177f IntegrationTestCase: Fix incomplete error message
Change-Id: Id5bee445b67cf5339b0e3d7bb4376fb114312a06
2021-05-10 15:34:55 +01:00
James D. Forrester
6bbad15444 User: Hard-deprecate the confusingly-named isLoggedIn() method
This was soft-deprecated in 0171846c, since when all uses in Wikimedia
production code have been removed. As this is such a vital and widely-
used method, we'll want to deprecate it for at least two releases. and
so we should get this in at a time when we're willing to fix many such
uses. Why not now?

Bug: T270450
Change-Id: I8ac4a91d77c2bb748183b69b3e901cce93cbc940
2021-05-10 07:30:23 -07:00
jenkins-bot
a19532464d Merge "PageIdentityValue: apply basic validation of titles" 2021-05-10 14:11:39 +00:00
jenkins-bot
3d7868059d Merge "RevisionDeleter: Use PageIdentity instead of Title" 2021-05-10 13:41:25 +00:00
jenkins-bot
b6fea99341 Merge "DatabaseBlockStore: fetch correct ActorNormalization" 2021-05-10 09:13:12 +00:00
jenkins-bot
7abcde069b Merge "Run tests with ONLY_FULL_GROUP_BY" 2021-05-10 08:12:57 +00:00
Isarra
489564b35d getFooterIcons should not return empty arrays, part 2, Electric Boogaloo
We filter out icons with no images, which includes empty icon arrays,
already. Let's also remove their containers if nothing winds up inside
them so we're not returning any empty container arrays, either.

Bug: T278266
Change-Id: If9bfb764b61a77e71ca7f374fa67a56ac89c799f
2021-05-09 20:12:06 +00:00
DannyS712
d2a0b3976c Simplify database handling in CategoryTest
Use addDBData() and tables used

Change-Id: Ib9c9e9dcd2ddfad4ab9d4780c44fbc94a7a85d77
2021-05-09 00:53:31 +00:00
jenkins-bot
32d1ce99a7 Merge "registration: Allow multi-line strings in "@" note keys" 2021-05-08 05:13:42 +00:00
jenkins-bot
41d7fa917f Merge "Split TimeCorrection parser into separate class" 2021-05-07 18:43:08 +00:00
Derk-Jan Hartman
65c955746c Split TimeCorrection parser into separate class
The parsing of the timecorrection useroption was split over multiple
classes. Combine into a single class and add some testcases.

Change-Id: I2cadac00e46dff2bc7d81ac2f294ea2ae4e72f47
2021-05-07 10:43:09 -07:00
jenkins-bot
8ff25e40bb Merge "LinkBatch: skip bad input" 2021-05-07 16:15:04 +00:00
daniel
62176bec1b PageIdentityValue: apply basic validation of titles
In order to prevent bad titles from entering the database,
PageIdentityValue should not allow instances that have obviously broken
dbeys, just like it does not allow construction for a special page.

Note however that for now, we allow PageReferenceValue to represent
thigns that are not actual pages, such as titles like "User:#1234" which
are used in the block log to represent autoblock targets. Similarly,
a PageReferenceValue can represent a special page.

This patch introduces a convenience method for constructing
PageIdentityValues in a context where it is uncertain whetehr the title
is valid, providing an opportunity to the caller to report in which
context the bad values were found.

In addition, this patch adds some documentation and testing, to clarify
the semantics of methods in PageStore with respect to invalid and non-
proper titles.

Bug: T282070
Change-Id: I8a44d9e73dda8fe38d009847332946809767d0fa
2021-05-07 17:17:45 +02:00
daniel
316053ed88 LinkBatch: skip bad input
LinkBatch used to be lenient about receiving null or invalid titles.
This patch restores this lenient behavior.

Bug: T282180
Bug: T282070
Change-Id: I2c6378a3a0d508c77bcb290a6ed07f4d5f96d62c
2021-05-07 16:22:24 +02:00
daniel
1823345c52 Title: avoid instance cache pollution
Bug: T281337
Change-Id: I2e8d18b2fc10509097f66287b2543217f4eb9b6a
2021-05-07 11:37:54 +02:00
mainframe98
ae55be3000 Add a JobQueueGroupFactory service
This replaces JobQueueGroup::singleton and ::destroySingletons.
A JobQueueGroup service has been added to serve as convenience
getter.

Bug: T277648
Change-Id: Ic8709119773ab788a07531193dc65d418536eda2
2021-05-07 06:50:29 +00:00
jenkins-bot
62a63c8309 Merge "Remove PathRouterTest::$basicRouter, unused" 2021-05-07 02:00:13 +00:00
jenkins-bot
064eea6483 Merge "rdbms: disallow upsert()/replace() calls with multiple unique keys" 2021-05-07 01:55:56 +00:00
Tim Starling
9a6dcfb4e5 Run tests with ONLY_FULL_GROUP_BY
Have MySQL emulate PostgreSQL's standards-compliant GROUP BY
nitpicking, so that MySQL developers can tell whether queries would fail
on PostgreSQL.

Bug: T281329
Change-Id: Ia9e6c6ad3286dd37f7efb55045e8556d85791c37
2021-05-07 00:48:31 +00:00
jenkins-bot
eee48dfed0 Merge "Split a base class out of ActorMigration" 2021-05-06 11:48:50 +00:00
daniel
2a1087fa40 RevisionDeleter: Use PageIdentity instead of Title
RevDelList for now still uses a Title internally.

Change-Id: Id839ac697bd742e908f465cf5330da486dc73111
2021-05-06 13:42:13 +02:00
jenkins-bot
d58e417207 Merge "Eliminate use of Title object in REST infrastructure" 2021-05-06 08:40:46 +00:00
jenkins-bot
f1ea459814 Merge "Remove harmful validation regex in PageReferenceValue" 2021-05-06 04:00:05 +00:00
jenkins-bot
3af81b2938 Merge "EditPage::getExpectedParentRevision(): guard against null edittime" 2021-05-06 02:24:12 +00:00
Tim Starling
c5390fcefc Remove harmful validation regex in PageReferenceValue
Catching common issues here instead of where the caller expects breaks
log formatting, including complete breakage of Special:RecentChanges.
The doc comment says that validation is the caller's responsibility,
which seems like a good idea to me.

Bug: T282070
Change-Id: Ic7e5c5576564e61906a812d50ea4e48adf5ac998
2021-05-06 11:56:12 +10:00
Petr Pchelko
4ca16e8d08 Eliminate use of Title object in REST infrastructure
Change-Id: I585f0f23cac5f6dc2a4879f69f7b83828fda3dd3
2021-05-05 18:54:58 -07:00
Tim Starling
7430e278c6 EditPage::getExpectedParentRevision(): guard against null edittime
Document the fact that EditPage::$edittime can be null, and guard
against a type mismatch error in getExpectedParentRevision() which is
hit if EditPage::$edittime is null and EditPage::$editRevId is a value
that is false when converted to boolean.

Bug: T277204
Change-Id: Ibc9500a314ddfd99452d6c03d8906f69cdebc0e4
2021-05-06 11:38:30 +10:00
jenkins-bot
84aab44b9f Merge "Merge FormatJsonTest and FormatJsonUnitTest" 2021-05-05 22:07:40 +00:00
jenkins-bot
d7a0394e8e Merge "Allow action blocks to be logged via block log parameters" 2021-05-05 21:26:46 +00:00
DannyS712
db4f2bbb24 Merge FormatJsonTest and FormatJsonUnitTest
FormatJsonUnitTest was split off back when the
rest still needed to be integration tests[1], but
after [2] with global functions being loaded for unit
tests, the rest of FormatJsonTest was moved to a
unit test since it no longer required integration

[1] I86dfe17f794c615048b3c20487b0e84d38d13b93
[2] Ib42c56a67926ebcdba53f4c6c54a5bff98cb77a3

Change-Id: I92bb7a6cafd82d8b2186f92e0953bc18f40b0ee4
2021-05-05 20:52:30 +00:00
jenkins-bot
642caf049f Merge "Add DummyServicesTrait::getDummyInterwikiLookup" 2021-05-05 20:47:29 +00:00