Commit Graph

1239 Commits

Author SHA1 Message Date
Rubén Dávila 0b7d70a35e Use #iid for revert branch name so it's consistent when the MR id in the URL. 2016-02-19 13:14:49 -05:00
Rubén Dávila 207522f923 Some refactor to the revert commit creation.
* Not required to run hooks since it's an internal commit
2016-02-19 13:14:49 -05:00
Rubén Dávila 720e52d9d9 Add merge_commit_sha column to merge_requests. 2016-02-19 13:14:48 -05:00
Rubén Dávila d7511a4b04 Create reverse branch and generate MR with new branch. #3409 2016-02-19 13:14:48 -05:00
Rubén Dávila 2770de9617 Reopened MRs should also be considered as open. 2016-02-17 21:15:13 -05:00
Nemanja Boric 8172d5ca54 Don't try to mark broken MR as mergable
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.
2016-02-11 00:38:07 +01:00
Douglas Barbosa Alexandre 1353cff5fe Replaces "Create merge request" link with one to the MR when one exists 2016-02-10 10:32:25 -02:00
Douwe Maan b5befc734b Merge branch 'disable-remove-source-branch' into 'master'
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
2016-02-04 11:56:58 +00:00
Zeger-Jan van de Weg c6e0228ca9 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
2016-02-04 11:56:23 +01:00
Douwe Maan a1fa973123 Merge branch 'wipMergeSpacing' into 'master'
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
2016-02-04 09:49:54 +00:00
Robert Speicher f8052310ad Merge branch 'merge-request-closes-issues-performance' into 'master'
Optimize fetching issues closed by a merge request

Related issue: #12419

See merge request !2625
2016-02-01 15:32:58 -05:00
Yorick Peterse 99492d6b8d Optimize fetching issues closed by a merge request
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
2016-02-01 11:04:05 +01:00
Douwe Maan 30b0d06e9f Fix specs 2016-01-28 15:10:48 +01:00
Douwe Maan 5cce1278ad Correctly determine MR diff base when MR has merge conflicts 2016-01-27 17:23:59 +01:00
Douwe Maan 577f2fb47a Save and use actual diff base commit for MR diff highlighting 2016-01-20 18:44:27 +01:00
Douwe Maan 987e3d94b0 Fix MR diff_refs 2016-01-20 15:40:49 +01:00
Rubén Dávila c7264d2a76 Check if MR is not broken. 2016-01-19 11:40:43 -05:00
Rubén Dávila c8db25c37c Merge branch 'master' into issue_3945 2016-01-14 17:28:44 -05:00
Rubén Dávila 6b9c730e91 More refactoring from last code review. #3945
* Use commit objects instead of IDs when generating diffs
* Use proper references when generating MR's source and target
* Update broken specs
2016-01-14 16:47:55 -05:00
Dmitriy Zaporozhets 5500f9159f Merge branch 'group-issues-sorting' into 'master'
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
2016-01-11 15:28:41 +00:00
Dmitriy Zaporozhets 3c93e588e9 Merge branch 'annotate-models-20160105' into 'master'
Annotate models

Time to refresh the comments via `annotate`.


See merge request !2311
2016-01-07 18:22:32 +00:00
Yorick Peterse 19a0db30ba Removed ORDER BY in "of_group" scopes
These scopes don't care about the order. Removing the explicit "ORDER
BY" can speed up the queries by a little bit.
2016-01-07 15:34:37 +01:00
Yorick Peterse 0d0049c058 Don't pluck IDs when getting issues/MRs per group
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.
2016-01-07 14:53:02 +01:00
Stan Hu 79c0e7212a Annotate models 2016-01-06 13:09:55 +00:00
Douwe Maan 097faeb481 Get "Merge when build succeeds" to work when commits were pushed to MR target branch while builds were running 2016-01-05 16:30:03 +01:00
Ted Hogan 9fc6df512b Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into wipMergeSpacing 2015-12-29 11:25:46 -07:00
Drew Blessing f177aaa5fa Backport JIRA service 2015-12-18 14:19:48 -06:00
Gabriel Mazetto b5291f9599 Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
Dmitriy Zaporozhets 7a4d468576
Merge remote-tracking branch 'origin/mr-broken'
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-09 21:06:04 +01:00
Douwe Maan f66454beaa Add indication to merge request list item that MR cannot be merged automatically 2015-12-08 21:43:11 +01:00
Douwe Maan 75486f09c4 Merge branch 'master' into zj/gitlab-ce-merge-if-green 2015-12-08 13:43:45 +01:00
Valery Sizov bd5fb1b479 Merge branch 'webhook_payload_with_changes' into 'master'
Add added, modified and removed properties to commit object in webhook

https://gitlab.com/gitlab-org/gitlab-ee/issues/20

