Commit graph

4827 commits

Author SHA1 Message Date
cenarium
e1509f0caa Move tagging of API deletions to RC save
Since the recent change save of logged actions is now deferred, we need
to move tagging of API deletions to the RC save, like other API actions
do already. Otherwise, only the log gets tagged, not the RC.

Bug: T108564
Change-Id: I4e6e18e7f8fb7a6b0932e7579bafddcc1b0a9758
2016-09-21 19:18:28 +02:00
jenkins-bot
8afc7161ed Merge "FSFile and TempFSFile cleanups" 2016-09-20 23:21:30 +00:00
Brad Jorsch
892c31ebaf API: Remove deprecated methods
All deprecated ApiResult methods are removed. These have been deprecated
since 1.24 or 1.25, and the only users remaining in Gerrit are wrapped
in backwards-compatibility checks and so should not be being called.

ApiBase, ApiFormatBase, ApiMain, and ApiQuery methods for generating the
pre-Ib14c00df help text are removed. Nothing has called these for a long
time, and only Flow implemented them in any way. Deprecated methods for
providing the text for such help, such as getDescription(), haven't been
removed yet, though, since some extensions still call some of them.

Change-Id: I3ca7c98174b4a3f6f67f2b023e0f4446637e7a84
2016-09-20 17:21:00 -04:00
dcausse
16e2491a73 Pass User to SearchEngine::getProfiles
Useful for search engines that allow users to customize search profiles.

Depends-On: Icd577c8ebc6e162befe30bde4fe276e633d2e434
Change-Id: I471cd090730d2a25cb70d622ec3bebbe9583118c
2016-09-20 20:22:23 +00:00
Translation updater bot
2b2149bfef Localisation updates from https://translatewiki.net.
Change-Id: Ia226031f53b3b32abf5cec62bda2c90548ee940b
2016-09-19 22:06:14 +02:00
Aaron Schulz
f7e3ac3f95 FSFile and TempFSFile cleanups
* Remove wf* function dependencies. This includes wfTempDir().
  Callers now should specify the directory, though it will try to do
  most of the wfTempDir() logic anyway if they do not.
* Update callers to inject wfTempDir() so $wgTmpDirectory is used by
  TempFSFile instead of it probing to find a valid directory itself.
* Move most of the wfTempDir() logic to TempFSFile::getUsableTempDirectory().
* Remove unused getMimeType() method.

Change-Id: Idd55936b07f9448a6c90577708722b7b52b8fe66
2016-09-19 19:55:09 +00:00
Aaron Schulz
578d08d84e Make ApiMain use isBot() to catch global bots in checkReadOnly()
Change-Id: I2090b1aad8a5858965e4ec261f8e88c37414e804
2016-09-18 14:01:42 -07:00
Translation updater bot
1bef3ec2eb Localisation updates from https://translatewiki.net.
Change-Id: Ic5673e78a0257e8c8c1cd93d8450f6f7293e0b5d
2016-09-16 23:21:44 +02:00
jenkins-bot
ffa16cf8ae Merge "API: Force straight join for prop=linkshere|transcludedin|fileusage" 2016-09-16 01:45:33 +00:00
jenkins-bot
2979f6e7cf Merge "Replace WikiPage::doEdit() usages" 2016-09-15 21:38:10 +00:00
Reedy
3c27ff94fa Replace WikiPage::doEdit() usages
Update/add some comments

Bug: T145737
Change-Id: Ib3b2b69906074cbb51917dc57204c989fd6c58b2
2016-09-15 21:25:32 +01:00
Translation updater bot
83641dc0d4 Localisation updates from https://translatewiki.net.
Change-Id: Ic6504bfa03dfb50c40231151255bc0297f28275c
2016-09-15 22:18:46 +02:00
Translation updater bot
d40c0e2d3d Localisation updates from https://translatewiki.net.
Change-Id: Iee268ac310eb4a09e6df11ca71a9a71a7d8b19e5
2016-09-14 22:00:21 +02:00
jenkins-bot
8ddc4bea69 Merge "API: Deprecate use of ApiPurge via GET" 2016-09-14 16:36:59 +00:00
Brad Jorsch
8e461ca44e API: Deprecate use of ApiPurge via GET
This emits a warning and logs feature usage, and also pretends that POST
is required in the help and paraminfo output.

Bug: T145649
Change-Id: Ied8d47a947662158fddab383c764bf70c5ab0112
2016-09-14 11:04:33 -04:00
Brad Jorsch
81912c3ef9 API: Force straight join for prop=linkshere|transcludedin|fileusage
MySQL (or at least 5.5.5-10.0.23-MariaDB) chooses a really bad query plan if it
thinks there will be more matching rows in the linktable than are in page. Use
STRAIGHT_JOIN here to force it to use the intended, fast plan. See T145079 for
details.

Bug: T145079
Change-Id: I1a363450b818a049938145d0feb207c9894d2a49
2016-09-14 10:13:10 -04:00
Kunal Mehta
beb18f1edd API: Expose $wgEnableMagicLinks in meta=siteinfo
So Parsoid can use it.

