[go: up one dir, main page]

Skip to content

Empty wiki pages should be valid

Problem to solve

Creating a new Wiki page from the UI requires the content of the page to exist while creating the page via the command line does not.

Proposal

Make the Wiki page content field optional when creating a new page.

We should still prevent the value from being nil but an empty string "" should be acceptable.

Documentation

Testing


https://sentry.gitlab.net/gitlab/gitlabcom/issues/1637330/?referrer=gitlab_plugin

WikiPage::Meta::WikiPageInvalid: WikiPage::Meta::WikiPageInvalid
(105 additional frame(s) were not displayed)
...
  wiki_pages/event_create_service.rb:16:in `block in execute'
    wiki_page_meta = WikiPage::Meta.find_or_create(slug, page)
  gitlab/metrics/instrumentation.rb:161:in `find_or_create'
    .measure { super }
  gitlab/metrics/method_call.rb:36:in `measure'
    retval = yield
  gitlab/metrics/instrumentation.rb:161:in `block in find_or_create'
    .measure { super }
  wiki_page/meta.rb:38:in `find_or_create'
    raise WikiPageInvalid unless wiki_page.valid?

WikiPage::Meta::WikiPageInvalid
Edited by Eric Schurter