Fix error when duplicate users are merged in approvers list
If a user who belongs to an approval group and also is an individual in
the approval rule, MergeService
will fail in the after_merge
, which
will cause MergeWorker
to retry again. Since the merge has been
successfully merged, MergeWorker
will encounter an error since
MergeService
is not idempotent.
This change fixes the issue by using the Array |=
join method to add an
element to the Array, unless it is already present. This fixes the
immediate bug, but we will have to address the idempotency issues later.
Closes #13488 (closed)
Merge request reports
Activity
added 1 commit
- 07730b0e - Fix error when duplicate users are list in approvers list
changed milestone to %12.3
added devopscreate priority2 typebug labels
mentioned in issue #13488 (closed)
added severity2 label
added Pick into auto-deploy label
1 Warning ⚠ 6e4a4465: This commit’s subject line is acceptable, but please try to reduce it to 50 characters. Reviewer roulette
Changes that require review have been detected! A merge request is normally reviewed by both a reviewer and a maintainer in its primary category (e.g. frontend or backend), and by a maintainer in all other categories.
To spread load more evenly across eligible reviewers, Danger has randomly picked a candidate for each review slot. Feel free to override this selection if you think someone else would be better-suited, or the chosen person is unavailable.
Once you've decided who will review this merge request, mention them as you normally would! Danger does not (yet?) automatically notify them for you.
Category Reviewer Maintainer backend Oswaldo Ferreira ( @oswaldo
)Grzegorz Bizon ( @grzesiek
)Generated by
🚫 DangerEdited by 🤖 GitLab Bot 🤖mentioned in issue #32185 (closed)
added 1 commit
- 6e4a4465 - Fix error when duplicate users are merged in approvers list
mentioned in commit 404eee31
Thanks for digging into @stanhu
💯 In terms of idempotency, is there anything specific we can open an issue about ? My understanding is that different merge strategies will potentially have different issues /cc @dosuken123
removed Pick into auto-deploy label
mentioned in commit b6e377da
This merge request has been deployed to the GitLab.com environment
gstg
in GitLab auto-deploy version12.3.201909221220-b6e377daa82.9183f7201d0
.A list of all the deployed commits can be found here.
🤖 If this message is incorrect, please create an issue in the Release Tools project.added workflowstaging label
In terms of idempotency, is there anything specific we can open an issue about ? My understanding is that different merge strategies will potentially have different issues
Things off the top of my head:
-
SquashService
should check if the merge request has been merged. I think we can just checkmerge_request.merged?
, although if we really want to be thorough we would check that the merge commit contains the same diff. -
MergeService
should also check if the merge request has been merged. Right now I think we attempt to merge again (not sure what happens).
I think we might be able to flush out more if we write tests that attempt to run
MergeService
multiple times for the same merge request.-
Ironically, this merge request is showing
Merge failed: Merge request is not mergeable. Please try again.
even though it has been merged fine.@yorickpeterse We need to pick this into 12.3 as well as !17466 (merged) to fix these misleading messages. I suspect the latter merge request will fix more cases.
This merge request has been deployed to the GitLab.com environment
gprd-cny
in GitLab auto-deploy version12.3.201909221220-b6e377daa82.9183f7201d0
.A list of all the deployed commits can be found here.
🤖 If this message is incorrect, please create an issue in the Release Tools project.added workflowcanary label and removed workflowstaging label
mentioned in issue #32582 (closed)
mentioned in issue #32357 (closed)
Automatically picked into !17540 (merged), will merge into
12-3-stable-ee
ready for12.3.1-ee
.mentioned in commit 26c30d28
mentioned in merge request !17540 (merged)
This merge request has been deployed to the GitLab.com environment
gprd
in GitLab auto-deploy version12.4.201909240421-2d096e8234d.2888c83d378
.A list of all the deployed commits can be found here.
🤖 If this message is incorrect, please create an issue in the Release Tools project.added workflowproduction label and removed workflowcanary label
This merge request has been deployed to the GitLab.com environment
gstg
in GitLab auto-deploy version12.4.201910011210-d42717d3ad0.477f92dfa6a
.A list of all the deployed commits can be found here.
🤖 If this message is incorrect, please create an issue in the Release Tools project.added workflowstaging label and removed workflowproduction label
This merge request has been deployed to the GitLab.com environment
gprd-cny
in GitLab auto-deploy version12.4.201910011210-d42717d3ad0.477f92dfa6a
.A list of all the deployed commits can be found here.
🤖 If this message is incorrect, please create an issue in the Release Tools project.added workflowcanary label and removed workflowstaging label
This merge request has been deployed to the GitLab.com environment
gprd
in GitLab auto-deploy version12.4.201910021004-f79c1794977.391a41dff5a
.A list of all the deployed commits can be found here.
🤖 If this message is incorrect, please create an issue in the Release Tools project.added workflowproduction label and removed workflowcanary label
mentioned in merge request !24708 (merged)
mentioned in merge request !32456 (merged)