Commit graph

8579 commits

Author SHA1 Message Date
jenkins-bot
a85318480d Merge "api: Make changes after pagelinks migration" 2024-03-19 19:32:39 +00:00
Tim Starling
51bceb0faf block: Fix exception in ApiQueryBlocks when specified users are not blocked
Fix exception due to empty array passed to makeList() for bt_id.

Bug: T360088
Change-Id: I1336923976aae02bb4a4013c2cefa0a3629bc99a
2024-03-19 20:34:55 +11:00
Amir Sarabadani
2ffa5b8f38 api: Make changes after pagelinks migration
This fixes most of cases mentioned in the ticket

Bug: T359425
Change-Id: Idd13d30a1590c7b9ccbca5e80ae5212ced7d948e
2024-03-18 21:29:36 +01:00
Translation updater bot
7f9a5b6858 Localisation updates from https://translatewiki.net.
Change-Id: I4f52e4544898dafa3ba7353ab96e7490f6e0e989
2024-03-18 07:43:49 +00:00
jenkins-bot
0cd1179fe6 Merge "block: In ApiQueryBlocks use a union when querying for both users and IPs" 2024-03-15 19:17:18 +00:00
Translation updater bot
db191efe4e Localisation updates from https://translatewiki.net.
Change-Id: I7d04cb1ee4128f4739ea0dabbbbfba0d25c79d69
2024-03-15 08:05:12 +01:00
Tim Starling
b99acdddad block: In ApiQueryBlocks use a union when querying for both users and IPs
Avoid slow query due to lack of optimisation of "OR" operator.

Bug: T360088
Change-Id: Ic8e38fcebee674e1ce48e703be969f89eb77fe15
2024-03-15 12:27:39 +11:00
jenkins-bot
5a746bdc7b Merge "api: Tweak the 'internal' API label to explain that they shouldn't be used" 2024-03-14 21:53:07 +00:00
Translation updater bot
9143098de0 Localisation updates from https://translatewiki.net.
Change-Id: I2105b138bd779e775330c3b0d8598bad511c27ec
2024-03-14 13:58:13 +01:00
James D. Forrester
047ce19867 api: Tweak the 'internal' API label to explain that they shouldn't be used
Bug: T64905
Change-Id: I52769ab70908b27e96f26b7d0bf778dda4d0e48a
2024-03-13 17:59:54 -04:00
Translation updater bot
fd1a74914c Localisation updates from https://translatewiki.net.
Change-Id: I940df45588c8b46b9d569f7c16c46ad092a52586
2024-03-13 08:06:36 +01:00
jenkins-bot
8470c15136 Merge "ApiQuerySiteinfo: Fix up comment in recAutopromote" 2024-03-12 19:40:02 +00:00
jenkins-bot
9100c074d2 Merge "REST: Introduce trait for handling Status objects" 2024-03-12 14:25:34 +00:00
daniel
84f314bbf1 REST: Introduce trait for handling Status objects
The new trait provides conveniance methods for logging and throwing
errors based on StatusValue instances.

Change-Id: Id7cbacb744bee79cd8a6f61291a26b36e6243053
2024-03-12 14:48:33 +01:00
Translation updater bot
41642c66c6 Localisation updates from https://translatewiki.net.
Change-Id: I7e33e0e58c0bd95bd3cacb052422c0606fa55ccd
2024-03-12 08:06:35 +01:00
jenkins-bot
6d973e0b10 Merge "Improve i18n of ApiChangeContentModel messages" 2024-03-11 22:51:58 +00:00
jenkins-bot
74157f863b Merge "Use transactional time limit on api Upload (except checkstatus)" 2024-03-11 15:44:12 +00:00
Translation updater bot
193e580dee Localisation updates from https://translatewiki.net.
Change-Id: Ie24fd3de7b5c4242733cd59ffcb5cd106c2e99f5
2024-03-11 08:06:17 +01:00
jenkins-bot
121ce8b620 Merge "Deprecate Linker::generateTOC() and related methods" 2024-03-08 14:13:47 +00:00
jenkins-bot
b90d19690c Merge "Improve apihelp-main-param-errorlang/uselang" 2024-03-08 14:04:28 +00:00
Translation updater bot
a5170b7658 Localisation updates from https://translatewiki.net.
Change-Id: I81cd32b985f9b8f73f45b3407010ce6d855bc0f8
2024-03-08 08:05:04 +01:00
Amir E. Aharoni
ffa4a10f29 Improve apihelp-main-param-errorlang/uselang
These two messages were recently changed to simplify
the example URL parameter.

