Merge status stuck in `checking` when merge request needs approval from CODEOWNERS
In gitlab-shell!565 (merged), I noticed merge_status
was stuck in checking
:
[ gprd ] production> mr.merge_status
=> "checking"
[ gprd ] production> mr.recheck_merge_status?
=> true
[ gprd ] production> mr.mergeable?
=> false
[ gprd ] production> mr.mergeable_state?
=> true
[ gprd ] production> mr.can_be_merged?
=> false
[ gprd ] production> mr.approved?
=> false
Even after a reload, it was still stuck in checking
.
I suspect the approved?
check in https://gitlab.com/gitlab-org/gitlab/blob/6020f42812e3dc09d4163488e35d9a75f20da9ff/ee/app/models/ee/merge_request.rb#L122 was blocking check_mergeability
in https://gitlab.com/gitlab-org/gitlab/blob/382c653cc88f86876bf8c8d18fc56bb2cb1c77d8/app/models/merge_request.rb#L1108 from being called.
I approved the merge request, but I'm not a CODEOWNER
.
As soon as I called check_mergeability
this worked:
[ gprd ] production> mr.check_mergeability
mr.merge=> #<ServiceResponse:0x00007fb4bb2a7098 @status=:success, @message=nil, @payload={:merge_ref_head=>{:commit_id=>"4c9e6a6b34b6ad618d654c449969e16107033ba7", :source_id=>"4c52728138b01bc037301c9260cee64692eddea7", :target_id=>"c41d2b585dfec86851821155bef33de9f8783f59"}}, @http_status=:ok>
[ gprd ] production> mr.merge_status
=> "can_be_merged"
We discussed a similar issue in #351190 (closed). !79311 (merged) is in production now, so I'm not sure why reloading the merge request didn't solve this issue.
In https://log.gprd.gitlab.net/goto/f04abf70-83e6-11ec-9dd2-93d354bef8e7, I don't see MergeRequestMergeabilityCheckWorker
run after the first instance.
/cc: @patrickbajao
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.