Read about our upcoming Code of Conduct on this issue

  1. 02 Dec, 2016 1 commit
  2. 01 Nov, 2016 1 commit
  3. 19 Oct, 2016 1 commit
  4. 28 Sep, 2016 1 commit
    • Paco Guzman's avatar
      AbstractReferenceFilter caches current project_ref on RequestStore when active · 211f549cba7f
      Paco Guzman authored
      Before we weren’t caching current_project_ref because normally the reference to 
      the current project doesn’t include the path with namespace. But now we store 
      the current project in the projects reference cache to be used for the same 
      filter when accessing using path with namespace of for subsequent filters executed on the cache.
  5. 31 Aug, 2016 1 commit
  6. 30 Jun, 2016 1 commit
    • Yorick Peterse's avatar
      Handle external issues in IssueReferenceFilter · 65123d76d341
      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
  7. 18 Jun, 2016 1 commit
  8. 16 Jun, 2016 1 commit
    • Yorick Peterse's avatar
      Reduce queries in IssueReferenceFilter · 292360e09dbc
      Yorick Peterse authored
      This reduces the number of queries executed in IssueReferenceFilter by
      retrieving the various projects/issues that may be referenced in batches
      _before_ iterating over all the HTML nodes.
      A chunk of the logic resides in AbstractReferenceFilter so it can be
      re-used by other filters in the future.
  9. 03 Jun, 2016 2 commits
  10. 01 Jun, 2016 1 commit
    • Stan Hu's avatar
      Fix 404 page when viewing TODOs that contain milestones or labels in different projects · 55e36c0e7104
      Stan Hu authored
      A user viewing the TODOs page will see a 404 if there are mentioned labels
      in multiple different projects. This is likely a caching bug and only occurs
      when Markdown rendering occurs across multiple projects, which is why it's so
      tricky to reproduce. This is what I think is happening:
      1. LabelReferenceFilter#references_in encounters label ~X for ProjectA and finds the label in the DB as id = 1.
      2. LabelReferenceFilter.references_in yields [1, 'X', nil, ...]
      3. Since project_ref is nil, AbstractReferenceFilter#project_from_ref_cache caches nil => ProjectA.
      4. LabelReferenceFilter#references_in encounters label ~Y for ProjectB and finds the label in the DB as id = 2.
      5. LabelReferenceFilter.references_in yields [2, 'Y', nil, ...]
      6. AbstractReferenceFilter#project_from_ref_cache lookups nil and returns ProjectA. It was supposed to be ProjectB.
      7. A is the wrong project, so the label lookup fails.
      This MR caches Markdown references if the key is present.
      Closes #17898
  11. 26 May, 2016 1 commit
    • Yorick Peterse's avatar
      Split Markdown rendering & reference gathering · ab6202a5f89b
      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.
  12. 06 Apr, 2016 1 commit
  13. 04 Apr, 2016 5 commits
    • Yorick Peterse's avatar
      Cleaned up caching in AbstractReferenceFilter · f711ab4a4ed2
      Yorick Peterse authored
      Cleaning this up any further is a bit tricky as the caches in question
      should only be evaluated if RequestStore is actually enabled.
    • Yorick Peterse's avatar
      Memoize object class titles · 8212bebe26ac
      Yorick Peterse authored
      For an issue with around 200 notes this cuts down timings by around 150
    • Yorick Peterse's avatar
      Cache Banzai class methods returning static data · 630830e8fc8c
      Yorick Peterse authored
      These methods always return the same data for every class so there's no
      point in computing their values on every call.
    • Yorick Peterse's avatar
      Refactor processing of various Banzai filters · 14f57c432ab5
      Yorick Peterse authored
      These filters now use a single iteration over all the document nodes
      instead of multiple ones. This in turn allows variables to be re-used
      (e.g. links only have to be unescaped once). Combined with some other
      refactoring this can drastically reduce render timings.
    • Yorick Peterse's avatar
      Cache Banzai projects/objects using RequestStore · cfedc22a8809
      Yorick Peterse authored
      This was originally suggested by @ayufan and modified to be a bit
      cleaner and use RequestStore instead of a regular Hash.
      By caching the output of the two methods involved the number of queries
      is reduced significantly. For example, for an issue with 200 notes (of
      which 100 reference a number of merge requests) this cuts down the
      amount of queries from around 6300 to around 3300.
  14. 03 Mar, 2016 1 commit
    • Grzegorz Bizon's avatar
      Fix bug with return value in abstract reference filter · f7cd9c082109
      Grzegorz Bizon authored
      When `object_class.link_reference_pattern` was `nil` because object
      being processed do not implemement link references `call` method
      returned `nil` instead of returning document, even if document has been
      processed in for basic reference pattern.
  15. 14 Jan, 2016 1 commit
  16. 31 Dec, 2015 1 commit
    • Yorick Peterse's avatar
      Don't use delegate to delegate trivial methods · aec13813c7f0
      Yorick Peterse authored
      Around 300 ms (in total) would be spent in these delegated methods due
      to the extra stuff ActiveSupport adds to the compiled methods. Because
      these delegations are so simple we can just manually define the methods,
      saving around 275 milliseconds.
  17. 24 Dec, 2015 4 commits
  18. 15 Dec, 2015 1 commit
  19. 01 Dec, 2015 6 commits
  20. 30 Nov, 2015 1 commit
  21. 16 Nov, 2015 1 commit