Commit Graph
22224 Commits
Author SHA1 Message Date
Thirumal S 72ececfab1 form-control class to select box 2015-10-30 17:27:22 +05:30
Dmitriy Zaporozhets 49a73b6e70 Merge branch 'minor-ui-fixes' into 'master'
Minor ui fixes



See merge request !1704
2015-10-30 11:52:41 +00:00
Yorick Peterse 6d3068bec3 Adjusted ips/sec for find_by_any_email benchmarks
While these benchmarks run at roughly 1500 i/sec setting the threshold
to 1000 leaves some room for deviations (e.g. due to different DB
setups).
2015-10-30 12:00:58 +01:00
Yorick Peterse a9df714764 Use a subquery with IDs only for find_by_any_email
This further improves performance of User.find_by_any_email and is
roughly twice as fast as the previous UNION setup.

Thanks again to @dlemstra for suggesting this.
2015-10-30 12:00:58 +01:00
Yorick Peterse bba46623c2 Fixed UNION syntax for MySQL
MySQL doesn't support the previous syntax.
2015-10-30 12:00:58 +01:00
Yorick Peterse 24c8f42278 Use a UNION for User.find_by_any_email
This is significantly faster than using a sub-query, at least when run
on the GitLab.com production database. The benchmarks are a lot slower
now with these changes, most likely due to PostgreSQL choosing a
different (and less efficient) plan based on the amount of data present
in the test database.

Thanks to @dlemstra for suggesting the use of a UNION.
2015-10-30 12:00:58 +01:00
Yorick Peterse 0a6aaf2569 Changelog entry for User.find_by_any_email 2015-10-30 12:00:58 +01:00
Yorick Peterse 49c081b9f3 Improve performance of User.find_by_any_email
This query used to rely on a JOIN, effectively producing the following
SQL:

    SELECT users.*
    FROM users
    LEFT OUTER JOIN emails ON emails.user_id = users.id
    WHERE (users.email = X OR emails.email = X)
    LIMIT 1;

The use of a JOIN means having to scan over all Emails and users, join
them together and then filter out the rows that don't match the criteria
(though this step may be taken into account already when joining).

In the new setup this query instead uses a sub-query, producing the
following SQL:

    SELECT *
    FROM users
    WHERE id IN (select user_id FROM emails WHERE email = X)
    OR email = X
    LIMIT 1;

This query has the benefit that it:

1. Doesn't have to JOIN any rows
2. Only has to operate on a relatively small set of rows from the
   "emails" table.

Since most users will only have a handful of Emails associated
(certainly not hundreds or even thousands) the size of the set returned
by the sub-query is small enough that it should not become problematic.

Performance of the old versus new version can be measured using the
following benchmark:

    # Save this in ./bench.rb
    require 'benchmark/ips'

    email = 'yorick@gitlab.com'

    def User.find_by_any_email_old(email)
      user_table = arel_table
      email_table = Email.arel_table

      query = user_table.
        project(user_table[Arel.star]).
        join(email_table, Arel::Nodes::OuterJoin).
        on(user_table[:id].eq(email_table[:user_id])).
        where(user_table[:email].eq(email).or(email_table[:email].eq(email)))

      find_by_sql(query.to_sql).first
    end

    Benchmark.ips do |bench|
      bench.report 'original' do
        User.find_by_any_email_old(email)
      end

      bench.report 'optimized' do
        User.find_by_any_email(email)
      end

      bench.compare!
    end

Running this locally using "bundle exec rails r bench.rb" produces the
following output:

    Calculating -------------------------------------
                original     1.000  i/100ms
               optimized    93.000  i/100ms
    -------------------------------------------------
                original     11.103  (± 0.0%) i/s -     56.000
               optimized    948.713  (± 5.3%) i/s -      4.743k

    Comparison:
               optimized:      948.7 i/s
                original:       11.1 i/s - 85.45x slower

In other words, the new setup is 85x faster compared to the old setup,
at least when running this benchmark locally.

