1. 01 Aug, 2017 1 commit
  2. 28 Jul, 2017 1 commit
    • Yorick Peterse's avatar
      Merge issuable "reopened" state into "opened" · 5048bfd58cf0
      Yorick Peterse authored
      Having two states that essentially mean the same thing is very much like
      having a boolean "true" and boolean "mostly-true": it's rather silly.
      This commit merges the "reopened" state into the "opened" state while
      taking care of system notes still showing messages along the lines of
      "Alice reopened this issue".
      
      A big benefit from having only two states (opened and closed) is that
      indexing and querying becomes simpler and more performant. For example,
      to get all the opened queries we no longer have to query both states:
      
          SELECT *
          FROM issues
          WHERE project_id = 2
          AND state IN ('opened', 'reopened');
      
      Instead we can query a single state directly, which can be much faster:
      
          SELECT *
          FROM issues
          WHERE project_id = 2
          AND state = 'opened';
      
      Further, only having two states makes indexing easier as we will only
      ever filter (and thus scan an index) using a single value. Partial
      indexes could help but aren't supported on MySQL, complicating the
      development process and not being helpful for MySQL.
      5048bfd58cf0
  3. 25 Jul, 2017 1 commit
  4. 24 Jul, 2017 1 commit
  5. 19 Jul, 2017 2 commits
    • Lin Jen-Shin's avatar
      Eliminate N+1 queries on checking different protected refs · f759d31155b0
      Lin Jen-Shin authored
      I realized where the N+1 queries were actually coming from
      project.protected_branches, but how come we cannot preload this,
      or cache this at all?
      
      Then I found that this is somehow a Rails limitation. What we're
      doing before, eventually come to:
      
          project.protected_branches.matching
      
      But why it's not cached? (project.protected_branches.loaded? is always
      false) It's because matching is a class method, which is called on
      the proxy. In this case, Rails cannot cache the result. I don't know
      if this is possible to implement or not, because clearly this would
      require some tricks to implement class methods on associations.
      
      So instead, we could just pass project.protected_branches to
      ProtectedRef.matching, then it would work regularly.
      
      With this change, there's no more N+1 queries.
      f759d31155b0
    • Jarka Kadlecova's avatar
      2d6b2e1f86ce
  6. 14 Jul, 2017 1 commit
  7. 07 Jul, 2017 6 commits
  8. 06 Jul, 2017 1 commit
    • Yorick Peterse's avatar
      Added Cop to blacklist the use of `dependent:` · ccb23d8870a8
      Yorick Peterse authored
      This is allowed for existing instances so we don't end up 76 offenses
      right away, but for new code one should _only_ use this if they _have_
      to remove non database data. Even then it's usually better to do this in
      a service class as this gives you more control over how to remove the
      data (e.g. in bulk).
      ccb23d8870a8
  9. 05 Jul, 2017 1 commit
  10. 04 Jul, 2017 1 commit
  11. 03 Jul, 2017 1 commit
  12. 30 Jun, 2017 1 commit
  13. 29 Jun, 2017 3 commits
  14. 28 Jun, 2017 2 commits
  15. 27 Jun, 2017 2 commits
  16. 21 Jun, 2017 2 commits
  17. 20 Jun, 2017 5 commits
  18. 16 Jun, 2017 5 commits
  19. 31 May, 2017 2 commits
  20. 29 May, 2017 1 commit