Skip to content

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

  1. Create a MR.
  2. Redirects to MR page and the MR widget gets stuck on "Checking if merge request can be merged.".
  3. 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):

  1. Call MergeRequest#check_mergeability(async: true) in MergeRequests::AfterCreateService when the service sets the status from preparing to unchecked. This way, we can ensure that we are updating the merge_status of a MR appropriately after it's created.
  2. Call MergeRequest#check_mergeability(async: true) in MergeRequestPollCachedWidgetEntity#merge_status so it rechecks for updated merge_status on every poll in case it was updated (e.g. changes been made on target branch and the MR merge_status needs to be re-checked). We are doing the same thing at the API level.
  3. 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.

Edited by 🤖 GitLab Bot 🤖