summaryrefslogtreecommitdiff
path: root/app/services/merge_requests
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge branch 'osw-comment-on-any-line-on-diffs' into 'master'"osw-revert-comment-in-any-diff-lineOswaldo Ferreira2018-11-071-0/+4
| | | | | This reverts commit a82a595728d54bdc12e51dfcfb22e9eddc449143, reversing changes made to e7df959b8f99875edd246c7ac7779c3203e8755e.
* Merge branch 'bvl-patches-via-mail' into 'master'Douwe Maan2018-11-071-1/+5
|\ | | | | | | | | | | | | Allow to add patches to merge requests created via email Closes #40830 See merge request gitlab-org/gitlab-ce!22723
| * Allow limiting quick actions to executeBob Van Landuyt2018-11-071-1/+3
| | | | | | | | | | | | Sometimes we don't want to trigger any quick actions that cause side effects. For example when building a record to validate. This allows listing the quick actions that need to be performed.
| * Apply patches when creating MR via emailBob Van Landuyt2018-11-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows users to add patches as attachments to merge request created via email. When an email to create a merge request is sent, all the attachments ending in `.patch` will be applied to the branch specified in the subject of the email. If the branch did not exist, it will be created from the HEAD of the repository. When the patches could not be applied, the error message will be replied to the user. The patches can have a maximum combined size of 2MB for now.
* | Revert "Merge branch 'blackst0ne-update-push-new-merge-request-url' into ↵Douwe Maan2018-11-071-2/+2
|/ | | | | 'master'" This reverts merge request !22526
* Merge branch 'osw-comment-on-any-line-on-diffs' into 'master'Douwe Maan2018-11-071-4/+0
|\ | | | | | | | | Comment on any expanded diff line on MRs See merge request gitlab-org/gitlab-ce!22398
| * Comment on any expanded diff line on MRsOswaldo Ferreira2018-11-061-4/+0
| |
* | Set @push early for EEee-1012-assign-code-owner-as-approverMark Chao2018-11-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | In EE, there is need to call `merge_requests_for_source_branch` before calling CE's `refresh_merge_requests, in order to obtain the old diffs. However that requires `@push`, initialized inside CE's refresh_merge_requests. However it can't be set early in EE, or static analysis would fail because use of instance variables in module is discouraged. So @push is set in execute instead.
* | Optimize merge request refresh by using the database to check commit SHAssh-optimize-mr-commit-sha-lookupStan Hu2018-11-021-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously for a given merge request, we would: 1. Create the array of commit SHAs involved in the push (A) 2. Request all merge request commits and map the SHA (B) 3. Reload the diff if there were any common commits between A and B We can avoid additional database querying and overhead by checking with the database whether the merge request contains any of the commit SHAs. Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/53213
* | Add email for milestone changeChantal Rollison2018-11-021-0/+14
| |
* | Avoidp loading merge request diff files when not neededStan Hu2018-11-011-1/+1
| |
* | Significantly cut memory usage and SQL queries when reloading diffsStan Hu2018-11-011-1/+4
|/ | | | | | | | | By preloading certain models with the diff, we can eliminate many N+1 queries. For a push to the staging GitLab.com www-gitlab-com repository, this eliminates over 3000 SQL queries and appears to bring down the RSS usage by several gigabytes. Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/49703
* Merge branch 'sh-fix-issue-53153' into 'master'Sean McGivern2018-10-301-1/+6
|\ | | | | | | | | | | | | Fix extra merge request versions created from forked merge requests Closes #53153 See merge request gitlab-org/gitlab-ce!22611
| * Fix extra merge request versions created from forked merge requestssh-fix-issue-53153Stan Hu2018-10-291-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a forked merge request was created with the same branch name as the target name, MergeRequests::RefreshService would always create a new diff even though nothing had changed. For example, on GitLab.com: 1. There were a number of merge requests in the gitlab-ce and www-gitlab-com projects that had old merge requests from the community. 2. These merge requests originated from forked projects and used the source branch master. 3. When someone pushed to master in the main repository, MergeRequests::RefreshService would see that master matched the merge requests in question and generated a new diff. 4. This led to an explosion of merge request diffs and slowed down the "Changes" tab considerably. This change alters MergeRequests::RefreshService so that it will only refresh the diff if the merge request's source project and branch match. Otherwise, the refresh will only happen if a pushed commit contains a commit relevant to the existing merge request. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53153
* | Merge branch 'blackst0ne-update-push-new-merge-request-url' into 'master'Douwe Maan2018-10-291-2/+2
|\ \ | |/ |/| | | | | | | | | Make new merge request URL more friendly when pushing code Closes #53012 See merge request gitlab-org/gitlab-ce!22526
| * Make new merge request URL more friendly when pushing codeblackst0ne2018-10-231-2/+2
| |
* | Extract EE-specific lines from MRs controllerextract-ee-specific-lines-for-issues-and-mr-controllersSean McGivern2018-10-261-0/+5
|/ | | | | Move access checks to their own method so they can be overridden, and port an EE-only method to exist in CE too, with an EE-specific override.
* Fix CE to EE merge (backport)Kamil Trzciński2018-10-051-5/+6
|
* Extract git push from merge request refresh serviceGrzegorz Bizon2018-09-281-35/+24
|
* Add a class that represents a git push operationGrzegorz Bizon2018-09-281-3/+3
|
* Use standalone diff stats RPC on every comparison viewOswaldo Ferreira2018-09-191-2/+8
|
* Disable existing offenses for the CodeReuse copsYorick Peterse2018-09-116-0/+16
| | | | | This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
* Merge branch 'osw-write-cache-upon-mr-creation-and-cache-refactoring' into ↵Douwe Maan2018-09-071-2/+2
|\ | | | | | | | | | | | | | | | | 'master' Write diff highlighting cache upon MR creation (refactors caching) Closes #50204 See merge request gitlab-org/gitlab-ce!21489
| * Cache diff highlighting upon Merge Request creation (refactors diff caching)Oswaldo Ferreira2018-09-071-2/+2
| |
* | Resolve "Migrate issue labels and milestone to related merge request"Tiago Botelho2018-09-062-5/+20
|/
* REFACTOR: Clarify assignment fallback chainFranz Liedke2018-08-251-6/+4
|
* REFACTOR: Use early return to flatten codeFranz Liedke2018-08-251-6/+5
|
* Fix fallback logic for automatic MR title assignmentFranz Liedke2018-08-251-1/+1
|
* Retrieve merge request closing issues from database cacheFelipe Artur2018-08-062-1/+2
|
* Enable more frozen string in app/services/**/*.rbrepo-forks/gitlab-ce-frozen-string-enable-apps-services-inner-moregfyoung2018-07-1724-3/+54
| | | | Partially addresses #47424.
* Updates from `rubocop -a`Lin Jen-Shin2018-07-091-1/+1
|
* Merge branch 'add-more-rebase-logging' into 'master'Grzegorz Bizon2018-06-281-0/+8
|\ | | | | | | | | Add extra logging to githost.log when rebasing See merge request gitlab-org/gitlab-ce!20202
| * Add extra logging to githost.log when rebasingSean McGivern2018-06-281-0/+8
| |
* | Mark MR as merged regardless of errors when closing issuesOswaldo Ferreira2018-06-271-1/+1
|/ | | | We should mark the MR as merged as first thing on PostMergeService as in practice it is already merged on the repository. Happens that errors may happen when executing external services such as Issues::CloseService, and we do not want a MR hanging as opened because of that.
* Delete non-latest merge request diff files upon diffs reloadosw-delete-non-latest-mr-diff-files-upon-mergeOswaldo Ferreira2018-06-244-17/+66
|
* Don't use Gitlab::Utils.nlbr in Gitlab::GitJacob Vosmaer (GitLab)2018-06-112-2/+2
|
* Resolve "Automatically created MR uses wrong target branch (when branching ↵Athar Hameed2018-06-081-1/+3
| | | | from Tag)"
* Rephrase "maintainer" to more precise "members who can merge to the target ↵42751-rename-mr-maintainer-pushMark Chao2018-06-011-2/+2
| | | | | | branch" "Maintainer" will be freed to be used for #42751
* Add 'squash and rebase' feature to CEblackst0ne-squash-and-merge-in-gitlab-core-ceblackst0ne2018-05-292-4/+41
|
* Merge branch 'ce-6127-move-merge-requests-services' into 'master'Rémy Coutable2018-05-241-2/+6
|\ | | | | | | | | CE: Extract EE specific files/lines for some merge requests files See merge request gitlab-org/gitlab-ce!19107
| * Extract a do_execute method to be overriddence-6127-move-merge-requests-servicesLin Jen-Shin2018-05-241-2/+6
| |
* | Create TODO when MR became unmergeablelulalala2018-05-171-5/+1
|/ | | | | | | | Old behavior of creating TODO when “Merge When Pipeline Succeeds” service fails, is generalized to: Create a TODO whenever MR became unmergeable (and similar to notification, MR author and merge_user are both applicable)
* Merge branch 'jprovazn-generic-error' into 'master'Nick Thomas2018-05-021-10/+19
|\ | | | | | | | | Save and expose only generic merge error See merge request gitlab-org/gitlab-ce!18646
| * Save and expose only generic merge errorJan Provaznik2018-05-021-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an error occurs during merge, the error message is exposed to user and it is also saved in DB. This error message may be user unfriendly (as in !41820) and it could also expose a detailed backend information. Instead of displaying the specific error message, only sanitized generic message is displayed. This is potentially controversial change because disadvantage is that user doesn't get specific reason of failure. Additional changes: * repository.merge including exceptions is is extracted into a separate method to make things clearer * update! is used instead of update so we don't silently ignore an error Related to !41857
* | Move NotificationService calls to SidekiqSean McGivern2018-04-254-6/+11
|/ | | | | | | | | | | | | | | | | | | | | The NotificationService has to do quite a lot of work to calculate the recipients for an email. Where possible, we should try to avoid doing this in an HTTP request, because the mail are sent by Sidekiq anyway, so there's no need to schedule those emails immediately. This commit creates a generic Sidekiq worker that uses Global ID to serialise and deserialise its arguments, then forwards them to the NotificationService. The NotificationService gains an `#async` method, so you can replace: notification_service.new_issue(issue, current_user) With: notification_service.async.new_issue(issue, current_user) And have everything else work as normal, except that calculating the recipients will be done by Sidekiq, which will then schedule further Sidekiq jobs to send each email.
* Rename `create_merge_request` permissionsBob Van Landuyt2018-04-111-2/+2
| | | | | | | | | | So we can distinguish between the permissions on the source and the target project. - `create_merge_request_from` indicates a user can create a merge request with the project as a source_project - `create_merge_request_in` indicates a user can create a merge request with the project as a target_project
* Prevent new merge requests for archived projectsBob Van Landuyt2018-04-111-1/+1
| | | | | | | This prevents creating merge requests targeting archived projects. This could happen when a project was already forked, but then the source was archived.
* Send notification emails when push to a merge requestYarNayar/gitlab-ce-23460-send-email-when-pushing-more-commits-to-the-merge-requestYarNayar2018-03-261-3/+5
| | | | Closes #23460
* Only cache highlight results for latest MR diffsSean McGivern2018-03-151-1/+10
| | | | | | Previously, we kept them all in the cache. We don't need the highlight results for older diffs - if someone does view that (which is rare), we can do the highlighting on the fly.
* Merge branch 'cache-refactor' into 'master'Sean McGivern2018-03-091-9/+1
|\ | | | | | | | | | | | | Cache `#can_be_resolved_in_ui?` git operations Closes gitaly#1051 See merge request gitlab-org/gitlab-ce!17589