Commit graph

129 commits

Author SHA1 Message Date
Translation updater bot 2100f52998 Localisation updates from https://translatewiki.net.
Change-Id: I7435d419c3bfed1665118658e7af44e834da24ce
2016-12-26 22:39:11 +01:00
Translation updater bot b4296e99c2 Localisation updates from https://translatewiki.net.
Change-Id: Iae2491d90ec948fb91f772e51dafdfd70dbdbdcb
2016-12-23 22:31:27 +01:00
Translation updater bot 8e9e01608d Localisation updates from https://translatewiki.net.
Change-Id: I4bcf8d126dcd0ef8ee111f065ca7104a4210c87f
2016-12-22 22:54:23 +01:00
jenkins-bot 7b093c7827 Merge "Add __METHOD__ to MWCallableUpdate" 2016-12-20 01:14:40 +00:00
jenkins-bot 2f179e3851 Merge "Add severity for error categories" 2016-12-20 01:11:13 +00:00
Translation updater bot 31c5953ea1 Localisation updates from https://translatewiki.net.
Change-Id: I347c44b3b76434a48dcb85252cec58fb8cfaf6fe
2016-12-19 22:46:06 +01:00
Translation updater bot 5a01511443 Localisation updates from https://translatewiki.net.
Change-Id: Ifac80c16c783610f14b8660d3e27455934b554a7
2016-12-18 22:15:46 +01:00
Translation updater bot cbc3b9005c Localisation updates from https://translatewiki.net.
Change-Id: I872d2b62b1c5ed4b8dfed646acd93b2887f96f63
2016-12-16 22:15:30 +01:00
Kunal Mehta b201a3122c Add __METHOD__ to MWCallableUpdate
For stats and debugging purposes.

Change-Id: I5acd7fad0a9f09519595c2fa1f6232bb2624a713
2016-12-14 19:46:18 -08:00
Kunal Mehta f3778856f2 Add severity for error categories
Categories can now have a severity level of "error" or "warning"
designated, which places them in a different heading on
Special:LintErrors.

Bug: T152822
Change-Id: I1276b9502d90765e88dcb8ea78569dee910c5d88
2016-12-14 17:07:40 -08:00
jenkins-bot 69fd50c811 Merge "Record totals in categories in statsd" 2016-12-15 00:03:42 +00:00
Translation updater bot 3ae0ff7c29 Localisation updates from https://translatewiki.net.
Change-Id: I61769ce3d3960e4efe1379ed2458ab3e50e291b2
2016-12-14 22:24:20 +01:00
jenkins-bot 06ece970b1 Merge "Add missing semicolon to &mdash" 2016-12-14 16:59:27 +00:00
Kunal Mehta 651d8f174b Add missing semicolon to &mdash
Change-Id: If669c89cd06ca173c0dcf6a01a793ddf8ce31793
2016-12-14 01:01:57 -08:00
Translation updater bot 152546d274 Localisation updates from https://translatewiki.net.
Change-Id: Iba1733ad1b050716f0c93d9592d7e3bc4b9a9e35
2016-12-13 22:43:25 +01:00
Translation updater bot 4dcbc5b639 Localisation updates from https://translatewiki.net.
Change-Id: Ie5cdfb74e69456f1e911e7890abf4637aa170fbf
2016-12-12 22:30:34 +01:00
Kunal Mehta 9ba2839e7d Record totals in categories in statsd
For historical purposes so we can see new errors being added/fixed.

Bug: T152664
Change-Id: Icec62d236351e43ec397ac448805ab16131c943c
2016-12-08 16:52:52 -08:00
Kunal Mehta 782313088d Show error counts on Special:LintErrors
Change-Id: Ib49f2e391ca4b9d1eef5443c011d54a42921ce4e
2016-12-08 16:52:31 -08:00
Translation updater bot ca7a3e85c1 Localisation updates from https://translatewiki.net.
Change-Id: Ib5d48d20a2d5c02df1a42e45d6724a531a1fb450
2016-12-06 22:44:49 +01:00
Kunal Mehta df0f222fa3 Remove redundant index
Because linter_cat is the leftmost part of the linter_cat_page_position
index, we don't need a separate one.

