Commit graph

7794 commits

Author SHA1 Message Date
WMDE-Fisch
6df9ed1ad6 update mediawiki-codesniffer to 0.11.0 and fix issues
- mostly auto fixes
- some too long lines fixed
- ignore amp space in one case  passing by reference

Change-Id: I6472f83bc3cbf4bd629d83050cc3319b19ec465c
2017-08-11 22:27:51 +02:00
MusikAnimal
d779a09035 Create new table to be used for querying IP ranges.
When revisions by logged out users are created, they will get copied
to this table. We can then JOIN it with revision when querying for
ranges at Special:Contributions.

DBA approval for this table can be found at T156318

Bug: T163562

Change-Id: I6593eb13701128faa782691a6b25ec01869c827d
2017-08-10 21:28:16 +00:00
Jesús Martínez Novo
c9cc6a299b Fix overzealous addQuotes for rc_source field in rebuildrecentchanges.php
Those quotes aren't needed since those constants are being used as an array
value and the database methods already quotes them. It caused the field to
be double-quoted and being inserted with quotes on the database.

Bug: T172205
Change-Id: I050f8d477600ee44794b7525a119b3d4451e5a28
2017-08-03 09:09:36 +00:00
Jesús Martínez Novo
ec7b5e9262 refreshLinks.php: Fix fatal when using --category parameter
A title object must be passed to refreshCategory(), which is created in
the above lines, not the string representation received as a parameter.

bug: T172061
Change-Id: Id579a86a26cb438c1866351064c6887dbcea23b0
2017-07-30 15:39:36 +02:00
jenkins-bot
a00e369aff Merge "Follow-up to '3D' file type addition" 2017-07-29 00:03:18 +00:00
Matthias Mullie
6260545fee Follow-up to '3D' file type addition
Based on feedback on Id78a504302fa664b353a4c45bdc5d99f95a0180a

Bug: T157348
Change-Id: Id6bfe8d20307f62e4673a5ef30e79f164b1ea034
2017-07-28 23:46:33 +00:00
Bartosz Dziewoński
25d8d26071 updateCredits: Fix collation name
'uca-default-u-kn' is a valid name for MediaWiki's category collation
functionality ($wgCategoryCollation / Collation class), not for PHP's
collation functionality (Collator class).

'uca-default-u-kn' for Collation maps to 'root-u-kn' for Collator
(see Collation::factory()), and the '-u-kn' suffix is later stripped
to enable numeric collation (see IcuCollation::_construct()).

This doesn't seem to result in any changes in the output.

Change-Id: I8cc7d283aee5408f8b7bed365661ff286236a694
2017-07-28 17:24:03 +00:00
jenkins-bot
fdf8c2e171 Merge "Enable jsduck for resources/src/mediawiki.rcfilters and make pass" 2017-07-28 05:48:51 +00:00
Roan Kattouw
1cf0acaa62 Enable jsduck for resources/src/mediawiki.rcfilters and make pass
Change-Id: I2a29689e2697108a5c5206cc61b36b5fb838182f
2017-07-27 18:16:47 -07:00
Timo Tijhof
3bcc039e7a benchmarks: Add benchmarks for MapCacheLRU and HashBagOStuff
Currently, HashBagOStuff leads in most benchmarks, except for
the --fill benchmark, where MapCacheLRU is faster on HHVM.
(by invoking with `PHP=hhvm mwscript maintenance/bench...`)

Run in MediaWiki-Vagrant (Debian Jessie) on MacBook Pro host.

$ benchmarkLruHash.php --count 50000 --construct
Running PHP 5.6.30-0+deb8u1:
- HashBagOStuff-construct (22% faster)
  total: 446.20ms (min: 0.01ms, median: 0.01ms, max: 2.09ms)
- MapCacheLRU-construct
  total: 575.31ms (min: 0.01ms, median: 0.01ms, max: 3.51ms)
