summaryrefslogtreecommitdiff
path: root/app/models
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | | | Only sort by IDs by defaultYorick Peterse2015-11-031-5/+5
| | |_|/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sorting by both "created_at" and "id" in descending order is not needed as simply sorting by "id" in descending order will already sort rows from new to old. Depending on the query and data involved sorting twice can also introduce significant overhead.
* | | | | | | | | | | Merge branch 'only-syntax' into 'master' Kamil Trzciński2015-11-031-1/+1
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | | | | | | | Extend yml syntax for only and except to support specifying repository pathKamil Trzcinski2015-11-021-1/+1
| |/ / / / / / / / / /
* | | | | | | | | | | Merge branch 'olhado/gitlab-ce-commit-search'Dmitriy Zaporozhets2015-11-031-0/+9
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | |
| * | | | | | | | | | Refactor search by commits messageolhado/gitlab-ce-commit-searchDmitriy Zaporozhets2015-11-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | | | | | | | | Actually converted code to following suggestions.Michael Chmielewski2015-10-281-6/+3
| | | | | | | | | | |
| * | | | | | | | | | Fixed method to use git log via Popen as recommended, and made output match ↵Michael Chmielewski2015-10-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test (and thus system) expectations.
| * | | | | | | | | | Trying to incorporate suggestions from comments on Merge Request 1661Michael Chmielewski2015-10-281-4/+5
| | | | | | | | | | |
| * | | | | | | | | | Add support for searching commit log messagesJonathan Schoeffling2015-10-281-0/+6
| | |/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | | Use a subquery with IDs only for find_by_any_emailYorick Peterse2015-10-301-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | | Fixed UNION syntax for MySQLYorick Peterse2015-10-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL doesn't support the previous syntax.
* | | | | | | | | | Use a UNION for User.find_by_any_emailYorick Peterse2015-10-301-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | | Improve performance of User.find_by_any_emailYorick Peterse2015-10-301-15/+3
| |/ / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | | | Force update refs/merge-requests/X/head upon a push to the source branch of ↵Stan Hu2015-10-291-1/+1
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a merge request Closes #3138
* | | | | | | | Merge branch 'fix-ci-badge' into 'master' Robert Speicher2015-10-261-4/+0
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | | | | Fix CI badgefix-ci-badgeKamil Trzcinski2015-10-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous code relied on having on ref stored in commit, however the ref was moved to the build.
* | | | | | | | | Fix specific runner visibilityKamil Trzcinski2015-10-262-9/+15
|/ / / / / / / /
* | | | | | | | Merge branch 'dirceu/gitlab-ce-fix-project-search-with-unmatched-parentheses'Douwe Maan2015-10-251-1/+1
|\ \ \ \ \ \ \ \
| * | | | | | | | Fix issue #3055 (project search with unmatched parentheses)dirceu/gitlab-ce-fix-project-search-with-unmatched-parenthesesDirceu Pereira Tiegs2015-10-211-1/+1
| | |_|_|_|/ / / | |/| | | | | |
* | | | | | | | Render CI status on merge requests index pageDmitriy Zaporozhets2015-10-231-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | | | | | | Merge branch 'git-follow' into 'master' Dmitriy Zaporozhets2015-10-231-2/+5
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | | | | Refactor git follow option setgit-followDmitriy Zaporozhets2015-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * | | | | | | | Use git follow flag for commits page when retrieve history for file or directoryDmitriy Zaporozhets2015-10-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | | | | | | | Merge branch 'fix-ci-regressions' into 'master' Robert Speicher2015-10-232-1/+1
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | | | | | On CI Admin page show only projects that are present in GitLabKamil Trzcinski2015-10-231-0/+1
| | | | | | | | |
| * | | | | | | | Fix small CI UI regressionsKamil Trzcinski2015-10-231-1/+0
| | |_|/ / / / / | |/| | | | | |
* | | | | | | | Merge branch 'comments_fix' into 'master' Dmitriy Zaporozhets2015-10-231-1/+1
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix: Inability to reply to code comments in the MR view, if the MR comes from a fork https://dev.gitlab.org/gitlab/gitlabhq/issues/2535 See merge request !1675
| * | | | | | | Fix: Inability to reply to code comments in the MR view, if the MR comes ↵comments_fixValery Sizov2015-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from a fork
* | | | | | | | Merge branch 'project-path-case-sensitivity' into 'master' Robert Speicher2015-10-221-4/+5
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefer project with exact path to differently cased one when both exist. Fixes #3113. See merge request !1649
| * | | | | | | Move case sensitivity check to find_with_namespace.Douwe Maan2015-10-211-9/+3
| | | | | | | |
| * | | | | | | Prefer project with exact path to differently cased one when both exist.Douwe Maan2015-10-201-5/+12
| | | | | | | |
* | | | | | | | Show empty repository page if repository don't have branchesArtem V. Navrotskiy2015-10-212-1/+14
| |_|_|_|_|/ / |/| | | | | |
* | | | | | | Merge branch 'git-archive-improvements-2' into 'master' Douwe Maan2015-10-211-8/+8
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clear archive cache asynchronously See merge request !1651
| * \ \ \ \ \ \ Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into ↵git-archive-improvements-2Jacob Vosmaer2015-10-2013-49/+115
| |\ \ \ \ \ \ \ | | |/ / / / / / | | | | | | | | | | | | | | | | git-archive-improvements-2
| * | | | | | | Clear archive cache asynchronouslyJacob Vosmaer2015-10-201-8/+8
| | | | | | | |
* | | | | | | | Merge branch 'merge-request-deleted-file' into 'master' Dmitriy Zaporozhets2015-10-204-12/+26
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correctly find last known blob for file deleted in MR. Fixes #3092. When building a new MR, `@merge_request.commits.last` would fail because this delegates to `merge_request_diff` which is still `nil` at that point. I fixed that, and changed some of the logic because showing deleted blob contents didn't previously work for the Compare page, and the UI would show the wrong commit sha for "View File @...". See merge request !1647
| * | | | | | | Correctly find last known blob for file deleted in MR.merge-request-deleted-fileDouwe Maan2015-10-204-12/+26
| | | | | | | |
* | | | | | | | Merge branch 'master' into jrochkind/gitlab-ce-fix_2839_send_abuse_report_notifyDouwe Maan2015-10-196-6/+53
|\ \ \ \ \ \ \ \ | |/ / / / / / / | | | | | | | | | | | | | | | | [ci skip]
| * | | | | | | Improve performance of sorting milestone issuesYorick Peterse2015-10-191-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cuts down the time it takes to sort issues of a milestone by about 10x. In the previous setup the code would run a SQL query for every issue that had to be sorted. The new setup instead runs a single SQL query to update all the given issues at once. The attached benchmark used to run at around 60 iterations per second, using the new setup this hovers around 600 iterations per second. Timing wise a request to update a milestone with 40-something issues would take about 760 ms, in the new setup this only takes about 130 ms. Fixes #3066
| * | | | | | | Merge branch 'hanloong/gitlab-ce-remove-forks-from-projects-settings' into ↵Douwe Maan2015-10-191-1/+2
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'master' Add ability to remove the fork relationship from project settings ![Screen_Shot_2015-10-18_at_12.37.24](/uploads/676571642a4c90f7f286280d714599a3/Screen_Shot_2015-10-18_at_12.37.24.png) ![Screen_Shot_2015-10-18_at_12.37.28](/uploads/1a069ecfc4cd3b5438772a9c3f04b6fc/Screen_Shot_2015-10-18_at_12.37.28.png) Replaces !1579. Fixes #2578. See merge request !1636
| | * \ \ \ \ \ \ Merge branch 'master' into remove-forks-from-projects-settingsHan Loong Liauw2015-10-1729-231/+366
| | |\ \ \ \ \ \ \
| | * | | | | | | | Adds ability to remove the forked relationshipHan Loong Liauw2015-10-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was previously possible through the API but can now be done through the project#edit settings screen if the current user is the owner of the project. Update changelog
| * | | | | | | | | Merge branch 'cristianbica/gitlab-ce-user-project-view-files' into 'master' Dmitriy Zaporozhets2015-10-191-1/+1
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow users to select the Files view as default project view ![Screen_Shot_2015-10-17_at_19.24.01](/uploads/c3194db856f5e5e1b3493302c0a479a5/Screen_Shot_2015-10-17_at_19.24.01.png) Also shows the readme at the very bottom, like on the regular Files page. Replaces !1489. Closes #2655. See merge request !1632
| | * \ \ \ \ \ \ \ \ Merge branch 'master' into cristianbica/gitlab-ce-user-project-view-filesDouwe Maan2015-10-1738-438/+615
| | |\ \ \ \ \ \ \ \ \
| | * | | | | | | | | | Allow users to select the Files view as default project viewCristian Bica2015-10-011-1/+1
| | | | | | | | | | | |
| * | | | | | | | | | | Merge branch 'cross-reference-mr-on-issues' into 'master' Douwe Maan2015-10-183-4/+18
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Show merge requests which close current issue Closes #2903 ### What does this MR do If an issue is to be closed by a merge request the current user has access to, this will be displayed when the user looks at the issue. ![Screenshot_from_2015-10-12_12-10-37](https://gitlab.com/zj/gitlab-ce/uploads/52e429704e73067b24b69801f13ad7bc/Screenshot_from_2015-10-12_12-10-37.png) /cc @DouweM See merge request !1569
| | * \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into cross-reference-mr-on-issueszj/gitlab-ce-cross-reference-mr-on-issuesZeger-Jan van de Weg2015-10-162-1/+6
| | |\ \ \ \ \ \ \ \ \ \ \ | | | | |_|_|_|/ / / / / / | | | |/| | | | | | | | |
| | * | | | | | | | | | | Only accept open issues and merge requestsZeger-Jan van de Weg2015-10-163-9/+9
| | | | | | | | | | | | |
| | * | | | | | | | | | | Show merge requests which close current issueZeger-Jan van de Weg2015-10-162-0/+14
| | | | | | | | | | | | |
* | | | | | | | | | | | | Validate admin notification email.Douwe Maan2015-10-181-0/+4
|/ / / / / / / / / / / /