This simplifies them further by making the sentence flow
more naturally.

Change-Id: Ib05e4f352d5a7f6dc68b720da9c2c987f968a819
2024-03-07 23:24:34 -05:00
Bartosz Dziewoński
94ac2ba845 Deprecate Linker::generateTOC() and related methods
Move the code to private methods in the only place that needs it.

Change-Id: I7aa038e055adc1aea9faafd17b86e304ee2ca758
2024-03-07 19:57:35 +00:00
jenkins-bot
601310a119 Merge "api: Improve linking of language codes lists in top level i18n messages" 2024-03-06 15:04:07 +00:00
Translation updater bot
bbb266c7ce Localisation updates from https://translatewiki.net.
Change-Id: Id064f7ddd940b785611e294e7696a53c8878add8
2024-03-06 08:07:04 +01:00
jenkins-bot
27b4250893 Merge "Group temporary users with IP users in ApiQueryWatchlist filters" 2024-03-05 17:27:07 +00:00
Reedy
84e6b6e63f api: Improve linking of language codes lists in top level i18n messages
Bug: T359055
Change-Id: If4a8c9b70c06dea099200704212fb4b4cfc37000
2024-03-04 14:56:02 +00:00
Translation updater bot
e745c7aff6 Localisation updates from https://translatewiki.net.
Change-Id: I10c952805e730de4a34a9e7a4094375c9d7ddde1
2024-03-04 08:06:09 +01:00
jenkins-bot
e78541e80f Merge "upload: switch AssembleUploadChunksJob to GenericParameterJob" 2024-03-03 09:30:51 +00:00
Thalia
0b7a4b049a Group temporary users with IP users in ApiQueryWatchlist filters
Why

* ApiQueryWatchList allows filtering anon users or not-anon users.
  It is not obvious wether temporary users should be considered
  anon for these purposes.
* The equivalent filters in recent changes group temporary users
  with anonymous users (T343322).
* Since ApiQueryWatchlist queries the recentchanges table, and
  shares many filters with recent changes, it makes sense to
  filter the same way in both, and therefore to group temporary
  users with anonymous users.

What

* Update queries in WatchedItemQueryService to group temporary
  users with anonymous users for FILTER_ANON and FILTER_NOT_ANON.
* Don't change the 'anon' flag, because the other APIs flag
  temporary users with anon=false.
* Instead add a 'temp' flag for temporary users.

Bug: T358693
Change-Id: I4cd3a4d0c5f4f488933cf3f06dee62a9beb85440
2024-03-03 06:26:03 +00:00
Aaron Schulz
9c14663be9 upload: switch AssembleUploadChunksJob to GenericParameterJob
Change-Id: I75e401c047828abf4b42d519509a1e717509ba2f
2024-03-03 00:02:52 +00:00
Brian Wolff
de2e653583 Fix typo in log message
Change-Id: Ic688cca85b42bed2706d9579022429ea94fb1818
2024-03-02 00:34:29 -08:00
Brian Wolff
46cfc70b69 Use transactional time limit on api Upload (except checkstatus)
Uploads can be a long operation that we would prefer not to get
cut off. The API upload module supports a variety of upload types.
This calls useTransactionalTimeLimit() for all of them (except
checkstatus which is not a write operations) however it is more
applicable to some methods than other methods such as "async" where
the real work happens in the job queue.

Change-Id: I6795f6d38693306f22091afa77123f2f0721ef5b
2024-03-01 14:38:39 -08:00
Translation updater bot
661ad7605b Localisation updates from https://translatewiki.net.
Change-Id: If8da4ca1c20e32ea8215693e5db40386e79cd00b
2024-03-01 08:06:18 +01:00
Translation updater bot
3c409df295 Localisation updates from https://translatewiki.net.
Change-Id: Ic4d95368089a9402a28170cdd345a762848df9c8
2024-02-29 08:14:48 +01:00
Dreamy Jazz
2e3bd68bec Add 'temp' flag to ApiQueryUserInfo API
Why:
* The ApiQueryUserInfo API returns 'anon' as true when the user
  making the request is an IP user.
* This API should return 'temp' if the user making the request is
  a temporary account, as described by T358683.

What:
* Return 'temp' with the value true from the ApiQueryUserInfo API
  when the user making the API request is a temporary user.
* Test that the temp user flag is added when the user making the
  request is a temporary user and that the flag is not added when
  the user is logged-out.

