Page MenuHomePhabricator

Add page and file import support
Open, MediumPublic

Description

Narrative

As a developer, I can set up test wikis easily, without having to import a hundred templates / upload test images / etc. by hand

Acceptance Criteria

  • Add a puppet command to import an XML file created with Special:Export when a role is enabled (you can use importDump.php)
  • it should also import the images mentioned in the XML file (importImages.php)
  • come up with a convention of were these files should be stored and where their purpose can be described (multiple roles might want to share the same dump; one role might want to import multiple dumps), whether they should be gzipped etc. Create an example that others can copy (e.g. the template shims for CommonsMetadata)
  • There is no great way to check if the file has been imported already, esp. when the role gets disabled/reenabled; skipping existing pages, or just overwriting them, is acceptable.

Event Timeline

Gergo said:

From https://www.mediawiki.org/wiki/Typography_refresh/Retrospective , sounds like a nice use case:

Nick put this together in November [officewiki listing of browsertesting tools]; he suggested that the design team might consider putting together (over the long-term) a long list of "100+ examples pages, that we internally use as test-beds, to highlight the Extremes, the Edge Cases, and the Exemplars: From English FAs and stubs and docs, to Chinese Wikivoyage Discussion Boards, to Wikidata, to Wikisource, to ...."

The E2E page is now imported for the MMV role, the rest of the templates needs by UW are blocked on two bugs.

IIRC there is now a role that imports some content into the wiki, is this report still current?

  • Add a puppet command to import an XML file created with Special:Export when a role is enabled (you can use importDump.php)

mediawiki::import::dump. There is also vagrant import-dump <something.xml> if you would rather do it manually.

There is also mediawiki::import::url for importing live wiki content. It does not support importing files.

  • it should also import the images mentioned in the XML file (importImages.php)

vagrant import-dump calls importDump.php --uploads which presumably takes care of it. mediawiki::import::dump doesn't.

  • come up with a convention of were these files should be stored and where their purpose can be described (multiple roles might want to share the same dump; one role might want to import multiple dumps), whether they should be gzipped etc. Create an example that others can copy (e.g. the template shims for CommonsMetadata)

That didn't happen AFAIK; only a few roles use dump import at all (gwtoolset, multimediaviewer, wikitech, articleplaceholder, labs_initial_content).

  • There is no great way to check if the file has been imported already, esp. when the role gets disabled/reenabled; skipping existing pages, or just overwriting them, is acceptable.

mediawiki::import::dump checks a sentinel page and imports nothing if that page exists, overwrites existing pages if it does not. vagrant import-dump just overwrites stuff.