Commit Graph
10007 Commits
Author SHA1 Message Date
Dmitriy Zaporozhets 00ac792cfb Fix clipboard button overflow
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-03 15:44:52 +01:00
Kamil Trzciński 86c0d8d289 Merge branch 'only-syntax' into 'master'
Extend yml syntax for only and except to support specifying repository path

This allows to limit execution of jobs to specific repository.

For example:
```yaml
job:
  only:
    - branches@gitlab-org/gitlab-ce
  except:
    - master@gitlab-org/gitlab-ce
```

The above will run `job` for all branches on `gitlab-org/gitlab-ce`, except master.

@dzaporozhets @JobV @vsizov Please review.


See merge request !1720
2015-11-03 12:13:21 +00:00
Dmitriy Zaporozhets d23ffc832c Fix code that depends on incorrect inflector behavior
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-03 12:00:27 +01:00
Dmitriy Zaporozhets fb2f8be4d7 Merge branch 'olhado/gitlab-ce-commit-search' 2015-11-03 11:28:56 +01:00
Dmitriy Zaporozhets d0398514b8 Add 'New file' link to dropdown on project page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-03 09:21:35 +01:00
Stan Hu aa27108e6b Merge pull request #9791 from konpyu/fix-deprecated
Fix deprecated `prepend_before_filter` -> `prepend_before_action`
2015-11-02 23:47:37 -08:00
Dmitriy Zaporozhets 810c91fe35 Refactor search by commits message
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-02 16:39:24 +01:00
Kamil Trzcinski c03da1caad Extend yml syntax for only and except to support specifying repository path 2015-11-02 14:44:06 +01:00
Robert Speicher 3b0039f659 Persist blob editor's value on submit, not on click
Prior, the value of the Ace editor was only being persisted if the user
physically clicked the submit button, which the "quick submit" behavior
doesn't do.

Now the value will be properly transferred before any form is submitted.
2015-10-31 16:08:34 +01:00
KON YUICHI 31723eb9f0 fix deprecated 2015-10-31 22:32:06 +09:00
Yorick Peterse a0ba6c6c19 Merge branch 'optimize-user-find-by-any-email' into 'master'
Improve performance of User.find_by_any_email



See merge request !1698
2015-10-30 17:28:30 +00:00
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 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 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
Douwe Maan 0ea38dc519 Merge branch 'binford2k/gitlab-ce-feature/create_new_directories' 2015-10-29 15:50:49 +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
Dmitriy Zaporozhets b1547021bc Fix label destroy js
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-29 14:22:11 +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
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 f9c929b313 Merge branch 'edit-new-cross-references' 2015-10-28 14:57:17 +01: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
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
Stan Hu 98cc695afb Merge pull request #9771 from kazubu/fix_error_destroy_without_referer
Fix: 500 error returned if destroy request without HTTP referer
2015-10-26 16:49:14 +01:00
Robert Speicher 2b1636a320 Merge branch 'fix-ci-badge' into 'master'
Fix CI badge

The previous code relied on having on ref stored in commit, however the ref was moved to the build.

Fixes #3104

See merge request !1690
2015-10-26 14:02:21 +00:00
Kamil Trzcinski 271ad4e354 Fix CI badge
The previous code relied on having on ref stored in commit, however the ref was moved to the build.
2015-10-26 12:23:40 +01:00
Kamil Trzcinski 6db014987d Fix specific runner visibility 2015-10-26 11:23:11 +01:00
kazubu 0bfb9cbf38 modify to use redirect_back_or_default function 2015-10-26 15:06:55 +09:00
kazubu c3d48f9735 Fix: 500 error returned if destroy request without HTTP referer 2015-10-26 15:06:55 +09:00
Stan Hu f66ec1bc81 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-10-26 06:30:57 +01:00
Douwe Maan b6f8d0100e Merge branch 'dirceu/gitlab-ce-fix-project-search-with-unmatched-parentheses' 2015-10-25 11:55:14 +01:00
Dmitriy Zaporozhets 9b93704614 Merge branch 'ci-status-mr-index' into 'master'
Ci status for merge requests index page

![ci-mr-index](/uploads/1424564c87ac6ff5fb2c4bc260fbebdf/ci-mr-index.png)


See merge request !1682
2015-10-25 09:14:48 +00:00
Jannick Fahlbusch 45399ccc9a Fix some grammatical issues 2015-10-24 12:37:44 +02:00
Jannick Fahlbusch 7e441bbb40 Add missing character
This adds the missing character `a` to the help-text
2015-10-23 23:37:28 +02:00
Dmitriy Zaporozhets 5615f2737c Fix rubocop issues
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-23 18:21:43 +02:00
Dmitriy Zaporozhets 696a708401 Move rendering CI status to helper
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-23 17:32:52 +02:00
Dmitriy Zaporozhets 7b06c83cf7 Add tests for MR index page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-23 17:01:25 +02:00
Dmitriy Zaporozhets fe6ec80e75 Render CI status on merge requests index page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-23 17:01:10 +02:00
Dmitriy Zaporozhets 0bb50ea081 Merge branch 'rs-clipboard-js' into 'master'
Add "Copy to clipboard" buttons

See #2855

See merge request !1494
2015-10-23 14:39:03 +00:00
Dmitriy Zaporozhets 61fcb3c568 Merge branch 'git-follow' into 'master'
Use git follow flag for commits page when retrieve history for file or directory

This can be really helpful when you want commit history for file that was moved recently

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

See merge request !1680
2015-10-23 14:29:34 +00:00
Robert Speicher 17c60173f6 Merge branch 'fix-ci-regressions' into 'master'
Fix CI regressions

This MR fixes a couple of small CI regressions
- Allow developer to manage builds
- On CI Admin page show only projects that are present in GitLab
- On Runner CI Admin page show only projects that are present in GitLab
- Refresh build log only when status changes
- Show the oldest builds on top when viewing Builds - it most cases it shows running builds on top
- Fix Lint rendering
- Fix number of other builds in build widget

Fixes #3164

Fixes #3161 

Fixes gitlab-org/gitlab-ci#343

See merge request !1679
2015-10-23 14:06:34 +00:00
Robert Speicher 03cfda9422 Remove unused argument from clipboard_button helper 2015-10-23 15:59:25 +02:00
Robert Speicher 8010872579 Add clipboard buttons to each step of "How to merge" 2015-10-23 15:44:39 +02:00
Robert Speicher 187625831f Add "Copy to clipboard" buttons
Adds buttons to the commit list SHAs and the cross-project reference
data on issuables.
2015-10-23 15:31:43 +02:00