BigW Consortium Gitlab

  1. 01 Jul, 2016 1 commit
  2. 30 Jun, 2016 1 commit
    • Handle external issues in IssueReferenceFilter · a4ce2d12
      Yorick Peterse authored
      IssueReferenceFilter will end up processing internal issue references
      when a project uses an external issues tracker while still using
      internal issue references (in the form of `#\d+`). This commit ensures
      that these links are rendered as external issue links, regardless of
      whether the project one currently views uses an internal or external
      issues tracker.
      
      Fixes gitlab-org/gitlab-ce#19036, gitlab-com/performance#16
  3. 27 Jun, 2016 1 commit
  4. 24 Jun, 2016 1 commit
    • Support for rendering/redacting multiple documents · d470f3d1
      Yorick Peterse authored
      This commit changes the way certain documents are rendered (currently
      only Notes) and how documents are redacted. Previously both rendering
      and redacting would run on a per document basis. The result of this was
      that for every document we'd have to run countless queries just to
      figure out if we could display a set of links or not.
      
      This commit changes things around so that redacting Markdown documents
      is no longer tied into the html-pipeline Gem. This in turn allows it to
      redact multiple documents in a single pass, thus reducing the number of
      queries needed.
      
      In turn rendering issue/merge request notes has been adjusted to take
      advantage of this new setup. Instead of rendering Markdown somewhere
      deep down in a view the Markdown is rendered and redacted in the
      controller (taking the current user and all that into account). This has
      been done in such a way that the "markdown()" helper method can still be
      used on its own.
      
      This particular commit also paves the way for caching rendered HTML on
      object level. Right now there's an accessor method Note#note_html which
      is used for setting/getting the rendered HTML. Once we cache HTML on row
      level we can simply change this field to be a column and call a "save"
      whenever needed and we're pretty much done.
  5. 21 Jun, 2016 2 commits
    • Handle external issues in IssueReferenceFilter · ceeba75c
      Yorick Peterse authored
      In the past this class would use Project#get_issue to retrieve an issue
      by its ID. This method would automatically determine whether to return
      an Issue or ExternalIssue.
      
      This commit changes IssueReferenceFilter to handle external issues again
      and in a somewhat more explicit manner than before.
      
      Fixes gitlab-org/gitlab-ce#18827
    • Optimize Banzai::Filter::RelativeLinkFilter · ca696175
      Alejandro Rodríguez authored
          A lot of git operations were being repeated, for example, to build a url
          you would ask if the path was a Tree, which would call a recursive routine
          in Gitlab::Git::Tree#where, then ask if the path was a Blob, which would
          call a recursive routine at Gitlab::Git::Blob#find, making reference to
          the same git objects several times. Now we call Rugged::Tree#path, which
          allows us to determine the type of the path in one pass.
      
          Some other minor improvement added, like saving commonly used references
          instead of calculating them each time.
  6. 18 Jun, 2016 2 commits
  7. 16 Jun, 2016 5 commits
  8. 13 Jun, 2016 1 commit
  9. 10 Jun, 2016 1 commit
  10. 09 Jun, 2016 1 commit
    • Implement the correct linking behaviour in `WikiLinkFilter`. · 8e71c19a
      Timothy Andrew authored
      Original Comments
      =================
      
      - Linking behaves as per rules documented here:
        https://gitlab.com/gitlab-org/gitlab-ce/blob/16568-document-wiki-linking-behavior/doc/markdown/wiki.md
      - All links (to other wiki pages) are rewritten to be at the level of
        the app root. We can't use links relative to the current
        page ('./foo', 'foo', '../foo'), because they won't work in the
        markdown preview, where the current page is suffixed with `/edit`
      - Move existing `WikiLinkFilter` specs to `WikiPipeline` spec. It makes
        sense to run these tests on the combined output of the pipeline,
        rather than a single filter, since we can catch issues with
        conflicting filters.
      - Add more tests to cover the new linking
      
      @rymai's Review
      ===============
      
      - Classes nested under `WikiLinkFilter` should declare `WikiLinkFilter`'s
        inherit, so nothing changes if the nested class is loaded first.
      - Add a blank line after a guard clause
      - Use keyword arguments for the `Rewriter` constructor
      - Invert a condition - use `if` instead of `unless`
      - Inline a `let` in `WikiPipeline` spec - it was only used in a single place
      - Change out of date spec names
      - Add a comment for every rewrite rule in `Rewriter`
  11. 03 Jun, 2016 2 commits
  12. 02 Jun, 2016 3 commits
    • Reduce Namespace queries in UserReferenceFilter · 01575e99
      Yorick Peterse authored
      This changes UserReferenceFilter so it operates using the following
      steps:
      
      1. Grab all username references from the input document.
      2. Query the corresponding Namespace objects using a single query.
      3. Iterate over all nodes to build links while re-using the objects
         queried in step 2.
      
      The impact of these changes is that a comment mentioning 5 different
      usernames no longer runs 5 different queries (1 for every username),
      instead it only runs a single query.
    • Added ReferenceFilter#nodes · 8a6c3f27
      Yorick Peterse authored
      This method returns an Array of the HTML nodes as yielded by
      ReferenceFilter#each_node. The method's return value is memoized to
      allow multiple calls without having to re-query the input document.
    • Returning enums in ReferenceFilter#each_node · 2fbfb854
      Yorick Peterse authored
      This changes ReferenceFilter#each_node so that when it's called without
      a block an Enumerator is returned.
  13. 26 May, 2016 1 commit
    • Split Markdown rendering & reference gathering · 86166d28
      Yorick Peterse authored
      This splits the Markdown rendering and reference extraction phases into
      two distinct code bases. The reference extraction phase no longer relies
      on the html-pipeline Gem (and any related code) and allows for
      extracting of references from multiple HTML nodes in a single pass. This
      means that if you want to extract user references from 200 comments you
      no longer need to run 200 times N number of queries, instead only a
      handful of queries may be needed.
  14. 18 May, 2016 1 commit
  15. 12 May, 2016 2 commits
  16. 10 May, 2016 2 commits
  17. 09 May, 2016 1 commit
  18. 05 May, 2016 1 commit
  19. 21 Apr, 2016 5 commits
  20. 06 Apr, 2016 3 commits
  21. 05 Apr, 2016 1 commit
  22. 30 Mar, 2016 1 commit
  23. 20 Mar, 2016 1 commit