1. 18 7月, 2016 3 次提交
  2. 15 7月, 2016 1 次提交
  3. 14 7月, 2016 1 次提交
  4. 13 7月, 2016 4 次提交
  5. 12 7月, 2016 1 次提交
  6. 07 7月, 2016 2 次提交
  7. 05 7月, 2016 2 次提交
    • R
      Dumb-down avatar presence check in `avatar_url` methods · c7b68b6e
      Robert Speicher 提交于
      `avatar.present?` goes through CarrierWave, and checks that the file
      exists on disk and checks its filesize. Because we're hitting the disk,
      this adds extra overhead to something where the worst-case scenario is
      rendering a broken image.
      
      Instead, we now just check that the _database attribute_ is present,
      which is good enough for our purposes.
      
      See https://gitlab.com/gitlab-org/gitlab-ce/issues/19273
      c7b68b6e
    • T
      Support wildcard matches for protected branches at the model level. · f51af496
      Timothy Andrew 提交于
      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
  8. 01 7月, 2016 1 次提交
  9. 30 6月, 2016 3 次提交
  10. 29 6月, 2016 1 次提交
  11. 28 6月, 2016 1 次提交
  12. 22 6月, 2016 1 次提交
  13. 17 6月, 2016 1 次提交
  14. 16 6月, 2016 4 次提交
    • Y
      Fixed ordering in Project.find_with_namespace · 42598786
      Yorick Peterse 提交于
      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
      42598786
    • J
      Revert "squashed merge and fixed conflicts" · 452c076a
      James Lopez 提交于
      This reverts commit 13e37a3e.
      452c076a
    • J
      squashed merge and fixed conflicts · 13e37a3e
      James Lopez 提交于
      13e37a3e
    • Y
      Set inverse_of for Project/Services relation · 8a9164bf
      Yorick Peterse 提交于
      This ensures that code such as this don't run needless SQL queries:
      
          project.gitlab_issue_tracker_service.project
      
      This also means that if the root `project` eager loads any associations
      the Service object will be able to re-use those.
      8a9164bf
  15. 15 6月, 2016 4 次提交
  16. 14 6月, 2016 5 次提交
  17. 11 6月, 2016 1 次提交
  18. 10 6月, 2016 2 次提交
    • P
      Cache the presence of an issue_tracker at project level · 136a4ea3
      Paco Guzman 提交于
      Using update_column to store the boolean flag to avoid
      any side effects with the current state of the project
      instance
      136a4ea3
    • Y
      Add Project.where_paths_in · 24920bc5
      Yorick Peterse 提交于
      This method can be used to find multiple projects for multiple paths.
      For example, take this snippet:
      
          Project.where_paths_in(%w{gitlab-org/gitlab-ce gitlab-org/gitlab-ee})
      
      This will return an ActiveRecord::Relation containing the GitLab CE and
      GitLab EE projects.
      
      This method takes care of matching rows both case-sensitively and
      case-insensitively where needed.
      
      Project.find_with_namespace in turn has been modified to use
      Project.where_paths_in without nuking any scoping (instead it uses
      reorder(nil)). This means that any default scopes (e.g. those used for
      "pending_delete" stay intact).
      
      The method Project.where_paths_in was added so the various Markdown
      filters can use a single query to grab all the projects referenced in a
      set of documents, something Project.find_with_namespace didn't allow.
      24920bc5
  19. 03 6月, 2016 2 次提交