1. 05 Jul, 2016 3 commits
    • Timothy Andrew's avatar
      Support wildcard matches for protected branches at the model level. · f51af496
      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.
      f51af496
    • Stan Hu's avatar
      Merge branch '19496-fix-build' into 'master' · ba9ef7f3
      Stan Hu authored
      Assert against `ActionMailer::Base.deliveries` relatively
      
      - Closes #19496 
      - Fixes `master` build
      
      
      See merge request !5082
      ba9ef7f3
    • Timothy Andrew's avatar
      Assert against `ActionMailer::Base.deliveries` relatively. · f617bd76
      Timothy Andrew authored
      - Look for a `change` in its size rather than asserting against an
        actual size.
      
      - This previously failed because another spec had an email in
        `ActionMailer::Base.deliveries`, which failed this `be_nil` assertion.
      f617bd76
  2. 04 Jul, 2016 22 commits
  3. 03 Jul, 2016 5 commits
  4. 02 Jul, 2016 3 commits
  5. 01 Jul, 2016 7 commits