We're trying to avoid passing raw strings around, since they can be
ambiguous specifiers of language. This patch makes VE compatible
with I982e0df706a633b05dcc02b5220b737c19adc401, with a backward
compatibility workaround which can be removed after
I982e0df706a633b05dcc02b5220b737c19adc401 merges.
The new code also uses slightly more methods of the Language object,
which need to be mocked in a unit test.
Change-Id: I830867d58f8962d6a57be16ce3735e8384f9ac1c
Helper classes have been moved to a dedicated namespace
of their own, this patch references the new namespace.
Depends-On: Ieeb7a0a706a4cb38778f312bfbfe781a1f366d14
Change-Id: I5a2792a3536f6d953905561410f0e4966254ccbe
Catch HttpException from REST helpers, even when they are triggered
already during initialization. This will happen e.g. when the request is
asking for a render key for which the stashed rendering has expired.
Bug: T325310
Change-Id: I9e622b5bb253f5e40fe2b50ff08471beddac9acf
logLevel from info is very verbose. It is no longer needed. The default
error logLevel should be enough.
Bug: T296187
Change-Id: I1bde5b57f64df2d6c00b4a7b8e24f9887a865bb6
This reverts commit 9b9304b13f.
Reason for revert: Selenium tests occasionally fail for many different
reasons. We should use the default specFileRetries, so that a single
failure doesn't cause ~20 minutes of delay when someone is backporting
a change. See also e.g. T324544
Bug: T324544
Change-Id: I043eb5e57bec13a16efb35bbdffda6d3ea65b8e9
This isolates this extension from knowledge about the constructor
signature of the helper classes. Constructore signatures are not stable
interfaces.
Needed-By: Ie430acd0753880d88370bb9f22bb40a0f9ded917
Depends-On: I10af85b2da96568cfffd03867d1cb299645fb371
Change-Id: If1914dbfbefc3501b4d4cef4beb1fae307c36455
* Rename imported classes in VE that will be renamed in core
* Re-enable tests that would fail when the core patch is merged
Depends-On: I506f3303ae8f9e4db17299211366bef1558f142c
Change-Id: I59ebeb24fa0de5f10d1501cc0830c7e4805e1003
HTMLTransform is being renamed at I506f3303ae8f9e4db17299211366bef1558f142c.
This is a temporary measure to allow CI to succeed in the core patch
Change-Id: Id11068e34d4b3ed6ccc210c91e449656e74138a2
When receiving HTML from a VE session, process it with the same kind of
ParsoidClient that was originally used to generate the HTML. If we were
to use a different implementation, the ETag wouldn't match, so we would
fail to find the stashed data-parsoid map, and the edit would fail.
Bug: T320704
Change-Id: I3b73431fccacecb4ad88b82f8f5675b1042e03ce
AutoConfig was used to set VE to call internal REST API endpoints exposed by the parsoid extension.
With DirectParsoidClient available, this is no longer needed.
NOTE: this causes all wikis that do not have a RESTbase backend
configured to start using DirectParsoidClient. This is true in
particular for officewiki and labswiki.
Bug: T320704
Change-Id: Ia4c6184dd75a653c3202ea160b6605335f36f6eb
If VE is configured to call parsoid directly in PHP, the client
should not try to fetch HTML from restbase. Doing so will
lead to inconsistencies, and may cause edits to fail.
Bug: T320704
Bug: T320703
Change-Id: I98bfdd305dcd188d91db6a8fe5885156cdeca7db
* DirectParsoidClient makes use of parsoid directly for performing
transformations on both wikitext and/or HTML contents.
* Also, it's used to fetch HTML from parsoid's parser cache. Before,
this operation was done via RESTBase but now it's being fetched in
core's parsoid parser cache.
* This patch also enables VE clients to transform HTML to
Wikitext when switching from HTML to source mode on. It
makes use of the HtmlInputTransformHelper to perform this
transformation.
* Now, VE client can make use of core code for switching
between HTML to source mode and back without RESTBase.
Change-Id: I5c7cfcc4086d8da7905897194d8601aa07418b59
This adds assertions for the return values of the following pactions:
metadata, parse, parsefragment.
It also adds a test that asserts that edits are not possible with
an invalid token.
Change-Id: Idb453d3561a46930afb5366c1a96787895fc8e40
This VE paction was removed in I90d775dd71d5f5a61d651b63d946ab60a27e2ca3
so this code can be deleted per Bartosz, so this patch removes the code.
NOTE: A merged API test that uses this is also removed along side.
Change-Id: I4ff75df57fd58f508ef7212486e52cb11a7cfb57
The test file is just a placeholder for now, so we can enable the CI job.
Actual tests will follow in a separate patch.
Bug: T318403
Change-Id: I8105f49f8898c8ebfd80eb898d30a49e58db5b25
* DirectParsoidClient: Actually allow null to be provided.
Previously we tried to call methods on it unconditionally.
* VRSParsoidClient: Require the param to be provided (even if null).
No reason to diverge from the interface, which requires it.
Change-Id: Id9a450dc8b8eb3e82cf87718b96975e5a3c6180c
This follows up the initial fix with additional sanitation and a
regression test. See I21c7a2b2541061a858a9791a2cb12866acd38dc5.
Bug: T318083
Change-Id: I4e433e711c068336a888f4aafa243455764fd710
This makes the "direct" client and the VRS based client
implement the same interface, so the caller doesn't have to know
which one it is using.
It looks like ParsoidHelper will not be needed if we use this approach.
Change-Id: Ib1c1d7355951fc0765227dd01a9edfc554fc448d
This patch introduces a factory service for creating VE Parsoid
clients.
NOTE: This patch also injects a GlobalIdGenerator to the client
and avoids usage of deprecated UIDGenerator class.
Change-Id: I787c0afb227308aab56770d14d62e08eb0084a6c
EditPage.activationComplete() was flaky.
We have replaced it with EditPage.toolbar.waitForDisplayed().
We have run all the tests 100 times in a row in CI and it works fine.
Bug: T310772
Change-Id: I321b4114ca03ebd02a79d8bd3863ea0e68494dc2