Commit graph

24 commits

Author SHA1 Message Date
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Aaron Schulz
d478d4a154 Add ParserOutputStashForEdit hook for extension cache warming
This can pre-cache slow queries by extensions that happen on
edit submission.

Bug: T116557
Change-Id: I803f69013f68e80a53dd3c466bddff3ebe2b659b
2016-01-26 17:23:56 -08:00
jenkins-bot
c102eb8cc0 Merge "Remove unused ApiStashEdit variable" 2015-12-18 20:08:39 +00:00
Aaron Schulz
f4a07ea296 Make ApiStashEdit use statsd metrics
Change-Id: Iffdeae7f867490e3c69c4b6d79a5f844cb7fce23
2015-12-18 02:59:55 +00:00
Aaron Schulz
83c7d3fbb9 Remove unused ApiStashEdit variable
Change-Id: Ifd85dd6b96e80d7c1163566153e8d746b27754d8
2015-12-15 21:23:23 -08:00
Aaron Schulz
9c919dd2cf Make edit stashing use named DB locks
These should be faster by avoiding the inefficient back-off
polling in BagOStuff::lock().

Change-Id: I013b2567716eea5e354e13f3e9640573886e596a
2015-12-15 20:32:18 +00:00
Bryan Davis
b89a6a5944 Convert ApiStashEdit to PSR-3
Convert the wfDebugLog calls in ApiStashEdit to direct use of the PSR-3
logging layer and add severity information for each message.

Change-Id: Ic91e89ceee405a1d22e5e3c461ad37795cae4a6f
2015-12-04 15:18:07 -07:00
Aaron Schulz
92bbfd5ea6 Migrate more callers away from $wgMemc
Callers should use more expliciy lazy-loaded
cache factory methods.

Change-Id: Ifa0bf389720a09a931ee6466b993f787d83a09a7
2015-10-26 19:07:12 +00:00
Brad Jorsch
ec658adad5 Add i18n messages for ApiStashEdit
Bug: T113189
Change-Id: Iee7b2fbb7b9cd4e7255c87d78be9396073f41236
2015-09-21 10:31:01 -04:00
Aaron Schulz
84c4e7597e Ignore some ScopedCallback IDE warnings
Change-Id: Iefe24ee5dae90d70c2acaaae9dc5d44c1758d53a
2015-07-15 14:13:42 -07:00
Aaron Schulz
6ed8416a70 Fixed edit stash inclusion queries
* These are hit when the stashed edit is several seconds
  old. The old code was not using makeList() correctly.

Bug: T105597
Change-Id: I265307715996c50d819915a55ea34bbc0ed6c5c9
2015-07-13 21:46:01 +00:00
Aaron Schulz
5399fba68b Use less fuzzy User::getDBTouched() in ApiStashEdit::getStashKey()
* The getTouched() value can bump more often or vary in DCs

Change-Id: Idffa22c9dde7c7950943b104ed61f5779636b7e7
2015-06-02 20:31:14 +00:00
Brad Jorsch
df80f1ead5 API: Add more parameter types and improve info
New types 'text' and 'password' for where a <textarea> or
<input type="password"> would be preferred over <input type="text">.

Some timestamp parameters get actually tagged as 'timestamp'.

