Skip to content
Snippets Groups Projects
  1. Jul 08, 2022
  2. Apr 08, 2022
  3. Mar 29, 2022
  4. Mar 13, 2022
  5. Mar 04, 2022
  6. Feb 24, 2022
  7. Dec 14, 2021
  8. Jul 07, 2021
    • Francisco Javier López's avatar
      Allow wiki pages to be empty · 2bc6eefb
      Francisco Javier López authored
      In this commit we allow wiki pages to be empty (mostly removing
      the validation in the backend).
      
      This aligns the existing behavior because users can push
      wiki empty pages through git and that will trigger an error
      because of the existing validator.
      
      Changelog: changed
      Unverified
      2bc6eefb
  9. May 14, 2021
    • Zeger-Jan van de Weg's avatar
      Wiki: Use FindAllCommits RPC to list page versions · 19cccbba
      Zeger-Jan van de Weg authored and Bob Van Landuyt's avatar Bob Van Landuyt committed
      The wiki interface to the Git data leverages the Wiki Service in Gitaly.
      This service uses LibGit2, and the Ruby sidecar. As such there's a
      maintainance burden to the Wiki RPCs.
      
      This change changes the Gitaly RPC that the `Wiki#versions` call uses to
      FinddAllCommits. This RPC uses Git itself, and as such will allow the
      remove of the PageVersions RPC on the Gitaly side in the next release.
      
      Furthermore, it's expected that this change resolves other bugs too, for
      example: #330295 (comment 572087692)
      In this instance, `git-fsck(1)` can inflate a ZLib'ed Git object, where
      Libgit2 for some reason fails. While I don't yet know why Libgit2 fails,
      leveraging the same implementation as `git-fsck(1)` should resolve it.
      
      Changelog: changed
      19cccbba
  10. Feb 23, 2021
  11. Sep 24, 2020
    • Markus Koller's avatar
      Show wiki tree structure in sidebar and pages overview · 4915fd9b
      Markus Koller authored
      Replaces `WikiPage.group_by_directory` with `WikiDirectory.group_pages`,
      which groups the pages recursively by their path.
      
      The views were already set up for recursive partials, so we only had
      to change them to show the basename of each directory, rather than
      their full path. This is done through a new `WikiDirectory#title`
      helper.
      Unverified
      4915fd9b
  12. Aug 04, 2020
  13. Jul 30, 2020
    • Markus Koller's avatar
      Fix content validation for existing wiki pages · f85e5897
      Markus Koller authored
      This new validation didn't work correctly yet because of two reasons:
      
      - When loading the wiki page in the `#update` controller action, the
        content in `attributes[:content]` won't be initialized which causes
        `content_changed?` to return true. Our factory on the other hand
        sets `attributes[:content]` as part of its initialization.
      
        We can fix this by using `raw_content` instead in `content_changed?`,
        and verify this in the specs by reloading the existing page from the
        wiki.
      
      - Gollum converts CRLF line endings ("\r\n") to LFs ("\n"), so we also
        need to do this conversion in `WikiPage#content_changed?`.
      Unverified
      f85e5897
  14. Jul 20, 2020
  15. Jul 17, 2020
    • Markus Koller's avatar
      Add limit for wiki page content size · 1b181612
      Markus Koller authored and Imre Farkas's avatar Imre Farkas committed
      This adds a new validation to restrict the maximum size of a wiki page,
      which is only enforced when the content is updated, and only when using
      the GitLab UI or API (not for Git pushes yet).
      
      The default limit is 50MB, and can be changed through the Rails console
      or the API.
      1b181612
  16. Jul 02, 2020
    • Steve Mokris's avatar
      Allow diffing changes in wiki history · 7e199a51
      Steve Mokris authored
      Introduces a new `diff` action on the wiki controllers which shows
      the diff for the selected file and commit.
      
      - Add `Gitlab::Diff::FileCollection::WikiPage`.
      - Override diff helpers in wiki controller.
      - Unify wiki views:
        - Always use limited container width.
        - Always add breadcrumbs for wiki page path.
        - Show sidebar in diff view.
        - Align title in diff view with history view.
        - Add helpers for wiki page headers.
      Unverified
      7e199a51
  17. Jun 11, 2020
    • Markus Koller's avatar
      Decouple wiki views from projects · e7c7beeb
      Markus Koller authored and Igor Drozdov's avatar Igor Drozdov committed
      - Add generic `wiki_path` / `wiki_page_path` helpers.
      - Move views into `app/views/shared`.
      - Move JS assets into `app/assets/javascripts/pages/shared`.
      - Refer to `@wiki` instead of `@Project` in views.
      - Use constants on `Wiki` instead of `ProjectWiki`.
      e7c7beeb
  18. Jun 05, 2020
    • Luke Duncalfe's avatar
      Bugfix Save wiki pages with +<> chars in title · c5e06350
      Luke Duncalfe authored and Mayra Cabrera's avatar Mayra Cabrera committed
      A page's `title` will be returned from Gollum/Gitaly with any +<>
      characters changed to -, whereas the `path` preserves these characters.
      
      Previously, if a title had one of these characters in it, this method
      would inaccurately return true, as we would be comparing `my+page` with
      `my page` (after unhyphenization).
      
      #218230
      c5e06350
  19. May 08, 2020
  20. Apr 23, 2020
  21. Apr 16, 2020
    • Markus Koller's avatar
      Add group wiki model · fe5533a7
      Markus Koller authored
      - Refactor existing `ProjectWiki` into `Wiki`, and add new child classes
        `ProjectWiki` and `GroupWiki`.
      - Rename `project` to `container` in the wiki classes.
      - Add `HasWiki` concern for use in `Project` and `Group`.
      - Add `@groups` prefix in `Storage::Hashed`.
      - Refactor existing specs into shared examples.
      Unverified
      fe5533a7
  22. Apr 14, 2020
    • Alex Kalderimis's avatar
      Add front-matter support to wiki pages · 786cc880
      Alex Kalderimis authored
      This adds wiki page front-matter parsing library code, behind a
      feature flag. The parser abstracts front-matter recognition and
      extraction and explanation of failure.
      
      The WikiPage model is provided with a new attribute `front_matter`,
      which is derived from the content. This attribute can be updated and
      serialized to the wiki-page repository.
      
      The feature flag is gated on a project-by-project basis.
      
      Front-matter parsing is unified across concerns, by
      re-using our existing front-matter parsing Regexp in the new
      front-matter parser, to ensure consistency.
      
      A new module, `Gitlab::WikiPages` is used by model and library code.
      
      `parse_string` is made a separate method so that different languages can
      be supported without modifying other code.
      786cc880
  23. Mar 18, 2020
    • Alex Kalderimis's avatar
      Remove WikiPage#meta method · 82a0cc88
      Alex Kalderimis authored
      this was only ever needed in tests, and having it on the actual
      wiki-page model is just incurring technical debt and installing a
      permanent footgun. It is removed and replaced with factories.
      
      This also refactors the event spec to be much more declarative for
      visibility tests.
      82a0cc88
    • Alex Kalderimis's avatar
      Add wiki page metadata models · 3416ee42
      Alex Kalderimis authored
      Adds wiki page slug model:
      
      A slug represents a historical set of slugs that identify wiki pages. At
      most one can be canonical at any one time, per page.
      
      Adds wiki page meta model:
      
      The wiki page metadata model contains the current title, and has access
      to a collection of slugs, at most one of which may be canonical at any
      one point (all others are historic).
      
      Rather than polluting the model namespace, and to clarify the meaning of
      the class names, these classes are placed under the `WikiPage`
      namespace.
      
      Adds adds wiki page meta/spec factories with sequences for use in the
      specs, guaranteeing unique titles and slugs
      3416ee42
    • Alex Kalderimis's avatar
      WikiPage: Expose user, support identity equality · c16351a7
      Alex Kalderimis authored
      Exposes `@user` as `user`, so that the current page author can be
      identified.
      
      Change equality to match other DB objects: pages with equal slugs are
      equal.
      c16351a7
  24. Mar 12, 2020
    • Markus Koller's avatar
      Fix WikiPage#title_changed for paths with spaces · 6eb00b13
      Markus Koller authored
      If a wiki page is inside a directory with spaces, the change detection
      didn't account for hyphenated spaces and mistakenly assumed the title
      was changed when it wasn't, causing a validation error.
      
      This also fixes the specs to catch this case.
      Unverified
      6eb00b13
  25. Mar 03, 2020
    • Markus Koller's avatar
      Tweak wiki page title handling · d2780da0
      Markus Koller authored
      - Add specs for handling of special characters.
      - Fix `title_changed?` for all cases.
      - Remove redundant `persisted` argument.
      - Don't unescape title returned by gollum, it's not escaped anymore now.
      Unverified
      d2780da0
  26. Mar 02, 2020
  27. Feb 13, 2020
    • Markus Koller's avatar
      Limit length of wiki file/directory names · 76c643a7
      Markus Koller authored
      Many common file systems have a limit of 255 bytes for file and
      directory names, and while Git and GitLab both support paths exceeding
      those limits, the presence of them makes it impossible for users on
      those file systems to checkout a wiki repository locally.
      
      To avoid this situation, we enforce these limits when editing pages
      through the GitLab web interface and API:
      
      - 245 bytes for page titles (reserving 10 bytes for the file extension)
      - 255 bytes for directory names
      Unverified
      76c643a7
  28. Dec 16, 2019
  29. Nov 05, 2019
  30. Oct 31, 2019
  31. Oct 23, 2019
    • Alex Kalderimis's avatar
      Improve wiki page grouping · d8fafdf5
      Alex Kalderimis authored and Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre committed
      This uses an intermediate index to transform the function from `O(n^2)`
      to `O(n.logn)`, which will be very important for large wikis with lots
      of directories, which is definitely something we want to support.
      d8fafdf5
  32. Oct 17, 2019
    • Luke Duncalfe's avatar
      Pass all wiki markup formats through pipelines · 284a7fe8
      Luke Duncalfe authored
      Previously, when the wiki page format was anything other than `markdown`
      or `asciidoc` the formatted content would be returned though a Gitaly
      call. Gitaly in turn would delegate formatting to the gitlab-gollum-lib
      gem, which in turn would delegate that to various gems (like RDoc for
      `rdoc`) and then apply some very liberal sanitization.
      
      It was too liberal!
      
      This change brings our wiki content formatting in line with how we
      format other markdown at GitLab, so we have a SSOT for sanitization.
      
      #30540
      284a7fe8
  33. Sep 25, 2019
  34. Apr 12, 2019
  35. Apr 04, 2019
  36. Mar 06, 2019
Loading