Pointed out by jynus in T148866#2846381.

Change-Id: I3b0e75b02762cc948baf8dbdfee67b611aa3b9c1
2016-12-05 19:40:27 -08:00
Kunal Mehta 08b4c26b7d Add unit tests for LintError
Change-Id: I62ac7c2d652afb7a46e912ad6178ebeb3cff3ff2
2016-12-02 16:27:48 -08:00
Kunal Mehta 81ef6878af Include location in LintError::id()
Since it's no longer in $this->params, we need to explicitly include it.

Change-Id: I45f26db061f02066aa03a501dc022bf33e2c096e
2016-12-02 16:15:17 -08:00
Kunal Mehta 8e2d4e42ee Use INSERT IGNORE when putting new lint errors in the database
The most likely scenario of duplicate key errors is that it's the exact
same lint error and there's just a race condition when calculating which
new errors need to be inserted, so just ignore them.

Follows-up 419610bcdb.

Change-Id: I84749ab221bbd517b474be8875bb6a59e4f3258e
2016-12-02 15:54:02 -08:00
Kunal Mehta fa56bafacf Add basic integration tests for RecordLintJob
Change-Id: I6852d41f481282750b690b2e8122dcb224b4a107
2016-12-02 08:11:16 -08:00
Kunal Mehta a50398d4ce Remove unused LintError::equals()
Change-Id: I0d0d743119fee8a95627c365e1b2f45b8fcf67e7
2016-12-02 07:56:19 -08:00
Kunal Mehta 3a03781a70 Add basic integration tests for Special:LintErrors
Change-Id: I2d527ae6f4f615e73ea5dafa21ba678c1de835f7
2016-12-02 07:55:26 -08:00
Kunal Mehta 9d5759329f Add alias file
So people can localize the special page name

Change-Id: Icd331d02f400dfca465236bb95c1357c58480260
2016-12-02 07:55:13 -08:00
Kunal Mehta 14b53d6281 Add integration tests for Database class
These tests insert variations of fake lint errors into the database, and
then read out of the database to check they round-trip properly.

And while we're at it, improve the setForPage() return value.

These tests can be run with something like:
 php tests/phpunit/phpunit.php extensions/Linter/tests/phpunit/

Change-Id: Ifdba8a8a104d218a822f909bc5d7b3512aca499d
2016-11-30 21:17:51 -08:00
Kunal Mehta 419610bcdb Enforce category/page/position uniqueness constraint in the database
Move location to two separate columns in the database: linter_start and
linter_end. This allows us to have the database enforce the uniqueness
of those fields, instead of just relying upon the PHP code to do so,
which could be bypassed since we have multiple servers and concurrent
processes.

Change-Id: I3e67ce1b7cb3c93866a388ec3248af4cff2a81e0
2016-11-30 18:55:19 -08:00
Kunal Mehta 9550db450d Fix inserting errors if none exist for that page
If no errors existed for the page, inserting new ones would fail with a
database error since $errors was key-ed by unique id, which the database
wrapper interpreted as field names, causing issues. Using array_values()
gets rid of the keys, fixing the issue.

Change-Id: I7645de4e5d3ac4462d7980374c8ef8be6280442b
2016-11-30 18:17:36 -08:00
Translation updater bot 65cdec486c Localisation updates from https://translatewiki.net.
Change-Id: Idc28e0c6c5380c3bd421036d16574c85becd8da8
2016-11-27 22:29:17 +01:00
Translation updater bot ad6efbb7b1 Localisation updates from https://translatewiki.net.
Change-Id: Ie2bcb5ff42bb1947966a30e265d87824831d497d
2016-11-25 22:51:26 +01:00
Translation updater bot 8756b0d573 Localisation updates from https://translatewiki.net.
Change-Id: I3a1690d156832b4b8629b6ac97b0948d0271bb9c
2016-11-24 22:20:23 +01:00
jenkins-bot 603f480f5b Merge "De-duplicate errors and trim excessive errors in the same category" 2016-11-24 14:56:49 +00:00
Kunal Mehta 29379edb0b De-duplicate errors and trim excessive errors in the same category
It's possible to have duplicate, identical lint errors if the same exact
error is repeated in a template transclusion (e.g. {{1x|<b/> <b/>}})
since the position via dsr is the same. In this case, just de-duplicate
the errors since we can't differentiate them.

