1. 06 Mar, 2019 1 commit
    • Patrick Bajao's avatar
      Allow protected branch creation via web and API · e371520f
      Patrick Bajao authored
      This commit includes changes to add `UserAccess#can_create_branch?`
      which will check whether the user is allowed to create a branch even
      if it matches a protected branch.
      
      This is used in `Gitlab::Checks::BranchCheck` when the branch name
      matches a protected branch.
      
      A `push_to_create_protected_branch` ability in `ProjectPolicy` has been
      added to allow Developers and above to create protected branches.
      e371520f
  2. 02 Aug, 2017 1 commit
  3. 27 Jul, 2017 2 commits
  4. 18 May, 2017 1 commit
  5. 03 Apr, 2017 2 commits
  6. 05 Jul, 2016 1 commit
    • 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
  7. 03 Jun, 2016 2 commits
  8. 09 May, 2016 1 commit
  9. 09 Dec, 2015 1 commit
  10. 12 Feb, 2015 1 commit
  11. 22 Jan, 2015 1 commit
  12. 26 Jun, 2014 1 commit
  13. 09 Apr, 2014 1 commit
  14. 05 Feb, 2013 1 commit
  15. 05 Jan, 2013 1 commit
  16. 04 Jan, 2013 1 commit
  17. 19 Nov, 2012 1 commit
  18. 09 Oct, 2012 2 commits
  19. 26 Sep, 2012 1 commit
  20. 02 Sep, 2012 1 commit
  21. 29 Aug, 2012 2 commits
  22. 11 Aug, 2012 1 commit
  23. 02 Aug, 2012 1 commit
  24. 26 Jun, 2012 1 commit
  25. 26 May, 2012 1 commit
  26. 11 May, 2012 1 commit
  27. 15 Feb, 2012 1 commit