Mergeability check gets stuck and only updates on refresh
Summary
While @stanhu is rolling out early_prepare_for_mergeability
FF, he experienced an issue: #346667 (comment 802785320). Mergeability gets stuck on checking state and gets updated when refreshing a page.
Steps to reproduce
- Create a MR.
- Redirects to MR page and the MR widget gets stuck on "Checking if merge request can be merged.".
- Refresh the page, the status gets updated.
Example Project
What is the current bug behavior?
The MR widget gets stuck on checking state and updates on refresh. Based on XP, this happens intermittently.
What is the expected correct behavior?
The MR widget should update when it polls.
Possible fixes
As mentioned in #346667 (comment 812132895):
- Call
MergeRequest#check_mergeability(async: true)
inMergeRequests::AfterCreateService
when the service sets the status frompreparing
tounchecked
. This way, we can ensure that we are updating themerge_status
of a MR appropriately after it's created. - Call
MergeRequest#check_mergeability(async: true)
inMergeRequestPollCachedWidgetEntity#merge_status
so it rechecks for updatedmerge_status
on every poll in case it was updated (e.g. changes been made on target branch and the MRmerge_status
needs to be re-checked). We are doing the same thing at the API level. - Cleanup
check_mergeability_async_in_widget
FF as it doesn't seem to be used at all.
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.