Commit graph

4472 commits

Author SHA1 Message Date
IoannisKydonis
4adb40a797 Reword and clarify API messages
Threads:
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Apihelp-upload-param-leavemessage/uk
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Apihelp-main-param-maxlag/ksh
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Apihelp-import-param-summary/en

Change-Id: I71404b96fe48fed62b50ff2f544da97bd925e9d7
2016-04-02 21:49:06 +02:00
Siebrand Mazeland
336ab226cc Use IP address range instead of IP range
We use "IP address" consistently instead of "IP", but this was never
applied to the "range" addition.

Change-Id: I02fecf0b9e6a5b90f7a24209c7a1cdce64060b23
2016-04-02 19:29:44 +02:00
Translation updater bot
6add84830c Merge "Localisation updates from https://translatewiki.net." 2016-04-01 20:09:37 +00:00
Translation updater bot
2cd31f2660 Localisation updates from https://translatewiki.net.
Change-Id: Ie0a08fde2970106bae564551bb6ed6bd76f8a9da
2016-04-01 21:58:59 +02:00
Reedy
38d63a73a1 ApiPageSet::finishPageSetGeneration() was removed
Bug:T122754
Change-Id: I106f37f5f83e30222a602d88704069ceccc91a29
2016-04-01 19:58:26 +00:00
Reedy
9593b60855 Removed ApiMain::(getFormats|addFormat|addModule|getShowVersions).
Deprecated since 1.21

Bug: T122754
Change-Id: Id5cbc50e45cdfdfeb2e92faffc7ded868a350f4b
2016-04-01 19:41:48 +00:00
Translation updater bot
e97d3c7478 Localisation updates from https://translatewiki.net.
Change-Id: I5b6a5a944e62e3bb64fd1fdbb3fb654bd0726285
2016-03-31 21:54:54 +02:00
Aaron Schulz
39c4d09727 Time POST requests to API write modules
This lets us capture some basic endpoint timing data that is
lacking now, such as upload API call time.

Change-Id: If0627e2d78d82b22ed6bdaaa0fa7fe5f20ef50b1
2016-03-31 10:05:07 +00:00
Translation updater bot
9496297a0e Localisation updates from https://translatewiki.net.
Change-Id: I4768f539d408562cd0b37e083a0500a99c7c66a2
2016-03-30 22:01:05 +02:00
Translation updater bot
a8e00b6fe6 Localisation updates from https://translatewiki.net.
Change-Id: I807d9f22094274e39b0d9e524bd58bc9f46e5234
2016-03-29 22:08:24 +02:00
Translation updater bot
cd2b282b79 Localisation updates from https://translatewiki.net.
Change-Id: I2b5d9392619b4eec5a266f9828ee4a1f09579488
2016-03-28 21:51:27 +02:00
Bartosz Dziewoński
771964fdea ApiMain: Correct typo in variable name
https://en.wikipedia.org/wiki/Asterisk

Change-Id: I6f2d968c92f4e472fe574ebc8a2a5f9932e0d6f2
2016-03-28 16:45:02 +00:00
jenkins-bot
4a33b34696 Merge "API: Normalize input URL in ApiQueryExtLinksUsage" 2016-03-28 02:27:29 +00:00
Translation updater bot
ace407e276 Localisation updates from https://translatewiki.net.
Change-Id: I977112d0c7c10d043c8f71ace015cf0d97e373f3
2016-03-27 20:29:34 +02:00
Brad Jorsch
a2f2cf8cf1 API: Normalize input URL in ApiQueryExtLinksUsage
This matches the behavior of Special:LinkSearch, and makes it more
likely to give sensible results for non-normalized input.

Bug: T130912
Change-Id: I2f60dd48fdfc24108110a24ad41b297ece7f33df
2016-03-26 18:14:43 -04:00
Ori Livneh
5360a3497f Provide a unique request identifier
When MediaWiki encounters an unhandled exception, the error message it produces
includes a randomly-generated token, which allows the exception details to be
looked up in the error logs. This is useful but narrow: would it not be useful
to have the ability to retrieve all log records associated with a particular
request, rather than just exception details? (Hint: yes.)