Running PHP version 5.6.99-hhvm:
- HashBagOStuff-construct (13% faster)
  total: 124.70ms (min: 0.00ms, median: 0.00ms, max: 1.27ms)
- MapCacheLRU-construct
  total: 143.76ms (min: 0.00ms, median: 0.00ms, max: 2.01ms)

For MapCacheLRU, the main slowdown is its use of Wikimedia\Assert.
Removing that would make it faster than HashBagOStuff.

$ benchmarkLruHash.php --count 3000 --fill
Running PHP 5.6.30-0+deb8u1:
- HashBagOStuff-fill (22% faster)
  total: 10196.82ms (min: 2.91ms, median: 3.24ms, max: 9.51ms)
- MapCacheLRU-fill
  total: 13197.13ms (min: 3.92ms, median: 4.31ms, max: 9.90ms)
Running PHP version 5.6.99-hhvm:
- HashBagOStuff-fill
  total: 5700.37ms (min: 1.71ms, median: 1.85ms, max: 8.24ms)
- MapCacheLRU-fill (11% faster)
  total: 4986.90ms (min: 1.48ms, median: 1.62ms, max: 6.93ms)

Change-Id: Icd03f872dddb308f162c72674c8d2aa6092395e5
2017-07-27 21:40:42 +00:00
Reedy
cd3f1d58de Add some output messages to populatePPSortKey
Change-Id: I8a78fd1575c6a79cd78288c4f1e53a35689d1205
2017-07-26 00:47:58 +01:00
jenkins-bot
baa5c190ea Merge "addRFCandPMIDInterwiki.php: Add trailing . to skipped message" 2017-07-25 23:34:36 +00:00
Reedy
bd38435848 addRFCandPMIDInterwiki.php: Add trailing . to skipped message
Change-Id: If7966d1356605ae18857055ac5e6f8364187c414
2017-07-25 23:26:14 +00:00
Roan Kattouw
a3d8d1a1b1 Follow-up 993ce4d: use pp_page for $lastPageValue, not pp_value
This caused the script to get in an infinite loop and never stop.

Change-Id: Ib28a033e82b76fd60005335b882a7f5d95ac6644
2017-07-25 16:20:37 -07:00
jenkins-bot
4427b84407 Merge "Add a maintenance script for populating pp_sortkey" 2017-07-25 23:00:58 +00:00
Kunal Mehta
d1cf48a397 build: Update mediawiki/mediawiki-codesniffer to 0.10.1
And auto-fix all errors.

The `<exclude-pattern>` stanzas are now included in the default ruleset
and don't need to be repeated.

Change-Id: I928af549dc88ac2c6cb82058f64c7c7f3111598a
2017-07-22 18:24:09 -07:00
jenkins-bot
e72303c9f3 Merge "Remove auto-generated "Constructor" documentation on constructors" 2017-07-21 13:19:44 +00:00
Thiemo Mättig
91a920fd85 Remove auto-generated "Constructor" documentation on constructors
Having such comments is worse than not having them. They add zero
information. But you must read the text to understand there is
nothing you don't already know from the class and the method name.

This is similar to I994d11e. Even more trivial, because this here is
about comments that don't say anything but "constructor".

Change-Id: I474dcdb5997bea3aafd11c0760ee072dfaff124c
2017-07-21 12:19:30 +02:00
jenkins-bot
1c6805c759 Merge "maintenance: Consistently use hasOption() for boolean options" 2017-07-19 22:08:02 +00:00
Timo Tijhof
1e0a992f6c maintenance: Consistently use hasOption() for boolean options
We already do this in many places, but there were also still plenty
of getOption(, false) calls. Change these to hasOption() for consistency.

Change-Id: I74f91a5bf5a8036496ab1f493e5862a04d27ec0f
2017-07-19 14:52:21 -05:00
Reedy
8a60ace2a6 Set batch size to 1000 in updateRestrictions
As far as can be seen on enwiki, very few rows to update

