summaryrefslogtreecommitdiff
path: root/spec/models/merge_request_spec.rb
Commit message (Collapse)AuthorAgeFilesLines
* Create BaseService for Auto Merge architecturecreate-base-class-for-auto-merge-architectureShinya Maeda2019-06-061-16/+0
| | | | It abstracts some codes for common methods in AutoMerge::*Services.
* Merge branch 'osw-sync-merge-ref-upon-mergeability-check' into 'master'Douwe Maan2019-06-031-85/+2
|\ | | | | | | | | | | | | Automatically update MR merge-ref along merge status Closes #58495 See merge request gitlab-org/gitlab-ce!28513
| * Automatically update MR merge-ref along merge statusOswaldo Ferreira2019-05-311-85/+2
| | | | | | | | | | | | | | | | | | | | | | | | This couples the code that transitions the `MergeRequest#merge_status` and refs/merge-requests/:iid/merge ref update. In general, instead of directly telling `MergeToRefService` to update the merge ref, we should rely on `MergeabilityCheckService` to keep both the merge status and merge ref synced. Now, if the merge_status is `can_be_merged` it means the merge-ref is also updated to the latest. We've also updated the logic to be more systematic and less user-based.
* | Merge dev.gitlab.org master into GitLab.com masterYorick Peterse2019-06-031-0/+36
|\ \
| * \ Merge branch 'security-60039' into 'master'GitLab Release Tools Bot2019-06-031-0/+36
| |\ \ | | |/ | |/| | | | | | | Disallow invalid MR branch name See merge request gitlab/gitlabhq!3052
| | * Validate MR branch namesMark Chao2019-05-031-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevents refspec as branch name, which would bypass branch protection when used in conjunction with rebase. HEAD seems to be a special case with lots of occurrence, so it is considered valid for now. Another special case is `refs/head/*`, which can be imported.
* | | Abstract auto merge processesShinya Maeda2019-06-031-2/+16
|/ / | | | | | | | | | | | | | | | | | | | | | | We have one auto merge strategy today - Merge When Pipeline Succeeds. In order to add more strategies for Merge Train feature, we abstract the architecture to be more extensible. Removed arguments Fix spec
* | Additional fix to handle NULL lock_versionsh-fix-activerecord-patch-mark2Stan Hu2019-05-061-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the UI sends a string value for lock_version (e.g. "0"), then the previous monkey patch did not properly handle that properly. This commit casts the value to an integer to determine whether to look for NULL lock_versions. For merge requests, GitLab sends a POST request to `namespace/project/merge_requests/:iid` with the `merge_request[lock_version]` parameter with a string `0`. The string value comes from the form field, which explains why https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/28145 wasn't sufficient.
* | Fix editing issues and MRs with NULL lock_versionSean McGivern2019-05-061-0/+12
| |
* | Merge branch 'add-project-level-config-for-merge-train-ce' into 'master'Sean McGivern2019-05-011-1/+1
|\ \ | | | | | | | | | | | | CE Backport: Add project level config for merge train See merge request gitlab-org/gitlab-ce!27819
| * | Add project level config for merge trainadd-project-level-config-for-merge-train-ceShinya Maeda2019-04-301-1/+1
| | | | | | | | | | | | We add the option and expose the parameter for frontend work
* | | Fix environment automatic on_stop triggerShinya Maeda2019-04-301-0/+44
|/ / | | | | | | | | | | | | Due to the nature of pipelines for merge requests, deployments.ref can be a merge request ref instead of a branch name. We support the environment auto-stop hook for this case
* | [CE] Support multiple assignees for merge requestsosw-multi-assignees-merge-requestsOswaldo Ferreira2019-04-081-51/+9
|/ | | | | Backports https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10161 (code out of ee/ folder).
* Do not show system notes on commits in the MR page55268-exclude-system-notes-from-commits-in-mrHeinrich Lee Yu2019-04-021-0/+8
|
* Backport splitting approval changes from CEIgor2019-04-021-21/+6
| | | | | | | Author and committers approvals are split in EE This commit provides backports for those changes This reverts commit 886f00bcba23d67e2c86591c2eb5359ef457a2f9.
* Merge branch 'check-mergeability-in-merge-to-ref-service' into 'master'Douglas Barbosa Alexandre2019-04-011-0/+32
|\ | | | | | | | | Check mergeability in merge to ref service See merge request gitlab-org/gitlab-ce!26757
| * Check mergeability in merge to ref servicecheck-mergeability-in-merge-to-ref-serviceShinya Maeda2019-04-011-0/+32
| | | | | | | | | | | | | | | | | | | | and add spec Add changelog ok ok
* | Fix MergeRequest#has_commits? nil comparisonFrancisco Javier López2019-04-011-3/+10
| |
* | Add # frozen_string_literal to spec/modelsThong Kuah2019-04-011-0/+2
|/ | | | Adds `# frozen_string_literal: true` to spec/models ruby files
* Create detached merge request pipelinespersist-fulll-ref-path-for-mr-pipelinesShinya Maeda2019-03-291-0/+28
| | | | | | | | | | | | | | | | | | By using `refs/merge-requests/:iid/head` ok ok Improve naming nicely Add nice tests add nice tests fix some more revert
* Merge branch 'osw-multi-assignees-merge-requests-migration' into 'master'Douglas Barbosa Alexandre2019-03-261-0/+25
|\ | | | | | | | | Add multiple MR assignees migration and background table population See merge request gitlab-org/gitlab-ce!26496
| * Add multiple assignees migration and table populationOswaldo Ferreira2019-03-251-0/+25
| | | | | | | | This will be further required for supporting multi-assignees MRs
* | Merge branch ↵Sean McGivern2019-03-261-21/+16
|\ \ | |/ |/| | | | | | | | | | | | | '58805-allow-incomplete-commit-data-to-be-fetched-from-collection' into 'master' Enrich commits with full data in CommitCollection Closes #58805 See merge request gitlab-org/gitlab-ce!26445
| * Scope out merge commits in MergeRequest specLuke Duncalfe2019-03-221-2/+2
| | | | | | | | | | | | | | | | Previously the code for excluding merge commits from the commit collection (CommitCollection#without_merge_commits) was not working when the commits had come from a merge request. Now that this has been fixed, these tests fails. They should always have been written to exclude merge commits when comparing.
| * Enrich commits with full data in CommitCollectionLuke Duncalfe2019-03-221-19/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow incomplete commit records to load their full data from gitaly. Commits can be based on a Hash of data retrieved from PostgreSQL, and this data can be intentionally incomplete in order to save space. A new method #gitaly? has been added to Gitlab::Git::Commit, which returns true if the underlying data source of the Commit is a Gitaly::GitCommit. CommitCollection now has a method #enrich which replaces non-gitaly commits in place with commits from gitaly. CommitCollection#without_merge_commits has been updated to call this method, as in order to determine a merge commit we need to have parent data. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/58805
* | Update merge request widget pipeline blockNathan Friend2019-03-211-2/+12
| | | | | | | | | | | | This commit updates the pipeline block that appears on the merge request page to include information that will be exposed by the API as part of the post-merge pipeline feature.
* | Revert "Merge branch ↵Sean McGivern2019-03-211-16/+21
| | | | | | | | | | '58805-allow-incomplete-commit-data-to-be-fetched-from-collection' into 'master'" This reverts merge request !26144
* | Scope out merge commits in MergeRequest specLuke Duncalfe2019-03-181-2/+2
| | | | | | | | | | | | | | | | Previously the code for excluding merge commits from the commit collection (CommitCollection#without_merge_commits) was not working when the commits had come from a merge request. Now that this has been fixed, these tests fails. They should always have been written to exclude merge commits when comparing.
* | Enrich commits with full data in CommitCollectionLuke Duncalfe2019-03-181-19/+14
|/ | | | | | | | | | | | | | | | | | | | Allow incomplete commit records to load their full data from gitaly. Commits can be based on a Hash of data retrieved from PostgreSQL, and this data can be intentionally incomplete in order to save space. A new method #gitaly? has been added to Gitlab::Git::Commit, which returns true if the underlying data source of the Commit is a Gitaly::GitCommit. CommitCollection now has a method #enrich which replaces non-gitaly commits in place with commits from gitaly. CommitCollection#without_merge_commits has been updated to call this method, as in order to determine a merge commit we need to have parent data. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/58805
* Make all_pipelines method compatible with pipelines for merge requestsShinya Maeda2019-03-131-8/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it sane Include merge ref head Fix union Improve a bit Add spec remove add spec Add changelog fix coding offence Apply suggestion to spec/models/merge_request_spec.rb ok ok Fix Fix spec Fix spec fix Simplify the things Memoize OK a
* Filter merge requests by target branchHiroyuki Sato2019-03-091-0/+19
|
* Add suffix for merge request eventShinya Maeda2019-03-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fix ok Add spec Fix ok Fix Add changelog Fix Add memoization a fix
* Merge branch 'sh-fix-issue-9787-ce' into 'master'Douwe Maan2019-02-151-8/+9
|\ | | | | | | | | Backport commit author changes from CE See merge request gitlab-org/gitlab-ce!25294
| * Backport commit author changes from CEStan Hu2019-02-151-8/+9
| | | | | | | | | | This backports the changes made in EE to fix merge request approvers from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9574.
* | Base pipeline must be from target branchOlivier Gonzalez2019-02-151-1/+2
|/
* Allow custom squash commit messagesLuke Duncalfe2019-02-061-8/+40
|
* Enable the Layout/ExtraSpacing cop56392-enable-the-layout-extraspacing-copRémy Coutable2019-01-241-12/+12
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Fix unexpected exception by failed to find an actual head pipelineShinya Maeda2019-01-101-0/+17
| | | | Add changelog
* Add committers and authors methods on MergeRequestTiago Botelho2019-01-081-0/+28
| | | | These are used by the EE-only approvers feature
* Refactor the logic of updating head pipelinesShinya Maeda2019-01-041-0/+28
| | | | Sort out some logic
* Cache diff highlight in discussionsOswaldo Ferreira2018-12-211-0/+51
| | | | | | | | | This commit handles note diffs caching, which considerably improves the performance on merge requests with lots of comments. Important to note that the caching approach taken here is different from `Gitlab::Diff::HighlightCache`. We do not reset the whole cache when a new push is sent or anything else. That's because discussions diffs are persisted and do not change.
* Merge branch 'force-reload-arguments-2' into 'master'Rémy Coutable2018-12-181-1/+1
|\ | | | | | | | | Passing an argument to force an association to reload is now deprecated See merge request gitlab-org/gitlab-ce!23894
| * Passing an argument to force an association to reload is now deprecatedJasper Maes2018-12-181-1/+1
| |
* | Update specs to exclude possible false positive passblackst0ne2018-12-181-1/+1
|/
* Generalise test compare serviceGilbert Roulot2018-12-111-0/+24
| | | | | | It adds a base class for CompareTestReportsService containing common code with CompareLicenseManagementReportsService which is present in GitLab Enterprise Edition.
* Revert "Merge branch '28682-can-merge-branch-before-build-is-started' into ↵Stan Hu2018-12-101-1/+1
| | | | | | | | | | | | | 'master'" This reverts commit 793be43b35bc8cd2a9effe38280417ee198647cb, reversing changes made to 8d0b4872ba3ff787c4067618f48b60bd24466c74. For projects not using any CI, enabling merge only when pipeline succeeds caused merge requests to be in unmergeable state, which caused significant confusion. See https://gitlab.com/gitlab-org/gitlab-ce/issues/55144 for more details.
* Merge request pipelinesShinya Maeda2018-12-051-0/+113
|
* Revert "Merge branch 'revert-e2aa2177' into 'master'"Zeger-Jan van de Weg2018-11-201-40/+22
| | | This reverts merge request !23229
* Revert "Merge branch 'zj-improve-gitaly-pb' into 'master'"revert-e2aa2177Sean McGivern2018-11-201-22/+40
| | | This reverts merge request !23140
* Merge branch 'zj-improve-gitaly-pb' into 'master'Sean McGivern2018-11-201-40/+22
|\ | | | | | | | | Show what RPC is called in the performance bar See merge request gitlab-org/gitlab-ce!23140