Skip to content
代码片段 群组 项目
未验证 提交 414ac24c 编辑于 作者: Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre 提交者: GitLab
浏览文件

Merge branch 'kerrizor/minor-formatting-fixes-for-MR_RefreshService' into 'master'

No related branches found
No related tags found
无相关合并请求
......@@ -15,7 +15,9 @@ def refresh_merge_requests!
update_approvers_for_source_branch_merge_requests
update_approvers_for_target_branch_merge_requests
reset_approvals_for_merge_requests(push.ref, push.newrev)
trigger_suggested_reviewers_fetch
sync_any_merge_request_approval_rules
end
......@@ -31,15 +33,19 @@ def trigger_suggested_reviewers_fetch
end
def reset_approvals_for_merge_requests(ref, newrev)
# Add a flag that prevents unverified changes from getting through in the 10 second window below
# Add a flag that prevents unverified changes from getting through in the
# 10 second window below
#
merge_requests_for(push.branch_name, mr_states: [:opened, :closed]).each do |mr|
if reset_approvals?(mr, newrev)
mr.approval_state.temporarily_unapprove!
end
end
# We need to make sure the code owner approval rules have all been synced first, so we delay for 10s
# We are trying to pin down and fix the race condition: https://gitlab.com/gitlab-org/gitlab/-/issues/373846
# We need to make sure the code owner approval rules have all been synced
# first, so we delay for 10s. We are trying to pin down and fix the race
# condition: https://gitlab.com/gitlab-org/gitlab/-/issues/373846
#
MergeRequestResetApprovalsWorker.perform_in(10.seconds, project.id, current_user.id, ref, newrev)
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册