'submodule' types change the 'submodules' output property from a boolean
to an object indicating the mapping from values to module paths. And
they get an indication of the submodule parameter prefix (e.g.
generator's "g"), if applicable. "generator" actually gets reported as a
submodule type, using this new mechanism.

action=paraminfo will now indicate ApiBase::PARAM_RANGE_ENFORCE status,
and return better-formatted defaults for timestamps and booleans.

Change-Id: Ic862d6f8fe13f7eb6b4298683514d33af5823e47
2015-05-29 19:26:44 +00:00
Aaron Schulz
b390f9399e Split out internal parseAndStash from the edit stashing API
Bug: T90040
Change-Id: Ifa49fb9955dafff0c82ae635a5e1b3fb16d5e783
2015-03-27 22:16:59 +00:00
daniel
95c85f71b1 Remove getSecondaryDataUpdates and friends from ParserOutput.
This is a hard deprecation, with getSecondaryDataUpdates returning an
empty array and addSecondaryDataUpdate throwing an exception. This seems
prudent since there are no known users of these methods, and they
interfere with the parser cache:

DataUpdates are basically jobs, they need access to services to
function. That makes them inherently non-serializable. This interferes
with the function of the parser cache, which serializes ParserOutput
objects in order to persist them.

This could be solved by splitting DataUpdates into DataUpdateDefinitions
and DataUpdateHandlers, similar to how JobSpecification works with
wgJobClasses. That however seems pointless and overkill, since
ParserOutput already has a mechanism for storing arbitrary data,
including any info needed by an UpdateJob: the setExtensionData method.

After this change, the preferred method to introduce custom data updates
is to store any relevant data using setExtensionData and 
implement Content::getSecondaryDataUpdates() if possible. If not,
use the 'SecondaryDataUpdates' hook to construct the necessary update
objects from the info stored using setExtensionData.

Change-Id: I0f6f49e61fa3d8904e55f42c99f342a3dc357495
2015-02-24 11:01:16 +01:00
daniel
f10b8df598 Fix ApiStashEdit wrt custom DataUpdates.
My previous patch broke this: ApiStashEdit would stash ParserOutput
with no custom DataUpdates, but calling getSecondaryDataUpdates still
failed after unserialization. This patch should fix that.

Bug: T86305
Change-Id: Ic114e521c5dfd0d3c028ea7d16e93eace758deef
2015-01-09 19:19:13 +00:00
daniel
d509361e67 Skip ApiStashEdit if custom DataUpdates are present.
Bug: T86305
Change-Id: I423ba39a46a08edf2862b8439169ff91338fb6eb
2015-01-09 15:51:15 +00:00
Aaron Schulz
3b9b48646b Made StashEdit log a bit less verbose
Change-Id: Ib1272862efa5518854533af8bf28df97f37f350e
2014-12-13 16:46:48 -08:00
Ricordisamoa
f86a5590aa Always use 'bool' instead of 'boolean' after '@param' and '@return'
The former is by far the most common.

Skipped:
* resources/lib/jquery.ui/jquery.ui.datepicker.js
* resources/src/mediawiki.special/mediawiki.special.upload.js

Change-Id: I73c93797e745128ba703e4865080c36784caa474
2014-12-10 11:57:31 +00:00
Aaron Schulz
17431af154 Reuse page preview parses by using the edit stash system
* This also changes previews to render section edit tokens but
  remove them on output, avoiding cache fragmentation.
* Also shortened the resulting getStashKey() value.

Change-Id: Ic8fa87669106b960c76912b864788b781f6ee2e6
2014-12-09 22:43:01 +00:00
Aaron Schulz
de6393d190 Made prepareContentForEdit() use the stash cache by default
Change-Id: I1123a8da4764df67f1b0f2b18f6ea74ec5be7be9
2014-12-09 22:26:36 +00:00
Aaron Schulz
3a030622b5 Various edit stash fixes
* Unlock the key at the right point, so checkCache actually sees the result
* Turn CRLF to LF just as EditPage does via getText(), this avoids misses
* Added a bit more debug logging

Change-Id: I5c296325ebee2501e5de59b8090e1ddde8689f17
2014-12-09 13:50:00 -08:00
Ori Livneh
afd317ac50 Make ApiStashEdit use the StashEdit log group, rather than PreparedEdit
An early version of what ultimately became commit 3a6c9d36c used
'ApiPreparedEdit' instead of 'ApiStashEdit'. The class / file were renamed but
not the log group.

Change-Id: Ib4de1f1f21f058d3be627048bc93e7730515d340
2014-12-03 17:27:01 -08:00
Aaron Schulz
3a6c9d36c9 Added ApiStashEdit module for pre-emptive edit parsing
* This lets edits be prepared while users enter edit summaries.
* The edit form will now make use of this API, controlled by
  $wgAjaxEditStash.

Change-Id: I4f4057bc0d1d4a66a8f7cfb7cdc26d443a8eb0c4
2014-12-03 22:38:41 +00:00