Skip to content

Add WikiPage::Meta support for group wikis

Piotr Skorupa requested to merge psk-add-wiki-page-meta-for-group-wikis into master

What does this MR do and why?

Related to #468799 (closed) and #216904 (closed).

This adds backend support for WikiPage::Meta for group-level wikis.

  • Now every time a new wiki page for a group-level wiki is added, a corresponding WikiPage::Meta record is created, achieving parity with project-level wikis.
  • DB changes: A new namespace_id attribute has been added to wiki_page_meta to enable the records to belong to a Namespace instead of a Project and project_id is no longer required. A new record has to have at least project_id or namespace_id present.
  • Generalized existing logic to support both Project and Namespace as container entities for the meta records.
  • Creating the WikiPage::Meta record has been moved to WikiPages::BaseService for clarity and looser coupling. -- this will be addressed in a follow-up MR.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Create or visit an existing group-level wiki and add a new page.
  2. Check in Rails console that a new WikiPage::Meta record with the group's namespace_id and a new WikiPage::Slug record were created.
  3. Edit that page's title and slug.
  4. Check in Rails console that the title attribute in the WikiPage::Meta record has changed and a new WikiPage::Slug record was created.
Edited by Piotr Skorupa

Merge request reports

Loading