summaryrefslogtreecommitdiff
path: root/app/models/merge_request.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* 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
* 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.
* Fetch to mr code from fork to iidDmitriy Zaporozhets2015-08-071-1/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Huge refactoring for accepting merge requestsDmitriy Zaporozhets2015-07-161-13/+12
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Refactor compare and fetch logicDmitriy Zaporozhets2015-07-151-0/+8
|
* Implement merge from forks without satellitesDmitriy Zaporozhets2015-07-151-7/+12
|
* Remove satellitesDmitriy Zaporozhets2015-07-151-3/+3
|
* Refactor can_be_merged logic for merge requestDmitriy Zaporozhets2015-07-011-7/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Merge branches inside one repository using rugged instead of satellitesDmitriy Zaporozhets2015-07-011-1/+14
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Revert merge request states renamingDmitriy Zaporozhets2015-06-191-5/+13
| | | | | | | | Replaced: * "Accepted" with "Merged" * "Rejected" with "Closed" Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Improve variables in mr widgetDmitriy Zaporozhets2015-06-111-0/+4
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Refactor accept merge request widgetDmitriy Zaporozhets2015-06-111-0/+8
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Support editing target branch of merge requestStan Hu2015-05-291-1/+0
| | | | | Closes https://github.com/gitlabhq/gitlabhq/issues/7105 See: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/130
* Merge branch 'accepted-rejected-mrs' into 'master'Dmitriy Zaporozhets2015-05-271-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Accepted and Rejected tabs to MR lists. Before, MRs were referred to as Merged or Closed, but the Merge button on the MR page read "Accept Merge Request", the activity feed even read "X accepted merge request Y", and the Closed tab on the MR index included both Merged _and_ Closed MRs. I've changed every occurrence to consistently refer to MRs as either Accepted or Rejected, which is less technical and more clearly two opposites. ![Screen_Shot_2015-05-25_at_17.02.31](https://gitlab.com/gitlab-org/gitlab-ce/uploads/b0bf43aa1b5b9898a1c6b204dbcf669a/Screen_Shot_2015-05-25_at_17.02.31.png) ![Screen_Shot_2015-05-25_at_17.02.47](https://gitlab.com/gitlab-org/gitlab-ce/uploads/2ac05b1e1dba3b2d1692bd9242078f3a/Screen_Shot_2015-05-25_at_17.02.47.png) ![Screen_Shot_2015-05-25_at_17.03.03](https://gitlab.com/gitlab-org/gitlab-ce/uploads/4c0f0fa869c9130a6af18d80a1c6ebed/Screen_Shot_2015-05-25_at_17.03.03.png) Addresses internal issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2201. See merge request !702
| * Consistently refer to MRs as either Accepted or Rejected.Douwe Maan2015-05-251-1/+1
| |
* | Surround Project.reference_pattern in parenthesis inside other patternsRobert Speicher2015-05-261-1/+1
| |
* | Add `reference_pattern` to Referable modelsRobert Speicher2015-05-261-0/+10
| |
* | Implement gfm_reference directly in MentionableRobert Speicher2015-05-261-5/+0
| | | | | | | | Except for Note, which still overrides it.
* | Add `to_reference` for models that support referencesRobert Speicher2015-05-261-3/+18
|/ | | | | Now there is a single source of information for which attribute a model uses to be referenced, and its special character.
* Don't allow a merge request to be merged when its title starts with "WIP".Douwe Maan2015-04-301-0/+18
|
* Select MR commit notes from source project.Douwe Maan2015-04-241-3/+6
|
* No longer needed to pass project argument to commit methods.Douwe Maan2015-04-241-2/+2
|
* fix stuck mrBen Bodenmiller2015-04-141-1/+3
| | | | fixes #348. related to 6487419364fa9c179e24028d85b2be10d574067f.
* Refactor ClosingIssueExtractor.Douwe Maan2015-04-031-2/+2
|
* Only allow users to cross-reference and close issues they have access to.Douwe Maan2015-04-021-3/+3
|
* Don't mark merge request as updated when merge status relative to target ↵merge-status-without-timestampsDouwe Maan2015-03-231-0/+9
| | | | branch changes.
* Update merge_status state to allow more transitionsDJ Mountney2015-03-191-2/+2
| | | | Previously you could only transition from the unchecked state to one of the others. This meant that the mark_as_unmerged call in AutoMergeService would rarily be able to actually transition the state. As it would usually have already been set to can_be_merged before it hit that service.
* Remove old team scopes.Douwe Maan2015-03-151-1/+0
|
* Fix method overlap for issue sortingDmitriy Zaporozhets2015-02-051-0/+1
|
* Convert hashes to ruby 1.9 styleDmitriy Zaporozhets2015-02-021-1/+1
|
* Annotate modelsDmitriy Zaporozhets2015-01-221-0/+1
|
* Merge pull request #7999 from cirosantilli/append-inplaceDmitriy Zaporozhets2015-01-211-1/+2
|\ | | | | Append in place for strings and arrays [failure unrelated]
| * Append in place for strings and arraysCiro Santilli2015-01-011-1/+2
| |
* | Fix various typosSteven Burgart2015-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | signe-in -> signed-in go_to_gihub_for_permissions -> go_to_github_for_permissions descendand -> descendant behavour -> behaviour recepient_email -> recipient_email generate_fingerpint -> generate_fingerprint dependes -> depends Cant't -> Can't wisit -> visit notifcation -> notification sufficent_scope -> sufficient_scope? levet -> level
* | Refactor merge request merge serviceDmitriy Zaporozhets2015-01-061-1/+3
|/ | | | | * Add system note when user merges MR in same way as it closes it * Remove duplicating code