Page MenuHomePhabricator

Remove ParserMigration from CI deps for MobileFrontend
Open, LowPublic

Description

Followup to T415451 -- we recently added ParserMigration as a tests dependency on MobileFrontend after fixing its tests to work with ParserMigration enabled -- however this forces *other* extensions which depend on ParserMigration to also load it. This would be fine, but T417512 / 607055b70c434a6b0f4e7e969295253a7593c359 changed ParserMigration's default behavior so that installing ParserMigration is sufficient to enable Parsoid read views by default without requiring further action by the user or site administrator.

To fix:

  • Remove ParserMigration from MobileFrontend's CI deps: https://gerrit.wikimedia.org/r/c/integration/config/+/1248065
  • Ensure that MobileFrontend's tests pass whether ParserMigration is enabled or not (currently they're skipped when ParserMigration is not present, which is not ideal -- they should actually run and pass)

Was recommended to use setUseParsoid( true / false ) explicitly on tests where one or the other parser's behavior is being specifically tested rather than pulling in ParserMigration.

Event Timeline

Also relevant: the tests currently failing in DiscussionTools are failing because there is an initial:

<section class="mf-section-0" id="mf-section-0">

wrapper which is being removed from the HTML.

Parsoid does it own <section> wrapping, but the legacy parser requires MobileFrontend to do equivalent <section> wrapping for output compatibility.

The change in output looks like MFE/DiscussionTools is still using the legacy parser (even though ParserMigration is installed) but is turning *off* its internal section wrapping code (presumably because it thinks Parsoid is being used).

MobileFrontend probably needs a single source of truth here, for example looking at ParserOptions::getUseParsoid() instead of using the presence of ParserMigration to determine whether parsoid is being used and thus whether section wrapping should be performed.

More context: In the June-November time frame (before MW 1.47 is released) we expect to change the default parser to Parsoid, basically by making ParserOptions::newFromAnon return a ParserOptions with useParsoid set to true. The ParserMigration extension in that case will still "do something"; except it will be allowing users to opt-out (reset useParsoid to false), instead of being the primary mechanism used to opt-in (set useParsoid to true).

In general test cases should explicitly use setUseParsoid(true/false) rather than rely on the default being a certain value, in order to continue working consistently through the transition to Parsoid as the default parser.

It's probably fine in the short term to add ParserMigration as a dependency to leaf extensions, like ReaderExperiments, but adding it as a dependency of MobileFrontend will cause too many other extensions to change behavior all at once. After June 2026 we will be working on migrating the test cases for these other extension as part of T419048: Use Parsoid as default wikitext parser in MW 1.47.

Change #1248065 had a related patch set uploaded (by Bvibber; author: Bvibber):

[integration/config@master] Revert "Zuul: [mediawiki/extensions/MobileFrontend] Add ParserMigration dependency"

https://gerrit.wikimedia.org/r/1248065

  • Ensure that MobileFrontend's tests pass whether ParserMigration is enabled or not (confirmed seems good at present)

I don't think this is correct? They seem to be skipped if PM is not present, and pass when it's both present by disabling it and bypassing its code, as @cscott says above. I'm happy to revert the CI config change for now, but this means T415451 is not done and bodes poorly for the Parsoid default work, indeed.

Change #1248065 merged by jenkins-bot:

[integration/config@master] Revert "Zuul: [mediawiki/extensions/MobileFrontend] Add ParserMigration dependency"

https://gerrit.wikimedia.org/r/1248065

Mentioned in SAL (#wikimedia-releng) [2026-03-04T18:50:46Z] <James_F> Revert "Zuul: [mediawiki/extensions/MobileFrontend] Add ParserMigration dependency", for T419043

  • Ensure that MobileFrontend's tests pass whether ParserMigration is enabled or not (confirmed seems good at present)

I don't think this is correct? They seem to be skipped if PM is not present, and pass when it's both present by disabling it and bypassing its code, as @cscott says above. I'm happy to revert the CI config change for now, but this means T415451 is not done and bodes poorly for the Parsoid default work, indeed.

Bah yeah that's not ideal. Ok I'm expanding the scope of this task slightly to clean those back up (so this task now covers follow-up from T415451's earlier patches)