1. 21 Jun, 2017 14 commits
    • Toon Claes's avatar
      Auditor user should also have private access · f9488901
      Toon Claes authored
      The permitted visibility levels for an auditor user should also include private,
      because it has read-only access to every project/group on the GitLab instance.
      f9488901
    • Yorick Peterse's avatar
      Refactor GroupProjectsFinder#init_collection · bd819aa9
      Yorick Peterse authored
      This optimises how GroupProjectsFinder builds it collection, producing
      simpler and faster queries in the process. It also cleans up the code a
      bit to make it easier to understand.
      bd819aa9
    • Yorick Peterse's avatar
      Refactor Project.with_feature_available_for_user · 80deee92
      Yorick Peterse authored
      This method used to use a UNION, which would lead to it performing the
      same query twice; producing less than ideal performance. Further, in
      certain cases ActiveRecord could get confused and mess up the variable
      bindings, though it's not clear how/why exactly this happens.
      
      Fortunately we can work around all of this by building some of the WHERE
      conditions manually, allowing us to use a simple OR statement to get all
      the data we want without any of the above problems.
      80deee92
    • Yorick Peterse's avatar
      Refactor ProjectsFinder#init_collection · 2dbb6ca3
      Yorick Peterse authored
      This changes ProjectsFinder#init_collection so it no longer relies on a
      UNION. For example, to get starred projects of a user we used to run:
      
          SELECT projects.*
          FROM projects
          WHERE projects.pending_delete = 'f'
          AND (
              projects.id IN (
                  SELECT projects.id
                  FROM projects
                  INNER JOIN users_star_projects
                      ON users_star_projects.project_id = projects.id
                  INNER JOIN project_authorizations
                      ON projects.id = project_authorizations.project_id
                  WHERE projects.pending_delete = 'f'
                  AND project_authorizations.user_id = 1
                  AND users_star_projects.user_id = 1
      
                  UNION
      
                  SELECT projects.id
                  FROM projects
                  INNER JOIN users_star_projects
                      ON users_star_projects.project_id = projects.id
                  WHERE projects.visibility_level IN (20, 10)
                  AND users_star_projects.user_id = 1
              )
          )
          ORDER BY projects.id DESC;
      
      With these changes the above query is turned into the following instead:
      
          SELECT projects.*
          FROM projects
          INNER JOIN users_star_projects
              ON users_star_projects.project_id = projects.id
          WHERE projects.pending_delete = 'f'
          AND (
              EXISTS (
                  SELECT 1
                  FROM project_authorizations
                  WHERE project_authorizations.user_id = 1
                  AND (project_id = projects.id)
              )
              OR projects.visibility_level IN (20,10)
          )
          AND users_star_projects.user_id = 1
          ORDER BY projects.id DESC;
      
      This query in turn produces a better execution plan and takes less time,
      though the difference is only a few milliseconds (this however depends
      on the amount of data involved and additional conditions that may be
      added).
      2dbb6ca3
    • Rémy Coutable's avatar
      Merge branch 'speed-up-approvers-queries-again' into 'master' · ee4b5fc6
      Rémy Coutable authored
      Speed up counting approvers when some are specified
      
      See merge request !2196
      ee4b5fc6
    • Kamil Trzciński's avatar
      Merge branch 'docs/object-storage-94' into 'master' · ebc7deb2
      Kamil Trzciński authored
      Change GitLab version for object storage
      
      See merge request !2197
      ebc7deb2
    • Marin Jankovski's avatar
      Merge branch 'docs-setup-repmgr' into 'master' · 07c6ff58
      Marin Jankovski authored
      Document the manual steps needed to use repmgr
      
      See merge request !2172
      07c6ff58
    • Ian Baum's avatar
      Document the manual steps needed to use repmgr · c9b77313
      Ian Baum authored
      c9b77313
    • Timothy Andrew's avatar
      Update CHANGELOG.md for 9.2.7 · 16e88fff
      Timothy Andrew authored
      [ci skip]
      16e88fff
    • Timothy Andrew's avatar
      Update CHANGELOG-EE.md for 9.2.7-ee · 719348f6
      Timothy Andrew authored
      [ci skip]
      719348f6
    • Achilleas Pipinellis's avatar
      Change GitLab version for object storage · 09c7b6be
      Achilleas Pipinellis authored
      [ci skip]
      09c7b6be
    • Sean McGivern's avatar
      Speed up counting approvers when some are specified · aed26bfc
      Sean McGivern authored
      When some approvers are specified, we still need to check the potential set of
      approvers, including people with developer access and up. Doing that with an OR
      took a long time (over 500ms) on GitLab.com, even when only one approver was
      specified.
      
      By doing a UNION instead, we get much faster results (less than 10ms). Also, as
      we are using UNION and not UNION ALL, we don't need to exclude the approvers
      specified from the query to get everyone with access.
      aed26bfc
    • Phil Hughes's avatar
      Merge branch '2676-codeclimate-sentence-is-incomplete' into 'master' · 3f441389
      Phil Hughes authored
      Fix bad connector - verify if both new and resolved issues are present before adding the connector.
      
      Closes #2676
      
      See merge request !2187
      3f441389
    • Filipa Lacerda's avatar
  2. 20 Jun, 2017 19 commits
  3. 19 Jun, 2017 7 commits