Commit Graph

20203 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 819cfcef59 Merge branch 'fix-inflector' into 'master'
Remove inflector rule that makes commits uncountable

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

Before: 

```
>> "commits".singularize
=> "commits"
>> "commit".pluralize
=> “commits”
```

After: 

```
>> "commits".singularize
=> "commit"
>> "commit".pluralize
=> “commits”
```

cc @rspeicher 

See merge request !1726
2015-11-03 12:04:22 +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 8a22b5bf54 Remove inflector rule that makes commits uncountable
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-03 11:36:20 +01:00
Dmitriy Zaporozhets fb2f8be4d7 Merge branch 'olhado/gitlab-ce-commit-search' 2015-11-03 11:28:56 +01:00
Dmitriy Zaporozhets d0e74f49b4 Merge branch 'new-file-link' into 'master'
Add 'New file' link to dropdown on project page

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

Screenshot: 

![Screenshot_2015-11-02_15.33.41](/uploads/ecc87c6bda9e3f0680e5422d5cdc08f9/Screenshot_2015-11-02_15.33.41.png)


Fixes internal issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2562

See merge request !1719
2015-11-03 10:26:16 +00:00
Kamil Trzcinski fe34b745e7 Fix tests 2015-11-03 11:05:54 +01:00
Kamil Trzciński b9e53258c5 Merge branch 'update-links-to-ci-status' into 'master'
Update links in CI docs after GitLab 8.1

Fix that some links to CI status in docs were broken even after following redirects.

As CI build overview is now missing (cf. #3008), this MR uses `?scope=all` parameter.

See merge request !1733
2015-11-03 09:51:47 +00:00
Dmitriy Zaporozhets 28f6fba97c
Fix commits search for empty repository
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-03 10:16:09 +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
Dmitriy Zaporozhets 57430dc4da Merge branch 'rs-require-backup-files' into 'master'
Explicitly require backup/files

Fixes a test failure we were seeing on CI after merging !1520

See merge request !1731
2015-11-03 08:16:44 +00: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
Takuya Noguchi f61aa9acdc Update links in CI docs after GitLab 8.1 2015-11-03 14:01:27 +09:00
Robert Speicher 60c5b52ee9 Explicitly require backup/files 2015-11-02 15:04:43 -05:00
Dmitriy Zaporozhets 5782217bfc Merge branch 'api_file_touched_at' into 'master'
Add ability to fetch the commit ID of the last commit that actually touched a file

https://dev.gitlab.org/gitlab/gitlabhq/issues/2564

See merge request !1718
2015-11-02 17:58:32 +00: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
Valery Sizov 1b8d324762 Add ability to fetch the commit ID of the last commit that actually touched a file 2015-11-02 17:07:06 +02:00
Kamil Trzcinski 1056c9d2d2 Spelling 2015-11-02 15:49:54 +01:00
Dmitriy Zaporozhets a9f02300c8 Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2015-11-02 15:15:09 +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
Kamil Trzciński edab429c97 Merge branch 'backup-improvements' into 'master'
Reduce disk IO and space usage during backups

This is based on improvements made to the GitLab CI 8.0 backup script.

- Avoid creating many small intermediate files while backing up builds and uploads by using tar and light gzip compression
- Use same backup/restore code for uploads and builds
- Only store a compressed intermediate DB dump

See merge request !1520
2015-11-02 13:02:25 +00:00
Douwe Maan 329e067ff1 Merge branch 'rs-dev-issue-2613' into 'master'
Add custom protocol whitelisting to SanitizationFilter

Addresses internal https://dev.gitlab.org/gitlab/gitlabhq/issues/2613

We allow any protocol for autolinks: irc://irc.freenode.net/git

But manual Markdown links with the same protocol get sanitized: `[This will not be clickable](irc://irc.freenode.net/git)`: [This will not be clickable](irc://irc.freenode.net/git)

To get around this we have to first allow *all* protocols, and then manually clean dangerous (i.e., `javascript:`) protocols.

See merge request !1496
2015-11-02 10:49:46 +00:00
Douwe Maan cbd1c3e31e Merge branch 'rs-editor-submit' into 'master'
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.

See merge request !1712
2015-11-02 10:49:30 +00:00
Robert Schilling 65808019ad Merge pull request #9794 from arnaud-zg/master
Go to gitlab installation folder before initialize database
2015-11-02 10:12:18 +01:00
zheng_b 1045a72eb7 Go to gitlab installation folder before initialize database 2015-11-02 07:59:04 +01:00
Achilleas Pipinellis 8f75200d46 Merge branch 'doc-Gitlab-2-GitLab' into 'master'
Gilab -> GitLab

Replace `Gitlab` with `GitLab`

See merge request !1715
2015-11-01 00:33:16 +00:00
Achilleas Pipinellis c3d5dac185 Merge branch 'fix-doc-typo' into 'master'
Fix typo in rake task doc



See merge request !1713
2015-11-01 00:31:19 +00:00
Robert Schilling a1d0eca886 Gilab -> GitLab 2015-10-31 23:31:21 +01:00
Robert Schilling 98008a2db8 Fix typo in rake task doc 2015-10-31 22:56:24 +01:00
Achilleas Pipinellis 1f8689693a Merge branch 'fix-deadlink-in-docs-ci-examples' into 'master'
Fix deadlink in docs for ci/examples

Just fix a deadlink in docs for ci/examples.

See merge request !1710
2015-10-31 15:38:57 +00: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
Dmitriy Zaporozhets 7335395916 Merge branch 'gitlab-workhorse' into 'master'
Switch to gitlab-workhorse

This is a little annoying but it is better to change this name then
to be stuck with a bad name for a long time. Reasons for the name
change: https://gitlab.com/gitlab-org/gitlab-git-http-server/issues/13

See merge request !1707
2015-10-30 21:23:53 +00: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
Takuya Noguchi 31ea88cfed Fix deadlink in docs for ci/examples 2015-10-31 02:27:44 +09: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 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
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 Ford 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