Bug: T358683
Change-Id: I5f165576a12a2218d89ab3623d7df45e2c9049fa
2024-02-28 17:21:30 +00:00
jenkins-bot
845e69cb2e Merge "Namespace includes/cache" 2024-02-28 15:10:38 +00:00
jenkins-bot
c15b91c1c0 Merge "Update summary message for ApiQueryContributors for temp accounts" 2024-02-28 13:57:30 +00:00
Dreamy Jazz
2ea72f4302 Update summary message for ApiQueryContributors for temp accounts
Why:
* The ApiQueryContributors API description says that it returns
  'the list of logged-in contributors' for given pages in the API
  summary text.
* When temporary accounts are enabled, this list will include both
  named and temporary accounts. As such, the message needs to be
  updated to make this clear for users of the API on a wiki which
  has temporary accounts enabled.

What:
* Add 'apihelp-query+contributors-summary-tempusers-enabled'
  which is shown instead of the existing summary message for the
  API if TempUserConfig::isEnabled returns true.
* Update existing mention of 'anonymous' with 'logged-out' to
  per https://w.wiki/9Ji$ in the existing summary message.
* Update the existing message documentation for the summary message
  to link to this new message to make it easier for translators.
* Test the newly added PHP code.

Bug: T341228
Change-Id: Id1bd597e068cb3aa946c94686ca6fa39ef1df89f
2024-02-28 12:18:58 +00:00
Reedy
554f95f9b0 ApiQuerySiteinfo: Fix up comment in recAutopromote
Follows-Up: I92236cea845c10ef1725891a49d48a04d5d3bfad
Change-Id: Ic069f25d2713a6e558095e7e7816bd4ac23882de
2024-02-27 17:39:56 +00:00
Brian Wolff
10a7d46ac4 Use ->push not lazyPush for PublishStashedFile job
Follow up 4db0b0cb44

Change-Id: I1941372dd9a498ea286db75f16be52b549c6bb20
2024-02-27 08:29:43 -08:00
Translation updater bot
04d24edc9f Localisation updates from https://translatewiki.net.
Change-Id: Ibddcf58a7d2ed0619e8f0b015c5bafe9d008f362
2024-02-27 08:03:27 +01:00
jenkins-bot
2f9b233b12 Merge "Prevent race condition between AssembleUploadChunksJob and transaction" 2024-02-27 00:30:55 +00:00
Translation updater bot
74e65e9aaf Localisation updates from https://translatewiki.net.
Change-Id: I0c60e585ba920f9fd0bc03615bac15ea57876892
2024-02-26 08:17:41 +01:00
Siddharth VP
96cedcf663 Improve i18n of ApiChangeContentModel messages
These messages take in the localised model name as $2. It doesn't make
sense to put that within code tags.

Change-Id: I69a5ea43e4180e1d7933764edbdcebb5627b211c
2024-02-24 15:31:57 +05:30
jenkins-bot
3a8b43c52a Merge "Add missing block message keys to ApiBase and ApiMessageTrait" 2024-02-23 11:39:24 +00:00
Thalia
7a4eeb8732 Add missing block message keys to ApiBase and ApiMessageTrait
Add blockedtext-tempuser and autoblockedtext-tempuser to
ApiBase::BLOCK_CODE_MAP and ApiMessageTrait::messageMap

Change-Id: Ia365a300b16ee1ebd39556bc138c183f39b464ed
2024-02-23 10:56:48 +00:00
Translation updater bot
a47a5e3c05 Localisation updates from https://translatewiki.net.
Change-Id: I6c4340e86dc10c3f8dd60d65a0ff8927284a0905
2024-02-23 08:17:53 +01:00
Brian Wolff
4db0b0cb44 Prevent race condition between AssembleUploadChunksJob and transaction
The ChunkedUpload feature stores information about in progress uploads
in the uploadstash table. The AssembleUploadChunksJob reads this data
from the primary DB to prevent race conditions. However the job is
inserted into the job queue before the current transaction commits,
so the race is still present. The job sees the old version, and as
a result drops the final chunk, corrupting the file (Often noticable
by files that have a size which are a multiple of 5mb).

This changes the job push from ->push to ->lazyPush which will make
the job insert happen in a DeferredUpdate after the primary transaction
has commited. Additionally, pass the expected size to the job queue
and assert that UploadStash class has the same filesize as expected.
This will ensure that if this issue happens again, the upload will
abort and it will show up in the logs instead of silently corrupting
files.

Bug: T350917
Change-Id: I37c5c8ffc882026a9fab252b20a10cf4c43d48bc
2024-02-22 20:37:42 -08:00
jenkins-bot
6690eb21b8 Merge "Update help text for 'hideanons' in ApiFeedRecentChanges API" 2024-02-22 19:24:21 +00:00