1. 05 1月, 2018 1 次提交
  2. 23 11月, 2017 1 次提交
  3. 03 11月, 2017 1 次提交
  4. 22 10月, 2017 1 次提交
  5. 21 10月, 2017 1 次提交
  6. 04 10月, 2017 1 次提交
  7. 28 9月, 2017 1 次提交
  8. 22 9月, 2017 1 次提交
  9. 13 9月, 2017 1 次提交
  10. 08 9月, 2017 2 次提交
    • Y
      Rework how recent push events are retrieved · 83355336
      Yorick Peterse 提交于
      Whenever you push to a branch GitLab will show a button to create a
      merge request (should one not exist already). The underlying code to
      display this data was quite inefficient. For example, it involved
      multiple slow queries just to figure out what the most recent push event
      was.
      
      This commit changes the way this data is retrieved so it's much faster.
      This is achieved by caching the ID of the last push event on every push,
      which is then retrieved when loading certain pages. Database queries are
      only executed if necessary and the cached data is removed automatically
      once a merge request has been created, or 2 hours after being stored.
      
      A trade-off of this approach is that we _only_ track the last event.
      Previously if you were to push to branch A and B then create a merge
      request for branch B we'd still show the widget for branch A. As of this
      commit this is no longer the case, instead we will only show the widget
      for the branch you pushed to most recently. Once a merge request exists
      the widget is no longer displayed. Alternative solutions are either too
      complex and/or too slow, hence the decision was made to settle for this
      trade-off.
      
      Performance Impact
      ------------------
      
      In the best case scenario (= a user didn't push anything for more than 2
      hours) we perform a single Redis GET per page. Should there be cached
      data we will run a single (and lightweight) SQL query to get the
      event data from the database. If a merge request already exists we will
      run an additional DEL to remove the cache key.
      
      The difference in response timings can vary a bit per project. On
      GitLab.com the 99th percentile of time spent in User#recent_push hovers
      between 100 milliseconds and 1 second, while the mean hovers around 50
      milliseconds. With the changes in this MR the expected time spent in
      User#recent_push is expected to be reduced down to just a few
      milliseconds.
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/35990
      83355336
    • M
  11. 07 9月, 2017 4 次提交
  12. 06 9月, 2017 3 次提交
  13. 05 9月, 2017 2 次提交
  14. 31 8月, 2017 1 次提交
    • S
      `current_application_settings` belongs on `Gitlab::CurrentSettings` · 5883ce95
      Sean McGivern 提交于
      The initializers including this were doing so at the top level, so every object
      loaded after them had a `current_application_settings` method. However, if
      someone had rack-attack enabled (which was loaded before these initializers), it
      would try to load the API, and fail, because `Gitlab::CurrentSettings` didn't
      have that method.
      
      To fix this:
      
      1. Don't include `Gitlab::CurrentSettings` at the top level. We do not need
         `Object.new.current_application_settings` to work.
      2. Make `Gitlab::CurrentSettings` explicitly `extend self`, as we already use it
         like that in several places.
      3. Change the initializers to use that new form.
      5883ce95
  15. 29 8月, 2017 1 次提交
  16. 19 8月, 2017 1 次提交
  17. 18 8月, 2017 4 次提交
  18. 15 8月, 2017 2 次提交
  19. 14 8月, 2017 1 次提交
  20. 07 8月, 2017 1 次提交
    • Y
      Improve checking if projects would be returned · f77fda64
      Yorick Peterse 提交于
      In various places we check if the same relation would return projects.
      This is done using "any?" which will run a COUNT query with any
      LIMIT/OFFSET values still applied.
      
      To work around all this we introduce 2 helper methods that take care of
      doing the right thing. This leads to the produced queries being simpler
      and fewer queries being executed.
      f77fda64
  21. 01 8月, 2017 1 次提交
  22. 18 7月, 2017 1 次提交
  23. 13 7月, 2017 2 次提交
  24. 07 7月, 2017 1 次提交
  25. 06 7月, 2017 1 次提交
  26. 01 7月, 2017 1 次提交
  27. 27 6月, 2017 1 次提交
  28. 21 6月, 2017 1 次提交