So: introduce the notion of a request-global unique ID, retrievable via
WebRequest::getRequestId(). When MediaWiki is behind Apache + mod_unique_id
(which provides the same facility) or some other software which sets a
UNIQUE_ID envvar, the value of that envvar is used as the request ID.
Otherwise, it is a randomly-generated 24-character string.

The request ID supplants exception-specific IDs; MWExceptionHandler::getLogId()
is deprecated, accordingly. The request ID is also added as an annotation to
all Monolog-processed log records, and is exposed client-side as 'wgRequestId'.
This allows developers to associate a page view with log records even when the
page view does not result in an unhandled exception. (For the WMF, I also
intend to add it as an annotation to profiling data).

The request ID is not a tracking token; it does not persist, and it is
associated with a backend request, not with a particular user or a particular
session. Like the data in the NewPP report, the request ID is designed to be
cacheable, so that if, for example, a developer notices something weird in the
HTML, s/he can associate the output with a backend request regardless of
whether the response was served from the cache or directly from the backend.

Some prior art:
* https://httpd.apache.org/docs/2.4/mod/mod_unique_id.html
* http://api.rubyonrails.org/classes/ActionDispatch/RequestId.html
* https://github.com/dabapps/django-log-request-id
* https://packagist.org/packages/php-middleware/request-id
* https://github.com/rhyselsmore/flask-request-id

Change-Id: Iaf90c20c330e0470b9b98627a0228cadefd301d1
2016-03-25 16:09:05 +00:00
Translation updater bot
855dfc341d Localisation updates from https://translatewiki.net.
Change-Id: I31cbae4f585f73a2a0ab97909206185a0d1c0aef
2016-03-24 22:09:30 +01:00
Ricordisamoa
1617e7822e Always use 'bool' instead of 'boolean' in Doxygen tags
Just like commit f86a5590aa

Change-Id: Ic9d08bca6524d6bb4baf5170c081ad0f3d738e28
2016-03-24 09:44:09 +01:00
Translation updater bot
fa9b2e6d02 Localisation updates from https://translatewiki.net.
Change-Id: Idf395e9379605a64103df4ee0ce3847b600f5ede
2016-03-23 21:54:56 +01:00
Translation updater bot
f62f84f175 Localisation updates from https://translatewiki.net.
Change-Id: Iba1610b61c1658b22216e57ed5d60d131073feab
2016-03-22 22:00:03 +01:00
Translation updater bot
9478a1db8a Localisation updates from https://translatewiki.net.
Change-Id: I9e4277291fc529f86496f46c8eab1c2cd4590903
2016-03-21 23:00:56 +01:00
jenkins-bot
f9128d21b7 Merge "Use WatchedItemStore in ApiQueryInfo::getWatchedInfo" 2016-03-21 10:24:09 +00:00
Leszek Manicki
b92ae1501e Use WatchedItemStore in ApiQueryInfo::getWatchedInfo
Adds a method for getting watchlist's notification timestamps
for a batch of LinkTargets.

Bug: T129482
Change-Id: I1f84212e7879a84b34bb3b53859069fcea282bba
2016-03-21 10:25:54 +01:00
Translation updater bot
848cf81714 Localisation updates from https://translatewiki.net.
Change-Id: I3d9b14ae3a5d77fea9694ef113b0180e5677c39e
2016-03-20 22:15:07 +01:00
Translation updater bot
f2a160f777 Localisation updates from https://translatewiki.net.
Change-Id: I67c4a49a16f5cee599db767b1414cac75bc19fd5
2016-03-19 22:10:06 +01:00
jenkins-bot
ecfdb46916 Merge "API: Allow fetching login token from action=query&meta=tokens on private wikis" 2016-03-18 22:19:25 +00:00
Brad Jorsch
02cc80c514 API: Allow fetching login token from action=query&meta=tokens on private wikis
The problem is that ApiQuery requires the 'read' right even though
ApiQueryTokens doesn't.