For GitLab.com these improvements result in User.find_by_any_email
taking only ~170 ms to run, instead of around 800 ms. While this is
"only" an improvement of about 4.5 times (instead of 85x) it's still
significantly better than before.

Fixes #3242
2015-10-30 12:00:58 +01:00
Douglas Barbosa Alexandre c8fe421512 Improve personal snippet access workflow. Fixes #3258 2015-10-29 18:42:29 -02:00
James Lopez de990aa158 fixed last group owner issue and added test 2015-10-29 16:10:27 +00:00
Jacob Vosmaer bc89c4f8d9 Make sed command GNU-compatible 2015-10-29 16:34:50 +01:00
Jacob Vosmaer 6119b872fb Add missing "cd" 2015-10-29 16:34:33 +01:00
Douwe Maan 0ea38dc519 Merge branch 'binford2k/gitlab-ce-feature/create_new_directories' 2015-10-29 15:50:49 +01:00
Douwe Maan 6d0337a97a Update changelog item 2015-10-29 15:49:07 +01:00
Ben FordandDouwe Maan 3be9d2c422 Add ability to create directories in the editor
Simply type a name with a `/` directory separator and new directories
will be created. This does not do the fancy UI work that github.com
does, but it will get the job done.

I could not find tests for file creation, so I didn't add a test for
this slight behaviour modification. I did test directory traversals
though, using both absolute paths like `/tmp/foo.txt` and relative paths
like `../../foo.txt`. Neither case escaped the repository, though
attempting to traverse with a relative path resulted in a 500 error that
did not affect application stability upon reload.
2015-10-29 15:49:07 +01:00
Douwe Maan f24324adbe Merge branch 'fix-issue-3138' into 'master'
Force update refs/merge-requests/X/head upon a push to the source branch of a merge request

If a user rebases and does a force push, GitLab would not update the `refs/merge-requests/X/head` link. Using the -f flag forces this to happen.

Closes #3138

See merge request !1683
2015-10-29 13:25:06 +00:00
Dmitriy Zaporozhets b1547021bc Fix label destroy js
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-29 14:22:11 +01:00
Jacob Vosmaer c5132e94e1 Switch to gitlab-workhorse 2015-10-29 14:21:24 +01:00
Gert Goet 41734b630e Ensure variable is evalled 2015-10-29 14:14:21 +01:00
Yorick Peterse 29b3ce56ac Removed extra activity update for new projects
When a project is created the last activity timestamp is already set so
there's no need for another update.
2015-10-29 14:06:11 +01:00
Douwe Maan bb8b6f38e7 Update changelog 2015-10-29 13:02:11 +00:00
Douwe Maan 0574166a61 Fix grouping of contributors by email in graph. 2015-10-29 13:00:20 +00:00
Yorick Peterse 6369c992a6 Added benchmark for Projects::CreateService
This benchmark currently runs at ~0.6 iterations per second and is
unlikely to perform any better any time soon.
2015-10-29 12:09:25 +01:00
Yorick Peterse 7fc95d805d Added index on services.template
This column is queried when creating a new project, without an index
this query would lead to a sequence scan.
2015-10-29 12:09:25 +01:00
Dmitriy Zaporozhets ead3ffd7a5 Merge branch 'shared-file-access' into 'master'
Start putting shared files in "shared"



