1. 09 Aug, 2016 2 commits
  2. 04 Aug, 2016 1 commit
  3. 02 Aug, 2016 1 commit
  4. 29 Jul, 2016 1 commit
    • Timothy Andrew's avatar
      Fix all specs related to changes in !5081. · d7366dd20b80
      Timothy Andrew authored
      1. Remove `Project#developers_can_push_to_protected_branch?` since it
         isn't used anymore.
      
      2. Remove `Project#developers_can_merge_to_protected_branch?` since it
         isn't used anymore.
      d7366dd20b80
  5. 27 Jul, 2016 1 commit
  6. 26 Jul, 2016 1 commit
  7. 21 Jul, 2016 1 commit
  8. 20 Jul, 2016 11 commits
  9. 19 Jul, 2016 3 commits
  10. 18 Jul, 2016 1 commit
  11. 12 Jul, 2016 3 commits
  12. 07 Jul, 2016 1 commit
    • Timothy Andrew's avatar
      Have `Project#open_branches` return branches that are matched by a wildcard protected branch. · eda80556710c
      Timothy Andrew authored
      1. The `open_branches` method is used to provide a list of branches
         while creating a protected branch.
      
      2. It makes sense to include branches which are matched by one or more
         wildcard protected branches, since the user might want to make exact
         protected branches from these as well.
      
      3. This also provides a large performance improvement. On my machine, in
         a project with 5000 branches and 2000 protected branches, the
         `ProtectedBranches#index` page went from a 40 seconds load time to 4
         seconds (10x speedup).
      eda80556710c
  13. 06 Jul, 2016 1 commit
  14. 05 Jul, 2016 1 commit
    • Timothy Andrew's avatar
      Support wildcard matches for protected branches at the model level. · 4fea0f8e3d8b
      Timothy Andrew authored
      1. The main implementation is in the `ProtectedBranch` model. The
         wildcard is converted to a Regex and compared. This has been tested
         thoroughly.
      
          - While `Project#protected_branch?` is the main entry point,
            `project#open_branches` and
            `project#developers_can_push_to_protected_branch?`
            have also been modified to work with wildcard protected branches.
      
          - The regex is memoized (within the `ProtectedBranch` instance)
      
      2. Improve the performance of `Project#protected_branch?`
      
          -  This method is called from `Project#open_branches` once _per branch_
             in the project, to check if that branch is protected or not.
      
          -  Before, `#protected_branch?` was making a database call every
             time it was invoked (in the above case, that amounts to once
             per branch), which is expensive.
      
          -  This commit caches the list of protected branches in memory, which
             reduces the number of database calls down to 1.
      
          -  A downside to this approach is that `#protected_branch?` _could_
             return a stale value (due to the caching), but this is
             an acceptable tradeoff.
      
      3. Remove the (now) unused `Project#protected_branch_names` method.
      
          - This was previously used to check for protected branch status.
      4fea0f8e3d8b
  15. 01 Jul, 2016 1 commit
  16. 30 Jun, 2016 2 commits
  17. 27 Jun, 2016 1 commit
  18. 24 Jun, 2016 1 commit
  19. 23 Jun, 2016 1 commit
  20. 22 Jun, 2016 1 commit
  21. 17 Jun, 2016 1 commit
  22. 16 Jun, 2016 3 commits
    • Yorick Peterse's avatar
      Fixed ordering in Project.find_with_namespace · 5fa0a6c1a212
      Yorick Peterse authored
      This ensures that Project.find_with_namespace returns a row matching
      literally as the first value, instead of returning a random value.
      
      The ordering here is _only_ applied to Project.find_with_namespace and
      _not_ Project.where_paths_in as currently there's no code that requires
      Project.where_paths_in to return rows in a certain order. Since this
      method also returns all rows that match there's no real harm in not
      setting a specific order either. Another reason is that generating all
      the "WHEN" arms for multiple values in Project.where_paths_in becomes
      really messy.
      
      On MySQL we have to use the "BINARY" operator to turn a "WHERE" into a
      case-sensitive WHERE as otherwise MySQL may still end up returning rows
      in an unpredictable order.
      
      Fixes gitlab-org/gitlab-ce#18603
      5fa0a6c1a212
    • James Lopez's avatar
      Revert "squashed merge and fixed conflicts" · 91545d127ac6
      James Lopez authored
      This reverts commit 429cd5e57fb1.
      91545d127ac6
    • James Lopez's avatar
      squashed merge and fixed conflicts · 429cd5e57fb1
      James Lopez authored
      429cd5e57fb1