So, we introduce an exception: if action=query gets only meta=tokens
(and optionally rawcontinue and indexpageids, since they don't affect
anything), no other modules and nothing in the ApiPageSet,
ApiQuery::isReadMode() will return false.

Bug: T130112
Change-Id: I83dafb0305ff0cb1fc3bac668b88b5d2022e5880
2016-03-18 17:11:40 -04:00
Translation updater bot
6011e78ab0 Localisation updates from https://translatewiki.net.
Change-Id: I935a1d0bbc9fa5028f2fa1c9b05272ec2e416a7a
2016-03-18 21:57:36 +01:00
jenkins-bot
53c469e0b4 Merge "ApiQueryStashImageInfo: Don't throw exceptions when the user is not logged in" 2016-03-18 18:19:46 +00:00
Bartosz Dziewoński
18e68d62da ApiQueryStashImageInfo: Don't throw exceptions when the user is not logged in
Bug: T130253
Change-Id: If70b919c65a21b57b3022d495756bf250b0ba786
2016-03-18 16:22:58 +01:00
Bryan Davis
96d6cb6e16 Rename ApiRequest to ApiAction
Half of the work needed for handling this logging stream was done using
the channel name "ApiRequest" and the other half was done under the name
"ApiAction". The ApiRequest naming is easier to change at this point.

Bug: T108618
Change-Id: I5797731abeba22ef6ced7c8407ee670344d35b3d
2016-03-17 16:43:50 -06:00
Bryan Davis
84e8829687 Cast API timeSpentBackend to an int
Fixes {"timeSpentBackend":"Expected integer, but received double"} Avro
encoding error.

Bug: T108618
Change-Id: Iea79d14afe0ef0d1a9ea88096b7bbd90083df757
2016-03-17 22:21:36 +00:00
Translation updater bot
d79c3b36b9 Localisation updates from https://translatewiki.net.
Change-Id: I610b8736afb5cc84d6a057c521a241c3656b73b8
2016-03-17 22:37:47 +01:00
Leszek Manicki
7d4e225cb9 Add WatchedItemStore::countVisitingWatchersMultiple
This is for batch counting of visiting watchers, following the change
made in I2868c31fc09121de381d822e8f49194e3022bb42.
Query/logic has been extracted from ApiQueryInfo.

Bug: T129482
Change-Id: Ia9a534f5edb7af3cb7bf86be358dddb5d8c259cf
2016-03-17 16:17:38 +00:00
Leszek Manicki
4ec20438ab Fix ApiQueryInfo response for prop=watchers
Ie84e6feaa42db1bc7a1f89b56aed37dd7fe95ea4 part of them problem
with incorrect API response but if when no watchers data is
fetched (ie. due to early return in ApiQueryInfo::getWatcherInfo),
response contains "watchers": null instead of skipping "watchers"
key entirely.

Bug: T129482
Change-Id: I9cab120ec4e6a9cf4626678e45ef14ea8efc8cbc
2016-03-17 09:48:30 +00:00
Translation updater bot
078339b885 Localisation updates from https://translatewiki.net.
Change-Id: I2cd76699393ba63879babd31f435387593d3a2aa
2016-03-16 21:56:35 +01:00
Aaron Schulz
e052761ca0 Add RecursiveLinkPurge log for API requests
Change-Id: I29636c045f7b561b2da0100f5e69050808d1aec7
2016-03-15 21:39:40 +00:00
Translation updater bot
953932c621 Localisation updates from https://translatewiki.net.
Change-Id: I4830f0116910a4e4bddfd7b0d44e7caea70f1f5c
2016-03-15 22:17:29 +01:00
addshore
2bfdb5da84 Fix ApiQueryInfo break from use of WatchedItemStore
Fixes an issue introduced in:
I5a465773599cce9f8c9e94847cede6d12282c827