See merge request !1691
2015-10-29 11:06:03 +00:00
Sytse Sijbrandij ae99720a40 Write out internet explorer 2015-10-29 10:27:21 +00:00
Sytse Sijbrandij ac006c193c IE message doesn't need a heading 2015-10-29 10:26:48 +00:00
James Newton 3bb626f91c refactor login as to be impersonation with better login/logout
Modifies the existing "login as" feature to be called impersonation, as
well as keeping track of who is impersonating to revert back to that
user without having to log out.
2015-10-29 11:00:17 +01:00
Dmitriy Zaporozhets e0e311a19c Fix bg for labels page when no labels present
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-29 10:28:41 +01:00
Dmitriy Zaporozhets 7794cc8b9d Put delete snippet btn after edit btn
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-29 10:25:38 +01:00
Michael Chmielewski a0d0a01791 Actually converted code to following suggestions. 2015-10-28 22:34:39 -04:00
Michael Chmielewski 7b62791afc Fixed method to use git log via Popen as recommended, and made output match test (and thus system) expectations. 2015-10-28 22:34:39 -04:00
Michael Chmielewski b1f4aaa5e7 Trying to incorporate suggestions from comments on Merge Request 1661 2015-10-28 22:34:39 -04:00
Michael Chmielewski 8e8fb87d40 Trailing new lines at ends of files are important. 2015-10-28 22:34:39 -04:00
Michael Chmielewski 8e3a316121 Moved changelog entry to 8.2 2015-10-28 22:34:39 -04:00
Mike Chmielewski afdb53baec Added @commits to list of tags. 2015-10-28 22:34:39 -04:00
Mike Chmielewski 091aa95dbf Make subject of spec line up on one line to satisfy rubocop requirements 2015-10-28 22:34:39 -04:00
Jonathan SchoefflingandMichael Chmielewski 5a5069969c Add support for searching commit log messages
Include the log messages of recent commits in project-level search
results, providing functionality similar to 'git log --grep'.

Update repository model rspec tests to validate the output of
Repository#commits_with_log_matching.
2015-10-28 22:34:39 -04:00
Stan Hu f56c7d9f8e Force update refs/merge-requests/X/head upon a push to the source branch of a merge request
Closes #3138
2015-10-29 00:10:25 +01:00
Dmitriy Zaporozhets 8c9e1df98e Merge branch 'closing-issue-tracker' into 'master'
Add copy paste text for closing down the Github issue tracker

@sytses I think we talked about closing down the Issue tracker on Github. A first step can be closing all the older issues and steering people towards the gitlab.com issue tracker.

What do you think about this text?

See merge request !1689
2015-10-28 14:08:06 +00:00
Dmitriy Zaporozhets 92929ee48f Merge branch 'edit-new-cross-references' into 'master'
Use issue editor as cross reference comment author when issue is edited with a new mention.

Fixes #3244.

See merge request !1696
2015-10-28 13:59:18 +00:00
Dmitriy Zaporozhets deb700419d Merge branch 'rs-update-nprogress-rails' into 'master'
Bump nprogress-rails to 0.1.6.7

Closes #2866

See merge request !1686
2015-10-28 13:58:15 +00:00
Dmitriy Zaporozhets f9c929b313 Merge branch 'edit-new-cross-references' 2015-10-28 14:57:17 +01:00
Dmitriy Zaporozhets be0631e1cd Merge branch 'cleanup-ci-integration' into 'master'
Remove deprecated CI events from project settings page

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

cc @ayufan 

Part of #2594 

See merge request !1694
2015-10-28 13:53:41 +00:00
Jeroen van Baarsen 89bce7fada Add copy paste text for closing down the Github issue tracker
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2015-10-28 14:39:16 +01:00
Achilleas Pipinellis 52ac3ff1c0 Merge branch 'fix_permission_doc' into 'master'
Fixed the permission doc

The guest users was missing "Pull project code" and "Download project".

/cc @axil 

See merge request !1695
2015-10-28 13:37:46 +00:00
Douwe Maan aaa93d5add Use issue editor as cross reference comment author when issue is edited with a new mention. 2015-10-28 13:09:51 +01:00
Hannes Rosenögger 910c2a50ef Fixed the permission doc
The guest users was missing "Pull project code" and "Download project".
2015-10-28 12:41:56 +01:00
Dmitriy Zaporozhets c9af886df9 Remove deprecated CI events from project settings page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-28 12:33:54 +01:00
Dmitriy Zaporozhets b6d1d25d43 Merge branch 'gitlab-shell-v2.6.6' into 'master'
Bump gitlab-shell to v2.6.6



See merge request !1673
2015-10-28 10:32:18 +00:00