Page MenuHomePhabricator

Create sample pages for new MW
Open, MediumPublic

Description

When initializing a new MW database (this should not happen if database already exists and needs to be updated), vagrant should create a set of test pages to work with.

Based on my past experiences, I would recommend about 15 regular pages, some in non 0 namespace, at least 2 templates (one - nested), some categories, and possibly an image file or two. Most edits should be done as if by the administrator, plus a few - by anonymous user. All pages should at least be linked from the main page. Some pages should be watched by admin.

In short, the wiki should not be pristine, allowing for all sorts of functionality instantly testable without page creation.


Version: unspecified
Severity: enhancement

Details

Reference
bz46869

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:41 AM
bzimport set Reference to bz46869.
bzimport added a subscriber: Unknown Object (MLST).

[mass-moving from Tools>MediaWiki-Vagrant to separate product. See bug 54041. Filter bugmail on this comment.]

A much more flexible solution: create new wiki pages based on files in the wikiPages\ directory.

Use filename as the article title. The filename should be URL-decoded first, e.g. Talk%3ABlah would create a page "Talk:Blah". Additionally, directories should be used as namespaces (I don't think we should use directories as sub-pages, i.e. Page/SubPage, as this is a rarely used feature).

Files will need additional processing - all files in a directory File/ need to be loaded into wiki, except files with a trailing underscore (e.g. Test.png_), which will be treated as a text file with markup for Test.png mediawiki page.

I think this should be a separate MW command - vagrant load-pages

Note, there is now 'vagrant import-dump'. It uses a standard dump XML file.

I don't think there is any functionality to automatically do an import when you first create/vagrant up the wiki (what this bug requests). I don't think this automatic import should require running a separate command (besides 'vagrant up').

I would also suggest that the 'vagrant load-pages' idea (loading from this directory structure) is a separate enhancement request.

Implemented in Change-Id: I79cfcc515a32e25c25817d67ac302eec4d5acda6 pending review.

Matthew, import-dump has a different goal - it's a complex transfer of textual data from one wiki to another. This bug & the available patch address a very different, development oriented process: to quickly populate (or to reset to a known state) a given set of pages and images. Now I no longer need to go and manually re-create custom pages that I use in my development - I simply run a command.

Initial pre-population of data vs population with a simple command are two different requests, even though they combined in my mind as they solve the same problem - populating an empty wiki. We could even create a simple script to generate some sample files and use "vagrant add-pages" to upload them.

T88872 provides a more development-oriented mechanism to import pages. See also T88356.