Commit graph

15 commits

Author SHA1 Message Date
GitLab Bot
1769b59b9f Add latest changes from gitlab-org/gitlab@master 2021-04-01 18:13:56 +00:00
GitLab Bot
3775eba7c1 Add latest changes from gitlab-org/gitlab@master 2020-10-16 12:09:33 +00:00
GitLab Bot
a8de96bff5 Add latest changes from gitlab-org/gitlab@master 2020-03-05 18:08:19 +00:00
Oswaldo Ferreira
84dd31493e [CE port] Bypass push rules for merge to ref service
Turns out push rules to validate commit message does
not apply in the context of automatic merge to
the refs/merge-requests/:iid/merge. Mainly because
if it fails to merge to it, we currently can't give enough
preemptive feedback to the user and it'll turn the
merge request unmergeable (given we automatically
mark it as unmergeable if we can't merge to the ref).

In general, it's a systematic operation, which already
bypasses user authorization and git hooks.

Therefore, this commit makes it bypass the push rules
at EE as well.
2019-07-09 14:36:29 -03:00
Shinya Maeda
48307fac1e Extend MergeToRefService for creating merge ref from the other ref
Currently, MergeToRefService is specifically designed for
createing merge commits from source branch and target branch of
merge reqeusts. We extend this behavior to source branch and any
target ref paths.
2019-07-05 17:15:10 +07:00
Oswaldo Ferreira
3af348b6cf Automatically update MR merge-ref along merge status
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.
2019-06-20 11:48:30 -03:00
Oswaldo Ferreira
00a273d3a9 Revert "Automatically update MR merge-ref along merge status" 2019-06-11 13:08:25 -03:00
Oswaldo Ferreira
b965009ddd Automatically update MR merge-ref along merge status
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.
2019-05-31 19:16:01 -03: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
Oswaldo Ferreira
2cb45dd0d5 Provide reliable source and target IDs
Returns the source and target IDs used to create
the merge commit on Gitaly.
2019-03-06 17:49:31 -03:00
Oswaldo Ferreira
959ad992b6 Ref merge does not fail upon FF config enabled 2019-03-06 10:53:55 -03:00
Oswaldo Ferreira
7a8a5fe541 Extend error checking to be overwritten in EE 2019-02-25 10:41:02 -03:00
Oswaldo Ferreira
4e16edbe0a Add feature-flag support
Returns error in MergeToRefService when
merge_to_tmp_merge_ref_path ff is disabled.
2019-02-25 10:41:02 -03:00
Oswaldo Ferreira
105212ce49 Check authorization in merge services
Move authorization checks to merge services
instead relying solely on external checks.
2019-02-25 10:41:01 -03: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