At the same time, trim excessive errors on the same page in the same
category. It's most likely that if a page has that many of the same
errors, the editor or bot will just fix all of them at the same time, so
we don't need to include all of them in the database. 20 is kind of a
low value, but we can always increase it later on as necessary.

Change-Id: I9cded720169870d0eea574e1a930ce4e9b190ac0
2016-11-23 19:47:04 -08:00
jenkins-bot eb8981bd79 Merge "Delete linter rows when pages are deleted" 2016-11-23 23:58:31 +00:00
Translation updater bot 66c9a0ca2c Localisation updates from https://translatewiki.net.
Change-Id: I3784c6c60a22796ab73ed05b78c58e26f56e7c46
2016-11-23 22:37:53 +01:00
jenkins-bot 5db0873adc Merge "API: Fix lntcategories parameter" 2016-11-23 02:41:52 +00:00
jenkins-bot cd819bdc65 Merge "API: Fix up action=record-lint's getAllowedParams()" 2016-11-23 02:40:22 +00:00
jenkins-bot 78e7e8f8b8 Merge "LintErrorsPager: Set explicit output format on some messages" 2016-11-23 02:39:36 +00:00
jenkins-bot 98ec5c3388 Merge "SpecialLintErrors: Implement getSubpagesForPrefixSearch()" 2016-11-23 02:38:15 +00:00
jenkins-bot d62cd4efc7 Merge "Hardcode category ids" 2016-11-23 02:37:04 +00:00
Kunal Mehta 70cc3ac190 Delete linter rows when pages are deleted
Bug: T151281
Change-Id: I3b113d0729b288683d9bc6c2f552b99ed2890f5c
2016-11-22 18:31:21 -08:00
Kunal Mehta 06671d2034 API: Fix lntcategories parameter
* Treat it as an array in all cases
* Make the default value all categories
* Rename from category to categories

Bug: T151288
Change-Id: I5c0c341112894c5a7ec3aaebb6ac9085353f55bd
2016-11-22 18:31:21 -08:00
Kunal Mehta 2f39ab7fff API: Fix up action=record-lint's getAllowedParams()
Since this module is internal, it doesn't really matter, but it cleans
up the output on api.php?modules=record-lint.

Bug: T151285
Change-Id: I859a2780d6ed1918cc81101e9e2c2cd348a2390a
2016-11-22 18:31:21 -08:00
Kunal Mehta d8437fc9c3 LintErrorsPager: Set explicit output format on some messages
Bug: T151283
Change-Id: Ic52bc11a6aacf7f5bb23d9273fa0bf2a27e0cfc4
2016-11-22 18:31:21 -08:00
Kunal Mehta 96c5e091f1 SpecialLintErrors: Implement getSubpagesForPrefixSearch()
Test plan:
Type "Special:LintErrors/" into the search box, and see that the
autocomplete dropdowns include the subpages for individual error
categories.

Bug: T151289
Change-Id: I919e0e51a3b956f275f9a372b2f2844002972ea7
2016-11-22 18:31:21 -08:00
Kunal Mehta b41e74ce8b Hardcode category ids
Instead of having a complex auto-increment category manager that had
additional caching, just hardcode the (currently 6) ids for each
category, which allows us to simplify a lot of code.

If Parsoid sends a lint error in a category that we don't know about, it
is silently dropped.

Bug: T151287
Change-Id: Ice6edf1b7985390aa0c1c410d357bc565bb69108
2016-11-22 18:31:17 -08:00
Translation updater bot 03be9d61c0 Localisation updates from https://translatewiki.net.
Change-Id: Ife6b67db3375c586d9ad769d76162a4141637d32
2016-11-22 23:25:00 +01:00
Justin Du 9970699910 API: Fix example URL for list=linterrors
The prefix should be lnt, not le.

Bug: T151284
Change-Id: Ib8ffbc9ee181e93da6b990ef8c788da7e49767cd
2016-11-21 20:25:29 -08:00