Bug: T145590
Change-Id: Id792e07dc6fffec6d02b34168220b3a4e24b222b
2016-09-13 15:43:19 -07:00
Translation updater bot
0eb6f193a5 Localisation updates from https://translatewiki.net.
Change-Id: I1c1a5601f4e102c7c8ac32908c91f5f3cff25eaa
2016-09-13 22:14:01 +02:00
Kunal Mehta
951c1016ed ChangeTags: Rename "extension" to "software"
Most end users don't care about whether a tag comes from MediaWiki core
or an extension. Since we now have tags that are added by core, let's
rename all of the "extension" terminology to the more generic
"software".

Not renamed in this patch is the i18n message "tags-source-extension",
which will be done in a separate patch to coordinate with TWN, and the
"source" output of the API, to avoid a breaking change.

Change-Id: Ic7b32b3e4bef0c0153a7cf302eef4aa07c52c9f2
2016-09-13 12:16:08 +00:00
jenkins-bot
3e35565c93 Merge "Avoid page_touched update for HTTP GET action=purge requests" 2016-09-13 06:40:52 +00:00
Aaron Schulz
c84ba4d864 Avoid page_touched update for HTTP GET action=purge requests
This will still clear the local DC parser cache and the CDN cache
in all DCs. Therefore, the next page views served by the local
DC will reflect the refreshed content, as will further GET/HEAD
requests by the client that issued the purge using GET/HEAD.

If the problem was imply a stale CDN cache entry, then all
DCs will be up-to-date. If the problem is stale parser cache,
then a proper POST purge request is required to refresh all DCs.

Bug: T92357
Change-Id: I9af12ca8cfff73298f404fd3e2dd4f546621c546
2016-09-13 05:24:46 +00:00
jenkins-bot
fc7d715b4b Merge "Allow putting the app ID in the password for bot passwords" 2016-09-13 00:38:14 +00:00
Translation updater bot
9c7f7dedcb Localisation updates from https://translatewiki.net.
Change-Id: I634a673bf12cc66b2fbffb9a3abd2a2a0237ebe4
2016-09-12 22:18:47 +02:00
Translation updater bot
0e928cc6b7 Localisation updates from https://translatewiki.net.
Change-Id: I7f5b889fba9e6a54d318b58f68c58179d1f5fba7
2016-09-11 22:19:31 +02:00
Translation updater bot
601d1a0021 Localisation updates from https://translatewiki.net.
Change-Id: I0a15f0872c222b8be6576ea43a98cbc14c8c3a1a
2016-09-09 22:22:25 +02:00
Brian Wolff
99485235b0 API: When undoing an edit, allow overriding content model.
This brings the API in line with web UI changes from Ic528f65d.

Bug: T145044
Change-Id: Ib97eef38d228c4da4b062ee96ddbbbb926ee665b
2016-09-08 20:19:45 -07:00
Translation updater bot
94a5679cbe Localisation updates from https://translatewiki.net.
Change-Id: I11dbcc26b7ee18146c907c309bbc67ba4ccc9339
2016-09-08 23:10:04 +02:00
Gergő Tisza
4f29c96197 Allow putting the app ID in the password for bot passwords
Bot passwords allow backwards-compatible login (with grants, for API
usage only) with "<real username>@<botname>" for username plus a
random-generated password.
This doesn't work well with some bot frameworks (including Pywikibot,
the most popular one) which assume that the text that goes into the
username field of the login API is the username that they will be
logged in with afterwards (and so the @-postfix causes all kinds of
errors).

Since the goal of bot passwords is compatibility with old unmaintained
API clients, this patch adds an alternative format which does not
cause problems with old bots: use the username normally, and use
"<botname>@<random-generated password>" as password. Since this is
technically a valid normal password, there is some ambiguity, but
bot passwords have a distintive format so it's easy to check and it is
extremely unlikely that someone would use the exact same format for
their normal password; and if the bot password login fails we can
simply retry it as a normal password, just in case.

Bug: T142304
Change-Id: Ib59a6fbe0e65d80d5e7d19ff37cec5e011c00539
2016-09-07 21:01:55 +00:00
jenkins-bot
5b0aaf1fc5 Merge "Fix ApiStashEdit IDEA warnings" 2016-09-07 20:23:16 +00:00
Translation updater bot
7dac7a5903 Localisation updates from https://translatewiki.net.
Change-Id: Ib4a52f1616cdf4ed928731f1341e094a7f35092b
2016-09-07 22:08:41 +02:00
Aaron Schulz
ae648472b0 Fix ApiStashEdit IDEA warnings
Change-Id: Icc1d0225908e432df10c36d69c6ed282f8761198
2016-09-07 12:00:52 -07:00
Brad Jorsch
40e1070c32 API: Fix query+authmanagerinfo example message names
When code was copy-pasted to create the module, apparently the messages
didn't get renamed correctly.