See merge request !1988
2015-12-07 14:43:13 +00:00
Valery Sizov 5df2c4419c fox specs 2015-12-07 14:14:35 +02:00
Zeger-Jan van de Weg 0e96d6eb10 Merge branch 'master' into merge-if-green 2015-12-07 10:06:07 +01:00
Zeger-Jan van de Weg 2462a96e45 Incorporate feedback 2015-12-05 15:42:38 +01:00
Zeger-Jan van de Weg a7682f8775 Specs for 'Merge When Build Succeeds' 2015-12-02 13:27:16 +01:00
Douwe Maan f3ea06eb7f Autolink first so we don't pick up numeric anchors as issue references. 2015-12-01 15:53:32 +01:00
Douwe Maan d6a5b45c8e Recognize issue/MR/snippet/commit links as references. 2015-11-30 21:36:34 +01:00
Douwe Maan 8f43298d96 Show local issues and MRs in "This X closes... / closed by..." sentence 2015-11-30 21:09:36 +01:00
Ted Hogan 6e6a99061d No space required after WIP identifier
Modified changelog
2015-11-23 11:52:43 -07:00
Zeger-Jan van de Weg 8608c6325e Refactor MergeWhenBuildSucceedsService and incorporate feedback 2015-11-23 10:11:54 +01:00
Yorick Peterse d496a6b919 Handle removed source projects in MR CI commits
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.
2015-11-20 23:43:10 +01:00
Yorick Peterse 8591cc02be Use a JOIN in IssuableFinder#by_project
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.
2015-11-19 11:58:05 +01:00
Zeger-Jan van de Weg 53b285c9a8 Merge branch 'master' into merge-if-green 2015-11-18 11:58:01 +01:00
Zeger-Jan van de Weg 2f048df4a4 API support, incorporated feedback 2015-11-18 11:17:41 +01:00
Dmitriy Zaporozhets a237999f00
Annotate models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-11-13 19:22:46 +01:00
Minsik Yoon 3d0efa8e0a Add ignore white space option in merge request diff
fix this issue(https://gitlab.com/gitlab-org/gitlab-ce/issues/1393).

Add ignore whitespace optoin to Commits Compare view
2015-11-13 16:53:53 +09:00
Zeger-Jan van de Weg 77f8a1e392 Merge when build succeeds 2015-11-02 17:27:38 +01:00
Dmitriy Zaporozhets fe6ec80e75
Render CI status on merge requests index page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-23 17:01:10 +02:00
Valery Sizov 95df86638d Fix: Inability to reply to code comments in the MR view, if the MR comes from a fork 2015-10-22 18:38:00 +02:00
Douwe Maan 8710739e4e Correctly find last known blob for file deleted in MR. 2015-10-20 14:24:02 +02:00
Zeger-Jan van de Weg 94a788f66d Only accept open issues and merge requests 2015-10-16 09:59:32 +02:00
Zeger-Jan van de Weg 9f9f0c35ec Show merge requests which close current issue 2015-10-16 09:46:59 +02:00
Ben Boeckel 6b73902733 merge_request: add work_in_progress to MR hooks 2015-10-08 16:37:04 -04:00
Ben Boeckel 380392212f merge_request: coerce work_in_progress? into a boolean 2015-10-08 10:08:08 -04:00
Dmitriy Zaporozhets 3a001a9290
Fetch merge request ref if it is missing when visit MR page
This will fix merge problem for merge requests between forks created
before 8.0

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-09-21 16:25:59 +02:00
Stan Hu d7812a95cf Re-annotate models 2015-09-06 07:48:48 -07:00
Dmitriy Zaporozhets 3e259ea8bc Revert "Merge branch 'revert-satellites' into 'master' "
This reverts commit 5daf44b7c8, reversing
changes made to 2f706fbd23.
2015-08-11 14:33:31 +02:00
Dmitriy Zaporozhets 3b02ad8467 Revert "Merge branches inside one repository using rugged instead of satellites"
This reverts commit d24c40ec21.
2015-08-11 10:50:39 +02:00
Dmitriy Zaporozhets 32046983ad
Revert "Merge branch 'refactor-can-be-merge' into 'master'"
This reverts commit 459e6d3467, reversing
changes made to 804168e1de.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 10:48:02 +02:00
Dmitriy Zaporozhets 9f10943c1a
Revert "Merge branch 'drop-satellites'"
This reverts commit 957e849f41, reversing
changes made to 6b9dbe9f5a.

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-11 10:28:42 +02:00
Dmitriy Zaporozhets 84727fba96 Revert "Merge branch 'improve-merge-requests' into 'master' "
This reverts commit 4773f38e28, reversing
changes made to 0d5d80b735.
2015-08-11 10:26:19 +02:00
Dmitriy Zaporozhets 8dce66234f
Fetch to mr code from fork to iid
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-08-07 12:35:04 +02:00
Dmitriy Zaporozhets a7fded9b95
Huge refactoring for accepting merge requests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-16 16:03:07 +02:00
Dmitriy Zaporozhets 26f5d6047d Refactor compare and fetch logic 2015-07-15 17:28:09 +02:00
Dmitriy Zaporozhets 2a6f522cac Implement merge from forks without satellites 2015-07-15 16:45:50 +02:00
Dmitriy Zaporozhets a87989fb7d Remove satellites 2015-07-15 15:45:57 +02:00
Dmitriy Zaporozhets 2e6bbb12f8
Refactor can_be_merged logic for merge request
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-01 17:24:03 +02:00
Dmitriy Zaporozhets d24c40ec21
Merge branches inside one repository using rugged instead of satellites
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-07-01 16:23:58 +02:00
Dmitriy Zaporozhets 7524d7c082 Revert merge request states renaming
Replaced:
* "Accepted" with "Merged"
* "Rejected" with "Closed"

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-19 17:09:50 +02:00
Dmitriy Zaporozhets 946b4ceda3
Improve variables in mr widget
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-11 18:45:12 +02:00
Dmitriy Zaporozhets 644b6ba993
Refactor accept merge request widget
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-11 09:40:26 +02:00
Stan Hu 5e4384ec9b Support editing target branch of merge request
Closes https://github.com/gitlabhq/gitlabhq/issues/7105
See: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/130
2015-05-29 04:08:08 -07:00
Dmitriy Zaporozhets 9eec0d5436 Merge branch 'accepted-rejected-mrs' into 'master'
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
2015-05-27 11:40:36 +00:00
Robert Speicher 1a9da9178c Surround Project.reference_pattern in parenthesis inside other patterns 2015-05-26 15:49:22 -04:00
Robert Speicher b88da58cb6 Add `reference_pattern` to Referable models 2015-05-26 15:48:32 -04:00
Robert Speicher 0359d41b06 Implement gfm_reference directly in Mentionable
Except for Note, which still overrides it.
2015-05-26 15:48:31 -04:00
Robert Speicher c0faf91ff2 Add `to_reference` for models that support references
Now there is a single source of information for which attribute a model
uses to be referenced, and its special character.
2015-05-26 15:48:30 -04:00
Douwe Maan ebe9c89082 Consistently refer to MRs as either Accepted or Rejected. 2015-05-25 17:01:14 +02:00
Douwe Maan 7e0eb486ed Don't allow a merge request to be merged when its title starts with "WIP". 2015-04-30 15:46:36 +02:00
Douwe Maan 4f2e4c7656 Select MR commit notes from source project. 2015-04-24 12:30:37 +02:00
Douwe Maan 27af24c1c9 No longer needed to pass project argument to commit methods. 2015-04-24 12:29:36 +02:00
Ben Bodenmiller f517dd2606 fix stuck mr
fixes #348. related to 6487419364.
2015-04-14 23:11:13 -07:00
Douwe Maan e33ddfebf2 Refactor ClosingIssueExtractor. 2015-04-03 18:03:26 +02:00
Douwe Maan 65bb0c3406 Only allow users to cross-reference and close issues they have access to. 2015-04-02 10:57:01 +02:00
Douwe Maan 70fa9d5629 Don't mark merge request as updated when merge status relative to target branch changes. 2015-03-23 17:30:19 +01:00
DJ Mountney 415517918e Update merge_status state to allow more transitions
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.
2015-03-19 13:51:16 -07:00
Douwe Maan e97cdb042d Remove old team scopes. 2015-03-15 13:50:38 +01:00
Dmitriy Zaporozhets e0aa5c371e Fix method overlap for issue sorting 2015-02-05 16:49:41 -08:00
Dmitriy Zaporozhets 4f1d1fc51b Convert hashes to ruby 1.9 style 2015-02-02 19:30:09 -08:00
Dmitriy Zaporozhets 98ee4a1fa7 Annotate models 2015-01-22 09:40:03 -08:00
Dmitriy Zaporozhets 2b10520b30 Merge pull request #7999 from cirosantilli/append-inplace
Append in place for strings and arrays [failure unrelated]
2015-01-21 23:07:15 -08:00
Steven Burgart 5c80160218 Fix various typos
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
2015-01-18 10:29:37 -05:00
Dmitriy Zaporozhets ccdf08d80a Refactor merge request merge service
* Add system note when user merges MR in same way as it closes it
* Remove duplicating code
2015-01-06 16:24:47 -08:00
Ciro Santilli 33c9f05c6b Append in place for strings and arrays 2015-01-01 21:12:00 +01:00
Dmitriy Zaporozhets 6487419364
Automatically close merge requests that were locker for 1 day
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-12-05 16:02:08 +02:00
Dmitriy Zaporozhets b23f71ec4d
Set/unset merge request locked_at timestamp after transition
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-12-05 15:49:25 +02:00
Vinnie Okada 9f0083a96c Add task lists to issues and merge requests
Make the Markdown parser recognize "[x]" or "[ ]" at the beginning of a
list item and turn it into a checkbox input.  Users who can modify the
issue or MR can toggle the checkboxes directly or edit the Markdown to
manage the tasks.  Task status is also displayed in the MR and issue
lists.
2014-10-05 22:15:27 -05:00
Kirill Zaitsev 1c9d2e39c1 Hook attributes 2014-10-02 12:58:02 +04:00
jubianchi 998cd3cb63 Improve error reporting on users API
* users (#6878, #3526, #4209): Validation error messages are now exposed through 400 responses, 409 response are sent in case of duplicate email or username
* MRs (#5335): 409 responses are sent in case of duplicate merge request (source/target branches), 422 responses are sent when submiting MR fo/from unrelated forks
* issues
* labels
* projects
2014-09-16 01:25:24 +02:00
Dmitriy Zaporozhets 92deb451da
Annotate models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-08-25 12:25:02 +03:00
Dmitriy Zaporozhets d45a6b2941
Migrate issue/mr labels from act_as_taggable to own labels
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-29 19:19:26 +03:00
Dmitriy Zaporozhets ddaa493ef3
Improve MR building
* fix 500 error when no parent for initial commit
* fix link from diff files to wrong commit

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-28 20:54:40 +03:00
Jeroen van Baarsen 16eea49277 Moved some behaviour to one place
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2014-07-25 22:23:42 +02:00
Dmitriy Zaporozhets be5b6db883
Refactor diff suppress logic and diff views
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-15 18:28:21 +03:00
Dmitriy Zaporozhets 45623089e2
Refactor MR build process
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-15 15:34:06 +03:00
Christian Taedcke c1b7e904ff Add a mention of the merge request into its default commit message. 2014-07-01 21:54:19 +02:00
Dmitriy Zaporozhets 4f0bfdb500 Merge branch 'strong-parameters' into 'master'
Strong parameters

Replace protected_attributes with strong parameters.
Fixes #1340
2014-06-30 17:01:22 +00:00
Jacob Vosmaer b5007c1565 Rename MergeRequest#lock! to #lock_mr!
As a warning from the StateMachine gem points out to us, there already
exists a method ActiveRecord#lock!. This change renames the `lock` and
`unlock` events defined on MergeRequest to `lock_mr` and `unlock_mr`.
2014-06-26 14:09:17 +02:00
Dmitriy Zaporozhets 1dab15940d
Remove protected_atrributes gem and start moving to strong params
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-26 14:30:07 +03:00
Jacob Vosmaer 3f1ece2690 Detect closing issues in Merge Request description 2014-06-13 17:25:44 +02:00
Dmitriy Zaporozhets ffd50e8cf5
Add merged mrs list to milestone page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-05 16:28:13 +03:00
Dmitriy Zaporozhets affd376f7a
Dont show remove source branch ckecbox/button if you dont have such
permissions for MR page

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-05-27 18:51:41 +03:00
Dmitriy Zaporozhets 1f1c59b61d Merge pull request #6778 from dblessing/feature/mr_labels
Merge Request Labels
2014-05-13 14:43:46 +03:00
Drew Blessing 5f25cdfe19 Implement Merge Request Labels 2014-05-13 06:41:36 -05:00
Dmitriy Zaporozhets 23de3551ab
Add MergeRequest#target_project_namespace
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-05-08 15:37:36 +03:00
Dmitriy Zaporozhets 36f861f1b1
Re-annotate models
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-09 15:05:03 +03:00
Dmitriy Zaporozhets d92e4830f7
Allow people to remove source branch of fork project in MR
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-07 19:11:02 +03:00
Dmitriy Zaporozhets 9b598fa62d
Fix MR fork validation and services load
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-03 10:36:10 +03:00
Dmitriy Zaporozhets 9ee697dd68
Use MergeRequest services in API and controllers
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-04-02 21:51:53 +03:00
Dmitriy Zaporozhets f08464c055
Remove author_id_of_changes from app
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-03-25 14:01:52 +02:00
Daniel Cestari 55fbe71ad1 Fix error with reopened merge request not properly reloading
If you reopen a Merge Request and then try to update the source branch
it won't properly reload the code since the "reload_code" method still
checks if the MR is "opened" and not just "open" (which includes reopened)
2014-03-12 08:54:42 +02:00
Dmitriy Zaporozhets 36b065e634
Feature: reopen closed merge request
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-28 22:43:16 +02:00
Dmitriy Zaporozhets 1c61ac1c64
Refactor MR code reload
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-18 20:17:26 +02:00
Dmitriy Zaporozhets 1e106756fa
For form MR render only namespace name
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-15 14:36:58 +02:00
Dmitriy Zaporozhets f416b2f5cf
Fix bug with merge request branch select
Merge request target branch select is broken if you submit form and have
some errors on page

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-31 13:24:38 +02:00
Dmitriy Zaporozhets 1338c7dd71
Fix mr update issue if merge_request_diff missing
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-24 14:38:02 +02:00
Dmitriy Zaporozhets 48f741eed9
MergeRequests services
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-24 14:18:32 +02:00
Dmitriy Zaporozhets 380342784d
Fix MR spinach tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-23 12:55:43 +02:00
Dmitriy Zaporozhets 4b3afe2325
Always create merge_request_diff if MR created
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-22 20:22:20 +02:00
Dmitriy Zaporozhets 51ea42e238
Improve commit render performnace for MR show page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-22 15:54:53 +02:00
Dmitriy Zaporozhets 79bfbe5918
Remove commits/diff store login from MergeRequest model
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-22 15:20:20 +02:00
Dmitriy Zaporozhets 09d5868c22
Fix mr controller specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-14 10:47:28 +02:00
Dmitriy Zaporozhets db966364de
MergeRequest#automerge accepts custom message now. MergeRequest#merge_commit_message generate default one
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-01-13 17:20:30 +02:00
Drew Blessing 63723ef6df Fix dashboard event caching 2013-12-13 13:40:45 -06:00
Dmitriy Zaporozhets cb599a09be
Allow close of broken MR
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-12-12 12:20:54 +02:00
Dmitriy Zaporozhets 6c3459978d
Add new methods to MR to check if source or target branch exists
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2013-12-12 11:34:42 +02:00
Dmitriy Zaporozhets b658489f27 Fix bugs when discussion visible in wrong project
Because notes scope was not limited by project in
MergeRequest#mr_and_commit_notes it causes comments from project A
appears in discussions for MR in project B.
2013-10-07 14:49:01 +03:00
Dmitriy Zaporozhets e219cf7246 Annotate! 2013-10-01 15:15:28 +03:00
Dmitriy Zaporozhets 76a0739454 Add description to MergeRequest model 2013-09-09 16:32:43 +03:00
ash wilson c8a115c0e3 Link issues from comments and automatically close them
Any mention of Issues, MergeRequests, or Commits via GitLab-flavored markdown
references in descriptions, titles, or attached Notes creates a back-reference
Note that links to the original referencer. Furthermore, pushing commits with
commit messages that match a (configurable) regexp to a project's default
branch will close any issues mentioned by GFM in the matched closing phrase.
If accepting a merge request would close any Issues in this way, a banner is
appended to the merge request's main panel to indicate this.
2013-08-25 18:58:41 -04:00
Dmitriy Zaporozhets 8dd37afe34 Reannotate 2013-08-21 12:34:02 +03:00
Dmitriy Zaporozhets 625fb2f29d Add iids to milestones. Moved iids logic to separate concern 2013-08-21 12:16:26 +03:00
Dmitriy Zaporozhets 7047a44a26 Sett iid on create. Use iid as value to_param 2013-08-19 22:10:56 +03:00
Dmitriy Zaporozhets 7fefb0397e Fix filter context. Dont duplicate target project name for MR 2013-08-08 17:29:31 +03:00
Dmitriy Zaporozhets f4978bc08e Fix unmerged diff for non-fork MR 2013-08-08 12:44:33 +03:00
Dmitriy Zaporozhets 4537623d12 Merge branch 'master' into karlhungus-mr-on-fork
Conflicts:
	app/contexts/filter_context.rb
	app/contexts/search_context.rb
	app/models/merge_request.rb
	app/models/note.rb
	app/views/shared/_merge_requests.html.haml
	spec/controllers/commit_controller_spec.rb
	spec/services/notification_service_spec.rb
2013-08-08 12:22:09 +03:00
Dmitriy Zaporozhets b92655663c Update main calls to gitlab_git 2013-08-05 16:51:04 +03:00
Izaak Alpert d99594273d Style changes from review with @randx
-Some changes around calling origional methods for !for_fork? merge requests. Other changes to follow

Change-Id: I009c716ce2475b9efa3fd07aee9215fca7a1c150
2013-07-17 22:48:03 -04:00
Izaak Alpert 0ef055a4ae MR on fork: Email fixes, style fixes
-Removed many extra spaces I added
-Fixed email templates to be consistent/better looking

GITLAB-894, GITLAB-895, (GITLAB-858)

Change-Id: I35c1a8e0e22af7de26d54e5c3da987fa7bb3921e
2013-07-17 22:46:38 -04:00
Izaak Alpert 09112dbb1d Rebase on master
Trying to retrigger travis
Change-Id: Ifd86fb4c6b2791ad176230254fbf69a9ade979fb
2013-07-17 22:45:03 -04:00
Izaak Alpert 5d56da6bdd MR on fork: Some cleanup, test updates
-The forked merge request test now tests it's componenets again, and seems to work every time (did this by reordering the branch updates so their is more time for update_branches to run) -- this could still technically fail, but after several runs it doesn't seem to.
-Removed todo in merge_request, pushed wrapping of grit down to the satellite
-updated action test to check flock status, made it nolonger pending
-moved all logging on failure to helper method in satellite
GITLAB-592

Change-Id: If0554ca35eedc3d3e8461f7d93d4b3939fa2cd75
2013-07-17 22:42:51 -04:00
Izaak Alpert 3d7194f011 Merge Request on forked projects
The good:

 - You can do a merge request for a forked commit and it will merge properly (i.e. it does work).
 - Push events take into account merge requests on forked projects
 - Tests around merge_actions now present, spinach, and other rspec tests
 - Satellites now clean themselves up rather then recreate

The questionable:

 - Events only know about target projects
 - Project's merge requests only hold on to MR's where they are the target
 - All operations performed in the satellite

The bad:

  -  Duplication between project's repositories and satellites (e.g. commits_between)

(for reference: http://feedback.gitlab.com/forums/176466-general/suggestions/3456722-merge-requests-between-projects-repos)

Fixes:

Make test repos/satellites only create when needed
-Spinach/Rspec now only initialize test directory, and setup stubs (things that are relatively cheap)
-project_with_code, source_project_with_code, and target_project_with_code now create/destroy their repos individually
-fixed remote removal
-How to merge renders properly
-Update emails to show project/branches
-Edit MR doesn't set target branch
-Fix some failures on editing/creating merge requests, added a test
-Added back a test around merge request observer
-Clean up project_transfer_spec, Remove duplicate enable/disable observers
-Ensure satellite lock files are cleaned up, Attempted to add some testing around these as well
-Signifant speed ups for tests
-Update formatting ordering in notes_on_merge_requests
-Remove wiki schema update
Fixes for search/search results
-Search results was using by_project for a list of projects, updated this to use in_projects
-updated search results to reference the correct (target) project
-udpated search results to print both sides of the merge request

Change-Id: I19407990a0950945cc95d62089cbcc6262dab1a8
2013-07-17 22:41:30 -04:00
Dmitriy Zaporozhets 63e532eff0 Cache MR diffs result. Improve diff output 2013-07-08 20:12:35 +03:00
Dmitriy Zaporozhets 6e35aceff2 Annotated 2013-06-19 15:40:33 +03:00
Dmitriy Zaporozhets 940c05086e Check for existing MR only for opened/reopened MR 2013-06-14 17:19:26 +03:00
Dmitriy Zaporozhets a59fe739fe IMprove MR validation logic 2013-06-14 15:17:47 +03:00
Dmitriy Zaporozhets 977146f568 Prevent creating several open merge requests for same branches 2013-06-14 15:03:22 +03:00
Dmitriy Zaporozhets 44275e5066 Fix huge MR exceptions. Fixed link to diff for it 2013-05-22 14:06:08 +03:00
Dmitriy Zaporozhets 71033c9efb handle broken diffs gracefully 2013-05-22 09:50:09 +03:00
Dmitriy Zaporozhets 6a4a17f339 Remove native git calls from MR. Dump diff as array, not class 2013-04-15 19:01:36 +03:00
Dmitriy Zaporozhets 03f41e2820 Gitlab::Git::Tree & Blob added 2013-04-02 22:37:20 +03:00
Dmitriy Zaporozhets 5f4445c3d3 store commits for MR as array of hashes 2013-04-02 21:30:36 +03:00
Dmitriy Zaporozhets af657b0509 reset st_commits before setting new value to prevent error when old st_commits is broken 2013-04-02 11:32:41 +03:00
Dmitriy Zaporozhets bbfbff3add Extend models functionality with old decorator methods. Use Repository model 2013-03-31 23:48:12 +03:00
Dmitriy Zaporozhets 154e54b46e Remove grit logic from app/ 2013-03-31 18:49:58 +03:00
Dmitriy Zaporozhets 21b1fee92c reannotated 2013-03-15 15:16:02 +02:00
Sebastian Ziebell 3374027e3a Merge branch 'master' into fixes/api, code clean up and tests fixed
Conflicts:
	doc/api/projects.md
	spec/requests/api/projects_spec.rb
2013-03-07 14:51:56 +01:00
Dmitriy Zaporozhets b3d648b4e8 Prevent duplicate merge events 2013-02-27 17:48:51 +02:00
Dmitriy Zaporozhets d7b667fee2 Merge branch 'state-machine-stage-2' of https://github.com/Undev/gitlabhq into Undev-state-machine-stage-2
Conflicts:
	app/models/merge_request.rb
2013-02-26 10:38:40 +02:00
Dmitriy Zaporozhets 4a137651ec Fix merge request closed filter. Fixed one more test 2013-02-21 14:11:24 +02:00
Andrew8xx8 6d68923edc human_merge_status replaced by human_merge_status_name 2013-02-20 17:50:29 +04:00
Andrew8xx8 52e0df5c23 class.self methods moved to scopes 2013-02-20 17:50:24 +04:00
Andrew8xx8 e2d94e0719 State machine added for merge_status field 2013-02-20 17:49:48 +04:00
Dmitriy Zaporozhets 155703c613 Merge branch 'state-machine' of https://github.com/Undev/gitlabhq into Undev-state-machine
Conflicts:
	app/models/issue.rb
	app/models/merge_request.rb
2013-02-19 11:01:19 +02:00
Dmitriy Zaporozhets bfc359ca61 Fix project filter for MR on dashboard 2013-02-19 09:43:41 +02:00
Andrew8xx8 d27ed43daa Hash syntax improved 2013-02-18 17:22:18 +04:00
Andrew8xx8 29f70acc98 Merge Request uses StateMachine now 2013-02-18 14:43:50 +04:00
Andrew8xx8 b45e9aefd3 Merge Request uses StateMachine now 2013-02-18 14:43:50 +04:00
Andrew8xx8 8db3920c01 State renamed to merge_status 2013-02-18 14:43:49 +04:00
Andrew8xx8 839957cf56 Constants in Events looks good now 2013-02-13 15:48:16 +04:00
Dmitriy Zaporozhets da03a5c7e2 more refactoring using models/concerns 2013-01-03 09:06:07 +02:00
Dmitriy Zaporozhets 40a956eb68 Few more fixes after removing roles 2013-01-03 00:01:08 +02:00
Dmitriy Zaporozhets 9ada678819 Split commit_id and noteable_id for Note 2012-12-18 20:02:00 +02:00
Dmitriy Zaporozhets ca936d2784 Improve CI integration for merge requests 2012-12-11 06:14:05 +03:00
Riyad Preukschas b3834bc9b0 Remove MergeRequest#to_raw and replace it with #to_diff and #to_patch 2012-11-25 00:05:47 +01:00
Dmitriy Zaporozhets 95c23b2f97 Annotated. schema updated 2012-11-19 21:24:05 +03:00
randx e4cf99db46 Refactor milestones related functionality. Added seeds for Milestine and MR 2012-10-30 09:22:24 +02:00
randx f417a265d7 Finalize milestones for Merge Requests 2012-10-29 23:45:11 +02:00
randx ecdf778e80 Merge branch 'public_submission_milestones_for_mr' of https://github.com/piffio/gitlabhq into piffio-public_submission_milestones_for_mr
Conflicts:
	app/views/merge_requests/_form.html.haml
2012-10-29 21:37:46 +02:00
Sergio Visinoni a7d0816933 Add Milestone information in Merge Requests
Step 1:
* Add milestone_id in the model for merge_requests
* Make it possible to create or update a Merge Request with an attached
  Milestone detail
* Add the possibility to filter by Milestone and / or Assignee in the
  Merge Requests listing page
2012-10-26 16:12:40 +02:00
Riyad Preukschas 8c89beb6f9 Change argument order for satellite actions to always start with the user 2012-10-26 00:26:47 +02:00
Riyad Preukschas 78235edda8 Renamed Gitlab::Merge to Gitlab::Satellite::MergeAction 2012-10-26 00:19:01 +02:00
Riyad Preukschas d4e3664067 Fix bug in MergeRequest#mark_as_unmergable 2012-10-20 15:27:34 +02:00
Riyad Preukschas 122769e358 Refactor Gitlab::Merge
* Refactor and document methods
* Rename merge to merge!
* Fixes #1544
2012-10-20 15:25:48 +02:00
Valeriy Sizov 3b5c7b6e9a minor code style fixing 2012-10-12 20:07:23 +03:00
Riyad Preukschas 6dc8c0eac2 Make MRs also count and display its commits' notes 2012-10-10 01:31:36 +02:00
Dmitriy Zaporozhets 41e53eb980 Annotated 2012-10-09 11:14:17 +03:00
Andrey Kumanyaev df7c52489a simple refactoring 2012-10-09 04:10:04 +04:00
Nihad Abbasov 841e4fbd08 cosmetical cleanup of models 2012-09-27 02:05:53 -07:00
Nihad Abbasov 2a4359a572 annotate models 2012-09-27 02:05:53 -07:00
Robert Speicher afc4a75499 Use Rails.root.join where appropriate 2012-09-26 16:32:26 -04:00
Nihad Abbasov 83efcabc82 set activerecord whitelist_attributes to true 2012-09-26 11:18:35 -07:00
Dmitriy Zaporozhets 40eec08c99 Merge pull request #1409 from riyad/update-votes
Update votes for issues and merge requests
2012-09-11 23:08:19 -07:00
Riyad Preukschas a2a0060034 Rename Upvote role to Votes 2012-09-08 16:05:48 +02:00
randx ad3a88cfd3 Prepared for gitolite v3 2012-08-29 02:03:04 +03:00
Sytse Sijbrandij 9ec4c2d214 Show only the commits that are newer in the merge request. 2012-08-21 23:07:11 +02:00
Robert Speicher 7754189187 Fully embrace Ruby 1.9 hash syntax
Didn't bother with files in db/, config/, or features/
2012-08-10 18:25:15 -04:00
Robert Speicher f36f0dac9d Consolidate functionality shared between Issue and MergeRequest
Any associations, validations, delegates, scopes and methods that
were exactly the same in both Issue and MergeRequest models have been
moved to a new IssueCommonality module (role) that gets included by each
class.

There was actually quite a bit of duplication, because MergeRequests are
basically just specialized Issues.
2012-08-08 21:44:33 -04:00
Robert Speicher 7a4c958882 Add empty IssueCommonality module; include in Issue and MergeRequest 2012-08-08 21:26:56 -04:00
Dmitriy Zaporozhets 8803350023 CHANGELOG updated. Fixed MR bug. Logger improved 2012-07-17 08:23:16 +03:00
Dmitriy Zaporozhets a3bb9ca1fa Feature: Unassigned Merge Requests 2012-07-17 08:19:16 +03:00
Dmitriy Zaporozhets 0a6b64e6a9 MR: Handle broken diff ex. in case its too huge 2012-07-05 22:59:37 +03:00
randx 264ee0c5a1 Tabs styled. MR Get Patch 2012-07-05 01:26:23 +03:00
randx 6abc649590 Reannotated 2012-06-26 21:23:09 +03:00
Dmitriy Zaporozhets 75cf927d3b Issues & MR legend 2012-06-21 08:29:53 +03:00
Dmitriy Zaporozhets 0a70aca3b1 Models Refactoring: Move methods to roles 2012-06-07 15:44:57 +03:00
Zevs d6ed9920d6 #888 prevent to remove source_branch 2012-06-05 00:11:07 +03:00
Zevs 3b41b1839b ability to remove source branch after merge 2012-06-05 00:11:07 +03:00
randx 3272620f72 lib/ refactoring. Module Gitlabhq renamed to Gitlab 2012-05-26 13:37:49 +03:00
Valery Sizov 8269a3a735 Auto-merge: checking via AJAX 2012-04-16 22:08:03 +03:00
Dmitriy Zaporozhets f145450415 fixed mr unmergable method 2012-03-31 13:48:30 +03:00
Dmitriy Zaporozhets 90748cf724 Merge Button v1 complete 2012-03-30 20:49:34 +03:00
randx 3824f9b372 Unverify MR on every push. Ajax for MR accept. better UI 2012-03-30 08:15:04 +03:00
randx 411d84f385 Better merge handling. show if MR can be accepted or not 2012-03-30 08:05:04 +03:00
Dmitriy Zaporozhets cd74f9da91 Link for auto merge, db field for MR 2012-03-30 00:27:42 +03:00
Dmitriy Zaporozhets 2ec12c9bb8 Impoved merge requests show page. Minor style improvements across project 2012-03-16 01:45:46 +02:00
Dmitriy Zaporozhets 5d2bd5ec3a Simple search implementation 2012-03-16 01:14:39 +02:00
Dmitriy Zaporozhets 7b75f3cfd3 show who merged request 2012-03-15 23:32:00 +02:00
Dmitriy Zaporozhets 5a3f23f395 Persist Merge Request diff. Auto merge request close on push 2012-03-15 00:57:43 +02:00
Ariejan de Vroom 2d00f2dfe4 Added 'x notes' and +1 counters to issues and merge requests. Refs #549 2012-03-15 00:51:03 +02:00
Dmitriy Zaporozhets 3676838dc9 Rspec test repo replaced.\nMerge Requests improved 2012-03-13 23:54:49 +02:00
Dmitriy Zaporozhets 94befdd502 Events improved. Open/close issue, merge request events displayed 2012-03-07 00:13:43 -08:00
Dmitriy Zaporozhets cff9519127 Dashboard perfomance improved. Filter for projects page 2011-12-20 08:24:14 +02:00
Dmitriy Zaporozhets 54fb0f8589 Merge branch 'notification_refactoring' 2011-12-19 15:17:11 +02:00
Valery Sizov a66d9b4c76 annotate model 2011-12-18 16:09:16 +02:00
Dmitriy Zaporozhets 10df55e11d Added missing dependent for notes assoc 2011-12-18 12:10:20 +02:00
Dmitriy Zaporozhets 79b64ef4ac fixed merge request diff 2011-11-29 20:06:37 +02:00
Dmitriy Zaporozhets 6d460aa2d6 merge request entity 2011-11-28 09:39:43 +02:00