Commit graph

8 commits

Author SHA1 Message Date
Oswaldo Ferreira
f4cd926cf3 Add exclusive lease to mergeability check process
Concurrent calls to UserMergeToRef RPC updating a single ref
can lead to an opaque fail that is being rescued at Gitaly.

So this commit adds an exclusive lease to the mergeability
check process with the key as the current MR ID.
2019-07-31 19:58:43 -03:00
Douglas Barbosa Alexandre
72dee32f46
Upgrade rspec-rails to 3.8.2 and dependencies
This brings the rspec-core version in line with the Gitaly changes
and introduces Rails 5.1/5.2 improvements.

Full CHANGELOG:
https://github.com/rspec/rspec-rails/blob/master/Changelog.md
2019-07-10 15:04:56 -03:00
Oswaldo Ferreira
74a3e6b712 Avoid touching the MR status if MR is not opened 2019-06-21 11:30:09 -03:00
Oswaldo Ferreira
1f0b50c418 Only force recheck when merge-ref is outdated
When recheck flag is true, we make sure the merge-ref
is indeed outdated. If it is, we update it along
the merge status.
2019-06-20 14:47:34 -03: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
4246a62118 Add payload to the service response
This introduces payload to the ServiceResponse with
the merge ref HEAD commit data
2019-05-31 19:16:01 -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