Change-Id: I1bab2ed5a2b014602b6c3dc1e53a4ce53f78fa6f
2016-09-06 16:35:29 -04:00
Translation updater bot
609cc5702d Localisation updates from https://translatewiki.net.
Change-Id: I53d6598a7fdfc5af3b1afd61c182dc0e6491808d
2016-09-06 22:09:23 +02:00
jenkins-bot
f6c8b955bd Merge "Add API warnings when upload is same as older versions" 2016-09-06 18:55:02 +00:00
Matthias Mullie
4e50971b32 Add API warnings when upload is same as older versions
Bug: T141822
Change-Id: I115d84d865c59200dbb60bd962c093185c9afafe
2016-09-06 18:43:00 +00:00
Aaron Schulz
57e19b610d Renamed some variables from "slave" to "replica"
Change-Id: I455278294cd7ea344d14a76ac5957ece2e07fbf3
2016-09-05 23:03:01 -07:00
Aaron Schulz
950cf6016c Rename DB_SLAVE constant to DB_REPLICA
This is more consistent with LoadBalancer, modern, and inclusive
of master/master mysql, NDB cluster, and MariaDB galera cluster.

The old constant is an alias now.

Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
2016-09-05 22:55:53 -07:00
Aaron Schulz
16266edff3 Change "slave" => "replica DB" in /includes
Change-Id: Icb716219c9335ff8fa447b1733d04b71d9712bf9
2016-09-05 21:01:01 +00:00
Translation updater bot
fb962d346e Localisation updates from https://translatewiki.net.
Change-Id: Ib2530497c22f021d77f3838f9b1b6d3043cc51bc
2016-09-04 21:56:54 +02:00
Translation updater bot
623149a2cc Localisation updates from https://translatewiki.net.
Change-Id: Ib9a3add2d9502cfa52a9a464b92c21633028cca0
2016-09-03 23:50:07 +02:00
Translation updater bot
f55ffbfafd Localisation updates from https://translatewiki.net.
Change-Id: I22dc4d60a502074f810a7ef5b704dd7bda05801f
2016-09-02 22:15:53 +02:00
Chad Horohoe
e0b6c735a8 Don't mention $wgUser, it's ugly and it messes my grep-fu
Change-Id: Ic2b181a9f22f172aa8845a2e13bafa6142469ec4
2016-09-02 11:15:28 -07:00
Aaron Schulz
dc0cdc8a4d Make DeferredUpdates able to run DataUpdates
* Also make ErrorPageError exceptions display themselves
  in PRESEND mode. Before they were always suppressed.
* Make DataUpdate::runUpdates() simply wrap
  DeferredUpdates::execute().
* Remove unused installDBListener() method, which was
  basically moved to Maintenance.
* Enable DBO_TRX for DeferredUpdates::execute() in CLI mode
* Also perform sub-DeferrableUpdate jobs right after their
  parent for better transaction locality.
* Made rollbackMasterChangesAndLog() clear all master
  transactions/rounds, even if there are no changes yet.
  This keeps the state cleaner for continuing.
* For sanity, avoid calling acquirePageLock() in link updates
  unless the transaction ticket is set. These locks are
  already redundant and weaker in range than the locks the
  Job classes that run them get. This helps guard against
  DBTransactionError.
* Renamed $type to $stage to be more clear about the order.

Change-Id: I1e90b56cc80041d70fb9158ac4f027285ad0f2c9
2016-09-02 04:12:50 +00:00
Translation updater bot
1b67dc0885 Localisation updates from https://translatewiki.net.
Change-Id: Ib4393e8374d2b6596a461934e7a5a0f15a88e292
2016-09-01 22:08:52 +02:00
jenkins-bot
dc1a06b939 Merge "ApiParamInfo: Allow fetching info for all submodules of a module" 2016-09-01 00:56:19 +00:00
Translation updater bot
93e39eba6f Localisation updates from https://translatewiki.net.
Change-Id: I94ec22fbff6255c613997c008e185def799495ad
2016-08-31 21:57:45 +02:00
Brad Jorsch
be5c2ca017 ApiParamInfo: Allow fetching info for all submodules of a module
This allows fetching info for all query submodules with modules=query+*,
and info for all modules recursively with modules=main|main+**.

Bug: T28680
Change-Id: Icca5d2fda39d9d43fe20d77e34779412cec77aad
2016-08-31 15:27:07 -04:00
Brad Jorsch
e7be66b4d7 ApiQueryAllDeletedRevisions: More namespace handling fixes
* If the user specifically requests an empty list of namespaces, they
  should get no pages.
* `ar_namespace` should always be in the query so MySQL can do a range
  search instead of a full index scan.
* The example provided didn't match its description.

Bug: T89665
Change-Id: I91afc25db488f75c7f2b1ef343766b4bd7da5472
2016-08-31 13:19:13 -04:00
Translation updater bot
4e9392dc50 Localisation updates from https://translatewiki.net.
Change-Id: I197f28fb1bb4507234a7f534160f017db2476598
2016-08-30 22:04:17 +02:00
jenkins-bot
81100ad05b Merge "API: Warn when input parameters are normalized" 2016-08-30 01:46:36 +00:00