summaryrefslogtreecommitdiff
path: root/app/models/merge_request.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'merge-request-closes-issues-performance' into 'master'Robert Speicher2016-02-011-4/+4
|\ | | | | | | | | | | | | | | Optimize fetching issues closed by a merge request Related issue: #12419 See merge request !2625
| * Optimize fetching issues closed by a merge requestmerge-request-closes-issues-performanceYorick Peterse2016-02-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of running ClosingIssueExtractor for every commit in a merge request we can gather all the commit messages (and the merge request description), concatenate all this together and then run ClosingIssueExtractor only once. The result of this is that MergeRequest#closes_issues is now between 3.5x and 4x faster than the old setup. Using a merge request with 10 commits (each referencing a number of issues to close) this reduced the call duration from around 200 milliseconds to around 50 milliseconds. As a result of these changes the Jira related tests for MergeRequest#closes_issues have been removed. These tests stubbed Commit#closes_issues meaning that the only code that was really tested was the call to Array#uniq to filter out duplicate issues. As this code is no longer used (nor present) the corresponding tests were removed. Related: gitlab-org/gitlab-ce#12419
* | Fix specsDouwe Maan2016-01-281-2/+2
| |
* | Correctly determine MR diff base when MR has merge conflictsDouwe Maan2016-01-271-2/+2
|/
* Save and use actual diff base commit for MR diff highlightingDouwe Maan2016-01-201-3/+12
|
* Fix MR diff_refsDouwe Maan2016-01-201-2/+2
|
* Check if MR is not broken.Rubén Dávila2016-01-191-1/+1
|
* Merge branch 'master' into issue_3945Rubén Dávila2016-01-141-28/+34
|\
| * Merge branch 'group-issues-sorting' into 'master' Dmitriy Zaporozhets2016-01-111-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve performance of getting issues on group level For testing I used the URL http://localhost:3000/groups/gitlab-org/issues?milestone_title=8.1. Prior to these changes said URL would take about 10-12 seconds to load. By applying these changes the loading time has been reduced to roughly 2-3 seconds. There's still some stuff going on in some views that I have to look at, resolving those changes might reduce the loading time a bit more. I also still have to check if I didn't break too many tests. Fixes: gitlab-org/gitlab-ce#3707 gitlab-org/gitlab-ce#4071 See merge request !2318
| | * Removed ORDER BY in "of_group" scopesgroup-issues-sortingYorick Peterse2016-01-071-1/+1
| | | | | | | | | | | | | | | These scopes don't care about the order. Removing the explicit "ORDER BY" can speed up the queries by a little bit.
| | * Don't pluck IDs when getting issues/MRs per groupYorick Peterse2016-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | This replaces plucking of IDs with a sub-query, saving the overhead of loading the data in Ruby and then mapping the rows to an Array of IDs. This also scales much better when dealing with a large amount of IDs that would be involved.
| * | Merge branch 'annotate-models-20160105' into 'master' Dmitriy Zaporozhets2016-01-071-22/+22
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | Annotate models Time to refresh the comments via `annotate`. See merge request !2311
| | * Annotate modelsStan Hu2016-01-061-22/+22
| | |
| * | Get "Merge when build succeeds" to work when commits were pushed to MR ↵Douwe Maan2016-01-051-5/+11
| |/ | | | | | | target branch while builds were running
* | More refactoring from last code review. #3945Rubén Dávila2016-01-141-0/+4
|/ | | | | | * Use commit objects instead of IDs when generating diffs * Use proper references when generating MR's source and target * Update broken specs
* Backport JIRA serviceDrew Blessing2015-12-181-1/+1
|
* Fixed Rubocop offensesGabriel Mazetto2015-12-151-3/+1
|
* Merge remote-tracking branch 'origin/mr-broken'Dmitriy Zaporozhets2015-12-091-0/+4
|\ | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Add indication to merge request list item that MR cannot be merged automaticallyDouwe Maan2015-12-081-0/+4
| |
* | Merge branch 'master' into zj/gitlab-ce-merge-if-greenDouwe Maan2015-12-081-1/+1
|\ \ | |/
| * Merge branch 'webhook_payload_with_changes' into 'master' Valery Sizov2015-12-071-1/+1
| |\ | | | | | | | | | | | | | | | | | | Add added, modified and removed properties to commit object in webhook https://gitlab.com/gitlab-org/gitlab-ee/issues/20 See merge request !1988
| | * fox specsValery Sizov2015-12-071-1/+1
| | |
* | | Merge branch 'master' into merge-if-greenZeger-Jan van de Weg2015-12-071-2/+9
|\ \ \ | |/ /
| * | Autolink first so we don't pick up numeric anchors as issue references.Douwe Maan2015-12-011-5/+2
| | |
| * | Recognize issue/MR/snippet/commit links as references.Douwe Maan2015-11-301-2/+9
| | |
| * | Show local issues and MRs in "This X closes... / closed by..." sentenceDouwe Maan2015-11-301-1/+1
| |/
| * Handle removed source projects in MR CI commitsfix-merge-requests-without-source-projectsYorick Peterse2015-11-201-1/+1
| | | | | | | | | | | | | | | | When calling MergeRequest#ci_commit the code would previously raise an error if the source project no longer existed (e.g. because the user removed their fork). See #3599 for more information.
| * Use a JOIN in IssuableFinder#by_projectYorick Peterse2015-11-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using IssuableFinder/IssuesFinder to find issues for multiple projects it's more efficient to use a JOIN + a "WHERE project_id IN" condition opposed to running a sub-query. This change means that when finding issues without labels we're now using the following SQL: SELECT issues.* FROM issues JOIN projects ON projects.id = issues.project_id LEFT JOIN label_links ON label_links.target_type = 'Issue' AND label_links.target_id = issues.id WHERE ( projects.id IN (...) OR projects.visibility_level IN (20, 10) ) AND issues.state IN ('opened','reopened') AND label_links.id IS NULL ORDER BY issues.id DESC; instead of: SELECT issues.* FROM issues LEFT JOIN label_links ON label_links.target_type = 'Issue' AND label_links.target_id = issues.id WHERE issues.project_id IN ( SELECT id FROM projects WHERE id IN (...) OR visibility_level IN (20,10) ) AND issues.state IN ('opened','reopened') AND label_links.id IS NULL ORDER BY issues.id DESC; The big benefit here is that in the last case PostgreSQL can't properly use all available indexes. In particular it ends up performing a sequence scan on the "label_links" table (processing around 290 000 rows). The new query is roughly 2x as fast as the old query.
* | Incorporate feedbackZeger-Jan van de Weg2015-12-051-22/+24
| |
* | Specs for 'Merge When Build Succeeds'Zeger-Jan van de Weg2015-12-021-7/+6
| |
* | Refactor MergeWhenBuildSucceedsService and incorporate feedbackZeger-Jan van de Weg2015-11-231-2/+9
| |
* | Merge branch 'master' into merge-if-greenZeger-Jan van de Weg2015-11-181-1/+2
|\ \ | |/
| * Annotate modelsDmitriy Zaporozhets2015-11-131-0/+1
| | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
| * Add ignore white space option in merge request diffMinsik Yoon2015-11-131-1/+1
| | | | | | | | | | | | fix this issue(https://gitlab.com/gitlab-org/gitlab-ce/issues/1393). Add ignore whitespace optoin to Commits Compare view
* | API support, incorporated feedbackZeger-Jan van de Weg2015-11-181-1/+5
| |
* | Merge when build succeedsZeger-Jan van de Weg2015-11-021-0/+13
|/
* Render CI status on merge requests index pageDmitriy Zaporozhets2015-10-231-2/+8
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* 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
* Correctly find last known blob for file deleted in MR.merge-request-deleted-fileDouwe Maan2015-10-201-1/+13
|
* Only accept open issues and merge requestsZeger-Jan van de Weg2015-10-161-4/+0
|
* Show merge requests which close current issueZeger-Jan van de Weg2015-10-161-0/+4
|
* merge_request: add work_in_progress to MR hooksBen Boeckel2015-10-081-1/+2
|
* merge_request: coerce work_in_progress? into a booleanBen Boeckel2015-10-081-1/+1
|
* Fetch merge request ref if it is missing when visit MR pagefix-mr-without-refsDmitriy Zaporozhets2015-09-211-1/+13
| | | | | | | This will fix merge problem for merge requests between forks created before 8.0 Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Re-annotate modelsStan Hu2015-09-061-0/+1
|
* Revert "Merge branch 'revert-satellites' into 'master' "Dmitriy Zaporozhets2015-08-111-20/+35
| | | | | This reverts commit 5daf44b7c86e0e2641a902b1da8b01d91fa3dbfa, reversing changes made to 2f706fbd231cabe7a76a5d17ac44285aaaf8592c.
* Revert "Merge branches inside one repository using rugged instead of satellites"Dmitriy Zaporozhets2015-08-111-14/+1
| | | | This reverts commit d24c40ec219d76e01e2fab5f6ebf431adae91bdd.
* Revert "Merge branch 'refactor-can-be-merge' into 'master'"Dmitriy Zaporozhets2015-08-111-1/+7
| | | | | | | This reverts commit 459e6d346768d9d8fceaee00bf0870b8e7c4ed9a, reversing changes made to 804168e1def1204af712febb229f41a3865f085f. Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Revert "Merge branch 'drop-satellites'"Dmitriy Zaporozhets2015-08-111-32/+24
| | | | | | | This reverts commit 957e849f41d96fa9778fcdd06792d2f0274b29ab, reversing changes made to 6b9dbe9f5a175a8162abf296367f561bab3eea1a. Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Revert "Merge branch 'improve-merge-requests' into 'master' "Dmitriy Zaporozhets2015-08-111-1/+1
| | | | | This reverts commit 4773f38e28c91dbbb6e5e385e0c403877298bfed, reversing changes made to 0d5d80b735eb18ae79eb2bfe26c08896d53db414.