MySQL was incorrectly doing the change_tag table first, even when that
required scanning ~1M rows, because it believed that the only alternative
was scanning the whole of recentchanges, ~10M rows. Use a better model
for the set sizes which takes the query limit into account.
Also:
* Factor out the change_tag_for_display_query hack and avoid copying
the data more than once
* Add a cache for SpecialRecentChanges::getDB()
* Move the rc_new hack up closer to the other perf hacks
Bug: T298225
Change-Id: Ic3d16dd3ebdc683c7cfce6ae86b60e951145ad7a
After I4d6c175c637a2cb26c63e0b2b27d5ea8ce6b1e0d
some of the filter joins are applied to the query before
the RecentChange joins. Since filter joins depend on actor,
and RecentChange query is the one adding actor joins,
we need to reorder them.
Bug: T281981
Change-Id: Ifbdb24ff5b99b9ec12cb313c48227563696c48c9
Some of these parameters are marked as optional and nullable,
but can never be null (the test would fail then), and are
never missing.
While I'm here I also add more strict type hints for
parameters and return types. Note this is only done in tests
and impossible to cause trouble in production.
Change-Id: I1c66325c97d5ea86d9822e789a36542faad1272b
This covers only directly used services by this special page and pager
Services used by the base class are not part of this patch set
Bug: T259960
Depends-On: I62855be191ea87bdc5157b6ab879c47815644156
Change-Id: I730ce17548fad3e35e8d8b6730eb3aafd734eac9
This query was correctly excluding expired items from RC, but it
was failing to include them when the unwatched filter was set.
This is a follow-up to https://gerrit.wikimedia.org/r/c/mediawiki/core/+/602211
Bug: T252136
Change-Id: I5d43d746df21cc3674eb2e92c3f604b7c87b7d1a
wgStructuredChangeFiltersShowPreference, wgStructuredChangeFiltersShowWatchlistPreference,
and wgStructuredChangeFiltersOnWatchlist were introduced for progressive rollout
of the RCFilters app on RC and WL.
These variables and their related conditional code is no longer needed.
Bug: T196033
Change-Id: Id3799fefd21cd9bea0e089a5e12576ee9ea1085e
Reenable MediaWiki.WhiteSpace.SpaceBeforeClassBrace.NoSpaceBeforeBrace,
because the mentioned bug is fixed
Bug: T172933
Change-Id: I1593bdba2295ebed401b921f2beabed69dba7638
Allow fractional values (e.g ?days=0.25). Previously, fractional values
were rounded down (truncated) to integers.
When computing the cutoff timestamp, don't round down to midnight UTC.
This caused a strange phenomenon where ?days=1 would display between
24 and 48 hours' worth of changes depending on when you used it:
if the current time was 2017-07-24 23:59 UTC, the cutoff would be
set at 2017-07-23 00:00 UTC so you would see almost 48 hours' worth,
but if you refreshed two minutes later, the cutoff would be set at
2017-07-24 00:00 UTC and you should see just over 24 hours' worth.
In addition to this strangeness, it also made fractional values
somewhat meaningless and made a feature like "show only the last 3 hours"
impossible to implement.
Bug: T162784
Change-Id: I75b71324e29a4da09939c4b00feeb4cb556f797c
It's ; for namespaces (since that is generally what we're using,
e.g. for STRING_OPTIONS), and | for tags. I would have
preferred them to all be consistent, but there is one revision
that has a ;, and this seems better than modifying the DB.
Comma is already used as a delimiter between separate parameters
(e.g. hideanons and namepsace).
Also, fix multiple namespaces for parseParameters and add test
cases.
Bug: T164132
Bug: T164133
Change-Id: Iad061e0bc17e3522a3f5d330ac2c8bf9cf0e614f
Some combinations of RC filters should never appear
together because they guarantee to return no data
and cannot be visually represented in the new RC
filters UI (ERI project).
Examples include:
* 'hidemyself' and 'hidebyothers'
* 'hideminor' and 'hidemajor'
* All of the filters in the changeType group (which
is extended by extensions)
This also handles an old special case, but it now redirects
instead of doing it silently:
hideanons=1 & hideliu=1 & hidebots=1 -> hideliu=1 & hidebots=1
hideanons=1 & hideliu=1 & hidebots=0 -> hidehumans=1
Bug: T151873
Change-Id: Id08dccd07b262ce61c9d38563f19a0ab181e2341
Replaces \TestingAccessWrapper (defined in core) with
\Wikimedia\TestingAccessWrapper (defined in the composer package
wikimedia/testing-access-wrapper).
See https://gerrit.wikimedia.org/r/#/q/topic:librarize-testing-access-wrapper
for downstream patches.
The core version of the class is kept around for a while to avoid
circular dependency problems.
Bug: T163434
Change-Id: I52cc257e593da3d6c3b01a909e554a950225aec8
Generate old RC, Related changes (it was already displayed and working
on 'Related changes' before this change), and Watchlist/etc. and data
for new UI from back-end.
This moves everything used for defining the old (unstructured) and new
(structured) filters into unified objects, ChangesListFilter and
ChangesListFilterGroup (and sub-classes).
This includes the query logic (see below) and logic for adding
CSS attribution classes.
This is a breaking change (for subclasses of ChangesListSpecialpage)
due to the signature (and name) change of buildMainQueryConds and
doMainQuery. An alternative that I don't think is a breaking change
would be to put the filter->DB logic in runMainQueryHook, but then it's
doing more than just running a hook.
This is because it used to only build $conds here, but it's clear from
filterOnUserExperienceLevel filters need more than this. I added all
the DB parameters from the hook, but this could be debated.
I have an checked and fixed the WMF-deployed extensions affected by
this.
Other than that, there should be full back-compat (including legacy
filters not using the new system).
* add hidepatrolled/hideunpatrolled to new UI.
* Move userExpLevel from RC to ChangesListSpecialPage. Although for
now the structured UI only displays on RC anyway, when it displays on
watchlist, it seems we'll want userExpLevel there.
Change this to make 'all' exclude unregistered users.
* Don't have front-end convert none-selected to 'all' on string_options.
* Needs the hideanons/hideliu special redirect to be done before this
is merged (T151873)
Bug: T152754
Bug: T152797
Change-Id: Iec2d82f6a830403d1c948a280efa58992e0cdee7
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.
Change-Id: I46261416f7603558dceb76ebe695a5cac274e417
Allows filtering changes based on user
experience level. Supports the following
levels: 'newcomer', 'learner', 'experienced'
Will be used by the ERI project.
Bug: T149637
Change-Id: Ib2ac92925836ce2f3706d898968538aa18d14d5d
'hidemajor', along with the existing 'hideminor'
RC filter, allow showing just the minor edits,
just the major edits, or both.
This will be used by the ERI project.
Bug: T149863
Change-Id: I936a4a1b13d8c4a15c745012cd0f82207d9e57ca
Allows hiding edits that have not been patrolled.
In other words, showing only edits that have been patrolled.
Will be used by the new Special:RC filters (ERI project).
Bug: T152061
Change-Id: I3cd896812c5af87bc4be53d493055c37298c712f
Normalize condition object to ignore order and ignore the
following equivalent formats:
$conds['column'] = 'value';
$conds[] = "column = 'value'";
This makes the tests more resilient to minor refactoring
that doesn't affect functionality.
Change-Id: I440f230c81182694a952de801cb37b9ddbad5599
Allows hiding edits by other users on
Special:RecentChanges.
It is not available in the current UI but
will be used by the ERI project.
Bug: T149859
Change-Id: I8c1e2238a41d6f5e5ac44cc12cb02a6b4271c237
This is part of a chain that reverts:
e412ff5ecc.
NOTE:
- The feature is disabled by default
- User settings default to hiding changes
- T109707 Touching a file on wikisource adds and
removes it from a category... Even when page
has no changes.... WTF? See linked issue,
marked as stalled with a possible way forward
for this patch.
@see https://gerrit.wikimedia.org/r/#/c/235467/
Changes since version 1:
- T109604 - Page names in comment are no longer
url encoded / have _'s
- T109638 & T110338 - Reserved username now used
when we can't determine a username for the change
(we could perhaps set the user and id to be blank
in the RC table, but who knows what this might do)
- T109688 - History links are now disabled in RC....
(could be fine for the introduction and worked
on more in the future)
- Categorization changes are now always patrolled
- Touching on T109672 in this change emails will never
be sent regarding categorization changes. (this
can of course be changed in a followup)
- Added $wgRCWatchCategoryMembership defaulting to true
for enabling / disabling the feature
- T109700 - for cases when no revision was retrieved
for a category change set the bot flag to true.
This means all changes caused by parser functions
& Lua will be marked as bot, as will changes that
cant find their revision due to slave lag..
Bug: T9148
Bug: T109604
Bug: T109638
Bug: T109688
Bug: T109700
Bug: T110338
Bug: T110340
Change-Id: I51c2c1254de862f24a26ef9dbbf027c6c83e9063
Fix almost all occurences of the following sniffs:
Generic.CodeAnalysis.UselessOverridingMethod.Found
Generic.Formatting.NoSpaceAfterCast.SpaceFound
Generic.Functions.FunctionCallArgumentSpacing.SpaceBeforeComma
Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine
Generic.PHP.LowerCaseConstant.Found
PSR2.Classes.PropertyDeclaration.ScopeMissing
PSR2.Files.EndFileNewline.TooMany
PSR2.Methods.MethodDeclaration.StaticBeforeVisibility
Change-Id: I96aacef5bafe5a2bca659744fba1380999cfc37d
Some class extending MediaWikiTestCase did not call its setUp method. We
most probably always want to do it since MediaWikiTestCase::setUp() does
garbage collection and might do more in the future.
Change-Id: I68dde370a62c8f4a779836ca0c4ad06844fdc916
This commit depends on the introduction of
MediaWikiTestCase::setMwGlobals in change Iccf6ea81f4.
Various tests already set their globals, but forgot to restore
them afterwards, or forgot to call the parent setUp, tearDown...
Either way they won't have to anymore with setMwGlobals.
Consistent use of function characteristics:
* protected function setUp
* protected function tearDown
* public static function (provide..)
(Matching the function signature with PHPUnit/Framework/TestCase.php)
Replaces:
* public function (setUp|tearDown)\(
* protected function $1(
* \tfunction (setUp|tearDown)\(
* \tprotected function $1(
* \tfunction (data|provide)\(
* \tpublic static function $1\(
Also renamed a few "data#", "provider#" and "provides#" functions
to "provide#" for consistency. This also removes confusion where
the /media tests had a few private methods called dataFile(),
which were sometimes expected to be data providers.
Fixes:
TimestampTest often failed due to a previous test setting a
different language (it tests "1 hour ago" so need to make sure
it is set to English).
MWNamespaceTest became a lot cleaner now that it executes with
a known context. Though the now-redundant code that was removed
didn't work anyway because wgContentNamespaces isn't keyed by
namespace id, it had them was values...
FileBackendTest:
* Fixed: "PHP Fatal: Using $this when not in object context"
HttpTest
* Added comment about:
"PHP Fatal: Call to protected MWHttpRequest::__construct()"
(too much unrelated code to fix in this commit)
ExternalStoreTest
* Add an assertTrue as well, without it the test is useless
because regardless of whether wgExternalStores is true or false
it only uses it if it is an array.
Change-Id: I9d2b148e57bada64afeb7d5a99bec0e58f8e1561
* There should be no two files with the same name
* Test suite files should be named after the main file containing the code being tested followed by "Test"
2011-09-14 01:37:13 +00:00
Renamed from tests/phpunit/includes/specials/SpecialRecentchanges.php (Browse further)