1. 21 Jun, 2017 2 commits
  2. 20 Jun, 2017 1 commit
  3. 19 Jun, 2017 4 commits
    • http://jneen.net/'s avatar
      add a spec for no-href link parsing · bc4745d0b8ef
      http://jneen.net/ authored
      bc4745d0b8ef
    • Stan Hu's avatar
      If migrations are pending, make CurrentSettings use existing values and... · 631ba3bf3531
      Stan Hu authored
      If migrations are pending, make CurrentSettings use existing values and populate missing columns with defaults
      
      master was failing because `ApplicationSetting.create_from_defaults` attempted
      to write to a column that did not exist in the database. This occurred in a
      `rake db:migrate` task, which was unable to perform the migration that would
      have added the missing column in the first place.
      
      In 9.3 RC2, we also had a bug where password sign-ins were disabled because
      there were many pending migrations. The problem occurred because
      `fake_application_settings` was being returned with an OpenStruct that did not
      include the predicate method `signup_enabled?`. As a result, the value would
      erroneously return `nil` instead of `true`. This commit uses the values of the
      defaults to mimic this behavior.
      
      This commit also refactors some of the logic to be clearer.
      631ba3bf3531
    • Pawel Chojnacki's avatar
      Do not enable prometheus metrics when data folder is not present. · 453033351ac9
      Pawel Chojnacki authored
      + Set defaults correctly only for when not in production or staging
      + set ENV['prometheus_multiproc_dir'] in config/boot.rb instead of config.ru
      
      Test prometheus metrics unmemoized
      453033351ac9
    • Jacob Vosmaer's avatar
      Pass Gitaly token on Ruby gRPC requests · 4ac88debea2c
      Jacob Vosmaer authored
      4ac88debea2c
  4. 16 Jun, 2017 4 commits
    • Michael Kozono's avatar
      Add “Project moved” error to Git-over-SSH · d7440b5f28c3
      Michael Kozono authored
      d7440b5f28c3
    • David Turner's avatar
      repository: index submodules by path · e0d08c27781d
      David Turner authored
      
      
      Submodules have a name in the configuration, but this name is simply
      the path at which the submodule was initially checked in (by default
      -- the name is totally arbitrary).  If a submodule is moved, it
      retains its original name, but its path changes.  Since we discover
      submodules inside trees, we have their path but not necessarily their
      name.
      
      Make the submodules() function return the submodule hash indexed by
      path rather than name, so that renamed submodules can be looked up.
      Signed-off-by: default avatarDavid Turner <novalis@novalis.org>
      e0d08c27781d
    • Sean McGivern's avatar
      Add table for files in merge request diffs · 5e72ebc31d73
      Sean McGivern authored
      This adds an ID-less table containing one row per file, per merge request
      diff. It has a column for each attribute on Gitlab::Git::Diff that is serialised
      currently, with the advantage that we can easily query the attributes of this
      new table.
      
      It does not migrate existing data, so we have fallback code when the legacy
      st_diffs column is present instead. For a merge request diff to be valid, it
      should have at most one of:
      
      * Rows in this new table, with the correct merge_request_diff_id.
      * A non-NULL st_diffs column.
      
      It may have neither, if the diff is empty.
      5e72ebc31d73
    • Yorick Peterse's avatar
      Refactor ProjectsFinder#init_collection · 175cffb1bca8
      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).
      175cffb1bca8
  5. 15 Jun, 2017 2 commits
  6. 14 Jun, 2017 5 commits
  7. 13 Jun, 2017 2 commits
  8. 12 Jun, 2017 5 commits
  9. 09 Jun, 2017 1 commit
  10. 08 Jun, 2017 6 commits
  11. 07 Jun, 2017 8 commits