1. 01 Nov, 2018 1 commit
  2. 02 Oct, 2018 1 commit
  3. 24 Sep, 2018 1 commit
    • Michael Kozono's avatar
      Use `Gitlab::SafeRequestStore` in more places · 6f63147d8133
      Michael Kozono authored
      Even if it doesn’t save lines of code, since people will tend to use
      code they’ve seen. And `SafeRequestStore` is safer since you
      don’t have to remember to check `RequestStore.active?`.
      6f63147d8133
  4. 17 Sep, 2018 1 commit
    • Yorick Peterse's avatar
      Added FromUnion to easily select from a UNION · 84f6b869d148
      Yorick Peterse authored
      This commit adds the module `FromUnion`, which provides the class method
      `from_union`. This simplifies the process of selecting data from the
      result of a UNION, and reduces the likelihood of making mistakes. As a
      result, instead of this:
      
          union = Gitlab::SQL::Union.new([foo, bar])
      
          Foo.from("(#{union.to_sql}) #{Foo.table_name}")
      
      We can now write this instead:
      
          Foo.from_union([foo, bar])
      
      This commit also includes some changes to make this new setup work
      properly. For example, a bug in Rails 4
      (https://github.com/rails/rails/issues/24193) would break the use of
      `from("sub-query-here").includes(:relation)` in certain cases. There was
      also a CI query which appeared to repeat a lot of conditions from an
      outer query on an inner query, which isn't necessary.
      
      Finally, we include a RuboCop cop to ensure developers use this new
      module, instead of using Gitlab::SQL::Union directly.
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/51307
      84f6b869d148
  5. 06 Sep, 2018 1 commit
  6. 15 Aug, 2018 1 commit
  7. 01 Aug, 2018 1 commit
    • Zeger-Jan van de Weg's avatar
      Add repository languages for projects · fc85a3572af6
      Zeger-Jan van de Weg authored
      Our friends at GitHub show the programming languages for a long time,
      and inspired by that this commit means to create about the same
      functionality.
      
      Language detection is done through Linguist, as before, where the
      difference is that we cache the result in the database. Also, Gitaly can
      incrementaly scan a repository. This is done through a shell out, which
      creates overhead of about 3s each run. For now this won't be improved.
      
      Scans are triggered by pushed to the default branch, usually `master`.
      However, one exception to this rule the charts page. If we're requesting
      this expensive data anyway, we just cache it in the database.
      
      Edge cases where there is no repository, or its empty are caught in the
      Repository model. This makes use of Redis caching, which is probably
      already loaded.
      
      The added model is called RepositoryLanguage, which will make it harder
      if/when GitLab supports multiple repositories per project. However, for
      now I think this shouldn't be a concern. Also, Language could be
      confused with the i18n languages and felt like the current name was
      suiteable too.
      
      Design of the Project#Show page is done with help from @dimitrieh. This
      change is not visible to the end user unless detections are done.
      fc85a3572af6
  8. 26 Jul, 2018 1 commit
  9. 25 Jul, 2018 1 commit
    • Yorick Peterse's avatar
      Remove code for dynamically generating routes · d9212d447768
      Yorick Peterse authored
      This adds a database migration that creates routes for any projects and
      namespaces that don't already have one. We also remove the runtime code
      for dynamically creating routes, as this is no longer necessary.
      d9212d447768
  10. 26 Jun, 2018 1 commit
  11. 31 May, 2018 1 commit
  12. 04 May, 2018 1 commit
  13. 02 May, 2018 1 commit
  14. 09 Apr, 2018 1 commit
  15. 06 Apr, 2018 1 commit
  16. 06 Mar, 2018 1 commit
  17. 03 Mar, 2018 1 commit
  18. 07 Feb, 2018 1 commit
  19. 06 Feb, 2018 3 commits
  20. 05 Feb, 2018 1 commit
  21. 02 Feb, 2018 1 commit
  22. 08 Jan, 2018 1 commit
  23. 03 Jan, 2018 3 commits
  24. 08 Dec, 2017 1 commit
  25. 04 Dec, 2017 1 commit
    • Bob Van Landuyt's avatar
      Cache the forks in a namespace in the RequestStore · 21350ff1d7f6
      Bob Van Landuyt authored
      On the `show` of a project that is part of a fork network. We check if
      the user already created a fork of this project in their personal
      namespace.
      
      We do this in several places, so caching the result of this query in
      the request store prevents us from repeating it.
      21350ff1d7f6
  26. 27 Nov, 2017 1 commit
  27. 24 Nov, 2017 1 commit
  28. 06 Nov, 2017 1 commit
  29. 10 Oct, 2017 1 commit
  30. 07 Oct, 2017 1 commit
  31. 15 Sep, 2017 1 commit
    • Yorick Peterse's avatar
      Fix setting share_with_group_lock · c5f0e09eb838
      Yorick Peterse authored
      Prior to this commit running
      Namespace#force_share_with_group_lock_on_descendants would result in
      updating _all_ namespaces in the namespaces table, not just the
      descendants. This is the result of ActiveRecord::Relation#update_all not
      taking into account the CTE. To work around this we use the CTE query as
      a sub-query instead of directly calling #update_all.
      
      To prevent this from happening the relations returned by
      Gitlab::GroupHierarchy are now marked as read-only, resulting in an
      error being raised when methods such as #update_all are used.
      
      Fortunately on GitLab.com our statement timeouts appear to have
      prevented this query from actually doing any damage other than causing
      a very large amount of dead tuples.
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37916
      c5f0e09eb838
  32. 06 Sep, 2017 2 commits
  33. 31 Aug, 2017 1 commit
  34. 14 Aug, 2017 1 commit
  35. 01 Aug, 2017 1 commit