Commit Graph

740 Commits

Author SHA1 Message Date
Shinya Maeda d4b4693663 Abstract auto merge processes
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
2019-06-03 13:15:29 +07:00
Stan Hu 37a335e60e Fix remaining failures in shoulda-matcher
Starting with Rails 5, belongs_to now adds a presence validation to the
association, and so as of shoulda-matchers 4.0.0 the belong_to matcher
follows suit and tests that this validation is there by setting the
association to nil and asserting that there are validation errors. This
exposed an error with the `validate_branches` method: we need to check
the source and target project exist.
2019-05-21 23:19:07 -07:00
Shinya Maeda d4d2cf7327 Fix merge request pipeline exist method
Refactor
2019-05-06 13:20:47 +07:00
Shinya Maeda daa8f784d0 Fix environment automatic on_stop trigger
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
2019-04-30 21:15:39 +07:00
Jasper Maes 624a1cdab4 Upgrade Rails to 5.1.6.1
Model.new.attributes now also returns encrypted attributes.
2019-04-23 08:31:23 +08:00
Matija Čupić 0cfa25ff21
Backport changes from EE
This backports the changes from
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10452
2019-04-16 13:06:52 +02:00
Oswaldo Ferreira ca884980ee [CE] Support multiple assignees for merge requests
Backports https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10161
(code out of ee/ folder).
2019-04-08 18:40:00 -03:00
Heinrich Lee Yu 0e5dbaf87f Do not show system notes on commits in the MR page 2019-04-02 22:59:43 +08:00
Igor 351b39f172 Backport splitting approval changes from CE
Author and committers approvals are split in EE
This commit provides backports for those changes

This reverts commit 886f00bcba.
2019-04-02 11:01:07 +00:00
Sean McGivern f87b7fe3b3 Merge branch 'issue_51789_part_1' into 'master'
Migrate issuable states to integer patch 1 of 2

Closes #51789

See merge request gitlab-org/gitlab-ce!25107
2019-04-02 08:39:53 +00:00
Douglas Barbosa Alexandre d8258470b5 Merge branch 'check-mergeability-in-merge-to-ref-service' into 'master'
Check mergeability in merge to ref service

See merge request gitlab-org/gitlab-ce!26757
2019-04-01 16:17:10 +00:00
Francisco Javier López 45293f66fa Fix MergeRequest#has_commits? nil comparison 2019-04-01 15:13:22 +00:00
Shinya Maeda a7d4824ded Check mergeability in merge to ref service
and add spec

Add changelog

ok

ok
2019-04-01 14:02:57 +07:00
Kamil Trzciński 0d26c48332 Merge branch 'persist-fulll-ref-path-for-mr-pipelines' into 'master'
Use merge request HEAD ref for detached merge request pipelines

Closes #58454

See merge request gitlab-org/gitlab-ce!25504
2019-03-29 10:46:02 +00:00
Shinya Maeda bf639fd504 Create detached merge request pipelines
By using `refs/merge-requests/:iid/head`

ok

ok

Improve naming nicely

Add nice tests

add nice tests

fix some more

revert
2019-03-29 13:58:45 +07:00
Nick Thomas 013f7cd24c
Inherit from ApplicationRecord instead of ActiveRecord::Base 2019-03-28 16:18:23 +00:00
Felipe Artur 16a3fea399 Merge master 2019-03-27 15:19:12 -03:00
Oswaldo Ferreira 03e0604d5d Prepare suggestion implementation for multi-line
Adds the groundwork needed in order to persist multi-line suggestions,
while providing the parsing strategy which will be reused for the
**Preview** as well.
2019-03-27 12:26:53 -03:00
Oswaldo Ferreira 929ee4d18d Add multiple assignees migration and table population
This will be further required for supporting multi-assignees MRs
2019-03-25 19:50:40 -03:00
Nathan Friend 7e6b57499f Update merge request widget pipeline block
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.
2019-03-21 15:31:09 +00:00
Shinya Maeda b913169d88 Make all_pipelines method compatible with pipelines for merge requests
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
2019-03-13 19:26:38 +07:00
Hiroyuki Sato de784ac105 Filter merge requests by target branch 2019-03-09 12:22:58 +00:00
Stan Hu 062efe4f7a Significantly reduce N+1 queries in /api/v4/todos endpoint
By preloading associations and batching issuable metadata lookups,
we can significantly cut the number of SQL queries needed to load
the Todos API endpoint.

On GitLab.com, my own tests showed my user's SQL queries went
from 365 to under 60 SQL queries.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/40378
2019-03-06 07:03:46 -08:00
John Jarvis 83cb748256 Merge branch 'merge-dev-to-master' into 'master'
Merge dev.gitlab.org master into GitLab.com master

Closes #2794, #2814, #2806, #2805, #2798, #2795, #2788, and #2787

