| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: I2c1bc3b4e0ee782076ddaeae133672b730d345d9
|
|
|
|
|
|
|
| |
Found via disabling phan's alias support for a run (and ignoring wgLang's
hard-coded state of being a \Language, alas).
Change-Id: I4753bcd84d72d6de111fc7ffc5841fa417bf7333
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I assume these are all either auto-generated by an IDE or the
language-level type declarations have been added later. In any case
the comments don't add any new information to what the code already
says. This is just extra clutter that makes the code harder to read,
I would argue.
There are many, many more comments like this. In this patch I
intentionally focus on the most trivial 1-line comments.
Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suppress remaining issues
Depends-On: I633ec05fe9ab6a815225911d942ecb79f21c428f
Depends-On: I186e799256fbaf5ee77558bd146f9418dd5eaacc
Depends-On: Ib84b7d71e8308a36409f30ecfd16e9de149e97b3
Depends-On: I26aa4adf31b4142248abe3e0f9aa8314512602a6
Depends-On: Icf24e208a487bafe3d1983536870aac19cfc4b5e
Depends-On: I99915b893f14cfbb2b54d9a6264b4f294200c4f2
Depends-On: Ia53b71dff3299837856ae3c004cd0227bd45e05b
Change-Id: I825dce05d4a6ca87acf25063e3664cb2d16f5db0
|
|
|
|
|
|
|
|
|
|
|
| |
Remove unused $db parameter and make the $cluster required. Update
the checkStorage.php callers to provide the cluster.
Use the getTable() method in trackBlobs.php to avoid duplication.
Mark this method as @internal to the class and /storage scripts.
Change-Id: I888040a536a60e22e780900a59e4c34b6c468cdf
|
|
|
|
|
|
|
|
|
|
| |
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I7dec01892a987a87b1b79374a1c28f97d055e8fa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* Maintenance scripts in core have bolierplate code that is
added before and after the class to allow directly running
the maintenance script.
* Running the maintenance script directly has been deprecated
since 1.40, so this boilerplate code is only to support a now
deprecated method of running maintenance scripts.
* This code cannot also be marked as covered, due to PHPUnit
not recognising code coverage for files.
* Therefore, it is best to ignore this boilerplate code in code
coverage reports as it cannot be marked as covered and also
is for deprecated code.
What:
* Wrap the boilerplate code (requiring Maintenance.php and then
later defining the maintenance script class and running if the
maintenance script was called directly) with @codeCoverageIgnore
comments.
* Some files use a different boilerplate code, however, these
should also be marked as ignored for coverage for the same
reason that coverage is not properly reported for files.
Bug: T371167
Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
|
|
|
|
|
|
|
|
| |
This touches various production classes and maintenance scripts.
The code should do the exact same as before. The main benefit is that
the syntax avoids any repetition.
Change-Id: I5c552125469f4d7fb5b0fe494d198951b05eb35f
|
|
|
|
|
|
|
| |
Maintenance scripts do not use DBO_TRX mode so this was redundant.
Bug: T311090
Change-Id: I6dc6d2a8e7daf8a2a1dac7c3f8968b4a575b3dd6
|
|
|
|
|
| |
Bug: T361023
Change-Id: Ieb229d8088cb1ff3f03e44f7ac99eb612f48bc7b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid the call to internal constructor of AndExpressionGroup and
OrExpressionGroup by creating a factory function similiar as the
IReadableDatabase::expr function for Expression objects.
This is also a replacement for calls to ISQLPlatform::makeList with
LIST_AND or LIST_OR argument to reduce passing sql as string to the
query builders.
Created two functions to allow the return type to be set for both
expression group to allow further calls of ->and() or ->or() on the
returned object.
Depending on the length of the array argument to makeList() it is
sometimes hard to see if the list gets converted to AND or OR, having
the operator in the function name makes it easier to read, so two
functions are helpful in this case as well.
Bug: T358961
Change-Id: Ica29689cbd0b111b099bb09b20845f85ae4c3376
|
|
|
|
|
|
|
| |
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: Ic4d4dd61de5ab896fb6173eb579c81f164a1e4a3
|
|
|
|
|
|
|
| |
Completely unused.
Bug: T363839
Change-Id: I041ab5ce57ef116076dcc07b2035b5336ceff032
|
|
|
|
|
| |
Bug: T326274
Change-Id: I90493d7cd4c21fdc022bcc19765fc04d986a9c8f
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Replace BETWEEN with >= and <= operator
Change-Id: Ic21b6f4cc11c773c967d9d4c5f20e762c2ff9629
|
|/
|
|
| |
Change-Id: I74302c9b2818e02d7d5e67a728558ced5e8f0181
|
|
|
|
|
| |
Bug: T353219
Change-Id: Ic278c8534dad40a3f34674db2d5fbfbca5984da8
|
|
|
|
|
| |
Bug: T330641
Change-Id: I6d30af6ff9f667e367d39befb80c2bb0bf5fb29e
|
|
|
|
|
|
|
|
|
|
| |
* Change `$services->getDBLoadBalancerFactory()->waitForReplication()`
to `$this->waitForReplication()`
* Change various complicated expressions to `$this->getReplicaDB()`
and `$this->getPrimaryDB()`
* Remove unused variables
Change-Id: Ia857be54938a32bb6288dcdf695a35cd38761c3c
|
|
|
|
|
|
|
|
|
|
|
|
| |
And start using them instead of wfGetDB(), LB/LBF connection methods or
worse, $this->getDB().
$this->getDB() reuses the database object regardless of whether you're
calling a replica or primary, leading to returning a replica on a
primary and other way around.
Bug: T330641
Change-Id: I9e2cf85ca277022284fc26b9f37db57bd12aaa81
|
|
|
|
|
|
|
| |
This was somehow left out
Bug: T210206
Change-Id: I70851b5b99fa865dbfd629caf2c1866c85418350
|
|
|
|
|
|
|
|
|
| |
Tests are not checked.
There is nothing left as far I can check.
Bug: T353219
Change-Id: I1d58397118c7ab1110b9d7cf400c59c4bff7378c
|
|
|
|
|
|
|
|
|
|
| |
For readability. Allowed since PHP 7.4.
I searched for integer literals of 6 or more digits, and also changed
some nearby smaller numbers for consistency.
Bug: T353205
Change-Id: I8518e04889ba8fd52e0f9476a74f8e3e1454b678
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pass Authority to WikiImporter constructor, instead of looking at the
user from RequestContext::getMain(), and skipping this check if
$wgCommandLineMode is true.
Maintenance scripts now use UltimateAuthority, to match the original
intent of skipping permission checks, see 2ed55f42 / r96311.
The Authority parameter to WikiImporterFactory::getWikiImporter() is
optional for now for backwards-compatibility. It should become
required later after deprecation.
Change-Id: Iea1d03dcdcbda2f9a9adbff1b0d319efd22c4d86
|
|
|
|
|
| |
Bug: T210206
Change-Id: Ie7bf3701fa9d51a43167ce7ec0c1f30bc090296b
|
|
|
|
|
|
|
| |
blobs
Bug: T340174
Change-Id: I5d6385b5c924985f47e199dee3ecef13905d6388
|
|
|
|
|
| |
Bug: T344971
Change-Id: Ia727b513a6bfcaa5a0b13977a6789aa879ad2f0b
|
|
|
|
|
|
|
| |
Around fifty-ish. Found becuase of fixed MigrateSelect.
Bug: T344971
Change-Id: If85428d5a033822bfd8ee1f6ab730863bfad55bd
|
|
|
|
|
|
|
|
|
|
|
| |
Done semi-automatically via migrateselect[1]. The script only accepted
ascii chars until I found out and fixed it and now I can run it in more
places.
[1] https://gitlab.wikimedia.org/ladsgroup/migrateselect
Bug: T344971
Change-Id: I83b6c424c62a517a0ab3635b64488ea53fd88bab
|
|
|
|
|
|
|
|
|
| |
Deprecating RevisionStore::getQueryInfo() and cleaning up a lot of code
Also removing a brittle test that wasn't really testing anything.
Bug: T344971
Change-Id: Ifd690dc8f030f86e3567a717eaeb830cb6dc703b
|
|
|
|
|
|
|
|
|
|
|
| |
Maintenance class provides a method for getting a fresh reference
of the MW services container instance. Let's make use of these in
maintenance scripts now that we have it.
NOTE: There are still some static methods like in refreshLinks.php
that makes use of services that we can't use this method for now.
Change-Id: Idba744057577896fc97c9ecf4724db27542bf01c
|
|
|
|
|
|
|
| |
Previous revisions can have bigger revision IDs than the last revision
in a few situations, including imported or history-merged revisions.
Change-Id: I4e23d10b0763de4b016460e789baec4f560f1674
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Using a php parser written on top of ANTLR4, done semi-automatically.
I checked everything and made adjustments.
Bug: T311866
Change-Id: I6150c6909bce8f3dbd745a26380cc0af9d9c547f
|
|/
|
|
|
|
| |
Reduce raw sql fragments on simple compares
Change-Id: I3f2340dfdbf5197cc22546911e6c5653dc5a6269
|
|
|
|
|
|
|
| |
Done semi-automatically via a php parser written on top of ANTLR4.
Bug: T311866
Change-Id: I33f5b6703c0aa9c80c907a21c2a770e30642edd3
|
|
|
|
|
|
|
|
|
|
|
| |
To fix legacy encoding entries in external storage which means they
can't be fixed via calling moveToExternal.php.
The script originally was copy-paste and clean up of moveToExternal.php
but it made so much duplication that I went with subclassing.
Bug: T282734
Change-Id: Ic52e843f3dbe7d14cc8df5e8f3fe7aada7681bc9
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
CommandLineInc is deprecated. This allows the scripts to be executed
from MaintenanceRunner.
Change-Id: I180605ea5cb47783670b28a6f01d98f0398c705d
|
|/
|
|
|
|
|
| |
This bug has messed up content of 0.5M revisions in English Wikipedia
Bug: T128150
Change-Id: I675287a07a58df0f19a35011c012462400e90be8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While most rows in production use 'utf-8' to flag content being UTF-8,
we have lots of rows flagged with 'utf8':
mysql:research@s3-analytics-replica.eqiad.wmnet [dawiki]> select old_flags, count(*) from text group by old_flags limit 50;
+---------------------+----------+
| old_flags | count(*) |
+---------------------+----------+
| error | 2 |
| external,gzip | 49 |
| external,object | 36 |
| external,utf-8 | 1614469 |
| external,utf8 | 336780 |
| gzip,utf-8,external | 1094 |
| utf-8,gzip,external | 9458083 |
+---------------------+----------+
7 rows in set (26.038 sec)
This would confuse the script to try to reencode it again which possibly
could lead to all sorts of errors
Change-Id: I9b4a38538199c9954cfed51cdd2bba8b0f6cb953
|
|
|
|
|
|
|
|
|
| |
HistoryBlobCurStub objects point to rows in the cur table from 1.4,
which would have used the legacy encoding. It is incorrect to add the
"utf-8" flag without also converting the encoding.
Bug: T337700
Change-Id: Ie884512c1489358cabdf52660a7cb9d0797b8e78
|
|
|
|
|
|
| |
Use inline suppression for known exception from eval/passthru/query call
Change-Id: Ie85ea5698a615adf07e4e391bf06d102149effd5
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Triple backslash in regex should really be quadruple backslash
* Using the returned value of a void method
* Immediately overwritten array keys
* Duplicate array keys
* Foreach variable reuse
* sprintf() with too many params
* Incorrect reference usage
Change-Id: I3c649b543c9561a1614058c50f3847f663ff04df
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is moderately messy.
Process was principally:
* xargs rg --files-with-matches '^use Title;' | grep 'php$' | \
xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1'
* rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \
xargs rg --files-with-matches 'Title\b' | \
xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1'
* composer fix
Then manual fix-ups for a few files that don't have any use statements.
Bug: T166010
Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a
Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
|
|
|
|
|
|
|
| |
And WikiReference
Bug: T321882
Change-Id: I60cf4b9ef02b9d58118caa39172677ddfe03d787
|
|
|
|
|
|
| |
Dead code found by phan
Change-Id: I9fc404d546a4fb1c61394cb6359eb774fd94383a
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Convert these two old scripts to Maintenance subclasses.
* Uncomment the resolveStub() call in moveToExternal and fix one obvious
bug with it, i.e. the fact that stubs need to be resolved after CGZ
blobs are moved.
* Replace get_class() with instanceof.
* Make the "tiny text" threshold configurable. Normally this is not
wanted in WMF production since new revisions are written to ES
unconditionally.
* Add a dry run mode.
* Add an undo log.
* Add --skip-resolve option.
* Make resolveStub() be much more defensive about what it resolves.
* In moveToExternal, make compression optional and do it also for plain
text.
* Optionally convert the legacy encoding to UTF-8.
Bug: T299387
Change-Id: I52d54e3b6b785ac072796031be06499221340f51
|