Change-Id: Idf8dee951a5240c4ebaa73fc02c1248a6737b3f8
2017-07-19 18:35:02 +01:00
Timo Tijhof
820446e251 maintenance: Add --dry-run option to deleteDefaultMessages.php
For back-compat, keep the default as-is, because it is also
used as a post-update script by the installer.

But for convenience and safe manual use, do add a dry-run option.
(Ideally this would be a --delete option and dry-run by default.)

Change-Id: I3ca70f15f50b66f9d19fa705cef9a4aae2dd4e5c
2017-07-18 21:18:28 +00:00
jenkins-bot
10d1b7d12b Merge "New maintenance script to recalculate category membership counts" 2017-07-15 08:02:21 +00:00
This, that and the other
50affc7781 New maintenance script to recalculate category membership counts
The category membership counts stored in the category table have a habit of
drifting away from the actual number of pages in the category. This script
identifies incorrectly-counted categories by performing a SELECT on the
replica DB, then querying master for up-to-date counts and updating the
category rows with those counts.

It's possible that a LinksUpdate job will be in progress while this script
is run. LinksUpdate does categorylinks INSERTs and category UPDATEs in
separate transactions, and our count might occur in between, leading to
category values that are slightly off. But since we are only updating
categories with already incorrect counts, we are not making the situation
any worse than it already was.

The script runs reasonably quickly on all but the very largest wikis.

Bug: T18765
Change-Id: I555f068fbf3aee20a7775d5532781f421f706346
2017-07-15 07:37:11 +00:00
mdew192837
993ce4d411 Add a maintenance script for populating pp_sortkey
The addition of a pp_sortkey field in T60032 necessitates an update
to old entries in the page_props table that don't have a pp_sortkey.
The script uses the pp_value as the sort key if it's numeric.
The script extends LoggedUpdateMaintenance so it only runs once.
Added the script to MysqlUpdater so that it automatically runs.

Bug: T66949
Change-Id: Id482dc73ec1963010324e51fe9273a72dd31a7f7
2017-07-13 22:55:26 +00:00
jenkins-bot
29115b9e53 Merge "Maintenance script to purge specific page" 2017-07-13 02:18:22 +00:00
jenkins-bot
b85207c9c0 Merge "Fix cleanupTitles.php" 2017-07-12 19:24:54 +00:00
jenkins-bot
51cb436f38 Merge "Give some idea of time remaining" 2017-07-12 19:02:00 +00:00
jenkins-bot
7fa619d361 Merge "Use shell_exec instead of backtick" 2017-07-11 00:50:04 +00:00
Max Semenik
d5a429a10e Fix cleanupTitles.php
It was failing in production with duplicate key error in
moveInconsistentPage(). Live-patching it to check for existence
for updates resolved the issues. Committing the fix now.

Change-Id: I1c0bf632b5040b44f5a49c8fb95779e7ed19dea9
2017-07-10 15:07:07 -07:00
Matthew Flaschen
5e6a3a418c Use shell_exec instead of backtick
They are exactly equivalent, but shell_exec is more readable.
We just imported a sniff to forbid backtick into mediawiki-codesniffer.

It's not deployed here yet, but this will facilitate it.

Change-Id: I4b58ed78e1792ff83e1bf99425f8f19123cfe911
2017-07-06 19:14:38 -04:00
Mark A. Hershberger
36cea971b6 Give some idea of time remaining
Bug: T169931
Change-Id: I3c80727516c329e5b911e9f29d17a2a9e860f44d
2017-07-06 17:57:06 -04:00
Gilles Dubuc
30d645574f Maintenance script to purge specific page
Bug: T169195
Change-Id: Ia55f926e019eed5d5f421d49506b8182e5b2c5b7
2017-07-06 17:34:49 +02:00
Kunal Mehta
399adec9ad Turn ParserCache into a service, deprecate $parserMemc
ParserCache is already a singleton, making it a good candidate for a
service. $parserMemc is an odd global (it lacks the "wg" prefix) and is
ripe for deprecation.

