Commit graph

22 commits

Author SHA1 Message Date
James D. Forrester
b5ce7632c7 hooks: Drop Special{Watchlist|RecentChanges}Filters, deprecated in 1.23
Neither SpecialWatchlistFilters nor SpecialRecentChangesFilters are used in any
code known to Wikimedia code search. The related code to use these hooks was
only ever used within the MediaWiki repo.

Change-Id: Ib631d49d7b5835c665171dbad3e8a646b80827ef
2018-09-12 12:43:01 -07:00
Roan Kattouw
d9c360e0a4 RCFilters: Convert patrolled filter to three states
Unpatrolled, manual and auto.

This moves the old hidepatrolled/hideunpatrolled filters to a legacy
group, and adds a new string options group with three options.
Also adds code mapping the old parameters to the new ones, and handling
for the hidepatrolled preference.

Bug: T190408
Change-Id: Ic1f181d3704c1d998696617a0d10270a87f22a62
2018-04-11 10:59:06 -07:00
Roan Kattouw
e8cc356786 ChangesListSpecialPageTest: Use Database::makeList() instead of makeshift DIY code
Otherwise these tests break completely when you add conditions like
$conds['rc_patrolled'] = [ 1, 2 ];
That maps to 'rc_patrolled IN (1,2)', but the DIY code in
normalizeCondition() was too simplistic to generate that.

Change-Id: I449317185f98e20b3e17f1b13610d872ae828171
2018-04-06 10:20:32 -07:00
Amir Sarabadani
e4277f170b Do not assume rc_patrolled is binary in ChangesListSpecialPage
Bug: T184791
Change-Id: Idd9fc4b37da2d862f84d3aacd9966872958bc9eb
2018-03-22 14:21:45 +01:00
Brad Jorsch
27c61fb1e9 Add actor table and code to start using it
Storing the user name or IP in every row in large tables like revision
and logging takes up space and makes operations on these tables slower.
This patch begins the process of moving those into one "actor" table
which other tables can reference with a single integer field.

A subsequent patch will remove the old columns.

Bug: T167246
Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50
Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
2018-02-23 10:06:20 -08:00
petarpetkovic
b5df5477cc Replace deprecated edit review params
- Replace old options 'hideanons' or 'hideliu' with structured UI equivalent.
- Update tests to take this new behavior into account.

Bug: T176172
Change-Id: I6ad050f7864bf51db05c3db957ac3533358cd3ac
2017-10-18 13:41:35 +02:00
Stephane Bisson
4b82dc1bee RCFilters: Don't let new params filter out old page
Bug: T177884
Change-Id: Id0ace30b837cf6c5fa7159aa40d80392187c4e16
2017-10-16 15:56:37 -04:00
Stephane Bisson
8937a72df7 RCFilters: Allows specifying default highlights from the server
Bug: T172757
Change-Id: I0545b4e0222e14be99d567e7890ccf33722a5d1e
2017-10-04 13:51:23 -07:00
Umherirrender
c5fee4a6ba Set wgUseRCPatrol in ChangesListSpecialPageTest
wgUseRCPatrol = false makes the tests fail

Change-Id: I18965d33171137ff182800512c8c0e8e63de124e
2017-09-20 21:21:25 +02:00
Roan Kattouw
ed4210a567 Follow-up 0b3ea6e1ab: use more flexible regex for timestamp in ChangesListSpecialPageTest
Postgres uses timestamps like "2017-07-28 17:37:03" that aren't all numbers.

Bug: T75174
Change-Id: I1b65578c955ccdce1060783b06c2ca577796e68f
2017-07-28 17:36:25 -07:00
Stephane Bisson
0b3ea6e1ab RC Filters: combine user registration and experience level filters
Add 'registered' and 'unregistered' filters to
user experience group.

Keep minimal definitions of user registration to
support hideanons and hideliu for no-js and
users who are not using ERI filters.

Reword all user experience levels description according
to the phab task.

Bug: T165160
Change-Id: Ie6b1795d7cbdb1692f8eeb13db7afb89ea4e5bbc
2017-07-18 11:15:46 -04:00
Matthew Flaschen
efe994d3c3 Change delimiter for multiple namespaces and tags
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
2017-05-08 23:03:46 -04:00
Stephane Bisson
5bd1b43e6a Fix contradictory RC filters and add back-compat
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
2017-05-04 08:49:36 -04:00
jenkins-bot
393798a0b3 Merge "RC Filters: support multiple namespaces" 2017-05-02 19:58:27 +00:00
jenkins-bot
efafb74daf Merge "userExpLevel test: use $tables from function under tests" 2017-05-02 19:58:22 +00:00
Stephane Bisson
2d7370468d RC Filters: support multiple namespaces
Make the namespace filter support multiple values separated by ','.

Bug: T164132
Change-Id: I6a83eafef69ea416dd9ba8cecc524efbd85db438
2017-05-02 13:50:04 -04:00
Stephane Bisson
ec8e5dcf95 userExpLevel test: use a single time()
Capture `$now = time()` only once and propagate
the value in the test and production code.

Bug: T161041
Change-Id: Ib2887a81a4e8015e3c80ef89d48181c7e5e1d406
2017-04-24 08:54:10 -04:00
Stephane Bisson
685c9e15b5 userExpLevel test: use $tables from function under tests
This is to make sure that the function under tests
correctly adds 'user' to the $tables variable
where it adds conditions against this table.

Bug: T161041
Change-Id: I0e9e97e4a24bdf6f488bc1b1e758904496c7efe8
2017-04-21 12:15:40 -04:00
Gergő Tisza
525bfbc8df Switch to librarized version of TestingAccessWrapper
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
2017-04-20 14:15:57 +00:00
Stephane Bisson
93cbb2450c RC Filters: Detect filters conflicts to by-pass db query
Filters are in conflict when their combination is guaranteed
to return no results. For instance: minor and log entries
is a conflict because major/minor does not apply to
log entries and the field is set to major by default.

Letting conflicts go through result in some very slow
database queries.

Bug: T160220
Change-Id: Ia6b0125c675c4a3cc4e4be4f83d1bd10d23059ba
2017-04-18 22:49:58 -04:00
Matthew Flaschen
e0c5080323 hidemyself/hidebyothers: Use rc_user_text since there is an index
hidebyothers was extremely slow (on large data sets) due to the
lack of an index on rc_user.  To fix this, changed to use rc_user_text.

hidemyself seems to be fine (assuming normal usage patterns), but
to avoid edge cases and ensure full coverage, it's been changed as
well.

I'll inquire about adding an index for this.

Bug: T161557
Change-Id: I61efe11de12e8ab6c01e8d913cdeda471132a6ee
2017-03-28 15:40:56 -04:00
Matthew Flaschen
aa063f4c5a Back-end of new RecentChanges page, refactoring
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
2017-03-11 01:42:01 +00:00