See merge request gitlab-org/gitlab-ce!25746
2019-03-05 10:28:59 +00:00
Hiroyuki Sato 2b0a0f9b03 Merge branch 'master' into expose-additional-merge-request-pipeline-variables
Conflicts:
  doc/ci/variables/README.md
  spec/models/ci/pipeline_spec.rb
2019-03-04 21:07:36 +00:00
Yorick Peterse 025015048f Merge branch 'security-2773-milestones-fix' into 'master'
[master] Check issue milestone availability

See merge request gitlab/gitlabhq!2788
2019-03-04 18:37:15 +00:00
Francisco Javier López ebf16ada85 Arbitrary file read via MergeRequestDiff 2019-03-04 18:36:34 +00:00
Oswaldo Ferreira 1ad699677f Support merge to ref for merge-commit and squash
Adds the ground work for writing into
the merge ref refs/merge-requests/:iid/merge the
merge result between source and target branches of
a MR, without further side-effects such as
mailing, MR updates and target branch changes.
2019-02-25 10:40:58 -03:00
Felipe Artur 648b87315d Merge branch 'master' into issue_51789_part_1 2019-02-19 11:35:29 -03:00
Douwe Maan 8f209ed5ea Merge branch 'sh-fix-issue-9787-ce' into 'master'
Backport commit author changes from CE

See merge request gitlab-org/gitlab-ce!25294
2019-02-15 17:17:27 +00:00
Stan Hu 886f00bcba Backport commit author changes from CE
This backports the changes made in EE to fix merge request approvers
from https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9574.
2019-02-15 05:58:23 -08:00
Olivier Gonzalez b079a6b6bb Base pipeline must be from target branch 2019-02-15 10:47:13 +00:00
Felipe Artur 9671a67a4c Fix broken specs 2019-02-14 16:33:26 -02:00
Jarka Košanová 30ab6ee416 Check issue milestone availability
Add project when creating milestone in specs

We validate milestone is from the same
project/parent group as issuable ->
we need to set project in specs correctly

Improve methods names and specs organization
2019-02-14 15:28:02 +01:00
Felipe Artur 37741c59a4 Split background migration for issues and merge requests 2019-02-14 11:48:20 -02:00
Felipe Artur 26f40aefb0 Code improvements 2019-02-13 17:31:14 -02:00
Felipe Artur e2aa332504 Improve batch size 2019-02-12 16:39:56 -02:00
Felipe Artur e9b84f50e9 Migrate issuable states to integer patch 1
Patch 1 that migrates issues/merge requests states from integer to string.
On this commit we are only adding the state_id column and syncing it with a backgroud migration.

On Patch 2 the code to use the new integer column will be deployed and the old column will be
removed.
2019-02-11 15:48:40 -02:00
Luke Duncalfe 2b7dd017af Allow custom squash commit messages 2019-02-06 12:33:11 +00:00
Mario de la Ossa 49c74068ae
Save sorting preference for Issues/MRs in BE
In order to let users' sorting preferences transfer between devices, we
save the preference for issues and MRs (one preference for issues, one
for MRs) in the backend inside the UserPreference object
2019-01-28 12:48:05 -06:00
Douwe Maan 8c1991b9bb Merge branch 'osw-fix-quick-suggestion-application-being-reverted' into 'master'
Adjust applied suggestion reverting previous changes

Closes #56017

See merge request gitlab-org/gitlab-ce!24250
2019-01-14 13:46:05 +00:00
Oswaldo Ferreira 6e29368118 Adjust applied suggestion reverting previous changes
1. Avoid suggestions being applied on the same file
from reverting previous changes
2. Gracefully use and handle file changes error
when updating the file (though, it does not totally
solves the sync problem for multiple suggestion
applications at once)
2019-01-11 21:35:07 -02:00
Shinya Maeda 1c248cd47c Fix unexpected exception by failed to find an actual head pipeline
Add changelog
2019-01-10 14:02:43 +09:00
Tiago Botelho a2842241d4
Add committers and authors methods on MergeRequest
These are used by the EE-only approvers feature
2019-01-08 00:27:29 +01:00
Shinya Maeda b6a9dce14e Make find_actual_head_pipeline private method
a
2019-01-04 19:38:45 +09:00
Shinya Maeda 0d9b801a5f Refactor the logic of updating head pipelines
Sort out some logic
2019-01-04 19:36:45 +09:00
Kamil Trzciński 7ebd36e302 Prefer to use after_transition
Before_transition does not play nice when used with
OptimisticLocking and this can result in triggering
multiple events

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/55306
2019-01-02 19:02:46 +01:00
Oswaldo Ferreira 7cf4947792 Cache diff highlight in discussions
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.
2018-12-21 16:59:21 -02:00
Douwe Maan 58ee1746a8 Merge branch 'osw-revert-suggestions-ff' into 'master'
Remove feature flag for suggest changes feature

See merge request gitlab-org/gitlab-ce!23892
2018-12-18 15:42:34 +00:00
Oswaldo Ferreira ee425c9cf8 Remove feature flag for suggest changes feature 2018-12-18 11:18:21 -02:00