[Wiki] Wiki pages should have distinct filenames, slugs and titles.

Problem to solve

Wiki pages have a single conflated notion of identity - they have a title, from which we generate a slug and a filename. This has a few issues of its own:

  • Some titles get mangled
  • Users cannot select their own slugs
  • Page renames break old links
  • Page renames break the history (we lose the ability to find old versions)

More importantly it has performance and design implications for application developers:

  • the sole datastore is git, accessed through gitaly. This does not have the advanced query features of SQL
  • getting a page listing is expensive
  • finding the pages in a directory is expensive/impossible

We want to separate out these concerns, but preserve the git datastore and the ability for users to create files locally and push them to the app.

Proposal

We should allow wiki pages to specify metadata, which we keep in sync in the WikiPage::Meta records we now store in the DB and in front-matter blocks in wiki-pages. These will allow us to (gradually) transition to a world where a page may have a distinct filename, slug and title, with complete control over all of them if required.

For this we need:

  • Storage of metadata outside git (done: see WikiPage::Meta)
  • Synchronization of metadata for UI actions (done)
  • Synchronization of metadata for git access (see !26624 (merged))
  • Import/export of metadata
  • Ability to specify slugs (and maybe filenames) in the UI
  • Ability to specify titles and slugs in the git repo (see !27706 (merged))

Down the line we would want to use this to:

  • avoid changing filenames, or keep track of old filenames so that page history is preserved over renames
  • allow multiple slugs to map to a page, using alternative slugs listed as non-canonical. When we route from these, we should have a notice on the page to inform the reader
  • Use old slugs to redirect readers to the current slug
  • Replace page listing APIs with DB calls

Intended users

Documentation

We need to add user facing documentation about how to use the front-matter sections

Availability & Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Is this a cross-stage feature?

Links / references