The new code now returns all targets even when 0
watcher have been found.
This patch adjusts the api to expect that.

Bug: T129482
Change-Id: Ie84e6feaa42db1bc7a1f89b56aed37dd7fe95ea4
2016-03-15 16:08:45 +00:00
jenkins-bot
1ed1cc8769 Merge "Add countUnreadNotifications to WatchedItemStore" 2016-03-15 15:29:59 +00:00
jenkins-bot
198cd73853 Merge "Move counting of watchers to WatchedItemStore" 2016-03-15 15:29:19 +00:00
addshore
846d373c28 Add countUnreadNotifications to WatchedItemStore
This query / logic has been extracted from
ApiQueryUserInfo.

Unit & Integration tests have also been added.

Relating to the task linked this is the last change
needed in this ApiQueryUserInfo!

Bug: T129482
Change-Id: I91aa109416c16cd1f257c9de46669e35d6fd34d7
2016-03-14 16:00:47 +00:00
addshore
6e2d6a0b44 Move counting of watchers to WatchedItemStore
Also adds tests

Bug: T129479
Bug: T129482
Change-Id: I5a465773599cce9f8c9e94847cede6d12282c827
2016-03-14 15:56:16 +00:00
Translation updater bot
b598347d56 Localisation updates from https://translatewiki.net.
Change-Id: I8af274b32e9af1553e074c4b29eedd0f7f3803eb
2016-03-12 20:50:54 +01:00
Translation updater bot
55132619eb Localisation updates from https://translatewiki.net.
Change-Id: Ie105d1bced55a141d9c641ab0c6cec53e267d427
2016-03-11 21:55:12 +01:00
jenkins-bot
c5f4cd0ad1 Merge "Remove some deprecated functions from ApiBase" 2016-03-10 21:22:30 +00:00
Translation updater bot
b35d903366 Localisation updates from https://translatewiki.net.
Change-Id: Iaea8b19d6e8c2cb24cb41c36f42c833c8cadf85a
2016-03-10 21:54:09 +01:00
Siebrand Mazeland
19316dd4e4 Remove some deprecated functions from ApiBase
* ApiBase::addTokenProperties() was removed (deprecated since 1.24).
* ApiBase::getFinalPossibleErrors() was removed (deprecated since 1.24).
* ApiBase::getFinalResultProperties() was removed (deprecated since 1.24).
* ApiBase::getRequireAtLeastOneParameterErrorMessages() was removed (deprecated since 1.24).
* ApiBase::getPossibleErrors() was removed (deprecated since 1.24).
* ApiBase::getRequireMaxOneParameterErrorMessages() was removed (deprecated since 1.24).
* ApiBase::getRequireOnlyOneParameterErrorMessages() was removed (deprecated since 1.24).
* ApiBase::getResultProperties() was removed (deprecated since 1.24).
* ApiBase::getTitleOrPageIdErrorMessage() was removed (deprecated since 1.24).
* ApiBase::parseErrors() was removed (deprecated since 1.24).
* Remove related constants ApiBase::PROP_ROOT, ApiBase::PROP_LIST,
  ApiBase::PROP_TYPE, ApiBase::PROP_NULLABLE.

Patches were submitted for remaining uses in Gerrit extensions.

Change-Id: Idea70300874258fbcb9deef6504eb55f2ebe8d6c
2016-03-10 21:45:04 +01:00
Translation updater bot
3565fe0795 Localisation updates from https://translatewiki.net.
Change-Id: Ifd102e2f148caf1caea83af03b8e42eff8ff72cc
2016-03-09 21:57:31 +01:00
Translation updater bot
8228f3532b Localisation updates from https://translatewiki.net.
Change-Id: I4d6429a915ca693c26bdce85c0fc70ffab7af876
2016-03-08 22:01:34 +01:00