The following are now deprecated:
* $parserMemc global
* ParserCache::singleton()
* wfGetParserCacheStorage()

A ParserCache::getCacheStorage() method was added for cases where direct
access to the underlying BagOStuff object is necessary.

Usage of $parserMemc will emit deprecation warnings through the
DeprecatedGlobal class mechanism. All usage in core was migrated.

Also take this opportunity to inject the $wgCacheEpoch global value into
ParserCache. This will require an update to the FlaggedRevs extension.

Change-Id: I2ac7afff0d8522214329248c3d1cdccd0f72bbd4
2017-07-05 19:56:49 -07:00
jenkins-bot
08a3993adc Merge "Allow install.php to run env-checks with no db" 2017-07-04 19:42:56 +00:00
jenkins-bot
3cbaa0f861 Merge "Don't ask for password for env-checks in install.php" 2017-07-04 19:42:52 +00:00
addshore
ba87c9a6c6 Allow install.php to run env-checks with no db
Bug: T169668
Change-Id: Ibb05b26cbf2d26c02ee7f26497e16d2c98e97de2
2017-07-04 19:39:42 +01:00
addshore
99b0296945 Don't ask for password for env-checks in install.php
Bug: T169669
Change-Id: I00dbaca0e4532ecc499317ec8f1cb7f9eb872db3
2017-07-04 19:31:22 +01:00
Umherirrender
b5cddfb27b Remove empty lines at begin of function, if, foreach, switch
Organize phpcs.xml a bit

Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
2017-07-01 11:34:16 +00:00
jenkins-bot
9fde467cac Merge "clone keyword must not be used as a function" 2017-06-29 01:11:20 +00:00
Umherirrender
9cd5a3fccf clone keyword must not be used as a function
Also changed a require_once

Change-Id: Ib8030ea5320a62ee4f114d8d506382c5665e3e02
2017-06-28 16:29:33 +02:00
jenkins-bot
25d765c473 Merge "benchmarks: Add benchmark for JSMinPlus" 2017-06-28 00:00:12 +00:00
jenkins-bot
203cedd029 Merge "Remove "@author Aaron Schulz" annotations" 2017-06-27 22:39:10 +00:00
Aaron Schulz
82e2c924e4 Remove "@author Aaron Schulz" annotations
Bug: T139301
Change-Id: Ib5248e8e27d60611c7373bce4b29dd5e85aa3489
2017-06-27 15:24:14 -07:00
jenkins-bot
164ac51879 Merge "benchmarks: Add reporting of resource usage" 2017-06-27 22:19:19 +00:00
Timo Tijhof
0df8f6d49c benchmarks: Add benchmark for JSMinPlus
Example usage

> mwscript maintenance/benchmarks/benchmarkJSMinPlus.php --file resources/lib/jquery/jquery.js -v

Bug: T31784
Change-Id: I3c11574adb864a4bfbfceba137e285fdb8dc66d2
2017-06-27 22:17:39 +00:00
Umherirrender
be42e09aa8 build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0
The used phpcs has a bug, so the version 0.9.0 could not be enforced at the moment.
Will be fixed in next version, see T167168

Changed:
- Remove duplicate newline at end of file
- Add space between function and ( for closures
- and -> &&, or -> ||

Change-Id: I4172fb08861729bccd55aecbd07e029e2638d311
2017-06-26 17:14:31 +00:00
Prateek Saxena
2e600acf4a docs: Use oojs-ui-wikimediaui, instead of -mediawiki
Change-Id: Iac6a526c928fe384f5f7df5af6b0156146bf2f33
2017-06-26 09:23:30 +05:30
jenkins-bot
f7e1770fb8 Merge "Add 3D filetype for STL files" 2017-06-22 16:49:40 +00:00
Brad Jorsch
2e1f3a53c8 Remove execute bits from non-executable files
Change-Id: I4d6a202c63bef3e52b67b55fb6daef04dc2fdd62
2017-06-22 11:28:39 -04:00