summaryrefslogtreecommitdiff
path: root/app/models/merge_request.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add changelog entry, improve specs and model codeissue_15044Felipe Artur2016-04-121-9/+4
|
* Allow to close invalid merge requestFelipe Artur2016-04-111-2/+7
|
* Merge branch 'fix_remove_fork_link' into 'master' Douwe Maan2016-04-041-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove fork link closes all merge requests opened on source project Currently, if you: - create a fork - open a merge request on the source project - remove the fork link The created MR cannot be closed. With this MR, all pending MR is closed when the fork link is removed. See merge request !3189
| * Merge branch 'master' into fix_remove_fork_linkBaldinof2016-03-141-1/+18
| |\
| * | Close merge requests when removing fork relationBaldinof2016-03-111-0/+1
| | |
* | | Memoize reference_pattern/link_reference_patternmemoize-pattern-methodsYorick Peterse2016-04-011-2/+2
| | | | | | | | | | | | | | | These methods are called quite often in loops so by memoizing their output we can reduce timings a bit.
* | | We need `sha` reference from `diff_base_commit` to generate the diffGabriel Mazetto2016-03-291-2/+2
| | |
* | | Use `diff_base_commit` instead of `target_branch` to generate diffsGabriel Mazetto2016-03-291-4/+4
| | |
* | | Ensuring Merge Request API returns boolean values for work_in_progressAbhi Rao2016-03-281-1/+1
| | | | | | | | | | | | Fixes #14692
* | | Fix group project selection in IssuableFinderDouwe Maan2016-03-201-1/+0
| | |
* | | Merge remote-tracking branch 'origin/master' into remove-wipRémy Coutable2016-03-181-8/+66
|\ \ \
| * | | Add a safeguard in MergeRequest#compute_diverged_commits_countRémy Coutable2016-03-181-1/+4
| | | | | | | | | | | | | | | | | | | | We have to ensure source_sha and target_sha are not nil before calling Gitlab::Git::Commit.between.
| * | | Fix MergeRequest#source_sha when there is no diffPierre de La Morinerie2016-03-161-1/+5
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `MergeRequest#source_sha` is expected to return the sha of the source branch last commit. But when a open Merge Request has no diff (e.g. all commits have already been merged to the target branch), `merge_request.source_sha` incorrectly returns `nil`. This was un-noticed before – but now that !2217 has been merged, it makes `Gitlab::Git::Commit.between` raise an "Unexpected nil argument" exception. This fixes the crash, by making sure that `source_sha` returns a correct result even when there is no diff available.
| * | Use a UNION in MergeRequest.in_projectsYorick Peterse2016-03-111-1/+18
| |/ | | | | | | | | | | | | | | The OR condition for source_project_id/target_project_id leads to a query plan that performs rather poorly on PostgreSQL due to the use of sub-queries. Because Rails offers no easy alternative for this particular problem we're forced to using a UNION for both conditions. The resulting query performs much faster than just using an OR.
| * Merge branch 'issue_13621_2' into 'master' Douwe Maan2016-03-071-2/+0
| |\ | | | | | | | | | | | | | | | | | | Labels should be visible in dashboard and group milestone views Closes #13621 See merge request !2931
| | * Updates from last code review.issue_13621_2Rubén Dávila2016-03-061-1/+0
| | |
| | * Refactor GlobalMilestone queries.Rubén Dávila2016-03-041-1/+0
| | | | | | | | | | | | Make methods return ActiveRecord Relations instead of Arrays.
| * | Merge branch 'indicate-mr-diverged-from-target' into 'master' Douwe Maan2016-03-071-0/+23
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Indicate when an MR diverged from the target branch This adds an indicator to the "Merge MR" box, to tell if and how much an MR diverged from its target branch. For instance, consider an MR to merge the branch `feature` into `master`. Some other commits were added to `master` since `feature` was created, and the two branches diverged. ```text o master | o o feature | | o o | / o ``` In this case, there will be a label in the MR Merge box stating: > This MR is by 3 commits behind the target branch `master`. ## Screenshots ### The branch diverged from the target (UI Proposal) ![UI_suggestion_1](/uploads/cd5bee3959e68026ec7d5097259d53f4/UI_suggestion_1.png) ### The branch diverged from the target (alternative UI Proposal) ![UI_suggestion_2](/uploads/f36977101b59a610850e129837dfbc83/UI_suggestion_2.png) ## How is this useful? - In a _rebase-workflow_ (MR are preferably rebased before being merged), the reviewer wants to know if an MR is rebased on the target branch before merging it. _With this indicator, the reviewer knows immediately if the branch is rebased, or if she needs to ask the committer to rebase its branch._ <br> - To keep the git history readable, a team prefers to avoid merging branches that really lag a lot behind the target branch. Merging an MR that is 10 commits behind is fine, but 200 is too much. _With this indicator, the reviewer can see on the MR page if the branch is really far behind the target – or only a few commits behind._ ## Open questions We've been using this at @captaintrain for a few months now, and found it quite useful. I guess the open-questions are mostly: what UI would be the more adequate? Any thoughts on this, on the general usefulness and/or on the code? See merge request !2217
| | * | Indicate how much an MR branch diverges from the target branchPierre de La Morinerie2016-03-031-0/+23
| | | |
| * | | Change icons for open close on issue/MRJacob Schatz2016-03-041-0/+10
| | |/ | |/| | | | | | | Button full width on phone on MR/issue.
| * | Use Gitlab::Git::DiffCollectionsJacob Vosmaer2016-03-031-3/+6
| |/
* | Improve the "easy WIP & un-WIP from link" featureRémy Coutable2016-03-181-1/+1
| |
* | Use specialized system notes when MR is (un)marked as WIPDouwe Maan2016-02-261-1/+7
|/
* More updates from the last code review.Rubén Dávila2016-02-191-4/+2
|
* Don't show revert button if commit/MR has already been reverted.Rubén Dávila2016-02-191-0/+10
|
* Remove no longer required methods on MR.Rubén Dávila2016-02-191-12/+0
|
* Some updates from last code review.Rubén Dávila2016-02-191-2/+2
|
* Add some specs plus some refactor.Rubén Dávila2016-02-191-0/+8
|
* Use #iid for revert branch name so it's consistent when the MR id in the URL.Rubén Dávila2016-02-191-1/+1
|
* Some refactor to the revert commit creation.Rubén Dávila2016-02-191-1/+1
| | | | * Not required to run hooks since it's an internal commit
* Add merge_commit_sha column to merge_requests.Rubén Dávila2016-02-191-0/+1
|
* Create reverse branch and generate MR with new branch. #3409Rubén Dávila2016-02-191-0/+4
|
* Reopened MRs should also be considered as open.issue_13539Rubén Dávila2016-02-171-1/+1
|
* Don't try to mark broken MR as mergableNemanja Boric2016-02-111-1/+1
| | | | | | In case merge request is broken, we shouldn't check if the sha is mergable, as it will be null, and there's no point, as we know that it's not mergable.
* Replaces "Create merge request" link with one to the MR when one existsDouglas Barbosa Alexandre2016-02-101-0/+1
|
* Merge branch 'disable-remove-source-branch' into 'master' Douwe Maan2016-02-041-1/+2
|\ | | | | | | | | | | | | | | | | | | | | Hide remove source branch button when new commit is added to branch Fixes #3339 This MR hides the 'Remove source branch' button when a new commit is added to the source branch /cc @DouweM See merge request !2701
| * Hide remove source branch button when new commit is added to branchZeger-Jan van de Weg2016-02-041-1/+2
| | | | | | | | | | | | Fixes #3339 This MR hides the 'Remove source branch' button when a new commit is added to the source branch
* | Merge branch 'wipMergeSpacing' into 'master' Douwe Maan2016-02-041-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | No space required after WIP identifier Fixes #2426 Currently, the WIP: (or any other variation) prefix of a merge request title must include a trailing space for it to be recognized as a work in progress and prevent merging. To resolve this, I added an or pattern to the regexp to look for any one of the three possible delimiters ':', ']', or ' '. This way the trailing space isn't required but it still won't mark any titles beginning with wip as work in progress (e.g. "Wipwap"). See merge request !1876
| * Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into wipMergeSpacingTed Hogan2015-12-291-27/+58
| |\
| * | No space required after WIP identifierTed Hogan2015-11-231-1/+1
| | | | | | | | | | | | Modified changelog
* | | 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.